From 1c6a36d63878c2ac15b0c2abef859ce7b58c8689 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Thu, 26 Dec 2013 07:59:00 +0000 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E9=BB=91=E6=B2=B3=E4=B8=93?= =?UTF-8?q?=E9=A2=98jiathis=E7=9A=84=E6=B3=A8=E9=87=8A=EF=BC=8C=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E9=87=8D=E5=A4=8D=E8=AE=BF=E9=97=AE=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=97=B6=E7=9A=84=E6=AD=BB=E5=BE=AA=E7=8E=AF?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BF=AE=E6=94=B9=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E5=9B=BE=E7=89=87=E5=AD=98=E6=94=BE=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/AccountController.php | 11 ++++------- application/default/views/scripts/heihe/view.phtml | 4 ++-- application/module/Helpers/Captcha.php | 12 +++++++++--- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/application/default/controllers/AccountController.php b/application/default/controllers/AccountController.php index 72e52f23..762f3597 100755 --- a/application/default/controllers/AccountController.php +++ b/application/default/controllers/AccountController.php @@ -301,20 +301,17 @@ class AccountController extends Zend_Controller_Action $auth = Zend_Auth::getInstance(); if ($auth->hasIdentity()) { - view::Post($this,"您已经登录,无需重复登录",-1); + view::Post($this,"您已经登录,无需重复登录","/index"); return true; } $tohref = $this->_request->getParam('href'); - if(($options['module']=="default" && $options['controller'] == "account" && $options['action'] == "login")) + if($_SERVER['REQUEST_URI'] !== "/account/login") { $this->view->href = $_SERVER['REQUEST_URI']; - } - - if($tohref == "/account/login") - { - $this->view->href = $tohref = "/"; + }else{ + $this->view->href = "/"; } if(!empty($tohref)) diff --git a/application/default/views/scripts/heihe/view.phtml b/application/default/views/scripts/heihe/view.phtml index ba55b71c..f5a5b84a 100755 --- a/application/default/views/scripts/heihe/view.phtml +++ b/application/default/views/scripts/heihe/view.phtml @@ -479,7 +479,7 @@ endforeach; - + @@ -554,4 +554,4 @@ var bound = {

没有找到对应的元数据。

- \ No newline at end of file + \ No newline at end of file diff --git a/application/module/Helpers/Captcha.php b/application/module/Helpers/Captcha.php index dc61b759..43a835b3 100644 --- a/application/module/Helpers/Captcha.php +++ b/application/module/Helpers/Captcha.php @@ -6,6 +6,7 @@ class Captcha extends \Zend_Controller_Plugin_Abstract public $captcha; private $sessionName = "captcha"; + private $imgDir = "images/captcha"; function __construct($db = NULL) { @@ -23,13 +24,18 @@ class Captcha extends \Zend_Controller_Plugin_Abstract 'dotNoiseLevel'=>2, 'lineNoiseLevel'=>1, 'timeout' => 300, - 'font' => '../data/fonts/ggbi.ttf', - 'imgDir' => 'vdimg/', - 'imgUrl' => '/vdimg', + 'font' => '../data/fonts/ggbi.ttf', + 'imgDir' => $this->imgDir, + 'imgUrl' => '/images/captcha', )); } public function setCaptcha(){ + if(!is_dir($this->imgDir)) + { + mkdir($this->imgDir); + } + $this->captcha->generate(); $_SESSION[$this->sessionName] = $this->captcha->getWord(); $url = $this->captcha->getImgUrl()