<?php require_once '../FastInit.php'; //header("Content-Type: text/json"); use habbo\Session\HabboCookie as HC; use habbo\Articles\ArticleManager as AM; use api\Requests\Requests as Req; use habbo\Users\HabboUserManager as Habbo; $articleid = Req::Php("article_id"); $positive = Req::Php("positive"); $err = ["error" => true, "message" => "UNKOWN_ERROR"]; function goerror($str) { die(json_encode(["error" => true, "message" => $str])); } if (!HC::HasSession()) { goerror("ERROR_SESSION_NOT_FOUND"); } $session = json_decode(HC::GetSessionData()->value); $habbo = Habbo::GetHabboByName($session->username); if (!$habbo) { goerror("ERROR_SESSION_USER_NOT_FOUND"); } if (!$articleid || !$positive) { goerror("ERROR_MISS_ARGS"); } $article = AM::GetNotice($articleid); if (!$article->Success) { goerror("ERROR_ARTICLE_NOT_FOUND"); } $article->Vote->AddVote($habbo->id, $positive == "true");
<?php require_once '../FastInit.php'; use api\Sessions\CookieManager as CM; use habbo\Session\HabboCookie as HC; if (HC::HasSession()) { CM::RemoveCookie(HC::GetSessionData()); }
if (!Arr::ContainsAll(Requests::$PhpInput, ["username", "password"])) { $userdata["error"] = true; $userdata["message"] = "Preencha com Nome e Senha!"; goto end; } $username = Requests::Php("username"); $password = Requests::Php("password"); $user = Habbo::GetHabboByName($username); if (!$user) { $userdata["error"] = true; $userdata["message"] = "Este usuário não existe!"; goto end; } if (!Arr::ContainsAll(Requests::$PhpInput, ["username", "password"])) { $userdata["error"] = true; $userdata["message"] = "Preencha com Nome e Senha!"; goto end; } if (!Habbo::CheckAuth($user, $password)) { $userdata["error"] = true; $userdata["message"] = "Senha Incorreta!"; goto end; } CM::TryStartSession($username, $password); $sessiondata = CM::GetSessionData(); $userdata["error"] = false; $userdata["message"] = ""; $userdata["userdata"] = $user->PrivateInfo(); $userdata["cookie_data"] = ["expire" => $sessiondata->expire, "now" => time(), "reaming_time" => $sessiondata->expire - time()]; end: echo json_encode($userdata);
<?php //FIXAR ISSO URGENTEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE// //session_start(); require_once "../library/Init.php"; use Database\DatabaseManager as DB; use habbo\Session\HabboCookie as Session; use habbo\Users\HabboUserManager as Habbo; if (!Session::HasSession()) { die(""); } $usercookie = json_decode(Session::GetSessionData()->value); $user = Habbo::GetHabboByName($usercookie->username); $user->GenerateNewTicket(); ?> <!DOCTYPE HTML> <html> <head> <meta http-Equiv="Cache-Control" Content="no-cache" /> <meta http-Equiv="Pragma" Content="no-cache" /> <meta http-Equiv="Expires" Content="0" /> <script type="text/javascript"> var andSoItBegins = (new Date()).getTime(); </script> <link rel="shortcut icon" href="<?php echo WEB_URL; ?> /web-gallery/v2/images/favicon.ico" type="image/vnd.microsoft.icon" /> <script src="<?php echo WEB_URL;
} else { $comment->Likes->UnLike($habbo->id); } break; case 'delete': $error = ["message" => ""]; if ($comment_id == "" || $article_id == "" || !C::HasSession()) { $error["message"] = "Missing data!"; goto _break; } $article = ArticleManager::GetNotice($article_id); if (!$article->Success) { $error["message"] = "Article not found!"; goto _break; } $userdata = json_decode(C::GetSessionData()->value); $habbo = Habbo::GetHabboByName($userdata->username); if (!$habbo) { $error["message"] = "No session!"; goto _break; } $comment = $article->Comments->GetComment($comment_id); if (!$comment) { $error["message"] = "Comment not found!"; goto _break; } if ($comment->user_id != $habbo->id && $habbo->rank < STAFF_MIN_RANK) { $error["message"] = "No Rights to delete this comment!"; goto _break; } $article->Comments->DeleteComment($comment_id);