|
From: Scott P. <wht...@us...> - 2007-09-30 20:13:47
|
Update of /cvsroot/helpmeict/Helpdesk/system
In directory sc8-pr-cvs17:/tmp/cvs-serv3370/system
Modified Files:
authentication.php upgrade.1.0.inc.php
Log Message:
Fix db calls for MySQL case sensitivity
Index: upgrade.1.0.inc.php
===================================================================
RCS file: /cvsroot/helpmeict/Helpdesk/system/upgrade.1.0.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** upgrade.1.0.inc.php 30 Sep 2007 17:18:32 -0000 1.4
--- upgrade.1.0.inc.php 30 Sep 2007 20:13:43 -0000 1.5
***************
*** 33,39 ****
// Add 'ldap' column to table tbl_users
$output[] = "Adding ldap column to table 'tbl_users' ....... ";
! $qry['pgsql'] = "ALTER TABLE tbl_users ADD COLUMN ldap smallint";
! $qry['mysql'] = "ALTER TABLE tbl_users ADD COLUMN smallint DEFAULT '0' NOT NULL";
! $qry['mssql'] = "ALTER TABLE tbl_users ADD COLUMN smallint";
if ($qry[$helpdeskdb->phptype] != "") {
$res = $helpdeskdb->query($qry[$helpdeskdb->phptype]);
--- 33,39 ----
// Add 'ldap' column to table tbl_users
$output[] = "Adding ldap column to table 'tbl_users' ....... ";
! $qry['pgsql'] = "ALTER TABLE tbl_Users ADD COLUMN ldap smallint";
! $qry['mysql'] = "ALTER TABLE tbl_Users ADD COLUMN ldap smallint DEFAULT '0' NOT NULL";
! $qry['mssql'] = "ALTER TABLE tbl_Users ADD COLUMN ldap smallint";
if ($qry[$helpdeskdb->phptype] != "") {
$res = $helpdeskdb->query($qry[$helpdeskdb->phptype]);
***************
*** 46,59 ****
// Set default value for new 'ldap' column in tbl_users
$output[] = "Setting default value for 'ldap' column in tbl_users ....... ";
! $qry = "UPDATE tbl_users SET ldap='0'";
$res = $helpdeskdb->query($qry);
if (!PEAR::isError($res)) {
//PostgreSQL and MSSQL need a couple of more ALTER TABLE's
if ($helpdeskdb->phptype == 'pgsql' || $helpdesk->phptype =='mssql') {
! $qry = "ALTER TABLE tbl_users ALTER COLUMN ldap SET DEFAULT '0'";
$res = $helpdeskdb->query($qry);
if (!PEAR::isError($res)) {
// Set column to not allow NULL
! $qry = "ALTER TABLE tbl_users ALTER COLUMN ldap SET NOT NULL";
$res = $helpdeskdb->query($qry);
$output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<br />\n";
--- 46,59 ----
// Set default value for new 'ldap' column in tbl_users
$output[] = "Setting default value for 'ldap' column in tbl_users ....... ";
! $qry = "UPDATE tbl_Users SET ldap='0'";
$res = $helpdeskdb->query($qry);
if (!PEAR::isError($res)) {
//PostgreSQL and MSSQL need a couple of more ALTER TABLE's
if ($helpdeskdb->phptype == 'pgsql' || $helpdesk->phptype =='mssql') {
! $qry = "ALTER TABLE tbl_Users ALTER COLUMN ldap SET DEFAULT '0'";
$res = $helpdeskdb->query($qry);
if (!PEAR::isError($res)) {
// Set column to not allow NULL
! $qry = "ALTER TABLE tbl_Users ALTER COLUMN ldap SET NOT NULL";
$res = $helpdeskdb->query($qry);
$output[] = (!PEAR::isError($res) ? "Success!" : $res->getMessage()) . "<br />\n";
***************
*** 75,81 ****
//Insert ldap-ause prefs to tbl_preference_descriptions
$output[] = "Adding ldap-ause preference to tbl_preference_descriptions ....... ";
! $qry['pgsql'] = "INSERT INTO tbl_preference_descriptions (identifier, type, description, overridable) VALUES ('ldap-ause', 'boolean', 'Use LDAP Authentication', '0')";
! $qry['mysql'] = "INSERT INTO tbl_preference_descriptions (identifier, type, description, overridable) VALUES ('ldap-ause', 'boolean', 'Use LDAP Authentication', '0')";
! $qry['mssql'] = "INSERT INTO tbl_preference_descriptions (identifier, type, description, overridable) VALUES ('ldap-ause', 'boolean', 'Use LDAP Authentication', '0')";
if ($qry[$helpdeskdb->phptype] != "") {
$res = $helpdeskdb->query($qry[$helpdeskdb->phptype]);
--- 75,81 ----
//Insert ldap-ause prefs to tbl_preference_descriptions
$output[] = "Adding ldap-ause preference to tbl_preference_descriptions ....... ";
! $qry['pgsql'] = "INSERT INTO tbl_Preference_Descriptions (identifier, type, description, overridable) VALUES ('ldap-ause', 'boolean', 'Use LDAP Authentication', '0')";
! $qry['mysql'] = "INSERT INTO tbl_Preference_Descriptions (identifier, type, description, overridable) VALUES ('ldap-ause', 'boolean', 'Use LDAP Authentication', '0')";
! $qry['mssql'] = "INSERT INTO tbl_Preference_Descriptions (identifier, type, description, overridable) VALUES ('ldap-ause', 'boolean', 'Use LDAP Authentication', '0')";
if ($qry[$helpdeskdb->phptype] != "") {
$res = $helpdeskdb->query($qry[$helpdeskdb->phptype]);
***************
*** 90,96 ****
//Insert ldap-basdn prefs to tbl_preference_descriptions
$output[] = "Adding ldap-basdn preference to tbl_preference_descriptions ....... ";
! $qry['pgsql'] = "INSERT INTO tbl_preference_descriptions (identifier, type, description, overridable) VALUES ('ldap-basedn', 'text', 'LDAP BaseDN', '0')";
! $qry['mysql'] = "INSERT INTO tbl_preference_descriptions (identifier, type, description, overridable) VALUES ('ldap-basedn', 'text', 'LDAP BaseDN', '0')";
! $qry['mssql'] = "INSERT INTO tbl_preference_descriptions (identifier, type, description, overridable) VALUES ('ldap-basedn', 'text', 'LDAP BaseDN', '0')";
if ($qry[$helpdeskdb->phptype] != "") {
$res = $helpdeskdb->query($qry[$helpdeskdb->phptype]);
--- 90,96 ----
//Insert ldap-basdn prefs to tbl_preference_descriptions
$output[] = "Adding ldap-basdn preference to tbl_preference_descriptions ....... ";
! $qry['pgsql'] = "INSERT INTO tbl_Preference_Descriptions (identifier, type, description, overridable) VALUES ('ldap-basedn', 'text', 'LDAP BaseDN', '0')";
! $qry['mysql'] = "INSERT INTO tbl_Preference_Descriptions (identifier, type, description, overridable) VALUES ('ldap-basedn', 'text', 'LDAP BaseDN', '0')";
! $qry['mssql'] = "INSERT INTO tbl_Preference_Descriptions (identifier, type, description, overridable) VALUES ('ldap-basedn', 'text', 'LDAP BaseDN', '0')";
if ($qry[$helpdeskdb->phptype] != "") {
$res = $helpdeskdb->query($qry[$helpdeskdb->phptype]);
***************
*** 105,111 ****
//Insert ldap-host prefs to tbl_preference_descriptions
$output[] = "Adding ldap-host preference to tbl_preference_descriptions ....... ";
! $qry['pgsql'] = "INSERT INTO tbl_preference_descriptions (identifier, type, description, overridable) VALUES ('ldap-host', 'text', 'LDAP Hostname', '0')";
! $qry['mysql'] = "INSERT INTO tbl_preference_descriptions (identifier, type, description, overridable) VALUES ('ldap-host', 'text', 'LDAP Hostname', '0')";
! $qry['mssql'] = "INSERT INTO tbl_preference_descriptions (identifier, type, description, overridable) VALUES ('ldap-host', 'text', 'LDAP Hostname', '0')";
if ($qry[$helpdeskdb->phptype] != "") {
$res = $helpdeskdb->query($qry[$helpdeskdb->phptype]);
--- 105,111 ----
//Insert ldap-host prefs to tbl_preference_descriptions
$output[] = "Adding ldap-host preference to tbl_preference_descriptions ....... ";
! $qry['pgsql'] = "INSERT INTO tbl_Preference_Descriptions (identifier, type, description, overridable) VALUES ('ldap-host', 'text', 'LDAP Hostname', '0')";
! $qry['mysql'] = "INSERT INTO tbl_Preference_Descriptions (identifier, type, description, overridable) VALUES ('ldap-host', 'text', 'LDAP Hostname', '0')";
! $qry['mssql'] = "INSERT INTO tbl_Preference_Descriptions (identifier, type, description, overridable) VALUES ('ldap-host', 'text', 'LDAP Hostname', '0')";
if ($qry[$helpdeskdb->phptype] != "") {
$res = $helpdeskdb->query($qry[$helpdeskdb->phptype]);
***************
*** 120,126 ****
//Insert ldap-v2 prefs to tbl_preference_descriptions
$output[] = "Adding ldap-v2 preference to tbl_preference_descriptions ....... ";
! $qry['pgsql'] = "INSERT INTO tbl_preference_descriptions (identifier, type, description, overridable) VALUES ('ldap-v2', 'boolean', 'Use LDAP Protocol Version 2(No means Version 3)', '0')";
! $qry['mysql'] = "INSERT INTO tbl_preference_descriptions (identifier, type, description, overridable) VALUES ('ldap-v2', 'boolean', 'Use LDAP Protocol Version 2(No means Version 3)', '0')";
! $qry['mssql'] = "INSERT INTO tbl_preference_descriptions (identifier, type, description, overridable) VALUES ('ldap-v2', 'boolean', 'Use LDAP Protocol Version 2(No means Version 3)', '0')";
if ($qry[$helpdeskdb->phptype] != "") {
$res = $helpdeskdb->query($qry[$helpdeskdb->phptype]);
--- 120,126 ----
//Insert ldap-v2 prefs to tbl_preference_descriptions
$output[] = "Adding ldap-v2 preference to tbl_preference_descriptions ....... ";
! $qry['pgsql'] = "INSERT INTO tbl_Preference_Descriptions (identifier, type, description, overridable) VALUES ('ldap-v2', 'boolean', 'Use LDAP Protocol Version 2(No means Version 3)', '0')";
! $qry['mysql'] = "INSERT INTO tbl_Preference_Descriptions (identifier, type, description, overridable) VALUES ('ldap-v2', 'boolean', 'Use LDAP Protocol Version 2(No means Version 3)', '0')";
! $qry['mssql'] = "INSERT INTO tbl_Preference_Descriptions (identifier, type, description, overridable) VALUES ('ldap-v2', 'boolean', 'Use LDAP Protocol Version 2(No means Version 3)', '0')";
if ($qry[$helpdeskdb->phptype] != "") {
$res = $helpdeskdb->query($qry[$helpdeskdb->phptype]);
***************
*** 135,141 ****
//Insert ldap-ause pref to tbl_default_preferences
$output[] = "Adding ldap-ause preference to tbl_default_preferences ....... ";
! $qry['pgsql'] = "INSERT INTO tbl_default_preferences (identifier, value) VALUES ('ldap-ause', 'false')";
! $qry['mysql'] = "INSERT INTO tbl_default_preferences (identifier, value) VALUES ('ldap-ause', 'false')";
! $qry['mssql'] = "INSERT INTO tbl_default_preferences (identifier, value) VALUES ('ldap-ause', 'false')";
if ($qry[$helpdeskdb->phptype] != "") {
$res = $helpdeskdb->query($qry[$helpdeskdb->phptype]);
--- 135,141 ----
//Insert ldap-ause pref to tbl_default_preferences
$output[] = "Adding ldap-ause preference to tbl_default_preferences ....... ";
! $qry['pgsql'] = "INSERT INTO tbl_Default_Preferences (identifier, value) VALUES ('ldap-ause', 'false')";
! $qry['mysql'] = "INSERT INTO tbl_Default_Preferences (identifier, value) VALUES ('ldap-ause', 'false')";
! $qry['mssql'] = "INSERT INTO tbl_Default_Preferences (identifier, value) VALUES ('ldap-ause', 'false')";
if ($qry[$helpdeskdb->phptype] != "") {
$res = $helpdeskdb->query($qry[$helpdeskdb->phptype]);
***************
*** 150,156 ****
//Insert ldap-basedn pref to tbl_default_preferences
$output[] = "Adding ldap-basedn preference to tbl_default_preferences ....... ";
! $qry['pgsql'] = "INSERT INTO tbl_default_preferences (identifier, value) VALUES ('ldap-basedn', '')";
! $qry['mysql'] = "INSERT INTO tbl_default_preferences (identifier, value) VALUES ('ldap-basedn', '')";
! $qry['mssql'] = "INSERT INTO tbl_default_preferences (identifier, value) VALUES ('ldap-basedn', '')";
if ($qry[$helpdeskdb->phptype] != "") {
$res = $helpdeskdb->query($qry[$helpdeskdb->phptype]);
--- 150,156 ----
//Insert ldap-basedn pref to tbl_default_preferences
$output[] = "Adding ldap-basedn preference to tbl_default_preferences ....... ";
! $qry['pgsql'] = "INSERT INTO tbl_Default_Preferences (identifier, value) VALUES ('ldap-basedn', '')";
! $qry['mysql'] = "INSERT INTO tbl_Default_Preferences (identifier, value) VALUES ('ldap-basedn', '')";
! $qry['mssql'] = "INSERT INTO tbl_Default_Preferences (identifier, value) VALUES ('ldap-basedn', '')";
if ($qry[$helpdeskdb->phptype] != "") {
$res = $helpdeskdb->query($qry[$helpdeskdb->phptype]);
***************
*** 165,171 ****
//Insert ldap-host pref to tbl_default_preferences
$output[] = "Adding ldap-host preference to tbl_default_preferences ....... ";
! $qry['pgsql'] = "INSERT INTO tbl_default_preferences (identifier, value) VALUES ('ldap-host', '')";
! $qry['mysql'] = "INSERT INTO tbl_default_preferences (identifier, value) VALUES ('ldap-host', '')";
! $qry['mssql'] = "INSERT INTO tbl_default_preferences (identifier, value) VALUES ('ldap-host', '')";
if ($qry[$helpdeskdb->phptype] != "") {
$res = $helpdeskdb->query($qry[$helpdeskdb->phptype]);
--- 165,171 ----
//Insert ldap-host pref to tbl_default_preferences
$output[] = "Adding ldap-host preference to tbl_default_preferences ....... ";
! $qry['pgsql'] = "INSERT INTO tbl_Default_Preferences (identifier, value) VALUES ('ldap-host', '')";
! $qry['mysql'] = "INSERT INTO tbl_Default_Preferences (identifier, value) VALUES ('ldap-host', '')";
! $qry['mssql'] = "INSERT INTO tbl_Default_Preferences (identifier, value) VALUES ('ldap-host', '')";
if ($qry[$helpdeskdb->phptype] != "") {
$res = $helpdeskdb->query($qry[$helpdeskdb->phptype]);
***************
*** 180,186 ****
//Insert ldap-v2 pref to tbl_default_preferences
$output[] = "Adding ldap-v2 preference to tbl_default_preferences ....... ";
! $qry['pgsql'] = "INSERT INTO tbl_default_preferences (identifier, value) VALUES ('ldap-v2', 'false')";
! $qry['mysql'] = "INSERT INTO tbl_default_preferences (identifier, value) VALUES ('ldap-v2', 'false')";
! $qry['mssql'] = "INSERT INTO tbl_default_preferences (identifier, value) VALUES ('ldap-v2', 'false')";
if ($qry[$helpdeskdb->phptype] != "") {
$res = $helpdeskdb->query($qry[$helpdeskdb->phptype]);
--- 180,186 ----
//Insert ldap-v2 pref to tbl_default_preferences
$output[] = "Adding ldap-v2 preference to tbl_default_preferences ....... ";
! $qry['pgsql'] = "INSERT INTO tbl_Default_Preferences (identifier, value) VALUES ('ldap-v2', 'false')";
! $qry['mysql'] = "INSERT INTO tbl_Default_Preferences (identifier, value) VALUES ('ldap-v2', 'false')";
! $qry['mssql'] = "INSERT INTO tbl_Default_Preferences (identifier, value) VALUES ('ldap-v2', 'false')";
if ($qry[$helpdeskdb->phptype] != "") {
$res = $helpdeskdb->query($qry[$helpdeskdb->phptype]);
Index: authentication.php
===================================================================
RCS file: /cvsroot/helpmeict/Helpdesk/system/authentication.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** authentication.php 16 Sep 2007 22:00:38 -0000 1.7
--- authentication.php 30 Sep 2007 20:13:43 -0000 1.8
***************
*** 45,49 ****
function ldap_authenticate($ldapuser, $ldappassword) {
! $sql = "SELECT * FROM tbl_default_Preferences";
$result = db_recordset($sql);
$default_prefs = Array();
--- 45,49 ----
function ldap_authenticate($ldapuser, $ldappassword) {
! $sql = "SELECT * FROM tbl_Default_Preferences";
$result = db_recordset($sql);
$default_prefs = Array();
|