论坛风格切换
  • 3117阅读
  • 0回复

查看网站是否正常开放用户访问 [复制链接]

上一主题 下一主题
ben
 

发帖
119
大洋
5222
贡献值
91
只看楼主 正序阅读 使用道具 楼主  发表于: 2011-08-17

  zen_run_normal() 
该函数检测网店是正常的开放访问还是有其他的设置。如果是正常的就返回true,否则返回false; 
函数源代码: 

  1. [color=#000000]function zen_run_normal() {[/color]
  2.     $zc_run = false;
  3.     switch (true) {
  4.       case (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])):
  5.       // down for maintenance not for ADMIN
  6.         $zc_run = true;
  7.         break;
  8.       case (DOWN_FOR_MAINTENANCE == 'true'):
  9.       // down for maintenance
  10.         $zc_run = false;
  11.         break;
  12.       case (STORE_STATUS >= 1):
  13.       // showcase no prices
  14.         $zc_run = false;
  15.         break;
  16.       case (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == ''):
  17.       // customer must be logged in to browse
  18.         $zc_run = false;
  19.         break;
  20.       case (CUSTOMERS_APPROVAL == '2' and $_SESSION['customer_id'] == ''):
  21.       // show room only
  22.       // customer may browse but no prices
  23.         $zc_run = false;
  24.         break;
  25.       case (CUSTOMERS_APPROVAL == '3'):
  26.       // show room only
  27.         $zc_run = false;
  28.         break;
  29.       case (CUSTOMERS_APPROVAL_AUTHORIZATION != '0' and $_SESSION['customer_id'] == ''):
  30.       // customer must be logged in to browse
  31.         $zc_run = false;
  32.         break;
  33.       case (CUSTOMERS_APPROVAL_AUTHORIZATION != '0' and $_SESSION['customers_authorization'] > '0'):
  34.       // customer must be logged in to browse
  35.         $zc_run = false;
  36.         break;
  37.       default:
  38.       // proceed normally
  39.         $zc_run = true;
  40.         break;
  41.     }
  42.     return $zc_run;
  43.   }

欢迎来到zen-cart论坛,这里将是你迈进zen-cart世界的起点
有问题到求助版块提问。
快速回复
限80 字节
批量上传需要先选择文件,再选择上传(---删除纯表情和无意义内容,扣1分---)
 
上一个 下一个