Ejemplo n.º 1
0
 public function index()
 {
     //获取权限
     $biz_account_auth = get_biz_account_auth();
     if (empty($biz_account_auth)) {
         app_redirect(url("biz", "user#login"));
     } else {
         $jump_url = url("biz", $biz_account_auth[0]);
         app_redirect($jump_url);
     }
 }
Ejemplo n.º 2
0
 function do_login()
 {
     $account_name = strim($_POST['account_name']);
     $account_password = strim($_POST['account_password']);
     $data = array();
     //验证
     if ($account_name == '') {
         $data['status'] = false;
         $data['info'] = "请输入用户名";
         $data['field'] = "account_user";
         ajax_return($data);
     }
     if ($account_password == '') {
         $data['status'] = false;
         $data['info'] = "请输入密码";
         $data['field'] = "account_password";
         ajax_return($data);
     }
     $account_info = $GLOBALS['db']->getRow("SELECT * FROM " . DB_PREFIX . "supplier_account WHERE account_name='" . $account_name . "' AND is_delete=0");
     require_once APP_ROOT_PATH . "system/libs/biz_user.php";
     if (check_ipop_limit(CLIENT_IP, "biz_dologin", intval(app_conf("SUBMIT_DELAY")))) {
         $result = do_login_biz($account_name, $account_password);
     } else {
         showErr("提交太快了", 1);
     }
     if ($result['status']) {
         // 			$s_account_info = es_session::get("account_info");
         // 			if(intval($_POST['auto_login'])==1)
         // 			{
         // 				//自动登录,保存cookie
         // 				$account_info = $s_account_info;
         // 				es_cookie::set("account_name",$account_info['account_name'],3600*24*30);
         // 				es_cookie::set("account_pwd",md5($account_info['account_password']."_EASE_COOKIE"),3600*24*30);
         // 			}
         // 			if(strim($_REQUEST['form_prefix'])=="ajax")
         // 			{
         // 				$GLOBALS['account_info'] = $s_account_info;
         // 				if($GLOBALS['account_info'])
         // 				{
         // 					$GLOBALS['tmpl']->assign("account_info",$s_account_info);
         // 				}
         // 				$tip = $GLOBALS['tmpl']->fetch("inc/insert/load_biz_user_tip.html");
         // 			}
         //获取权限
         $biz_account_auth = get_biz_account_auth();
         if (empty($biz_account_auth)) {
             showBizErr("请更换帐号登录,此账户还没有分配权限", 1);
         } else {
             $jump_url = url("biz", $biz_account_auth[0]);
         }
         $return['status'] = true;
         $return['info'] = "登录成功";
         $return['data'] = $result['msg'];
         $return['jump'] = $jump_url;
         $return['tip'] = $tip;
         ajax_return($return);
     } else {
         if ($result['data'] == ACCOUNT_NO_EXIST_ERROR) {
             $field = "account_name";
             $err = $GLOBALS['lang']['USER_NOT_EXIST'];
         }
         if ($result['data'] == ACCOUNT_PASSWORD_ERROR) {
             $field = "account_password";
             $err = $GLOBALS['lang']['PASSWORD_ERROR'];
         }
         if ($result['data'] == ACCOUNT_NO_VERIFY_ERROR) {
             $field = "account_name";
             $err = $GLOBALS['lang']['USER_NOT_VERIFY'];
         }
         $data['status'] = false;
         $data['info'] = $err;
         $data['field'] = $field;
         ajax_return($data);
     }
 }
Ejemplo n.º 3
0
function check_module_auth($module)
{
    //获取权限进行判断
    $biz_account_auth = get_biz_account_auth();
    if (!in_array($module, $biz_account_auth)) {
        return false;
    } else {
        return true;
    }
}