src/bbn/user.php
public function set_password($old_pass, $new_pass){
    if ( $this->auth ){
      $pwt = $this->class_cfg['tables']['passwords'];
      $pwa = $this->class_cfg['arch']['passwords'];
      $stored_pass = $this->db->select_one($pwt, $pwa['pass'], [
        $this->class_cfg['arch']['passwords']['id_user'] => $this->id
      ], [
        $this->class_cfg['arch']['passwords']['added'] => 'DESC'
      ]);
      if ( $this->_check_password($old_pass, $stored_pass) ){
        return $this->force_password($new_pass, $this->get_id());
      }
    }
    return false;
  }
public function set_password($old_pass, $new_pass){
    if ( $this->auth ){
      $pwt = $this->class_cfg['tables']['passwords'];
      $pwa = $this->class_cfg['arch']['passwords'];
      $stored_pass = $this->db->select_one($pwt, $pwa['pass'], [
        $this->class_cfg['arch']['passwords']['id_user'] => $this->id
      ], [
        $this->class_cfg['arch']['passwords']['added'] => 'DESC'
      ]);
      if ( $this->_check_password($old_pass, $stored_pass) ){
        return $this->force_password($new_pass, $this->get_id());
      }
    }
    return false;
  }
public function set_password ( $ old_pass , $ new_pass ) { if ( $ this -> auth ) { $ pwt = $ this -> class_cfg [ 'tables' ] [ 'passwords' ] ; $ pwa = $ this -> class_cfg [ 'arch' ] [ 'passwords' ] ; $ stored_pass = $ this -> db -> select_one ( $ pwt , $ pwa [ 'pass' ] , [ $ this -> class_cfg [ 'arch' ] [ 'passwords' ] [ 'id_user' ] => $ this -> id ] , [ $ this -> class_cfg [ 'arch' ] [ 'passwords' ] [ 'added' ] => 'DESC' ] ) ; if ( $ this -> _check_password ( $ old_pass , $ stored_pass ) ) { return $ this -> force_password ( $ new_pass , $ this -> get_id ( ) ) ; } } return false ; }
Change the password in the database after checking the current one
@return boolean
Change the password in the database after checking the current one