/** * Persist user values * * This function is used to store user's changed values to the database. * <br/>Example: * <code> * $user -> surname = 'doe'; //Change object's surname * $user -> persist(); //Persist changed value * </code> * * @return boolean True if everything is ok * @since 3.5.0 * @access public */ public function persist() { $fields = array('password' => $this->user['password'], 'email' => $this->user['email'], 'languages_NAME' => $this->user['languages_NAME'], 'name' => $this->user['name'], 'surname' => $this->user['surname'], 'active' => $this->user['active'], 'comments' => $this->user['comments'], 'user_type' => $this->user['user_type'], 'timestamp' => $this->user['timestamp'], 'avatar' => $this->user['avatar'], 'pending' => $this->user['pending'], 'user_types_ID' => $this->user['user_types_ID'], 'status' => $this->user['status'], 'balance' => $this->user['balance'], 'archive' => $this->user['archive'], 'timezone' => $this->user['timezone'], 'need_pwd_change' => $this->user['need_pwd_change'] ? 1 : 0, 'additional_accounts' => $this->user['additional_accounts'], 'short_description' => $this->user['short_description'], 'autologin' => $this->user['autologin']); if ($GLOBALS['configuration']['reset_license_note_always']) { $fields['viewed_license'] = 0; } else { $fields['viewed_license'] = $this->user['viewed_license']; } $userProfile = eF_getTableData("user_profile", "*", "active=1 AND type <> 'branchinfo' AND type <> 'groupinfo'"); foreach ($userProfile as $value) { $fields[$value['name']] = $this->user[$value['name']]; } eF_updateTableData("users", $fields, "login='******'login'] . "'"); EfrontCache::getInstance()->deleteCache('usernames'); ///MODULES1 - Module user add events // Get all modules (NOT only the ones that have to do with the user type) if (!self::$cached_modules) { self::$cached_modules = eF_loadAllModules(); } // Trigger all necessary events. If the function has not been re-defined in the derived module class, nothing will happen foreach (self::$cached_modules as $module) { $module->onUpdateUser($this->user['login']); } return true; }