本文整理匯總了PHP中Browse::saveBrowseList方法的典型用法代碼示例。如果您正苦於以下問題:PHP Browse::saveBrowseList方法的具體用法?PHP Browse::saveBrowseList怎麽用?PHP Browse::saveBrowseList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Browse
的用法示例。
在下文中一共展示了Browse::saveBrowseList方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getUserMap
/**
* 獲取該用戶的瀏覽級權限
*
* @param unknown $aname 當前action名稱
* @param unknown $type $type=1 讀取物理文件格式
* @param unknown $tablename 內嵌表格讀取數據權限 傳入內嵌表格表名
*/
public function getUserMap($aname = '', $type, $tablename)
{
$authId = $_SESSION[C('USER_AUTH_KEY')];
$map = "";
if ($authId && $_SESSION[C('ADMIN_AUTH_KEY')] != 1) {
$file = DConfig_PATH . "/BrowsecList/borwse_" . $authId . ".php";
if (!file_exists($file)) {
Browse::saveBrowseList($authId);
}
// 查詢當前用戶當前模塊的瀏覽權限,如果沒獲取到,要1、重新生成 2、如果未生成拋出異常 3、對生成文件再做檢查權限工作
$borwseList = (require $file);
// 返回當前aciton的瀏覽權限
if ($tablename) {
if ($borwseList[$aname][$tablename]['formsql']) {
$map = $borwseList[$aname][$tablename]['formsql'];
}
} else {
if ($borwseList[$aname]['formsql'] || $borwseList[$aname]['extend']['formsql']) {
$map = $borwseList[$aname]['formsql'];
if ($borwseList[$aname]['extend']['formsql']) {
if ($map) {
$map .= " and " . $borwseList[$aname]['extend']['formsql'];
} else {
$map .= $borwseList[$aname]['extend']['formsql'];
}
}
}
}
}
if ($type == 1) {
//物理文件樣式
return $borwseList;
} else {
//表單sql
//echo $tablename;
$map2 = Browse::changerole($aname, '', $tablename);
if ($map2) {
$map = array($map, $map2);
//$map = $map." OR (".$map2.")";
}
//print_r($map);
return $map;
}
}
示例2: signin
/**
* @Title: signin
* @Description: todo(瀏覽器版登陸方法)
* @author liminggang
* @date 2014-8-28 下午4:34:10
* @throws
*/
public function signin()
{
//獲取產品模塊授權培
$model = D('SerialNumber');
$system = array();
$system = $model->CheckFile();
if (count($system) > 0) {
//驗證序列號文件是否存在,基本校驗。
redirect(U("Public/serialnumber?register=" . $_POST['account']));
}
//讀取名人錄數據
//$this->getsolidotinfor();
if ($_POST["login_type"] == "dialog") {
$this->loginType = "dialog";
}
if (empty($_POST['account'])) {
$this->assign("jumpUrl", __URL__ . '/login/');
} elseif (empty($_POST['password'])) {
$this->assign("jumpUrl", __URL__ . '/login/');
} elseif (C("VERIFICATION_CODE") && empty($_POST['verify'])) {
if ($this->loginType != 'helperLogin') {
$this->assign("jumpUrl", __URL__ . '/login/');
$this->error('驗證碼必須!');
}
} elseif (C("VERIFICATION_CODE") && $_SESSION['verify'] != md5($_POST['verify'])) {
if ($this->loginType != 'helperLogin') {
$this->assign("jumpUrl", __URL__ . '/login/');
$this->error('驗證碼錯誤!');
}
}
//獲取authinfo信息
$authInfo = $this->getAuthInfo();
//使用用戶名、密碼和狀態的方式進行認證
if (false == $authInfo) {
$this->assign("jumpUrl", __URL__ . '/login/');
if ($this->loginType != 'helperLogin') {
$this->assign("info", "帳號不存在或已禁用!");
$this->display('login');
} else {
return array('status' => 0, 'msg' => "error:帳號不存在或已禁用!");
exit;
}
} else {
//--------------此部分為驗證密碼-------------------//
$checkPwd = $this->checkPwd($authInfo);
if ($checkPwd) {
return $checkPwd;
}
//-----------以下部分已被分成方法-------------//
$this->setSession($authInfo);
//設置session
$this->setUserInfoCookie($authInfo);
//設置UserInfo的cookie
//$this->setBBSCookie($authInfo);//設置BBS的cookie
$time = time();
//保存登錄信息
$ip = get_client_ip();
$data = array();
$data['last_login_time'] = $time;
$data['logintime'] = $time;
$data['isonline'] = 1;
$data['sessionid'] = session_id();
$data['id'] = $authInfo['id'];
$data['login_count'] = array('exp', 'login_count+1');
$data['login_error_count'] = 0;
$data['newmsg'] = 1;
$data['newmsgtype'] = 1;
$data['last_login_ip'] = $ip;
if (!$bindacount) {
$User = M('User');
$User->save($data);
$User->commit();
}
//新增online信息,類型為新增
$this->setUserOnline($authInfo, $type = "insert");
// 緩存訪問權限
RBAC::saveAccessList();
//寫入瀏覽及權限
Browse::saveBrowseList();
if (isset($_SESSION[C('ADMIN_AUTH_KEY')])) {
$re = $this->check_upgrade(false);
}
//如果是從OA客戶端登錄的,返回真
if ($this->loginType == 'helperLogin') {
if ($_REQUEST['fromOA'] == 2) {
//$this->success('登錄成功!');
redirect(U('Index/index'), 0.01, '頁麵跳轉中。。。');
} else {
return array('status' => 1, 'msg' => "success:登錄成功!");
exit;
}
} else {
if ($this->loginType != 'checkLogin') {
//.........這裏部分代碼省略.........
示例3: lookupchangec
public function lookupchangec()
{
$companyid = $_POST['companyid'];
//當前登錄公司id
$_SESSION['companyid'] = $companyid;
//查詢該用戶在此公司中主崗部門
$userMap = array();
$userMap['status'] = 1;
//查詢該公司
$userMap['companyid'] = $companyid;
//查詢主崗
$userMap['typeid'] = 1;
//當前用戶
$userMap['userid'] = $_SESSION[C('USER_AUTH_KEY')];
$userDeptDutyModel = D("UserDeptDuty");
//查詢當前登錄公司主崗部門id
$userDeptDutyVo = $userDeptDutyModel->where($userMap)->find();
$_SESSION['user_dep_id'] = $userDeptDutyVo['deptid'];
//刪除原有瀏覽權限
$obj_dir = new Dir();
$directory = DConfig_PATH . "/BrowsecList/borwse_" . $_SESSION[C('USER_AUTH_KEY')] . ".php";
$ret = file_exists($directory);
if ($ret) {
$ret = unlink($directory);
}
/*if(isset($directory)){
unlink($directory)
$obj_dir->del($directory);
}*/
//寫入瀏覽及權限
Browse::saveBrowseList();
//修改公司後 重新讀取瀏覽權限
echo $_SESSION['companyid'];
}