Exemple #1
0
     $Server = new Servidor($_GET['Id'], $conn);
     $Server->pararServidor();
     $Server->setStatus(0);
     $Server->atualizaInfo();
     $Server->eliminar();
     // Eliminar
     if (isset($_GET['Return'])) {
         header("Location: ../index.php?Successo=1");
         die;
     }
     echo json_encode(array("Status" => true, "Id" => $_GET['Id'], "Mensagem" => $Lang['api_servidorEliminado']));
     die;
 } elseif ($_GET['Action'] == "MudaMotd" && isset($_GET['Motd'])) {
     $Servidor = new Servidor($_GET['Id'], $conn);
     // Cria Servidor
     $Servidor->setMotd(addslashes(htmlentities($_GET['Motd'])));
     // Mudar Motd.
     $Servidor->atualizaInfo();
     // Faz update na base de dados do Motd Novo
     if (isset($_GET['Return'])) {
         if ($Servidor->getMotd() == $_GET['Motd']) {
             header("Location: ../servidor.php?Id=" . $_GET['Id'] . "&Sucesso=1");
         } else {
             header("Location: ../servidor.php?Id=" . $_GET['Id'] . "&Erro=1");
         }
         die;
     }
     echo json_encode(array("Status" => true, "Id" => $_GET['Id'], "Mensagem" => $Lang['api_motdAlteradoPara'] . " " . $Servidor->getMotd()));
     die;
 } elseif ($_GET['Action'] == "MudaIp" && isset($_GET['Ip'])) {
     $Servidor = new Servidor($_GET['Id'], $conn);