/** * 构造方法-初始化数据 */ public function __construct() { parent::__construct(); $this->_model = loadModel('Index'); $this->_admin_model = loadModel('Admin.Admin'); $this->_config = array('verify_error' => '验证码错误', 'userNull' => '用户信息不能为空', 'userError' => '用户名密码错误'); $this->_username = $this->getParam("username"); $this->_password = $this->getParam("password"); $this->_verify = $this->getParam("verify"); $this->_p = $this->getParam('p') ? intval($this->getParam('p')) : 0; $this->_openid = $this->getParam("openid"); $this->_memberEdit = $this->getParam("memberEdit"); $this->_member = $this->getParam("member"); $this->_cardid = $this->getParam("cardid"); //获取card id $this->_card_id = $this->getParam('card_id'); if (!$this->_card_id) { $id = $this->getParam('id') ? intval($this->getParam('id')) : 1; $this->_card_id = $this->_model->getCardId($id); } //验证是否登录用户 if ((!isset($_COOKIE['huishi_admin_uid']) || !$_COOKIE['huishi_admin_uid']) && ($this->getParam("m") != 'login') && ($this->getParam("m") != 'index') && ($this->getParam("m") != 'verify')) { header('location:' . url('index', 'index', array(), 'admin.php')); exit(); } }
/** * 构造函数 */ public function __construct() { parent::__construct(); $this->_model = loadModel('Index'); $this->_ModelCom = loadModel('Common'); $this->_admin_model = loadModel('Admin.Admin'); $this->_openid = isset($_COOKIE['huishi_openid']) ? $_COOKIE['huishi_openid'] : $this->getParam("openid"); $this->_card_id = $this->getParam("card_id"); $this->_token = $this->_ModelCom->getAccessToken(); //获取openid if (!$this->_openid && empty($_COOKIE['huishi_openid'])) { $nowUrl = url('Index', 'index', array(), 'index.php'); $url = "http://call.socialjia.com/Wxapp/weixin_common/oauth2.0/link.php?entid=" . C('ENT_ID') . "&url=" . urlencode($nowUrl); header("location:$url"); exit(); } //获取card id if (!$this->_card_id) { //默认获取第一个card_id $id = $this->getParam('id') ? intval($this->getParam('id')) : 1; $this->_card_id = $this->_model->getCardId($id); } //保存openid到数据库 if ($this->_openid) { $this->_user_id = $this->_model->saveOpenid($this->_openid, $this->_card_id); } if ($this->_openid && !isset($_COOKIE['huishi_openid'])) { setcookie("huishi_openid", $this->_openid, time() + 86400); $_COOKIE['huishi_openid'] = $this->_openid; } $this->assign('title', '惠氏健康生活馆会员卡'); }
public function __construct() { parent::__construct(); $path = C('PROJECT.SITE_PATH') . '/' . $_GET['site'] . '/' . C('PROJECT.SRC_DIR') . '/' . $_GET['module'] . '/' . C('M3D_FILENAME'); // $path = '/home/music/javey/music_1-0-165-34_BRANCH/m3d.php'; $this->tool = new InstantmergeTool($path); }
public function __construct() { parent::__construct(); $this->page = M('page'); //实例化一个数据模型 $this->article = M('article'); }
public function __construct($data = '') { $this->param = $data; $this->setServerId($this->param['from_server_id']); $this->player_id = $this->param['from_player_id']; parent::__construct(); }
public function __construct() { parent::__construct(); $this->_manage = new ManageModel(); $this->_goods = new GoodsModel(); $this->_order = new OrderModel(); }
/** * @param Grido\Grid $grid * @param string $name * @param string $label * @param callback $onClick */ public function __construct($grid, $name, $label, $onClick = NULL) { parent::__construct($grid, $name, $label); if ($onClick !== NULL) { $this->onClick[] = $onClick; } }
/** * Initializes a new instance of a AMQP action to report */ public function __construct($method, $target, $routingKey = '') { parent::__construct(); $this->method = $method; $this->target = $target; $this->routingKey = $routingKey; }
function __construct() { parent::__construct(); // if(MODULE_NAME != 'Index') $this->iM = D(MODULE_NAME); $this->quoteRequestData(); $this->assignGlobalData(); }
public function __construct() { parent::__construct(); $this->goods = new GoodsModel(); $this->rotator = new RotatorModel(); $this->user = new UserModel(); }
public function __construct() { parent::__construct(); $this->_aBaseOptions = (require CONF_PATH . 'dataConfig.inc.php'); $this->para = $_REQUEST; if (empty($_SESSION['app_index'])) { $_SESSION['app_index'] = (array) C('APP_INFO'); } $this->oApp = $_SESSION['app_index']; $uid = D('Session')->check(); if ($uid) { $user = D('User')->where(array('id' => $uid))->find(); $_SESSION['user'] = $user; $this->oUser = $user; #用户名 $this->assign('user', $this->oUser); #未读私信数 $this->assign('letterCount', D('Letter')->where(array('recipient' => $uid, 'isread' => 0))->count()); $collect['case'] = D('collect')->where(array('uid' => $this->oUser['id'], 'type' => 1))->select(); $collect['house'] = D('collect')->where(array('uid' => $this->oUser['id'], 'type' => 2))->select(); $collect['active'] = D('collect')->where(array('uid' => $this->oUser['id'], 'type' => 3))->select(); $_SESSION['collect'] = $collect; $this->oCollect = $collect; } else { unset($_SESSION['user']); $this->oUser = array(); } $this->assign('hot_designer', D('User_designer')->getHotDesigner()); $this->assign('hot_case', D('Case')->getHotCase()); }
public function __construct() { parent::__construct(); $this->article = M("article"); $this->note = M("guestbook"); $this->product = M("product"); }
public function __construct($tpl) { //构造方法 初始化 global $templates; parent::__construct($tpl); //初始化父类 }
public function __construct() { parent::__construct(); global $mobile_cfg; if ($mobile_cfg == null) { $mobile_cfg = (require_once APP_ROOT_PATH . "system/mobile_cfg/" . APP_TYPE . "/webnav_cfg.php"); } check_install(); //重新处理后台的语言加载机制,后台语言环境配置于后台config.php文件 $langSet = conf('DEFAULT_LANG'); // 定义当前语言 define('LANG_SET', strtolower($langSet)); // 读取项目公共语言包 if (is_file(LANG_PATH . $langSet . '/common.php')) { L(include LANG_PATH . $langSet . '/common.php'); $this->lang_pack = (require LANG_PATH . $langSet . '/common.php'); if (!file_exists(APP_ROOT_PATH . "public/runtime/admin/lang.js")) { $str = "var LANG = {"; foreach ($this->lang_pack as $k => $lang) { $str .= "\"" . $k . "\":\"" . $lang . "\","; } $str = substr($str, 0, -1); $str .= "};"; file_put_contents(APP_ROOT_PATH . "public/runtime/admin/lang.js", $str); } } es_session::close(); }
public function __construct() { parent::__construct(); $this->product = M('product'); import('ORG.Util.Page'); //分页 }
public function __construct() { parent::__construct(); check_install(); //重新处理后台的语言加载机制,后台语言环境配置于后台config.php文件 $langSet = conf('DEFAULT_LANG'); // 定义当前语言 define('LANG_SET', strtolower($langSet)); // 读取项目公共语言包 if (is_file(LANG_PATH . $langSet . '/common.php')) { L(include LANG_PATH . $langSet . '/common.php'); $this->lang_pack = (require LANG_PATH . $langSet . '/common.php'); if (is_file(LANG_PATH . $langSet . '/weixin.php')) { L(include LANG_PATH . $langSet . '/weixin.php'); $weixin_lang = (require LANG_PATH . $langSet . '/weixin.php'); $this->lang_pack = array_merge($this->lang_pack, $weixin_lang); } if (!file_exists(APP_ROOT_PATH . "public/runtime/admin/lang.js")) { $str = "var LANG = {"; foreach ($this->lang_pack as $k => $lang) { $str .= "\"" . $k . "\":\"" . $lang . "\","; } $str = substr($str, 0, -1); $str .= "};"; file_put_contents(APP_ROOT_PATH . "public/runtime/admin/lang.js", $str); } } }
public function __construct() { parent::__construct(); $this->nav = new NavModel(); $this->goods = new GoodsModel(); $this->cart = new cart(); }
function __construct() { parent::__construct(); if (!isLogin()) { redirect(__APP__ . '/User/login/'); } }
function __construct() { parent::__construct(); if (!CheckTaskSwitch()) { $this->error('该页面不存在!'); } }
public function __construct() { parent::__construct(); //加载项目信息 if (empty($_SESSION['app'])) { $_SESSION['app'] = (object) C('APP_INFO'); $this->oApp = $data; } else { $this->oApp = $_SESSION['app']; } //加载用户数据 $uid = D('Session')->check(); if ($uid) { $oUser = D('User')->getObjectById($uid); if (empty($oUser)) { $this->error('调试信息:请检查用户表数据!'); } //session有效,赋值oUser $this->oUser = $oUser; } //对免验证模块,不进行登录验证。 if (in_array(ACTION_NAME, $this->aVerify)) { if (!$this->isLogin()) { redirect(C('TMPL_PARSE_STRING.__HOST__') . '/login.php'); } } }
/** * Constructor. * * @access public */ public function __construct() { parent::__construct(); // Setup Search Engine Connection $this->db = ConnectionManager::connectToIndex(); $_SESSION['no_store'] = true; }
public function __construct() { import("ORG.Io.Dir"); parent::__construct(); $this->rebuile(); $this->install_lock = $this->getRealPath() . "public/install.lock"; }
public function __construct($tpl) { //构造方法 初始化 global $templates; parent::__construct($tpl, new LevelModel()); //初始化父类,定义了ManageModel 的对象$model }
public function __construct() { C('TMPL_ACTION_ERROR', 'Public:success'); // 默认错误跳转对应的模板文件 C('TMPL_ACTION_SUCCESS', 'Public:success'); // 默认成功跳转对应的模板文件 parent::__construct(); }
public function __construct() { parent::__construct(); $this->pM = D('Picture'); // 加载上传和缩略图处理类 import('SwfUpload', __ROOT__ . 'include/Lib/'); import('Thumbnail', __ROOT__ . 'include/Lib/'); }
public function __construct() { parent::__construct(); $this->_nav = new NavModel(); $this->_brand = new BrandModel(); $this->_attr = new AttrModel(); $this->_service = new ServiceModel(); }
/** * Class constructor. * * @param array $options Element options * @param array $attr HTML attributes */ public function __construct(array $options = [], array $attr = []) { if (isset($options['url'])) { $attr['href'] = $options['url']; } unset($options['url']); parent::__construct($options, $attr); }
public function __construct() { parent::__construct(); if (empty($_SESSION['username']) || empty($_SESSION['timestamp']) || empty($_SESSION['secret'])) { $_SESSION['backUrl'] = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $this->display('Login:Login'); exit; } }
public function __construct() { parent::__construct(); $this->_nav = new NavModel(); $this->_goods = new GoodsModel(); $this->_attr = new AttrModel(); $this->_commend = new CommendModel(); $this->_record = new RecordModel(); }
public function __construct() { parent::__construct(); $this->install_lock = $this->getRealPath() . "/public/install.lock"; if (file_exists($this->install_lock)) { $this->assign("jumpUrl", __ROOT__ . "/m.php"); $this->error("系统已经安装"); } }