Exemple #1
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
define('IN_PBADMIN', TRUE);
if (empty($_COOKIE[$cookiepre . 'admin']) || !$_COOKIE[$cookiepre . 'admin']) {
    echo "<script language='javascript'>top.location.href='login.php';</script>";
    exit;
} else {
    uses("adminfield");
    $adminer = new Adminfields();
    $tAdminInfo = authcode($_COOKIE[$cookiepre . 'admin'], "DECODE");
    $tAdminInfo = explode("\n", $tAdminInfo);
    $current_adminer_id = $tAdminInfo[0];
    $current_adminer = $tAdminInfo[1];
    $current_pass = $tAdminInfo[2];
    $adminer->loadsession($current_adminer_id, pb_get_client_ip("str"), $cfg_checkip);
    $adminer_info = $adminer->info;
    uaAssign(array("current_adminer" => $current_adminer, "current_adminer_id" => $current_adminer_id));
}
$sections = array('admin', 'message', 'adminmenu');
$smarty->configLoad('default.conf', $sections);
require PHPB2B_ROOT . 'phpb2b_version.php';
$ADODB_CACHE_DIR = DATA_PATH . 'dbcache';
$smarty->template_dir = PHPB2B_ROOT . "templates/admin/";
$smarty->assign("admin_theme_path", "../templates/admin/");
$smarty->setCompileDir($smarty->getCompileDir() . "pb-admin" . DS);
Exemple #2
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2173 $
 */
session_start();
require "../libraries/common.inc.php";
require CACHE_LANG_PATH . 'lang_admin.php';
require DATA_PATH . 'phpb2b_version.php';
uses("adminfield", "setting", "member");
$adminer = new Adminfields();
$member = new Members();
$setting = new Settings();
if (isset($_GET['action'])) {
    if ($_GET['action'] == "dereg") {
        usetcookie("admin", "");
        unset($_SESSION['last_adminer_time']);
    }
}
capt_check("capt_login_admin");
if (isset($_POST['do'])) {
    $do = trim($_POST['do']);
    if ($do == "login") {
        pb_submit_check('data');
        if (!empty($_POST['data']['username']) && !empty($_POST['data']['userpass'])) {
            $checked = false;
            $uname = $_POST['data']['username'];
            $upass = $_POST['data']['userpass'];