Example #1
0
<?php

require_once '../FastInit.php';
use api\Sessions\CookieManager as CM;
use habbo\Session\HabboCookie as HC;
if (HC::HasSession()) {
    CM::RemoveCookie(HC::GetSessionData());
}
<?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");
Example #3
0
<?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;
Example #4
0
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);
Example #5
0
<?php

require '../FastInit.php';
use habbo\Mus\MusCommunication as Mus;
use api\Requests\Requests as Req;
use habbo\Session\HabboCookie as C;
if (!C::HasSession()) {
    echo "ERROR_NO_SESSION";
    die;
}
$habbo = C::GetHabbo();
$command = Req::Php("command");
$user = Req::Php("username");
$extravalue = Req::Php("extravalue");
if ($user == "") {
    $user = $habbo->username;
} else {
    if ($habbo->rank < STAFF_MIN_RANK) {
        echo "NO_RIGHTS_TO_THAT";
        die;
    }
}
switch ($command) {
    case "sendtoroom":
        echo Mus::SendUserToRoom($user, $extravalue);
        break;
    case "updatemotto":
        echo Mus::UpdateMotto($user, $extravalue);
        break;
    default:
        echo "ERROR_COMMAND_NOT_REGISTRED";
Example #6
0
<?php

require_once '../FastInit.php';
use habbo\Session\HabboCookie as C;
use habbo\Users\HabboUserManager as Habbo;
header("Content-Type: text/json");
$sessiondata = null;
$userdata = null;
if (C::HasSession()) {
    $sessiondata = C::GetSessionData();
    $userdata = json_decode($sessiondata->value);
}
$data = ["has_session" => C::HasSession(), "userdata" => null, "cookie_data" => null];
if (C::HasSession()) {
    if ($habbo = Habbo::GetHabboByName($userdata->username)) {
        if (Habbo::CheckAuth($habbo, $userdata->password)) {
            $data["userdata"] = $habbo->PrivateInfo();
            $data["cookie_data"] = ["expire" => $sessiondata->expire, "now" => time(), "reaming_time" => $sessiondata->expire - time()];
        }
    }
}
echo json_encode($data);
     } 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);