From e7c42339634a1d94a11f8ad6c8e7b75575c67500 Mon Sep 17 00:00:00 2001 From: phpnut Date: Wed, 9 Jan 2008 04:51:12 +0000 Subject: [PATCH] "Fixing bug with scaffold and valid Session id check" git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6346 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/controller/scaffold.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cake/libs/controller/scaffold.php b/cake/libs/controller/scaffold.php index 8122559de..6ab137c59 100644 --- a/cake/libs/controller/scaffold.php +++ b/cake/libs/controller/scaffold.php @@ -204,7 +204,7 @@ class Scaffold extends Object { if (isset($params['pass'][0])) { $this->ScaffoldModel->id = $params['pass'][0]; - } elseif (isset($this->controller->Session) && $this->controller->Session->valid != false) { + } elseif (isset($this->controller->Session) && $this->controller->Session->valid() != false) { $this->controller->Session->setFlash(sprintf(__("No id set for %s::view()", true), Inflector::humanize($this->modelKey))); $this->controller->redirect($this->redirect); } else { @@ -268,7 +268,7 @@ class Scaffold extends Object { } if(!$this->ScaffoldModel->exists()) { - if (isset($this->controller->Session) && $this->controller->Session->valid != false) { + if (isset($this->controller->Session) && $this->controller->Session->valid() != false) { $this->controller->Session->setFlash(sprintf(__("Invalid id for %s::edit()", true), Inflector::humanize($this->modelKey))); $this->controller->redirect($this->redirect); } else { @@ -284,7 +284,7 @@ class Scaffold extends Object { if ($this->ScaffoldModel->save($this->controller->data)) { if ($this->controller->_afterScaffoldSave($action)) { - if (isset($this->controller->Session) && $this->controller->Session->valid != false) { + if (isset($this->controller->Session) && $this->controller->Session->valid() != false) { $this->controller->Session->setFlash(sprintf(__('The %1$s has been %2$s', true), Inflector::humanize($this->modelClass), $success)); $this->controller->redirect($this->redirect); } else { @@ -294,7 +294,7 @@ class Scaffold extends Object { return $this->controller->_afterScaffoldSaveError($action); } } else { - if (isset($this->controller->Session) && $this->controller->Session->valid != false) { + if (isset($this->controller->Session) && $this->controller->Session->valid() != false) { $this->controller->Session->setFlash(__('Please correct errors below.', true)); } } @@ -333,7 +333,7 @@ class Scaffold extends Object { if ($this->controller->_beforeScaffold('delete')) { if (isset($params['pass'][0])) { $id = $params['pass'][0]; - } elseif (isset($this->controller->Session) && $this->controller->Session->valid != false) { + } elseif (isset($this->controller->Session) && $this->controller->Session->valid() != false) { $this->controller->Session->setFlash(sprintf(__("No id set for %s::delete()", true), Inflector::humanize($this->modelKey))); $this->controller->redirect($this->redirect); } else { @@ -342,14 +342,14 @@ class Scaffold extends Object { } if ($this->ScaffoldModel->del($id)) { - if (isset($this->controller->Session) && $this->controller->Session->valid != false) { + if (isset($this->controller->Session) && $this->controller->Session->valid() != false) { $this->controller->Session->setFlash(sprintf(__('The %1$s with id: %2$d has been deleted.', true), Inflector::humanize($this->modelClass), $id)); $this->controller->redirect($this->redirect); } else { return $this->controller->flash(sprintf(__('The %1$s with id: %2$d has been deleted.', true), Inflector::humanize($this->modelClass), $id), '/' . $this->viewPath); } } else { - if (isset($this->controller->Session) && $this->controller->Session->valid != false) { + if (isset($this->controller->Session) && $this->controller->Session->valid() != false) { $this->controller->Session->setFlash(sprintf(__('There was an error deleting the %1$s with id: %2$d', true), Inflector::humanize($this->modelClass), $id)); $this->controller->redirect($this->redirect); } else {