/** * Saves user's settings such as order sorting for bookmarks, ... * @param type $user * @param type $key * @param type $value * @return boolean */ function user_prefs_settings_edit($user, $key, $value) { // Sanity check if (!isset($user) || $user == '') { return false; } // 1) set the repository path $user_files_path = user_prefs_repository_path($user_files_path); if ($user_files_path === false) { return false; } // set user's file path $user_path = $user_files_path . '/' . $user; // if the user's directory doesn't exist yet, we create it if (!file_exists($user_path)) { mkdir($user_path, 0755, true); } $settings = user_prefs_settings_get($user); $settings[$key] = $value; // converts the array in xml file return simple_assoc_array2xml_file($settings, $user_path . "/_settings.xml", "settings"); }
/** * Retrieve the new settings values */ function acl_update_settings() { if (acl_user_is_logged()) { $_SESSION['acl_user_settings'] = user_prefs_settings_get($_SESSION['user_login']); } }