本文整理汇总了PHP中checkGroup函数的典型用法代码示例。如果您正苦于以下问题:PHP checkGroup函数的具体用法?PHP checkGroup怎么用?PHP checkGroup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了checkGroup函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: time
}
*/
if ($_FILES['imgfile']['error'] == UPLOAD_ERR_OK) {
$filename = "module/lovestation/templates/default/images/carrelaxbargame/" . $_FILES['imgfile']['name'];
$data['imgfile'] = $filename;
//上传图片处理结束
}
$data['href'] = $href;
$data['introduce'] = $introduce;
$data['dateline'] = time();
$whearr['id'] = $id;
updatetable("cargames", $data, $whearr);
MooMessageAdmin("更新成功", 'index.php?action=lovestation&h=carrelaxbargame');
exit;
}
if (!checkGroup('lovestation', $h)) {
MooMessageAdmin('您没有此操作的权限', 'index.php');
}
$h = MooGetGPC('h', 'string', 'G');
//日志变更类型
/*
$matchmaker_msg_array=array(0=>'处罚',1=>'奖励','3'=>'PK胜利','4'=>'PK失败','5'=>'PK资本支付','6'=>'PK资本返还');
if(!checkGroup('matchmaker',$h)){
if(in_array($h,array('config_list','to_rewards','want_pk','my_pk','pk_me','pk_list','mylog','reward_log','isAuthRewards'))){
exit('您没有此操作的权限');
}else{
exit(json_encode(array('flag'=>0,'msg'=>'您没有此操作的权限')));
}
}
*/
switch ($h) {
示例2: returnglobal
*
* $Id: activate.php 10925 2011-09-02 14:12:02Z c_schmitz $
*/
//Ensure script is not run directly, avoid path disclosure
include_once "login_check.php";
//Login Check dies also if the script is started directly
include_once "activate_functions.php";
$postsid = returnglobal('sid');
$activateoutput = '';
$qtypes = getqtypelist('', 'array');
if (!isset($_POST['ok']) || !$_POST['ok']) {
if (isset($_GET['fixnumbering']) && $_GET['fixnumbering']) {
fixNumbering($_GET['fixnumbering']);
}
// Check consistency for groups and questions
$failedgroupcheck = checkGroup($postsid);
$failedcheck = checkQuestions($postsid, $surveyid, $qtypes);
//IF ANY OF THE CHECKS FAILED, PRESENT THIS SCREEN
if (isset($failedcheck) && $failedcheck || isset($failedgroupcheck) && $failedgroupcheck) {
$activateoutput .= "<br />\n<div class='messagebox ui-corner-all'>\n";
$activateoutput .= "<div class='header ui-widget-header'>" . $clang->gT("Activate Survey") . " ({$surveyid})</div>\n";
$activateoutput .= "<div class='warningheader'>\n" . $clang->gT("Error") . "<br />\n";
$activateoutput .= $clang->gT("Survey does not pass consistency check") . "</div>\n";
$activateoutput .= "<p>\n";
$activateoutput .= "<strong>" . $clang->gT("The following problems have been found:") . "</strong><br />\n";
$activateoutput .= "<ul>\n";
if (isset($failedcheck) && $failedcheck) {
foreach ($failedcheck as $fc) {
$activateoutput .= "<li> Question qid-{$fc[0]} (\"<a href='{$scriptname}?sid={$surveyid}&gid={$fc['3']}&qid={$fc['0']}'>{$fc[1]}</a>\"){$fc[2]}</li>\n";
}
}
示例3: MooGetGPC
$data['province'] = MooGetGPC('province', 'integer', 'P');
$data['activity_img'] = 'module/activity/templates/default/images/activity_new/' . MooGetGPC('img', 'string', 'P');
$data['href'] = 'index.php?n=activity&h=' . MooGetGPC('href', 'string', 'P');
$data['city'] = MooGetGPC('city', 'integer', 'P');
$data['place'] = htmlspecialchars(trim(MooGetGPC('place', 'string', 'P')));
$data['profile'] = htmlspecialchars(trim(MooGetGPC('profile', 'string', 'P')));
$data['introduction'] = htmlspecialchars(trim(MooGetGPC('introduction', 'string', 'P')));
updatetable('activity', $data, $where);
MooMessageAdmin('活动修改成功', 'index.php?action=active_activity&h=edit&id=' . $id);
}
$sql = 'SELECT `type`,`title`,`price`,`price_online`,`starttime`,`endtime`,`opentime`,`closetime`,`issex`,`province`,`city`,`place`,`profile`,`introduction` from `' . $GLOBALS['dbTablePre'] . 'activity` where `id`=' . $id;
$data = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
require adminTemplate('active_activity_detail');
}
$h = MooGetGPC('h', 'string', 'G');
$h_array = array('list', 'add', 'edit');
$h = in_array($h, $h_array) ? $h : 'list';
if (!checkGroup('active_activity', $h)) {
MooMessageAdmin('您没有此操作的权限', 'index.php?action=active_activity');
}
switch ($h) {
case 'list':
active_activity_list();
break;
case 'add':
active_activity_add();
break;
case 'edit':
active_activity_edit();
break;
}
示例4: preg_replace
$currenturl = preg_replace("/(&page=\\d+)/", "", $currenturl);
$currenturl = preg_replace("/(&type=undealed)/", "", $currenturl);
$currenturl = preg_replace("/(&type=dealed)/", "", $currenturl);
$currenturl = preg_replace("/(&type=all)/", "", $currenturl);
$currenturl2 = $currenturl;
$currenturl = $currenturl . "&type={$type}";
$pages = multipage($total['num'], $limit, $page, $currenturl);
//note 跳转到某一页
$page_num = ceil($total['num'] / $limit);
//note 插入日志
serverlog(1, $GLOBALS['dbTablePre'] . 'service_leer', "{$GLOBALS['username']}查看秋波列表", $GLOBALS['adminid']);
require adminTemplate('active_leer_list');
}
/***********************************************控制层(C)*****************************************/
$h = MooGetGPC('h', 'string', 'G') == '' ? 'list' : MooGetGPC('h', 'string', 'G');
//note 动作列表
$hlist = array('list');
//note 判断页面是否存在
if (!in_array($h, $hlist)) {
MooMessageAdmin('您要打开的页面不存在');
}
//note 判断是否有权限
if (!checkGroup('active_leer', $h)) {
MooMessageAdmin('您没有此操作的权限');
}
switch ($h) {
//note 秋波列表
case 'list':
active_leer_list();
break;
}
示例5: multipage
}
$total = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
$user_arr = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql_detail);
$currenturl = "index.php?action=active_uplink&h=list&choose={$choose}&keyword={$keyword}&startdate={$startdate}&enddate={$enddate}";
$currenturl = $currenturl . "&type={$type}";
$pages = multipage($total['num'], $limit, $page, $currenturl);
//note 跳转到某一页
$page_num = ceil($total['num'] / $limit);
//note 插入日志
serverlog(1, $GLOBALS['dbTablePre'] . 'servies', "{$GLOBALS['username']}查看会员上行列表", $GLOBALS['adminid']);
//note 载入模块
require adminTemplate('active_uplink_list');
}
/***********************************************控制层(C)*****************************************/
$h = MooGetGPC('h', 'string', 'G') == '' ? 'list' : MooGetGPC('h', 'string', 'G');
//note 动作列表
$hlist = array('list');
//note 判断页面是否存在
if (!in_array($h, $hlist)) {
MooMessageAdmin('您要打开的页面不存在', 'index.php?action=site_media');
}
//note 判断是否有权限
if (!checkGroup('active_uplink', $h)) {
MooMessageAdmin('您没有此操作的权限', 'index.php?action=site&h=site_media');
}
switch ($h) {
//note 委托列表
case 'list':
active_uplink_list();
break;
}
示例6: preg_replace
$currenturl = preg_replace("/(&page=\\d+)/", "", $currenturl);
$currenturl = preg_replace("/(&type=undealed)/", "", $currenturl);
$currenturl = preg_replace("/(&type=dealed)/", "", $currenturl);
$currenturl = preg_replace("/(&type=all)/", "", $currenturl);
$currenturl2 = $currenturl;
$currenturl = $currenturl . "&type={$type}";
$pages = multipage($total['num'], $limit, $page, $currenturl);
//note 跳转到某一页
$page_num = ceil($total['num'] / $limit);
//note 插入日志
serverlog(1, $GLOBALS['dbTablePre'] . 'members_search', "{$GLOBALS['username']}操作会员委托", $GLOBALS['adminid']);
require adminTemplate('active_commission_list');
}
/***********************************************控制层(C)*****************************************/
$h = MooGetGPC('h', 'string', 'G') == '' ? 'list' : MooGetGPC('h', 'string', 'G');
//note 动作列表
$hlist = array('list');
//note 判断页面是否存在
if (!in_array($h, $hlist)) {
MooMessageAdmin('您要打开的页面不存在');
}
//note 判断是否有权限
if (!checkGroup('active_commission', $h)) {
MooMessageAdmin('您没有此操作的权限');
}
switch ($h) {
//note 委托列表
case 'list':
active_commission_list();
break;
}
示例7: preg_replace
$currenturl = preg_replace("/(&type=undealed)/", "", $currenturl);
$currenturl = preg_replace("/(&type=dealed)/", "", $currenturl);
$currenturl = preg_replace("/(&type=all)/", "", $currenturl);
$currenturl2 = $currenturl;
$currenturl = $currenturl . "&type={$type}";
$pages = multipage($total['num'], $limit, $page, $currenturl);
//note 跳转到某一页
$page_num = ceil($total['num'] / $limit);
//note 插入日志
serverlog(1, $GLOBALS['dbTablePre'] . 'service_chat', "{$GLOBALS['username']}查看聊天记录列表", $GLOBALS['adminid']);
//note 调用模板
require adminTemplate('active_chat_list');
}
/***********************************************控制层(C)*****************************************/
$h = MooGetGPC('h', 'string', 'G') == '' ? 'list' : MooGetGPC('h', 'string', 'G');
//note 动作列表
$hlist = array('list');
//note 判断页面是否存在
if (!in_array($h, $hlist)) {
MooMessageAdmin('您要打开的页面不存在', 'index.php?n=main');
}
//note 判断是否有权限
if (!checkGroup('active_chat', $h)) {
MooMessageAdmin('您没有此操作的权限', 'index.php?n=main');
}
switch ($h) {
//note 委托列表
case 'list':
active_chat_list();
break;
}
示例8: file_get_contents
$output .= "<h2>Groups</h2>";
/*
* If the ?group=THING query is defined, we're going to save that variable.
* If a user action is also defined, we'll do that. If it's just the group
* name, we'll list check that the user is a member of that group, then get
* all it's posts.
*/
//Join group dialogue
$output .= file_get_contents("templates/join-group.html");
//New group dialogue.
$output .= file_get_contents("templates/new-group.html");
if (isset($_POST['create-group'])) {
$new_group = mysqli_real_escape_string($conn, $_POST['new-group']);
//If the group doesn't exist yet...
if (!checkGroup($new_group)) {
$private = isset($_POST['private']);
//If $private is 1 (true) leave it as 1, else set to 0 (false).
$private = $private == 1 ? 1 : 0;
//spit($private);
$username = $_SESSION['username'];
$sql = "INSERT INTO Groups (name, private, owner) VALUES ('{$new_group}', '{$private}', '{$username}')";
$result = mysqli_query($conn, $sql);
if ($result) {
//spit("A");
addtoGroup($new_group, $username);
$output .= "<p>Group created successfully.</p>";
} else {
//spit("B");
$output .= "<p>" . mysqli_error($conn) . "</p>";
}
示例9: MooGetGPC
$uid = MooGetGPC('uid', 'integer', 'R');
$data = $GLOBALS['_MooClass']['MooMySQL']->getAll('SELECT * FROM ' . $GLOBALS['dbTablePre'] . 'cooperation where uid = ' . $uid);
$v = $data['0'];
require adminTemplate('active_cooperation_remark');
exit;
}
$h = MooGetGPC('h', 'string', 'R') == '' ? 'list' : MooGetGPC('h', 'string', 'R');
$act = MooGetGPC('act', 'string', 'R') == '' ? 'list' : MooGetGPC('act', 'string', 'R');
//note 动作列表
$hlist = array('list', 'search', 'edit', 'remark', 'update');
//note 判断页面是否存在
if (!in_array($h, $hlist)) {
MooMessageAdmin('您要打开的页面不存在', 'index.php?action=site_media');
}
//note 判断是否有权限
if (!checkGroup('active_cooperation', $h)) {
MooMessageAdmin('您没有此操作的权限', 'index.php?action=site&h=site_media');
}
switch ($act) {
case 'search':
cooperation_search();
break;
case 'edit':
cooperation_edit();
break;
case 'remark':
cooperation_remark();
break;
case 'remark_update':
cooperation_remark_update();
break;
示例10: while
</h4>
</a>
</div>
</div>
<?php
$query = $conn->prepare('SELECT * FROM departments ORDER BY name ASC');
$query->execute();
$row = $query->fetch(PDO::FETCH_ASSOC);
$i = 0;
while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
if ($row['name'] == 'FinanceandHR') {
$dep = 'Finance';
} else {
$dep = $row['humanName'];
}
if ($_SESSION['access'] == 10 || checkGroup($dep)) {
echo '
<div class="panel panel-default">
<div class="panel-heading">
<a class="ajax-link" data-toggle="collapse" data-parent="#accordion" href="#collapse' . $i . '" data-href-url="admin/dashboard.php?department=' . $row['name'] . '">
<h4 class="panel-title">';
if ($row['name'] == "CommunicationsandSales") {
echo 'Comms and Sales';
} elseif ($row['name'] == "FinanceandHR") {
echo 'Finance';
} else {
echo $row['humanName'];
}
echo '</h4>
</a>
</div>
示例11: MooGetGPC
$isedit = 1;
$id = MooGetGPC('id', 'integer', 'G');
$sql = "SELECT * FROM {$GLOBALS['dbTablePre']}media WHERE id = {$id}";
$news = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
require adminTemplate('site_media_add');
}
/***********************************************控制层(C)*****************************************/
$h = MooGetGPC('h', 'string', 'G') == '' ? 'list' : MooGetGPC('h', 'string', 'G');
//note 动作列表
$hlist = array('list', 'add', 'del', 'edit');
//note 判断页面是否存在
if (!in_array($h, $hlist)) {
MooMessageAdmin('您要打开的页面不存在', 'index.php?action=site_media');
}
//note 判断是否有权限
if (!checkGroup('site_media', $h)) {
MooMessageAdmin('您没有此操作的权限', 'index.php?action=site&h=site_media');
}
switch ($h) {
//note 报道列表
case 'list':
site_media_list();
break;
//note 添加媒体报道
//note 添加媒体报道
case 'add':
site_media_add();
break;
//note 删除媒体报道
//note 删除媒体报道
case 'del':
示例12: activate
/**
* Function responsible to activate survey.
*
* @access public
* @param int $iSurveyID
* @return void
*/
public function activate($iSurveyID)
{
if (!Permission::model()->hasSurveyPermission($iSurveyID, 'surveyactivation', 'update')) {
die;
}
$iSurveyID = (int) $iSurveyID;
$aData = array();
$aData['sidemenu']['state'] = false;
$aData['aSurveysettings'] = getSurveyInfo($iSurveyID);
$aData['surveyid'] = $iSurveyID;
$surveyinfo = Survey::model()->findByPk($iSurveyID)->surveyinfo;
$aData['title_bar']['title'] = $surveyinfo['surveyls_title'] . "(" . gT("ID") . ":" . $iSurveyID . ")";
// Die if this is not possible
if (!isset($aData['aSurveysettings']['active']) || $aData['aSurveysettings']['active'] == 'Y') {
$this->getController()->error('Survey not active');
}
$qtypes = getQuestionTypeList('', 'array');
Yii::app()->loadHelper("admin/activate");
if (empty($_POST['ok'])) {
if (isset($_GET['fixnumbering']) && $_GET['fixnumbering']) {
fixNumbering($_GET['fixnumbering'], $iSurveyID);
}
// Check consistency for groups and questions
$failedgroupcheck = checkGroup($iSurveyID);
$failedcheck = checkQuestions($iSurveyID, $iSurveyID, $qtypes);
$aData['failedcheck'] = $failedcheck;
$aData['failedgroupcheck'] = $failedgroupcheck;
$aData['aSurveysettings'] = getSurveyInfo($iSurveyID);
$this->_renderWrappedTemplate('survey', 'activateSurvey_view', $aData);
} else {
$survey = Survey::model()->findByAttributes(array('sid' => $iSurveyID));
if (!is_null($survey)) {
$survey->anonymized = Yii::app()->request->getPost('anonymized');
$survey->datestamp = Yii::app()->request->getPost('datestamp');
$survey->ipaddr = Yii::app()->request->getPost('ipaddr');
$survey->refurl = Yii::app()->request->getPost('refurl');
$survey->savetimings = Yii::app()->request->getPost('savetimings');
$survey->save();
Survey::model()->resetCache();
// Make sure the saved values will be picked up
}
$aResult = activateSurvey($iSurveyID);
if (isset($aResult['error'])) {
$aViewUrls['output'] = "<br />\n<div class='messagebox ui-corner-all'>\n";
if ($aResult['error'] == 'surveytablecreation') {
$aViewUrls['output'] .= "<div class='alert alert-warning' role='alert'>" . gT("Survey table could not be created.") . "</div>\n";
} else {
$aViewUrls['output'] .= "<div class='alert alert-success' role='alert'>" . gT("Timings table could not be created.") . "</div>\n";
}
$aViewUrls['output'] .= "<strong class='text-warning'>" . gT("Database error!!") . "\n " . "\n" . "<pre>" . var_export($aResult['error'], true) . "</pre>\n\n <a href='" . Yii::app()->getController()->createUrl("admin/survey/sa/view/surveyid/" . $iSurveyID) . "'>" . gT("Main Admin Screen") . "</a>\n</strong><br/>";
} else {
$warning = isset($aResult['warning']) ? true : false;
$allowregister = $survey->allowregister == 'Y' ? true : false;
$onclickAction = convertGETtoPOST(Yii::app()->getController()->createUrl("admin/tokens/sa/index/surveyid/" . $iSurveyID));
$closedOnclickAction = convertGETtoPOST(Yii::app()->getController()->createUrl("admin/tokens/sa/index/surveyid/" . $iSurveyID));
$noOnclickAction = convertGETtoPOST(Yii::app()->getController()->createUrl("admin/survey/sa/view/surveyid/" . $iSurveyID));
$activationData = array('iSurveyID' => $iSurveyID, 'warning' => $warning, 'allowregister' => $allowregister, 'onclickAction' => $onclickAction, 'closedOnclickAction' => $closedOnclickAction, 'noOnclickAction' => $noOnclickAction);
$aViewUrls['output'] = $this->getController()->renderPartial('/admin/survey/_activation_feedback', $activationData, true);
}
$this->_renderWrappedTemplate('survey', $aViewUrls, $aData);
}
}
示例13: adminTemplate
}
}
$sql = "SELECT * FROM {$GLOBALS['dbTablePre']}admin_action WHERE id='{$actionid}'";
$adminaction = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
require_once adminTemplate('adminaction_edit');
}
/***********************************************控制层(C)*****************************************/
$h = MooGetGPC('h', 'string') == '' ? 'list' : MooGetGPC('h', 'string');
//note 动作列表
$hlist = array('list', 'add', 'edit');
//note 判断页面是否存在
if (!in_array($h, $hlist)) {
MooMessageAdmin('您要打开的页面不存在', 'index.php?action=system_adminaction&h=list');
}
//note 判断是否有权限
if (!checkGroup('system_adminaction', $h)) {
MooMessageAdmin('您没有此操作的权限', 'index.php?action=admin&h=index', 1);
}
switch ($h) {
//note 所有操作列表
case 'list':
system_adminaction_list();
break;
//note 添加操作
//note 添加操作
case 'add':
system_adminaction_add();
break;
//note 修改操作
//note 修改操作
case 'edit':
示例14: print_r
echo '缓存重建成功,请重新刷新页面 <br>';
print_r($hntest_cache);
} else {
echo '缓存生成失败!';
}
}
/***********************************************控制层(C)*****************************************/
$h = MooGetGPC('h', 'string') == '' ? 'question_list' : MooGetGPC('h', 'string');
//note 判断是否有权限
//echo 'hntest_'.$h;exit;
require 'include/hntest_function.php';
if (!file_exists('../data/cache/hntest_cache.php')) {
hntest_cache();
}
require '../data/cache/hntest_cache.php';
if (!checkGroup('hntest', $h)) {
MooMessageAdmin('您没有此操作的权限', 'index.php?action=admin&h=index', 1);
}
if (isset($_GET['cache'])) {
$h = 'cache';
}
switch ($h) {
case 'question_list':
hntest_question_list();
break;
case 'question_modify':
hntest_question_modify();
break;
case 'question_del':
hntest_question_del();
break;
示例15: MooMessageAdmin
MooMessageAdmin('队红娘币限额设置成功', $referer, 1);
} else {
MooMessageAdmin('队红娘币限额设置失败<br/>USER_SQL=>' . $user_sql . '<br/>MANAGE_SQL=>' . $manage_sql, $referer, 1);
}
}
/***********************************************控制层(C)*****************************************/
$h = MooGetGPC('h', 'string') == '' ? 'list' : MooGetGPC('h', 'string');
//note 动作列表
$hlist = array('teamlist', 'addteam', 'teammember', 'addteammember', 'delteam', 'editteam', 'del_teammember', 'set_leader', 'change');
//note 判断页面是否存在
if (!in_array($h, $hlist)) {
salert('打开的页面不存在');
exit;
}
//note 判断是否有权限
$nav_list = checkGroup('system_adminteam', $h);
if (!$nav_list) {
salert('您没有此操作权限');
exit;
}
include './include/system_function.php';
switch ($h) {
//组管理
case 'teamlist':
system_adminteam_teamlist();
break;
case 'addteam':
system_adminteam_addteam();
break;
case 'teammember':
system_adminteam_teammember();