public function recover_password($input) { $v = new InputValidator($input); $v->stringEmail()->validate('email', 'E-mail'); $v->dbRecord($this->_dao, 'admin')->validate('email', 'E-mail'); $v->throwException(); // $f = new TableFilter($this->_table, $input); $f->timestamp()->filter('password_change_date'); // $this->_dao->update($this->_table, array('email = ?' => $input['email'])); $this->send_email($input['email']); }
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(); }