final function updateOwner()
 {
     return parent::updateOwner();
 }
 /**
  * updates a record "user" and write it into database
  * @access	public
  */
 function update()
 {
     global $ilErr, $ilDB, $ilAppEventHandler;
     $this->syncActive();
     if (!$this->active) {
         $this->setInactivationDate(ilUtil::now());
     }
     $update_array = array("gender" => array("text", $this->gender), "title" => array("text", $this->utitle), "firstname" => array("text", $this->firstname), "lastname" => array("text", $this->lastname), "email" => array("text", trim($this->email)), "birthday" => array('date', $this->getBirthday()), "hobby" => array("text", $this->hobby), "institution" => array("text", $this->institution), "department" => array("text", $this->department), "street" => array("text", $this->street), "city" => array("text", $this->city), "zipcode" => array("text", $this->zipcode), "country" => array("text", $this->country), "sel_country" => array("text", $this->sel_country), "phone_office" => array("text", $this->phone_office), "phone_home" => array("text", $this->phone_home), "phone_mobile" => array("text", $this->phone_mobile), "fax" => array("text", $this->fax), "referral_comment" => array("text", $this->referral_comment), "matriculation" => array("text", $this->matriculation), "client_ip" => array("text", $this->client_ip), "approve_date" => array("timestamp", $this->approve_date), "active" => array("integer", $this->active), "time_limit_unlimited" => array("integer", $this->getTimeLimitUnlimited()), "time_limit_until" => array("integer", $this->getTimeLimitUntil()), "time_limit_from" => array("integer", $this->getTimeLimitFrom()), "time_limit_owner" => array("integer", $this->getTimeLimitOwner()), "time_limit_message" => array("integer", $this->getTimeLimitMessage()), "profile_incomplete" => array("integer", $this->getProfileIncomplete()), "auth_mode" => array("text", $this->getAuthMode()), "ext_account" => array("text", $this->getExternalAccount()), "im_icq" => array("text", $this->im_icq), "im_yahoo" => array("text", $this->im_yahoo), "im_msn" => array("text", $this->im_msn), "im_aim" => array("text", $this->im_aim), "im_skype" => array("text", $this->im_skype), "delicious" => array("text", $this->delicious), "latitude" => array("text", $this->latitude), "longitude" => array("text", $this->longitude), "loc_zoom" => array("integer", (int) $this->loc_zoom), "last_password_change" => array("integer", $this->last_password_change_ts), "im_jabber" => array("text", $this->im_jabber), "im_voip" => array("text", $this->im_voip), "last_update" => array("timestamp", ilUtil::now()), 'inactivation_date' => array('timestamp', $this->inactivation_date));
     if (isset($this->agree_date) && (strtotime($this->agree_date) !== false || $this->agree_date == null)) {
         $update_array["agree_date"] = array("timestamp", $this->agree_date);
     }
     switch ($this->passwd_type) {
         case IL_PASSWD_PLAIN:
             if (strlen($this->passwd)) {
                 $update_array["i2passwd"] = array("text", (string) "");
                 $update_array["passwd"] = array("text", (string) md5($this->passwd));
             } else {
                 $update_array["i2passwd"] = array("text", (string) "");
                 $update_array["passwd"] = array("text", (string) $this->passwd);
             }
             break;
         case IL_PASSWD_MD5:
             $update_array["i2passwd"] = array("text", (string) "");
             $update_array["passwd"] = array("text", (string) $this->passwd);
             break;
         case IL_PASSWD_CRYPT:
             $update_array["i2passwd"] = array("text", (string) $this->passwd);
             $update_array["passwd"] = array("text", (string) "");
             break;
         default:
             $ilErr->raiseError("<b>Error: passwd_type missing in function update()" . $this->id . "!</b><br />class: " . get_class($this) . "<br />Script: " . __FILE__ . "<br />Line: " . __LINE__, $ilErr->FATAL);
     }
     $ilDB->update("usr_data", $update_array, array("usr_id" => array("integer", $this->id)));
     $this->writePrefs();
     // update user defined fields
     $this->updateUserDefinedFields();
     parent::update();
     parent::updateOwner();
     $this->read();
     $ilAppEventHandler->raise("Services/User", "afterUpdate", array("user_obj" => $this));
     return true;
 }