diff options
author | Andrew Dolgov <[email protected]> | 2012-12-25 00:45:10 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2012-12-25 00:45:10 +0400 |
commit | de612e7a3850d3053c7038e94098c0681d46983b (patch) | |
tree | 3e983cc930f18bd3d18d6536801929c733f7bf6c /include | |
parent | 57e97294259f8d14806764d7a65083c2b84f1ea7 (diff) |
experimental support for per-user plugins (bump schema)
Diffstat (limited to 'include')
-rw-r--r-- | include/functions.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/functions.php b/include/functions.php index 14b3af517..6848f14b9 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1,6 +1,6 @@ <?php define('EXPECTED_CONFIG_VERSION', 26); - define('SCHEMA_VERSION', 99); + define('SCHEMA_VERSION', 100); $fetch_last_error = false; $pluginhost = false; @@ -711,9 +711,19 @@ return true; } + function load_user_plugins($link, $owner_uid) { + if ($owner_uid) { + $plugins = get_pref($link, "_ENABLED_PLUGINS", $owner_uid); + + global $pluginhost; + $pluginhost->load($plugins); + } + } + function login_sequence($link, $login_form = 0) { if (SINGLE_USER_MODE) { - return authenticate_user($link, "admin", null); + authenticate_user($link, "admin", null); + load_user_plugins($link, $_SESSION["uid"]); } else { if (!$_SESSION["uid"] || !validate_session($link)) { @@ -735,6 +745,10 @@ setcookie("ttrss_lang", $_SESSION["language"], time() + SESSION_COOKIE_LIFETIME); } + + if ($_SESSION["uid"]) { + load_user_plugins($link, $_SESSION["uid"]); + } } } |