Пример #1
0
/**
 * Redirect function for generic trackers.
 * This function checks the artifact short name and project.
 * If the name is not the same as the tracker's short name, a warning is displayed.
 * If the artifact does not belong to the same project as the referring page, a warning is also displayed.
 */
function generic_redirect($location, $aid, $group_id, $art_group_id, $atid, $atn, $art_name)
{
    global $Language;
    $feed = '';
    if ($group_id && $group_id != $art_group_id) {
        // The link is coming from another project, add a warning msg
        $group_name = util_get_group_name_from_id($art_group_id);
        $feed = "&feedback=" . urlencode($Language->getText('tracker_gotoid', 'art_belongs_to', $group_name));
    }
    if ($atn && strtolower($atn) != strtolower($art_name)) {
        if (strtolower($atn) != "art" && strtolower($atn) != "artifact") {
            $feed .= urlencode($Language->getText('tracker_gotoid', 'art_is_a', array($art_name, $atn)));
        }
    }
    $location .= "/tracker/?func=detail&aid=" . (int) $aid . "&group_id=" . (int) $art_group_id . "&atid=" . (int) $atid . $feed;
    header($location);
    exit;
}
Пример #2
0
    if (permission_exist('DOCUMENT_READ', $docid)) {
        if (!permission_is_authorized('DOCUMENT_READ', $docid, user_getid(), $object_group_id)) {
            exit_error($Language->getText('global', 'perm_denied'), $Language->getText('global', 'error_perm_denied'));
        }
    } else {
        if (!permission_is_authorized('DOCGROUP_READ', $row['doc_group'], user_getid(), $object_group_id)) {
            exit_error($Language->getText('global', 'perm_denied'), $Language->getText('global', 'error_perm_denied'));
        }
    }
    if (user_isloggedin()) {
        //Insert a new entry in the doc_log table only for restricted documents
        $sql = "INSERT INTO doc_log(user_id,docid,time) " . "VALUES ('" . user_getid() . "','" . $docid . "','" . time() . "')";
        $res_insert = db_query($sql);
    }
    // HTML or text files that were copy/pasted are displayed in a Codendi-formatted page.
    // Uploaded files are always displayed as-is.
    if (($row['filetype'] == 'text/html' || $row['filetype'] == 'text/plain') && $row['filesize'] == 0) {
        docman_header(array('title' => $row['title'], 'help' => 'DocumentManager.html'));
        if ($object_group_id != $from_group_id) {
            $group_name = util_get_group_name_from_id($object_group_id);
            print '<H3><span class="feedback">' . $Language->getText('docman_display_doc', 'warning_different_group', array($group_name)) . '</span></H3>';
        }
        // Document data can now contain HTML tags but not php code
        print util_unconvert_htmlspecialchars($row['data']);
        docman_footer($params);
    } else {
        session_redirect("/docman/download.php?docid=" . $docid);
    }
} else {
    exit_error($Language->getText('global', 'error'), $Language->getText('docman_display_doc', 'error_wrongid'));
}
Пример #3
0
 // Build the mail to be sent
 $vSrep = new Valid_WhiteList('send_reply', array('Submit'));
 $vSrep->required();
 if ($request->valid($vSrep)) {
     // process the mail
     $ret = plugin_forumml_process_mail($p, true);
     if ($ret) {
         $GLOBALS['Response']->addFeedback('warning', $GLOBALS['Language']->getText('plugin_forumml', 'delay_redirection', array($p->getThemePath() . "/images/ic/spinner-greenie.gif", $group_id, $list_id, $topic)), CODENDI_PURIFIER_DISABLED);
     }
 }
 $vRep = new Valid_WhiteList('reply', array('1'));
 $vRep->required();
 if ($request->valid($vRep)) {
     $GLOBALS['Response']->addFeedback('warning', $GLOBALS['Language']->getText('plugin_forumml', 'warn_post_without_confirm'));
 }
 $params['title'] = util_get_group_name_from_id($group_id) . ' - ForumML - ' . $list_name;
 if ($topicSubject) {
     $params['title'] .= ' - ' . $topicSubject;
 }
 $params['group'] = $group_id;
 $params['toptab'] = 'mail';
 $params['help'] = "CommunicationServices.html#MailingLists";
 if ($request->valid(new Valid_Pv('pv'))) {
     $params['pv'] = $request->get('pv');
 }
 mail_header($params);
 if ($request->valid($vSrep) && $request->valid($vTopic)) {
     if (isset($ret) && $ret) {
         // wait few seconds before redirecting to archives page
         echo "<script> setTimeout('window.location=\"/plugins/forumml/message.php?group_id=" . $group_id . "&list=" . $list_id . "&topic=" . $topic . "\"',3000) </script>";
     }