diff options
| author | Simon Rettberg | 2023-11-02 18:32:51 +0100 | 
|---|---|---|
| committer | Simon Rettberg | 2023-11-03 14:05:30 +0100 | 
| commit | d076e1118dd8c87fffebb1549920f4b7b232ffed (patch) | |
| tree | a71dbdc5d24dbe4c26ed366b3ce431a14c3e2c65 | |
| parent | [locationinfo] Restore PHP7.0 compat (diff) | |
| download | slx-admin-v3.11.tar.gz slx-admin-v3.11.tar.xz slx-admin-v3.11.zip | |
[rebootcontrol] Remove API prototypev3.11
| -rw-r--r-- | modules-available/rebootcontrol/api.inc.php | 36 | 
1 files changed, 0 insertions, 36 deletions
| diff --git a/modules-available/rebootcontrol/api.inc.php b/modules-available/rebootcontrol/api.inc.php index 05fa5699..b3e9e976 100644 --- a/modules-available/rebootcontrol/api.inc.php +++ b/modules-available/rebootcontrol/api.inc.php @@ -10,39 +10,3 @@ if (Request::any('action') === 'rebuild' && isLocalExecution()) {  	}  	exit(0);  } -/* -	Needed POST-Parameters: -		'token' -- for authentication -		'action' -- which action should be performed (shutdown or reboot) -		'clients' -- which are to reboot/shutdown (json encoded array!) -		'timer' -- (optional) when to perform action in minutes (default value is 0) -*/ - -$ips = json_decode(Request::post('clients')); -$minutes = Request::post('timer', 0, 'int'); - -$clients = array(); -foreach ($ips as $client) { -	$clients[] = array("ip" => $client); -} - -$apikey = Property::get("rebootcontrol_APIPOSTKEY", 'not-set'); -if (!empty($apikey) && Request::post('token') === $apikey) { -	if (Request::isPost()) { -		if (Request::post('action') == 'shutdown') { -			$shutdown = true; -			$task = Taskmanager::submit("RemoteReboot", array("clients" => $clients, "shutdown" => $shutdown, "minutes" => $minutes)); -			echo $task["id"]; -		} else if (Request::post('action') == 'reboot') { -			$shutdown = false; -			$task = Taskmanager::submit("RemoteReboot", array("clients" => $clients, "shutdown" => $shutdown, "minutes" => $minutes)); -			echo $task["id"]; -		} else { -			echo "Only action=shutdown and action=reboot available."; -		} -	} else { -		echo "Only POST Method available."; -	} -} else { -	echo "Not authorized"; -}
\ No newline at end of file | 
