better error handling if no server is specified
This commit is contained in:
		
							parent
							
								
									f33bc2f3cb
								
							
						
					
					
						commit
						a61cd561fb
					
				|  | @ -104,6 +104,9 @@ function lamdaemon($command, $server) { | |||
| * | ||||
| */ | ||||
| function lamdaemonSeclib($command, $server) { | ||||
| 	if ($server == '') { | ||||
| 		return array(); | ||||
| 	} | ||||
| 	// add phpseclib to include path
 | ||||
| 	set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/3rdParty/phpseclib'); | ||||
| 	include_once('Net/SSH2.php'); | ||||
|  |  | |||
|  | @ -176,6 +176,9 @@ class quota extends baseModule { | |||
| 			$server = $temp[0]; | ||||
| 			// get quotas
 | ||||
| 			$quotas = lamdaemon(implode(quota::$SPLIT_DELIMITER, array($userName, "quota", "get", $this->get_scope())), $server); | ||||
| 			if (sizeof($quotas) == 0) { | ||||
| 				continue; | ||||
| 			} | ||||
| 			$allQuotas = explode(":", $quotas[0]); | ||||
| 			array_pop($allQuotas); // remove empty element at the end
 | ||||
| 			for ($i = 0; $i < sizeof($allQuotas); $i++) { | ||||
|  | @ -463,6 +466,9 @@ class quota extends baseModule { | |||
| 			} | ||||
| 			// Get quotas
 | ||||
| 			$quotas = lamdaemon(implode(quota::$SPLIT_DELIMITER, array("+", "quota", "get", $this->get_scope())), $server); | ||||
| 			if (sizeof($quotas) == 0) { | ||||
| 				continue; | ||||
| 			} | ||||
| 			$dirs = explode(":", $quotas[0]); | ||||
| 			array_pop($dirs); // remove empty element at the end
 | ||||
| 			for ($i = 0; $i < sizeof($dirs); $i++) { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue