X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap-cgi.git;a=blobdiff_plain;f=update.cgi;h=c4d121de6972a32bf34000584fd3e1be64ba5a00;hp=36631697b96dc5b7fa50aef740b57666034fa39e;hb=bb937c32bd6f82064c59c56ef4dc718deb7b581e;hpb=d7b018a2e8aa309a6fe581c331cbe1d475a3ccef diff --git a/update.cgi b/update.cgi index 3663169..c4d121d 100755 --- a/update.cgi +++ b/update.cgi @@ -10,11 +10,13 @@ use strict vars; use CGI; use Data::UUID; use Digest::HMAC_SHA1 qw(hmac_sha1_hex); +use Digest::MD5 qw(md5_hex); use Util; use English; use URI::Escape; use Crypt::PasswdMD5; use Net::LDAP qw(LDAP_SUCCESS LDAP_PROTOCOL_ERROR); +use Net::LDAP::Util qw(ldap_explode_dn); my %config = &Util::ReadConfigFile; @@ -264,7 +266,7 @@ if (!($query->param('doupdate'))) { &Util::HTMLError("Password check failed for voip-password: $msg. Please go back and try again."); } # create a md5 crypted password - $newvoippassword = '{crypt}'.crypt($query->param('newpass'), &Util::CreateCryptSalt(1)); + $newvoippassword = &md5_hex( ldap_explode_dn($editid)->[0]{UID} . '@debian.org:sip.debian.org:' . $query->param('newvoippass') ); &Util::LDAPUpdate($ldap, $editdn, 'voipPassword', $newvoippassword); }