[Home]WikiPatches/LoginWithId

UseModWiki | WikiPatches | RecentChanges | Preferences

See also LoginRework

I frequently clear out existing cookies. Whenever I want to edit a Wiki page and have the changes attributed to me, I have to log into the Wiki. This means I have to remember my user ID. This can be a pain, since I have several Wikis I use. So, I've modified the "login" action on my Wiki to allow an ID to be sent:

..../cgi-bin/wiki.pl?action=login&id=2684

This allows me to create a bookmark in my browser, so my browser will remember my ID.


The standard script provides this possibility already by using ..../cgi-bin/wiki.pl?action=login&p_userid=2684 so we don't have to change anything here. You even could include the line

 Login http://yourwiki/cgi-bin/wiki.pl?action=login&p_userid=

in your intermap to easily create your personal login like "Login:2684". I did so at MeatBall:DavidAndel thanks to the MeatBall:PublicallyEditableInterMap.


The modifications to the script are quite trivial (line numbers are based on the original wiki.pl v0.92):

2472c2472
<       &DoEnterLogin();
---
>       &DoEnterLogin($id);
2933a2934
>   my ($uid ) = @_;
2938c2939
<         $q->textfield(-name=>'p_userid', -value=>'',
---
>         $q->textfield(-name=>'p_userid', -value=>$uid,

The first change is in the DoOtherRequest subroutine, and the second is in the DoEnterLogin subroutine.

Of course, this is really a work-around for not being able to log in by user name - I'm not proficient enough with Perl to be able to make that kind of change, though :-) -- JimHyslop

Maybe /LoginLogoutPatch is the solution for you?


With context:

sub DoOtherRequest {
...
} elsif ($action eq "login") {
  &DoEnterLogin($id);

sub DoEnterLogin {
  my ($uid ) = @_;
...
#  $q->textfield(-name=>'p_userid', -value=>'',
  $q->textfield(-name=>'p_userid', -value=>$uid,

UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited January 28, 2008 11:15 pm by JuanmaMP (diff)
Search: