public function __construct()
 {
     parent::__construct();
     $user = M('User')->getUserById($this->user_session['uid']);
     $user['last_ip'] = long2ip($user['last_ip']);
     $this->assign('user', $user);
 }
 public function __construct()
 {
     parent::__construct();
     if (empty($this->store_session)) {
         json_return(999, '会话超时,请刷新页面重试');
     }
 }
Exemple #3
0
 function __construct(&$app)
 {
     parent::__construct($app);
     if (@constant('WITHOUT_STRIP_HTML')) {
         $this->enable_strip_whitespace = false;
     }
     $this->app = $app;
     $this->_request = kernel::single('base_component_request');
     $this->_response = kernel::single('base_component_response');
     foreach (kernel::serviceList('site_controller_construct') as $service) {
         $service->prepare($this);
     }
     //构造时加载
     //finish modify controler-action html
     foreach (kernel::serviceList(sprintf('site_controller_content.%s.%s.%s', $this->_request->get_app_name(), $this->_request->get_ctl_name(), $this->_request->get_act_name())) as $class_name => $service) {
         if ($service instanceof site_interface_controller_content) {
             if (method_exists($service, 'modify')) {
                 $this->__finish_modifier[$class_name] = $service;
             }
             if (method_exists($service, 'boot')) {
                 $service->boot($this);
             }
         }
     }
 }
 public function __construct()
 {
     parent::__construct();
     if (!$this->user) {
         die("Members only. <a href='/users/login'>Please login</a>");
     }
 }
Exemple #5
0
 public function __construct($_vars)
 {
     parent::__construct();
     var_dump($_vars);
     var_dump($this->get_app_path());
     var_dump($this->get_base_url());
 }
 public function __construct()
 {
     parent::__construct();
     $this->contactModel = F::load_model('contact');
     $this->userModel = F::load_model('user');
     $this->tagModel = F::load_model('tag');
 }
Exemple #7
0
 public function __construct()
 {
     parent::__construct();
     if (empty($this->store_session)) {
         redirect(url('index:index'));
     }
 }
Exemple #8
0
 public function __construct()
 {
     parent::__construct();
     # Make sure user is logged in if they want to use anything in this controller
     if (!$this->user) {
         die("Members only. <a href='/users/login'>Login</a>");
     }
 }
Exemple #9
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model('system_model');
     $this->_compID = $this->session->userdata('compID');
     date_default_timezone_set("Asia/Manila");
     $this->_datetime = date('Y-m-d H:i:s');
 }
 /**
  * 构造函数
  *
  * @access public
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     $this->userModel = F::load_model('user');
     $this->tagModel = F::load_model('tag');
     $this->photoTool = F::loadClass('photo');
     $this->contactModel = F::load_model('contact', array());
 }
Exemple #11
0
 public function __construct($r = array())
 {
     $this->allowed_methods = array('views');
     if (lib::client_is_internal_host()) {
         $this->allowed_methods[] = 'views_demo';
     }
     parent::__construct($r);
 }
Exemple #12
0
 public function __construct()
 {
     parent::__construct();
     #Specific css is added to an array which already has one element from the parent constructor method.
     #$this->$client_files[] = "/css/users.css"; # doesn't work so I use the following array_push invocation instead
     #array_push($this->client_files, "/css/users.css"); # this works
     #$this->template->client_files = Utils::load_client_files($this->client_files);
 }
Exemple #13
0
 function __construct(&$app)
 {
     parent::__construct($app);
     $helper = kernel::single('base_view_helper');
     foreach (get_class_methods($helper) as $method) {
         $this->_compiler()->set_view_helper($method, 'base_view_helper');
     }
 }
Exemple #14
0
 public function __construct()
 {
     parent::__construct();
     # Make sure user is logged in if they want to use anything in this controller
     if (!$this->user) {
         #die("Members only. <a href='/users/login'>Login</a>");
         Router::redirect("/users/login/Please login first.");
     }
 }
 public function __construct()
 {
     parent::__construct();
     $this->syncModel = F::load_model('sync', array());
     #请求权限检查
     $this->params = $this->require_params(array('token'));
     if ($this->params['token'] != self::TOKEN) {
         throw new Exception('无效的授权信息', 100);
     }
 }
Exemple #16
0
 public function __construct()
 {
     parent::__construct();
     if (empty($_SESSION['user'])) {
         exit('非法访问!');
     }
     $this->apiUrl = option('config.syn_domain') ? rtrim(option('config.syn_domain'), '/') . '/' : 'http://demo.pigcms.cn/';
     $this->SALT = option('config.encryption') ? option('config.encryption') : 'pigcms';
     $this->token = $this->getToken($_SESSION['store']['store_id']);
 }
 public function __construct()
 {
     parent::__construct();
     $cate_id = $_GET['id'];
     if (!$cate_id) {
         pigcms_tips('非法访问!', 'none');
     }
     $this->cate_id = $cate_id;
     $this->assign('cid', $cate_id);
 }
Exemple #18
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model('system_model');
     $this->load->library('form_validation');
     $this->_urlDB = $this->system_model->getSpecific('lg_externalurl', 'lg_extURL', '');
     $this->_sqlSent = $this->system_model->get_all_join();
     $this->_sqlFailed = $this->system_model->get_all_query('SELECT * FROM send_sms WHERE response_statusCode <> 20 ORDER BY sms_id DESC');
     $this->_sqlreceived = $this->system_model->get_all_query('SELECT * FROM receivesms a JOIN queue_sms_inquiry b ON a.rcv_id = b.rcv_id ORDER BY a.rcv_id DESC');
 }
Exemple #19
0
 public function __construct()
 {
     parent::__construct();
     $id = $_GET['id'] + 0;
     if (empty($id)) {
         pigcms_tips('非法访问!', 'none');
     }
     $this->id = $id;
     $this->assign('id', $id);
 }
Exemple #20
0
 public function __construct(&$app)
 {
     parent::__construct($app);
     if (@constant('WITHOUT_STRIP_HTML')) {
         $this->enable_strip_whitespace = false;
     }
     $this->app = $app;
     $this->_request = vmc::singleton('base_component_request');
     $this->_response = vmc::singleton('base_component_response');
 }
Exemple #21
0
 public function __construct()
 {
     parent::__construct();
     if (empty($_SESSION['user'])) {
         exit('非法访问!');
     }
     $this->apiUrl = option('config.syn_domain');
     if (empty($this->apiUrl)) {
         exit('你还没有配置');
     }
     $this->SALT = option('config.encryption') ? option('config.encryption') : 'pigcms';
 }
Exemple #22
0
 public function __construct()
 {
     parent::__construct();
     #Specific css is added to an array which already has one element from the parent constructor method.
     array_push($this->client_files, "/css/posts.css");
     # this works
     $this->template->client_files = Utils::load_client_files($this->client_files);
     # Make sure user is logged in if they want to use anything in this controller
     if (!$this->user) {
         Router::redirect('/users/signupOrLogin/');
     }
 }
Exemple #23
0
 public function __construct()
 {
     parent::__construct();
     # Make sure user is logged in if they want to use anything in this controller
     if (!$this->user) {
         # Send them to login or signup
         Router::redirect("/users/signupOrLogin/");
     }
     array_push($this->client_files, "/css/requests.css");
     array_push($this->client_files, "/js/requests.js");
     array_push($this->client_files, "ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js");
     $this->template->client_files = Utils::load_client_files($this->client_files);
 }
Exemple #24
0
 function __construct(&$app)
 {
     parent::__construct($app);
     if (@constant('WITHOUT_STRIP_HTML')) {
         $this->enable_strip_whitespace = false;
     }
     $this->app = $app;
     $this->_request = kernel::single('base_component_request');
     $this->_response = kernel::single('base_component_response');
     $this->weixin_share_page = kernel::single('weixin_wechat')->get_weixin_share_page();
     $this->weixin_a_appid = kernel::single('weixin_wechat')->get_a_appid();
     $this->from_weixin = kernel::single('weixin_wechat')->from_weixin();
 }
Exemple #25
0
 function __construct(&$app)
 {
     parent::__construct($app);
     if (@constant('WITHOUT_STRIP_HTML')) {
         $this->enable_strip_whitespace = false;
     }
     $this->pagedata['CART_NUMBER'] = $_COOKIE['S']['CART_NUMBER'];
     $this->app = $app;
     $this->_request = kernel::single('base_component_request');
     $this->_response = kernel::single('base_component_response');
     $this->weixin_share_page = kernel::single('weixin_wechat')->get_weixin_share_page();
     $this->weixin_a_appid = kernel::single('weixin_wechat')->get_a_appid();
     $this->from_weixin = kernel::single('weixin_wechat')->from_weixin();
     kernel::single('base_session')->start();
     if ($this->from_weixin) {
         if (!empty($_GET['signature']) && !empty($_GET['openid'])) {
             $bind = app::get('weixin')->model('bind')->getRow('id', array('eid' => $_GET['u_eid'], 'status' => 'active'));
             $flag = kernel::single('weixin_object')->check_wechat_sign($_GET['signature'], $_GET['openid']);
             if ($flag && !empty($bind)) {
                 $openid = $_GET['openid'];
             }
         } elseif (!empty($_GET['code']) && !empty($_GET['state'])) {
             $bind = app::get('weixin')->model('bind')->getRow('id', array('eid' => $_GET['state'], 'status' => 'active'));
             if (!empty($bind) && kernel::single('weixin_wechat')->get_oauth2_accesstoken($bind['id'], $_GET['code'], $result)) {
                 $openid = $result['openid'];
                 $this->accesstoken_oauth2 = $result['access_token'];
             }
         }
         //区分是否活动
         if ($openid) {
             $this->openid = $openid;
         }
         //no_reg 表示使用微信接口,但不注册用户
         if ($openid && empty($_GET['no_reg'])) {
             $sendData = array('bind_id' => $bind['id']);
             //一键登陆
             $pam_members_model = app::get('pam')->model('members');
             $flag = $pam_members_model->getList('*', array('login_account' => trim($openid)));
             $userData = array('login_account' => $openid, 'login_password' => $flag[0]['login_password']);
             $this->weixinObject = kernel::single('weixin_object');
             $this->userObject = kernel::single('b2c_user_object');
             $member_id = $this->logindide($userData, '', $msg);
             $this->userObject->set_member_session($member_id);
             //是否自动注册
             if ($flag[0]['member_id'] == '' && !WX_AOUTH_AUTO_REG) {
                 kernel::single('weixin_wechat')->subscribe($sendData, 1, $openid);
                 return true;
             }
         }
     }
 }
Exemple #26
0
 public function __construct(&$app)
 {
     parent::__construct($app);
     if (@constant('WITHOUT_STRIP_HTML')) {
         $this->enable_strip_whitespace = false;
     }
     $this->app = $app;
     $this->_request = vmc::singleton('base_component_request');
     $this->_response = vmc::singleton('base_component_response');
     foreach (vmc::servicelist('site.controller.construct') as $object) {
         if (method_exists($object, 'exec')) {
             $object->exec($this->_request);
         }
     }
 }
Exemple #27
0
 public function __construct()
 {
     parent::__construct();
     # authenticate the user - if we don't have a user object, do not allow access to any of these pages
     if (!$this->user) {
         $this->template->content = View::instance('v_users_login');
         $this->template->title = "Members Only";
         $client_files = array("/views/css/main.css", "/views/js/modernizr-2.6.1.min.js");
         $this->template->client_files = Utils::load_client_files($client_files);
         $this->template->content->error_title = "Members Only";
         $_SESSION['users']['errors'][] = "Please use the login form at the top of the page.";
         echo $this->template;
         die;
     }
 }
Exemple #28
0
 function __construct($app)
 {
     $this->defaultwg = $this->defaultWorkground;
     parent::__construct($app);
     kernel::single('base_session')->start();
     $auth = pam_auth::instance(pam_account::get_account_type('desktop'));
     $account = $auth->account();
     if (get_class($this) != 'desktop_ctl_passport' && !$account->is_valid()) {
         $url = $this->app->router()->gen_url(array(), 1);
         $url = base64_encode($url);
         echo "<script>top.location='index.php?ctl=passport&url=" . $url . "'</script>";
         exit;
     }
     $this->user = kernel::single('desktop_user');
     if ($_GET['ctl'] != "passport" && $_GET['ctl'] != "") {
         $this->status = $this->user->get_status();
         if (!$this->status && $this->status == 0) {
             #echo "未启用";exit;
             //echo "<script>alert('管理员未启用')</script>";
             echo "<script>window.location='index.php?ctl=passport&act=logout'</script>";
             exit;
         }
     }
     ###如果不是超级管理员就查询操作权限
     if (!$this->user->is_super()) {
         if (!$this->user->chkground($this->workground)) {
             echo "您无权操作";
             exit;
         }
     }
     $this->_finish_modifier = array();
     foreach (kernel::servicelist(sprintf('desktop_controller_content.%s.%s.%s', $_GET['app'], $_GET['ctl'], $_GET['act'])) as $class_name => $service) {
         if ($service instanceof desktop_interface_controller_content) {
             if (method_exists($service, 'modify')) {
                 $this->_finish_modifier[$class_name] = $service;
             }
             if (method_exists($service, 'boot')) {
                 $service->boot($this);
             }
         }
     }
     if ($this->_finish_modifier) {
         ob_start();
         register_shutdown_function(array(&$this, 'finish_modifier'));
     }
     $this->url = 'index.php?app=' . $this->app->app_id . '&ctl=' . $_GET['ctl'];
 }
Exemple #29
0
 public function __construct()
 {
     parent::__construct();
     $bind = D('Weixin_bind')->where(array('store_id' => $this->store_session['store_id']))->find();
     if (!in_array(ACTION_NAME, array('auth', 'get_url', 'auth_back')) && empty($bind)) {
         header('Location:' . $this->config['site_url'] . '/user.php?c=weixin&a=auth');
         exit;
     } elseif (ACTION_NAME == 'auth' && $bind) {
         header('Location:' . $this->config['site_url'] . '/user.php?c=weixin&a=index');
         exit;
     }
     $this->weixin_bind_info = $bind;
     $this->assign('weixin_bind_info', $this->weixin_bind_info);
     for ($i = 1; $i < 106; $i++) {
         $this->face_image[$i] = '<img src="/static/images/qq/' . $i . '.gif" />';
     }
 }
Exemple #30
0
 public function __construct()
 {
     parent::__construct();
     # Make sure user is logged in if they want to use anything in this controller
     if (!$this->user) {
         # Send them to login or signup
         Router::redirect("/users/signupOrLogin/");
     }
     #Specific css is added to an array which already has one element from the parent constructor method.
     #$this->$client_files[] = "/css/users.css"; # doesn't work so I use the following array_push invocation instead
     array_push($this->client_files, "/css/peptide.css");
     # this works
     array_push($this->client_files, "//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js");
     array_push($this->client_files, "//ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js");
     array_push($this->client_files, "http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css");
     array_push($this->client_files, "/js/peptide.js");
     $this->template->client_files = Utils::load_client_files($this->client_files);
 }