Note that there are some explanatory texts on larger screens.

plurals
  1. POKohana Change Password Error ORM Driver
    text
    copied!<p>Okay so im attempt to allow users to change their passwords via an admin panel with this code but i keep getting </p> <blockquote> <p>ORM_Validation_Exception [ 0 ]: Failed to validate array ~ MODPATH/orm/classes/kohana/orm.php [ 1174 ]</p> </blockquote> <p>Anyone have any solutions? heres the controller function and model functions and view respectively</p> <p>Controller:</p> <pre><code>public function action_edituser() { $this-&gt;auto_render = false; $edit = Model::factory('manageusers'); $post = $_POST; $edit-&gt;editUser($post); } </code></pre> <p>Model:</p> <pre><code>public function editUser($array) { try { $user = ORM::factory('user') -&gt;where('id', '=', $array['id']) -&gt;find() -&gt;update_user($array, array( 'username', 'password', 'email', )); return $this-&gt;response('success', 'User Edited'); } catch (Database_Exception $e) { $this-&gt;response('error', $e-&gt;getMessage()); } } </code></pre> <p>View:</p> <pre><code>&lt;div class="modal" id="editmodal" style="display: none;"&gt; &lt;div class="modal-header"&gt; &lt;a class="close" data-dismiss="modal"&gt;×&lt;/a&gt; &lt;h3&gt;Edit User&lt;/h3&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;?php echo Form::open('admin/manageusers/edituser', array('data-function'=&gt; '/admin/manageusers/updategrid', 'data-element' =&gt; 'tbody')); echo Form::label('username', 'Username'); echo Form::input('username', null, array('id' =&gt; 'username')); echo Form::label('email', 'Email'); echo Form::input('email', null, array('id' =&gt; 'email')); echo HTML::anchor('#', 'Change Password', array('id' =&gt; 'changepass', 'style' =&gt; 'display: block;')); echo '&lt;div id="passwordchange" style="display: none;"&gt;'; echo Form::label('password', 'Password'); echo Form::password('password', null, array('id' =&gt; 'password')); echo Form::label('password_confirm', 'Confirm Password'); echo Form::password('password_confirm'); echo '&lt;/div&gt;'; echo Form::hidden('id', null, array('id' =&gt; 'id')); ?&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;a href="#" class="btn" data-dismiss="modal"&gt;Close&lt;/a&gt; &lt;input type="submit" class="btn btn-success" value="Save changes" /&gt; &lt;/div&gt; &lt;?php echo Form::close(); ?&gt; &lt;/div&gt; </code></pre>
 

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