예제 #1
0
파일: index.php 프로젝트: stof/pearweb
        }
        echo ">{$text}</td>\n";
        echo "{$i}    </tr>\n";
    }
}
response_header('PEAR Administration');
// {{{ adding and deleting notes
if (!empty($_REQUEST['cmd'])) {
    if ($_REQUEST['cmd'] == "Add note" && !empty($_REQUEST['note']) && !empty($_REQUEST['id'])) {
        include_once 'pear-database-note.php';
        note::add($_REQUEST['id'], $_REQUEST['note']);
        unset($_REQUEST['cmd']);
    } elseif ($_REQUEST['cmd'] == "Delete note" && !empty($_REQUEST['id'])) {
        include_once 'pear-database-note.php';
        // Delete note
        note::remove($_REQUEST['id']);
    } elseif ($_REQUEST['cmd'] == "Open Account" && !empty($_REQUEST['uid'])) {
        /**
         * Open account
         */
        $karmalevel = empty($_REQUEST['karma']) ? 'pear.pepr' : $_REQUEST['karma'];
        // another hack to remove the temporary "purpose" field
        // from the user's "userinfo"
        include_once 'pear-database-user.php';
        if (user::activate($_REQUEST['uid'], $karmalevel)) {
            $uid = strip_tags(htmlspecialchars($_REQUEST['uid']));
            print "<p>Opened account {$uid}...</p>\n";
        }
    } elseif ($_REQUEST['cmd'] == "Reject Request" && !empty($_REQUEST['uid'])) {
        // Reject account request
        include_once 'pear-database-user.php';