Note that there are some explanatory texts on larger screens.

plurals
  1. PONO QUERY using CakePHP Authentication component
    primarykey
    data
    text
    <p>I'm using CakePHP 2.2.4, and I have started to work with Atuh Componenet.</p> <p>This is my AppController:</p> <pre><code>class AppController extends Controller { public $components = array('Auth', 'Session'); public function beforeFilter() { $this-&gt;Auth-&gt;authorize = array('Controller'); $this-&gt;Auth-&gt;authenticate = array( 'Form' =&gt; array ( 'scope' =&gt; array('User.active' =&gt; 1), 'fields' =&gt; array('username' =&gt; 'email', 'password' =&gt; 'password'), ) ); } public function isAuthorized($user) { debug($user); return true; } } </code></pre> <p>This is my User.php model</p> <pre><code>class User extends AppModel { public $name = 'User'; /* Relazioni */ public $hasOne = 'Profile'; public $belongsTo = 'Role'; public $hasMany = array( 'Lead' =&gt; array( 'className' =&gt; 'Lead' ) ); } </code></pre> <p>and this is my UserController.php</p> <pre><code>&lt;?php App::uses('AppController', 'Controller'); class UsersController extends AppController { public $name = 'Users'; public $uses = array(); public function beforeFilter() { parent::beforeFilter(); } public function login() { if ($this-&gt;request-&gt;is('post')) { if ($this-&gt;Auth-&gt;login()) { debug('Logged'); } else { $this-&gt;Session-&gt;setFlash('Login non autorizzato', 'default', array('class' =&gt; 'errore'), 'login'); } } } public function logout() { $this-&gt;redirect($this-&gt;Auth-&gt;logout()); } } </code></pre> <p>I have a strange problem using Auth Component, because at the end of the layout I have sql_dump element, that prints NO QUERY.</p> <p>However, If i put correct values I do not login</p> <p>Why does Auth component is not working ?</p> <p><strong>EDIT:</strong></p> <p>The data of the request is:</p> <pre><code>Array ( [User] =&gt; Array ( [email] =&gt; test@test.it [pwd] =&gt; abc ) ) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload