From: Steve Sutton Date: Wed, 30 Nov 2016 17:41:00 +0000 (-0500) Subject: Updates for php version diffs X-Git-Tag: v1.0.0~2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=26cbde13cb968f171d7790621b03a7daf109a2f5;p=web%2Fwww.mackinacislandpackage.com.git Updates for php version diffs Updating to move site to ws6 --- diff --git a/admin/packages/addPackage.php b/admin/packages/addPackage.php index 83167c3..2564935 100644 --- a/admin/packages/addPackage.php +++ b/admin/packages/addPackage.php @@ -42,7 +42,7 @@ if( date("w",$min_time) == 0 ) $min_time = mktime(0,0,0,date('m'),date('j')+6,date('Y')); } // min date for packages is May 15th (fort closed before this) -$fort_opens = mktime(0,0,0,5,15,date('Y')); +$fort_opens = mktime(0,0,0,5,13,date('Y')); if( $min_time < $fort_opens ) { $min_time = $fort_opens; @@ -57,8 +57,8 @@ else } // min date for packages is May 13th (fort closed before this) $min_date = date("n/j/Y",$min_time); -// max date for packages is Oct 2nd (fort closed after this) -$max_time = mktime(0,0,0,10,3,date('Y')); +// max date for packages is Sep 30th (fort closed after this) +$max_time = mktime(0,0,0,12,30,date('Y')); $max_date = date("n/j/Y",$max_time); $cal_set = ',pagedate: "'.$page_date.'",mindate: "'.$min_date.'",maxdate: "'.$max_date.'"'; $fields[] = array('name'=>'cday','type'=>'hide'); diff --git a/authorize/sequence.txt b/authorize/sequence.txt index 16d6cd1..931fdb7 100755 --- a/authorize/sequence.txt +++ b/authorize/sequence.txt @@ -1 +1 @@ -1016541 +1016544 diff --git a/classes/class_administrator.inc b/classes/class_administrator.inc index 5d33fa0..36493cc 100755 --- a/classes/class_administrator.inc +++ b/classes/class_administrator.inc @@ -141,7 +141,7 @@ class administrator extends GLM_DB function edit_result( $data ) { $out = $this->add_form_top(); - $out .= '
+ $out .= ' '; $form = new form_creator( $this->fields, $data ); $this->form_scripts =& $form->form_scripts; @@ -160,7 +160,7 @@ class administrator extends GLM_DB function add_result( $data = null ) { //$out = $this->add_form_top(); - $out .= ' + $out .= '
'; $form = new form_creator( $this->fields, $data ); $this->form_scripts =& $form->form_scripts; @@ -188,7 +188,8 @@ class administrator extends GLM_DB case "text": default: - $q_part[$fields['name']] .= " = '".$_POST[$fields['name']]."'"; + $q_part[$fields['name']] .= " = '" + . addslashes( stripslashes( $_POST[$fields['name']] ) ) . "'"; break; } } @@ -310,7 +311,7 @@ class administrator extends GLM_DB case "Update": $out .= $member->update_member( $_POST['id'] ); - header('Location: '.$GLOBALS["PHP_SELF"].'?Action=List+Members'); + header('Location: '.$_SERVER["PHP_SELF"].'?Action=List+Members'); exit(); break; @@ -339,7 +340,8 @@ class administrator extends GLM_DB case "Update": $out .= $member->update_member( $_POST['id'] ); - header('Location: '.$GLOBALS["PHP_SELF"].'?Action=List+Members'); + + header('Location: '.$_SERVER["PHP_SELF"].'?Action=List+Members'); exit(); break; @@ -361,7 +363,7 @@ class administrator extends GLM_DB case "Delete Package": $out .= $package->delete_package( $_GET['id'] ); - header('Location: '.$GLOBALS["PHP_SELF"].'?Action=List+Packages'); + header('Location: '.$_SERVER["PHP_SELF"].'?Action=List+Packages'); exit(); break; @@ -371,7 +373,7 @@ class administrator extends GLM_DB case "Update Package": $out .= $package->update_package( $_POST['id'] ); - header('Location: '.$GLOBALS["PHP_SELF"].'?Action=List+Packages'); + header('Location: '.$_SERVER["PHP_SELF"].'?Action=List+Packages'); exit(); break; @@ -407,7 +409,7 @@ class administrator extends GLM_DB $out .= $package->approve_vouchers(); if( $package->return_page ) { - header('Location: '.$package->return_page);//$GLOBALS["PHP_SELF"].'?Action=Voucher+Reciepts'); + header('Location: '.$package->return_page); exit(); } break; diff --git a/classes/class_auth.inc b/classes/class_auth.inc index 56d9709..0c921f9 100755 --- a/classes/class_auth.inc +++ b/classes/class_auth.inc @@ -1,33 +1,33 @@ * $Id: class_auth.inc,v 1.1.1.1 2007/04/19 13:06:15 matrix Exp $ * Authentication class. Enables different levels -* of authentication for users with one master(admin) user -* able to set up accounts for others and permissions based on different +* of authentication for users with one master(admin) user +* able to set up accounts for others and permissions based on different * levels. Can be modified to use more levels. This is set up with four levels. *

* @package Toolbox Library * @subpackage Authentication Library * @filesource -* +* */ /** * Require DocBlock */ require_once( BASE.'classes/class_db.inc' ); -/** +/** * authuser *

* $Id: class_auth.inc,v 1.1.1.1 2007/04/19 13:06:15 matrix Exp $ * Authentication class. Enables different levels -* of authentication for users with one master(admin) user -* able to set up accounts for others and permissions based on different +* of authentication for users with one master(admin) user +* able to set up accounts for others and permissions based on different * levels. Can be modified to use more levels. This is set up with four levels. *

-* Permissions are checked using bitwise operators so you can have custom permission +* Permissions are checked using bitwise operators so you can have custom permission * levels per user. Thus an admin user with perms set to 15 would have all levels.

* CREATE TABLE authuser ( * id SERIAL, @@ -72,8 +72,8 @@ require_once( BASE.'classes/class_db.inc' ); /** @var $auth_data array to keep user info */ var $auth_data; - /** authuser - Class construtor. Set up the default variables for + /** authuser + Class construtor. Set up the default variables for the class. */ function authuser( &$DB ) @@ -93,7 +93,7 @@ require_once( BASE.'classes/class_db.inc' ); /** * fill_data: - * + * * @return mixed * @access public **/ @@ -114,20 +114,20 @@ require_once( BASE.'classes/class_db.inc' ); Checks the user login. Checks the users IP address to be sure it is not hijacked. @param level - If a level is giving and the user doesn't match the - level then the page is not shown. + level then the page is not shown. @return void */ /** * verify: verify the user - * - *

check the table in $this->usertable for user matching + * + *

check the table in $this->usertable for user matching * password and username and tells if passed or not *

- * @param $NULL: - * - * @return boolean + * @param $NULL: + * + * @return boolean * @access public **/ function verify($level=NULL) @@ -140,8 +140,8 @@ require_once( BASE.'classes/class_db.inc' ); $this->logout(); } - /* Check to see if GLM-AUTH cookie is set then check if - $auth is registered in session. + /* Check to see if GLM-AUTH cookie is set then check if + $auth is registered in session. */ if($_COOKIE[$this->cookie_name]) { @@ -159,7 +159,7 @@ require_once( BASE.'classes/class_db.inc' ); { session_start(); session_destroy(); - $p = session_get_cookie_params(); + $p = session_get_cookie_params(); setcookie(session_name(), "", 0, $p["path"], $p["domain"]); setcookie($this->cookie_name,"",0,"/"); if(!$this->login()) @@ -190,13 +190,13 @@ require_once( BASE.'classes/class_db.inc' ); function sqlBypass( $text ) { - $text = eregi_replace('[();\'\"]','',$text); + $text = preg_replace('%[();\'\"]%i','',$text); return( $text ); } - /** + /** * login - * + * *

User login funtcion. Now this will check for a cookie * which can be set if the user selects remember my login.

* @return boolean - True if login in successful False not. @@ -228,14 +228,14 @@ require_once( BASE.'classes/class_db.inc' ); } return(true); } - else + else { session_register("auth"); $auth['failed'] = true; return(false); } } - else + else { session_register("auth"); $auth['failed'] = true; @@ -248,9 +248,9 @@ require_once( BASE.'classes/class_db.inc' ); * is_admin: * *

Tells if user is an admin user or not

- * + * * @return boolean - * @access public + * @access public **/ function is_admin() { @@ -264,12 +264,12 @@ require_once( BASE.'classes/class_db.inc' ); } } - /** login_screen + /** login_screen * *

Outputs the login screen

* * @return void - * @access public + * @access public */ function login_screen() { @@ -292,7 +292,7 @@ require_once( BASE.'classes/class_db.inc' );
Username: auth["uname"] ) ) { $out .= $this->auth["uname"]; } @@ -307,7 +307,7 @@ require_once( BASE.'classes/class_db.inc' );
-

'; +

'; if ( $_SESSION['auth']['failed'] == true ) { $out .= ' @@ -328,27 +328,27 @@ require_once( BASE.'classes/class_db.inc' ); if (document.forms[0][0].value != \'\') { document.forms[0][1].focus(); - } - else + } + else { document.forms[0][0].focus(); } // --> '; return( $out ); - } + } /** logout Ends the current session and distroys any cookies that were created @return void - * @access public + * @access public */ function logout() { session_start(); session_destroy(); - $p = session_get_cookie_params(); + $p = session_get_cookie_params(); setcookie(session_name(), "", 0, $p["path"], $p["domain"]); setcookie($this->cookie_name,"",0,"/"); } @@ -357,15 +357,15 @@ require_once( BASE.'classes/class_db.inc' ); Stop the script from going any further. @param reply - string to show user if any. @return void - * @access public + * @access public */ function failed($reply=NULL) { if(isset($reply)) { die(''.$reply.''); - } - else + } + else { exit; } diff --git a/classes/class_contact_form.inc b/classes/class_contact_form.inc index 6b84f7d..56443ac 100644 --- a/classes/class_contact_form.inc +++ b/classes/class_contact_form.inc @@ -632,7 +632,7 @@ class contact_form { break; case 'phone': - if( $_POST[$val['name']] && !ereg("([0-9]{7,11})",ereg_replace("[()-. ]","",$_POST[$val['name']])) ) + if( $_POST[$val['name']] && !preg_match("%([0-9]{7,11})%",preg_replace("%[()-. ]%","",$_POST[$val['name']])) ) { $error[$val['name']] = 1; unset( $_POST[$val['name']] ); @@ -644,7 +644,7 @@ class contact_form { break; case 'url': - if( $_POST[$val['name']] && !ereg("^http://",$_POST[$val['name']]) ) + if( $_POST[$val['name']] && !preg_match("%^http://%",$_POST[$val['name']]) ) { $error[$val['name']] = 1; unset( $_POST[$val['name']] ); @@ -657,7 +657,7 @@ class contact_form { default: - if( $_POST[$val['name']] && ereg("^http://|\@",$_POST[$val['name']]) ) + if( $_POST[$val['name']] && preg_match("%^http://|\@%",$_POST[$val['name']]) ) { $error[$val['name']] = 1; unset( $_POST[$val['name']] ); @@ -843,7 +843,7 @@ class contact_form { if( $db_interest_field ) { $interest_array = $_POST['interest']; - $f_int_string = ereg_replace("^:|:$","",$cData[0][$db_interest_field]); + $f_int_string = preg_replace("%^:|:$%","",$cData[0][$db_interest_field]); if( $f_int_string ) { $f_int_array = explode(":",$f_int_string); @@ -976,7 +976,7 @@ font-size: 12px; '; if( $_POST['interest'] ) { - $interest = ereg_replace( "^:|:$","",$_POST['interest'] ); + $interest = preg_replace( "%^:|:$%","",$_POST['interest'] ); // $_POST['interest'] = explode(":",$interest); } foreach($this->DB_fields as $key=>$value) diff --git a/classes/class_events.inc b/classes/class_events.inc index 08650c2..f6ad2fe 100755 --- a/classes/class_events.inc +++ b/classes/class_events.inc @@ -1,11 +1,11 @@ USAGE: to build an event calendar create the events class. thats it.
Pass it second param of 'Flat' to change to flat layout.

* - * @package Toolbox + * @package Toolbox * @subpackage Event * @filesource */ @@ -19,7 +19,7 @@ require_once(BASE.'classes/class_db.inc'); require_once(BASE.'classes/class_template.inc'); /** * - * Library for the generation of the detail events + * Library for the generation of the detail events * *

USAGE: to build an event calendar create the events class. thats it.
Pass it second param of 'Flat' to change to flat layout.

* @@ -36,15 +36,15 @@ require_once(BASE.'classes/class_template.inc'); class GLM_EVENTS extends GLM_TEMPLATE{ /** * @access public - * @var integer + * @var integer */ var $topicid; /**#@+ * @access public - * @var string + * @var string */ var $page_name; - /** + /** * Type of display flat or calendar based on weather or not a topicid exists. */ var $display_type; @@ -58,13 +58,13 @@ class GLM_EVENTS extends GLM_TEMPLATE{ parent::GLM_TEMPLATE( $GLOBALS['catid'] ); $DB =& $toolbox->DB; $this->topicid = $GLOBALS['topicid']; - $this->page_name = BASE_URL.'events.phtml';//$GLOBALS['PHP_SELF']; - $this->display_type = $this->get_type(); // Calendar or Flat + $this->page_name = BASE_URL.'events.phtml'; + $this->display_type = $this->get_type(); // Calendar or Flat $this->get_events(); } /** - * get_type - * + * get_type + * * @return string */ function get_type() @@ -84,7 +84,7 @@ class GLM_EVENTS extends GLM_TEMPLATE{ return('flat'); } } - elseif( $_POST['topicid'] || $_GET['topicid'] || $_POST['topic'] + elseif( $_POST['topicid'] || $_GET['topicid'] || $_POST['topic'] || $_POST['topics_id'] || $_POST['EventName']) { return('flat'); @@ -97,9 +97,9 @@ class GLM_EVENTS extends GLM_TEMPLATE{ // date helper funcs /** - * lastDayOfMonth - * - * @param string $timestamp + * lastDayOfMonth + * + * @param string $timestamp * @return string */ function lastDayOfMonth($timestamp = '') @@ -108,13 +108,13 @@ class GLM_EVENTS extends GLM_TEMPLATE{ return( mktime(0,0,0, date("m",$timestamp)+1, 1, date("Y",$timestamp))-3600*24); } /** - * show_print_link - * + * show_print_link + * * @return string */ function show_print_link() { - if(!ereg("printable.phtml",$GLOBALS["PHP_SELF"])) + if(!preg_match("%printable.phtml%",$_SERVER["PHP_SELF"])) { $month = (int)substr($GLOBALS['month'],0,2); $year = (int)substr($GLOBALS['month'],3,6); @@ -128,9 +128,9 @@ class GLM_EVENTS extends GLM_TEMPLATE{ return( $out ); } /** - * firstDayOfMonth - * - * @param string $timestamp + * firstDayOfMonth + * + * @param string $timestamp * @return string */ function firstDayOfMonth($timestamp='') @@ -156,9 +156,9 @@ class GLM_EVENTS extends GLM_TEMPLATE{ } if(!$month || $month == "All") { - $month = date("n"); + $month = date("n"); } - if(ereg("^0([0-9]).*",$month,$part)) + if(preg_match("%^0([0-9]).*%",$month,$part)) $month = $part[1]; $st = mktime(0,0,0,$month,1,$year); $starting = date("m-d-Y",$this->firstDayOfMonth($st)); @@ -191,7 +191,7 @@ class GLM_EVENTS extends GLM_TEMPLATE{ /** * get_event_search - * + * * @uses PGSQL_ASSOC * @uses GLM_EVENT::$page_name * @uses calendar() @@ -223,9 +223,9 @@ class GLM_EVENTS extends GLM_TEMPLATE{ $page = BASE_URL.'events.phtml'; - for($i=0;$iDB->db_fetch_array($result,$i,PGSQL_ASSOC); + $data = $this->DB->db_fetch_array($result,$i,PGSQL_ASSOC); $s_month = $data['d1_month']; $s_year = $data['d1_year']; $e_month = $data['d2_month']; @@ -233,11 +233,11 @@ class GLM_EVENTS extends GLM_TEMPLATE{ $start_time_stamp = mktime(0,0,0,$s_month,1,$s_year); $end_time_stamp = mktime(0,0,0,$e_month,1,$e_year); - $watchdog = 20; + $watchdog = 20; $cur_time_stamp = mktime(0,0,0,$m,1,$y); - for( $y=$s_year, $m=$s_month; $cur_time_stamp <= $end_time_stamp ; ) + for( $y=$s_year, $m=$s_month; $cur_time_stamp <= $end_time_stamp ; ) { - if( $m == 13 ) + if( $m == 13 ) { $y++; $m = 1; @@ -261,9 +261,9 @@ class GLM_EVENTS extends GLM_TEMPLATE{ } // Selections part - while( list($key,$value) = each($selection)) + while( list($key,$value) = each($selection)) { - $qs = "SELECT + $qs = "SELECT DISTINCT $key FROM event WHERE visable = 't' @@ -274,12 +274,12 @@ class GLM_EVENTS extends GLM_TEMPLATE{ $out .= ""; //$out .= ''; - if(isset($emonths) && is_array($emonths)) + if(isset($emonths) && is_array($emonths)) { - for(reset($emonths);$key=key($emonths);next($emonths)) + for(reset($emonths);$key=key($emonths);next($emonths)) { $date = mktime(0,0,0,(integer)substr($key,0,2),1,substr($key,3,4)); $now = mktime(0,0,0,date("m"),1,date("Y")); - if($date>=$now) + if($date>=$now) { $out .= "