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


PHP getperms函数代码示例

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


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

示例1: __construct

 function __construct()
 {
     $pref = e107::pref('core');
     if (getperms('0')) {
         $this->testMode = true;
     }
     if (substr(e_QUERY, 0, 9) == 'activate.') {
         $this->processActivationLink();
     }
     if (e_QUERY == 'resend' && (!USER || $this->testMode) && $pref['user_reg_veri'] == 1) {
         if (empty($_POST['submit_resend'])) {
             $this->renderResendForm();
         } else {
             $this->resendEmail();
         }
     }
     if ($this->testMode == true) {
         if (e_QUERY == 'preview') {
             $this->renderEmailPreview();
         }
         if (e_QUERY == "preview.aftersignup") {
             $this->renderAfterSignupPreview();
         }
         if (e_QUERY == 'test') {
             $this->sendEmailPreview();
         }
     }
 }
开发者ID:gitye,项目名称:e107,代码行数:28,代码来源:signup.php

示例2: __construct

    /**
     *
     */
    function __construct()
    {
        $html = '';
        if (!empty($_GET['debug']) && getperms('0')) {
            $debug = true;
            // For future use.
            $text = <<<TEMPL

\t[html][code]Something goes here [b]bold print[/b][/code][/html]

TEMPL;
            $_POST['content'] = $text;
            $_POST['mode'] = 'tohtml';
        } else {
            $debug = false;
        }
        if ($_POST['mode'] == 'tohtml') {
            $html = $this->toHtml($_POST['content']);
        }
        if ($_POST['mode'] == 'tobbcode') {
            $html = $this->toBBcode($_POST['content']);
        }
        if ($debug == true) {
            print_a($html);
            echo "<hr />";
            echo $html;
        } elseif ($this->gzipCompression == true) {
            header('Content-Encoding: gzip');
            $gzipoutput = gzencode($html, 6);
            header('Content-Length: ' . strlen($gzipoutput));
            echo $gzipoutput;
        } else {
            echo $html;
        }
    }
开发者ID:armpit,项目名称:e107,代码行数:38,代码来源:parser.php

示例3: check_allowed

function check_allowed($class_id)
{
    global $sql;
    if (!$sql->db_Select('userclass_classes', '*', "userclass_id = {$class_id}")) {
        header("location:" . SITEURL);
        exit;
    }
    $row = $sql->db_Fetch();
    if (!getperms('0') && !check_class($row['userclass_editclass'])) {
        header("location:" . SITEURL);
        exit;
    }
}
开发者ID:CAJT-UKCoder,项目名称:e107-Plugins,代码行数:13,代码来源:userclass2.php

示例4: sc_loginname

 function sc_loginname($parm)
 {
     $pref = e107::getPref();
     if ($pref['allowEmailLogin'] == 1) {
         return;
         // hide login name when email-login is being used. (may contain social login info)
     }
     if (ADMIN && getperms("4")) {
         $log_name_length = varset($pref['loginname_maxlength'], 30);
         $options = array('title' => $pref['allowEmailLogin'] == 1 ? LAN_USER_82 : LAN_USER_80, 'size' => 40);
         return e107::getForm()->text('loginname', $this->var['user_loginname'], $log_name_length, $options);
     } else {
         return $this->var['user_loginname'];
     }
 }
开发者ID:notzen,项目名称:e107,代码行数:15,代码来源:usersettings_shortcodes.php

示例5: actionTest

 public function actionTest()
 {
     echo '<h3>Social Login Tester</h3>';
     if (getperms('0')) {
         echo e107::getMessage()->addError("Please logout of e107 before testing the new-user login/signup procedure.")->render();
         return;
     }
     if (isset($_GET['lgt'])) {
         e107::getUser()->logout();
     }
     $profileData = null;
     $provider = e107::getUser()->getProvider();
     if ($provider) {
         $profileData = $provider->getUserProfile();
         if (!empty($profileData)) {
             print_a($profileData);
         }
     }
     echo 'Logged in: ' . (e107::getUser()->isUser() && !empty($profileData) ? '<span class="label label-success">true</span>' : '<span class="label label-danger">false</span>');
     $testUrl = SITEURL . "?route=system/xup/test";
     $providers = e107::getPref('social_login', array());
     foreach ($providers as $key => $var) {
         if ($var['enabled'] == 1) {
             echo '<h3>' . $key . '</h3><ul>';
             echo '<li><a class="btn btn-default" href="' . e107::getUrl()->create('system/xup/login?provider=' . $key . '&back=' . base64_encode($testUrl)) . '">Test login only with ' . $key . '</a></li>';
             echo '<li><a class="btn btn-default" href="' . e107::getUrl()->create('system/xup/signup?provider=' . $key . '&back=' . base64_encode($testUrl)) . '">Test signup/login with ' . $key . '</a></li>';
             echo "</ul>";
         }
         //	print_a($var);
     }
     echo '<br /><br /><a class="btn btn-default" href="' . e107::getUrl()->create('system/xup/test?lgt') . '">Test logout</a>';
     /*
     		echo '<h3>Facebook</h3>';
     		echo '<br /><a href="'.e107::getUrl()->create('system/xup/login?provider=Facebook').'">Test login with Facebook</a>';
     		echo '<br /><a href="'.e107::getUrl()->create('system/xup/signup?provider=Facebook').'">Test signup with Facebook</a>';
     		
     		echo '<h3>Twitter</h3>';
     		echo '<br /><a href="'.e107::getUrl()->create('system/xup/login?provider=Twitter').'">Test login with Twitter</a>';
     		echo '<br /><a href="'.e107::getUrl()->create('system/xup/signup?provider=Twitter').'">Test signup with Twitter</a>';
     */
 }
开发者ID:armpit,项目名称:e107,代码行数:41,代码来源:xup.php

示例6: check_allowed

/**
 * @todo user_class::isEditableClass() thinks public (0) is editable?!
 * @param integer $class_id
 * @param boolean $redirect
 * @return boolean
 */
function check_allowed($class_id, $redirect = true)
{
    $uc = e107::getUserClass();
    if (!isset($uc->class_tree[$class_id]) || !getperms('0') && !check_class($uc->class_tree[$class_id]['userclass_editclass'])) {
        if (!$redirect) {
            return false;
        }
        header('location:' . SITEURL);
        exit;
    }
    // fix public (0) case here for now
    if (!$class_id || !$uc->isEditableClass($class_id)) {
        if (!$redirect) {
            return false;
        }
        e107::getMessage()->addSession('You can\'t edit system user classes!', E_MESSAGE_ERROR);
        header('location:' . e_SELF);
        exit;
    }
    return true;
}
开发者ID:notzen,项目名称:e107,代码行数:27,代码来源:userclass2.php

示例7:

/*
 * e107 website system
 *
 * Copyright (C) 2008-2009 e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
 *
 *
 * $Source: /cvs_backup/e107_0.8/e107_admin/phpinfo.php,v $
 * $Revision$
 * $Date$
 * $Author$
 */
require_once "../class2.php";
if (!getperms("0")) {
    e107::redirect('admin');
    exit;
}
$e_sub_cat = 'phpinfo';
require_once "auth.php";
ob_start();
phpinfo();
$phpinfo .= ob_get_contents();
$phpinfo = preg_replace("#^.*<body>#is", "", $phpinfo);
$phpinfo = str_replace("font", "span", $phpinfo);
$phpinfo = str_replace("</body></html>", "", $phpinfo);
$phpinfo = str_replace('border="0"', '', $phpinfo);
//$phpinfo = str_replace('<table ','<table class="table table-striped adminlist" ',$phpinfo);
$phpinfo = str_replace('name=', 'id=', $phpinfo);
$phpinfo = str_replace('class="e"', 'class="forumheader2 text-left"', $phpinfo);
开发者ID:gitter-badger,项目名称:e107,代码行数:31,代码来源:phpinfo.php

示例8: header

<?php

/*
 * e107 website system
 *
 * Copyright (C) 2008-2013 e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
*/
require_once '../../class2.php';
if (!getperms('1')) {
    header('location:' . e_BASE . 'index.php');
    exit;
}
require_once e_HANDLER . 'userclass_class.php';
include_lan(e_PLUGIN . 'newforumposts_main/languages/' . e_LANGUAGE . '.php');
require_once e_ADMIN . 'auth.php';
$frm = e107::getForm();
$mes = e107::getMessage();
if (isset($_POST['updatesettings'])) {
    $pref['nfp_display'] = intval($_POST['nfp_display']);
    $pref['nfp_caption'] = $tp->toDB($_POST['nfp_caption']);
    $pref['nfp_amount'] = intval($_POST['nfp_amount']);
    $pref['nfp_layer'] = intval(vartrue($_POST['nfp_layer']));
    $pref['nfp_posts'] = intval(vartrue($_POST['nfp_posts']));
    $pref['nfp_layer_height'] = intval($_POST['nfp_layer_height'] ? $_POST['nfp_layer_height'] : 200);
    save_prefs();
}
$ns->tablerender($caption, $mes->render() . $text);
$text = "\n\t<form method='post' action='" . e_SELF . "?" . e_QUERY . "' id='menu_conf_form'>\n\t<table class='table adminform'>\t \n\t<colgroup span='2'>\n\t\t<col class='col-label' />\n\t\t<col class='col-control' />\n\t</colgroup>\n\t<tr>\n\t\t<td>" . NFPM_L4 . "</td>\n\t\t<td>" . $frm->select('nfp_display', array(0 => NFPM_L5, 1 => NFPM_L6, 2 => NFPM_L7), $pref['nfp_display']) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td>" . NFPM_L8 . ":</td>\n\t\t<td>" . $frm->text('nfp_caption', $pref['nfp_caption'], '100', array('class' => 'tbox input-text span3')) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td>" . NFPM_L9 . ": </td>\n\t\t<td>" . $frm->text('nfp_amount', $pref['nfp_amount'], '3') . "</td>\n\t</tr>\t \n\t<tr>\n\t\t<td>" . NFPM_L14 . "</td>\n\t\t<td>" . $frm->radio_switch('nfp_posts', $pref['nfp_posts'], LAN_YES, LAN_NO) . "<span class='field-help'>" . NFPM_L15 . "</span></td>\n\t</tr>\t \n\t<tr>\n\t\t<td>" . NFPM_L10 . "</td>\n\t\t<td>" . $frm->radio_switch('nfp_layer', $pref['nfp_layer'], LAN_YES, LAN_NO) . "<br />\n\t\t" . NFPM_L11 . ": " . $frm->text('nfp_layer_height', $pref['nfp_layer_height'], '3') . "</td>\n\t</tr>\n\t</table>\n\t<div class='buttons-bar center'>\n\t\t" . $frm->admin_button('updatesettings', LAN_UPDATE, 'update') . "\n\t</div>\n\t</form>";
开发者ID:armpit,项目名称:e107,代码行数:31,代码来源:admin_config.php

示例9: createemPage

 function createemPage()
 {
     if (!getperms("J")) {
         return;
     }
     $this->createPage('menu');
 }
开发者ID:notzen,项目名称:e107,代码行数:7,代码来源:cpage.php

示例10: array

 * Copyright (C) 2008-2015 e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
 * Administration Area - User classes
 *
*/
/**
 *	e107 Userclass handling - Admin
 *
 *	@package	e107
 *	@subpackage	admin
 *	@version 	$Id$;
 */
require_once '../class2.php';
if (!getperms('4')) {
    e107::redirect('admin');
    exit;
}
include_lan(e_LANGUAGEDIR . e_LANGUAGE . '/admin/lan_' . e_PAGE);
class uclass_admin extends e_admin_dispatcher
{
    protected $modes = array('main' => array('controller' => 'uclass_ui', 'path' => null, 'ui' => 'uclass_ui_form', 'uipath' => null));
    protected $adminMenu = array('main/list' => array('caption' => LAN_MANAGE, 'perm' => '4'), 'main/create' => array('caption' => LAN_CREATE, 'perm' => '4'), 'main/initial' => array('caption' => UCSLAN_38, 'perm' => '4'), 'main/options' => array('caption' => LAN_OPTIONS, 'perm' => '4'));
    protected $adminMenuAliases = array('main/edit' => 'main/list');
    protected $menuTitle = ADLAN_38;
}
class uclass_ui extends e_admin_ui
{
    protected $pluginTitle = ADLAN_38;
    protected $pluginName = 'core';
开发者ID:gitter-badger,项目名称:e107,代码行数:31,代码来源:userclass2.php

示例11: render_infopanel_menu_options

 function render_infopanel_menu_options()
 {
     if (!getperms('0')) {
         return;
     }
     $frm = e107::getForm();
     $pref = e107::getPref();
     $text = "<div style='padding-left:20px'>";
     $menu_qry = 'SELECT * FROM #menus WHERE menu_id!= 0  GROUP BY menu_name ORDER BY menu_name';
     $settings = varset($pref['core-infopanel-menus'], array());
     if (e107::getDb()->db_Select_gen($menu_qry)) {
         while ($row = e107::getDb()->db_Fetch()) {
             $label = str_replace("_menu", "", $row['menu_name']);
             $path_to_menu = $row['menu_path'] . $row['menu_name'];
             $checked = $settings && in_array($path_to_menu, $settings) ? true : false;
             $text .= "\n<div class='left f-left list field-spacer' style='display:block;height:24px;width:200px;'>";
             $text .= $frm->checkbox_label($label, "e-mymenus[]", $path_to_menu, $checked);
             $text .= "</div>";
         }
     }
     $text .= "</div><div class='clear'>&nbsp;</div>";
     return $text;
 }
开发者ID:gitye,项目名称:e107,代码行数:23,代码来源:infopanel.php

示例12: admin_info

function admin_info()
{
    global $tp;
    $width = getperms('0') ? "33%" : "50%";
    $ADMIN_INFO_TEMPLATE = "\n\t<div style='text-align:center'>\n\t\t<table style='width: 100%; border-collapse:collapse; border-spacing:0px;'>\n\t\t<tr>\n\t\t\t<td style='width: " . $width . "; vertical-align: top'>\n\t\t\t{ADMIN_STATUS}\n\t\t\t</td>\n\t\t\t<td style='width:" . $width . "; vertical-align: top'>\n\t\t\t{ADMIN_LATEST}\n\t\t\t</td>";
    if (getperms('0')) {
        $ADMIN_INFO_TEMPLATE .= "\n\t\t\t<td style='width:" . $width . "; vertical-align: top'>{ADMIN_LOG}</td>";
    }
    $ADMIN_INFO_TEMPLATE .= "\n\t\t</tr></table></div>";
    return $tp->parseTemplate($ADMIN_INFO_TEMPLATE);
}
开发者ID:gitye,项目名称:e107,代码行数:11,代码来源:admin.php

示例13: saveMailPrefs

 function saveMailPrefs(&$mes)
 {
     if (!getperms('0')) {
         return;
     }
     //$pref = e107::getPref();
     $e107 = e107::getInstance();
     $tp = e107::getParser();
     $mes = e107::getMessage();
     $bounceOpts = array('none' => LAN_MAILOUT_232, 'auto' => LAN_MAILOUT_233, 'mail' => LAN_MAILOUT_234);
     unset($temp);
     if (!in_array($_POST['mailer'], array('smtp', 'sendmail', 'php'))) {
         $_POST['mailer'] = 'php';
     }
     $temp['mailer'] = $_POST['mailer'];
     // Allow qmail as an option as well - works much as sendmail
     if (strpos($_POST['sendmail'], 'sendmail') !== FALSE || strpos($_POST['sendmail'], 'qmail') !== FALSE) {
         $temp['sendmail'] = $tp->toDB($_POST['sendmail']);
     } else {
         $temp['sendmail'] = '';
     }
     $temp['smtp_server'] = $tp->toDB($_POST['smtp_server']);
     $temp['smtp_username'] = $tp->toDB($_POST['smtp_username']);
     $temp['smtp_password'] = $tp->toDB($_POST['smtp_password']);
     $smtp_opts = array();
     switch (trim($_POST['smtp_options'])) {
         case 'smtp_ssl':
             $smtp_opts[] = 'secure=SSL';
             break;
         case 'smtp_tls':
             $smtp_opts[] = 'secure=TLS';
             break;
         case 'smtp_pop3auth':
             $smtp_opts[] = 'pop3auth';
             break;
     }
     if (vartrue($_POST['smtp_keepalive'])) {
         $smtp_opts[] = 'keepalive';
     }
     if (vartrue($_POST['smtp_useVERP'])) {
         $smtp_opts[] = 'useVERP';
     }
     $temp['smtp_options'] = implode(',', $smtp_opts);
     $temp['mail_sendstyle'] = $tp->toDB($_POST['mail_sendstyle']);
     $temp['mail_pause'] = intval($_POST['mail_pause']);
     $temp['mail_pausetime'] = intval($_POST['mail_pausetime']);
     $temp['mail_workpertick'] = intval($_POST['mail_workpertick']);
     $temp['mail_workpertick'] = min($temp['mail_workpertick'], 1000);
     $temp['mail_bounce'] = isset($bounceOpts[$_POST['mail_bounce']]) ? $_POST['mail_bounce'] : 'none';
     $temp['mail_bounce_auto'] = 0;
     // Make sure this is always defined
     switch ($temp['mail_bounce']) {
         case 'none':
             $temp['mail_bounce_email'] = '';
             break;
         case 'auto':
             $temp['mail_bounce_email'] = $tp->toDB($_POST['mail_bounce_email2']);
             break;
         case 'mail':
             $temp['mail_bounce_email'] = $tp->toDB($_POST['mail_bounce_email']);
             $temp['mail_bounce_auto'] = intval($_POST['mail_bounce_auto']);
             break;
     }
     $temp['mail_bounce_pop3'] = $tp->toDB($_POST['mail_bounce_pop3']);
     $temp['mail_bounce_user'] = $tp->toDB($_POST['mail_bounce_user']);
     $temp['mail_bounce_pass'] = $tp->toDB($_POST['mail_bounce_pass']);
     $temp['mail_bounce_type'] = $tp->toDB($_POST['mail_bounce_type']);
     $temp['mail_bounce_delete'] = intval(varset($_POST['mail_bounce_delete'], 0));
     $temp['mailout_enabled'] = implode(',', varset($_POST['mail_mailer_enabled'], ''));
     $temp['mail_log_options'] = intval($_POST['mail_log_option']) . ',' . intval($_POST['mail_log_email']);
     foreach ($temp as &$t) {
         if ($t === NULL) {
             $t = '';
         }
     }
     $pref = e107::pref('core');
     // Core Prefs Array.
     if (e107::getAdminLog()->logArrayDiffs($temp, $pref, 'MAIL_03')) {
         e107::getConfig()->updatePref($temp);
         e107::getConfig()->save(false);
         // Only save if changes - generates its own message
     } else {
         $mes->addInfo(LAN_NO_CHANGE);
     }
 }
开发者ID:armpit,项目名称:e107,代码行数:85,代码来源:mailout.php

示例14: header

 * e107 website system
 *
 * Copyright (C) 2008-2009 e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
 *
 *
 * $Source: /cvs_backup/e107_0.8/e107_plugins/download/admin_download.php,v $
 * $Revision: 12639 $
 * $Date: 2012-04-20 00:28:53 -0700 (Fri, 20 Apr 2012) $
 * $Author: e107coders $
 */
$eplug_admin = true;
require_once "../../class2.php";
if (!getperms("P") || !e107::isInstalled('gallery')) {
    header("location:" . e_BASE . "index.php");
    exit;
}
$e_sub_cat = 'gallery';
class plugin_gallery_admin extends e_admin_dispatcher
{
    /**
     * Format: 'MODE' => array('controller' =>'CONTROLLER_CLASS'[, 'index' => 'list', 'path' => 'CONTROLLER SCRIPT PATH', 'ui' => 'UI CLASS NAME child of e_admin_ui', 'uipath' => 'UI SCRIPT PATH']);
     * Note - default mode/action is autodetected in this order:
     * - $defaultMode/$defaultAction (owned by dispatcher - see below)
     * - $adminMenu (first key if admin menu array is not empty)
     * - $modes (first key == mode, corresponding 'index' key == action)
     * @var array
     */
    protected $modes = array('main' => array('controller' => 'gallery_cat_admin_ui', 'path' => null, 'ui' => 'gallery_cat_admin_form_ui', 'uipath' => null), 'cat' => array('controller' => 'gallery_cat_ui', 'path' => null, 'ui' => 'gallery_cat_form_ui', 'uipath' => null));
开发者ID:armpit,项目名称:e107,代码行数:31,代码来源:admin_gallery.php

示例15: array

<?php

/*
 * e107 website system
 *
 * Copyright (C) e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
 * URL and front controller Management
 *
 * $URL$
 * $Id$
*/
require_once '../class2.php';
if (!ADMIN || !getperms('L')) {
    e107::redirect('admin');
    exit;
}
e107::coreLan('eurl', true);
// TODO - admin interface support, remove it from globals
$e_sub_cat = 'eurl';
e107::css('inline', " span.e-help { cursor: help } ");
class eurl_admin extends e_admin_dispatcher
{
    protected $modes = array('main' => array('controller' => 'eurl_admin_ui', 'path' => null, 'ui' => 'eurl_admin_form_ui', 'uipath' => null));
    protected $adminMenu = array('main/config' => array('caption' => LAN_EURL_MENU_CONFIG, 'perm' => 'L'), 'main/alias' => array('caption' => LAN_EURL_MENU_ALIASES, 'perm' => 'L'), 'main/settings' => array('caption' => LAN_EURL_MENU_SETTINGS, 'perm' => 'L'), 'main/simple' => array('caption' => LAN_EURL_MENU_REDIRECTS, 'perm' => 'L'));
    protected $adminMenuAliases = array();
    protected $defaultAction = 'config';
    protected $menuTitle = LAN_EURL_MENU;
}
开发者ID:KonzolozZ,项目名称:e107,代码行数:31,代码来源:eurl.php


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