/* Decoded by unphp.net */ find()->fetch(true); if (isset($servers)) { foreach ($servers as $server) { $tests = (new Test())->find("expiration < :exp AND server_id=:sid", "exp=" . strtotime("now") . "&sid=" . $server->id)->fetch(true); if (isset($tests)) { $ssh = new SSH2($server->ip); if (!$ssh->login("root", $server->server_password)) { $notif = new Notification(); $notif->text = "Erro ao fazer a limpeza dos usu\xc3\xa1rios de teste, a autentica\303\xa7\303\243o falhou no servidor: " . $server->ip; $notif->save(); die; } foreach ($tests as $test) { $res = $ssh->exec("cd /etc/tbot && ./remover.sh {$test->user_ssh} 2> /dev/null"); if ($res == 1) { $notif = new Notification(); $notif->text = "Usu\xc3\xa1rio de teste " . $test->user_ssh . " deletado pelo sistema no servidor: " . $server->ip; $notif->save(); $test->destroy(); } else { $notif = new Notification(); $notif->text = "Ocorreu um eroo ao deletar o usu\xc3\xa1rio de teste " . $test->user_ssh . " deletado pelo sistema no servidor: " . $server->ip; $notif->save(); } } } } } ?>