X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=update.cgi;h=e526026ea161c20de92c8dc683c54bdb43849bd9;hb=214597ca66e06fdaa18bcb38429bed3a10ab2962;hp=ddb8052be31984a74df35d58128d01b357e2fc4f;hpb=2833afc99423e6cc0abe0fa6d0fafbf9275c8f2d;p=mirror%2Fuserdir-ldap-cgi.git diff --git a/update.cgi b/update.cgi index ddb8052..e526026 100755 --- a/update.cgi +++ b/update.cgi @@ -3,6 +3,7 @@ # $Id: update.cgi,v 1.13 2006/12/28 02:44:02 rmurray Exp $ # (c) 1999 Randolph Chung. Licensed under the GPL. # (c) 2006 Ryan Murray. Licensed under the GPL. +# Copyright (c) 2008, 2011, 2012, 2014, 2015 Peter Palfrader use lib '.'; use strict vars; @@ -25,8 +26,16 @@ my $proto = ($ENV{HTTPS} ? "https" : "http"); my $id = $query->param('id'); my $authtoken = $query->param('authtoken'); -my $password = &Util::CheckAuthToken($authtoken); -my $editdn = $query->param('editdn'); + +my $password = undef; + +if ($authtoken || $id) { + $password = Util::TouchAuthToken($authtoken, $id); +} else { + $password = ''; + $id = ''; + $authtoken = ''; +} if ($proto eq "http" || !($id && $password)) { print "Location: https://$ENV{SERVER_NAME}/$config{webloginhtml}\n\n"; @@ -45,6 +54,7 @@ sub DieHandler { } #$SIG{__DIE__} = \&DieHandler; +my $editdn = "uid=$id,$config{basedn}"; $ldap = Net::LDAP->new($config{ldaphost}); &Util::UpgradeConnection($ldap) unless $config{usessl} eq 'False'; @@ -173,7 +183,7 @@ if (!($query->param('doupdate'))) { } }; if ($confirmstring ne '') { - $confirmstring = "
To confirm your new sudo passwords send signed mail to changes\@db.debian.org with a signed body containing these lines:
$confirmstring
"; + $confirmstring = "
To confirm your new sudo passwords send signed mail to changes\@$config{maildomain} with a signed body containing these lines:
$confirmstring
"; } my $sudopasswordhosts = '