public function _initialize()
 {
     parent::_initialize();
     // 查找当前token店铺所属的帐号->所在的小区->的小区号->的第一个公众帐号的token
     $community_token = null;
     if (!empty($_GET['token'])) {
         //查找当前token所属的帐号
         $wxuser = M('Wxuser')->where(array('token' => $_GET['token']))->find();
         if (!empty($wxuser)) {
             //查找所属帐号
             $user = M('Users')->where(array('id' => $wxuser['uid']))->find();
             if (!empty($user)) {
                 // 查看用户所属小区的小区帐号
                 $user['community_id'];
                 $xq_user = M('Users')->where(array('community_id' => $user['community_id'], 'account_type' => 1))->find();
                 if (!empty($xq_user)) {
                     //查找该用户的所有公众号,并把第一个公众号作为小区公众号
                     $xq_wxusers = M('Wxuser')->where(array('uid' => $xq_user['id']))->select();
                     if (!empty($xq_wxusers)) {
                         $community_token = $xq_wxusers[0]['token'];
                     }
                 }
             }
         }
     }
     //读取公司信息
     $company = M('Company')->where(array('token' => $_GET['token']))->find();
     $this->assign('company', $company);
     $homeInfo = M('Home')->where(array('token' => $_GET['token']))->find();
     $this->assign('homeInfo', $homeInfo);
     $this->assign('community_token', $community_token);
 }
Beispiel #2
0
 protected function _initialize()
 {
     $sql = 'SHOW COLUMNS FROM `' . C('DB_PREFIX') . 'user`';
     $COLUMNS = M()->query($sql);
     foreach ($COLUMNS as $vo) {
         $COLUMNS_array[] = $vo['Field'];
     }
     if (!in_array('is_admin', $COLUMNS_array)) {
         $sql = 'ALTER TABLE `' . C('DB_PREFIX') . 'user` ADD `is_admin` INT NOT NULL DEFAULT \'0\'';
         M()->query($sql);
     }
     if (!isset($_SESSION['username'])) {
         $this->error('非法操作', U('System/Admin/index'));
     }
     parent::_initialize();
     C('NOT_AUTH_ACTION', '');
     C('NOT_AUTH_MODULE', 'Admin');
     if (C('USER_AUTH_ON') && !in_array(MODULE_NAME, explode(',', C('NOT_AUTH_MODULE')))) {
         if (!RBAC::AccessDecision()) {
             if (!$_SESSION[C('USER_AUTH_KEY')]) {
                 redirect(PHP_FILE . C('USER_AUTH_GATEWAY'));
             }
             if (C('RBAC_ERROR_PAGE')) {
                 redirect(C('RBAC_ERROR_PAGE'));
             } else {
                 if (C('GUEST_AUTH_ON')) {
                     $this->assign('jumpUrl', PHP_FILE . C('USER_AUTH_GATEWAY'));
                 }
                 $this->error(L('_VALID_ACCESS_'));
             }
         }
     }
     $this->show_menu();
 }
Beispiel #3
0
 public function _initialize()
 {
     parent::_initialize();
     $this->where = array('token' => $this->token);
     $this->modules = array('Home' => '首页', 'Classify' => '网站分类', 'Group' => '团购', 'Meal' => '订餐', 'Lottery' => '大转盘', 'Guajiang' => '刮刮卡', 'Coupon' => '优惠券', 'Card' => '会员卡', 'GoldenEgg' => '砸金蛋', 'LuckyFruit' => '水果机', 'Article' => '文章', 'Weidian' => '微店');
     $this->arr = array('game', 'Red_packet');
 }
Beispiel #4
0
 protected function _initialize()
 {
     // dump(session('username'));die;
     // 统一使用member前缀,防止与原系统的混淆
     if (!isset($_SESSION['member_uid'])) {
         // echo $_SESSION['username'];die;
         $this->error('非法操作', U('PayMembers/Member/login'));
     }
     parent::_initialize();
     // if (C('USER_AUTH_ON') && !in_array(MODULE_NAME, explode(',', C('NOT_AUTH_MODULE')))) {
     // 	if (!RBAC::AccessDecision()) {
     // 		//检查认证识别号
     // 		if (!$_SESSION[C('USER_AUTH_KEY')]) {
     // 			//跳转到认证网关
     // 			redirect(PHP_FILE . C('USER_AUTH_GATEWAY'));
     // 		}
     // 		// 没有权限 抛出错误
     // 		if (C('RBAC_ERROR_PAGE')) {
     // 			// 定义权限错误页面
     // 			redirect(C('RBAC_ERROR_PAGE'));
     // 		} else {
     // 			if (C('GUEST_AUTH_ON')) {
     // 				$this->assign('jumpUrl', PHP_FILE . C('USER_AUTH_GATEWAY'));
     // 			}
     // 			// 提示错误信息
     // 			$this->error(L('_VALID_ACCESS_'));
     // 		}
     // 	}
     // }
     // $this->show_menu();
 }
Beispiel #5
0
 public function _initialize()
 {
     parent::_initialize();
     $this->member = D('Member');
     $this->assign('current', 'member');
     $this->setTitle("成员 - " . $this->groupinfo['name']);
 }
Beispiel #6
0
	protected function _initialize(){		
		if(!isset($_SESSION['username'])){$this->error('非法操作',U('System/Adminsaivi/index'));}
		parent::_initialize();
		if (C('USER_AUTH_ON') && !in_array(MODULE_NAME, explode(',', C('NOT_AUTH_MODULE')))) {
            if (!RBAC::AccessDecision()) {
                //检查认证识别号
                if (!$_SESSION [C('USER_AUTH_KEY')]) {
                    //跳转到认证网关
                    redirect(PHP_FILE . C('USER_AUTH_GATEWAY'));
                }
                // 没有权限 抛出错误
                if (C('RBAC_ERROR_PAGE')) {
                    // 定义权限错误页面
                    redirect(C('RBAC_ERROR_PAGE'));
                } else {
                    if (C('GUEST_AUTH_ON')) {
                        $this->assign('jumpUrl', PHP_FILE . C('USER_AUTH_GATEWAY'));
                    }
                    // 提示错误信息
                    $this->error(L('_VALID_ACCESS_'));
                }
            }
        }
		$this->show_menu();
	}
Beispiel #7
0
 public function _initialize()
 {
     parent::_initialize();
     $this->assign('token', $this->token);
     $this->wxuser_db = M('Merchant_info');
     $this->member_card_set_db = M('Member_card_set');
     $thisWxUser = $this->wxuser_db->where(array('token' => $this->token))->find();
     $thisUser = $this->merchant_session;
     $can_cr_num = $thisWxUser['allcardnum'] - $cardTotal;
     if (0 < $can_cr_num) {
         $data['cardisok'] = 1;
     } else {
         $data['cardisok'] = 0;
     }
     $id = intval($_GET['id']);
     if ($id) {
         $this->thisCard = $this->member_card_set_db->where(array('id' => $id))->find();
         if ($this->thisCard && $this->thisCard['token'] != $this->token) {
             $this->error('非法操作');
         }
         $this->assign('thisCard', $this->thisCard);
     }
     $type = $this->_get('type', 'intval');
     $this->assign('type', $type ? $type : 1);
 }
Beispiel #8
0
 protected function _initialize()
 {
     parent::_initialize();
     $userinfo = M('User_group')->where(array('id' => session('gid')))->find();
     $users = M('Users')->where(array('id' => $_SESSION['uid']))->find();
     $this->assign('thisUser', $users);
     //dump($users);
     $this->assign('viptime', $users['viptime']);
     if (session('uid')) {
         if ($users['viptime'] < time()) {
             /*
             session(null);
             session_destroy();
             unset($_SESSION);
             */
             $_SESSION['gid'] = 1;
             $_SESSION['gname'] = "vip0";
             //$users['viptime'] = strtotime("+1 month");
             //$this->success('您的帐号已经到期,请充值后再使用');
         }
     }
     $wecha = M('Wxuser')->field('wxname,wxid,headerpic,weixin')->where(array('token' => session('token'), 'uid' => session('uid')))->find();
     $this->assign('wecha', $wecha);
     $this->assign('token', session('token'));
     $this->assign('userinfo', $userinfo);
     if (session('uid') == false) {
         $this->redirect('Home/Index/login');
     }
 }
Beispiel #9
0
 public function _initialize()
 {
     parent::_initialize();
     if (empty($this->config['is_open_oauth']) && empty($this->merchant_session['is_open_oauth'])) {
         $this->error('你没有这个使用权限', U('Index/index'));
     }
 }
Beispiel #10
0
 function _initialize()
 {
     parent::_initialize();
     if (!$this->_userid) {
         header("Location: " . U('User/Login/index'));
         exit;
     }
     $this->dao = M('User');
     $this->assign('bcid', 0);
     $user = $this->dao->find($this->_userid);
     if (empty($user["wxpas"])) {
         $himt = "<script type=\"text/javascript\">\$(document).ready(function(){alert(\"你还没绑定微信请扫描二维码绑定!\");});</script>";
         $this->assign("himt", $himt);
     }
     $user["username"] = $user["realname"] != "" ? $user["realname"] . "[" . $user["username"] . "]" : $user["username"];
     //////////////获得绑定二维码
     import("@.ORG.Weixin");
     $wechatObj = new Wechat();
     $user["ticket"] = $wechatObj->ewm($user["id"], 0);
     //////////////获得绑定二维码
     $this->user = $user;
     $this->assign('vo', $user);
     unset($_POST['status']);
     unset($_POST['groupid']);
     unset($_POST['amount']);
     unset($_POST['point']);
     $_GET = get_safe_replace($_GET);
     $order["count"] = M("order")->where(array('status' => 0, 'userid' => $this->_userid))->count();
     $order["all"] = M("order")->where(array('userid' => $this->_userid))->count();
     $order["ok"] = M("order")->where(array('status' => 1, 'userid' => $this->_userid))->count();
     $this->assign('order', $order);
     $this->assign('actionname', ACTION_NAME);
 }
Beispiel #11
0
 protected function _initialize()
 {
     $sql = "SHOW COLUMNS FROM `" . C("DB_PREFIX") . "user`";
     $COLUMNS = M()->query($sql);
     foreach ($COLUMNS as $vo) {
         $COLUMNS_array[] = $vo["Field"];
     }
     if (!in_array("is_admin", $COLUMNS_array)) {
         $sql = "ALTER TABLE `" . C("DB_PREFIX") . "user` ADD `is_admin` INT NOT NULL DEFAULT '0'";
         M()->query($sql);
     }
     if (!isset($_SESSION["username"])) {
         $this->error("非法操作", U("System/Admin/index"));
     }
     parent::_initialize();
     C("NOT_AUTH_ACTION", "");
     C("NOT_AUTH_MODULE", "Admin");
     if (C("USER_AUTH_ON") && !in_array(MODULE_NAME, explode(",", C("NOT_AUTH_MODULE")))) {
         if (!RBAC::AccessDecision()) {
             if (!$_SESSION[C("USER_AUTH_KEY")]) {
                 redirect(PHP_FILE . C("USER_AUTH_GATEWAY"));
             }
             if (C("RBAC_ERROR_PAGE")) {
                 redirect(C("RBAC_ERROR_PAGE"));
             } else {
                 if (C("GUEST_AUTH_ON")) {
                     $this->assign("jumpUrl", PHP_FILE . C("USER_AUTH_GATEWAY"));
                 }
                 $this->error(L("_VALID_ACCESS_"));
             }
         }
     }
     $this->show_menu();
 }
 function _initialize()
 {
     parent::_initialize();
     $dao = D('User');
     $user = $dao->find($this->mid);
     $this->assign('user', $user);
 }
Beispiel #13
0
	public function __construct()
	{
		parent::_initialize();

		if ($_GET['wid']) {
			$database_userinfo = D('Userinfo');
			$condition_userinfo['id'] = $_GET['wid'];
			$now_user_info = $database_userinfo->field('`wecha_id`,`token`')->where($condition_userinfo)->find();
			$this->wecha_id = $now_user_info['wecha_id'];
			$this->token = $now_user_info['token'];
		}
		else {
			$this->wecha_id = $this->_get('wecha_id');
			$this->token = $this->_get('token');
		}

		if (empty($_GET['platform'])) {
			$payConfig = M('Alipay_config')->where(array('token' => $this->token))->find();
			$payConfigInfo = unserialize($payConfig['info']);
			$this->payConfig = $payConfigInfo['allinpay'];
		}
		else {
			$payConfigInfo['merchantId'] = C('platform_allinpay_merchantId');
			$payConfigInfo['merchantKey'] = C('platform_allinpay_merchantKey');
			$this->payConfig = $payConfigInfo;
		}
	}
Beispiel #14
0
 function _initialize()
 {
     parent::_initialize();
     $this->dao = M('User');
     $this->assign('bcid', 0);
     $_POST = get_safe_replace($_POST);
 }
 public function _initialize()
 {
     parent::_initialize();
     $info = M('function_master')->where(array('class' => 1))->order('orderno asc')->select();
     $info = $this->convertLinks($info);
     //加外链等信息
 }
Beispiel #16
0
	public function _initialize() {
		parent::_initialize();
		$this->uid=intval($_GET['uid']);
		$this->gameConfig=M('Game_config')->where(array('uid'=>$this->uid))->find();
		$this->token=$this->gameConfig['token'];
		//
	}
 function _initialize()
 {
     parent::_initialize();
     $this->userid = AppframeAction::$Cache['uid'];
     $this->username = AppframeAction::$Cache['username'];
     $this->groupid = AppframeAction::$Cache['groupid'];
 }
 protected function _initialize()
 {
     parent::_initialize();
     $userinfo = M('User_group')->where(array('id' => session('gid')))->find();
     $users = M('Users')->where(array('id' => $_SESSION['uid']))->find();
     $this->assign('thisUser', $users);
     //dump($users);
     $this->assign('viptime', $users['viptime']);
     if (session('uid')) {
         if ($users['viptime'] < time()) {
             session(null);
             session_destroy();
             unset($_SESSION);
             $this->error('您的帐号已经到期,请联系您的总代理。');
         }
     }
     $this->assign('userinfo', $userinfo);
     if (session('uid') == false) {
         $this->redirect('Home/Index/login');
     }
     $allfunction = M('Function')->where(array('belonguser' => session('belonguser')))->order('id')->select();
     $allfunctiontype = M('Function')->Distinct(true)->field('funtype')->where(array('belonguser' => session('belonguser'), 'funtype' => array('neq', '默认')))->order('usenum')->select();
     $this->assign('allfunction', $allfunction);
     $this->assign('allfunctiontype', $allfunctiontype);
     $where['uid'] = session('uid');
     $info = M('Wxuser')->where($where)->find();
     session('token', $info['token']);
     session('wxid', $info['id']);
     $wecha = M('Wxuser')->field('wxname,wxid,headerpic,weixin')->where(array('token' => session('token'), 'uid' => session('uid')))->find();
     $this->assign('wecha', $wecha);
     $this->assign('token', session('token'));
     //dump(session('token'));exit;
 }
Beispiel #19
0
 public function _initialize()
 {
     parent::_initialize();
     $this->assign('jumpUrl', U('User/Login/index'));
     if (empty($this->Role[$this->_groupid]['allowpost'])) {
         $this->error(L('nologin'));
     }
     $this->assign('bcid', 0);
     $this->moduleid = intval($_REQUEST['moduleid']);
     if (!in_array($this->_groupid, explode(',', $this->module[$this->moduleid]['postgroup']))) {
         $this->error(L('add_no_postgroup'));
     }
     if ($this->moduleid) {
         $this->assign('moduleid', $this->moduleid);
         $module = $this->module[$this->moduleid]['name'];
         $this->dao = D($module);
         $fields = F($this->moduleid . '_Field');
         foreach ($fields as $key => $res) {
             if ($res['unpostgroup']) {
                 $res['unpostgroup'] = explode(',', $res['unpostgroup']);
             }
             if (!in_array($this->_groupid, $res['unpostgroup']) && $res['status']) {
                 $res['setup'] = string2array($res['setup']);
                 $this->fields[$key] = $res;
             }
         }
         unset($fields);
         unset($res);
         $this->assign('fields', $this->fields);
     }
 }
Beispiel #20
0
 function _initialize()
 {
     parent::_initialize();
     $this->dao = M('Order');
     $user = M('User')->find($this->_userid);
     $this->assign('vo', $user);
 }
 public function _initialize()
 {
     parent::_initialize();
     $agent = $_SERVER['HTTP_USER_AGENT'];
     if (!strpos($agent, "icroMessenger")) {
         //	echo '此功能只能在微信浏览器中使用';exit;
     }
     $this->token = $this->_get('token');
     $this->wecha_id = $this->_get('wecha_id');
     if (!$this->wecha_id) {
         $this->wecha_id = 'null';
     }
     $this->acid = $this->_get('acid');
     $this->recommend_model = M('Recommend');
     $this->assign('token', $this->token);
     $this->assign('wecha_id', $this->wecha_id);
     $this->assign('acid', $this->acid);
     $this->userdb = M('Userinfo');
     $this->recoUserdb = M('Recommend_user');
     //
     if ($this->acid) {
         $footuser = $this->recoUserdb->where(array('wecha_id' => $this->wecha_id, 'token' => $this->token, 'acid' => $this->acid))->find();
         $this->assign('footuser', $footuser);
     }
 }
Beispiel #22
0
 public function _initialize()
 {
     parent::_initialize();
     $where['token'] = $this->token;
     $kefu = M('Kefu')->where($where)->find();
     $this->assign('kefu', $kefu);
 }
Beispiel #23
0
 public function _initialize()
 {
     parent::_initialize();
     // 判断功能是否开启
     if (!$this->groupinfo['openBlog']) {
         $this->assign('jumpUrl', U('group/Group/index', array('gid' => $this->gid)));
         $this->error('帖子功能已关闭');
     }
     $this->topic = D('Topic');
     $this->post = D('Post');
     // 权限判读
     if (in_array(ACTION_NAME, array('dist', 'undist', 'top', 'untop', 'lock', 'unlock', 'addCategory', 'deleteCategory'))) {
         // 置顶,精华,锁定,删除,帖子分类
         if (!$this->isadmin) {
             $this->error('你没有权限');
         }
     } else {
         if (in_array(ACTION_NAME, array('add', 'doAdd', 'edit', 'post', 'editPost'))) {
             // 发布,回复,编辑
             if (!$this->ismember) {
                 $this->error('抱歉,您不是该群成员');
             }
         }
     }
     $this->assign('current', 'topic');
 }
Beispiel #24
0
 function _initialize()
 {
     parent::_initialize();
     $this->video = D('V');
     $this->attach = D('Attach');
     $this->category = D('VideoType');
 }
 public function _initialize()
 {
     parent::_initialize();
     $this->token = $this->_get('token');
     $this->wecha_id = $this->_get('wecha_id');
     $this->orderid = $this->_get('orderid');
     $this->order_db = M('product_cart');
     $this->order_list = M('product_cart_list');
     $order = M('product_cart')->where(array('orderid' => $this->orderid))->find();
     if ($order) {
         $order['ordername'] = "订单号:" . $order['orderid'];
         if ($order['dining'] == 1) {
             $this->orders_url = U('Dining/dingdan', array('token' => $this->token, 'wecha_id' => $this->wecha_id, 'storeid' => $order['storeid']));
         } else {
             $this->orders_url = U('Product/my', array('token' => $this->token, 'wecha_id' => $this->wecha_id, 'storeid' => $order['storeid']));
         }
         $this->order = $order;
     }
     //微信支付
     $pay_config = M('payment')->where(array('token' => $this->token, 'pay_code' => 'wxpay'))->find();
     $pay_config = unserialize($pay_config['pay_config']);
     $wxpay_config['appId'] = $pay_config['appId'];
     $wxpay_config['appKey'] = $pay_config['appKey'];
     $wxpay_config['appSecret'] = $pay_config['appSecret'];
     $wxpay_config['partnerId'] = $pay_config['partnerId'];
     $wxpay_config['partnerKey'] = $pay_config['partnerKey'];
     $this->wxpay_config = $wxpay_config;
 }
Beispiel #26
0
	public function __construct()
	{
		parent::_initialize();
		$this->token = $this->_get('token');
		$this->wecha_id = $this->_get('wecha_id');

		if (!$this->token) {
			$this->token = $_SESSION['yeepay']['token'];
		}

		if (empty($_GET['platform'])) {
			$payConfig = M('Alipay_config')->where(array('token' => $this->token))->find();
			$payConfigInfo = unserialize($payConfig['info']);
			$this->payConfig = $payConfigInfo['yeepay'];

			if (empty($this->payConfig['open'])) {
				$payConfigInfo['merchantaccount'] = C('platform_yeepay_merchantaccount');
				$payConfigInfo['merchantPrivateKey'] = C('platform_yeepay_merchantPrivateKey');
				$payConfigInfo['merchantPublicKey'] = C('platform_yeepay_merchantPublicKey');
				$payConfigInfo['yeepayPublicKey'] = C('platform_yeepay_yeepayPublicKey');
				$payConfigInfo['product_catalog'] = C('platform_yeepay_product_catalog');
				$this->payConfig = $payConfigInfo;
			}
		}
		else {
			$payConfigInfo['merchantaccount'] = C('platform_yeepay_merchantaccount');
			$payConfigInfo['merchantPrivateKey'] = C('platform_yeepay_merchantPrivateKey');
			$payConfigInfo['merchantPublicKey'] = C('platform_yeepay_merchantPublicKey');
			$payConfigInfo['yeepayPublicKey'] = C('platform_yeepay_yeepayPublicKey');
			$payConfigInfo['product_catalog'] = C('platform_yeepay_product_catalog');
			$this->payConfig = $payConfigInfo;
		}
	}
Beispiel #27
0
	public function _initialize() {
		parent::_initialize();
        $this->_cid = isset($_GET['cid']) ? $this->_get('cid', 'trim,intval') : session('ycompany_id');
        $this->token = isset($_GET['token']) ? $this->_get('token', 'trim') : session('RepastStaff_token');
        $this->assign('token', $this->token);
        $this->assign('cid', $this->_cid);
    }
Beispiel #28
0
 public function __construct()
 {
     parent::_initialize();
     $this->token = $this->_get('token');
     $this->wecha_id = $this->wecha_id;
     if (!$this->token) {
         $product_cart_model = M('product_cart');
         $out_trade_no = $this->_get('out_trade_no');
         $order = $product_cart_model->where(array('orderid' => $out_trade_no))->find();
         if (!$order) {
             $order = $product_cart_model->where(array('id' => intval($this->_get('out_trade_no'))))->find();
         }
         $this->token = $order['token'];
     }
     $payConfig = M('Alipay_config')->where(array('token' => $this->token))->find();
     $payConfigInfo = unserialize($payConfig['info']);
     $this->payConfig = $payConfigInfo['weixin'];
     if (ACTION_NAME == 'pay' || ACTION_NAME == 'new_pay') {
         if (empty($this->payConfig['is_old'])) {
             $this->new_pay();
             exit;
         } else {
             $this->pay();
             exit;
         }
     }
 }
 public function _initialize()
 {
     parent::_initialize();
     $this->token = $this->_get('token');
     $this->wecha_id = $this->_get('wecha_id');
     if (!$this->wecha_id) {
         $this->wecha_id = 'null';
     }
     $this->assign('token', $this->token);
     $this->assign('wecha_id', $this->wecha_id);
     $this->zuche_model = M('Zuche');
     $this->zuche_cat_model = M('Zuche_cat');
     //当前店铺
     $storeid = $this->_get('storeid', 'intval');
     $stores = M('Company')->where(array('token' => $this->token))->select();
     $this->assign('stores', $stores);
     if (!$storeid) {
         //$storeid=$stores[0]['id'];
         $store_logourl = M('company')->where(array('token' => $this->token, 'id' => $stores[0]['id']))->find();
     }
     //dump($store_logourl);exit;
     $store_info = M('company')->where(array('token' => $this->token, 'id' => $storeid))->find();
     $this->storeid = $storeid;
     $this->assign('storeid', $storeid);
     $this->assign('store_info', $store_info);
     $this->assign('store_logourl', $store_logourl);
     //是否开启第三方预定
     $yzucheconfig = M('Reply_info')->field('config')->where(array('token' => $this->token, 'infotype' => 'Zuche'))->find();
     $zucheconfig = unserialize($yzucheconfig['config']);
     if ($zucheconfig['iszuche'] == 1) {
         $this->assign('zucheurl', $zucheconfig['zucheurl']);
     }
     $this->zucheconfig = $zucheconfig;
 }
 protected function _initialize()
 {
     parent::_initialize();
     $this->id = I('get.id', 0, 'intval');
     $this->catid = I('get.catid', 0, 'intval');
     $this->userid = AppframeAction::$Cache['uid'];
     $this->groupid = AppframeAction::$Cache['User']['groupid'];
 }