mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
updating Auth and console script params
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5724 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
1d46e068d3
commit
c740e02896
3 changed files with 35 additions and 32 deletions
|
@ -31,7 +31,7 @@ APP=`pwd`
|
|||
|
||||
echo "Hello $USER,"
|
||||
|
||||
exec php -q ${LIB}cake.php "$@" -working "${APP}"
|
||||
exec php -q ${LIB}cake.php -working "${APP}" "$@"
|
||||
|
||||
echo " ";
|
||||
|
||||
|
|
|
@ -32,6 +32,6 @@
|
|||
SET app=%0
|
||||
SET lib=%~dp0
|
||||
|
||||
php -q "%lib%cake.php" %* -working "%CD%"
|
||||
php -q "%lib%cake.php" -working "%CD%" %*
|
||||
|
||||
echo.
|
|
@ -319,12 +319,10 @@ class AuthComponent extends Object {
|
|||
|
||||
if ($this->authorize) {
|
||||
extract($this->__authType());
|
||||
if ($type == 'controller') {
|
||||
if ($controller->isAuthorized()) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
switch ($type) {
|
||||
case 'controller':
|
||||
$this->object =& $controller;
|
||||
break;
|
||||
case 'crud':
|
||||
case 'actions':
|
||||
if (isset($controller->Acl)) {
|
||||
|
@ -344,12 +342,14 @@ class AuthComponent extends Object {
|
|||
$type = array('model' => $object);
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
||||
if ($this->isAuthorized($type)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->Session->setFlash($this->authError, 'default', array(), 'auth');
|
||||
$controller->redirect($controller->referer(), null, true);
|
||||
return false;
|
||||
|
@ -386,7 +386,7 @@ class AuthComponent extends Object {
|
|||
* used is based on the value of AuthComponent::$authorize or the passed $type param.
|
||||
*
|
||||
* Types:
|
||||
* 'controller' will validate against Controller::isAuthorized()
|
||||
* 'controller' will validate against Controller::isAuthorized() if controller instance is passed in $object
|
||||
* 'actions' will validate Controller::action against an AclComponent::check()
|
||||
* 'crud' will validate mapActions against an AclComponent::check()
|
||||
* array('model'=> 'name'); will validate mapActions against model $name::isAuthorize(user, controller, mapAction)
|
||||
|
@ -413,6 +413,9 @@ class AuthComponent extends Object {
|
|||
|
||||
$valid = false;
|
||||
switch ($type) {
|
||||
case 'controller':
|
||||
$valid = $object->isAuthorized();
|
||||
break;
|
||||
case 'actions':
|
||||
$valid = $this->Acl->check($user, $this->action());
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue