本文整理汇总了PHP中iACP::is_superadmin方法的典型用法代码示例。如果您正苦于以下问题:PHP iACP::is_superadmin方法的具体用法?PHP iACP::is_superadmin怎么用?PHP iACP::is_superadmin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iACP
的用法示例。
在下文中一共展示了iACP::is_superadmin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: do_save
function do_save()
{
$uid = (int) $_POST['uid'];
$gender = (int) $_POST['gender'];
$type = $_POST['type'];
$username = iS::escapeStr($_POST['uname']);
$nickname = iS::escapeStr($_POST['nickname']);
$realname = iS::escapeStr($_POST['realname']);
$power = $_POST['power'] ? json_encode($_POST['power']) : '';
$cpower = $_POST['cpower'] ? json_encode($_POST['cpower']) : '';
$gid = 0;
$info = array();
$info['icq'] = iS::escapeStr($_POST['icq']);
$info['home'] = iS::escapeStr($_POST['home']);
$info['year'] = intval($_POST['year']);
$info['month'] = intval($_POST['month']);
$info['day'] = intval($_POST['day']);
$info['from'] = iS::escapeStr($_POST['from']);
$info['signature'] = iS::escapeStr($_POST['signature']);
$info = addslashes(serialize($info));
$_POST['pwd'] && ($password = md5($_POST['pwd']));
$username or iPHP::alert('账号不能为空');
if (iACP::is_superadmin()) {
$gid = (int) $_POST['gid'];
} else {
isset($_POST['gid']) && iPHP::alert('您没有权限更改角色');
}
$fields = array('gid', 'gender', 'username', 'nickname', 'realname', 'power', 'cpower', 'info');
$data = compact($fields);
if (empty($uid)) {
iDB::value("SELECT `uid` FROM `#iCMS@__members` where `username` ='{$username}' LIMIT 1") && iPHP::alert('该账号已经存在');
$_data = compact(array('password', 'regtime', 'lastip', 'lastlogintime', 'logintimes', 'post', 'type', 'status'));
$_data['regtime'] = time();
$_data['lastip'] = iPHP::getIp();
$_data['lastlogintime'] = time();
$_data['status'] = '1';
$data = array_merge($data, $_data);
iDB::insert('members', $data);
$msg = "账号添加完成!";
} else {
iDB::value("SELECT `uid` FROM `#iCMS@__members` where `username` ='{$username}' AND `uid` !='{$uid}' LIMIT 1") && iPHP::alert('该账号已经存在');
iDB::update('members', $data, array('uid' => $uid));
$password && iDB::query("UPDATE `#iCMS@__members` SET `password`='{$password}' WHERE `uid` ='" . $uid . "'");
$msg = "账号修改完成!";
}
iPHP::success($msg, 'url:' . APP_URI);
}
示例2:
<form action="<?php
echo APP_FURI;
?>
&do=save" method="post" class="form-inline" id="iCMS-account" target="iPHP_FRAME">
<input name="uid" type="hidden" value="<?php
echo $this->uid;
?>
" />
<input name="type" type="hidden" value="<?php
echo $this->type;
?>
" />
<div id="account-add" class="tab-content">
<div id="account-info" class="tab-pane active">
<?php
if (iACP::is_superadmin()) {
?>
<div class="input-prepend"> <span class="add-on">角色</span>
<select name="gid" id="gid" class="chosen-select" data-placeholder="请选择用户组">
<option value='0'>路人甲[GID:0] </option>
<?php
echo $this->groupApp->select();
?>
</select>
</div>
<?php
}
?>
<div class="clearfloat mb10"></div>
<div class="input-prepend"> <span class="add-on"> 账号</span>
<input type="text" name="uname" class="span3" id="uname" value="<?php
示例3: function
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
window.setTimeout(function(){
$.getJSON("http://www.idreamsoft.com/cms/version.php?callback=?",
function(o){
$('#newversion').text(o.version);
}
);
},1000);
<?php
if (iCMS::$config['system']['patch'] && iACP::is_superadmin()) {
?>
window.setTimeout(function(){
$.getJSON('<?php
echo __ADMINCP__;
?>
=patch&do=check&ajax=1&jt=<?php
echo time();
?>
',
function(json){
if(json.code=="0"){
return;
}
iCMS.dialog({
content: json.msg,