本文整理汇总了PHP中allow_dept函数的典型用法代码示例。如果您正苦于以下问题:PHP allow_dept函数的具体用法?PHP allow_dept怎么用?PHP allow_dept使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了allow_dept函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DateMill
<?php
/******************************************************************************
Etano
===============================================================================
File: admin/profile.php
$Revision$
Software by: DateMill (http://www.datemill.com)
Copyright by: DateMill (http://www.datemill.com)
Support at: http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license. *
******************************************************************************/
require '../includes/common.inc.php';
require _BASEPATH_ . '/includes/admin_functions.inc.php';
allow_dept(DEPT_MODERATOR | DEPT_ADMIN);
// cleanup after an 'impersonate user' action
if (isset($_GET['clean_user_session'])) {
$_SESSION[_LICENSE_KEY_]['user'] = array();
unset($_SESSION[_LICENSE_KEY_]['user']);
}
$tpl = new phemplate('skin/', 'remove_nonjs');
$output = array('_user' => '');
// needed for the title
$output['search_md5'] = sanitize_and_format_gpc($_GET, 'search', TYPE_STRING, $__field2format[FIELD_TEXTFIELD], '');
$uid = 0;
if (!empty($_GET['uid'])) {
$uid = (int) $_GET['uid'];
if (!empty($output['search_md5']) && isset($_GET['go']) && ($_GET['go'] == 1 || $_GET['go'] == -1)) {
$query = "SELECT `results` FROM `{$dbtable_prefix}site_searches` WHERE `search_md5`='" . $output['search_md5'] . "'";
if (!($res = @mysql_query($query))) {
示例2: DateMill
<?php
/******************************************************************************
Etano
===============================================================================
File: admin/processors/subscriptions_auto_delete.php
$Revision$
Software by: DateMill (http://www.datemill.com)
Copyright by: DateMill (http://www.datemill.com)
Support at: http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license. *
******************************************************************************/
require_once '../../includes/common.inc.php';
require_once '../../includes/admin_functions.inc.php';
allow_dept(DEPT_ADMIN);
$qs = '';
$qs_sep = '';
$topass = array();
$asubscr_id = isset($_GET['asubscr_id']) ? (int) $_GET['asubscr_id'] : 0;
$query = "DELETE FROM `{$dbtable_prefix}subscriptions_auto` WHERE `asubscr_id`={$asubscr_id}";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
$topass['message']['type'] = MESSAGE_INFO;
$topass['message']['text'] = 'Subscription assignment deleted.';
redirect2page('admin/subscriptions_auto.php', $topass, $qs);
示例3: DateMill
<?php
/******************************************************************************
Etano
===============================================================================
File: admin/stats.php
$Revision$
Software by: DateMill (http://www.datemill.com)
Copyright by: DateMill (http://www.datemill.com)
Support at: http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license. *
******************************************************************************/
require_once '../includes/common.inc.php';
require_once '../includes/admin_functions.inc.php';
allow_dept(DEPT_ADMIN | DEPT_MODERATOR);
$tpl = new phemplate('skin/', 'remove_nonjs');
$output = array();
$query = "SELECT count(*) FROM `{$dbtable_prefix}user_profiles`";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
$output['num_members'] = mysql_result($res, 0, 0);
$query = "SELECT count(*) FROM `{$dbtable_prefix}user_photos`";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);
}
$output['num_photos'] = mysql_result($res, 0, 0);
$query = "SELECT count(*) FROM `{$dbtable_prefix}user_blogs`";
if (!($res = @mysql_query($query))) {
trigger_error(mysql_error(), E_USER_ERROR);