Exemple #1
0
init();
//←■■初期設定後は不要なので削除可■■
$iniv = array('mode', 'name', 'email', 'sub', 'com', 'pwd', 'upfile', 'upfile_name', 'resto', 'pass', 'res', 'post', 'no');
foreach ($iniv as $iniva) {
    if (!isset(${$iniva})) {
        ${$iniva} = "";
    }
}
switch ($mode) {
    case 'regist':
        regist($name, $email, $sub, $com, '', $pwd, $upfile, $upfile_name, $resto);
        break;
    case 'admin':
        valid($pass);
        if ($admin == "del") {
            admindel($pass);
        }
        if ($admin == "post") {
            echo "</form>";
            form($post, $res, 1);
            echo $post;
            die("</body></html>");
        }
        break;
    case 'usrdel':
        usrdel($no, $pwd);
    default:
        if ($res) {
            updatelog($res);
        } else {
            updatelog();
Exemple #2
0
    ob_implicit_flush(0);
}
// 支援且開啟Gzip壓縮就設緩衝區
$mode = isset($_GET['mode']) ? $_GET['mode'] : (isset($_POST['mode']) ? $_POST['mode'] : '');
// 目前執行模式 (GET, POST)
switch ($mode) {
    case 'regist':
        regist();
        break;
    case 'admin':
        $admin = isset($_REQUEST['admin']) ? $_REQUEST['admin'] : '';
        // 管理者執行模式
        valid();
        switch ($admin) {
            case 'del':
                admindel();
                break;
            case 'logout':
                adminAuthenticate('logout');
                header('HTTP/1.1 302 Moved Temporarily');
                header('Location: ' . fullURL() . PHP_SELF2 . '?' . time());
                break;
            case 'optimize':
            case 'check':
            case 'repair':
            case 'export':
                if (!$PIO->dbMaintanence($admin)) {
                    echo _T('action_main_notsupport');
                } else {
                    echo _T('action_main_' . $admin) . (($mret = $PIO->dbMaintanence($admin, true)) ? _T('action_main_success') : _T('action_main_failed')) . (is_bool($mret) ? '' : '<br/>' . $mret);
                }
Exemple #3
0
/* Auto-Linkify HTTP links */
function auto_link($proto)
{
    $proto = ereg_replace("(https?|ftp|news)(://[[:alnum:]\\+\$\\;\\?\\.%,!#~*/:@&=_-]+)", "<a href=\"\\1\\2\" target=\"_blank\">\\1\\2</a>", $proto);
    return $proto;
}
/* Display errors */
function error($mes)
{
    global $path;
    echo head();
    echo "<br><br><hr size=1><br><br>\n        <center><font color=red size=5><b>{$mes}</b></font></center>\n        <br><br><hr size=1>";
    die("</body></html>");
}
/*-----------Main-------------*/
switch ($mode) {
    case 'regist':
        regist($name, $email, $sub, $com, $url, $pwd);
        break;
    case 'add':
        valid($pass);
        echo form($post, 1);
        admindel($del, $chk, $pass);
        echo $post;
        die("</body></html>");
        break;
    case 'usrdel':
        usrdel($no, $pwd);
    default:
        main();
}