From: Don S. <ri...@us...> - 2004-09-13 18:23:19
|
Update of /cvsroot/phpwsbb/phpwsbb/boost In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18180/boost Modified Files: update.php Log Message: Need to make sure Manager is in session Index: update.php =================================================================== RCS file: /cvsroot/phpwsbb/phpwsbb/boost/update.php,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** update.php 13 Sep 2004 16:07:18 -0000 1.37 --- update.php 13 Sep 2004 18:23:09 -0000 1.38 *************** *** 37,43 **** // Load needed classes ! require_once(PHPWS_SOURCE_DIR . "mod/phpwsbb/class/Forum.php"); ! require_once(PHPWS_SOURCE_DIR . "mod/phpwsbb/class/Thread.php"); ! require_once(PHPWS_SOURCE_DIR . "mod/phpwsbb/class/Message.php"); // Load help information --- 37,41 ---- // Load needed classes ! require_once(PHPWS_SOURCE_DIR . "mod/phpwsbb/class/Manager.php"); // Load help information *************** *** 53,56 **** --- 51,58 ---- $status = 1; + // This might not exist during update + if (!isset($_SESSION["PHPWSBB_Manager"])) + $_SESSION["PHPWSBB_Manager"] = new PHPWSBB_Manager; + if(version_compare($currentVersion, "0.4.0") < 0) { if ($status = $GLOBALS["core"]->sqlImport(PHPWS_SOURCE_DIR . "mod/phpwsbb/boost/update040.sql", TRUE)) { *************** *** 248,253 **** --- 250,257 ---- if($status = $GLOBALS['core']->query('ALTER TABLE mod_phpwsbb_messages ADD owner_id int NOT NULL default 0 AFTER owner', TRUE) && $status = $GLOBALS['core']->sqlCreateIndex('mod_phpwsbb_messages',array('owner_id'))) { + /* Make a list of names and message ids of all message contributors */ $msg_list = $name_list = array(); + $result = $GLOBALS['core']->query('SELECT id,owner from mod_phpwsbb_messages WHERE owner IS NOT NULL', true); while ($result && $row = $result->fetchrow(DB_FETCHMODE_ASSOC)) { *************** *** 257,260 **** --- 261,265 ---- } unset($result); + /* Make a list of all user ids for the users in the last list */ $result = $GLOBALS['core']->query('SELECT username,user_id from mod_users WHERE username IN ("' . implode('","', $name_list) .'")', true); *************** *** 262,265 **** --- 267,271 ---- $name_tbl[$row['username']] = $row['user_id']; unset($result); + /* Update user id information for all messages submitted by each user */ if (count($msg_list) && count($name_list)) { |