Update for user management Sd_User::store

This is the general discussion board for development on Sourdough.

Moderators: Moderator Team, Development Team

Update for user management Sd_User::store

Postby Rinso on Tue Jan 03, 2006 2:09 pm

Hi there,

I'm trying to create a user management based on Sourdough.
When i want to update user information it will update on all existing users. I fixed that with following setWHERE id = user id

Code: Select all
   public function store($forceAll = FALSE)
   {
      $SQL = $this->Sourdough->SqlHelper();
      $SQL->create($this->conf['table']);
      // If we don't force to update all properties, only update the changed properties!
      $newProperties = ($forceAll) ? $this->userProperties :
                       Sd_Array::diffKeys($this->userProperties, $this->storedProperties);
      $SQL->bindFields($newProperties);
      
      // Update existing user or create a new user
      if ($this->userProperties['user_id']) {
          // @since v0.0.1
          $SQL->setWhere("user_id = " . $this->userProperties['user_id']);
         $SQL->setExecMode(Sd_SqlHelper::EXEC_UPDATE);
      } else {
         $SQL->setExecMode(Sd_SqlHelper::EXEC_INSERT);
      }
       echo $SQL->getCommand();
      return($SQL->execute());
   }


Let me know if this is usefull!

Greetings,
John
Rinso
 
Posts: 1
Joined: Tue Jan 03, 2006 1:53 pm

FIXED: Update for user management Sd_User::store

Postby pipo on Sat Jan 07, 2006 10:57 am

Hi John,

Thanks for the bug report.
This has been fixed in CVS:
http://cvs.phpee.com/diff.php?r1=1.13&r2=1.14&ty=h&f=sourdough%2FSd_User%2FSd_User.class.php

take care
philip
Philip Iezzi - Development Team Leader, phpee.com
PHPee.com | Downloads | PPhlogger
hosted by Onlime Webhosting
User avatar
pipo
Site Admin
 
Posts: 773
Joined: Sat Nov 15, 2003 2:57 pm
Location: Zurich, Switzerland

Postby Veztem on Sun Aug 06, 2006 8:47 am

Good news
Veztem
 
Posts: 1
Joined: Sun Aug 06, 2006 8:27 am
Location: USA


Return to Sourdough development

Who is online

Users browsing this forum: No registered users and 2 guests

cron