Subversion Repositories php-qbpwcf

Rev

Rev 168 | Rev 196 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 168 Rev 190
Line 360... Line 360...
360
			exit(1);
360
			exit(1);
361
		
361
		
362
			}#if end
362
			}#if end
363
			
363
			
364
		#取得用戶端的id	
364
		#取得用戶端的id	
365
		$clientId=$res["id"];	
365
		$clientId=$res["id"];
366
		
366
		
367
		}#if end
367
		}#if end
368
		
368
		
369
	#如果有要增加暫時的白名單
369
	#如果有要增加暫時的白名單
370
	if(isset($parseArgu["content"]["client-add-tmp-white-ip"])){
370
	if(isset($parseArgu["content"]["client-add-tmp-white-ip"])){
Line 1969... Line 1969...
1969
		}#if end
1969
		}#if end
1970
	
1970
	
1971
	#取得行數
1971
	#取得行數
1972
	$lineCount=count($callShell["output"]);
1972
	$lineCount=count($callShell["output"]);
1973
	
1973
	
-
 
1974
	#debug
-
 
1975
	#var_dump(__LINE__,get_defined_vars()["lineCount"],get_defined_vars()["callShell"]["output"]);
-
 
1976
	
1974
	#函式說明:
1977
	#函式說明:
1975
	#多層if判斷.
1978
	#多層if判斷.
1976
	#回傳結果:
1979
	#回傳結果:
1977
	#$result["status"],字串,"true"代表執行正常;"false"代表執行異常.
1980
	#$result["status"],字串,"true"代表執行正常;"false"代表執行異常.
1978
	#$result["function"],當前函式的名稱.
1981
	#$result["function"],當前函式的名稱.
1979
	#$result["pass"],字串,"true"代表通過多層if判斷;反之為"false".
1982
	#$result["pass"],字串,"true"代表通過多層if判斷;反之為"false".
1980
	#必填參數:
1983
	#必填參數:
1981
	#$conf["get_defined_vars"],陣列,所有已經定義的變數.
1984
	#$conf["get_defined_vars"],陣列,所有已經定義的變數.
1982
	$conf["controlStructures::nestedIf"]["get_defined_vars"]=get_defined_vars();
1985
	$conf["controlStructures::nestedIf"]["get_defined_vars"]=get_defined_vars();
1983
	#$conf["varToControlLeft"],變數陣列,依照順序每層要做判斷的變數.
1986
	#$conf["varToControlLeft"],變數陣列,依照順序每層要做判斷的變數.
1984
	$conf["controlStructures::nestedIf"]["varToControlLeft"]=array("lineCount","callShell[\"output\"]");
1987
	$conf["controlStructures::nestedIf"]["varToControlLeft"]=array("lineCount",array("callShell","output"));
1985
	#$conf["conditions"],字串陣列,依照順序每層變數判斷的條件,例如">","<",">=","<=","!=","==","<==","!==","===".
1988
	#$conf["conditions"],字串陣列,依照順序每層變數判斷的條件,例如">","<",">=","<=","!=","==","<==","!==","===".
1986
	$conf["controlStructures::nestedIf"]["conditions"]=array("===","!==");
1989
	$conf["controlStructures::nestedIf"]["conditions"]=array("===","!==");
1987
	#$conf["varToControlRight"],變數陣列,依照順序每層變數判斷期望的結果.
1990
	#$conf["varToControlRight"],變數陣列,依照順序每層變數判斷期望的結果.
1988
	$conf["controlStructures::nestedIf"]["varToControlRight"]=array(1,"-- No entries --");
1991
	$conf["controlStructures::nestedIf"]["varToControlRight"]=array(1,"-- No entries --");
1989
	#可省略參數:
1992
	#可省略參數:
Line 1992... Line 1995...
1992
	#無.
1995
	#無.
1993
	#備註:
1996
	#備註:
1994
	#無.
1997
	#無.
1995
	$nestedIf=controlStructures::nestedIf($conf["controlStructures::nestedIf"]);
1998
	$nestedIf=controlStructures::nestedIf($conf["controlStructures::nestedIf"]);
1996
	unset($conf["controlStructures::nestedIf"]);
1999
	unset($conf["controlStructures::nestedIf"]);
1997
		
2000
	
1998
	#如果執行異常
2001
	#如果執行異常
1999
	if($nestedIf["status"]==="false"){
2002
	if($nestedIf["status"]==="false"){
2000
	
2003
	
2001
		#設置執行異常
2004
		#設置執行異常
2002
		$result["status"]="false";
2005
		$result["status"]="false";
Line 2006... Line 2009...
2006
		
2009
		
2007
		#回傳結果
2010
		#回傳結果
2008
		return $result;
2011
		return $result;
2009
	
2012
	
2010
		}#if end
2013
		}#if end
-
 
2014
 
-
 
2015
	#debug
-
 
2016
	#var_dump(__LINE__,$nestedIf["pass"]);
2011
	
2017
	
2012
	#如果不通過判斷
2018
	#如果不通過判斷
2013
	if($nestedIf["pass"]==="false"){
2019
	if($nestedIf["pass"]==="false"){
2014
	
2020
	
-
 
2021
		#debug
-
 
2022
		var_dump(__LINE__,$nestedIf["reason"]);
-
 
2023
	
2015
		#沿用上次的時間
2024
		#沿用上次的時間
2016
		$sshdTimeFloat=$params["info"]["preTimeFloat"]["sshd"];
2025
		$sshdTimeFloat=$params["info"]["preTimeFloat"]["sshd"];
2017
		
2026
		
2018
		}#if end
2027
		}#if end
2019
	
2028