我在我的网站中使用 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');
}
}