diff --git a/frontend/modules/client/vps/lookup.php b/frontend/modules/client/vps/lookup.php index 147f119..8edd62e 100644 --- a/frontend/modules/client/vps/lookup.php +++ b/frontend/modules/client/vps/lookup.php @@ -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"); } diff --git a/frontend/rewrite.php b/frontend/rewrite.php index 56f4187..3451bc2 100644 --- a/frontend/rewrite.php +++ b/frontend/rewrite.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(