Ejemplo n.º 1
0
<?php

/* $Id: admin_login.php 252 2009-11-18 01:26:29Z steve $ */
$page = "admin_login";
include "admin_header.php";
$task = isset($_POST['task']) ? $_POST['task'] : "main";
// SET DEFAULT
$is_error = 0;
// TRY TO LOGIN
if ($task == "dologin") {
    // pasting username/password sometimes contains linebreak character
    // so gracefully trim before attempting to log in.
    $_POST['username'] = trim($_POST['username']);
    $_POST['password'] = trim($_POST['password']);
    $admin->admin_login();
    // IF ADMIN IS LOGGED IN SUCCESSFULLY, FORWARD THEM TO HOMEPAGE
    if ($admin->is_error == 0) {
        cheader("admin_home.php");
        exit;
        // IF THERE WAS AN ERROR, SET ERROR MESSAGE
    } else {
        $is_error = $admin->is_error;
    }
}
// INCLUDE FOOTER
$smarty->assign('is_error', $is_error);
include "admin_footer.php";
Ejemplo n.º 2
0
        $login_secure = $_POST['login_secure'];
        if ($login_secure != $code) {
            $user->is_error = 708;
        }
    }
    if (!$user->is_error) {
        $user->user_login($email, $_POST['password'], $_POST['javascript_disabled'], $_POST['persistent']);
    }
    // IF USER IS LOGGED IN SUCCESSFULLY, FORWARD THEM TO SPECIFIED URL
    if (!$user->is_error) {
        $failed_login_count = $_SESSION['failed_login_count'] = 0;
        // INSERT ACTION
        $actions->actions_add($user, "login", array($user->user_info['user_username'], $user->user_displayname), array(), 0, false, "user", $user->user_info['user_id'], $user->user_info['user_privacy']);
        // CALL LOGIN HOOK
        ($hook = SE_Hook::exists('se_login_success')) ? SE_Hook::call($hook, array()) : NULL;
        cheader("{$return_url}");
        exit;
    } else {
        $failed_login_count = ++$_SESSION['failed_login_count'];
        $is_error = $user->is_error;
        $user = new se_user();
    }
}
// SET GLOBAL PAGE TITLE
$global_page_title[0] = 658;
$global_page_description[0] = 673;
// ASSIGN VARIABLES AND INCLUDE FOOTER
$smarty->assign('email', $email);
$smarty->assign('is_error', $is_error);
$smarty->assign('return_url', $return_url);
$smarty->assign('failed_login_count', $failed_login_count);
Ejemplo n.º 3
0
<?php

/* $Id: chat.php 6 2009-01-11 06:01:29Z john $ */
$page = "chat";
include "header.php";
include "include/class_chat.php";
// REDIRECT IF USER IS NOT LOGGED IN OR USER IS NOT ALLOWED TO CHAT
if (!$user->user_exists || !$user->level_info['level_chat_allow']) {
    cheader('home.php');
    exit;
}
include "footer.php";
Ejemplo n.º 4
0
// CHECK IF USER SIGNUP COOKIES SET (STEPS 3, 4, 5)
$signup_logged_in = 0;
if ($task != "step1" && $task != "step1do" && $task != "step2" && $task != "step2do") {
    if (isset($_COOKIE['signup_id']) && isset($_COOKIE['signup_email']) && isset($_COOKIE['signup_password'])) {
        // GET USER ROW IF AVAILABLE
        $user_id = $_COOKIE['signup_id'];
        $new_user = new se_user(array($user_id));
        // VERIFY USER LOGIN COOKIE VALUES AND RESET USER LOGIN VARIABLE
        //if($_COOKIE['signup_email'] == crypt($new_user->user_info['user_email'], "$1$".$new_user->user_info['user_code']."$") && $_COOKIE['signup_password'] == $new_user->user_info['user_password'])
        $new_user->user_salt = $new_user->user_info['user_code'];
        if ($_COOKIE['signup_email'] == $new_user->user_password_crypt($new_user->user_info['user_email']) && $_COOKIE['signup_password'] == $new_user->user_info['user_password']) {
            $signup_logged_in = 1;
        }
    }
    if ($signup_logged_in != 1) {
        cheader("signupon13.php");
        exit;
    }
}
if ($signup_logged_in != 1) {
    setcookie("signup_id", "", 0, "/");
    setcookie("signup_email", "", 0, "/");
    setcookie("signup_password", "", 0, "/");
    $_COOKIE['signup_id'] = "";
    $_COOKIE['signup_email'] = "";
    $_COOKIE['signup_password'] = "";
    $new_user = new se_user();
    if ($task == "step1") {
        if (isset($_GET['signup_email'])) {
            $signup_email = $_GET['signup_email'];
        } else {
Ejemplo n.º 5
0
<?php

/* $Id: admin_logout.php 8 2009-01-11 06:02:53Z john $ */
$page = "adm_logout";
include "adm_header.php";
$provider->provider_logout();
// FORWARD TO ADMIN LOGIN PAGE
cheader("adm_login.php");
exit;
Ejemplo n.º 6
0
include "adm_header.php";
//include "include/class_provider.php";
$task = isset($_POST['task']) ? $_POST['task'] : "main";
// SET DEFAULT
$is_error = 0;
// TRY TO LOGIN
if ($task == "dologin") {
    // pasting username/password sometimes contains linebreak character
    // so gracefully trim before attempting to log in.
    $username = trim($_POST['username']);
    $password = trim($_POST['password']);
    $category = trim($_POST['category']);
    $provider->provider_login($username, $category, $password);
    // IF ADMIN IS LOGGED IN SUCCESSFULLY, FORWARD THEM TO HOMEPAGE
    if ($provider->is_error == 0) {
        cheader("adm_" . $category . "_home.php");
        exit;
        // IF THERE WAS AN ERROR, SET ERROR MESSAGE
    } else {
        $is_error = $provider->is_error;
    }
}
// Модель поставщиков
$provider_model = new se_provider();
// Категории поставщиков
$categories = $provider_model->get_categories();
/*
if($_GET['task'] == "create") {
$provider_model->admin_create("Evg","1234","Евгений","*****@*****.**");
}
*/
Ejemplo n.º 7
0
<?php

$page = "user_logout";
include "header.php";
if (@$_GET['token'] == $session->get('token') || strtoupper($_SERVER['REQUEST_METHOD']) === 'POST') {
    $user->user_logout();
}
// FORWARD TO USER LOGIN PAGE
cheader("home.php");
exit;
Ejemplo n.º 8
0
<?php

$page = "admin_logout";
include "admin_header.php";
$admin->admin_logout();
// FORWARD TO ADMIN LOGIN PAGE
cheader("admin_login.php");
exit;
Ejemplo n.º 9
0
// CHECK IF USER SIGNUP COOKIES SET (STEPS 3, 4, 5)
$signup_logged_in = 0;
if ($task != "step1" && $task != "step1do" && $task != "step2" && $task != "step2do") {
    if (isset($_COOKIE['signup_id']) && isset($_COOKIE['signup_email']) && isset($_COOKIE['signup_password'])) {
        // GET USER ROW IF AVAILABLE
        $user_id = $_COOKIE['signup_id'];
        $new_user = new se_user(array($user_id));
        // VERIFY USER LOGIN COOKIE VALUES AND RESET USER LOGIN VARIABLE
        //if($_COOKIE['signup_email'] == crypt($new_user->user_info['user_email'], "$1$".$new_user->user_info['user_code']."$") && $_COOKIE['signup_password'] == $new_user->user_info['user_password'])
        $new_user->user_salt = $new_user->user_info['user_code'];
        if ($_COOKIE['signup_email'] == $new_user->user_password_crypt($new_user->user_info['user_email']) && $_COOKIE['signup_password'] == $new_user->user_info['user_password']) {
            $signup_logged_in = 1;
        }
    }
    if ($signup_logged_in != 1) {
        cheader("signup.php");
        exit;
    }
}
if ($signup_logged_in != 1) {
    setcookie("signup_id", "", 0, "/");
    setcookie("signup_email", "", 0, "/");
    setcookie("signup_password", "", 0, "/");
    $_COOKIE['signup_id'] = "";
    $_COOKIE['signup_email'] = "";
    $_COOKIE['signup_password'] = "";
    $new_user = new se_user();
    if ($task == "step1") {
        if (isset($_GET['signup_email'])) {
            $signup_email = $_GET['signup_email'];
        } else {
Ejemplo n.º 10
0
<?php

$page = "admin_login";
include "admin_header.php";
$task = isset($_POST['task']) ? $_POST['task'] : "main";
// SET DEFAULT
$is_error = 0;
// TRY TO LOGIN
if ($task == "dologin") {
    // pasting username/password sometimes contains linebreak character
    // so gracefully trim before attempting to log in.
    $_POST['username'] = trim($_POST['username']);
    $_POST['password'] = trim($_POST['password']);
    $admin->admin_login();
    // IF ADMIN IS LOGGED IN SUCCESSFULLY, FORWARD THEM TO HOMEPAGE
    if ($admin->is_error == 0) {
        cheader("admin_announcements.php");
        exit;
        // IF THERE WAS AN ERROR, SET ERROR MESSAGE
    } else {
        $is_error = $admin->is_error;
    }
}
// INCLUDE FOOTER
$smarty->assign('is_error', $is_error);
include "admin_footer.php";
Ejemplo n.º 11
0
function redirect_user_home($user_id)
{
    cheader('id' . $user_id);
}