Ejemplo n.º 1
0
 private function showLoginForm($signMsg = '', array $signErrArr = array())
 {
     $urlHandler = $this->getApp()->getUrlHandler();
     $doLoginUrl = $urlHandler->createUrl('web/SignIn', 'do', array());
     $resetPassUrl = $urlHandler->createUrl('web/Forgot', 'index', array());
     $captchaUrl = $urlHandler->createUrl('web/Captcha', 'index', array());
     $captchaUrlT = $urlHandler->createUrl('web/Captcha', '--rand--', array(), false);
     if (!empty($_POST['url'])) {
         $url = $_POST['url'];
     } elseif (!empty($_SERVER['HTTP_REFERER'])) {
         $url = $_SERVER['HTTP_REFERER'];
     } else {
         $url = '';
     }
     if (!empty($_POST['username'])) {
         $username = $_POST['username'];
     } else {
         $username = '';
     }
     $siteInfoM = new SiteModel($this);
     $siteInfo = $siteInfoM->getSiteInfo(array('sitename'));
     $title = $siteInfo['sitename'] . ' › 登录';
     Templatel::tplStart();
     include Templatel::view('/login.html');
     Templatel::tplEnd();
 }
Ejemplo n.º 2
0
 public function indexAction()
 {
     $this->forceInstall();
     $session = new USession($this);
     $uid = $session->getUid();
     $urlHandler = $this->getApp()->getUrlHandler();
     if ($uid == 0) {
         $signInUrl = $urlHandler->createUrl('web/SignIn', 'index', array());
         header('Location: ' . $signInUrl);
         return;
     }
     $user = new UserModel($this);
     $uid = $session->getUid();
     $rand = $session->createNewSid();
     $session->getSessionData()->set('rand', $rand);
     $userInfo = $user->getUidInfo($uid, array('username', 'nickname', 'user_img', 'regtime'));
     $isAdmin = $user->isSuperAdmin($uid);
     $session = null;
     $siteInfoM = new SiteModel($this);
     $siteInfo = $siteInfoM->getSiteInfo(array('sitename'));
     $title = $siteInfo['sitename'] . ' › ' . $userInfo['nickname'];
     Templatel::tplStart();
     include Templatel::view('/userindex.html');
     Templatel::tplEnd();
 }
Ejemplo n.º 3
0
 /**
  * 后台管理中心首页
  *
  * @return void
  */
 public function indexAction()
 {
     $this->forceInstall();
     $session = new USession($this);
     $uid = $session->getUid();
     $urlHandler = $this->getApp()->getUrlHandler();
     if ($uid == 0) {
         $signInUrl = $urlHandler->createUrl('web/SignIn', 'index', array());
         header('Location: ' . $signInUrl);
         return;
     }
     $user = new UserModel($this);
     $isAdmin = $user->isSuperAdmin($uid);
     if (!$isAdmin) {
         $this->needAdmin();
         return;
     }
     $siteInfoM = new SiteModel($this);
     $siteInfo = $siteInfoM->getSiteInfo(array('sitename'));
     $title = $siteInfo['sitename'] . ' › 后台管理中心首页';
     $dbTypeStr = $this->getDbTypeStr();
     $dbBgSave = $siteInfoM->hasBgSave() ? 'true' : 'false';
     Templatel::tplStart();
     include Templatel::view('/admin/index.html');
     Templatel::tplEnd();
 }
Ejemplo n.º 4
0
 public function indexAction()
 {
     $this->forceInstall();
     $siteInfoM = new SiteModel($this);
     $siteInfo = $siteInfoM->getSiteInfo(array('sitename'));
     $title = $siteInfo['sitename'] . ' › 测试页面';
     $session = new USession($this);
     $user = new UserModel($this);
     Templatel::tplStart();
     include Templatel::view('/index.html');
     Templatel::tplEnd();
 }
Ejemplo n.º 5
0
 public function indexAction()
 {
     $this->forceInstall();
     $urlHandler = $this->getApp()->getUrlHandler();
     $doResetUrl = $urlHandler->createUrl('web/Forgot', 'do', array());
     $siteInfoM = new SiteModel($this);
     $siteInfo = $siteInfoM->getSiteInfo(array('sitename'));
     $title = $siteInfo['sitename'] . ' › 找回密码';
     Templatel::tplStart();
     include Templatel::view('/forgot.html');
     Templatel::tplEnd();
 }
Ejemplo n.º 6
0
 public function postNewAction()
 {
     $this->forceInstall();
     $session = new USession($this);
     $uid = $session->getUid();
     if ($uid == 0) {
         $urlHandler = $this->getApp()->getUrlHandler();
         $signInUrl = $urlHandler->createUrl('web/SignIn', 'index', array());
         header('Location: ' . $signInUrl);
         return;
     }
     $siteInfoM = new SiteModel($this);
     $siteInfo = $siteInfoM->getSiteInfo(array('sitename'));
     $title = $siteInfo['sitename'] . ' › 创建新主题';
     $user = new UserModel($this);
     Templatel::tplStart();
     include Templatel::view('/postnew.html');
     Templatel::tplEnd();
 }
Ejemplo n.º 7
0
 public function indexAction()
 {
     $this->forceInstall();
     $urlData = $this->getApp()->getUrlHandler()->getUrlData();
     $session = new USession($this);
     $sessionRand = $session->getSessionData()->get('rand', '');
     $urlRand = $urlData->get('rand', '');
     if (empty($sessionRand) || empty($urlRand)) {
         $loginOutOk = false;
     } else {
         $loginOutOk = $sessionRand == $urlRand;
     }
     if ($loginOutOk) {
         $session->destroy();
     }
     $siteInfoM = new SiteModel($this);
     $siteInfo = $siteInfoM->getSiteInfo(array('sitename'));
     $title = $siteInfo['sitename'] . ' › 登出';
     Templatel::tplStart();
     include Templatel::view('/logout.html');
     Templatel::tplEnd();
 }
Ejemplo n.º 8
0
 /**
  * 显示安装界面
  *
  * @param int $installStep
  *        	安装进行到的步骤
  *        	为0时,表示未安装,界面显示安装界面
  *        	为1时,表示进行安装时出现错误,显示错误信息
  *        	为2时,表示执行安装成功,显示关闭安装的步骤
  *        	为3时,表示系统已安装,此时提示禁止安装,以及重新执行安装的方法
  * @param array $errArr
  *        	错误消息提示
  * @return void
  */
 private function showInstallForm($installStep, array $errArr = array())
 {
     $urlHandler = $this->getApp()->getUrlHandler();
     $doInstallUrl = $urlHandler->createUrl('web/Install', 'do', array());
     $title = 'V2EX › 安装';
     Templatel::tplStart();
     include Templatel::view('/install.html');
     Templatel::tplEnd();
 }
Ejemplo n.º 9
0
 /**
  * 注册成功提示
  * 
  * @param int $uid
  */
 private function showRegOk($uid)
 {
     $urlHandler = $this->getApp()->getUrlHandler();
     $loginUrl = $urlHandler->createUrl('web/SignIn', 'index', array());
     $siteInfoM = new SiteModel($this);
     $siteInfo = $siteInfoM->getSiteInfo(array('sitename'));
     $title = $siteInfo['sitename'] . ' › 注册';
     Templatel::tplStart();
     include Templatel::view('/regok.html');
     Templatel::tplEnd();
 }