コード例 #1
0
ファイル: index.php プロジェクト: nyov/thehostingtool
        if ($_POST) {
            # If user submitts form
            if ($main->staffLogin($main->postvar['user'], $main->postvar['pass'])) {
                $queryString = $_SERVER["QUERY_STRING"];
                if ($queryString == "") {
                    $queryString = "page=home";
                }
                $main->redirect(URL . "admin/?" . $queryString);
            } else {
                $main->errors("Incorrect username or password!");
            }
        }
        echo $style->get("header.tpl");
        $array[] = "";
        echo '<div align="center">' . $main->table("Admin Area - Login", $style->replaceVar("tpl/alogin.tpl", $array), "300px") . '</div>';
        echo $style->get("footer.tpl");
    }
} elseif ($_SESSION['logged']) {
    if (!$main->getvar['page']) {
        $main->getvar['page'] = "home";
    } elseif ($main->getvar['page'] == "logout") {
        session_destroy();
        $main->redirect("?page=home");
    }
    $content = acp();
    echo $style->get("header.tpl");
    echo $content;
    echo $style->get("footer.tpl");
}
//End the sctipt
include LINK . "output.php";
コード例 #2
0
ファイル: index.php プロジェクト: codegooglecom/bnpanel
        }
        $content['content'] = $style->replaceVar("tpl/login/reset.tpl", $array);
        echo $style->replaceVar("layout/one-col/index.tpl", $content);
    } else {
        define("SUB", "Login");
        define("INFO", " ");
        if ($_POST) {
            if ($main->checkToken()) {
                if ($main->staffLogin($main->postvar['user'], $main->postvar['pass'])) {
                    $main->redirect("?page=home");
                } else {
                    $main->errors("Incorrect username or password!");
                    $main->generateToken();
                }
            }
        }
        $login = $style->fetch("login/alogin.tpl");
        $style->assign('content', $login);
        echo $style->display("layout/one-col/index.tpl");
    }
} elseif (isset($_SESSION['logged'])) {
    //Ok user is already in
    if (!isset($main->getvar['page'])) {
        $main->getvar['page'] = "home";
    } elseif ($main->getvar['page'] == "logout") {
        $main->logout('admin');
        $main->redirect("?page=home");
    }
    acp();
    echo $style->display("layout/two-col/index.tpl");
}