Added response message (at the top) on phone reboot.

This commit is contained in:
Nate Jones
2014-04-16 01:32:03 +00:00
parent a94e7b2f96
commit fba528e39a
2 changed files with 21 additions and 3 deletions

View File

@@ -36,6 +36,16 @@
$text['error-event-socket']['pt-pt'] = "A conexão ao Event Socket falhou.";
$text['error-event-socket']['fr-fr'] = "Connexion a l'Event Socket en echec.";
$text['label-event']['en-us'] = "Event:";
$text['label-event']['es-cl'] = "Evento:";
$text['label-event']['pt-pt'] = "Evento:";
$text['label-event']['fr-fr'] = "Evénement:";
$text['label-response']['en-us'] = "Response:";
$text['label-response']['es-cl'] = "Respuesta:";
$text['label-response']['pt-pt'] = "Resposta:";
$text['label-response']['fr-fr'] = "Réponse:";
$text['button-reboot']['en-us'] = "Reboot";
$text['button-reboot']['pt-pt'] = "Reinicialização";
$text['button-reboot']['fr-fr'] = "Redémarrage";

View File

@@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//set the variables
$cmd = check_str($_GET['cmd']);
$rdr = check_str($_GET['rdr']);
@@ -69,8 +75,10 @@ else {
if ($fp) {
//app.lua event_notify
if ($cmd == "reboot" || $cmd == "resync") {
$cmd = "api luarun app.lua event_notify ".$cmd." ".$user." ".$domain." ".$vendor;
$response = event_socket_request($fp, $cmd);
$cmd_complete = "api luarun app.lua event_notify ".$cmd." ".$user." ".$domain." ".$vendor;
$response = event_socket_request($fp, $cmd_complete);
$_SESSION['message'] = $text['label-event']." ".ucwords($cmd)."     ".$text['label-response'].$response;
unset($cmd);
}
@@ -84,7 +92,7 @@ else {
echo $response;
}
else {
header("Location: status_registrations.php?profile=internal&savemsg=".urlencode($response));
header("Location: status_registrations.php?profile=internal");
}
?>