From: David T. <mmm...@us...> - 2007-03-11 15:23:58
|
Update of /cvsroot/helpmeict/Helpdesk/system In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv11591/system Modified Files: db.php global_preferences.php lang.php security.php themes.php upgrade.0.9.2.inc.php upgrade.0.9.3.inc.php upgrade.0.9.9.inc.php upgrade.1.0.inc.php upgrade.php Log Message: getting there... Index: upgrade.0.9.3.inc.php =================================================================== RCS file: /cvsroot/helpmeict/Helpdesk/system/upgrade.0.9.3.inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** upgrade.0.9.3.inc.php 7 Feb 2007 01:20:18 -0000 1.2 --- upgrade.0.9.3.inc.php 11 Mar 2007 15:23:49 -0000 1.3 *************** *** 37,45 **** $qry['mysql'] = "ALTER TABLE tbl_Link_Categories ADD COLUMN lang char(5) DEFAULT 'en_UK' NOT NULL"; $qry['mssql'] = "ALTER TABLE tbl_Link_Categories ADD COLUMN lang char(5)"; ! if ($qry[$db->phptype] != "") { ! $res = $db->query($qry[$db->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $db->phptype . " not yet supported by the upgrade routine!<BR />\n"; --- 37,45 ---- $qry['mysql'] = "ALTER TABLE tbl_Link_Categories ADD COLUMN lang char(5) DEFAULT 'en_UK' NOT NULL"; $qry['mssql'] = "ALTER TABLE tbl_Link_Categories ADD COLUMN lang char(5)"; ! if ($qry[$helpdeskdb->phptype] != "") { ! $res = $helpdeskdb->query($qry[$helpdeskdb->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $helpdeskdb->phptype . " not yet supported by the upgrade routine!<BR />\n"; *************** *** 48,65 **** // First update all existing records with default value $qry = "UPDATE tbl_Link_Categories SET lang='en_UK'"; ! $res = $db->query($qry); if (!PEAR::isError($res)) { // PostgreSQL and MSSQL need a couple more ALTER TABLE's ! if ($db->phptype == 'pgsql' || $db->phptype == 'mssql') { // Set default value on the column $qry = "ALTER TABLE tbl_Link_Categories ALTER COLUMN lang SET DEFAULT 'en_UK'"; ! $res = $db->query($qry); if (!PEAR::isError($res)) { // Set column to not allow NULL $qry = "ALTER TABLE tbl_Link_Categories ALTER COLUMN lang SET NOT NULL"; ! $res = $db->query($qry); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; } else $output[] = $res->getMessage(); // Query failed --- 48,65 ---- // First update all existing records with default value $qry = "UPDATE tbl_Link_Categories SET lang='en_UK'"; ! $res = $helpdeskdb->query($qry); if (!PEAR::isError($res)) { // PostgreSQL and MSSQL need a couple more ALTER TABLE's ! if ($helpdeskdb->phptype == 'pgsql' || $helpdeskdb->phptype == 'mssql') { // Set default value on the column $qry = "ALTER TABLE tbl_Link_Categories ALTER COLUMN lang SET DEFAULT 'en_UK'"; ! $res = $helpdeskdb->query($qry); if (!PEAR::isError($res)) { // Set column to not allow NULL $qry = "ALTER TABLE tbl_Link_Categories ALTER COLUMN lang SET NOT NULL"; ! $res = $helpdeskdb->query($qry); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; } else $output[] = $res->getMessage(); // Query failed *************** *** 75,83 **** $qry['mysql'] = "ALTER TABLE tbl_News ADD COLUMN lang char(5) DEFAULT 'en_UK' NOT NULL"; $qry['mssql'] = "ALTER TABLE tbl_News ADD COLUMN lang char(5)"; ! if ($qry[$db->phptype] != "") { ! $res = $db->query($qry[$db->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $db->phptype . " not yet supported by the upgrade routine!<BR />\n"; --- 75,83 ---- $qry['mysql'] = "ALTER TABLE tbl_News ADD COLUMN lang char(5) DEFAULT 'en_UK' NOT NULL"; $qry['mssql'] = "ALTER TABLE tbl_News ADD COLUMN lang char(5)"; ! if ($qry[$helpdeskdb->phptype] != "") { ! $res = $helpdeskdb->query($qry[$helpdeskdb->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $helpdeskdb->phptype . " not yet supported by the upgrade routine!<BR />\n"; *************** *** 86,103 **** // First update all existing records with default value $qry = "UPDATE tbl_News SET lang='en_UK'"; ! $res = $db->query($qry); if (!PEAR::isError($res)) { // PostgreSQL and MSSQL need a couple more ALTER TABLE's ! if ($db->phptype == 'pgsql' || $db->phptype == 'mssql') { // Set default value on the column $qry = "ALTER TABLE tbl_News ALTER COLUMN lang SET DEFAULT 'en_UK'"; ! $res = $db->query($qry); if (!PEAR::isError($res)) { // Set column to not allow NULL $qry = "ALTER TABLE tbl_News ALTER COLUMN lang SET NOT NULL"; ! $res = $db->query($qry); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; } else $output[] = $res->getMessage(); // Query failed --- 86,103 ---- // First update all existing records with default value $qry = "UPDATE tbl_News SET lang='en_UK'"; ! $res = $helpdeskdb->query($qry); if (!PEAR::isError($res)) { // PostgreSQL and MSSQL need a couple more ALTER TABLE's ! if ($helpdeskdb->phptype == 'pgsql' || $helpdeskdb->phptype == 'mssql') { // Set default value on the column $qry = "ALTER TABLE tbl_News ALTER COLUMN lang SET DEFAULT 'en_UK'"; ! $res = $helpdeskdb->query($qry); if (!PEAR::isError($res)) { // Set column to not allow NULL $qry = "ALTER TABLE tbl_News ALTER COLUMN lang SET NOT NULL"; ! $res = $helpdeskdb->query($qry); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; } else $output[] = $res->getMessage(); // Query failed *************** *** 113,130 **** $qry['mysql'] = "ALTER TABLE tbl_News ADD COLUMN domain_id int(4)"; $qry['mssql'] = "ALTER TABLE tbl_News ADD COLUMN domain_id int4"; ! if ($qry[$db->phptype] != "") { ! $res = $db->query($qry[$db->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $db->phptype . " not yet supported by the upgrade routine!<BR />\n"; // For PostgreSQL and MSSQL we need to set default value to NULL (not needed for MySQL) ! if ($db->phptype == 'pgsql' || $db->phptype == 'mssql') { // Set default value for new 'domain_id' column in tbl_News $output[] = "Setting default value for 'domain_id' column in tbl_News ....... "; $qry = "ALTER TABLE tbl_News ALTER COLUMN domain_id SET DEFAULT NULL"; ! $res = $db->query($qry); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; } --- 113,130 ---- $qry['mysql'] = "ALTER TABLE tbl_News ADD COLUMN domain_id int(4)"; $qry['mssql'] = "ALTER TABLE tbl_News ADD COLUMN domain_id int4"; ! if ($qry[$helpdeskdb->phptype] != "") { ! $res = $helpdeskdb->query($qry[$helpdeskdb->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $helpdeskdb->phptype . " not yet supported by the upgrade routine!<BR />\n"; // For PostgreSQL and MSSQL we need to set default value to NULL (not needed for MySQL) ! if ($helpdeskdb->phptype == 'pgsql' || $helpdeskdb->phptype == 'mssql') { // Set default value for new 'domain_id' column in tbl_News $output[] = "Setting default value for 'domain_id' column in tbl_News ....... "; $qry = "ALTER TABLE tbl_News ALTER COLUMN domain_id SET DEFAULT NULL"; ! $res = $helpdeskdb->query($qry); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; } *************** *** 134,142 **** $output[] = "Re-fill tbl_News with data after adding column....... "; $qry = "SELECT id, notice FROM tbl_Domains"; ! $data =& $db->getAll($qry); foreach ($data as $row) { $qry = "INSERT INTO tbl_News (domain_id, content, frontpagepara) VALUES (" . $row['id'] . ", '" . $row['notice'] . "', '3')"; ! $res = $db->query($qry); if (PEAR::isError($res)) break; }; --- 134,142 ---- $output[] = "Re-fill tbl_News with data after adding column....... "; $qry = "SELECT id, notice FROM tbl_Domains"; ! $data =& $helpdeskdb->getAll($qry); foreach ($data as $row) { $qry = "INSERT INTO tbl_News (domain_id, content, frontpagepara) VALUES (" . $row['id'] . ", '" . $row['notice'] . "', '3')"; ! $res = $helpdeskdb->query($qry); if (PEAR::isError($res)) break; }; Index: db.php =================================================================== RCS file: /cvsroot/helpmeict/Helpdesk/system/db.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** db.php 7 Feb 2007 01:20:17 -0000 1.2 --- db.php 11 Mar 2007 15:23:48 -0000 1.3 *************** *** 57,70 **** // Connect to database ! $db =& DB::connect($conf_db['dsn'], $conf_db['options']); ! if (PEAR::isError($db)) { ! die($db->getMessage()); } // Define fetchmode to be an associative array ! $db->setFetchMode(DB_FETCHMODE_ASSOC); ! ! ! /* --- 57,68 ---- // Connect to database ! global $helpdeskdb; ! $helpdeskdb =& DB::connect($conf_db['dsn'], $conf_db['options']); ! if (PEAR::isError($helpdeskdb)) { ! die($helpdeskdb->getMessage()); } // Define fetchmode to be an associative array ! $helpdeskdb->setFetchMode(DB_FETCHMODE_ASSOC); /* *************** *** 85,91 **** { // Access database connection object ! global $db; ! // Query database ! $data =& $db->getAll(filter_sql($sql)); // Check that result is not an error --- 83,89 ---- { // Access database connection object ! global $helpdeskdb; ! // Query database ! $data =& $helpdeskdb->getAll(filter_sql($sql)); // Check that result is not an error *************** *** 120,126 **** { // Access database connection object ! global $db; // Query database ! $data =& $db->query(filter_sql($sql)); // Check that result is not an error --- 118,124 ---- { // Access database connection object ! global $helpdeskdb; // Query database ! $data =& $helpdeskdb->query(filter_sql($sql)); // Check that result is not an error *************** *** 153,159 **** { // Access database connection object ! global $db; // Get next id ! $id = $db->nextId($sequence); // Check that result is not an error if (PEAR::isError($id)) --- 151,157 ---- { // Access database connection object ! global $helpdeskdb; // Get next id ! $id = $helpdeskdb->nextId($sequence); // Check that result is not an error if (PEAR::isError($id)) Index: upgrade.php =================================================================== RCS file: /cvsroot/helpmeict/Helpdesk/system/upgrade.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** upgrade.php 7 Feb 2007 01:20:18 -0000 1.2 --- upgrade.php 11 Mar 2007 15:23:49 -0000 1.3 *************** *** 37,44 **** function rebuild_sequence($table, $field, $sequence) { ! global $db; // Find current value to synchronize sequence to ! $id =& $db->getOne("SELECT $field FROM $table ORDER BY $field DESC LIMIT 1"); // Check that result is not an error --- 37,44 ---- function rebuild_sequence($table, $field, $sequence) { ! global $helpdeskdb; // Find current value to synchronize sequence to ! $id =& $helpdeskdb->getOne("SELECT $field FROM $table ORDER BY $field DESC LIMIT 1"); // Check that result is not an error *************** *** 46,53 **** // Drop existing sequence (if it exists, otherwise ignore error and continue) ! $res = $db->dropSequence($sequence); // Rebuild sequence ! while ($db->nextId($sequence) < $id) ; --- 46,53 ---- // Drop existing sequence (if it exists, otherwise ignore error and continue) ! $res = $helpdeskdb->dropSequence($sequence); // Rebuild sequence ! while ($helpdeskdb->nextId($sequence) < $id) ; *************** *** 60,65 **** { // Update version field ! global $db; ! $res = $db->query("UPDATE tbl_System_Preferences SET value='$newversion' WHERE identifier='version'"); return $res; } --- 60,65 ---- { // Update version field ! global $helpdeskdb; ! $res = $helpdeskdb->query("UPDATE tbl_System_Preferences SET value='$newversion' WHERE identifier='version'"); return $res; } *************** *** 70,74 **** // Only continue for supported database backends ! if (in_array($db->phptype, $DBMS)) { // Determine version to upgrade to --- 70,74 ---- // Only continue for supported database backends ! if (in_array($helpdeskdb->phptype, $DBMS)) { // Determine version to upgrade to *************** *** 175,179 **** // Database backend not supported by upgrade routine, abort upgrade! $output[] = "<div class=\"maindark\"> ! <p>ERROR: Database system " . $db->phptype . " not yet supported by upgrade routine, aborting upgrade.</p>"; } --- 175,179 ---- // Database backend not supported by upgrade routine, abort upgrade! $output[] = "<div class=\"maindark\"> ! <p>ERROR: Database system " . $helpdeskdb->phptype . " not yet supported by upgrade routine, aborting upgrade.</p>"; } Index: themes.php =================================================================== RCS file: /cvsroot/helpmeict/Helpdesk/system/themes.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** themes.php 7 Feb 2007 01:20:18 -0000 1.2 --- themes.php 11 Mar 2007 15:23:48 -0000 1.3 *************** *** 48,54 **** // Ensure access to language and configuration global $_lang, $conf; - // First try your chosen language $theme = $conf['theme_dir']."/".$conf['default_theme']."/".$theme_file; if (!file_exists($theme)) { // Then try the system wide fallback languae --- 48,54 ---- // Ensure access to language and configuration global $_lang, $conf; // First try your chosen language $theme = $conf['theme_dir']."/".$conf['default_theme']."/".$theme_file; + if (!file_exists($theme)) { // Then try the system wide fallback languae Index: global_preferences.php =================================================================== RCS file: /cvsroot/helpmeict/Helpdesk/system/global_preferences.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** global_preferences.php 7 Feb 2007 01:20:17 -0000 1.2 --- global_preferences.php 11 Mar 2007 15:23:48 -0000 1.3 *************** *** 38,41 **** --- 38,43 ---- */ + require_once 'system/db.php'; + // Ensure this is called from within the index.php file (for security) if (strpos($_SERVER["SCRIPT_NAME"], basename(__FILE__, '.php')) !== false) { *************** *** 45,48 **** --- 47,51 ---- // Create an associative array and populate it with the system preferences $result = db_recordset("SELECT * FROM tbl_System_Preferences"); + global $global_prefs; $global_prefs = Array(); foreach ($result as $pref) { Index: upgrade.0.9.2.inc.php =================================================================== RCS file: /cvsroot/helpmeict/Helpdesk/system/upgrade.0.9.2.inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** upgrade.0.9.2.inc.php 7 Feb 2007 01:20:18 -0000 1.2 --- upgrade.0.9.2.inc.php 11 Mar 2007 15:23:49 -0000 1.3 *************** *** 37,45 **** $qry['mysql'] = "ALTER TABLE tbl_Users CHANGE user username VARCHAR(20) NOT NULL DEFAULT \"\""; $qry['mssql'] = "ALTER TABLE tbl_Users RENAME COLUMN \"user\" TO username"; ! if ($qry[$db->phptype] != "") { ! $res = $db->query($qry[$db->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $db->phptype . " not yet supported by the upgrade routine!<BR />\n"; --- 37,45 ---- $qry['mysql'] = "ALTER TABLE tbl_Users CHANGE user username VARCHAR(20) NOT NULL DEFAULT \"\""; $qry['mssql'] = "ALTER TABLE tbl_Users RENAME COLUMN \"user\" TO username"; ! if ($qry[$helpdeskdb->phptype] != "") { ! $res = $helpdeskdb->query($qry[$helpdeskdb->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $helpdeskdb->phptype . " not yet supported by the upgrade routine!<BR />\n"; *************** *** 49,57 **** $qry['mysql'] = "ALTER TABLE tbl_UserSites CHANGE user userid INT(4) NOT NULL DEFAULT 0"; $qry['mssql'] = "ALTER TABLE tbl_UserSites RENAME COLUMN \"user\" TO userid"; ! if ($qry[$db->phptype] != "") { ! $res = $db->query($qry[$db->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $db->phptype . " not yet supported by the upgrade routine!<BR />\n"; --- 49,57 ---- $qry['mysql'] = "ALTER TABLE tbl_UserSites CHANGE user userid INT(4) NOT NULL DEFAULT 0"; $qry['mssql'] = "ALTER TABLE tbl_UserSites RENAME COLUMN \"user\" TO userid"; ! if ($qry[$helpdeskdb->phptype] != "") { ! $res = $helpdeskdb->query($qry[$helpdeskdb->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $helpdeskdb->phptype . " not yet supported by the upgrade routine!<BR />\n"; *************** *** 61,69 **** $qry['mysql'] = "ALTER TABLE tbl_UserDomains CHANGE user userid INT(4) NOT NULL DEFAULT 0"; $qry['mssql'] = "ALTER TABLE tbl_UserDomains RENAME COLUMN \"user\" TO userid"; ! if ($qry[$db->phptype] != "") { ! $res = $db->query($qry[$db->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $db->phptype . " not yet supported by the upgrade routine!<BR />\n"; --- 61,69 ---- $qry['mysql'] = "ALTER TABLE tbl_UserDomains CHANGE user userid INT(4) NOT NULL DEFAULT 0"; $qry['mssql'] = "ALTER TABLE tbl_UserDomains RENAME COLUMN \"user\" TO userid"; ! if ($qry[$helpdeskdb->phptype] != "") { ! $res = $helpdeskdb->query($qry[$helpdeskdb->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $helpdeskdb->phptype . " not yet supported by the upgrade routine!<BR />\n"; *************** *** 73,81 **** $qry['mysql'] = "ALTER TABLE tbl_Logs CHANGE user userid INT(4) NOT NULL DEFAULT 0"; $qry['mssql'] = "ALTER TABLE tbl_Logs RENAME COLUMN \"user\" TO userid"; ! if ($qry[$db->phptype] != "") { ! $res = $db->query($qry[$db->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $db->phptype . " not yet supported by the upgrade routine!<BR />\n"; --- 73,81 ---- $qry['mysql'] = "ALTER TABLE tbl_Logs CHANGE user userid INT(4) NOT NULL DEFAULT 0"; $qry['mssql'] = "ALTER TABLE tbl_Logs RENAME COLUMN \"user\" TO userid"; ! if ($qry[$helpdeskdb->phptype] != "") { ! $res = $helpdeskdb->query($qry[$helpdeskdb->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $helpdeskdb->phptype . " not yet supported by the upgrade routine!<BR />\n"; *************** *** 85,93 **** $qry['mysql'] = "ALTER TABLE tbl_Times CHANGE user userid INT(4) NOT NULL DEFAULT 0"; $qry['mssql'] = "ALTER TABLE tbl_Times RENAME COLUMN \"user\" TO userid"; ! if ($qry[$db->phptype] != "") { ! $res = $db->query($qry[$db->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $db->phptype . " not yet supported by the upgrade routine!<BR />\n"; --- 85,93 ---- $qry['mysql'] = "ALTER TABLE tbl_Times CHANGE user userid INT(4) NOT NULL DEFAULT 0"; $qry['mssql'] = "ALTER TABLE tbl_Times RENAME COLUMN \"user\" TO userid"; ! if ($qry[$helpdeskdb->phptype] != "") { ! $res = $helpdeskdb->query($qry[$helpdeskdb->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $helpdeskdb->phptype . " not yet supported by the upgrade routine!<BR />\n"; *************** *** 97,105 **** $qry['mysql'] = "ALTER TABLE tbl_EmailConfirmation CHANGE user userid INT(4) NOT NULL DEFAULT 0"; $qry['mssql'] = "ALTER TABLE tbl_EmailConfirmation RENAME COLUMN \"user\" TO userid"; ! if ($qry[$db->phptype] != "") { ! $res = $db->query($qry[$db->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $db->phptype . " not yet supported by the upgrade routine!<BR />\n"; --- 97,105 ---- $qry['mysql'] = "ALTER TABLE tbl_EmailConfirmation CHANGE user userid INT(4) NOT NULL DEFAULT 0"; $qry['mssql'] = "ALTER TABLE tbl_EmailConfirmation RENAME COLUMN \"user\" TO userid"; ! if ($qry[$helpdeskdb->phptype] != "") { ! $res = $helpdeskdb->query($qry[$helpdeskdb->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $helpdeskdb->phptype . " not yet supported by the upgrade routine!<BR />\n"; *************** *** 109,117 **** $qry['mysql'] = "ALTER TABLE tbl_User_Preferences CHANGE user userid INT(4) NOT NULL DEFAULT 0"; $qry['mssql'] = "ALTER TABLE tbl_User_Preferences RENAME COLUMN \"user\" TO userid"; ! if ($qry[$db->phptype] != "") { ! $res = $db->query($qry[$db->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $db->phptype . " not yet supported by the upgrade routine!<BR />\n"; ?> --- 109,117 ---- $qry['mysql'] = "ALTER TABLE tbl_User_Preferences CHANGE user userid INT(4) NOT NULL DEFAULT 0"; $qry['mssql'] = "ALTER TABLE tbl_User_Preferences RENAME COLUMN \"user\" TO userid"; ! if ($qry[$helpdeskdb->phptype] != "") { ! $res = $helpdeskdb->query($qry[$helpdeskdb->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $helpdeskdb->phptype . " not yet supported by the upgrade routine!<BR />\n"; ?> Index: upgrade.1.0.inc.php =================================================================== RCS file: /cvsroot/helpmeict/Helpdesk/system/upgrade.1.0.inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** upgrade.1.0.inc.php 7 Feb 2007 01:20:18 -0000 1.2 --- upgrade.1.0.inc.php 11 Mar 2007 15:23:49 -0000 1.3 *************** *** 40,48 **** );"; $qry['mssql'] = ""; ! if ($qry[$db->phptype] != "") { ! $res = $db->query($qry[$db->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $db->phptype . " not yet supported by the upgrade routine!<BR />\n"; ?> --- 40,48 ---- );"; $qry['mssql'] = ""; ! if ($qry[$helpdeskdb->phptype] != "") { ! $res = $helpdeskdb->query($qry[$helpdeskdb->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $helpdeskdb->phptype . " not yet supported by the upgrade routine!<BR />\n"; ?> Index: upgrade.0.9.9.inc.php =================================================================== RCS file: /cvsroot/helpmeict/Helpdesk/system/upgrade.0.9.9.inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** upgrade.0.9.9.inc.php 7 Feb 2007 01:20:18 -0000 1.2 --- upgrade.0.9.9.inc.php 11 Mar 2007 15:23:49 -0000 1.3 *************** *** 54,62 **** ); "; ! if ($qry[$db->phptype] != "") { ! $res = $db->query($qry[$db->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $db->phptype . " not yet supported by the upgrade routine!<BR />\n"; --- 54,62 ---- ); "; ! if ($qry[$helpdeskdb->phptype] != "") { ! $res = $helpdeskdb->query($qry[$helpdeskdb->phptype]); $output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<BR />\n"; ! } else $output[] = "ERROR: DBMS " . $helpdeskdb->phptype . " not yet supported by the upgrade routine!<BR />\n"; *************** *** 69,73 **** 'Turn on usage of Timer', '0'); "; ! $res = $db->query($qry); if (!PEAR::isError($res)) { --- 69,73 ---- 'Turn on usage of Timer', '0'); "; ! $res = $helpdeskdb->query($qry); if (!PEAR::isError($res)) { *************** *** 83,87 **** VALUES ('wrk-timer', 'true'); "; ! $res = $db->query($qry); if (!PEAR::isError($res)) { --- 83,87 ---- VALUES ('wrk-timer', 'true'); "; ! $res = $helpdeskdb->query($qry); if (!PEAR::isError($res)) { Index: security.php =================================================================== RCS file: /cvsroot/helpmeict/Helpdesk/system/security.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** security.php 7 Feb 2007 01:47:41 -0000 1.3 --- security.php 11 Mar 2007 15:23:48 -0000 1.4 *************** *** 27,34 **** */ - require_once "system/lang.php"; - // Deny a user access, and display the login sidebar function ThrowOut() { $redirect = $_SERVER["REQUEST_URI"]; $ptitle = 'Access Error'; --- 27,33 ---- */ // Deny a user access, and display the login sidebar function ThrowOut() { + global $helpdeskdb, $_lang, $conf; $redirect = $_SERVER["REQUEST_URI"]; $ptitle = 'Access Error'; *************** *** 38,46 **** // Deny access to a user - use after sidebar has been displayed ! function AccessDenied() { // Set Language set_text_domain("security"); ! print "<<h1>".gettext("Access Error")."</h1>\n"; print "<h2>".gettext("Either you do not have permission to access this page or you are not currently logged in.")."</h2>\n"; print "<div class=\"block\" align=\"center\"><p>".gettext("Please choose another option or log in as a user who does have permission to access the page.")."</p></div>"; --- 37,46 ---- // Deny access to a user - use after sidebar has been displayed ! function AccessDenied() { ! global $helpdeskdb; // Set Language set_text_domain("security"); ! print "<h1>".gettext("Access Error")."</h1>\n"; print "<h2>".gettext("Either you do not have permission to access this page or you are not currently logged in.")."</h2>\n"; print "<div class=\"block\" align=\"center\"><p>".gettext("Please choose another option or log in as a user who does have permission to access the page.")."</p></div>"; Index: lang.php =================================================================== RCS file: /cvsroot/helpmeict/Helpdesk/system/lang.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** lang.php 7 Feb 2007 01:20:17 -0000 1.2 --- lang.php 11 Mar 2007 15:23:48 -0000 1.3 *************** *** 38,41 **** --- 38,42 ---- // Set language code to system wide default + global $_lang; $_lang = $conf['default_lang']; if ($_SESSION['_id']) { |