From ba6ab6262629bf21843cee3cfd4892ad70b813c8 Mon Sep 17 00:00:00 2001 From: Jan Boon Date: Mon, 27 May 2019 06:53:37 +0800 Subject: [PATCH 01/14] Added tag ryzomcore/v1.0.1 for changeset 8eb94c3549be --HG-- branch : develop --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 6a404b346..5dfa83d0e 100644 --- a/.hgtags +++ b/.hgtags @@ -14,3 +14,4 @@ bfe5628e14a024ba7ea32e4b326ae433a07856b9 ryzomcore/v0.11.3 043aaeb3d8a2a54177581b57bda87a9deaad510e ryzom-patch-3.1.0-april_patch 00dde390a394fce9da06c2f3264140282158d39f 3.3.0 dcd4c4d161ef775136e18c7e8f5072b75dede27e ryzom-patch-3.3.1 +8eb94c3549be898fdc4a7c6d791d2477bdc11a18 ryzomcore/v1.0.1 From 4d45de3e7d7c9838f05789ac8dfa1845d9713150 Mon Sep 17 00:00:00 2001 From: Jan Boon Date: Mon, 27 May 2019 06:54:42 +0800 Subject: [PATCH 02/14] Added tag ryzomcore/v1.0.0 for changeset 3e92c7104c20 --HG-- branch : develop --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 5dfa83d0e..463c24849 100644 --- a/.hgtags +++ b/.hgtags @@ -15,3 +15,4 @@ bfe5628e14a024ba7ea32e4b326ae433a07856b9 ryzomcore/v0.11.3 00dde390a394fce9da06c2f3264140282158d39f 3.3.0 dcd4c4d161ef775136e18c7e8f5072b75dede27e ryzom-patch-3.3.1 8eb94c3549be898fdc4a7c6d791d2477bdc11a18 ryzomcore/v1.0.1 +3e92c7104c20d6bc6c2147b4b5fc289e8621d322 ryzomcore/v1.0.0 From 1163d11ede67026625b200bda385bbd97886afde Mon Sep 17 00:00:00 2001 From: Jan Boon Date: Mon, 27 May 2019 06:57:51 +0800 Subject: [PATCH 03/14] Cleanup tags --HG-- branch : develop --- .hgtags | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.hgtags b/.hgtags index 463c24849..697b987fa 100644 --- a/.hgtags +++ b/.hgtags @@ -1,4 +1,3 @@ -950d650ca92e6041611258d7e5131ccf661e4ec2 compatibility-merge 4eddbaff0c5e5d685db96ee3e8427aa0fd96ac83 ryzomcore/v0.8.0 00d9b6e29e95f56785fbf85abe60afd34674f402 ryzomcore/v0.9.0 79776c337176dd5b02e1a74fe5dfb703b91747aa ryzomcore/v0.9.1 @@ -12,7 +11,7 @@ bfe5628e14a024ba7ea32e4b326ae433a07856b9 ryzomcore/v0.11.3 153e0b605c9e0c83ba05b6428c62838b49cc84b2 ryzom-patch-3.0.1 4300cc14aad098b1f86ea4c55577b7fa4a4cb5d2 ryzom-patch-3.1.0 043aaeb3d8a2a54177581b57bda87a9deaad510e ryzom-patch-3.1.0-april_patch -00dde390a394fce9da06c2f3264140282158d39f 3.3.0 +00dde390a394fce9da06c2f3264140282158d39f ryzom-patch-3.3.0 dcd4c4d161ef775136e18c7e8f5072b75dede27e ryzom-patch-3.3.1 8eb94c3549be898fdc4a7c6d791d2477bdc11a18 ryzomcore/v1.0.1 3e92c7104c20d6bc6c2147b4b5fc289e8621d322 ryzomcore/v1.0.0 From c439a10cfec123470fcf5a5a31c8eae36c56ae2d Mon Sep 17 00:00:00 2001 From: Nimetu Date: Mon, 3 Jun 2019 20:55:39 +0300 Subject: [PATCH 04/14] Fixed: WebIG notif thread did not have curl certificates loaded. --HG-- branch : develop --- .../src/interface_v3/group_html_webig.cpp | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/group_html_webig.cpp b/code/ryzom/client/src/interface_v3/group_html_webig.cpp index c7ee1a6c3..8f5c6da01 100644 --- a/code/ryzom/client/src/interface_v3/group_html_webig.cpp +++ b/code/ryzom/client/src/interface_v3/group_html_webig.cpp @@ -30,6 +30,7 @@ #include "../connection.h" #include +#include "nel/gui/curl_certificates.h" using namespace std; using namespace NLMISC; @@ -168,6 +169,17 @@ public: _Thread = NULL; curl_global_init(CURL_GLOBAL_ALL); + Curl = NULL; + //nlinfo("ctor CWebigNotificationThread"); + } + + void init() + { + if (Curl) + { + return; + } + Curl = curl_easy_init(); if(!Curl) return; curl_easy_setopt(Curl, CURLOPT_COOKIEFILE, ""); @@ -175,7 +187,8 @@ public: curl_easy_setopt(Curl, CURLOPT_USERAGENT, getUserAgent().c_str()); curl_easy_setopt(Curl, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(Curl, CURLOPT_WRITEFUNCTION, writeDataFromCurl); - //nlinfo("ctor CWebigNotificationThread"); + + NLGUI::CCurlCertificates::useCertificates(Curl); } ~CWebigNotificationThread() @@ -183,7 +196,7 @@ public: if(Curl) { curl_easy_cleanup(Curl); - Curl = 0; + Curl = NULL; } if (_Thread) { @@ -275,6 +288,9 @@ public: void startThread() { + // initialize curl outside thread + init(); + if (!_Thread) { _Thread = IThread::create(this); @@ -286,7 +302,6 @@ public: { nlwarning("WebIgNotification thread already started"); } - } void stopThread() @@ -305,7 +320,7 @@ public: } } - bool isRunning() const + bool isRunning() const { return _Running; } From abad5aa84ef7405ed7c9dcd63cae2aca6387fa12 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Tue, 4 Jun 2019 13:35:00 +0300 Subject: [PATCH 05/14] Changed: Workaround for intermittent ssl certificate issue under windows. --HG-- branch : develop --- code/nel/src/gui/curl_certificates.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/nel/src/gui/curl_certificates.cpp b/code/nel/src/gui/curl_certificates.cpp index 6d1bc86ee..dbd3005ad 100644 --- a/code/nel/src/gui/curl_certificates.cpp +++ b/code/nel/src/gui/curl_certificates.cpp @@ -332,7 +332,9 @@ namespace NLGUI { ERR_error_string_n(errCode, errorBuffer, 1024); nlwarning("Error adding certificate %s: %s", entry.name.c_str(), errorBuffer); - res = CURLE_SSL_CACERT; + // There seems to be intermittent issues (on windows) where cert loading will fail for same 3 to 5 certs + // with an 'SSL_shutdown while in init' error. It does not seem to be fatal for connection. + //res = CURLE_SSL_CACERT; } } else From 527d4bf00c65329d20e22da4cc4bd76ee59122d1 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Thu, 6 Jun 2019 11:03:47 +0300 Subject: [PATCH 06/14] Changed: Show server returned error message for http/404,500 errors --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 1b3a23ce4..b2808ad14 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -3827,6 +3827,9 @@ namespace NLGUI return; } + // received content from remote + std::string content = trim(_CurlWWW->Content); + // save HSTS header from all requests regardless of HTTP code if (_CurlWWW->hasHSTSHeader()) { @@ -3868,8 +3871,11 @@ namespace NLGUI else if ( (code < 200 || code >= 300) ) { // catches 304 not modified, but html is not in cache anyway - browseError(string("Connection failed\nhttp code " + toString((sint32)code) + ")\nURL '" + _CurlWWW->Url + "'").c_str()); - return; + // if server did not send any error back + if (content.empty()) + { + content = string("ERROR

Connection failed

HTTP code '" + toString((sint32)code) + "'

URL '" + _CurlWWW->Url + "'

"); + } } char *ch; @@ -3880,7 +3886,7 @@ namespace NLGUI contentType = ch; } - htmlDownloadFinished(_CurlWWW->Content, contentType, code); + htmlDownloadFinished(content, contentType, code); // clear curl handler if (MultiCurl) From f17aeff6f2062bf451d3e4c2d67d67a9d2edcb24 Mon Sep 17 00:00:00 2001 From: Inky Date: Wed, 19 Jun 2019 00:10:01 +0300 Subject: [PATCH 07/14] Changed: cli character selection --HG-- branch : develop --- code/ryzom/client/src/client.cpp | 7 +++++++ code/ryzom/client/src/connection.cpp | 22 +++++++++++++++------- code/ryzom/client/src/connection.h | 1 + 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/code/ryzom/client/src/client.cpp b/code/ryzom/client/src/client.cpp index 4c0121d2e..37cb36279 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -180,6 +180,7 @@ int main(int argc, char **argv) Args.addAdditionalArg("login", "Login to use", true, false); Args.addAdditionalArg("password", "Password to use", true, false); Args.addAdditionalArg("shard_id", "Shard ID to use", true, false); + Args.addAdditionalArg("slot", "Char slot to use", true, false); #ifdef TEST_CRASH_COUNTER Args.addArg("", "crash", "", "Crash client before init"); @@ -220,6 +221,12 @@ int main(int argc, char **argv) if (Args.haveAdditionalArg("shard_id")) sLoginShardId = Args.getAdditionalArg("shard_id").front(); + + if (Args.haveAdditionalArg("slot")) + { + if (!fromString(Args.getAdditionalArg("slot").front(), LoginCharsel)) + LoginCharsel = -1; + } } } diff --git a/code/ryzom/client/src/connection.cpp b/code/ryzom/client/src/connection.cpp index 045822370..dd776b7fb 100644 --- a/code/ryzom/client/src/connection.cpp +++ b/code/ryzom/client/src/connection.cpp @@ -144,14 +144,13 @@ ucstring PlayerSelectedHomeShardName; ucstring PlayerSelectedHomeShardNameWithParenthesis; extern std::string CurrentCookie; - ucstring NewKeysCharNameWanted; // name of the character for which a new keyset must be created ucstring NewKeysCharNameValidated; std::string GameKeySet = "keys.xml"; std::string RingEditorKeySet = "keys_r2ed.xml"; string ScenarioFileName; - +sint LoginCharsel = -1; static const char *KeySetVarName = "BuiltInKeySets"; @@ -1095,8 +1094,15 @@ TInterfaceState globalMenu() noUserChar = userChar = false; if( FarTP.isReselectingChar() || !FarTP.isServerHopInProgress() ) // if doing a Server Hop, expect serverReceivedReady without action from the user { + sint charSelect = -1; + if (ClientCfg.SelectCharacter != -1) + charSelect = ClientCfg.SelectCharacter; + + if (LoginCharsel != -1) + charSelect = LoginCharsel; + WaitServerAnswer = false; - if (ClientCfg.SelectCharacter == -1) + if (charSelect == -1) { CCDBNodeLeaf *pNL = NLGUI::CDBManager::getInstance()->getDbProp("UI:SERVER_RECEIVED_CHARS", false); if (pNL != NULL) @@ -1112,7 +1118,7 @@ TInterfaceState globalMenu() else { // check that the pre selected character is available - if (CharacterSummaries[ClientCfg.SelectCharacter].People == EGSPD::CPeople::Unknown) + if (CharacterSummaries[charSelect].People == EGSPD::CPeople::Unknown || charSelect > 4) { // BAD ! preselected char does not exist, use the first available or fail uint i; @@ -1132,12 +1138,14 @@ TInterfaceState globalMenu() if (ret == UDriver::noId) exit(-1); else - ClientCfg.SelectCharacter = i; + charSelect = i; } } - // Auto-selection for fast launching (dev only) - CAHManager::getInstance()->runActionHandler("launch_game", NULL, toString("slot=%d|edit_mode=0", ClientCfg.SelectCharacter)); + CAHManager::getInstance()->runActionHandler("launch_game", NULL, toString("slot=%d|edit_mode=0", charSelect)); + + if (LoginCharsel == -1) + ClientCfg.SelectCharacter = charSelect; } } diff --git a/code/ryzom/client/src/connection.h b/code/ryzom/client/src/connection.h index 92dfa859e..a424e80e9 100644 --- a/code/ryzom/client/src/connection.h +++ b/code/ryzom/client/src/connection.h @@ -34,6 +34,7 @@ extern ucstring PlayerSelectedHomeShardName; // The home shard name (aniro, extern ucstring PlayerSelectedHomeShardNameWithParenthesis; // Same with parenthesis extern std::vector CharacterSummaries; extern std::string UserPrivileges; +extern sint LoginCharsel; extern ucstring NewKeysCharNameWanted; extern ucstring NewKeysCharNameValidated; From 3da8dcbdac84a5f9f8688a340f4c126fae1e38be Mon Sep 17 00:00:00 2001 From: Inky Date: Tue, 25 Jun 2019 23:35:52 +0300 Subject: [PATCH 08/14] Changed: copy of changeset #ba5a7ec85045 (dead branch) --HG-- branch : develop --- code/ryzom/client/src/login.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/ryzom/client/src/login.cpp b/code/ryzom/client/src/login.cpp index 986465986..52f51873d 100644 --- a/code/ryzom/client/src/login.cpp +++ b/code/ryzom/client/src/login.cpp @@ -61,6 +61,7 @@ #include "game_share/bg_downloader_msg.h" #include "misc.h" +#include "user_agent.h" void ConnectToShard(); @@ -783,6 +784,15 @@ void initLoginScreen() ClientApp = ClientCfg.ConfigFile.getVar("Application").asString(0); + // version + std::string ext; + if (ClientApp.find("ryzom_") != ucstring::npos) + ext = " (" + ClientApp.substr(6) + ")"; + + CViewText *pV = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:login:checkpass:content:ver_value")); + if (pV) + pV->setHardText(getDisplayVersion() + (ext.empty() ? "" : ext)); + // give priority to login specified as argument string l = !LoginLogin.empty() ? LoginLogin:ClientCfg.LastLogin; From 7d688f1a6410ed8dd2f36123ac835c649ba1d5e7 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Fri, 12 Jul 2019 14:07:02 +0300 Subject: [PATCH 09/14] Fixed: IOS crash on startup when phrase language file is missing. --HG-- branch : develop --- .../src/input_output_service/string_manager_parser.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/ryzom/server/src/input_output_service/string_manager_parser.cpp b/code/ryzom/server/src/input_output_service/string_manager_parser.cpp index ef55570f9..79d0aba50 100644 --- a/code/ryzom/server/src/input_output_service/string_manager_parser.cpp +++ b/code/ryzom/server/src/input_output_service/string_manager_parser.cpp @@ -242,9 +242,17 @@ public: return; } + // no _wk file or empty if (addition.size() == 0) return; + // no _lang file or empty + if (reference.size() == 0) + { + text = prepareExcelSheet(addition); + return; + } + // create missing columns in reference and addition to make the diff for (uint i=0; i Date: Tue, 16 Jul 2019 15:09:50 +0300 Subject: [PATCH 10/14] Changed: Fixes for php7 --HG-- branch : develop --- .../ams/autoload/.plugincache.php.swp | Bin 16384 -> 0 bytes code/web/private_php/ams/autoload/helpers.php | 1 - code/web/private_php/ams/libinclude.php | 4 +- .../smarty_internal_compilebase.php | 41 +- code/web/public_php/admin/common.php | 2 +- .../web/public_php/admin/functions_common.php | 9 +- code/web/public_php/admin/functions_mysql.php | 381 -------------- .../web/public_php/admin/functions_mysqli.php | 10 +- .../admin/functions_tool_log_analyser.php | 4 +- .../public_php/admin/functions_tool_main.php | 6 +- code/web/public_php/admin/jpgraph/jpgraph.php | 66 +-- .../admin/jpgraph/jpgraph_gradient.php | 2 +- .../public_php/admin/jpgraph/jpgraph_line.php | 6 +- .../public_php/admin/jpgraph/jpgraph_log.php | 11 +- .../admin/jpgraph/jpgraph_plotmark.inc | 6 +- .../admin/jpgraph/jpgraph_polar.php | 2 +- .../admin/jpgraph/jpgraph_radar.php | 16 +- code/web/public_php/admin/nel/nel_message.php | 7 +- .../public_php/admin/smarty/Smarty.class.php | 2 +- .../admin/smarty/Smarty_Compiler.class.php | 17 +- .../admin/templates/default/_index.tpl | 486 ------------------ .../admin/templates/default/index.tpl | 2 +- code/web/public_php/login/config.php | 5 +- code/web/public_php/login/logs/placeholder | 1 - .../ring/ring_session_manager_itf.php | 28 +- .../public_php/ring/welcome_service_itf.php | 2 +- code/web/public_php/tools/nel_message.php | 9 +- 27 files changed, 133 insertions(+), 993 deletions(-) delete mode 100644 code/web/private_php/ams/autoload/.plugincache.php.swp delete mode 100644 code/web/public_php/admin/functions_mysql.php delete mode 100644 code/web/public_php/admin/templates/default/_index.tpl delete mode 100644 code/web/public_php/login/logs/placeholder 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 4993b302e2b689c202f1f0d64181857d67e06a07..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16384 zcmeI3UuYaf9LL92jji^dg+dW@OjDAcw%0#u5lx#mjc{#Rlcud`iO1gUTz1>L-OKK5 zuGcEm`e1!gK?)+&heGj1T7_b*;)@_6_#hOl5V3-Sh>AW`r20_5zx{K&cg@`eau15L z@X6io{^rl`J2StXncL*nAIR+Ho7Zh(IF>SY_3WjwUweLMFFwMUW80E0w>!j?SzLQy zWN>KvriX_1G`CJ0c1fhkI_-$E?HUtlr+U;bWc^W}H%SBfYF zlmbctrGQdEDWDWk3Md7X0{=4wWO+Wj0iWlASHUeIH*i$&{k8CXK0X(KE*OxFI+OxR z0i}RaKq;UUPzopolmbctrGQdEDWDYi?I735t1W0%1t@E&*_RKQ_S0MCLxz`-?aXnYPn z1|NWT!EtZ|>;)-sFIWkdfva~gb_JXVC&6=|0&K7qYzE7~FI|j%2d2Sga2lKfHrNTa zfJeawFdzJVJ7eF1ufPTHCU^zB3|;`cz#v!xy1# zLp(a3=Pdf#BMsB#Yq#*=jg72n6>Q$md&*hsG2f`{<%(vW7d$I3P21wGkR$%f9T`~m z`G$NAKNe(|N{63(psYDsi3j&J$I+_Mo#+!8g@tmzP)$n5%z099-<;b8E)Bu$+#!*d z>-<#dRLcJhvfwyccw%WKF*{H8z;c$JxTvEw!KF<)MAfH~f(r6fsBEh7K9Aj-t7ERz zr00@rdYdL1^DW_;-m-~w9%e}|`fyn-3$%y~M4r*1(7bal;cX(9Iv0GJY~#~DR1Y3a zw)AKc9?j5DVKFT{iz?DN*UG{vnQr8rY~$TX%^E(+mOjd$rNZ7c=?SO$V9@Jod9-je zQLPU6n$fB0+@{WDbhzWTbjPJWCnki$O}$0EO??g{$q~|XEC_pZ%$vFD6LrCEhA;<% zC<+8Yj3Qmxq z{sjt9cpi$9up~`*3PR?MzB;q`K0RD>MKTjdL>`lpr%Y+so*bcBjoZh&$A*T72KV84 z|HR%WcZVUs?M{~JXVA|rQQcghErP66Yjy@*rInF0lZGHD2^hd z|A_X@?w1_ z;$_F2LLcEhp5IrZ6@ouWuMMA?QT;NawGjQ#e_M;F)VEM#v&wIsL3sQ&;_?@ ziA+SVd{J{<9`scI)pRUd7^gK$iVxt`b;EYJYj`;W3zw1*mWIEU#2fHB&sF(u%##cZ z=3#BZ7MSMK%s7PxA?c)MS}sR8lbFbI&BBa2_)aF(PwW48Xgv;S{f}iXyMXolX|NM)1owfZ;7{269NK`q~-=oc3T3%xrp4j|pNJHsxB(n*w1b>@c z?+Nog*lXDKVSiVncl=;au=_weIpg?ABd-;USr7m2o~7SEqg}DOov36{$5`@=zMBQ! k=l>RkotY>(ex;EP{hxe=wgeL;()Jqf@8{UW5qu5%2YG$87ytkO 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; // } -?> + From e3b0cdeadf7e8faa8b77196d9e71c48c365f3f0f Mon Sep 17 00:00:00 2001 From: Nimetu Date: Wed, 17 Jul 2019 15:01:58 +0300 Subject: [PATCH 11/14] Changed: Remove duplicate js/css files from ams page template --HG-- branch : develop --- code/web/public_php/ams/templates/layout.tpl | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/code/web/public_php/ams/templates/layout.tpl b/code/web/public_php/ams/templates/layout.tpl index 7720ca65c..8e19e1ec5 100644 --- a/code/web/public_php/ams/templates/layout.tpl +++ b/code/web/public_php/ams/templates/layout.tpl @@ -22,6 +22,7 @@ + @@ -33,11 +34,6 @@ - - - @@ -229,9 +225,6 @@ _("status").innerHTML = "upload Aborted"; } - - -