本文整理汇总了PHP中need_auth函数的典型用法代码示例。如果您正苦于以下问题:PHP need_auth函数的具体用法?PHP need_auth怎么用?PHP need_auth使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了need_auth函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
<?php
require_once dirname(dirname(__FILE__)) . '/app.php';
$action = strval($_GET['action']);
$id = strval($_GET['id']);
$sec = strval($_GET['secret']);
if ($action == 'needlogin') {
$html = render('ajax_dialog_needlogin');
json($html, 'dialog');
} else {
if ($action == 'authorization') {
need_auth('super');
$user = Table::Fetch('user', $id);
$html = render('manage_ajax_dialog_authorization');
json($html, 'dialog');
} else {
if ('locale' == $action) {
$v = cookieget('locale', 'zh_cn');
cookieset('locale', $v == 'zh_cn' ? 'zh_tw' : 'zh_cn');
json(null, 'refresh');
}
}
}
示例2: dirname
<?php
require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('team');
if ($_POST) {
$table = new Table('team', $_POST);
Table::UpdateCache('team', $_POST['id'], array('now_number' => intval($_POST['now_number'])));
Session::Set('notice', '修改团购人数成功');
redirect(WEB_ROOT . "/manage/team/buy_num.php");
}
include template('manage_team_buynum_edit');
示例3: require_once
<?php
/**
* 新增一个员工
* @author abei <abei1982@qq.com>
*/
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');
need_manager();
need_auth('worker');
if($_POST){
$worker = $_POST['worker'];
$worker['create_time'] = time();
$worker['birth'] = !empty($worker['birth']) ? strtotime($worker['birth']) : NULL;
$worker['in_time'] = !empty($worker['in_time']) ? strtotime($worker['in_time']) : NULL;
if($worker_id = DB::Insert('worker',$worker)){
log_admin('worker', '新建员工成功',$worker);
Session::Set('notice', '新建员工成功');
redirect( WEB_ROOT . "/manage/worker/index.php");
}
}
include template('manage_worker_create');
?>
示例4: dirname
<?php
require_once dirname(dirname(__FILE__)) . '/app.php';
need_partner();
$partner_id = abs(intval($_SESSION['partner_id']));
$action = strval($_GET['action']);
$id = $order_id = abs(intval($_GET['id']));
$team = Table::Fetch('team', $id);
need_auth($team['partner_id'] == $partner_id);
if ('teamdetail' == $action) {
$partner = Table::Fetch('partner', $team['partner_id']);
$nowcount = Table::Count('order', array('state' => 'pay', 'team_id' => $id));
$onlinepay = Table::Count('order', array('state' => 'pay', 'team_id' => $id), 'money');
$creditpay = Table::Count('order', array('state' => 'pay', 'team_id' => $id), 'credit');
$team['state'] = team_state($team);
$html = render('ajax_dialog_teamdetail');
json($html, 'dialog');
}
示例5: dirname
<?php
require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('order');
$t_con = array('begin_time < ' . time(), 'end_time > ' . time());
$teams = DB::LimitQuery('team', array('condition' => $t_con));
$t_id = Utility::GetColumn($teams, 'id');
$condition = array('team_id' => $t_id, 'team_id > 0');
/* filter */
$uemail = strval($_GET['uemail']);
if ($uemail) {
$uuser = Table::Fetch('user', $uemail, 'email');
if ($uuser) {
$condition['user_id'] = $uuser['id'];
} else {
$uemail = null;
}
}
$team_id = abs(intval($_GET['team_id']));
if ($team_id && in_array($team_id, $t_id)) {
$condition['team_id'] = $team_id;
} else {
$team_id = null;
}
/* end fiter */
$count = Table::Count('order', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$orders = DB::LimitQuery('order', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset));
$pay_ids = Utility::GetColumn($orders, 'pay_id');
$pays = Table::Fetch('pay', $pay_ids);
示例6: dirname
<?php
require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('admin|market');
$action = strval($_GET['action']);
$id = abs(intval($_GET['id']));
$team = Table::Fetch('team', $id);
//处理导航分类下拉框联动效果
if ('baidu' == $action) {
$first = $_GET['first'];
require_once dirname(dirname(dirname(__FILE__))) . '/include/configure/navigation.php';
$second = $baidu[$first];
foreach ($second as $key => $val) {
if ('网上购物' == $first || '餐饮美食' == $first || '旅游住宿' == $first) {
$v[] = '<option value=' . $key . '>' . $key . '</option>';
} else {
$v[] = '<option value=' . $val . '>' . $val . '</option>';
}
}
$v = join('<br/>', $v);
$d = array('html' => "<option value=\"\">---请选择二级分类---</option>" . $v, 'id' => 'cate_api_baidu_second');
json($d, 'updater');
//json($second, 'alert');
} elseif ('baidu2' == $action) {
$first = $_GET['first'];
$second = $_GET['second'];
//json($first, 'alert');
require_once dirname(dirname(dirname(__FILE__))) . '/include/configure/navigation.php';
foreach ($baidu[$first][$second] as $key => $val) {
$v[] = '<option value=' . $val . '>' . $val . '</option>';
示例7: dirname
<?php
require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('ask');
$id = abs(intval($_GET['id']));
Table::Delete('ask', $id);
Session::Set('notice', "删除团购咨询({$id})记录成功");
redirect(udecode($_GET['r']));
示例8: need_auth
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
if ('newsremove' == $action) {
need_auth('news');
$news = Table::Fetch('news', $id);
Table::Delete('news', $id);
Session::Set('notice', "新闻 {$id} 删除成功!");
json(null, 'refresh');
}
if ('mltadremove' == $action) {
need_auth('mltad');
$news = Table::Fetch('mltad', $id);
Table::Delete('mltad', $id);
Session::Set('notice', "广告 {$id} 删除成功!");
json(null, 'refresh');
}
示例9: dirname
<?php
require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('news');
$now = time();
$condition = array();
$count = Table::Count('news', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$news = DB::LimitQuery('news', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset));
$selector = 'index';
include template('manage_news_index');
示例10: dirname
<?php
require_once dirname(dirname(__FILE__)) . '/app.php';
need_login();
need_auth(option_yes('navforum'));
$condition = array('OR' => array('public_id > 0', 'city_id' => $city['id']), 'length(title) > 0', 'parent_id' => 0);
$count = Table::Count('topic', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$topics = DB::LimitQuery('topic', array('condition' => $condition, 'size' => $pagesize, 'offset' => $offset, 'order' => 'ORDER BY head DESC, last_time DESC'));
$user_ids = Utility::GetColumn($topics, 'user_id');
$users = Table::Fetch('user', $user_ids);
$pagetitle = '讨论区';
include template('forum_index');
示例11: dirname
<?php
require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('help');
$system = Table::Fetch('system', 1);
if ($_POST) {
unset($_POST['commit']);
$INI = Config::MergeINI($INI, $_POST);
$INI = ZSystem::GetUnsetINI($INI);
/* end */
foreach ($INI['bulletin'] as $bid => $bv) {
$INI['bulletin'][$bid] = stripslashes($bv);
}
$value = Utility::ExtraEncode($INI);
$table = new Table('system', array('value' => $value));
if ($system) {
$table->SetPK('id', 1);
}
$flag = $table->update(array('value'));
Session::Set('notice', '更新系统信息成功');
Utility::Redirect(WEB_ROOT . '/manage/system/bulletin.php');
}
include template('manage_system_bulletin');
示例12: dirname
<?php
require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('coupon');
if (is_post()) {
$paycard = $_POST;
$paycard['quantity'] = abs(intval($paycard['quantity']));
$paycard['money'] = abs(intval($paycard['money']));
$paycard['expire_time'] = strtotime($paycard['expire_time']);
$error = array();
if ($paycard['money'] < 10) {
$error[] = "充值卡面额不能小于10元";
}
if ($paycard['quantity'] < 1 || $card['quantity'] > 1000) {
$error[] = "充值卡每次只能生产1-1000张";
}
$today = strtotime(date('Y-m-d'));
if ($paycard['expire_time'] < $today) {
$error[] = "过期时间不能小于当天";
}
if (!$error && ZPaycard::PayCardCreate($paycard)) {
log_admin('coupon', '新建充值卡' . $paycard['quantity'] . '张');
Session::Set('notice', "{$paycard['quantity']}张充值卡生成成功");
redirect(WEB_ROOT . '/manage/coupon/paycardcreate.php');
}
$error = join("<br />", $error);
Session::Set('error', $error);
} else {
$paycard = array('expire_time' => strtotime('+6 months'), 'quantity' => 10, 'money' => 50);
}
示例13: json
json($html, 'dialog');
} else {
if ('inviteok' == $action) {
need_auth(is_manager());
$invite = Table::Fetch('invite', $id);
if (!$invite || $invite['pay'] != 'N') {
json('Illeggal operation', 'alert');
}
Table::UpdateCache('invite', $id, array('pay' => 'Y'));
$invite = Table::FetchForce('invite', $id);
ZFlow::CreateFromInvite($invite);
Session::Set('notice', 'Invitation rebate operation is done');
json(null, 'refresh');
} else {
if ('inviteremove' == $action) {
need_auth(is_manager());
Table::Delete('invite', $id);
Session::Set('notice', 'Illegal invitations deleted!');
json(null, 'refresh');
} else {
if ('subscriberemove' == $action) {
$subscribe = Table::Fetch('subscribe', $id);
if ($subscribe) {
ZSubscribe::Unsubscribe($subscribe);
Session::Set('notice', "Email: {$subscribe['email']} unsubscribed successfully");
}
json(null, 'refresh');
} else {
if ('partnerremove' == $action) {
$partner = Table::Fetch('partner', $id);
$count = Table::Count('team', array('partner_id' => $id));
示例14: require_once
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');
need_manager();
need_auth('caiwu_withdraw');
$id = abs(intval($_GET['id']));
$status = strval($_GET['status']);
$withdraw_direction = strval($_GET['withdraw_direction']);
$uemail = strval($_GET['uemail']);
$adminname = strval($_GET['adminname']);
$adminemail = strval($_GET['adminemail']);
$content = strval($_GET['content']);
$condition = array (
'type' => 'withdraw',
);
/* filter */
if ($id) {
$condition['id'] = $id;
} else { $id = null; }
if ($status) {
$condition['status'] = $status;
} else { $status = null; }
示例15: dirname
<?php
require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('admin');
$id = abs(intval($_REQUEST['id']));
$category = Table::Fetch('category', $id);
$table = new Table('category', $_POST);
$table->letter = strtoupper($table->letter);
$uarray = array('zone', 'ename', 'letter', 'name', 'czone', 'sort_order');
if (!$_POST['name'] || !$_POST['ename'] || !$_POST['letter']) {
Session::Set('error', '中文名称、英文名称、首字母均不能为空');
Utility::Redirect(null);
}
if ($category) {
if ($flag = $table->update($uarray)) {
Session::Set('notice', '编辑分类成功');
} else {
Session::Set('error', '编辑分类失败');
}
option_category($category['zone'], true);
} else {
if ($flag = $table->insert($uarray)) {
Session::Set('notice', '新建分类成功');
} else {
Session::Set('error', '新建分类失败');
}
}
option_category($table->zone, true);
Utility::Redirect(null);