diff --git a/code/web/private_php/ams/autoload/.plugincache.php.swp b/code/web/private_php/ams/autoload/.plugincache.php.swp deleted file mode 100644 index 4993b302e..000000000 Binary files a/code/web/private_php/ams/autoload/.plugincache.php.swp and /dev/null differ diff --git a/code/web/private_php/ams/autoload/helpers.php b/code/web/private_php/ams/autoload/helpers.php index 28e4ce036..6838699b5 100644 --- a/code/web/private_php/ams/autoload/helpers.php +++ b/code/web/private_php/ams/autoload/helpers.php @@ -29,7 +29,6 @@ class Helpers { // define('SMARTY_SPL_AUTOLOAD',1); require_once $AMS_LIB . '/smarty/libs/Smarty.class.php'; - spl_autoload_register( '__autoload' ); $smarty = new Smarty; $smarty -> setCompileDir( $SITEBASE . '/templates_c/' ); diff --git a/code/web/private_php/ams/libinclude.php b/code/web/private_php/ams/libinclude.php index 230c6849c..20b1dba0a 100644 --- a/code/web/private_php/ams/libinclude.php +++ b/code/web/private_php/ams/libinclude.php @@ -3,7 +3,7 @@ * Base include file for library functions for AMS. * Autoload function that loads the classes in case they aren't loaded yet. */ -function __autoload( $className ){ +function __ams_autoload( $className ){ global $AMS_LIB; global $SITEBASE; //if the class exists in the lib's autload dir, load that one @@ -16,4 +16,6 @@ function __autoload( $className ){ } } +spl_autoload_register( '__ams_autoload' ); + diff --git a/code/web/private_php/ams/smarty/libs/sysplugins/smarty_internal_compilebase.php b/code/web/private_php/ams/smarty/libs/sysplugins/smarty_internal_compilebase.php index f78f15f40..075b2a72e 100644 --- a/code/web/private_php/ams/smarty/libs/sysplugins/smarty_internal_compilebase.php +++ b/code/web/private_php/ams/smarty/libs/sysplugins/smarty_internal_compilebase.php @@ -72,30 +72,31 @@ abstract class Smarty_Internal_CompileBase } // named attribute } else { - $kv = each($mixed); - // option flag? - if (in_array($kv['key'], $this->option_flags)) { - if (is_bool($kv['value'])) { - $_indexed_attr[$kv['key']] = $kv['value']; - } elseif (is_string($kv['value']) && in_array(trim($kv['value'], '\'"'), array('true', 'false'))) { - if (trim($kv['value']) == 'true') { - $_indexed_attr[$kv['key']] = true; + foreach($mixed as $k => $v) { + // option flag? + if (in_array($k, $this->option_flags)) { + if (is_bool($v)) { + $_indexed_attr[$k] = $v; + } elseif (is_string($v) && in_array(trim($v, '\'"'), array('true', 'false'))) { + if (trim($v) == 'true') { + $_indexed_attr[$k] = true; + } else { + $_indexed_attr[$k] = false; + } + } elseif (is_numeric($v) && in_array($v, array(0, 1))) { + if ($v == 1) { + $_indexed_attr[$k] = true; + } else { + $_indexed_attr[$k] = false; + } } else { - $_indexed_attr[$kv['key']] = false; - } - } elseif (is_numeric($kv['value']) && in_array($kv['value'], array(0, 1))) { - if ($kv['value'] == 1) { - $_indexed_attr[$kv['key']] = true; - } else { - $_indexed_attr[$kv['key']] = false; + $compiler->trigger_template_error("illegal value of option flag \"{$k}\"", $compiler->lex->taglineno); } + // must be named attribute } else { - $compiler->trigger_template_error("illegal value of option flag \"{$kv['key']}\"", $compiler->lex->taglineno); + reset($mixed); + $_indexed_attr[$k] = $v; } - // must be named attribute - } else { - reset($mixed); - $_indexed_attr[key($mixed)] = $mixed[key($mixed)]; } } } diff --git a/code/web/public_php/admin/common.php b/code/web/public_php/admin/common.php index 1ddecc2d9..ceb9aa87b 100644 --- a/code/web/public_php/admin/common.php +++ b/code/web/public_php/admin/common.php @@ -32,7 +32,7 @@ $tpl = new Smarty; if (!is_object($tpl)) die("error on smarty init"); - $iPhone = (strstr($_SERVER['HTTP_USER_AGENT'], "iPhone") !== FALSE); + $iPhone = (strstr($_SERVER['HTTP_USER_AGENT'], "iPhone") !== FALSE); $tpl->assign('iPhone', $iPhone); $tpl->template_dir = NELTOOL_SYSTEMBASE .'/templates/default/'; diff --git a/code/web/public_php/admin/functions_common.php b/code/web/public_php/admin/functions_common.php index c7553fcba..a06183109 100644 --- a/code/web/public_php/admin/functions_common.php +++ b/code/web/public_php/admin/functions_common.php @@ -4,6 +4,13 @@ * THIS FILE SHOULD ONLY INCLUDE SMALL USEFUL FUNCTIONS */ + if (!function_exists('ereg')) { + /** removed from php 7.0.0 */ + function ereg($pattern, $line, &$match = array()) { + return preg_match('/'.$pattern.'/', $line, $match); + } + } + /* * pushes some data in the debug variable */ @@ -206,4 +213,4 @@ } } -?> \ No newline at end of file +?> diff --git a/code/web/public_php/admin/functions_mysql.php b/code/web/public_php/admin/functions_mysql.php deleted file mode 100644 index 79c968ca9..000000000 --- a/code/web/public_php/admin/functions_mysql.php +++ /dev/null @@ -1,381 +0,0 @@ -persistency = $persistency; - $this->user = $sqluser; - $this->password = $sqlpassword; - $this->server = $sqlserver; - $this->dbname = $database; - - if($this->persistency) - { - $this->db_connect_id = mysql_pconnect($this->server, $this->user, $this->password); - } - else - { - $this->db_connect_id = mysql_connect($this->server, $this->user, $this->password); - } - if($this->db_connect_id) - { - if($database != "") - { - $this->dbname = $database; - $dbselect = mysql_select_db($this->dbname); - if(!$dbselect) - { - mysql_close($this->db_connect_id); - $this->db_connect_id = $dbselect; - } - } - return $this->db_connect_id; - } - else - { - echo "Connection to mySQL failed!"; - exit; - } - } - - // - // Other base methods - // - function sql_close() - { - if($this->db_connect_id) - { - if($this->query_result) - { - @mysql_free_result($this->query_result); - } - $result = mysql_close($this->db_connect_id); - return $result; - } - else - { - return false; - } - } - - // - // Base query method - // - function sql_query($query = "", $transaction = FALSE) - { - // Remove any pre-existing queries - unset($this->query_result); - if($query != "") - { - nt_common_add_debug($query); - $this->num_queries++; - $this->query_result = mysql_query($query, $this->db_connect_id); - } - if($this->query_result) - { - unset($this->row[$this->query_result]); - unset($this->rowset[$this->query_result]); - return $this->query_result; - } - else - { - return ( $transaction == 'END_TRANSACTION' ) ? true : false; - } - } - - function sql_select_db($dbname) - { - if($this->db_connect_id) - { - $result = mysql_select_db($dbname, $this->db_connect_id); - return $result; - } - return false; - } - function sql_reselect_db() - { - if($this->db_connect_id) - { - $result = mysql_select_db($this->dbname, $this->db_connect_id); - return $result; - } - return false; - } - // - // Other query methods - // - function sql_numrows($query_id = 0) - { - if(!$query_id) - { - $query_id = $this->query_result; - } - if($query_id) - { - $result = mysql_num_rows($query_id); - return $result; - } - else - { - return false; - } - } - function sql_affectedrows() - { - if($this->db_connect_id) - { - $result = mysql_affected_rows($this->db_connect_id); - return $result; - } - else - { - return false; - } - } - function sql_numfields($query_id = 0) - { - if(!$query_id) - { - $query_id = $this->query_result; - } - if($query_id) - { - $result = mysql_num_fields($query_id); - return $result; - } - else - { - return false; - } - } - function sql_fieldname($offset, $query_id = 0) - { - if(!$query_id) - { - $query_id = $this->query_result; - } - if($query_id) - { - $result = mysql_field_name($query_id, $offset); - return $result; - } - else - { - return false; - } - } - function sql_fieldtype($offset, $query_id = 0) - { - if(!$query_id) - { - $query_id = $this->query_result; - } - if($query_id) - { - $result = mysql_field_type($query_id, $offset); - return $result; - } - else - { - return false; - } - } - function sql_fetchrow($query_id = 0) - { - if(!$query_id) - { - $query_id = $this->query_result; - } - if($query_id) - { - $this->row[$query_id] = mysql_fetch_array($query_id); - return $this->row[$query_id]; - } - else - { - return false; - } - } - function sql_fetchrowset($query_id = 0) - { - if(!$query_id) - { - $query_id = $this->query_result; - } - if($query_id) - { - unset($this->rowset[$query_id]); - unset($this->row[$query_id]); - while($this->rowset[$query_id] = mysql_fetch_array($query_id)) - { - $result[] = $this->rowset[$query_id]; - } - return $result; - } - else - { - return false; - } - } - function sql_fetchfield($field, $rownum = -1, $query_id = 0) - { - if(!$query_id) - { - $query_id = $this->query_result; - } - if($query_id) - { - if($rownum > -1) - { - $result = mysql_result($query_id, $rownum, $field); - } - else - { - if(empty($this->row[$query_id]) && empty($this->rowset[$query_id])) - { - if($this->sql_fetchrow()) - { - $result = $this->row[$query_id][$field]; - } - } - else - { - if($this->rowset[$query_id]) - { - $result = $this->rowset[$query_id][$field]; - } - else if($this->row[$query_id]) - { - $result = $this->row[$query_id][$field]; - } - } - } - return $result; - } - else - { - return false; - } - } - function sql_rowseek($rownum, $query_id = 0){ - if(!$query_id) - { - $query_id = $this->query_result; - } - if($query_id) - { - $result = mysql_data_seek($query_id, $rownum); - return $result; - } - else - { - return false; - } - } - function sql_nextid(){ - if($this->db_connect_id) - { - $result = mysql_insert_id($this->db_connect_id); - return $result; - } - else - { - return false; - } - } - function sql_freeresult($query_id = 0){ - if(!$query_id) - { - $query_id = $this->query_result; - } - - if ( $query_id ) - { - unset($this->row[$query_id]); - unset($this->rowset[$query_id]); - - @mysql_free_result($query_id); - - return true; - } - else - { - return false; - } - } - function sql_error($query_id = 0) - { - $result["message"] = mysql_error($this->db_connect_id); - $result["code"] = mysql_errno($this->db_connect_id); - - return $result; - } - -} // class sql_db - -class sql_db_string extends sql_db -{ - // - // Constructor ($connstring format : mysql://user:password@host/dbname) - // - function sql_db_string($connstring, $persistency = true) - { - $ret = false; - - if ($connstring != '') - { - if (ereg("^mysql\:\/\/([^\:]+)\:([^\@]+)\@([^\\]+)\/([^\/]+)[\/]?$", $connstring, $params)) - { - $sqlserver = $params[3]; - $sqluser = $params[1]; - $sqlpassword = $params[2]; - $database = $params[4]; - - $ret = $this->sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency); - } - } - - return $ret; - } -} // class sql_db_string - - -} // if ... define - -?> \ No newline at end of file diff --git a/code/web/public_php/admin/functions_mysqli.php b/code/web/public_php/admin/functions_mysqli.php index 8cc2737c3..82ef9efa7 100644 --- a/code/web/public_php/admin/functions_mysqli.php +++ b/code/web/public_php/admin/functions_mysqli.php @@ -41,7 +41,7 @@ class sql_db // // Constructor // - function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true) + function __construct($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true) { $this->persistency = $persistency; @@ -72,8 +72,7 @@ class sql_db } else { - echo "Connection to mySQL failed!"; - exit; + throw new \RuntimeException('Connection to mySQL failed!'); } } @@ -270,7 +269,7 @@ class sql_db_string extends sql_db // // Constructor ($connstring format : mysql://user:password@host/dbname) // - function sql_db_string($connstring, $persistency = true) + function __construct($connstring, $persistency = true) { $ret = false; if ($connstring != '') @@ -282,10 +281,9 @@ class sql_db_string extends sql_db $sqlpassword = $params[2]; $database = $params[4]; - $ret = $this->sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency); + $ret = parent::__construct($sqlserver, $sqluser, $sqlpassword, $database, $persistency); } } - return $ret; } } // class sql_db_string diff --git a/code/web/public_php/admin/functions_tool_log_analyser.php b/code/web/public_php/admin/functions_tool_log_analyser.php index 3d5478b4b..caf79a9b3 100644 --- a/code/web/public_php/admin/functions_tool_log_analyser.php +++ b/code/web/public_php/admin/functions_tool_log_analyser.php @@ -30,7 +30,7 @@ reset($file_list); foreach($file_list as $tmp_key => $tmp_val) { - $date_ary[$tmp_key] = $file_list['date']; + $date_ary[$tmp_key] = $tmp_val['date']; } array_multisort($date_ary, SORT_DESC, $file_list); @@ -242,4 +242,4 @@ } -?> \ No newline at end of file +?> diff --git a/code/web/public_php/admin/functions_tool_main.php b/code/web/public_php/admin/functions_tool_main.php index cb541a83e..97d833fd3 100644 --- a/code/web/public_php/admin/functions_tool_main.php +++ b/code/web/public_php/admin/functions_tool_main.php @@ -320,6 +320,9 @@ foreach($sline_vars as $sline_var) { $sline_parts = explode("=", $sline_var); + if (!isset($sline_parts[1])) { + $sline_parts[1] = ''; + } if ($sline_parts[0] == 'RunningState') { @@ -1023,6 +1026,7 @@ function tool_main_get_shards_info_from_db($application, $status, $filters, $ringsqlstring='') { $shard_list = array(); + $shard_list2 = array(); $shard_list_result = array(); //nt_common_add_debug('in tool_main_get_shards_info_from_db()'); @@ -1034,7 +1038,7 @@ foreach($status as $sline) { $shard_name = trim($sline['ShardName']); - $shard_id = trim($sline['ShardId']); + $shard_id = isset($sline['ShardId']) ? trim($sline['ShardId']) : ''; if (($shard_name != '' && $shard_id != '') && (isset($filters[$shard_name]) || isset($filters['_all_']))) { diff --git a/code/web/public_php/admin/jpgraph/jpgraph.php b/code/web/public_php/admin/jpgraph/jpgraph.php index ee41112fc..0d0dfbfbf 100644 --- a/code/web/public_php/admin/jpgraph/jpgraph.php +++ b/code/web/public_php/admin/jpgraph/jpgraph.php @@ -225,7 +225,7 @@ require_once 'jpgraph_gradient.php'; class ErrMsgText { var $lt=NULL; var $supportedLocales = array('en'); - function ErrMsgText() { + function __construct() { GLOBAL $__jpg_err_locale; if( !in_array($__jpg_err_locale,$this->supportedLocales) ) $aLoc = 'en'; @@ -294,16 +294,16 @@ GLOBAL $__jpg_err; GLOBAL $__jpg_err_locale ; $__jpg_err_locale = 'en'; class JpGraphError { - function Install($aErrObject) { + static function Install($aErrObject) { GLOBAL $__jpg_err; $__jpg_err = $aErrObject; } - function Raise($aMsg,$aHalt=true){ + static function Raise($aMsg,$aHalt=true){ GLOBAL $__jpg_err; $tmp = new $__jpg_err; $tmp->Raise($aMsg,$aHalt); } - function RaiseL($errnbr,$a1=null,$a2=null,$a3=null,$a4=null,$a5=null) { + static function RaiseL($errnbr,$a1=null,$a2=null,$a3=null,$a4=null,$a5=null) { GLOBAL $__jpg_err; $t = new ErrMsgText(); $msg = $t->Get($errnbr,$a1,$a2,$a3,$a4,$a5); @@ -383,7 +383,7 @@ class JpGraphErrObject { var $iTitle = "JpGraph Error"; var $iDest = false; - function JpGraphErrObject() { + function __construct() { // Empty. Reserved for future use } @@ -631,7 +631,7 @@ class JpgTimer { var $idx; //--------------- // CONSTRUCTOR - function JpgTimer() { + function __construct() { $this->idx=0; } @@ -671,7 +671,7 @@ class DateLocale { //--------------- // CONSTRUCTOR - function DateLocale() { + function __construct() { settype($this->iDayAbb, 'array'); settype($this->iShortDay, 'array'); settype($this->iShortMonth, 'array'); @@ -758,7 +758,7 @@ class Footer { var $iRightMargin = 3; var $iBottomMargin = 3; - function Footer() { + function __construct() { $this->left = new Text(); $this->left->ParagraphAlign('left'); $this->center = new Text(); @@ -866,7 +866,7 @@ class Graph { // aTimeOut Timeout in minutes for image in cache // aInline If true the image is streamed back in the call to Stroke() // If false the image is just created in the cache - function Graph($aWidth=300,$aHeight=200,$aCachedName="",$aTimeOut=0,$aInline=true) { + function __construct($aWidth=300,$aHeight=200,$aCachedName="",$aTimeOut=0,$aInline=true) { GLOBAL $gJpgBrandTiming; // If timing is used create a new timing object if( $gJpgBrandTiming ) { @@ -3071,7 +3071,7 @@ class TTF { var $font_files,$style_names; //--------------- // CONSTRUCTOR - function TTF() { + function __construct() { $this->style_names=array(FS_NORMAL=>'normal',FS_BOLD=>'bold',FS_ITALIC=>'italic',FS_BOLDITALIC=>'bolditalic'); // File names for available fonts $this->font_files=array( @@ -3193,7 +3193,7 @@ class Text { // CONSTRUCTOR // Create new text at absolute pixel coordinates - function Text($aTxt="",$aXAbsPos=0,$aYAbsPos=0) { + function __construct($aTxt="",$aXAbsPos=0,$aYAbsPos=0) { if( ! is_string($aTxt) ) { JpGraphError::RaiseL(25050);//('First argument to Text::Text() must be s atring.'); } @@ -3429,7 +3429,8 @@ class GraphTabTitle extends Text{ var $corner = 6 , $posx = 7, $posy = 4; var $color='darkred',$fillcolor='lightyellow',$bordercolor='black'; var $align = 'left', $width=TABTITLE_WIDTHFIT; - function GraphTabTitle() { + function __construct() { + parent::__construct(); $this->t = ''; $this->font_style = FS_BOLD; $this->hide = true; @@ -3450,8 +3451,9 @@ class GraphTabTitle extends Text{ $this->align = $aAlign; } - function SetPos($aAlign) { - $this->align = $aAlign; + function SetPos($aXAbsPos = 0, $aYAbsPos = 0, $aHAlign = 'left', $aVAlign = 'top') { + //$this->align = $aXAbsPos; + throw new \Exception('Invalid function call. should use SetTabAlign()'); } function SetWidth($aWidth) { @@ -3467,7 +3469,8 @@ class GraphTabTitle extends Text{ $this->corner = $aD ; } - function Stroke(&$aImg) { + // parent class compat function + function Stroke(&$aImg, $x = NULL, $y = NULL) { if( $this->hide ) return; $this->boxed = false; @@ -3560,8 +3563,8 @@ class SuperScriptText extends Text { var $iSDir=0; var $iSimple=false; - function SuperScriptText($aTxt="",$aSuper="",$aXAbsPos=0,$aYAbsPos=0) { - parent::Text($aTxt,$aXAbsPos,$aYAbsPos); + function __construct($aTxt="",$aSuper="",$aXAbsPos=0,$aYAbsPos=0) { + parent::__construct($aTxt,$aXAbsPos,$aYAbsPos); $this->iSuper = $aSuper; } @@ -3738,7 +3741,7 @@ class Grid { var $fill=false,$fillcolor=array('#EFEFEF','#BBCCFF'); //--------------- // CONSTRUCTOR - function Grid(&$aAxis) { + function __construct(&$aAxis) { $this->scale = &$aAxis->scale; $this->img = &$aAxis->img; } @@ -3901,7 +3904,7 @@ class Axis { //--------------- // CONSTRUCTOR - function Axis(&$img,&$aScale,$color=array(0,0,0)) { + function __construct(&$img,&$aScale,$color=array(0,0,0)) { $this->img = &$img; $this->scale = &$aScale; $this->color = $color; @@ -4356,7 +4359,7 @@ class Ticks { //--------------- // CONSTRUCTOR - function Ticks(&$aScale) { + function __construct(&$aScale) { $this->scale=&$aScale; $this->precision = -1; } @@ -4483,7 +4486,8 @@ class LinearTicks extends Ticks { //--------------- // CONSTRUCTOR - function LinearTicks() { + function __construct() { + parent::__construct(); $this->precision = -1; } @@ -4825,7 +4829,7 @@ class LinearScale { var $name = 'lin'; //--------------- // CONSTRUCTOR - function LinearScale($aMin=0,$aMax=0,$aType="y") { + function __construct($aMin=0,$aMax=0,$aType="y") { assert($aType=="x" || $aType=="y" ); assert($aMin<=$aMax); @@ -5360,7 +5364,7 @@ class LinearScale { class RGB { var $rgb_table; var $img; - function RGB(&$aImg) { + function __construct(&$aImg) { $this->img = &$aImg; // Conversion array between color names and RGB @@ -5950,7 +5954,7 @@ class Image { //--------------- // CONSTRUCTOR - function Image($aWidth,$aHeight,$aFormat=DEFAULT_GFORMAT) { + function __construct($aWidth,$aHeight,$aFormat=DEFAULT_GFORMAT) { $this->CreateImgCanvas($aWidth,$aHeight); $this->SetAutoMargin(); @@ -7531,8 +7535,8 @@ class RotImage extends Image { var $a=0; var $dx=0,$dy=0,$transx=0,$transy=0; - function RotImage($aWidth,$aHeight,$a=0,$aFormat=DEFAULT_GFORMAT) { - $this->Image($aWidth,$aHeight,$aFormat); + function __construct($aWidth,$aHeight,$a=0,$aFormat=DEFAULT_GFORMAT) { + parent::__construct($aWidth,$aHeight,$aFormat); $this->dx=$this->left_margin+$this->plotwidth/2; $this->dy=$this->top_margin+$this->plotheight/2; $this->SetAngle($a); @@ -7597,7 +7601,7 @@ class RotImage extends Image { parent::Arc($xc,$yc,$w,$h,$s,$e); } - function FilledArc($xc,$yc,$w,$h,$s,$e) { + function FilledArc($xc,$yc,$w,$h,$s,$e, $style='') { list($xc,$yc) = $this->Rotate($xc,$yc); $s += $this->a; $e += $this->a; @@ -7686,7 +7690,7 @@ class ImgStreamCache { var $timeout=0; // Infinite timeout //--------------- // CONSTRUCTOR - function ImgStreamCache(&$aImg, $aCacheDir=CACHE_DIR) { + function __construct(&$aImg, $aCacheDir=CACHE_DIR) { $this->img = &$aImg; $this->cache_dir = $aCacheDir; } @@ -7862,7 +7866,7 @@ class Legend { var $reverse = false ; //--------------- // CONSTRUCTOR - function Legend() { + function __construct() { // Empty } //--------------- @@ -8334,7 +8338,7 @@ class Plot { var $legendcsimalt=''; //--------------- // CONSTRUCTOR - function Plot(&$aDatay,$aDatax=false) { + function __construct(&$aDatay,$aDatax=false) { $this->numpoints = count($aDatay); if( $this->numpoints==0 ) JpGraphError::RaiseL(25121);//("Empty input data array specified for plot. Must have at least one data point."); @@ -8510,7 +8514,7 @@ class PlotLine { //--------------- // CONSTRUCTOR - function PlotLine($aDir=HORIZONTAL,$aPos=0,$aColor="black",$aWeight=1) { + function __construct($aDir=HORIZONTAL,$aPos=0,$aColor="black",$aWeight=1) { $this->direction = $aDir; $this->color=$aColor; $this->weight=$aWeight; diff --git a/code/web/public_php/admin/jpgraph/jpgraph_gradient.php b/code/web/public_php/admin/jpgraph/jpgraph_gradient.php index d7382c060..356657950 100644 --- a/code/web/public_php/admin/jpgraph/jpgraph_gradient.php +++ b/code/web/public_php/admin/jpgraph/jpgraph_gradient.php @@ -34,7 +34,7 @@ class Gradient { var $numcolors=100; //--------------- // CONSTRUCTOR - function Gradient(&$img) { + function __construct(&$img) { $this->img = &$img; } diff --git a/code/web/public_php/admin/jpgraph/jpgraph_line.php b/code/web/public_php/admin/jpgraph/jpgraph_line.php index 4f9c0d0fb..60ef128ce 100644 --- a/code/web/public_php/admin/jpgraph/jpgraph_line.php +++ b/code/web/public_php/admin/jpgraph/jpgraph_line.php @@ -36,8 +36,8 @@ class LinePlot extends Plot{ //--------------- // CONSTRUCTOR - function LinePlot(&$datay,$datax=false) { - $this->Plot($datay,$datax); + function __construct(&$datay,$datax=false) { + parent::__construct($datay,$datax); $this->mark = new PlotMark(); } //--------------- @@ -424,7 +424,7 @@ class AccLinePlot extends Plot { var $iStartEndZero=true; //--------------- // CONSTRUCTOR - function AccLinePlot($plots) { + function __construct($plots) { $this->plots = $plots; $this->nbrplots = count($plots); $this->numpoints = $plots[0]->numpoints; diff --git a/code/web/public_php/admin/jpgraph/jpgraph_log.php b/code/web/public_php/admin/jpgraph/jpgraph_log.php index 95882e71a..d9561f56e 100644 --- a/code/web/public_php/admin/jpgraph/jpgraph_log.php +++ b/code/web/public_php/admin/jpgraph/jpgraph_log.php @@ -23,8 +23,8 @@ class LogScale extends LinearScale { // CONSTRUCTOR // Log scale is specified using the log of min and max - function LogScale($min,$max,$type="y") { - $this->LinearScale($min,$max,$type); + function __construct($min,$max,$type="y") { + parent::__construct($min,$max,$type); $this->ticks = new LogTicks(); $this->name = 'log'; } @@ -84,7 +84,7 @@ class LogScale extends LinearScale { // Note that for log autoscale the "maxstep" the fourth argument // isn't used. This is just included to give the method the same // signature as the linear counterpart. - function AutoScale(&$img,$min,$max,$dummy) { + function AutoScale(&$img,$min,$max,$dummy, $dummy2 = true) { if( $min==0 ) $min=1; if( $max <= 0 ) { @@ -107,7 +107,8 @@ class LogTicks extends Ticks{ var $label_logtype=LOGLABELS_MAGNITUDE; //--------------- // CONSTRUCTOR - function LogTicks() { + function __construct() { + parent::__construct(); } //--------------- // PUBLIC METHODS @@ -264,4 +265,4 @@ class LogTicks extends Ticks{ } } // Class /* EOF */ -?> \ No newline at end of file +?> diff --git a/code/web/public_php/admin/jpgraph/jpgraph_plotmark.inc b/code/web/public_php/admin/jpgraph/jpgraph_plotmark.inc index bc955bda7..c555aab6e 100644 --- a/code/web/public_php/admin/jpgraph/jpgraph_plotmark.inc +++ b/code/web/public_php/admin/jpgraph/jpgraph_plotmark.inc @@ -59,7 +59,7 @@ class FlagCache { global $_gFlagCache; require_once('jpgraph_flags.php'); if( $_gFlagCache[$aSize] === null ) { - $_gFlagCache[$aSize] =& new FlagImages($aSize); + $_gFlagCache[$aSize] = new FlagImages($aSize); } $f =& $_gFlagCache[$aSize]; $idx = $f->GetIdxByName($aName,$aFullName); @@ -89,7 +89,7 @@ class PlotMark { //-------------- // CONSTRUCTOR - function PlotMark() { + function __construct() { $this->title = new Text(); $this->title->Hide(); $this->csimareas = ''; @@ -479,4 +479,4 @@ class PlotMark { } // Class -?> \ No newline at end of file +?> diff --git a/code/web/public_php/admin/jpgraph/jpgraph_polar.php b/code/web/public_php/admin/jpgraph/jpgraph_polar.php index acab58b88..1690fcb2a 100644 --- a/code/web/public_php/admin/jpgraph/jpgraph_polar.php +++ b/code/web/public_php/admin/jpgraph/jpgraph_polar.php @@ -47,7 +47,7 @@ class PolarPlot { var $csimalts=null; // ALT:s for corresponding target var $line_style='solid',$mark; - function PolarPlot($aData) { + function __construct($aData) { $n = count($aData); if( $n & 1 ) { JpGraphError::RaiseL(17001); diff --git a/code/web/public_php/admin/jpgraph/jpgraph_radar.php b/code/web/public_php/admin/jpgraph/jpgraph_radar.php index ac3b8b38c..d08ca0d11 100644 --- a/code/web/public_php/admin/jpgraph/jpgraph_radar.php +++ b/code/web/public_php/admin/jpgraph/jpgraph_radar.php @@ -15,7 +15,7 @@ require_once('jpgraph_plotmark.inc'); class RadarLogTicks extends Ticks { //--------------- // CONSTRUCTOR - function RadarLogTicks() { + function __construct() { } //--------------- // PUBLIC METHODS @@ -468,17 +468,17 @@ class RadarGraph extends Graph { //("Illegal scale for radarplot ($axtype). Must be \"lin\" or \"log\""); } if( $axtype=="lin" ) { - $this->yscale = & new LinearScale($ymin,$ymax); - $this->yscale->ticks = & new RadarLinearTicks(); + $this->yscale = new LinearScale($ymin,$ymax); + $this->yscale->ticks = new RadarLinearTicks(); $this->yscale->ticks->SupressMinorTickMarks(); } elseif( $axtype=="log" ) { - $this->yscale = & new LogScale($ymin,$ymax); - $this->yscale->ticks = & new RadarLogTicks(); + $this->yscale = new LogScale($ymin,$ymax); + $this->yscale->ticks = new RadarLogTicks(); } - $this->axis = & new RadarAxis($this->img,$this->yscale); - $this->grid = & new RadarGrid(); + $this->axis = new RadarAxis($this->img,$this->yscale); + $this->grid = new RadarGrid(); } function SetSize($aSize) { @@ -644,4 +644,4 @@ class RadarGraph extends Graph { } // Class /* EOF */ -?> \ No newline at end of file +?> diff --git a/code/web/public_php/admin/nel/nel_message.php b/code/web/public_php/admin/nel/nel_message.php index 42dd91cbe..ab0e55f0e 100644 --- a/code/web/public_php/admin/nel/nel_message.php +++ b/code/web/public_php/admin/nel/nel_message.php @@ -19,7 +19,7 @@ var $InputStream; var $Pos; - function CMemStream () + function __construct() { $this->InputStream = false; $this->Pos = 0; @@ -104,11 +104,6 @@ { var $MsgName; - function CMessage() - { - $this->CMemStream(); - } - function setName($name) { $this->MsgName = $name; diff --git a/code/web/public_php/admin/smarty/Smarty.class.php b/code/web/public_php/admin/smarty/Smarty.class.php index 39eed5fc5..d57c1f67e 100644 --- a/code/web/public_php/admin/smarty/Smarty.class.php +++ b/code/web/public_php/admin/smarty/Smarty.class.php @@ -566,7 +566,7 @@ class Smarty /** * The class constructor. */ - function Smarty() + function __construct() { $this->assign('SCRIPT_NAME', isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : @$GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']); diff --git a/code/web/public_php/admin/smarty/Smarty_Compiler.class.php b/code/web/public_php/admin/smarty/Smarty_Compiler.class.php index c1bc798d1..27bf469f1 100644 --- a/code/web/public_php/admin/smarty/Smarty_Compiler.class.php +++ b/code/web/public_php/admin/smarty/Smarty_Compiler.class.php @@ -78,8 +78,10 @@ class Smarty_Compiler extends Smarty { /** * The class constructor. */ - function Smarty_Compiler() + function __construct() { + parent::__construct(); + // matches double quoted strings: // "foobar" // "foo\"bar" @@ -262,12 +264,11 @@ class Smarty_Compiler extends Smarty { reset($this->_folded_blocks); /* replace special blocks by "{php}" */ - $source_content = preg_replace_callback($search, create_function ('$matches', "return '" - . $this->_quote_replace($this->left_delimiter) . 'php' - . "' . str_repeat(\"\n\", substr_count('\$matches[1]', \"\n\")) .'" - . $this->_quote_replace($this->right_delimiter) - . "';") - , $source_content); + $source_content = preg_replace_callback($search, function($matches) { + return $this->_quote_replace($this->left_delimiter).'php'. + str_repeat("\n", substr_count($matches[1], "\n")). + $this->_quote_replace($this->right_delimiter); + }, $source_content); /* Gather all template tags. */ preg_match_all("~{$ldq}\s*(.*?)\s*{$rdq}~s", $source_content, $_match); @@ -556,7 +557,7 @@ class Smarty_Compiler extends Smarty { case 'php': /* handle folded tags replaced by {php} */ - list(, $block) = each($this->_folded_blocks); + $block = current($this->_folded_blocks); $this->_current_line_no += substr_count($block[0], "\n"); /* the number of matched elements in the regexp in _compile_file() determins the type of folded tag that was found */ diff --git a/code/web/public_php/admin/templates/default/_index.tpl b/code/web/public_php/admin/templates/default/_index.tpl deleted file mode 100644 index 9f7a11340..000000000 --- a/code/web/public_php/admin/templates/default/_index.tpl +++ /dev/null @@ -1,486 +0,0 @@ - -{include file="page_header.tpl"} - -{literal} - -{/literal} - -
- - - - - - - - - -
- -{if $tool_domain_selected && $tool_shard_selected} - - - - - - - - -{if $tool_refresh_rate > 0} - - - -{/if} - -
Refresh
- -
- - -
-
-{/if} - - - - - -{section name=domain loop=$tool_domain_list} - - - -{/section} -
Domains
{$tool_domain_list[domain].domain_name}
- -{if $tool_domain_selected} -
- - - - -{section name=shard loop=$tool_shard_list} -{if $tool_domain_selected == $tool_shard_list[shard].shard_domain_id} - - - -{/if} -{/section} -
Shards
{$tool_shard_list[shard].shard_name}
-{/if} - -{if $restriction_tool_notes && $tool_note_list} -
- - - - -{section name=note loop=$tool_note_list} - -{if $tool_note_list[note].note_mode == 0} - -{elseif $tool_note_list[note].note_mode == 1} - -{/if} - -{/section} -
Notes
{$tool_note_list[note].note_title}{$tool_note_list[note].note_title}
-{/if} - -{if $tool_hd_list} -
- - - - -{section name=hd loop=$tool_hd_list} -{if $tool_hd_list[hd].hd_percent >= 85}{assign var="hdtrclass" value="row_red"} -{elseif $tool_hd_list[hd].hd_percent >= 75}{assign var="hdtrclass" value="row_orange_light"} -{else}{assign var="hdtrclass" value="row0"}{/if} - - - - -{/section} - - - -
HardDrives
{$tool_hd_list[hd].hd_server}{$tool_hd_list[hd].hd_percent}%
{$tool_hd_time|date_format:"%Y/%m/%d %H:%M:%S"}
-{/if} - -
  -{if tool_domain_selected && $tool_shard_selected} - - -{if $tool_annotation_info || $tool_has_lock} - - - - -{/if} - - - - - - -
Annotation {if $tool_has_lock}{/if} -{if $tool_annotation_info} - ({$tool_annotation_info.annotation_user_name} @ {$tool_annotation_info.annotation_date|date_format:"%Y/%m/%d %H:%M:%S"}) -{/if} -
Lock -{if $tool_no_lock} -{* if (!$tool_lock_info || $tool_lock_info.lock_shard_id) && !$tool_cant_lock && ($tool_shard_restart_status == 0) && !$tool_no_domain_lock *} -{if (!$tool_lock_info || $tool_lock_info.lock_shard_id) && !$tool_cant_lock && !$tool_no_domain_lock} - {if $restriction_tool_main_lock_shard}{/if} -{else} - Lock unavailable, a restart sequence is active ! -{/if} -{if ($tool_shard_restart_status == 0) && ($tool_domain_has_shard_restart == 0)} - {if $restriction_tool_main_lock_domain}{/if} -{/if} -{elseif $tool_has_shard_lock} -{if $tool_shard_restart_status == 0} - -{/if} -{if ($tool_shard_restart_status == 0) && ($tool_domain_has_shard_restart == 0)} - {if $restriction_tool_main_lock_domain}{/if} -{elseif $tool_shard_restart_status > 0} - Restart Sequence is active ! -{/if} - -{if $restriction_tool_main_easy_restart && ($tool_shard_restart_status == 0)} - - -{/if} - -{elseif $tool_has_domain_lock} - -{/if} -{if $tool_lock_info} -{if $tool_lock_info.lock_domain_id} Domain{elseif $tool_lock_info.lock_shard_id} Shard{/if} - Locked by {$tool_lock_info.lock_user_name} @ {$tool_lock_info.lock_date|date_format:"%Y/%m/%d %H:%M:%S"} -{else} - Unlocked. -{/if} -
-
-{/if} - -{if !$tool_domain_selected} - - - - -
You need to select a domain.
-{elseif !$tool_shard_selected} - - - - -
You need to select a shard.
-{elseif $tool_domain_error} - - - - -
{$tool_domain_error}
-{else} -{if $tool_as_error} - - - - -
{$tool_as_error}
-
-{/if} -
- - - - - -{**} - -{**} - - - - - - - - - - - - - -{section name=service loop=$tool_services_list} -{assign var="service_shard_id" value=$tool_services_list[service].ShardName} -{if $tool_shard_filters.$service_shard_id || $tool_shard_filters._all_ || ($tool_shard_filters._unknown_ && !$tool_services_list[service].ShardName)} -{cycle assign="trclass" values="row0,row1"} -{assign var="tdclass1" value=""} -{assign var="tdclass2" value=""} -{if $tool_services_list[service]._flags_.rs_stopped}{assign var="tdclass1" value="class=\"cell_inactive1\""}{assign var="tdclass2" value="class=\"cell_inactive2\""}{assign var="trclass" value="row_stopped"}{/if} -{if $tool_services_list[service]._flags_.rs_starting}{* assign var="tdclass1" value="class=\"cell_inactive1\"" *}{assign var="tdclass2" value="class=\"cell_inactive2\""}{assign var="trclass" value="row_starting"}{/if} -{if $tool_services_list[service]._flags_.alert_red && ($tool_services_list[service]._flags_.rs_starting || $tool_services_list[service]._flags_.rs_online)}{assign var="trclass" value="row_red"} -{elseif $tool_services_list[service]._flags_.alert_orange_dark && ($tool_services_list[service]._flags_.rs_starting || $tool_services_list[service]._flags_.rs_online)}{assign var="trclass" value="row_orange_dark"} -{elseif $tool_services_list[service]._flags_.alert_orange_light && ($tool_services_list[service]._flags_.rs_starting || $tool_services_list[service]._flags_.rs_online)}{assign var="trclass" value="row_orange_light"}{/if} -{assign var="check_name" value=$tool_services_list[service].AliasName} - - - - -{**} - -{**} - - - - - - - - - - - - - -{/if} -{/section} -
AliasNameShardLongNameShortNameServiceAliasHostnameRunning StateRunning OrdersRunning TagsStateReportStart CountersUser SLTick SLMemoryNbPlayersUpTime
{$tool_services_list[service].AliasName}{if $tool_services_list[service].ShardName != ""}{$tool_services_list[service].ShardName}{else}?{/if}{if $tool_services_list[service].ShardId != ""}/{$tool_services_list[service].ShardId}{/if}{$tool_services_list[service].LongName}{$tool_services_list[service].ShortName}{$tool_services_list[service].ServiceAlias}{$tool_services_list[service].Hostname}{$tool_services_list[service].RunningState}{$tool_services_list[service].RunningOrders}{$tool_services_list[service].RunningTags}{$tool_services_list[service].State}{$tool_services_list[service].NoReportSince}{$tool_services_list[service].StartCounter}{$tool_services_list[service].UserSpeedLoop}{$tool_services_list[service].TickSpeedLoop}{$tool_services_list[service].ProcessUsedMemory}{$tool_services_list[service].NbPlayers}{$tool_services_list[service].UpTime}
- - -
- - -{if $restriction_tool_main_easy_restart && ($tool_shard_restart_status > 0)} - -{include file="index_restart_sequence.tpl"} - -{else} - -{if $restriction_tool_main_ws} -
- - - - - -
WS : {if $restriction_tool_main_ws_old}
new/old{/if}
-{if $restriction_tool_main_ws_old} - -{/if} -
- - - - - -{section name=shard loop=$tool_shard_run_list} -{assign var="sname" value=$tool_shard_run_list[shard]} -{if $tool_shard_infos[$sname] && $tool_shard_su_name} - - - - - - - -{/if} -{/section} -
 {$tool_shard_run_list[shard]} -  
-
-
-{/if} - -{if $restriction_tool_main_start || $restriction_tool_main_stop || $restriction_tool_main_restart || $restriction_tool_main_kill || $restriction_tool_main_abort || $restriction_tool_main_reset_counters || $restriction_tool_main_service_autostart} -
- - - - - -
Services :   -{if $restriction_tool_main_start} -   -{/if} -{if $restriction_tool_main_stop} -   -{/if} -{if $restriction_tool_main_restart} -   -{/if} -{if $restriction_tool_main_kill} -   -{/if} -{if $restriction_tool_main_abort} -   -{/if} -{if $restriction_tool_main_service_autostart} -   -   -{/if} -{if $restriction_tool_main_reset_counters} -   -{/if} -
-{/if} - -{if $restriction_tool_main_shard_autostart && $tool_shard_run_list} -
- - - - - -
Shards : - -{section name=shard loop=$tool_shard_run_list} -{assign var="sname" value=$tool_shard_run_list[shard]} - - - - - -{/section} -
 {$tool_shard_run_list[shard]}{if $sname != ""}{$tool_shard_orders[$sname]|replace:'_':' '}{/if}  -   -   -
-{/if} - -{if $restriction_tool_main_execute} -
- - - - - -
Command :    -   -
- -{if $tool_execute_command} -
- - - - - - - -
Command Results for '{$tool_execute_command}' :
-{/if} -{/if} - -{* end of: if $restriction_tool_main_easy_restart && ($tool_shard_restart_status > 0) *} -{/if} -
-{/if} - -
- - -{include file="page_footer.tpl"} diff --git a/code/web/public_php/admin/templates/default/index.tpl b/code/web/public_php/admin/templates/default/index.tpl index 04fe742df..6f7dea40f 100644 --- a/code/web/public_php/admin/templates/default/index.tpl +++ b/code/web/public_php/admin/templates/default/index.tpl @@ -195,7 +195,7 @@   -{if tool_domain_selected && $tool_shard_selected} +{if $tool_domain_selected && $tool_shard_selected} {if $tool_annotation_info || $tool_has_lock} diff --git a/code/web/public_php/login/config.php b/code/web/public_php/login/config.php index d69bdfea1..6ae107119 100644 --- a/code/web/public_php/login/config.php +++ b/code/web/public_php/login/config.php @@ -2,9 +2,10 @@ // This file contains all variables needed by other php scripts -require_once('../config.php'); +require_once dirname(__DIR__).'/config.php'; -$LogRelativePath = 'logs/'; +// !! IMPORTANT !! keep these outside public webroot +$LogRelativePath = '../../logs/'; // ---------------------------------------------------------------------------------------- // Variables for nel database access diff --git a/code/web/public_php/login/logs/placeholder b/code/web/public_php/login/logs/placeholder deleted file mode 100644 index 0519ecba6..000000000 --- a/code/web/public_php/login/logs/placeholder +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/code/web/public_php/ring/ring_session_manager_itf.php b/code/web/public_php/ring/ring_session_manager_itf.php index 4ef78555f..2c6afc477 100644 --- a/code/web/public_php/ring/ring_session_manager_itf.php +++ b/code/web/public_php/ring/ring_session_manager_itf.php @@ -21,7 +21,7 @@ { var $Value; - function RSMGR_TSessionPartStatus() + function __construct() { global $RSMGR_TSessionPartStatus_InvalidValue; $this->Value = $RSMGR_TSessionPartStatus_InvalidValue; @@ -81,7 +81,7 @@ { var $Value; - function RSMGR_TSessionType() + function __construct() { global $RSMGR_TSessionType_InvalidValue; $this->Value = $RSMGR_TSessionType_InvalidValue; @@ -143,7 +143,7 @@ { var $Value; - function RSMGR_TSessionOrientation() + function __construct() { global $RSMGR_TSessionOrientation_InvalidValue; $this->Value = $RSMGR_TSessionOrientation_InvalidValue; @@ -203,7 +203,7 @@ { var $Value; - function RSMGR_TSessionState() + function __construct() { global $RSMGR_TSessionState_InvalidValue; $this->Value = $RSMGR_TSessionState_InvalidValue; @@ -261,7 +261,7 @@ { var $Value; - function RSMGR_TAnimMode() + function __construct() { global $RSMGR_TAnimMode_InvalidValue; $this->Value = $RSMGR_TAnimMode_InvalidValue; @@ -319,7 +319,7 @@ { var $Value; - function RSMGR_TAccessType() + function __construct() { global $RSMGR_TAccessType_InvalidValue; $this->Value = $RSMGR_TAccessType_InvalidValue; @@ -377,7 +377,7 @@ { var $Value; - function RSMGR_TRuleType() + function __construct() { global $RSMGR_TRuleType_InvalidValue; $this->Value = $RSMGR_TRuleType_InvalidValue; @@ -439,7 +439,7 @@ { var $Value; - function RSMGR_TLevelFilter() + function __construct() { global $RSMGR_TLevelFilter_InvalidValue; $this->Value = $RSMGR_TLevelFilter_InvalidValue; @@ -498,7 +498,7 @@ { var $Value; - function RSMGR_TEstimatedDuration() + function __construct() { global $RSMGR_TEstimatedDuration_InvalidValue; $this->Value = $RSMGR_TEstimatedDuration_InvalidValue; @@ -558,7 +558,7 @@ { var $Value; - function RSMGR_TRaceFilter() + function __construct() { global $RSMGR_TRaceFilter_InvalidValue; $this->Value = $RSMGR_TRaceFilter_InvalidValue; @@ -617,7 +617,7 @@ { var $Value; - function RSMGR_TReligionFilter() + function __construct() { global $RSMGR_TReligionFilter_InvalidValue; $this->Value = $RSMGR_TReligionFilter_InvalidValue; @@ -675,7 +675,7 @@ { var $Value; - function RSMGR_TGuildFilter() + function __construct() { global $RSMGR_TGuildFilter_InvalidValue; $this->Value = $RSMGR_TGuildFilter_InvalidValue; @@ -763,7 +763,7 @@ { var $Value; - function RSMGR_TShardFilter() + function __construct() { global $RSMGR_TShardFilter_InvalidValue; $this->Value = $RSMGR_TShardFilter_InvalidValue; @@ -822,7 +822,7 @@ { var $Value; - function RSMGR_TSessionEvent() + function __construct() { global $RSMGR_TSessionEvent_InvalidValue; $this->Value = $RSMGR_TSessionEvent_InvalidValue; diff --git a/code/web/public_php/ring/welcome_service_itf.php b/code/web/public_php/ring/welcome_service_itf.php index 0945a2010..8b043bf55 100644 --- a/code/web/public_php/ring/welcome_service_itf.php +++ b/code/web/public_php/ring/welcome_service_itf.php @@ -14,7 +14,7 @@ { var $Value; - function WS_TUserRole() + function __construct() { global $WS_TUserRole_InvalidValue; $this->Value = $WS_TUserRole_InvalidValue; diff --git a/code/web/public_php/tools/nel_message.php b/code/web/public_php/tools/nel_message.php index b696bb151..d4cbc55d6 100644 --- a/code/web/public_php/tools/nel_message.php +++ b/code/web/public_php/tools/nel_message.php @@ -14,7 +14,7 @@ var $InputStream; var $Pos; - function CMemStream () + function __construct() { $this->InputStream = false; $this->Pos = 0; @@ -115,11 +115,6 @@ { var $MsgName; - function CMessage() - { - $this->CMemStream(); - } - function setName($name) { $this->MsgName = $name; @@ -521,4 +516,4 @@ // // return $ok; // } -?> +