[SUCS Devel] [Git][sucssite/sucs-site][sha512-passwords] [components/options.php] Update changePassword() to use new password hash

Imran Hussain (@imranh) imranh at sucs.org
Thu Dec 23 11:34:28 GMT 2021



Imran Hussain pushed to branch sha512-passwords at sucssite / sucs-site


Commits:
7ed6ab5b by Imran Hussain at 2021-12-23T11:34:26+00:00
[components/options.php] Update changePassword() to use new password hash
- - - - -


1 changed file:

- components/options.php


Changes:

=====================================
components/options.php
=====================================
@@ -5,6 +5,8 @@ require_once("../lib/validation.php");
 require_once("Net/MAC.php");
 include_once("../lib/date.php");
 
+// password hash, renewal functions
+include_once("../lib/member_functions.php");
 
 // Some Constants
 // These could possibly be moved somewhere saner?
@@ -47,7 +49,7 @@ function changePassword($oldpass, $newpass1, $newpass2)
 
     // if everything looks OK, attempt to make the change
     $success = ldap_mod_replace($ldap, "uid=" . $session->username . ",ou=People,dc=sucs,dc=org",
-        array('userpassword' => "{SHA}" . base64_encode(pack("H*", sha1($newpass1)))));
+        array('userpassword' => "{CRYPT}" . cryptPassword($newpass1));
 
     ldap_close($ldap);
     return $success;
@@ -214,7 +216,6 @@ function updateRenew()
         return FALSE;
     }
 
-    include_once("../lib/member_functions.php");
     renew_membership($member['username']);
     $sucsDB->Execute("update signup set activated=NOW(), username=? where id=?", array($member['username'], $signup['id']));
     return TRUE;



View it on GitLab: https://projects.sucs.org/sucssite/sucs-site/-/commit/7ed6ab5b46b2802e03af5bf5c28ed1f1e721491b

-- 
View it on GitLab: https://projects.sucs.org/sucssite/sucs-site/-/commit/7ed6ab5b46b2802e03af5bf5c28ed1f1e721491b
You're receiving this email because of your account on projects.sucs.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/devel/attachments/20211223/ff6f38be/attachment-0001.html>


More information about the Devel mailing list