$action = "new_idea"; } // Default view if (!empty($id)) { if ($idea = Idea::GetById($id)) { Viewer::AddData("comments", Comments::GetByIdea($idea)); Viewer::AddData("idea", $idea); Viewer::AddData("title", $idea->idea_title); if (isset($_GET["rate_plus"])) { $rated = 3; } elseif (isset($_GET["rate_minus"])) { $rated = 2; } else { $rated = 1; } if (User::Logged()) { $rate = Rate::Find($idea, User::$current); if (!empty($rate)) { $rated = 4; } Viewer::AddData("rated", $rated); } Viewer::UseTemplate("idea.tpl"); $action = "idea"; } } } else { Viewer::Restricted(); $action = "idea"; } if (!$action) {
/** * * */ ob_start(); include_once "../core.php"; $action = "login"; if (!empty($_POST["login"])) { if (!empty($_POST["user_name"]) && !empty($_POST["user_password"])) { $obj = User::CheckUser($_POST["user_name"], $_POST["user_password"]); User::$current = Session::StartUser($obj); } else { $error_message = I18n::L("Please fill all required fields."); } } if (User::Logged()) { header("Location:" . PREFIX . "/dashboard/"); exit; } if (!empty($_POST["login"]) && !User::Logged()) { if (empty($error_message)) { $error_message = I18n::L("Wrong password."); } Viewer::AddData("error_message", $error_message); Viewer::AddData("user_name", $_POST["user_name"]); } Viewer::AddData("title", I18n::L("Title Login")); Viewer::UseTemplate("login.tpl"); Viewer::AddData("action", $action); Viewer::Show(); ob_end_flush();
Notify::NotifyOfLostPassword($user); $error_message = I18n::L("New password was sent to your e-mail."); } } } if (!empty($_POST["password_recovery"]) && empty($_POST["user_email"])) { $error_message = I18n::L("Please fill email."); } if (!empty($error_message)) { Viewer::AddData("error_message", $error_message); } Viewer::AddData("title", I18n::L("Password recovery")); Viewer::UseTemplate("password_recovery.tpl"); $action = "password_recovery"; } } elseif ((!RESTRICT_ALL || User::Logged()) && !isset($_GET["recover"])) { $id = (int) $_SERVER["QUERY_STRING"]; $user = User::GetById($id); if (!empty($id) && $user) { //remove user if (isset($_GET["removeuser"])) { if (User::$current->IsAdmin() && !empty($user->user_email)) { $user->user_password = User::GeneratePassword(8); $user->user_email = ""; $user->user_name = $user->user_name . "_removed"; if (!User::Update($user)) { $error_message = I18n::L("Cannot update user."); $user = User::GetById($id); } else { header("Location:" . PREFIX . "/profile?" . $user->user_id); exit;
<?php /** * @package zoneideas * @subpackage ideas * @author Serg Podtynnyi <*****@*****.**> */ /** * * */ ob_start(); include_once "../core.php"; $action = false; if (!RESTRICT_ALL || User::Logged()) { if (isset($_GET["top"])) { Viewer::AddData("ideas", Ideas::GetByRate()); Viewer::UseTemplate("ideas.tpl"); Viewer::AddData("title", I18n::L("Title Top Ideas")); $action = "top"; } if (isset($_GET["last"])) { Viewer::AddData("ideas", Ideas::GetByLastTime()); Viewer::UseTemplate("ideas.tpl"); Viewer::AddData("title", I18n::L("Title Last Ideas")); $action = "last"; } if (isset($_GET["active"])) { Viewer::AddData("ideas", Ideas::GetByActivity()); Viewer::UseTemplate("ideas.tpl"); Viewer::AddData("title", I18n::L("Title Most Active Ideas"));