function __construct() { CORE::$bgend = true; CORE::summon(__FILE__); self::$func = $func = array_shift(CORE::$args); self::$temp = CORE::$cfg["temp"]['admin']; self::$temp_option = CORE::$cfg["temp"]['admin_option']; self::$lang = (include CORE::$path . 'lang/lang-cht.php'); CORE::res_init('ogs_admin', 'font', 'fix', 'css'); CORE::res_init('default', 'js'); # 預定使用功能 $function = array('system' => false, 'manager' => true, 'ad' => true, 'intro' => true, 'faq' => true, 'news' => true, 'products' => true, 'order' => false, 'member' => true, 'contact' => true, 'sk' => false, 'blog' => true, 'feedback' => true, 'gallery' => true, 'rewrite' => true); MANAGER::ban_check(); MANAGER::class_handle($function); if (isset($function[$func])) { $func_name = strtoupper($func); new $func_name($function[$func]); } else { self::$temp["MAIN"] = self::$temp_option["INDEX"]; } MANAGER::check(); # 登入檢查 MANAGER::level_check($func); # 權限檢查 self::language_select(); if (!CORE::$mobile) { VIEW::assignGlobal('TAG_PC', 'pc'); } if (!CHECK::is_ajax()) { new VIEW(self::$temp_option["HULL"], self::$temp, false, 1); } }
function __construct($end_switch = false) { CORE::summon(__FILE__); if ($end_switch) { self::$endClass = __CLASS__ . "_BACKEND"; } else { self::$endClass = __CLASS__ . "_FRONTEND"; } new self::$endClass(); }
function __construct() { $smtp = CORE::$cfg['smtp']; CORE::summon(__FILE__); self::$call = new PHPMailer(); self::$call->IsSMTP(); self::$call->SMTPAuth = true; self::$call->SMTPSecure = "ssl"; # 設定 SSL 連線 self::$call->Host = $smtp['host']; # 主機位置 self::$call->Port = $smtp['port']; # Gmail 是 465 # 信件內容的編碼方式 self::$call->CharSet = "utf-8"; # 信件處理的編碼方式 self::$call->Encoding = "base64"; # SMTP 驗證的使用者資訊 self::$call->Username = $smtp['account']; # mail 帳號 self::$call->Password = $smtp['pass']; # mail 密碼 }
<?php CORE::summon(__FILE__);
function __construct() { self::$origin_args = CORE::$args; $func = array_shift(CORE::$args); CORE::summon(__FILE__); self::$endClass = __CLASS__ . "_BACKEND"; new self::$endClass(); switch ($func) { case "verify": # 開通管理員帳號 self::$temp["NAV"] = ''; self::$temp["MAIN"] = self::$temp_option["MSG"]; self::verify(); new VIEW(self::$temp_option["HULL"], self::$temp, false, 1); break; case "login": # 管理員登入頁 self::$temp["NAV"] = ''; self::$temp["MAIN"] = 'ogs-admin-manager-login-tpl.html'; self::autologin(); new VIEW(self::$temp_option["HULL"], self::$temp, false, 1); break; case "login-act": self::$temp["NAV"] = ''; self::$temp["MAIN"] = self::$temp_option["MSG"]; self::login(); new VIEW(self::$temp_option["HULL"], self::$temp, false, 1); break; case "regist": self::$temp["NAV"] = ''; self::$temp["MAIN"] = 'ogs-admin-manager-regist-tpl.html'; new VIEW(self::$temp_option["HULL"], self::$temp, false, 1); break; case "regist-act": self::$temp["NAV"] = ''; self::$temp["MAIN"] = self::$temp_option["MSG"]; self::regist(); new VIEW(self::$temp_option["HULL"], self::$temp, false, 1); break; case "forget": session_destroy(); self::$temp["NAV"] = ''; self::$temp["MAIN"] = 'ogs-admin-manager-forget-tpl.html'; new VIEW(self::$temp_option["HULL"], self::$temp, false, 1); break; case "forget-act": session_destroy(); self::$temp["NAV"] = ''; self::$temp["MAIN"] = self::$temp_option["MSG"]; self::forget(); new VIEW(self::$temp_option["HULL"], self::$temp, false, 1); break; case "logout": session_destroy(); self::$temp["NAV"] = ''; self::$temp["MAIN"] = self::$temp_option["MSG"]; CORE::msg(self::$lang["logout_done"], CORE::$manage); new VIEW(self::$temp_option["HULL"], self::$temp, false, 1); break; } }
function __construct() { CORE::summon(__FILE__); self::$endClass = __CLASS__ . "_BACKEND"; new self::$endClass(); }