summaryrefslogtreecommitdiff
path: root/lib/lib_rss.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lib_rss.php')
-rw-r--r--lib/lib_rss.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index 3a929631e..8bfc6eb10 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -237,6 +237,29 @@ function listUsers() {
return $final_list;
}
+
+/**
+ * Register and return the configuration for a given user.
+ *
+ * Note this function has been created to generate temporary configuration
+ * objects. If you need a long-time configuration, please don't use this function.
+ *
+ * @param $username the name of the user of which we want the configuration.
+ * @return a Minz_Configuration object, null if the configuration cannot be loaded.
+ */
+function get_user_configuration($username) {
+ $namespace = time() . '_user_' . $username;
+ try {
+ Minz_Configuration::register($namespace,
+ join_path(USERS_PATH, $username, 'config.php'),
+ join_path(USERS_PATH, '_', 'config.default.php'));
+ return Minz_Configuration::get($namespace);
+ } catch(Minz_ConfigurationException $e) {
+ return null;
+ }
+}
+
+
function httpAuthUser() {
return isset($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'] : '';
}