[Openfirst-cvscommit] base/includes auth.php,1.5.2.4,1.5.2.5 dbase.php,1.7.2.5,1.7.2.6 globals.php,1
Brought to you by:
xtimg
|
From: Jamie <ast...@us...> - 2005-08-28 03:43:40
|
Update of /cvsroot/openfirst/base/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25250/includes Modified Files: Tag: REL1_1_BRANCH auth.php dbase.php globals.php Log Message: All modules install (under MySQL). Emoticon known to work. -install.php updated to current method -problems with auth.php fixed? (Watch auth.php, it's a tricky one) -ofirst_dbfetch_array() added (Need to port to HEAD) -var name mismatch fixed in globals.php -serious updates to logger (no longer tracks total and pagetotal) -issues with poll removed Index: auth.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/auth.php,v retrieving revision 1.5.2.4 retrieving revision 1.5.2.5 diff -C2 -d -r1.5.2.4 -r1.5.2.5 *** auth.php 25 Aug 2005 00:16:31 -0000 1.5.2.4 --- auth.php 28 Aug 2005 03:43:29 -0000 1.5.2.5 *************** *** 98,102 **** function InitUser() { ! global $pass_save_disabled, $encryption, $user; // Determine if the user has already logged in with this session. If // they have, set variables indicating this. If they have not, make a --- 98,103 ---- function InitUser() { ! global $pass_save_disabled, $encryption, $user, $basepath; ! session_start(); // Determine if the user has already logged in with this session. If // they have, set variables indicating this. If they have not, make a *************** *** 113,117 **** $_SESSION['authcode'] = $authcode; //renew cookie ! setcookie("openFIRSTlogin", $authcode, time()+2592000, "/"); } else { $authcode = 0; --- 114,118 ---- $_SESSION['authcode'] = $authcode; //renew cookie ! setcookie("openFIRSTlogin", $authcode, time()+2592000, $basepath); } else { $authcode = 0; *************** *** 126,130 **** if(!isset($pass_save_disabled)){ //delete cookie ! setcookie("openFIRSTlogin"," ",time()-3600,"/"); } if(isset($_POST["login"])){ --- 127,131 ---- if(!isset($pass_save_disabled)){ //delete cookie ! setcookie("openFIRSTlogin"," ",time()-3600,$basepath); } if(isset($_POST["login"])){ *************** *** 140,143 **** --- 141,145 ---- $aquery = ofirst_dbquery("UPDATE ofirst_members SET authcode='" . $_SESSION["authcode"] . "' WHERE user='" . $_POST["login"] . "';"); } else { + header('X-openFIRST-login-error: invalid password'); unset($user); } *************** *** 161,165 **** if(isset($_POST["savepass"])&&$_POST["savepass"]="1"){ //save authcode in a cookie ! setcookie("openFIRSTlogin",$_SESSION["authcode"],time()+2592000,"/"); } else { //delete cookie --- 163,167 ---- if(isset($_POST["savepass"])&&$_POST["savepass"]="1"){ //save authcode in a cookie ! setcookie("openFIRSTlogin",$_SESSION["authcode"],time()+2592000,$basepath); } else { //delete cookie *************** *** 170,173 **** --- 172,176 ---- } else { # invalid password! + header('X-openFIRST-login-error: invalid password'); unset($user); } *************** *** 175,178 **** --- 178,182 ---- } else { # invalid user! + header('X-openFIRST-login-error: invalid user'); unset($user); } Index: dbase.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/dbase.php,v retrieving revision 1.7.2.5 retrieving revision 1.7.2.6 diff -C2 -d -r1.7.2.5 -r1.7.2.6 *** dbase.php 25 Aug 2005 01:15:36 -0000 1.7.2.5 --- dbase.php 28 Aug 2005 03:43:29 -0000 1.7.2.6 *************** *** 145,149 **** function ofirst_dbquery($string, $linkidentifier = "", $batchsize = "") { ! global $dbasetype, $sqlconnection; if($dbasetype == "mysql") { if(function_exists("mysql_query") == false) { --- 145,150 ---- function ofirst_dbquery($string, $linkidentifier = "", $batchsize = "") { ! global $dbasetype, $sqlconnection, $lastquery; ! $lastquery = $string; if($dbasetype == "mysql") { if(function_exists("mysql_query") == false) { *************** *** 203,206 **** --- 204,235 ---- } + function ofirst_dbfetch_array($resource, $rownumber = "") { + global $dbasetype; + if($dbasetype == "mysql") { + if(function_exists("mysql_fetch_assoc") == false) { + die("MySQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable MySQL support, or choose another database type."); + } + return mysql_fetch_assoc($resource); + } elseif($dbasetype == "mssql") { + if(function_exists("mssql_fetch_assoc") == false) { + die("Microsoft SQL support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable Microsoft SQL support, or choose another database type."); + } + //@NOTE mssql_fetch_assoc() is undocumented. + return(mssql_fetch_assoc($resource)); + } elseif($dbasetype == "odbc") { + if(function_exists("odbc_fetch_array ") == false) { + die("ODBC support is not available in your version of PHP. To use the openFIRST Web Portal Software, please either enable ODBC support, or choose another database type."); + + } + if($rownumber != "") { + return(odbc_fetch_array ($resource, $rownumber)); + } else { + return(odbc_fetch_array ($resource)); + } + } + + exit(0); + } + function ofirst_dbnum_rows($resource) { global $dbasetype; *************** *** 312,317 **** `modulenavigation` text, `includes` text, ! PRIMARY KEY (`modulename`), ! UNIQUE (`modulename`) )"); if (ofirst_dberror() != 0) return false; --- 341,345 ---- `modulenavigation` text, `includes` text, ! PRIMARY KEY (`modulename`) )"); if (ofirst_dberror() != 0) return false; *************** *** 359,373 **** function ofirst_dbexec_file($filename, $linkidentifier = "") { if (file_exists($filename) && is_readable($filename) && is_file($filename)) { ! /* $sf = fopen($filename, "r"); $query = ""; while($line = fgets($sf)) { if(substr($line, 0, 2) != "--" && substr($line, 0, 1) != "#" && strlen($line) > 0) { ! $q = ofirst_dbquery(trim($line)); } } ! fclose($sf);*/ ! $line = file_get_contents($filename); $q = ofirst_dbquery(trim($line), $linkidentifier); ! return ofirst_dberrno($linkidentifier) ? ofirst_dberror($linkidentifier) : false; } else { return "Can't read file"; --- 387,404 ---- function ofirst_dbexec_file($filename, $linkidentifier = "") { if (file_exists($filename) && is_readable($filename) && is_file($filename)) { ! $sf = fopen($filename, "r"); $query = ""; while($line = fgets($sf)) { + $line = trim($line); if(substr($line, 0, 2) != "--" && substr($line, 0, 1) != "#" && strlen($line) > 0) { ! $q = ofirst_dbquery($line); ! if (ofirst_dberrno($linkidentifier) != 0) return ofirst_dberror($linkidentifier); } } ! fclose($sf); ! return false; ! /* $line = file_get_contents($filename); $q = ofirst_dbquery(trim($line), $linkidentifier); ! return ofirst_dberrno($linkidentifier) ? ofirst_dberror($linkidentifier) : false;*/ } else { return "Can't read file"; Index: globals.php =================================================================== RCS file: /cvsroot/openfirst/base/includes/globals.php,v retrieving revision 1.14.2.4 retrieving revision 1.14.2.5 diff -C2 -d -r1.14.2.4 -r1.14.2.5 *** globals.php 25 Aug 2005 01:15:36 -0000 1.14.2.4 --- globals.php 28 Aug 2005 03:43:29 -0000 1.14.2.5 *************** *** 106,110 **** // Include the functions using glob(); foreach (glob("$fbasepath/includes/functions/*.php") as $filename) { ! // include_once($filename); } } --- 106,110 ---- // Include the functions using glob(); foreach (glob("$fbasepath/includes/functions/*.php") as $filename) { ! include_once($filename); } } *************** *** 143,147 **** if( (bool) $module->showonmenu == true) { // If it is the current module then color the item ! if ($currentmodule == $module->modulename){ $headers .= " » <font color='red'><u><a class='menu' href='$basepath/$module->modulename'>".ucwords($module->modulename)."</a></u></font> |"; --- 143,147 ---- if( (bool) $module->showonmenu == true) { // If it is the current module then color the item ! if ($curmodule == $module->modulename){ $headers .= " » <font color='red'><u><a class='menu' href='$basepath/$module->modulename'>".ucwords($module->modulename)."</a></u></font> |"; |