Esempio n. 1
0
	/**
	 * 模块安装
	 */
	public function install() {
		$this->module = $_POST['module'] ? $_POST['module'] : $_GET['module'];
		$module_api = pc_base::load_app_class('module_api');
		if (!$module_api->check($this->module)) showmessage($module_api->error_msg, 'blank');
		if ($_POST['dosubmit']) {
			if ($module_api->install()) showmessage(L('success_module_install').L('update_cache'), '?m=zl_admin&c=module&a=cache&pc_hash='.$_SESSION['pc_hash']);
			else showmesage($module_api->error_msg, HTTP_REFERER);
		} else {
			include PC_PATH.'modules'.DIRECTORY_SEPARATOR.$this->module.DIRECTORY_SEPARATOR.'install'.DIRECTORY_SEPARATOR.'config.inc.php';
			include $this->admin_tpl('module_config');
		}
	}
Esempio n. 2
0
         } else {
             $protect_info['mobile_send_time'] = $_SGLOBAL['timestamp'];
             $verifycode = rand(100000, 999999);
             $protect_info['mobile_code'] = $verifycode;
             $protect_info['mobile_1'] = $_GET['mobile'];
             $content = "您在i北航(i.buaa.edu.cn)的手机密保验证码为" . $verifycode . "请及时输入验证码完成手机密保设置!";
             if (sendsms($_GET['mobile'], '验证码', $content)) {
                 if ($first_time) {
                     $protect_info['uid'] = $_SGLOBAL['supe_uid'];
                     inserttable('protect_info', $protect_info);
                 } else {
                     updatetable('protect_info', $protect_info, array('uid' => $_SGLOBAL['supe_uid']));
                 }
                 showmessage("成功发送!", "cp.php?ac=protect&op=mobile");
             }
             showmesage('发送失败!', "cp.php?ac=protect&op=mobile");
         }
     }
 } elseif (submitcheck('submit_mobile')) {
     //验证密码
     if (!($passport = getpassport($_SGLOBAL['supe_username'], $_POST['password']))) {
         showmessage('密码错误!', 'cp.php?ac=protect&op=mobile');
     }
     //验证密保问题
     if ($_POST['question_mobile'] == NULL or $_POST['answer_mobile'] == NULL) {
         showmessage('密保问题或答案未填写!', 'cp.php?ac=protect&op=mobile');
     }
     if ($protect_info["answer{$_POST['question_mobile']}"] != $_POST['answer_mobile']) {
         showmessage('密保答案错误', 'cp.php?ac=protect&op=mobile');
     }
     if ($protect_info['mobile_1'] != $_POST['mobile_num']) {