0

people I need your help, please. I have an application in Cake PHP, it was working perfectly and simply stopped working by emitting the following error:

Notice (8): Undefined variable: authUser [APP/View/Elements/top_bar.ctp, line 20]

Fatal Error Error: syntax error, unexpected ''logoutRedirect'' (T_CONSTANT_ENCAPSED_STRING), expecting ')' File: /var/www/pegasus/instancias/pw/Controller/AppController.php Line: 20

“In my homologation environment . everything works perfectly. I compared the codes and they are the same. I checked the database. Everything is ok and nothing has changed on the server.”

class AppController extends Controller {

    public $global = [];
    public $components = array(
        'Cookie',
        'Session',
        'AuthManager.AccessPermission',
        'TaskManager.TaskService',
        'AuthManager.LogSystem',
        'ConfigManager.Configuration',
        'Auth' => array(
            'loginRedirect'      => array(
                    'plugin'     => null,
                    'controller' => 'home',
                    'action'     => 'index'
            )
             'logoutRedirect'     => array(
                    'plugin'     => 'auth_manager',
                    'controller' => 'users',
                    'action'     => 'login'
            ),
            //'authorize' => array('Controller'),
            'authError'     => 'Você deve fazer login para ter acesso a essa área!',
            'loginError'    => 'Combinação de usuário e senha errada!' ,
            'authenticate'  => array(
                'Form'      => array(
                    'scope' => array('User.status' => '1')
                ),
            )
Cœur
  • 37,241
  • 25
  • 195
  • 267
PH27
  • 11
  • 1
  • 1
    Missing comma (`,`)after the `)` in the line before – Mark Baker Oct 19 '17 at 16:35
  • **Thank you**, a ( ; ) and another error in the View of the Users caused the problem, I was confused as they are the same as the homologation, and were working perfectly, it's been 2 years that the system is in the air. – PH27 Oct 19 '17 at 18:16

1 Answers1

0

You are missing , before 'logoutRedirect':

'loginRedirect'  => array(
    'plugin'     => null,
    'controller' => 'home',
    'action'     => 'index',
),
'logoutRedirect' => array(
    'plugin'     => 'auth_manager',
    'controller' => 'users',
    'action'     => 'login',
),

Read this answer to know the explanation for the error T_CONSTANT_ENCAPSED_STRING. 5. Array lists is the one matches yours.

Thamilhan
  • 13,040
  • 5
  • 37
  • 59