Пример #1
0
                    }
                } else {
                    $info .= lng('UPLOAD_FAIL') . '. (' . (!$female ? lng('MALE') : lng('FEMALE')) . ') <br/>';
                }
            }
            $timeout = (int) sqlConfigGet('next-reg-time');
            $verification = (int) sqlConfigGet('email-verification') ? true : false;
            ob_start();
            include View::Get('timeout.html', $st_subdir);
            $html .= ob_get_clean();
            $controlManager = new ControlManager(false, 'index.php?mode=control&do=ipbans&');
            $html .= $controlManager->ShowIpBans($curlist);
            $do = false;
            break;
        case 'servers':
            $controlManager = new ControlManager(false, 'index.php?mode=control&do=servers&');
            $html .= $controlManager->ShowServers($curlist);
            $do = false;
            break;
    }
}
if ($do) {
    // Buffer ON
    ob_start();
    switch ($do) {
        case 'ban':
            $confirmTrg = Filter::input('confirm', 'post', 'bool');
            if ($confirmTrg and $ban_user) {
                tokenTool('check');
                $ban_user->changeGroup(2);
                $info .= lng('USER_BANNED');
Пример #2
0
<?php

include_once '../../class/pattern/commandUndo.php';
$dummyWord = new DommyWord("今天天氣真好");
$dummyWordPaste = new PasteCommand($dummyWord);
$dummyWordCut = new CutCommand($dummyWord);
$controlManager = new ControlManager();
$controlManager->execute($dummyWordPaste, ",哇哈哈");
// 今天天氣真好,哇哈哈
$controlManager->execute($dummyWordPaste, ",你好嗎");
// 今天天氣真好,哇哈哈,你好嗎
$controlManager->undo();
// 今天天氣真好,哇哈哈
$controlManager->undo();
// 今天天氣真好
$controlManager->redo();
// 今天天氣真好,哇哈哈
$controlManager->redo();
// 今天天氣真好,哇哈哈,你好嗎
echo "<br/>";
$controlManager->execute($dummyWordCut, "今天");
// 天氣真好,哇哈哈,你好嗎
// 三次undo
$controlManager->undo();
// 今天天氣真好,哇哈哈,你好嗎
$controlManager->undo();
// 今天天氣真好,哇哈哈
$controlManager->undo();
// 今天天氣真好
// 到第四次undo已經沒有資料了,所以沒有任何字串出現
$controlManager->undo();