public function check() { Phalanx::loadController('public.LoginController'); $loginController = new LoginController(); if (!($loginController->isLoggedIn() && in_array($this->session->user->id, array(26, 66382, 66380, 65, 1300, 83922, 95394, 138505)))) { Request::redirect(HOST); } }
public function init() { Phalanx::loadController('LoginController'); $loginController = new LoginController(); $loginController->checkStatus(); $this->post = Request::post(); $this->session = new Session(); }
public function init() { $this->get = Request::get(); $this->session = new Session(); Phalanx::loadController('LoginController'); $loginController = new LoginController(); $this->isLoggedIn = $loginController->checkStatus(); Phalanx::loadClasses('Posts', 'Notification'); }
public function init() { $this->post = Request::post(true, REPLACE); $this->files = Request::files(); $this->session = new Session(); Phalanx::loadController('LoginController'); $loginController = new LoginController(); $this->isLoggedIn = $loginController->isLoggedIn(); }
public function init() { Phalanx::loadController("admin.AdminLoginController"); $alc = new AdminLoginController(); $alc->check(); $this->session = new Session(); $this->get = Request::get(); $this->post = Request::post(); $this->views = new Views(new Template("admin")); }
public function logout() { Phalanx::loadController('LoginController'); $loginController = new LoginController(); $loginController->checkStatus(); if ($this->session->accept_token != REQUEST_TOKEN) { Request::redirect(HOST . 'login'); } SocialNetwork::unlink_account($this->session->user->id, SocialNetwork::FACEBOOK); Request::redirect(HOST . 'perfil/configuracoes'); }
public function init() { $this->session = new Session(); Phalanx::loadController('LoginController'); $loginController = new LoginController(); $loginController->checkStatus(); $this->post = Request::post(); $this->files = Request::files(); $this->get = Request::get(); $this->views = new Views(new Template("default")); }
public function init() { $this->get = Request::get(); $this->post = Request::post(); $this->files = Request::files(); $this->session = new Session(); Phalanx::loadController("LoginController"); $LoginController = new LoginController(); if (!$LoginController->isLoggedIn()) { $this->isLoggedIn = $template->show_login_bar = true; } }
public function init() { $this->post = Request::post(); $this->session = new Session(); Phalanx::loadController('LoginController'); $loginController = new LoginController(); $loginController->checkStatus(); #Goodbye, XSS if ($this->session->accept_token != REQUEST_TOKEN) { Request::redirect(HOST . 'login'); return; } }
public function init() { $this->session = new Session(); if (!in_array(URI, array('/perfil/configuracoes/reativar-conta', 'perfil/configuracoes/reativar-conta'))) { Phalanx::loadController('LoginController'); $loginController = new LoginController(); $loginController->checkStatus(); } $this->post = Request::post(); $this->files = Request::files(); $this->get = Request::get(); $this->views = new Views(new Template("default")); }
public function init() { Phalanx::loadController('LoginController'); $loginController = new LoginController(); $loginController->checkStatus(); $this->session = new Session(); #Goodbye, XSS if ($this->session->accept_token != REQUEST_TOKEN) { Request::redirect(HOST . 'login'); return; } Phalanx::loadClasses('Instagram'); $this->config = array('client_id' => INSTAGRAM_CLIENT_ID, 'client_secret' => INSTAGRAM_CLIENT_SECRET, 'grant_type' => INSTAGRAM_GRANT_TYPE, 'redirect_uri' => HOST . INSTAGRAM_REDIRECT_URI); }
public function init() { $this->post = Request::post(); $this->session = new Session(); Phalanx::loadController('LoginController'); $loginController = new LoginController(); $loginController->checkStatus(); Phalanx::loadClasses('Friendship', 'Timeline', 'Notification', 'Message'); #Goodbye, XSS if ($this->session->accept_token != REQUEST_TOKEN) { Request::redirect(HOST . 'login'); return; } }
public function init() { $this->get = Request::get(); $this->post = Request::post(); $this->session = new Session(); $template = new Template("default"); Phalanx::loadController("LoginController"); $LoginController = new LoginController(); if (!$LoginController->isLoggedIn()) { $this->isLoggedIn = $template->show_login_bar = true; } $this->views = new Views($template); Phalanx::loadClasses('Friendship', 'Profile', 'Posts'); }
public function init() { Phalanx::loadClasses('Notification'); $this->get = Request::get(); $this->post = Request::post(true, REPLACE); $this->session = new Session(); $template = new Template("default"); Phalanx::loadController('LoginController'); $loginController = new LoginController(); $this->isLoggedIn = $loginController->checkStatus(); if (!$this->isLoggedIn) { $template->show_login_bar = true; } $this->views = new Views($template); }
public function UserCard() { Phalanx::loadController("LoginController"); $loginController = new LoginController(); $status = $loginController->isLoggedIn(); if ($status) { $v = new Views(); $v->login = $this->session->user->login; $v->avatar = $this->session->user->other_data->avatar; $v->experience = Profile::experience($this->session->user->id); $v->badges = Badges::from_user($this->session->user->id, 4); echo $v->render("user_mini_card.phtml"); } else { $v = new Views(); echo $v->render("user_mini_card_login.phtml"); } }
private function feed() { Phalanx::loadClasses('Profile', 'Lists', 'PostCategory'); $user_data = Profile::get_profile($this->session->user->login); #Correção p/ um bug com os nomes de usuários incorretos if (empty($user_data->login)) { Request::redirect(HOST); } else { #Reutilização do mesmo core para criação da timeline - F**k yeah Phalanx::loadController('TimelineController'); $Timeline = new TimelineController(); $posts = $Timeline->BuildFromList($this->cookies->active_list); #Pego os outros dados do usuário que são utilizados na página de feed $this->views = new Views(new Template("default")); $this->views->data = $user_data; $this->views->lists = Lists::from_user($this->session->user->id); $this->views->categories = PostCategory::get(); $this->views->posts = $posts; $this->views->display("feed.phtml"); } }
public function DisplayWordpressPost() { Phalanx::loadController('LoginController'); $loginController = new LoginController(); $this->isLoggedIn = $loginController->isLoggedIn(); Phalanx::loadClasses('public.Posts', 'public.PostComments'); $post = Posts::GetWPPostData($this->get->post_id, $this->session->user->id, true); $slug = mb_strtolower(preg_replace('/--+/u', '-', preg_replace('/[^\\w\\-]+/u', '-', $post->content->post_title))); if ($slug != $this->get->slug) { Request::redirect_301(HOST . "site/post/{$this->get->post_id}-{$slug}"); } $v = new Views(); $v->title = $post->content->post_title; $v->content = $post->content->post_content; $v->comments = $post->comments; $v->comments_array = PostComments::get($post->post_id); $v->replies = $post->replies; $v->post_id = $post->post_id; $v->rating = $post->rating; $v->when = Date::RelativeTime($post->content->post_date); $v->my_rating = $p->my_rating; $v->current_user = $this->session->user->login; $v->is_favorite = $p->is_favorite; $content = $v->render("post_body_wp.phtml"); $template = new Template("default"); $template->og = new stdClass(); $template->og->title = $v->title; $template->og->description = substr(strip_tags($content), 0, 250); //$template->og->img = MEDIA_DIR . 'images/avatar/big/' . $profile_data->aditional_info->avatar; if (!$this->isLoggedIn) { $template->show_login_bar = true; } $v = new Views($template); $v->data = new stdClass(); $v->data->post = $content; $v->display("single_post_display.phtml"); }
public function GetComments() { $post_id = $this->post->post_id != '' ? $this->post->post_id : false; $cache_time = MEMCACHE_SECONDS; if (!$post_id) { Phalanx::loadClasses('Posts'); $post = Posts::GetWPPost($this->get->wpid); $post_id = $post ? $post->id : false; $cache_time = 180; } $comments = array(''); header("Content-type: text/html; charset=utf-8"); if ($post_id) { Phalanx::loadClasses("PostComments"); $comments = PostComments::get($post_id, $cache_time, $this->get->sort); foreach ($comments as &$comment) { $comment->comment = preg_replace('/(?<=|(?<=[.A-Za-z0-9_-]))@([.A-Za-z0-9_-]+[.A-Za-z0-9_-]+)/', '<a class="profile-link" href="' . HOST . 'perfil/$1"e>@$1</a>', nl2br($comment->comment)); foreach ($comment->replies as &$reply) { $reply->comment = preg_replace('/(?<=|(?<=[.A-Za-z0-9_-]))@([.A-Za-z0-9_-]+[.A-Za-z0-9_-]+)/', '<a class="profile-link" href="' . HOST . 'perfil/$1"e>@$1</a>', nl2br($reply->comment)); } } } if ($this->get->render) { Phalanx::loadController('LoginController'); $loginController = new LoginController(); $v = new Views(); $v->comments = $post->comment_count; $v->replies = $post->reply_count; $v->comments_array = $comments; $v->post_id = $post_id; $v->logged_in = $loginController->isLoggedIn(); echo $v->render('post_comments.phtml'); } else { die(json_encode($comments)); } }