phpcms_v9 限制添加比自己更高级的管理员

修改 phpcms/modules/admin/templates/admin_add.tpl.php


原代码为:

<select name="info[roleid]">
<?php
foreach($roles as $role)
{
?>
<option value="<?php echo $role['roleid']?>" <?php echo (($role['roleid']==$roleid) ? 'selected' : '')?>><?php echo
$role['rolename']?></option>
<?php
} 
?>
</select>

改为:

<select name="info[roleid]">
<?php
foreach($roles as $role)
{
    if($_SESSION['roleid'] <= $role['roleid']){
?>
<option value="<?php echo $role['roleid']?>" <?php echo (($role['roleid']==$roleid) ? 'selected' : '')?>><?php echo
$role['rolename']?></option>
<?php
}
} 
?>
</select>


你可能感兴趣的:(phpcms_v9,限制添加比自己更高级的管理员)