Beispiel #1
0
function plugin_bugtrack_action()
{
    global $vars;
    global $_plugin_bugtrack, $_string;
    // if (PKWK_READONLY) die_message('PKWK_READONLY prohibits editing');
    if (Auth::check_role('readonly')) {
        die_message($_string['prohibit']);
    }
    if (Auth::is_check_role(PKWK_CREATE_PAGE)) {
        die_message(str_replace('PKWK_CREATE_PAGE', 'PKWK_READONLY', $_string['prohibit']));
    }
    if ($vars['mode'] != 'submit') {
        return FALSE;
    }
    // Vaildation foreign values(by miko)
    $spam = !in_array($vars['priority'], $_plugin_bugtrack['priority_list']) || !in_array($vars['state'], $_plugin_bugtrack['state_list']) ? TRUE : FALSE;
    if ($spam) {
        honeypot_write();
        return array('msg' => 'cannot write', 'body' => '<p>prohibits editing</p>');
    }
    $page = plugin_bugtrack_write($vars['base'], $vars['pagename'], $vars['summary'], $vars['name'], $vars['priority'], $vars['state'], $vars['category'], $vars['version'], $vars['body']);
    Utility::redirect(get_page_location_uri($page));
    exit;
}
Beispiel #2
0
function plugin_bugtrack_action()
{
    global $post;
    if (PKWK_READONLY) {
        die_message('PKWK_READONLY prohibits editing');
    }
    if ($post['mode'] != 'submit') {
        return FALSE;
    }
    $page = plugin_bugtrack_write($post['base'], $post['pagename'], $post['summary'], $post['name'], $post['priority'], $post['state'], $post['category'], $post['version'], $post['body']);
    pkwk_headers_sent();
    header('Location: ' . get_script_uri() . '?' . rawurlencode($page));
    exit;
}
function plugin_bugtrack_action()
{
    global $post;
    global $_plugin_bugtrack;
    // if (PKWK_READONLY) die_message('PKWK_READONLY prohibits editing');
    if (auth::check_role('readonly')) {
        die_message('PKWK_READONLY prohibits editing');
    }
    if (auth::is_check_role(PKWK_CREATE_PAGE)) {
        die_message(_('PKWK_CREATE_PAGE prohibits editing'));
    }
    if ($post['mode'] != 'submit') {
        return FALSE;
    }
    // Petit SPAM Check (Client(Browser)-Server Ticket Check)
    $spam = FALSE;
    if (isset($post['encode_hint']) && $post['encode_hint'] != '') {
        if (PKWK_ENCODING_HINT != $post['encode_hint']) {
            $spam = TRUE;
        }
    } else {
        if (PKWK_ENCODING_HINT != '') {
            $spam = TRUE;
        }
    }
    // Vaildation foreign values(by miko)
    if (!in_array($post['priority'], $_plugin_bugtrack['priority_list'])) {
        $spam = TRUE;
    }
    if (!in_array($post['state'], $_plugin_bugtrack['state_list'])) {
        $spam = TRUE;
    }
    if ($spam) {
        honeypot_write();
        return array('msg' => 'cannot write', 'body' => '<p>prohibits editing</p>');
    }
    $page = plugin_bugtrack_write($post['base'], $post['pagename'], $post['summary'], $post['name'], $post['priority'], $post['state'], $post['category'], $post['version'], $post['body']);
    pkwk_headers_sent();
    header('Location: ' . get_page_location_uri($page));
    exit;
}