/** * * @param type $who * @param type $whom * @return boolean */ public function hasAccess($who, $whom) { //accessArray $accessArray = array(12, 13, 15, 16, 0, 17, 1, 2); ////This contains the relation which have access over each other //Basic things. User can edit is own information. if ($who === $whom) { return true; } //Make a check if the person is admin $mclass = new member($who); if ($mclass->isAdmin()) { //The person suggesting is admin. Just do it. :P return true; } $relation = $this->calculateRelation($who, $whom); if (in_array($relation, $accessArray)) { return true; } else { return false; } }
<?php /** * @package iCMS * @copyright 2007-2010, iDreamSoft * @license http://www.idreamsoft.com iDreamSoft * @author coolmoo <*****@*****.**> */ require_once dirname(__FILE__) . '/../global.php'; define('__ADMINCP__', __SELF__ . '?mo'); error_reporting(E_ALL ^ E_NOTICE); iCMS_DB::$show_errors = true; require_once iPATH . 'include/member.class.php'; require_once iPATH . 'include/forum.class.php'; require_once iPATH . 'admin/function.php'; require_once iPATH . 'admin/admincp.lang.php'; require_once iPATH . 'include/UI.class.php'; require_once iPATH . 'admin/menu.class.php'; require_once iPATH . 'admin/admincp.class.php'; //admincp_log(); if ($_POST['action'] == "login") { ckseccode($_POST['seccode'], 'B') && javascript::alert("验证码错误!", 'js:parent.$("#seccodeimg").click();'); } member::$isAdmin = true; member::checklogin(); member::MP("ADMINCP", "ADMINCP_Permission_Denied");