Пример #1
0
 public function ipblock_delete()
 {
     if ($this->inGroup(43, true)) {
         require dirname(__FILE__) . '/resources/ipblock.action.php';
         $ipblock = new IpblockAction($this->parent);
         return $ipblock->delete();
     } else {
         return new ActionResult($this, '/admin/core/ipblock_view', 0, 'You are not allowed to do that', B_T_FAIL);
     }
 }
Пример #2
0
 function _initialize()
 {
     header("Content-Type:text/html; charset=utf-8");
     L('_OPERATION_SUCCESS_', "Operation Success");
     L('_OPERATION_FAIL_', 'Operation Fail');
     //是否关闭网站
     if (GetValue('close_site') == 1) {
         header("HTTP/1.1 500 Internal Server Error");
         header("Status: 500 Internal Server Error");
         die('<div style="margin: 10px; text-align: center; font-size: 14px"><p>The temporary closure of this site, you can not access!</p><p>' . GetValue('close_site_content') . '</p></div>');
     }
     //IP封锁
     if (isset($_COOKIE['ipblock']) && $_COOKIE['ipblock'] == 0) {
     } elseif (isset($_COOKIE['ipblock']) && $_COOKIE["ipblock"] == 1 || GetValue('ipblock') == 1 && GetValue('ipblock_pwd') != '') {
         import('@.Action.Home.IpblockAction');
         $ipblock = new IpblockAction();
         $ipblock->index();
     }
     $this->ProModel = D('Products');
     //多主题
     if ($this->theme = GetValue('theme')) {
         setcookie('think_template', $this->theme, time() + 3600, '/');
     } else {
         setcookie('think_template', 'default', time() + 3600, '/');
     }
     //多语言
     /*$lang=GetValue('lang');
     		if('auto'!=$lang){
     		setcookie('think_language',$lang?$lang:'en-us',time()+3600,'/');
     		}*/
     //浏览历史
     $this->product_history = product_history();
     //货币初始化
     $this->currencies = $currencies = get_currencies_arr();
     if (!isset($_SESSION['currency'])) {
         for ($row = 0; $row < count($currencies); $row++) {
             if ($currencies[$row]['symbol'] == C('DEFAULT_CURRENCIES_SYMBOL')) {
                 $_SESSION['currency'] = $currencies[$row];
             }
         }
     }
     //生产一个唯一的session id
     $this->sessionID = Cookie::get('sessionID');
     if (!$this->sessionID) {
         $this->sessionID = create_session_id();
         Cookie::set('sessionID', $this->sessionID);
     }
     //读取用户id
     $auth_cookie = Cookie::get('auth');
     if (empty($auth_cookie)) {
         $this->memberID = 0;
     } else {
         $auth = daddslashes(explode("\t", authcode($auth_cookie, 'DECODE', C('AUTHKEY'))));
         list($member_id, $member_email) = empty($auth) || count($auth) < 2 ? array('', '') : $auth;
         if (!empty($member_id)) {
             $this->memberID = $member_id;
         }
     }
     Cookie::set('memberID', $this->memberID);
     if ($this->memberID) {
         //读取用户信息
         $this->mid = $this->memberID;
         self::$Model = D("Members");
         $this->memberInfo = self::$Model->where("id=" . $this->memberID)->find();
         $this->member_Info = $this->memberInfo;
         self::$Model = D("Shippingaddress");
         $this->memberShippingAddress = self::$Model->where("id=" . $this->memberID)->find();
         Cookie::set('memberShippingAddress', $this->memberShippingAddress);
         $this->member_ShippingAddress = $this->memberShippingAddress;
         /*$this->_365call="
         		<script type=\"text/javascript\">
         		//<![CDATA[
         		var _365call_memberID  = \"{$this->memberInfo['email']}\"; //  char(20)  账号(会员号)
         		var _365call_clientName= \"{$this->memberInfo['firstname']}{$this->memberInfo['lastname']}\"; //  char(50)  用户名(姓名)
         		var _365call_email     = \"{$this->memberInfo['email']}\"; //  char(50)  邮件地址
         		var _365call_phone     = \"{$this->memberShippingAddress['telphone']}\"; //  char(20)  联系电话
         		var _365call_msn       = \"\"; //  char(50)  MSN
         		var _365call_qq        = \"\"; //  char(20)  QQ
         		var _365call_note      = \"{$this->memberShippingAddress['address']}\"; //  char(100) 其他
         		//]]>
         		</script>";*/
     }
     //当前月份
     $today = getdate();
     $this->month = $today['month'];
     //总重量
     self::$Model = D("Cart");
     $this->Total_weight = self::$Model->cart_total_weight($this->sessionID);
     //购物车商品
     $this->cart_list = self::$Model->cart_list($this->sessionID);
     $this->item_count = itemCount();
     $this->total_count = TotalCount();
     //会员等级
     $this->memberGropuInfo = get_members_group($this->memberID);
     if (get_members_group($this->memberID)) {
         $this->isVip = 1;
     } else {
         $this->isVip = 0;
     }
     /**
      * bof缓存模板变量
      */
     //全局模板变量
     if (F('Common_Cache') == '') {
         F('Common_Cache', $this->_Common_Cache());
     }
     $this->assign(F('Common_Cache'));
     //产品缓存
     if (F('Products_Cache') == '') {
         F('Products_Cache', $this->_Products_Cache());
     }
     //打乱随机显示
     $Products_Cache = F('Products_Cache');
     //$Products_Cache['FeaturedProducts']=$this->ProModel->rand($Products_Cache['FeaturedProducts']);
     //$Products_Cache['HotProducts']=$this->ProModel->rand($Products_Cache['HotProducts']);
     //$Products_Cache['NewProducts']=$this->ProModel->rand($Products_Cache['NewProducts']);
     //$Products_Cache['SpeProducts']=$this->ProModel->rand($Products_Cache['SpeProducts']);
     $this->assign($Products_Cache);
     /**
      * eof缓存模板变量
      */
 }