Example #1
0
function handle_pear_errors($error_obj)
{
    response_header("Oops! We are sorry that you are unable to report an undocumented feature today.");
    $error = "<p>Greetings! We are experiencing an error, and in the spirit of Open Source would like you to fix it. ";
    $error .= "Or more likely, just wait and someone else will find and solve this.</p>\n";
    $error .= "<p>It's our guess that the database is down. Argh!!!</p>\n";
    // FIXME: If logged in, show other stuff....
    response_footer($error);
    exit;
}
Example #2
0
            include dirname(__FILE__) . '/index.php';
            exit;
        }
        if (isset($_POST['url']) && !empty($_POST['url'])) {
            $pendingComments = $manualNotes->getPageComments($_POST['url'], 'pending');
        } else {
            $pendingComments = $manualNotes->getPageComments('', 'pending', true);
        }
        $url = isset($_POST['url']) ? strip_tags($_POST['url']) : '';
        $error = '';
        require PEARWEB_TEMPLATEDIR . '/notes/note-manage-admin.tpl.php';
        break;
    case 'updatesingle':
        break;
    default:
        response_header('Note Administration', null, null);
        report_error('Missing action');
        response_footer();
        exit;
}
function getPackageNameForId($id)
{
    global $dbh;
    $res = preg_match('/^package\\.[\\w-]+\\.([\\w-]+).*\\.php$/', $id, $matches);
    if ($res === 0) {
        return null;
    }
    $package = str_replace('-', '_', $matches[1]);
    $query = 'SELECT name FROM packages WHERE LCASE(name) = LCASE(?)';
    return $dbh->getOne($query, $package);
}
Example #3
0
/**
 * Display html footer and closing html tag
 *
 * @param string $id    ID of docbook chunk (manual page id)
 * @param string $title Manual page title
 *
 * @return void
 */
function manualFooter($id, $title = '')
{
    echo "</div>\n";
    global $HTDIG;
    if (!$HTDIG) {
        navigationBar($id, $title, 'bottom');
    }
    response_footer();
}
Example #4
0
\t\t\t\t\$(this).hide('slow');
\t\t\t}
\t\t});
\t}
\treturn false;
}
</script>
bug_JS;
if ($edit == 1) {
    $bug_JS .= '
<script type="text/javascript" src="js/jquery.autocomplete-min.js"></script>
<script type="text/javascript" src="js/userlisting.php"></script> 	
<script type="text/javascript" src="js/search.js"></script>
	';
}
response_footer($bug_JS);
// Helper functions
function mark_related_bugs($from, $comment_name, $ncomment)
{
    global $bug_id;
    $related = get_ticket_links($ncomment);
    /**
     * Adds a new comment on the related bug pointing to the current report
     */
    foreach ($related as $bug) {
        bugs_add_comment($bug, $from, $comment_name, 'Related To: Bug #' . $bug_id, 'related');
    }
}
function link_to_people($email, $text)
{
    $domain = strstr($email, "@");
Example #5
0
function auth_require()
{
    global $auth_user;
    $res = true;
    $user = @$_COOKIE['PEAR_USER'];
    $passwd = @$_COOKIE['PEAR_PW'];
    if (!auth_verify($user, $passwd)) {
        auth_reject();
        // exits
    }
    $num = func_num_args();
    for ($i = 0; $i < $num; $i++) {
        $arg = func_get_arg($i);
        $res = auth_check($arg);
        if ($res === true) {
            return true;
        }
    }
    if ($res === false) {
        response_header("Insufficient Privileges");
        report_error("Insufficient Privileges");
        response_footer();
        exit;
    }
    return true;
}
Example #6
0
/**
 * Generates a complete PEAR web page with an error message in it then
 * calls exit
 *
 * For use with PEAR_ERROR_CALLBACK error handling mode to print fatal
 * errors and die.
 *
 * @param string|array|PEAR_Error $in  see report_error() for more info
 * @param string $title  string to be put above the message
 *
 * @return void
 *
 * @see report_error()
 */
function error_handler($errobj, $title = 'Error')
{
    response_header($title);
    report_error($errobj);
    response_footer();
    exit;
}
Example #7
0
/**
 * Generates a complete PEAR web page with an error message in it then
 * calls exit
 *
 * For use with PEAR_ERROR_CALLBACK error handling mode to print fatal
 * errors and die.
 *
 * @param string|array|PEAR_Error $in  see report_error() for more info
 * @param string $title  string to be put above the message
 *
 * @return void
 *
 * @see report_error()
 */
function error_handler($errobj, $title = 'Error')
{
    response_header($title);
    report_error($errobj);
    response_footer();
    error_log('pearweb errorhandler: ' . get_detail_error_msg($errobj), 0);
    exit;
}
Example #8
0
function manualFooter($title, $id = "")
{
    global $HTDIG;
    if (!$HTDIG) {
        navigationBar($title, $id, "bottom");
    }
    response_footer();
}
Example #9
0
function auth_require($admin = false)
{
    global $auth_user;
    $res = true;
    if (!is_logged_in()) {
        auth_reject();
        // exits
    }
    $num = func_num_args();
    for ($i = 0; $i < $num; $i++) {
        $arg = func_get_arg($i);
        $res = auth_check($arg);
        if ($res == true) {
            return true;
        }
    }
    if ($res == false) {
        response_header("Insufficient Privileges");
        report_error("Insufficient Privileges");
        response_footer();
        exit;
    }
    return true;
}