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


PHP edit_auth函数代码示例

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


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

示例1: plugin_close_convert

function plugin_close_convert()
{
    global $vars, $script;
    $qm = get_qm();
    $qt = get_qt();
    $page = isset($vars['page']) ? $vars['page'] : '';
    //キャッシュ無効
    $qt->enable_cache = false;
    $title = $qm->m['plg_close']['title'];
    $msg = $qm->m['plg_close']['ntc'];
    //parse arguments
    $args = func_get_args();
    $num = count($args);
    if ($num == 0) {
        //do nothing
    } else {
        if ($num == 1) {
            $title = array_pop($args);
        } else {
            list($title, $msg) = $args;
        }
    }
    $editable = edit_auth($page, FALSE, FALSE);
    if ($editable) {
        return $qm->m['plg_close']['ntc_admin'];
    } else {
        force_output_message($title, '', $msg);
    }
}
开发者ID:big2men,项目名称:qhm,代码行数:29,代码来源:close.inc.php

示例2: plugin_fb_recommends_convert

function plugin_fb_recommends_convert()
{
    if ($alt = plugin_fb_root_is_deprecated('recommends')) {
        $args = func_get_args();
        return call_user_func_array($alt, $args);
    }
    global $script, $vars;
    $page = $vars['page'];
    $r_page = rawurlencode($page);
    $qm = get_qm();
    $qt = get_qt();
    $args = func_get_args();
    // scaffold
    $def_attrs = array('site' => '', 'width' => FALSE, 'height' => FALSE, 'header' => 'true', 'colorscheme' => 'light', 'ref' => FALSE, 'action' => 'og.likes', 'app-id' => FALSE, 'linktarget' => FALSE, 'max-age' => FALSE);
    $attrs = plugin_fb_root_parse_args($args, $def_attrs);
    //default site set
    if ($attrs['site'] == '') {
        $parsed = parse_url($script);
        $host = $parsed['host'];
        $attrs['site'] = $host;
    }
    plugin_fb_root_set_jsapi(TRUE);
    $body = plugin_fb_root_create_tag('fb-recommendations', $attrs);
    if (edit_auth($page, FALSE, FALSE)) {
        $fb_pagebox_help = h(QHM_HOME . '?PageName');
        $warning = <<<EOM
\t\t\t<div class="alert alert-warning">
\t\t\t\tFacebook Recommends は Graph API v2.3 より廃止されました。<br>
\t\t\t\t<strong>2015 年 6 月 23 日</strong>に完全に使えなくなります。
\t\t\t</div>
EOM;
        $body = $warning . $body;
    }
    return $body;
}
开发者ID:big2men,项目名称:qhm,代码行数:35,代码来源:fb_recommends.inc.php

示例3: plugin_diff_action

function plugin_diff_action()
{
    global $vars, $script;
    global $layout_pages, $style_name;
    $editable = edit_auth($page, FALSE, FALSE);
    if (!$editable) {
        header("Location: {$script}");
        exit;
    }
    $page = isset($vars['page']) ? $vars['page'] : '';
    check_readable($page, true, true);
    //レイアウト部品の場合、スタイルを変更する
    $is_layout = FALSE;
    if (isset($layout_pages) && isset($layout_pages[$page])) {
        $style_name = '..';
        $is_layout = TRUE;
    }
    $action = isset($vars['action']) ? $vars['action'] : '';
    switch ($action) {
        case 'delete':
            $retval = plugin_diff_delete($page);
            break;
        default:
            $retval = plugin_diff_view($page);
            break;
    }
    return $retval;
}
开发者ID:big2men,项目名称:qhm,代码行数:28,代码来源:diff.inc.php

示例4: plugin_ga_link_inline

function plugin_ga_link_inline()
{
    global $accesstag_moved;
    global $accesstag;
    global $vars;
    $qm = get_qm();
    $qt = get_qt();
    $page = isset($vars['page']) ? $vars['page'] : '';
    //parameter check
    $args = func_get_args();
    $num = func_num_args();
    if ($num != 2) {
        return $qm->replace('fmt_err_iln', 'ga_link', $qm->m['plg_ga_link']['err_usage']);
    }
    $text = strip_autolink(array_pop($args));
    //テキストデータ
    $url = array_pop($args);
    if (!is_url($url)) {
        $url = 'index.php?' . rawurlencode($url);
    }
    $acc_tag = '';
    //初めて呼び出される場合、accesstag情報を表示する
    if (!$accesstag_moved) {
        $accesstag_moved = TRUE;
        //accesstag_movedを設定
        $editable = edit_auth($page, FALSE, FALSE);
        if (!$editable) {
            $qt->setv('toolkit_upper', $accesstag);
        }
    }
    //Google Analytics用のjavascriptを先に読み込んでから、関数を呼び出す
    $ret = '<a href="index.php?cmd=ga_link&url=' . rawurlencode($url) . '" onClick="javascript:pageTracker._link(this.href);return false;">' . $text . '</a>';
    return $ret;
}
开发者ID:big2men,项目名称:qhm,代码行数:34,代码来源:ga_link.inc.php

示例5: plugin_canonical_show_info

function plugin_canonical_show_info()
{
    global $vars, $style_name;
    $qt = get_qt();
    $page = $vars['page'];
    if (edit_auth($page, FALSE, FALSE)) {
        if (strpos($style_name, 'haik_') !== 0) {
            return '
<div style="border:solid 1px #00e;background-color:#eef;max-width:80%;width:80%;text-align:left;padding:0 1.5em;margin:1em auto;">
  <p>
    <strong>このページは canonical URL が指定されています。</strong><br>
    <a href="' . h($qt->getv('canonical_url')) . '" target="_blank">確認</a>
  </p>
</div>';
        } else {
            return '
<div class="alert alert-info">
  <button type="button" class="close" data-dismiss="alert">
    <span aria-hidden="true">&times;</span>
    <span class="sr-only">Close</span>
  </button>

  <strong>このページは canonical URL が指定されています。</strong><br>
  <a href="' . h($qt->getv('canonical_url')) . '" target="_blank" class="btn btn-info">確認</a>
</div>';
        }
    }
}
开发者ID:big2men,项目名称:qhm,代码行数:28,代码来源:canonical.inc.php

示例6: plugin_conversion_r_inline

function plugin_conversion_r_inline()
{
    global $vars, $script;
    $qm = get_qm();
    $page = isset($vars['page']) ? $vars['page'] : '';
    $args = func_get_args();
    if (count($args) != 6) {
        return $qm->replace('fmt_err_iln', 'conversion_r', $qm->m['plg_conversion_r']['err_usage']);
    }
    $text = array_pop($args);
    list($step, $group, $name, $url, $site_url) = $args;
    if (!is_url($url)) {
        return $qm->replace('fmt_err_iln', 'conversion_r', $qm->m['plg_conversion_r']['err_url']);
    }
    $raw_url = $url;
    $step = rawurlencode($step);
    $group = rawurlencode($group);
    $name = rawurlencode($name);
    $url = rawurlencode($url);
    $site_url .= preg_match('/\\/$/', $site_url) ? '' : '/';
    $dest = $site_url . '?cmd=conversion&mode=link&step=' . $step . '&group=' . $group . '&name=' . $name . '&url=' . $url;
    //edit auth check
    $editable = edit_auth($page, FALSE, FALSE);
    if ($editable) {
        return '<a href="' . $dest . '">' . $text . '</a><span style="font-size:11px;background-color:#fdd">←' . $qm->m['plg_conversion_r']['ntc_admin'] . '</span>';
    } else {
        return '<a href="' . $dest . '">' . $text . '</a>';
    }
}
开发者ID:big2men,项目名称:qhm,代码行数:29,代码来源:conversion_r.inc.php

示例7: plugin_ganatracker_convert

function plugin_ganatracker_convert()
{
    global $accesstag;
    global $vars;
    $qm = get_qm();
    $page = isset($vars['page']) ? $vars['page'] : '';
    $args = func_get_args();
    $num = func_num_args();
    if ($num != 1) {
        return $qm->replace('fmt_err_cvt', 'ganatracker', $qm->m['plg_ganatracker']['err_usage_cvt']);
    }
    $name = $args[0];
    //versionをチェックして、置換
    $version = $qm->m['plg_ganatracker']['old'];
    if (strstr($accesstag, "gaJsHost") == false) {
        //Old version
        $repstr = 'urchinTracker(\'' . $name . '\')';
        $accesstag = str_replace('urchinTracker()', $repstr, $accesstag);
    } else {
        $version = $qm->m['plg_ganatracker']['old'];
        $repstr = 'pageTracker._trackPageview(\'' . $name . '\')';
        $accesstag = str_replace('pageTracker._trackPageview()', $repstr, $accesstag);
    }
    $editable = edit_auth($page, FALSE, FALSE);
    if ($editable) {
        return '<div style="margin:1em;border:dashed 2px #f00;background-color:#fee">' . $qm->replace('plg_ganatracker.ntc_admin_cvt', $version, $name) . '</div>';
    } else {
        return '';
    }
}
开发者ID:big2men,项目名称:qhm,代码行数:30,代码来源:ganatracker.inc.php

示例8: plugin_secret_convert

/**
 *   QHM Secret Plugin ver 0.9
 *   -------------------------------------------
 *   plugin/secret.inc.php
 *   
 *   Copyright (c) 2010 hokuken
 *   http://hokuken.com/
 *   
 *   created  : 2007-09-11
 *   modified :
 *   
 *   簡易パスワード認証ページを作るプラグイン
 *   
 *   Usage :
 *     &secret(パスワード(英数のみ));
 *   
 */
function plugin_secret_convert()
{
    global $vars, $script;
    $qm = get_qm();
    $qt = get_qt();
    //---- キャッシュのための処理を登録 -----
    if ($qt->create_cache) {
        $args = func_get_args();
        return $qt->get_dynamic_plugin_mark(__FUNCTION__, $args);
    }
    //------------------------------------
    $page = isset($vars['page']) ? $vars['page'] : '';
    $en_page = rawurlencode($page);
    $secretplugin = isset($vars['secretplugin']) ? $vars['secretplugin'] : '';
    $password = isset($vars['password']) ? $vars['password'] : '';
    $auth_url = $script . "?plugin=secret&page=" . urlencode($page);
    $args = func_get_args();
    $masterpasswd = array_pop($args);
    if ($masterpasswd == "") {
        return $qm->replace('fmt_err_cvt', 'secret', 'パスワードを設定して下さい。');
    }
    $editable = edit_auth($page, FALSE, FALSE);
    if ($editable) {
        return "<div style=\"border:dashed 1px #f00;background-color:#fee;padding:1em;\"><p><strong>{$qm->m['plg_secret']['ntc_admin']}</strong></p></div>";
    } else {
        //session check
        if (isset($_SESSION['secretplugin_' . $en_page]) && $_SESSION['secretplugin_' . $en_page] == $en_page) {
            return '';
        }
        if ($secretplugin == "secretplugin") {
            //passwd check
            if ($password == $masterpasswd) {
                $_SESSION['secretplugin_' . $en_page] = $en_page;
                return "";
            } else {
                header("Location: {$auth_url}&errmsg=true");
                exit;
            }
        }
        //携帯アクセスのことを考えての処理(cookieをちぇっくして、処理を行う)
        if (isset($vars['chkck'])) {
            $cookie = $_COOKIE['QHMDUMMY'];
            setcookie('QHMDUMMY', '', time() - 3600);
            //del cookie
            if ($cookie) {
                header("Location: {$auth_url}");
                exit;
            } else {
                header("Location: {$auth_url}&mobssid=yes");
                exit;
            }
        } else {
            //はじめてのアクセス
            setcookie('QHMDUMMY', TRUE);
            header('Location: ' . $script . '?cmd=read&page=' . $en_page . '&chkck');
            exit;
        }
    }
}
开发者ID:big2men,项目名称:qhm,代码行数:76,代码来源:secret.inc.php

示例9: plugin_fb_likegate_convert

function plugin_fb_likegate_convert()
{
    global $vars, $script, $nowindow;
    $qm = get_qm();
    $qt = get_qt();
    $editable = edit_auth($page, FALSE, FALSE);
    //本文部分以外のページに設置した場合、無効にする
    if (isset($vars['page_alt']) && is_page($vars['page_alt'])) {
        if ($editable) {
            return 'error: #fb_likegate: 本文に設置してください。';
        } else {
            return '';
        }
    }
    $page = isset($vars['page']) ? $vars['page'] : '';
    //キャッシュ無効
    $qt->enable_cache = false;
    $args = func_get_args();
    if (count($args) === 0) {
        return $qm->replace('fmt_err_cvt', 'fb_likegate', $qm->m['plg_fb_likegate']['err_usage']);
    }
    list($unlike_page) = $args;
    $fb_apps_url = plugin_fb_root_get_apps_url();
    //Facebook からのアクセス
    if ($signed_request = plugin_fb_root_parse_request()) {
        $nowindow = 1;
        $edit_url = $script . '?cmd=edit&page=' . rawurlencode($page);
        plugin_fb_root_set_page();
        $liked = (isset($signed_request->page->liked) and !is_null($signed_request->page->liked)) ? $signed_request->page->liked : $signed_request->page['liked'];
        if ($liked) {
            $src = get_source($page);
            foreach ($src as $i => $line) {
                if (strpos($line, '#fb_likegate') === 0) {
                    unset($src[$i]);
                    break;
                }
            }
            $body = convert_html($src);
        } else {
            $src = get_source($unlike_page);
            foreach ($src as $i => $line) {
                if (strpos($line, '#fb_page') === 0) {
                    unset($src[$i]);
                }
            }
            $body = convert_html($src);
        }
        if ($editable) {
            $add_body = convert_html($qm->replace('plg_fb_likegate.ntc_admin_fb', $edit_url, $unlike_page, $fb_apps_url));
        }
        force_output_message('', '', $add_body . $body);
    } else {
        if ($editable) {
            return convert_html($qm->replace('plg_fb_likegate.ntc_admin', $unlike_page, $fb_apps_url));
        }
        force_output_message($qm->m['plg_fb_likegate']['ntc_title'], '', $qm->m['plg_fb_likegate']['ntc_msg']);
    }
}
开发者ID:big2men,项目名称:qhm,代码行数:58,代码来源:fb_likegate.inc.php

示例10: plugin_utf8_convert

function plugin_utf8_convert()
{
    global $utf8, $vars;
    //edit auth check
    $editable = edit_auth($vars['page'], FALSE, FALSE);
    if ($editable) {
        return "<p><strong>【お知らせ】</strong><br />このページは、ユーザーモードの際、UTF8化されています<br />\nQHM v4からは、UTF-8が標準になったので、このプラグインは不要です</p>";
    } else {
        $utf8 = false;
        return "";
    }
}
开发者ID:big2men,项目名称:qhm,代码行数:12,代码来源:utf8.inc.php

示例11: plugin_shiftjis_convert

function plugin_shiftjis_convert()
{
    global $shiftjis, $vars;
    $qm = get_qm();
    //edit auth check
    $editable = edit_auth($vars['page'], FALSE, FALSE);
    if ($editable) {
        return $qm->m['plg_shiftjis']['ntc_admin'];
    } else {
        $shiftjis = TRUE;
        return "";
    }
}
开发者ID:big2men,项目名称:qhm,代码行数:13,代码来源:shiftjis.inc.php

示例12: plugin_read_action

function plugin_read_action()
{
    global $vars, $script;
    global $post;
    $qm = get_qm();
    $qt = get_qt();
    $page = isset($vars['page']) ? $vars['page'] : '';
    //キャッシュを無効化
    if (isset($vars['word'])) {
        $qt->enable_cache = false;
    }
    if (is_page($page)) {
        // ページを表示
        check_readable($page, true, true);
        header_lastmod($page);
        return array('msg' => '', 'body' => '');
    } else {
        if (!PKWK_SAFE_MODE && is_interwiki($page)) {
            return do_plugin_action('interwiki');
            // InterWikiNameを処理
        } else {
            if (is_pagename($page)) {
                $vars['cmd'] = 'edit';
                // 編集権限があれば、編集モードへ。なければ、メッセージを表示
                $editable = edit_auth($page, FALSE, FALSE);
                if ($editable) {
                    return do_plugin_action('edit');
                    // 存在しないので、編集フォームを表示
                } else {
                    //404 NOT FOUND
                    header('HTTP/1.1 404 Not Found');
                    return array('msg' => $qm->m['fmt_err_notfoundpage_title'], 'body' => $qm->replace('fmt_err_notfoundpage', $script));
                }
            } else {
                //EUCエンコーディングかチェック
                if (mb_detect_encoding($post['page'], 'UTF-8,EUC-JP') == 'EUC-JP') {
                    $u_page = mb_convert_encoding($post['page'], 'UTF-8', 'EUC-JP');
                    $enc_page = rawurlencode($u_page);
                    //redirect
                    header("HTTP/1.1 301 Moved Permanently");
                    header('Location: ' . $script . '?' . $enc_page);
                    exit;
                }
                // 無効なページ名
                return array('msg' => $qm->m['fmt_title_invalidiwn'], 'body' => $qm->replace('fmt_err_invalidiwn', h($page), 'WikiName'));
            }
        }
    }
}
开发者ID:big2men,项目名称:qhm,代码行数:49,代码来源:read.inc.php

示例13: plugin_edit_this_inline

function plugin_edit_this_inline()
{
    global $vars, $script;
    $qm = get_qm();
    $page = $vars['page'];
    if (!edit_auth($page, FALSE, FALSE)) {
        return '';
    }
    $args = func_get_args();
    if ($args[0] != '') {
        $page = trim($args[0]);
    }
    return <<<EOD
<a href="{$script}?cmd=edit&page={$page}">[{$qm->m['plg_edit_this']['label']}]</a>
EOD;
}
开发者ID:big2men,项目名称:qhm,代码行数:16,代码来源:edit_this.inc.php

示例14: plugin_commu_auth_convert

function plugin_commu_auth_convert()
{
    global $script, $vars;
    //キャッシュを無効に
    if (QHM_VERSION < 4.6) {
        global $enable_cache;
        $enable_cache = false;
    } else {
        $qt = get_qt();
        $qt->enable_cache = false;
    }
    $editable = edit_auth($page, FALSE, FALSE);
    if ($editable) {
        return '<p style="padding:1em;background-color:#fdd;border:1px dashed #f00;"><strong>【お知らせ】管理者モード以外のアクセスは、commu_authプラグインによって' . 'ログインページへ転送されます</strong></p>';
    } else {
        if (!isset($_SESSION['commu_user'])) {
            // ログイン画面にとばす
            commu_redirect($script . '?' . rawurlencode($vars['page']));
        }
        if (func_num_args()) {
            $flg_show = false;
            $args = func_get_args();
            foreach ($args as $line) {
                if (strpos($line, '=') !== FALSE) {
                    list($field, $value) = explode('=', trim($line));
                    $field = trim($field);
                    $value = trim($value);
                }
                if (isset($_SESSION['commu_user'][$field])) {
                    $cmpval = $_SESSION['commu_user'][$field];
                    $cmpval = mb_convert_encoding($cmpval, "UTF-8", "UTF-8,EUC-JP");
                    if ($cmpval == $value) {
                        $flg_show = true;
                    }
                }
            }
            if ($flg_show == false) {
                $url = $script . '?FrontPage';
                if (isset($vars['QHMSSID'])) {
                    $url .= '&QHMSSID=' . $vars['QHMSSID'];
                }
                header("Location: {$url}");
                exit;
            }
        }
    }
}
开发者ID:big2men,项目名称:qhm,代码行数:47,代码来源:commu_auth.inc.php

示例15: plugin_commu_auth_return_inline

function plugin_commu_auth_return_inline()
{
    global $script;
    //キャッシュを無効に
    if (QHM_VERSION < 4.6) {
        global $enable_cache;
        $enable_cache = false;
    } else {
        $qt = get_qt();
        $qt->enable_cache = false;
    }
    $editable = edit_auth($page, FALSE, FALSE);
    if (!isset($_SESSION['commu_user'])) {
        // 何も表示しない
        return '';
        // ログイン画面にとばす
        //		commu_redirect($script.'?'.rawurlencode($vars['page']));
    }
    if (func_num_args()) {
        $flg_show = false;
        $args = func_get_args();
        $text = array_pop($args);
        // フィールドの指定がない場合は、認証成功として表示する
        if (count($args) == 0) {
            return $text;
        }
        foreach ($args as $line) {
            if (strpos($line, '=') !== FALSE) {
                list($field, $value) = explode('=', trim($line));
                $field = trim($field);
                $value = trim($value);
            }
            if (isset($_SESSION['commu_user'][$field])) {
                $cmpval = $_SESSION['commu_user'][$field];
                $cmpval = mb_convert_encoding($cmpval, "UTF-8", "UTF-8,EUC-JP");
                if ($cmpval == $value) {
                    //						return convert_html($text);
                    return $text;
                }
            }
        }
        if ($flg_show == false) {
            return '';
        }
    }
}
开发者ID:big2men,项目名称:qhm,代码行数:46,代码来源:commu_auth_return.inc.php


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