From: <tr...@us...> - 2002-10-03 16:45:10
|
Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv14883 Modified Files: misc.inc.php mysql.inc.php pgsql.inc.php user_edit.phtml user_list.phtml Log Message: Added db_date_future and looked over never/future handling Index: misc.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/misc.inc.php,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** misc.inc.php 30 Sep 2002 21:13:10 -0000 1.40 --- misc.inc.php 3 Oct 2002 16:45:06 -0000 1.41 *************** *** 34,40 **** return $txt; } ! if($txt === NULL) return "<i>none</i>"; $txt = htmlspecialchars(trim($txt)); ! if($txt == "") return " "; return nl2br($txt); } --- 34,42 ---- return $txt; } ! if($txt === NULL) ! return "<i>none</i>"; $txt = htmlspecialchars(trim($txt)); ! if($txt == "") ! return " "; return nl2br($txt); } *************** *** 50,56 **** function strtodate($txt) { ! if($txt == "") return db_date_never(); $t = @strtotime($txt); ! if($t < 0) return db_date_never(); return date("Y-m-d", $t); } --- 52,60 ---- function strtodate($txt) { ! if($txt == "") ! return db_date_never(); $t = @strtotime($txt); ! if($t < 0) ! return db_date_never(); return date("Y-m-d", $t); } *************** *** 58,64 **** function strtodatetime($txt) { ! if($txt == "") return db_date_never()." 00:00:00"; $t = @strtotime($txt); ! if($t < 0) return db_date_never()." 00:00:00"; return date("Y-m-d H:i:s", $t); } --- 62,70 ---- function strtodatetime($txt) { ! if($txt == "") ! return db_date_never()." 00:00:00"; $t = @strtotime($txt); ! if($t < 0) ! return db_date_never()." 00:00:00"; return date("Y-m-d H:i:s", $t); } *************** *** 125,139 **** if(isset($_SERVER["HTTP_REFERER"])) { - // Quick fix for old Konqueror - delete later - if(ereg("Konqueror/2.1.2", $_SERVER["HTTP_USER_AGENT"]) && - ereg("bottom.phtml", $_SERVER["HTTP_REFERER"])) - { - $_SERVER["HTTP_REFERER"] = $defaultLocation; - } // Drop the proto://host[:port] part of the referring URL //$location = ereg_replace("^[a-z]+://[^/]*(:[0-9]+)?", "", // $_SERVER["HTTP_REFERER"]); ! // This removes all nasty links, including cross-site scripting ! // attempts. $location = ereg_replace(".*[/:]", "", $_SERVER["HTTP_REFERER"]); } --- 131,138 ---- if(isset($_SERVER["HTTP_REFERER"])) { // Drop the proto://host[:port] part of the referring URL //$location = ereg_replace("^[a-z]+://[^/]*(:[0-9]+)?", "", // $_SERVER["HTTP_REFERER"]); ! // This removes all nastyness $location = ereg_replace(".*[/:]", "", $_SERVER["HTTP_REFERER"]); } Index: mysql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/mysql.inc.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** mysql.inc.php 11 Sep 2002 09:03:06 -0000 1.17 --- mysql.inc.php 3 Oct 2002 16:45:06 -0000 1.18 *************** *** 281,284 **** --- 281,289 ---- } + function db_date_future() + { + return "9999-12-31"; + } + function db_dynamic_db_prepare(&$dyn) { Index: pgsql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/pgsql.inc.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** pgsql.inc.php 11 Sep 2002 09:03:36 -0000 1.14 --- pgsql.inc.php 3 Oct 2002 16:45:06 -0000 1.15 *************** *** 377,380 **** --- 377,385 ---- } + function db_date_future() + { + return "9999-12-31"; + } + function db_dynamic_db_prepare(&$dyn) { Index: user_edit.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/user_edit.phtml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** user_edit.phtml 10 Sep 2002 23:06:36 -0000 1.15 --- user_edit.phtml 3 Oct 2002 16:45:06 -0000 1.16 *************** *** 1,2 **** --- 1,3 ---- + <? // $Id$ *************** *** 50,55 **** $user->setPhone($i_phone); $user->setFax($i_fax); ! $user->setActiveUntil(isset($i_activeforever) ? ! "9999-12-31" : strtodate($i_activeu)); if($i_pass != "<<encrypted>>") $user->setPassword($i_pass); --- 51,56 ---- $user->setPhone($i_phone); $user->setFax($i_fax); ! $user->setActiveUntil(isset($i_activeforever) ? db_date_future() : ! ($i_activeu == "" ? db_date_never() : strtodate($i_activeu))); if($i_pass != "<<encrypted>>") $user->setPassword($i_pass); *************** *** 177,181 **** echo "</td></tr>\n"; $actu = $user->getActiveUntil(); ! if($actu == "9999-12-31") { $actu = ""; --- 178,182 ---- echo "</td></tr>\n"; $actu = $user->getActiveUntil(); ! if($actu == db_date_future()) { $actu = ""; *************** *** 231,235 **** { $actu = $user->getActiveUntil(); ! if($actu == "9999-12-31") $actu = "never"; else if($actu == db_date_never()) --- 232,236 ---- { $actu = $user->getActiveUntil(); ! if($actu == db_date_forever()) $actu = "never"; else if($actu == db_date_never()) Index: user_list.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/user_list.phtml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** user_list.phtml 9 Sep 2002 06:39:01 -0000 1.13 --- user_list.phtml 3 Oct 2002 16:45:06 -0000 1.14 *************** *** 118,122 **** function htmluserdate($date, $daysLeft) { ! if($date == "9999-12-31") return "<span class=active_0>forever</span>"; if($date == db_date_never()) --- 118,122 ---- function htmluserdate($date, $daysLeft) { ! if($date == db_date_forever()) return "<span class=active_0>forever</span>"; if($date == db_date_never()) |