Esempio n. 1
0
 public function post($f3)
 {
     // 权限检查
     $this->requirePrivilege('manage_plugin_plugin_configure');
     global $smarty;
     // 参数验证
     $validator = new Validator($f3->get('POST'));
     $qqauth_appid = $validator->required()->validate('qqauth_appid');
     $qqauth_appkey = $validator->required()->validate('qqauth_appkey');
     if (!$this->validate($validator)) {
         goto out_display;
     }
     // 保存设置
     QQAuthPlugin::saveOptionValue('qqauth_appid', $qqauth_appid);
     QQAuthPlugin::saveOptionValue('qqauth_appkey', $qqauth_appkey);
     $this->addFlashMessage('保存设置成功');
     out_display:
     $smarty->display('qqauth_configure.tpl', 'post');
 }
Esempio n. 2
0
 public function doUpdate($currentVersion)
 {
     // 简单的把版本设置为 1.0.0 就算完成升级了
     QQAuthPlugin::saveOptionValue('version', $this->targetVersion);
     return true;
 }