1

我在我的网站中使用 CakePHP Auth 组件。该代码在 Windows 中运行良好,但在将其上传到 linux 在线主机后,它给出消息授权适配器“未找到”。CakePHP

关于这个问题的任何想法?

      <?php
    App::uses('AppController', 'Controller');


    class AppController extends Controller {

          public  $mobile;
        public $components = array(
            'Acl',
            'Auth' => array(
                'authorize' => array(
                    'Actions' => array('actionPath' => 'controllers/'),
                ),
            ),
            'Session',
            'RequestHandler',
        );
        public $helpers = array('Html', 'Form', 'Session', 'Js' => array('Jquery'));


        public function beforeFilter() {
            parent::beforeFilter();
   // print_r($this->request); die;

   if ($this->request->is('post') && isset($this->request['data']['access_token'])) {

            App::uses('User', 'Model');
            $this->User = new User();



               // print_r($this->request['data']['access_token']);die;
                $this->mobile = $this->User->authenticateMobile($this->request['data']['access_token']);


            }



//        print_r('APPCONT');
//        print_r($this->request);
//        die;
        $this->Auth->authenticate = array(
            AuthComponent::ALL => array('userModel' => 'User'),
            //'ChangeEg',
            'Form' 
        );



        //Configure AuthComponent
        $this->Auth->authorize = 'actions';

        $this->Auth->loginError = "Wrong credentials";
        $this->Auth->authError = "This part of the website is protected.";

        $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');

        $this->Auth->loginRedirect = array('controller' => 'feedbacks', 'action' => 'add');
        $this->Auth->logoutRedirect = array('controller' => 'home', 'action' => 'index');


}

}

4

1 回答 1

2

我有同样的问题,是骆驼错误,

而是写 $this->Auth->authorize = 'Controller';

我写了 $this->Auth->authorize = 'controller'。

在 windows 中可以正常工作,但在 Linux 中不行。

看到这篇文章https://groups.google.com/forum/?fromgroups#!topic/cake-php/wZGFoJ4ayx0

于 2013-06-15T12:41:01.357 回答