当前位置: 首页>>代码示例>>PHP>>正文


PHP COM_output函数代码示例

本文整理汇总了PHP中COM_output函数的典型用法代码示例。如果您正苦于以下问题:PHP COM_output函数的具体用法?PHP COM_output怎么用?PHP COM_output使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了COM_output函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fncview

function fncview($uid, $template)
{
    $pi_name = "userbox";
    global $_CONF;
    global $LANG_USERBOX_ADMIN;
    //template フォルダ
    $tmplfld = DATABOX_templatePath('admin', 'default', $pi_name);
    $tmpl = new Template($tmplfld);
    $tmpl->set_file(array('view' => 'view.thtml'));
    //--
    $tmpl->set_var('site_admin_url', $_CONF['site_admin_url']);
    if ($template === "") {
        $tmpl->set_var('about_thispage', $LANG_USERBOX_ADMIN['about_admin_view']);
    } else {
        $tmpl->set_var('about_thispage', "");
    }
    $tmpl->parse('output', 'view');
    $view = $tmpl->finish($tmpl->get_var('output'));
    $information = array();
    $retval = userbox_profile($uid, $template, "", "view");
    $layout = $retval['layout'];
    $information['headercode'] = $retval['headercode'];
    $information['pagetitle'] = $retval['title'];
    $display = $view;
    $display .= $retval['display'];
    $display = DATABOX_displaypage($pi_name, $layout, $display, $information);
    COM_output($display);
}
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:28,代码来源:view.php

示例2: MG_access_denied

function MG_access_denied()
{
    global $LANG_MG00, $LANG_ACCESS;
    $display = COM_startBlock($LANG_ACCESS['accessdenied'], '', COM_getBlockTemplate('_msg_block', 'header')) . '<br' . XHTML . '>' . $LANG_MG00['access_denied_msg'] . COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
    $display = MG_createHTMLDocument($display);
    COM_output($display);
    exit;
}
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:8,代码来源:popup.php

示例3: MG_invalidRequest

function MG_invalidRequest()
{
    global $LANG_MG02;
    $display = COM_showMessageText($LANG_MG02['generic_error']);
    $display = MG_createHTMLDocument($display);
    COM_output($display);
    exit;
}
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:8,代码来源:admin.php

示例4: CUSTOM_handle404

function CUSTOM_handle404($alternate_url = '')
{
    global $_CONF, $_USER, $LANG_404;
    // send 404 in any case
    header('HTTP/1.1 404 Not Found');
    header('Status: 404 Not Found');
    $display .= COM_startBlock($LANG_404[1]);
    if (isset($_SERVER['SCRIPT_URI'])) {
        $url = strip_tags($_SERVER['SCRIPT_URI']);
    } else {
        $request = $_SERVER['REQUEST_URI'];
        $url = 'http://' . $_SERVER['HTTP_HOST'] . strip_tags($request);
    }
    // Add log stuff
    if (isset($_USER['uid'])) {
        $byuser = $_USER['uid'] . '@' . $_SERVER['REMOTE_ADDR'];
    } else {
        $byuser = 'anon@' . $_SERVER['REMOTE_ADDR'];
    }
    $refurl = $_SERVER['HTTP_REFERER'];
    $remoteaddress = $_SERVER['REMOTE_ADDR'];
    $timestamp = @strftime('%c');
    $logentry = "404 Error generated by {$byuser} for url: {$url} - Referring url: {$refurl}";
    $logfile = $_CONF['path_log'] . '404.log';
    if (!($file = fopen($logfile, 'a'))) {
    } else {
        fputs($file, "{$timestamp} - {$logentry} \n");
    }
    $display .= CUSTOM_getStaticpage('404');
    $display .= sprintf($LANG_404[2], $url);
    if ($alternate_url != '') {
        $display .= sprintf($LANG_404[4], $alternate_url);
    } else {
        $display .= $LANG_404[3];
    }
    $display .= COM_endBlock();
    // $display = COM_createHTMLDocument($display, array('pagetitle' => $LANG_404[1]));
    $display = COM_createHTMLDocument($display, array('what' => 'none', 'pagetitle' => $LANG_404[1], 'rightblock' => false));
    COM_output($display);
    exit;
    // Do not want to go any further
}
开发者ID:milk54,项目名称:geeklog-japan,代码行数:42,代码来源:custom_handle404.php

示例5: show

 function show($e_code, $pages = 1)
 {
     global $_CONF;
     $errmsg = array("0001" => "Could not connect to the forums database.", "0002" => "The forum you selected does not exist. Please go back and try again.", "0003" => "Password Incorrect.", "0004" => "Could not query the topics database.", "0005" => "Error getting messages from the database.", "0006" => "Please enter the Nickname and the Password.", "0007" => "You are not the Moderator of this forum therefore you can't perform this function.", "0008" => "You did not enter the correct password, please go back and try again.", "0009" => "Could not remove posts from the database.", "0010" => "Could not move selected topic to selected forum. Please go back and try again.", "0011" => "Could not lock the selected topic. Please go back and try again.", "0012" => "Could not unlock the selected topic. Please go back and try again.", "0013" => "Could not query the database. <br" . XHTML . ">Error: " . mysql_error(), "0014" => "No such user or post in the database.", "0015" => "Search Engine was unable to query the forums database.", "0016" => "That user does not exist. Please go back and search again.", "0017" => "You must type a subject to post. You can't post an empty subject. Go back and enter the subject", "0018" => "You must choose message icon to post. Go back and choose message icon.", "0019" => "You must type a message to post. You can't post an empty message. Go back and enter a message.", "0020" => "Could not enter data into the database. Please go back and try again.", "0021" => "Can't delete the selected message.", "0022" => "An error ocurred while querying the database.", "0023" => "Selected message was not found in the forum database.", "0024" => "You can't reply to that message. It wasn't sent to you.", "0025" => "You can't post a reply to this topic, it has been locked. Contact the administrator if you have any question.", "0026" => "The forum or topic you are attempting to post to does not exist. Please try again.", "0027" => "You must enter your username and password. Go back and do so.", "0028" => "You have entered an incorrect password. Go back and try again.", "0029" => "Couldn't update post count.", "0030" => "The forum you are attempting to post to does not exist. Please try again.", "0031" => "Unknown Error", "0035" => "You can't edit a post that's not yours.", "0036" => "You do not have permission to edit this post.", "0037" => "You did not supply the correct password or do not have permission to edit this post. Please go back and try again.", "1001" => "Please enter value for Title.", "1002" => "Please enter value for Phone.", "1003" => "Please enter value for Summary.", "1004" => "Please enter value for Address.", "1005" => "Please enter value for City.", "1006" => "Please enter value for State/Province.", "1007" => "Please enter value for Zipcode.", "1008" => "Please enter value for Description.", "1009" => "Vote for the selected resource only once.<br" . XHTML . ">All votes are logged and reviewed.", "1010" => "You cannot vote on the resource you submitted.<br" . XHTML . ">All votes are logged and reviewed.", "1011" => "No rating selected - no vote tallied.", "1013" => "Please enter a search query.", "1016" => "Please enter value for Filename.", "1017" => "The file was not uploaded - reported filesize of 0 bytes.", "1101" => "Upload approval Error: The temporary file was not found. Check error.log", "1102" => "Upload submit Error: The temporary filestore file was not created. Check error.log", "1103" => "The download info you provided is already in the database!", "1104" => "The download info was not complete - Need to enter a title for the new file", "1105" => "The download info was not complete - Need to enter a description for the new file", "1106" => "Upload Add Error: The new file was not created. Check error.log", "1107" => "Upload Add Error: The temporary file was not found. Check error.log", "1108" => "Duplicate file - already existing in filestore", "9999" => "OOPS! God Knows");
     $errorno = array_keys($errmsg);
     if (!in_array($e_code, $errorno)) {
         $e_code = '9999';
     }
     include_once $_CONF[path_html] . "filemgmt/include/header.php";
     $display = '';
     $display .= '<table class="plugin" border="0" cellspacing="0" cellpadding="1" style="width:100%;">';
     $display .= '<tr><td class="pluginAlert" style="text-align:right; padding:5px;">File Management Plugin</td>';
     $display .= '<td class="pluginAlert" style="width:50%; padding:5px 0px 5px 10px;">Error Code: ' . $e_code . '</td></tr>';
     $display .= '<tr><td colspan="2" class="pluginInfo"><b>ERROR:</b> ' . $errmsg[$e_code] . '</td></tr>';
     $display .= '<tr><td colspan="2" class="pluginInfo" style="text-align:center;padding:10px;">';
     $display .= '[ <a href="javascript:history.go(-' . $pages . ')">Go Back</a> ]</td></tr></table>';
     if (function_exists('COM_createHTMLDocument')) {
         $display = COM_createHTMLDocument($display);
     } else {
         $display = COM_siteHeader() . $display . COM_siteFooter();
     }
     COM_output($display);
     die("");
 }
开发者ID:milk54,项目名称:geeklog-japan,代码行数:24,代码来源:errorhandler.php

示例6: MG_processDir

function MG_processDir($dir, $album_id, $purgefiles, $recurse)
{
    global $_TABLES, $LANG_MG02;
    if (!@is_dir($dir)) {
        $display = COM_showMessageText($LANG_MG02['invalid_directory'] . '  [ <a href=\'javascript:history.go(-1)\'>' . $LANG_MG02['go_back'] . '</a> ]');
        $display = MG_createHTMLDocument($display);
        COM_output($display);
        exit;
    }
    if (!($dh = @opendir($dir))) {
        $display = COM_showMessageText($LANG_MG02['directory_error'] . '  [ <a href=\'javascript:history.go(-1)\'>' . $LANG_MG02['go_back'] . '</a> ]');
        $display = MG_createHTMLDocument($display);
        COM_output($display);
        exit;
    }
    while (($file = readdir($dh)) != false) {
        if ($file == '..' || $file == '.') {
            continue;
        }
        set_time_limit(60);
        $filename = $file;
        if (PHP_OS == "WINNT") {
            $filetmp = $dir . "\\" . $file;
        } else {
            $filetmp = $dir . '/' . $file;
        }
        if (is_dir($filetmp)) {
            if ($recurse) {
                $statusMsg .= MG_processDir($filetmp, $album_id, $purgefiles, $recurse);
            }
        } else {
            $max_filesize = DB_getItem($_TABLES['mg_albums'], 'max_filesize', 'album_id=' . intval($album_id));
            if ($max_filesize != 0 && filesize($filetmp) > $max_filesize) {
                COM_errorLog("MG Upload: File " . $file . " exceeds maximum filesize for this album.");
                $statusMsg = sprintf($LANG_MG02['upload_exceeds_max_filesize'] . '<br' . XHTML . '>', $file);
                continue;
            }
            $filetype = "application/force-download";
            $opt = array('upload' => 0, 'purgefiles' => $purgefiles, 'filetype' => $filetype);
            list($rc, $msg) = MG_getFile($filetmp, $file, $album_id, $opt);
            $statusMsg .= $file . ' ' . $msg . '<br' . XHTML . '>';
        }
    }
    closedir($dh);
    return $statusMsg;
}
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:46,代码来源:lib-upload.php

示例7: COM_handle404

/**
 * Display a 404 not found error message
 *
 * @param    string    $alternate_url  Point the user to another location
 */
function COM_handle404($alternate_url = '')
{
    global $_CONF, $_USER, $LANG_404;
    if (function_exists('CUSTOM_handle404')) {
        CUSTOM_handle404($alternate_url);
        exit;
    }
    // send 404 in any case
    header('HTTP/1.1 404 Not Found');
    header('Status: 404 Not Found');
    // Add log stuff
    $url = COM_getCurrentURL();
    if (isset($_USER['uid'])) {
        $byuser = $_USER['uid'] . '@' . $_SERVER['REMOTE_ADDR'];
    } else {
        $byuser = 'anon@' . $_SERVER['REMOTE_ADDR'];
    }
    $refurl = $_SERVER['HTTP_REFERER'];
    $timestamp = @strftime('%c');
    $logentry = "404 Error generated by {$byuser} for url: {$url}";
    if (!empty($refurl)) {
        $logentry .= " - Referring url: {$refurl}";
    }
    $logentry = str_replace(array('<?', '?>'), array('(@', '@)'), $logentry);
    $logfile = $_CONF['path_log'] . '404.log';
    if ($file = fopen($logfile, 'a')) {
        fputs($file, "{$timestamp} - {$logentry} \n");
    }
    $display = COM_startBlock($LANG_404[1]);
    $display .= sprintf($LANG_404[2], $url);
    if ($alternate_url != '') {
        $display .= sprintf($LANG_404[4], $alternate_url);
    } else {
        $display .= $LANG_404[3];
    }
    $display .= COM_endBlock();
    $display = COM_createHTMLDocument($display, array('pagetitle' => $LANG_404[1]));
    COM_output($display);
    exit;
    // Do not want to go any further
}
开发者ID:mistgrass,项目名称:geeklog-japan,代码行数:46,代码来源:lib-common.php

示例8: handleIconUpload

/**
 * Upload new topic icon, replaces previous icon if one exists
 *
 * @param    string $tid ID of topic to prepend to filename
 * @return   string          filename of new photo (empty = no new photo)
 */
function handleIconUpload($tid)
{
    global $_CONF, $_TABLES, $LANG27;
    $upload = new Upload();
    if (!empty($_CONF['image_lib'])) {
        if ($_CONF['image_lib'] == 'imagemagick') {
            // Using imagemagick
            $upload->setMogrifyPath($_CONF['path_to_mogrify']);
        } elseif ($_CONF['image_lib'] == 'netpbm') {
            // using netPBM
            $upload->setNetPBM($_CONF['path_to_netpbm']);
        } elseif ($_CONF['image_lib'] == 'gdlib') {
            // using the GD library
            $upload->setGDLib();
        }
        $upload->setAutomaticResize(true);
        if (isset($_CONF['debug_image_upload']) && $_CONF['debug_image_upload']) {
            $upload->setLogFile($_CONF['path'] . 'logs/error.log');
            $upload->setDebug(true);
        }
        if (isset($_CONF['jpeg_quality'])) {
            $upload->setJpegQuality($_CONF['jpeg_quality']);
        }
    }
    $upload->setAllowedMimeTypes(array('image/gif' => '.gif', 'image/jpeg' => '.jpg,.jpeg', 'image/pjpeg' => '.jpg,.jpeg', 'image/x-png' => '.png', 'image/png' => '.png'));
    if (!$upload->setPath($_CONF['path_images'] . 'topics')) {
        $display = COM_showMessageText($upload->printErrors(false), $LANG27[29]);
        $display = COM_createHTMLDocument($display, array('pagetitle' => $LANG27[29]));
        COM_output($display);
        exit;
        // don't return
    }
    $filename = '';
    // see if user wants to upload a (new) icon
    $newIcon = $_FILES['newicon'];
    if (!empty($newIcon['name'])) {
        $pos = strrpos($newIcon['name'], '.') + 1;
        $fExtension = substr($newIcon['name'], $pos);
        $filename = 'topic_' . $tid . '.' . $fExtension;
    }
    // do the upload
    if (!empty($filename)) {
        $upload->setFileNames($filename);
        $upload->setPerms('0644');
        if ($_CONF['max_topicicon_width'] > 0 && $_CONF['max_topicicon_height'] > 0) {
            $upload->setMaxDimensions($_CONF['max_topicicon_width'], $_CONF['max_topicicon_height']);
        } else {
            $upload->setMaxDimensions($_CONF['max_image_width'], $_CONF['max_image_height']);
        }
        if ($_CONF['max_topicicon_size'] > 0) {
            $upload->setMaxFileSize($_CONF['max_topicicon_size']);
        } else {
            $upload->setMaxFileSize($_CONF['max_image_size']);
        }
        $upload->uploadFiles();
        if ($upload->areErrors()) {
            $display = COM_showMessageText($upload->printErrors(false), $LANG27[29]);
            $display = COM_createHTMLDocument($display, array('pagetitle' => $LANG27[29]));
            COM_output($display);
            exit;
            // don't return
        }
        if (strpos($_CONF['path_images'], $_CONF['path_html']) === 0) {
            $filename = substr($_CONF['path_images'], strlen($_CONF['path_html']) - 1) . 'topics/' . $filename;
        } else {
            /**
             * Not really used when the 'path_images' is outside of the webroot.
             * Let's at least extract the name of the images directory then.
             */
            $images = 'images';
            $parts = explode('/', $_CONF['path_images']);
            if (count($parts) > 1) {
                $cnt = count($parts);
                // e.g. from /path/to/myimages/ would extract "myimages"
                if (empty($parts[$cnt - 1]) && !empty($parts[$cnt - 2])) {
                    $images = $parts[$cnt - 2];
                }
                $filename = '/' . $images . '/topics/' . $filename;
            }
        }
    }
    return $filename;
}
开发者ID:mystralkk,项目名称:geeklog,代码行数:89,代码来源:topic.php

示例9: unlink

    unlink($_CONF['path_log'] . $_POST['log']);
    $timestamp = strftime("%c");
    $fd = fopen($_CONF['path_log'] . $_POST['log'], a);
    fputs($fd, "{$timestamp} - Log File Cleared \n");
    fclose($fd);
    $action = $LANG_MONITOR_1['view_log'];
}
if ($action == $LANG_MONITOR_1['view_log']) {
    $retval .= "<hr><p><b>{$LANG_MONITOR_1['log_file']} " . $_POST['log'] . "</b></p><pre>";
    $retval .= implode('', file($_CONF['path_log'] . $_POST['log']));
    $retval .= "</pre>";
}
$T->set_var(array('configuration' => $LANG_MONITOR_1['configuration'], 'doc' => $LANG_MONITOR_1['doc'], 'admin_body' => $retval, 'site_admin_url' => $_CONF['site_admin_url'], 'cron' => $cron));
$T->parse('output', 'admin');
$display .= $T->finish($T->get_var('output'));
// Options
$html_infos['what'] = 'menu';
// If 'none' then no left blocks are returned, if 'menu' (default) then right blocks are returned
$html_infos['pagetitle'] = $MESSAGE[30];
// Optional content for the page's <title>
$html_infos['breadcrumbs'] = '';
// Optional content for the page's breadcrumb
$html_infos['headercode'] = '';
// Optional code to go into the page's <head>
$html_infos['rightblock'] = '';
// Whether or not to show blocks on right hand side default is no (-1)
$html_infos['custom'] = array();
// An array defining custom function to be used to format Rightblocks
//Output
COM_output(COM_createHTMLDocument($display, $html_infos));
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:30,代码来源:index.php

示例10: savepoll

/**
* Saves a poll
*
* Saves a poll topic and potential answers to the database
*
* @param    string  $pid            Poll topic ID
* @param    string  $old_pid        Previous poll topic ID
* @param    array   $Q              Array of poll questions
* @param    string  $mainpage       Checkbox: poll appears on homepage
* @param    string  $topic          The text for the topic
* @param    string  $meta_description
* @param    string  $meta_keywords
* @param    int     $statuscode     (unused)
* @param    string  $open           Checkbox: poll open for voting
* @param    string  $hideresults    Checkbox: hide results until closed
* @param    int     $commentcode    Indicates if users can comment on poll
* @param    array   $A              Array of possible answers
* @param    array   $V              Array of vote per each answer
* @param    array   $R              Array of remark per each answer
* @param    int     $owner_id       ID of poll owner
* @param    int     $group_id       ID of group poll belongs to
* @param    int     $perm_owner     Permissions the owner has on poll
* @param    int     $perm_grup      Permissions the group has on poll
* @param    int     $perm_members   Permissions logged in members have on poll
* @param    int     $perm_anon      Permissions anonymous users have on poll
* @return   string                  HTML redirect or error message
*
*/
function savepoll($pid, $old_pid, $Q, $mainpage, $topic, $meta_description, $meta_keywords, $statuscode, $open, $hideresults, $commentcode, $A, $V, $R, $owner_id, $group_id, $perm_owner, $perm_group, $perm_members, $perm_anon)
{
    global $_CONF, $_TABLES, $_USER, $LANG21, $LANG25, $MESSAGE, $_POLL_VERBOSE, $_PO_CONF;
    $retval = '';
    // Convert array values to numeric permission values
    list($perm_owner, $perm_group, $perm_members, $perm_anon) = SEC_getPermissionValues($perm_owner, $perm_group, $perm_members, $perm_anon);
    $topic = COM_stripslashes($topic);
    $meta_description = strip_tags(COM_stripslashes($meta_description));
    $meta_keywords = strip_tags(COM_stripslashes($meta_keywords));
    $pid = COM_sanitizeID($pid);
    $old_pid = COM_sanitizeID($old_pid);
    if (empty($pid)) {
        if (empty($old_pid)) {
            $pid = COM_makeSid();
        } else {
            $pid = $old_pid;
        }
    }
    // check if any question was entered
    if (empty($topic) or count($Q) == 0 or strlen($Q[0]) == 0 or strlen($A[0][0]) == 0) {
        $retval .= COM_siteHeader('menu', $LANG25[5]);
        $retval .= COM_startBlock($LANG21[32], '', COM_getBlockTemplate('_msg_block', 'header'));
        $retval .= $LANG25[2];
        $retval .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
        $retval .= COM_siteFooter();
        return $retval;
    }
    if (!SEC_checkToken()) {
        COM_accessLog("User {$_USER['username']} tried to save poll {$pid} and failed CSRF checks.");
        return COM_refresh($_CONF['site_admin_url'] . '/plugins/polls/index.php');
    }
    // check for poll id change
    if (!empty($old_pid) && $pid != $old_pid) {
        // check if new pid is already in use
        if (DB_count($_TABLES['polltopics'], 'pid', $pid) > 0) {
            // TBD: abort, display editor with all content intact again
            $pid = $old_pid;
            // for now ...
        }
    }
    // start processing the poll topic
    if ($_POLL_VERBOSE) {
        COM_errorLog('**** Inside savepoll() in ' . $_CONF['site_admin_url'] . '/plugins/polls/index.php ***');
    }
    $access = 0;
    if (DB_count($_TABLES['polltopics'], 'pid', $pid) > 0) {
        $result = DB_query("SELECT owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon FROM {$_TABLES['polltopics']} WHERE pid = '{$pid}'");
        $P = DB_fetchArray($result);
        $access = SEC_hasAccess($P['owner_id'], $P['group_id'], $P['perm_owner'], $P['perm_group'], $P['perm_members'], $P['perm_anon']);
    } else {
        $access = SEC_hasAccess($owner_id, $group_id, $perm_owner, $perm_group, $perm_members, $perm_anon);
    }
    if ($access < 3 || !SEC_inGroup($group_id)) {
        $display .= COM_siteHeader('menu', $MESSAGE[30]) . COM_showMessageText($MESSAGE[29], $MESSAGE[30]) . COM_siteFooter();
        COM_accessLog("User {$_USER['username']} tried to illegally submit or edit poll {$pid}.");
        COM_output($display);
        exit;
    }
    if (empty($voters)) {
        $voters = 0;
    }
    if ($_POLL_VERBOSE) {
        COM_errorLog('owner permissions: ' . $perm_owner, 1);
        COM_errorLog('group permissions: ' . $perm_group, 1);
        COM_errorLog('member permissions: ' . $perm_members, 1);
        COM_errorLog('anonymous permissions: ' . $perm_anon, 1);
    }
    // we delete everything and re-create it with the input from the form
    $del_pid = $pid;
    if (!empty($old_pid) && $pid != $old_pid) {
        $del_pid = $old_pid;
        // delete by old pid, create using new pid below
//.........这里部分代码省略.........
开发者ID:hostellerie,项目名称:nexpro,代码行数:101,代码来源:index.php

示例11: SEC_checkToken

/**
 * Check a security token.
 * Checks the POST and GET data for a security token, if one exists, validates
 * that it's for this user and URL. If the token is not valid, it asks the user
 * to re-authenticate and resends the request if authentication was successful.
 *
 * @return   boolean     true if the token is valid; does not return if not!
 * @see      SECINT_checkToken
 * @link     http://wiki.geeklog.net/index.php/Re-Authentication_for_expired_Tokens
 */
function SEC_checkToken()
{
    global $_CONF, $LANG20, $LANG_ADMIN;
    if (SECINT_checkToken()) {
        // if this was a recreated request, recreate $_FILES array, too
        SECINT_recreateFilesArray();
        return true;
    }
    /**
     * Token not valid (probably expired): Ask user to authenticate again
     */
    $returnurl = COM_getCurrentUrl();
    $method = strtoupper($_SERVER['REQUEST_METHOD']);
    $postdata = serialize($_POST);
    $getdata = serialize($_GET);
    $files = '';
    if (!empty($_FILES)) {
        // rescue uploaded files
        foreach ($_FILES as $key => $f) {
            if (!empty($f['name'])) {
                $filename = basename($f['tmp_name']);
                move_uploaded_file($f['tmp_name'], $_CONF['path_data'] . $filename);
                $_FILES[$key]['tmp_name'] = $filename;
                // drop temp. dir
            }
        }
        $files = serialize($_FILES);
    }
    $display = COM_showMessageText($LANG_ADMIN['token_expired']) . SECINT_authform($returnurl, $method, $postdata, $getdata, $files);
    $display = COM_createHTMLDocument($display, array('pagetitle' => $LANG20[1]));
    COM_output($display);
    exit;
    // we don't return from here
}
开发者ID:Geeklog-Core,项目名称:geeklog,代码行数:44,代码来源:lib-security.php

示例12: COM_applyFilter

$retval .= "</select>&nbsp;&nbsp;&nbsp;&nbsp;";
$retval .= "<input type=\"submit\" name=\"action\" value=\"{$LANG_CP00['view_file']}\"" . XHTML . ">";
$retval .= "&nbsp;&nbsp;&nbsp;&nbsp;";
$retval .= "<input type=\"submit\" name=\"action\" value=\"{$LANG_CP00['clear_file']}\"" . XHTML . ">";
$retval .= "</form>";
$action = COM_applyFilter($_REQUEST['action']);
if ($action == $LANG_CP00['clear_file']) {
    @unlink($_CONF['path_log'] . $log);
    $timestamp = strftime("%c");
    $fd = fopen($_CONF['path_log'] . $log, 'a');
    fputs($fd, "{$timestamp} - {$LANG_CP00['file_cleared']} \n");
    fclose($fd);
    $action = $LANG_CP00['view_file'];
}
if ($action == $LANG_CP00['view_file']) {
    $retval .= "<hr" . XHTML . "><p><b>{$LANG_CP00['file']} " . $log . "</b></p><div class=\"captcha_logview\">";
    if (file_exists($_CONF['path_log'] . $log)) {
        $retval .= implode('<br' . XHTML . '><br' . XHTML . '>', file($_CONF['path_log'] . $log));
    }
    $retval .= "</div>";
}
$T->set_var(array('admin_body' => $retval, 'title' => $LANG_CP00['log_viewer']));
$T->parse('output', 'admin');
$display .= $T->finish($T->get_var('output')) . COM_endBlock();
//Output
if (function_exists("COM_createHTMLDocument")) {
    //Geeklog 2.0+
    COM_output(COM_createHTMLDocument($display));
} else {
    COM_output(COM_siteHeader() . $display . COM_siteFooter(true));
}
开发者ID:milk54,项目名称:geeklog-japan,代码行数:31,代码来源:index.php

示例13: SP_getPerms

    if ($msg <= 0) {
        $msg = 0;
    }
}
// Handle just template staticpage security here, rest done in services.
// Cannot view template staticpages directly. If template staticpage bail here
// if user doesn't have edit rights.
if (DB_getItem($_TABLES['staticpage'], 'template_flag', "sp_id = '{$page}'") == 1) {
    if (SEC_hasRights('staticpages.edit')) {
        $perms = SP_getPerms('', '3');
        if (!empty($perms)) {
            $perms = ' AND ' . $perms;
        }
        if (DB_getItem($_TABLES['staticpage'], 'sp_id', "sp_id = '{$page}'" . $perms) == '') {
            COM_handle404();
            exit;
        }
    } else {
        COM_handle404();
        exit;
    }
}
$retval = SP_returnStaticpage($page, $display_mode, $comment_order, $comment_mode, $comment_page, $msg, $query);
if ($display_mode == 'print') {
    header('Content-Type: text/html; charset=' . COM_getCharset());
    if (!empty($_CONF['frame_options'])) {
        header('X-FRAME-OPTIONS: ' . $_CONF['frame_options']);
    }
}
COM_output($retval);
开发者ID:milk54,项目名称:geeklog-japan,代码行数:30,代码来源:index.php

示例14: COM_output

// | as published by the Free Software Foundation; either version 2            |
// | of the License, or (at your option) any later version.                    |
// |                                                                           |
// | This program is distributed in the hope that it will be useful,           |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of            |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             |
// | GNU General Public License for more details.                              |
// |                                                                           |
// | You should have received a copy of the GNU General Public License         |
// | along with this program; if not, write to the Free Software Foundation,   |
// | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           |
// |                                                                           |
// +---------------------------------------------------------------------------+
require_once '../../../lib-common.php';
if (!in_array('tag', $_PLUGINS)) {
    COM_output(COM_refresh($_CONF['site_url'] . '/index.php'));
    exit;
}
TAG_checkAdmin();
/**
* Main 
*/
class TagStats
{
    function TagStats()
    {
    }
    function add()
    {
    }
    function edit()
开发者ID:MikeDevue,项目名称:plugin-tag,代码行数:31,代码来源:stats.class.php

示例15: links_list

/**
* Create the links list depending on the category given
*
* @param    array   $message    message(s) to display
* @return   string              the links page
*
*/
function links_list($message)
{
    global $_CONF, $_TABLES, $_LI_CONF, $LANG_LINKS_ADMIN, $LANG_LINKS, $LANG_LINKS_STATS;
    $cid = $_LI_CONF['root'];
    $display = '';
    if (isset($_GET['category'])) {
        $cid = strip_tags(COM_stripslashes($_GET['category']));
    } elseif (isset($_POST['category'])) {
        $cid = strip_tags(COM_stripslashes($_POST['category']));
    }
    $cat = DB_escapeString($cid);
    $page = 0;
    if (isset($_GET['page'])) {
        $page = COM_applyFilter($_GET['page'], true);
    }
    if ($page == 0) {
        $page = 1;
    }
    if (empty($cid)) {
        if ($page > 1) {
            $page_title = sprintf($LANG_LINKS[114] . ' (%d)', $page);
        } else {
            $page_title = $LANG_LINKS[114];
        }
    } else {
        if ($cid == $_LI_CONF['root']) {
            $category = $LANG_LINKS['root'];
        } else {
            $category = DB_getItem($_TABLES['linkcategories'], 'category', "cid = '{$cat}'");
        }
        if ($page > 1) {
            $page_title = sprintf($LANG_LINKS[114] . ': %s (%d)', $category, $page);
        } else {
            $page_title = sprintf($LANG_LINKS[114] . ': %s', $category);
        }
    }
    // Check has access and existent to this category
    if ($cid != $_LI_CONF['root']) {
        $result = DB_query("SELECT owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon FROM {$_TABLES['linkcategories']} WHERE cid='{$cat}'");
        $A = DB_fetchArray($result);
        if (SEC_hasAccess($A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']) < 2) {
            $display .= COM_showMessage(5, 'links');
            $display = COM_createHTMLDocument($display, array('pagetitle' => $page_title));
            COM_output($display);
            exit;
        }
        // check existent
        if (!isset($A['owner_id'])) {
            $display .= COM_showMessage(16, 'links');
            $display = COM_createHTMLDocument($display, array('pagetitle' => $page_title));
            COM_output($display);
            exit;
        }
    }
    if (is_array($message) && !empty($message[0])) {
        $display .= COM_showMessageText($message[1], $message[0]);
    } else {
        if (isset($_REQUEST['msg'])) {
            $msg = COM_applyFilter($_REQUEST['msg'], true);
            if ($msg > 0) {
                $display .= COM_showMessage($msg, 'links');
            }
        }
    }
    $linklist = COM_newTemplate(CTL_plugin_templatePath('links'));
    $linklist->set_file(array('linklist' => 'links.thtml', 'catlinks' => 'categorylinks.thtml', 'link' => 'linkdetails.thtml', 'catnav' => 'categorynavigation.thtml', 'catrow' => 'categoryrow.thtml', 'catcol' => 'categorycol.thtml', 'actcol' => 'categoryactivecol.thtml', 'pagenav' => 'pagenavigation.thtml', 'catdrop' => 'categorydropdown.thtml'));
    $linklist->set_var('blockheader', COM_startBlock($LANG_LINKS[114]));
    if ($_LI_CONF['linkcols'] > 0) {
        // Create breadcrumb trail
        $linklist->set_var('breadcrumbs', links_breadcrumbs($_LI_CONF['root'], $cid));
        // Set dropdown for category jump
        $linklist->set_var('lang_go', $LANG_LINKS[124]);
        $linklist->set_var('link_dropdown', links_select_box(2, $cid));
        // Show categories
        $sql = "SELECT cid,pid,category,description FROM {$_TABLES['linkcategories']} WHERE pid='{$cat}'";
        $sql .= COM_getLangSQL('cid', 'AND');
        $sql .= COM_getPermSQL('AND') . " ORDER BY category";
        $result = DB_query($sql);
        $nrows = DB_numRows($result);
        if ($nrows > 0) {
            $linklist->set_var('lang_categories', $LANG_LINKS_ADMIN[14]);
            for ($i = 1; $i <= $nrows; $i++) {
                $C = DB_fetchArray($result);
                // Get number of child links user can see in this category
                $ccid = DB_escapeString($C['cid']);
                $result1 = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['links']} WHERE cid='{$ccid}'" . COM_getPermSQL('AND'));
                $D = DB_fetchArray($result1);
                // Get number of child categories user can see in this category
                $result2 = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['linkcategories']} WHERE pid='{$ccid}'" . COM_getPermSQL('AND'));
                $E = DB_fetchArray($result2);
                // Format numbers for display
                $display_count = '';
                // don't show zeroes
//.........这里部分代码省略.........
开发者ID:milk54,项目名称:geeklog-japan,代码行数:101,代码来源:index.php


注:本文中的COM_output函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。