src/bbn/user.php
public function update_info(array $d)
  {
    if ( $this->check_session() ){
      $update = [];
      foreach ( $d as $key => $val ){
        if (
          ($key !== $this->fields['id']) &&
          ($key !== $this->fields['cfg']) &&
          ($key !== 'auth') &&
          ($key !== 'pass') &&
          \in_array($key, $this->fields)
        ){
          $update[$key] = $val;
        }
      }
      if ( \count($update) > 0 ){
        $r = $this->db->update(
                $this->class_cfg['tables']['users'],
                $update,
                [$this->fields['id'] => $this->id]);
        /** @todo Why did I do this?? */
        $this->set_session(['cfg' => false]);
        $this->_user_info();
        return $r;
      }
    }
    return false;
  }
public function update_info(array $d)
  {
    if ( $this->check_session() ){
      $update = [];
      foreach ( $d as $key => $val ){
        if (
          ($key !== $this->fields['id']) &&
          ($key !== $this->fields['cfg']) &&
          ($key !== 'auth') &&
          ($key !== 'pass') &&
          \in_array($key, $this->fields)
        ){
          $update[$key] = $val;
        }
      }
      if ( \count($update) > 0 ){
        $r = $this->db->update(
                $this->class_cfg['tables']['users'],
                $update,
                [$this->fields['id'] => $this->id]);
        /** @todo Why did I do this?? */
        $this->set_session(['cfg' => false]);
        $this->_user_info();
        return $r;
      }
    }
    return false;
  }
public function update_info ( array $ d ) { if ( $ this -> check_session ( ) ) { $ update = [ ] ; foreach ( $ d as $ key => $ val ) { if ( ( $ key !== $ this -> fields [ 'id' ] ) && ( $ key !== $ this -> fields [ 'cfg' ] ) && ( $ key !== 'auth' ) && ( $ key !== 'pass' ) && \ in_array ( $ key , $ this -> fields ) ) { $ update [ $ key ] = $ val ; } } if ( \ count ( $ update ) > 0 ) { $ r = $ this -> db -> update ( $ this -> class_cfg [ 'tables' ] [ 'users' ] , $ update , [ $ this -> fields [ 'id' ] => $ this -> id ] ) ; /** @todo Why did I do this?? */ $ this -> set_session ( [ 'cfg' => false ] ) ; $ this -> _user_info ( ) ; return $ r ; } } return false ; }
Changes the data in the user's table.

@param array $d The new data

@return bool
Changes the data in the user s table .