Specify the VPS action (start, stop, restart) as a custom variable instead of grabbing it from the URL

feature/node-rewrite
Sven Slootweg 12 years ago
parent 3893966f09
commit 4e6549cbc9

@ -13,17 +13,17 @@
if(!isset($_CVM)) { die("Unauthorized."); }
if(!empty($router->uParameters[2]))
if(!empty($router->uVariables['action']))
{
if($router->uParameters[2] == "start")
if($router->uVariables['action'] == "start")
{
require("modules/client/vps/action/start.php");
}
elseif($router->uParameters[2] == "stop")
elseif($router->uVariables['action'] == "stop")
{
require("modules/client/vps/action/stop.php");
}
elseif($router->uParameters[2] == "restart")
elseif($router->uVariables['action'] == "restart")
{
require("modules/client/vps/action/restart.php");
}

@ -69,25 +69,28 @@ try
),
/* TODO: Use action variable instead of relying on the path. */
/* VPS - Start */
'^/([0-9]+)/(start)/?$' => array(
'^/([0-9]+)/start/?$' => array(
'target' => "modules/client/vps/lookup.php",
'authenticator' => "authenticators/vps.php",
'auth_error' => "modules/error/access.php",
'_menu' => "vps"
'_menu' => "vps",
'_action' => "start"
),
/* VPS - Stop */
'^/([0-9]+)/(stop)/?$' => array(
'^/([0-9]+)/stop/?$' => array(
'target' => "modules/client/vps/lookup.php",
'authenticator' => "authenticators/vps.php",
'auth_error' => "modules/error/access.php",
'_menu' => "vps"
'_menu' => "vps",
'_action' => "stop"
),
/* VPS - Restart */
'^/([0-9]+)/(restart)/?$' => array(
'^/([0-9]+)/restart/?$' => array(
'target' => "modules/client/vps/lookup.php",
'authenticator' => "authenticators/vps.php",
'auth_error' => "modules/error/access.php",
'_menu' => "vps"
'_menu' => "vps",
'_action' => "restart"
),
/* VPS - Reinstall */
'^/([0-9]+)/reinstall/?$' => array(

Loading…
Cancel
Save