Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Beside the error I found in my comment I'm fairly certain your <code>login</code> validation isn't setup correctly.</p> <p>Here's what you have:</p> <pre><code>'login' =&gt; array( 'rule' =&gt; 'isUnique', 'message' =&gt; 'This username has already been taken', ), 'pattern' =&gt; array( 'rule' =&gt; array('custom','/[a-zA-Z0-9\_\-]{6,}$/i'), 'message' =&gt; 'Must be 6 characters or longer with no spaces', ), 'length' =&gt; array( 'rule' =&gt; array('maxLength', 15), 'message' =&gt; 'Please keep username under 15 characters', ), 'notempty' =&gt; array( 'rule' =&gt; array('notempty'), 'message' =&gt; 'Username cannot be empty', ), ), </code></pre> <p>Here's what I <strong>think</strong> you want to have</p> <pre><code>'username' =&gt; array( 'isUnique' =&gt; array( 'rule' =&gt; 'isUnique', 'message' =&gt; 'This username has already been taken' ), 'pattern' =&gt; array( 'rule' =&gt; array('custom','/[a-zA-Z0-9\_\-]{6,}$/i'), 'message' =&gt; 'Must be 6 characters or longer with no spaces', ), 'length' =&gt; array( 'rule' =&gt; array('maxLength', 15), 'message' =&gt; 'Please keep username under 15 characters', ), 'notEmpty' =&gt; array( 'rule' =&gt; 'notEmpty', 'message' =&gt; 'Username cannot be empty', ), ), </code></pre> <p>Mandatory links to the <a href="http://book.cakephp.org/" rel="nofollow">CakePHP Book</a> and the <a href="http://api13.cakephp.org/" rel="nofollow">CakePHP API</a>.</p> <p><hr /> Answer to error from OP in comment:</p> <p>I see now what you were trying to do. Try this:</p> <pre><code>$id = $this-&gt;Auth-&gt;user('id'); if (!empty($this-&gt;data) &amp;&amp; $id) { $this-&gt;User-&gt;id = $id; </code></pre> <p><hr /> Answer to "How to display my login error message from the <code>AuthComponent</code>?"</p> <p>For the login error message to appear you will need to add the following line in your layout or view for your login form.</p> <pre><code>echo $this-&gt;Session-&gt;flash('auth'); </code></pre> <p><hr /> Answer to "How to temporarily disable CakePHP's <code>modified</code> behavior?":</p> <p>Well, a brief look at the source code and the <a href="http://ask.cakephp.org/questions/view/temporarily_disable_modified_automagic" rel="nofollow">answer to this question on Cake's internal QA</a> you can add something like this before you save the data.</p> <pre><code>$this-&gt;data['User']['modified'] = false; </code></pre> <p>This tells Cake to not update the modified field.</p> <p><em>Interestingly enough from the source code it appears that you could just as easily replace <code>false</code> with <code>true</code> and it wouldn't update the field. I don't know if this is actually the case though.</em></p>
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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