[geeklog-cvs] geeklog: Fixed 1.7.2 upgrade script broken by password_update

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Mar 3 18:39:28 EST 2012


changeset 8503:c97fbefa9829
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/c97fbefa9829
user: vinny
date: Sat Mar 03 16:39:18 2012 -0700
description:
Fixed 1.7.2 upgrade script broken by password_update

diffstat:

 sql/updates/mysql_1.7.2_to_1.8.0.php |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 245755bb01df -r c97fbefa9829 sql/updates/mysql_1.7.2_to_1.8.0.php
--- a/sql/updates/mysql_1.7.2_to_1.8.0.php	Fri Mar 02 22:45:43 2012 +0100
+++ b/sql/updates/mysql_1.7.2_to_1.8.0.php	Sat Mar 03 16:39:18 2012 -0700
@@ -70,7 +70,6 @@
     global $_CONF, $_TABLES;
 
     require_once $_CONF['path_system'] . 'lib-security.php';
-    require_once $_CONF['path_system'] . 'lib-user.php';
 
     $passwords = array();
     
@@ -81,8 +80,16 @@
     for($i = 0; $i < $nrows; $i++) {
         $A = DB_fetchArray($result);
         
-        $passwd = null;
-        SEC_updateUserPassword($passwd, $A['uid']);
+	{  /* Formerlly USER_changePassword */
+		$passwd['normal'] = rand ();
+		$passwd['normal'] = md5 ($passwd['normal']);
+		$passwd['normal'] = substr ($passwd['normal'], 1, 8);
+		$passwd['encrypted'] = SEC_encryptPassword($passwd['normal'], '', HashFunction::md5, 1); /* use default md5 only */
+		if ($A['uid'] > 1) { 
+			DB_change ($_TABLES['users'], 'passwd', $passwd['encrypted'], 'uid', $A['uid']);
+		}
+	}
+
     }    
 
 }



More information about the geeklog-cvs mailing list