public function update_password($input) { $v = new InputValidator($input); $v->stringEqual('password2')->validate('password', 'Senha'); // $this->validateToken($input['token'], $v); // $v->throwException(); // $f = new TableFilter($this->_table, $input); $f->crypted()->filter('password'); $f->null()->filter('password_change_date'); // $this->_dao->update($this->_table, array('id_admin = ?' => $input['token'])); }
public function update($input) { $v = new InputValidator($input); $v->string()->validate('name', 'Nome'); $v->stringEmail()->validate('email', 'E-mail'); $has_avatar = $v->upload()->validate('avatar', 'Avatar'); $v->throwException(); // $f = new TableFilter($this->_table, $input); $f->string()->filter('name'); $f->string()->filter('email'); $f->crypted()->filter('password'); // $mf = new MoveFiles(); $f->uploaded("/system/uploads/admin/{$this->getId()}/avatar", $has_avatar, $mf)->filter('avatar'); // $mf->move(); // $this->dao_update(); $this->relogin(); }