Changeset 259 for trunk


Ignore:
Timestamp:
06/13/05 16:33:16 (20 years ago)
Author:
Kris Deugau
Message:

/trunk

Modify add user capability in admin.cgi to allow a
pre-encrypted password to be used.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/admin.cgi

    r258 r259  
    281281        "<hr>Add new user:<form action=admin.cgi method=POST>\n".
    282282        "Username: <input name=username><br>\n".
    283         "Password: <input name=password><br>\n".
     283        "Password: <input name=password> <input type=checkbox name=preenc>Password is pre-encrypted (MUST be crypt() encrypted)<br>\n".
    284284        "<input type=submit value='Add user'><input type=hidden name=action value=newuser></form>\n";
    285285
     
    326326} elsif ($webvar{action} eq 'newuser') {
    327327  print "Adding user $webvar{username}...\n";
    328   my $cr_pass = crypt $webvar{password},
    329         join('',('.','/',0..9,'A'..'Z','a'..'z')[rand 64, rand 64]);
     328  my $cr_pass = ($webvar{preenc} ? $webvar{password} :
     329        crypt $webvar{password}, join('',('.','/',0..9,'A'..'Z','a'..'z')[rand 64, rand 64]));
    330330  $sth = $ip_dbh->prepare("insert into users (username,password,acl) values ".
    331331        "('$webvar{username}','$cr_pass','b')");
Note: See TracChangeset for help on using the changeset viewer.