Permalink
Browse files

fix login logout

  • Loading branch information...
1 parent b1a5bf3 commit 21e07301e841bcba1b8e19c17f03998fbd5810f6 @yandod committed Apr 3, 2012
Showing with 22 additions and 46 deletions.
  1. +7 −9 app/Controller/AccountController.php
  2. +1 −1 app/Controller/AppController.php
  3. +1 −1 app/Vendor/candycane/ActionMailer.php
  4. +13 −35 index.php
@@ -181,7 +181,7 @@ public function login() {
$this->set('back_url',$this->referer());
return;
}
- $this->set('back_url',$this->request->params['form']['back_url']);
+ $this->set('back_url',$this->request->data['back_url']);
// validate
$this->User->set($this->request->data);
if (!$this->User->validates()) {
@@ -211,12 +211,14 @@ public function login() {
# cookies[:autologin] = { :value => token.value, :expires => 1.year.from_now }
#end
#redirect_back_or_default :controller => 'my', :action => 'page'
- if (!$this->request->params['form']['back_url'][0] == '/' ||
- Router::url($this->request->params['form']['back_url']) == Router::url($this->request->action)
+ if (
+ !$this->request->data['back_url'][0] == '/' ||
+ Router::url($this->request->data['back_url'], true) ==
+ Router::url($this->request->action, true)
) {
- $this->request->params['form']['back_url'] = '/';
+ $this->request->data['back_url'] = '/';
}
- $this->redirect($this->request->params['form']['back_url']);
+ $this->redirect($this->request->data['back_url']);
}
}
@@ -225,13 +227,9 @@ public function login() {
*
* Log out current user and redirect to welcome page
*
- * @todo implement yet
*/
public function logout() {
$this->Session->destroy();
- #cookies.delete :autologin
- #Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) if User.current.logged?
- #self.logged_user = nil
$this->redirect('/');
}
@@ -17,7 +17,7 @@ class AppController extends Controller {
public $helpers = array('Html', 'Form', 'Candy', 'Session');
- public $components = array('Session','Cookie', 'MenuManager'/*,'DebugKit.Toolbar'*/);
+ public $components = array('Session','Cookie', 'MenuManager','DebugKit.Toolbar');
public $uses = array('User', 'Setting', 'Project');
@@ -24,7 +24,7 @@
* @link http://wiki.rubyonrails.org/rails/pages/ActionMailer
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
-class ActionMailer extends Object
+class ActionMailer extends Component
{
var $name = 'ActionMailer';
View
@@ -1,29 +1,24 @@
<?php
-/* SVN FILE: $Id: index.php 7945 2008-12-19 02:16:01Z gwoo $ */
/**
* Requests collector.
*
* This file collects requests if:
- * - no mod_rewrite is avilable or .htaccess files are not supported
- * -/public is not set as a web root.
+ * - no mod_rewrite is available or .htaccess files are not supported
+ * - requires App.baseUrl to be uncommented in app/Config/core.php
+ * - app/webroot is not set as a document root.
*
- * PHP versions 4 and 5
+ * PHP 5
*
- * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
- * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
+ * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
+ * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
- * @filesource
- * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
- * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
- * @package cake
+ * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
+ * @link http://cakephp.org CakePHP(tm) Project
* @since CakePHP(tm) v 0.2.9
- * @version $Revision: 7945 $
- * @modifiedby $LastChangedBy: gwoo $
- * @lastmodified $Date: 2008-12-18 18:16:01 -0800 (Thu, 18 Dec 2008) $
- * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
* Get Cake's root directory
@@ -34,29 +29,12 @@
define('WEBROOT_DIR', 'webroot');
define('WWW_ROOT', ROOT . DS . APP_DIR . DS . WEBROOT_DIR . DS);
/**
- * This only needs to be changed if the cake installed libs are located
- * outside of the distributed directory structure.
+ * This only needs to be changed if the "cake" directory is located
+ * outside of the distributed structure.
+ * Full path to the directory containing "cake". Do not add trailing directory separator
*/
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
- //define ('CAKE_CORE_INCLUDE_PATH', FULL PATH TO DIRECTORY WHERE CAKE CORE IS INSTALLED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
- define('CAKE_CORE_INCLUDE_PATH', ROOT);
+ define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');
}
- if (function_exists('ini_set')) {
- ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS);
- define('APP_PATH', null);
- define('CORE_PATH', null);
- } else {
- define('APP_PATH', ROOT . DS . APP_DIR . DS);
- define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
- }
- require CORE_PATH . 'cake' . DS . 'basics.php';
- $TIME_START = getMicrotime();
- require CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php';
- require LIBS . 'object.php';
- require LIBS . 'inflector.php';
- require LIBS . 'configure.php';
- $bootstrap = true;
- $url = null;
require APP_DIR . DS . WEBROOT_DIR . DS . 'index.php';
-?>

0 comments on commit 21e0730

Please sign in to comment.