From a74239490523219f687286c1a3a67bd6046ae398 Mon Sep 17 00:00:00 2001 From: wyd621 Date: Wed, 30 Oct 2013 02:43:12 +0000 Subject: [PATCH] * add index.php for GET of requestType in init.sh(bat) --- bin/init.bat | 10 +++++----- bin/init.sh | 12 ++++++------ framework/router.class.php | 9 ++++++--- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/bin/init.bat b/bin/init.bat index 8dcefe0d36..6823de9983 100644 --- a/bin/init.bat +++ b/bin/init.bat @@ -42,7 +42,7 @@ echo backup.bat ok if %requestType% == 'PATH_INFO' ( SET computeburn= %phpcli% %baseDir%ztcli "%pmsRoot%/report-remind" )else ( - SET computeburn= %phpcli% %baseDir%ztcli "%pmsRoot%/?m=report&f=remind" + SET computeburn= %phpcli% %baseDir%ztcli "%pmsRoot%/index.php?m=report&f=remind" ) echo %computeburn% > %baseDir%dailyreminder.bat echo dailyreminder.bat ok @@ -51,7 +51,7 @@ echo dailyreminder.bat ok if %requestType% == 'PATH_INFO' ( SET computeburn= %phpcli% %baseDir%ztcli "%pmsRoot%/project-computeburn" )else ( - SET computeburn= %phpcli% %baseDir%ztcli "%pmsRoot%/?m=project&f=computeburn" + SET computeburn= %phpcli% %baseDir%ztcli "%pmsRoot%/index.php?m=project&f=computeburn" ) echo %computeburn% > %baseDir%computeburn.bat echo computeburn.bat ok @@ -60,7 +60,7 @@ echo computeburn.bat ok if %requestType% == 'PATH_INFO' ( SET checkdb= %phpcli% %baseDir%ztcli "%pmsRoot%/admin-checkdb" )else ( - SET checkdb= %phpcli% %baseDir%ztcli "%pmsRoot%/?m=admin&f=checkdb" + SET checkdb= %phpcli% %baseDir%ztcli "%pmsRoot%/index.php?m=admin&f=checkdb" ) echo %checkdb% > %baseDir%checkdb.bat echo checkdb.bat ok @@ -69,7 +69,7 @@ echo checkdb.bat ok if %requestType% == 'PATH_INFO' ( SET syncsvn= %phpcli% %baseDir%ztcli "%pmsRoot%/svn-run" )else ( - SET syncsvn= %phpcli% %baseDir%ztcli "%pmsRoot%/?m=svn&f=run" + SET syncsvn= %phpcli% %baseDir%ztcli "%pmsRoot%/index.php?m=svn&f=run" ) echo %syncsvn% > %baseDir%syncsvn.bat echo syncsvn.bat ok @@ -78,7 +78,7 @@ echo syncsvn.bat ok if %requestType% == 'PATH_INFO' ( SET syncgit= %phpcli% %baseDir%ztcli "%pmsRoot%/git-run" )else ( - SET syncgit= %phpcli% %baseDir%ztcli "%pmsRoot%/?m=git&f=run" + SET syncgit= %phpcli% %baseDir%ztcli "%pmsRoot%/index.php?m=git&f=run" ) echo %syncgit% > %baseDir%syncgit.bat echo syncgit.bat ok diff --git a/bin/init.sh b/bin/init.sh index 0c00561fee..778cf81483 100755 --- a/bin/init.sh +++ b/bin/init.sh @@ -50,7 +50,7 @@ echo "backup.sh ok" if [ $requestType == 'PATH_INFO' ]; then computeburn="$phpcli $basePath/ztcli '$pmsRoot/project-computeburn'"; else - computeburn="$phpcli $basePath/ztcli '$pmsRoot/?m=project&f=computeburn'"; + computeburn="$phpcli $basePath/ztcli '$pmsRoot/index.php?m=project&f=computeburn'"; fi echo $computeburn > $basePath/computeburn.sh echo "computeburn.sh ok" @@ -59,7 +59,7 @@ echo "computeburn.sh ok" if [ $requestType == 'PATH_INFO' ]; then checkdb="$phpcli $basePath/ztcli '$pmsRoot/report-remind'"; else - checkdb="$phpcli $basePath/ztcli '$pmsRoot/?m=report&f=remind'"; + checkdb="$phpcli $basePath/ztcli '$pmsRoot/index.php?m=report&f=remind'"; fi echo $checkdb > $basePath/dailyreminder.sh echo "dailyreminder.sh ok" @@ -68,7 +68,7 @@ echo "dailyreminder.sh ok" if [ $requestType == 'PATH_INFO' ]; then checkdb="$phpcli $basePath/ztcli '$pmsRoot/admin-checkdb'"; else - checkdb="$phpcli $basePath/ztcli '$pmsRoot/?m=admin&f=checkdb'"; + checkdb="$phpcli $basePath/ztcli '$pmsRoot/index.php?m=admin&f=checkdb'"; fi echo $checkdb > $basePath/checkdb.sh echo "checkdb.sh ok" @@ -77,7 +77,7 @@ echo "checkdb.sh ok" if [ $requestType == 'PATH_INFO' ]; then win2Unix="$phpcli $basePath/ztcli '$pmsRoot/admin-win2Unix'"; else - win2Unix="$phpcli $basePath/ztcli '$pmsRoot/?m=admin&f=win2Unix'"; + win2Unix="$phpcli $basePath/ztcli '$pmsRoot/index.php?m=admin&f=win2Unix'"; fi echo $win2Unix > $basePath/win2unix.sh echo "win2unix.sh ok" @@ -86,7 +86,7 @@ echo "win2unix.sh ok" if [ $requestType == 'PATH_INFO' ]; then syncsvn="$phpcli $basePath/ztcli '$pmsRoot/svn-run'"; else - syncsvn="$phpcli $basePath/ztcli '$pmsRoot/?m=svn&f=run'"; + syncsvn="$phpcli $basePath/ztcli '$pmsRoot/index.php?m=svn&f=run'"; fi echo $syncsvn > $basePath/syncsvn.sh echo "syncsvn.sh ok" @@ -95,7 +95,7 @@ echo "syncsvn.sh ok" if [ $requestType == 'PATH_INFO' ]; then syncgit="$phpcli $basePath/ztcli '$pmsRoot/git-run'"; else - syncgit="$phpcli $basePath/ztcli '$pmsRoot/?m=git&f=run'"; + syncgit="$phpcli $basePath/ztcli '$pmsRoot/index.php?m=git&f=run'"; fi echo $syncgit > $basePath/syncgit.sh echo "syncgit.sh ok" diff --git a/framework/router.class.php b/framework/router.class.php index 8c02f4c232..2b6ac439b1 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -1592,10 +1592,13 @@ class router $errorLog = "\n" . date('H:i:s') . " $message in $file on line $line "; $errorLog .= "when visiting " . $this->getURI() . "\n"; - $serverAddr = explode('.', $_SERVER['SERVER_ADDR']); - if(!($serverAddr[0] == 10 or ($serverAddr[0] == 172 and $serverAddr[1] >= 16 and $serverAddr[1] <= 131) or ($serverAddr[0] == 192 and $serverAddr[1] == '168'))) + if(!defined('IN_SHELL')) { - $errorLog = str_replace($this->getBasePath(), '', $errorLog); + $serverAddr = explode('.', $_SERVER['SERVER_ADDR']); + if(!($serverAddr[0] == 10 or ($serverAddr[0] == 172 and $serverAddr[1] >= 16 and $serverAddr[1] <= 131) or ($serverAddr[0] == 192 and $serverAddr[1] == '168'))) + { + $errorLog = str_replace($this->getBasePath(), '', $errorLog); + } } /* Save to log file. */