diff options
author | Sem <sembrestels@riseup.net> | 2013-11-09 16:26:19 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2013-11-09 16:26:19 +0100 |
commit | 5cc7f96262509b2a5d43fa6fbb6cd083064385be (patch) | |
tree | c2de1ca30876063882cbbb0818d1d618cc6da4c4 /mod/openid_server/start.php | |
parent | 2161e2335c9c650b8e44a56f6c9b0bd37546ae1f (diff) | |
parent | b6c722ac63d250972fea066b30e58026d00ab3e2 (diff) | |
download | elgg-5cc7f96262509b2a5d43fa6fbb6cd083064385be.tar.gz elgg-5cc7f96262509b2a5d43fa6fbb6cd083064385be.tar.bz2 |
Add 'mod/openid_server/' from commit 'b6c722ac63d250972fea066b30e58026d00ab3e2'
git-subtree-dir: mod/openid_server
git-subtree-mainline: 2161e2335c9c650b8e44a56f6c9b0bd37546ae1f
git-subtree-split: b6c722ac63d250972fea066b30e58026d00ab3e2
Diffstat (limited to 'mod/openid_server/start.php')
-rwxr-xr-x | mod/openid_server/start.php | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/mod/openid_server/start.php b/mod/openid_server/start.php new file mode 100755 index 000000000..7129f1497 --- /dev/null +++ b/mod/openid_server/start.php @@ -0,0 +1,65 @@ +<?php
+
+/**
+ * Elgg openid server plugin
+ *
+ * @package ElggOpenID
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Kevin Jardine <kevin@radagast.biz>
+ * @copyright Curverider Ltd 2008-2009
+ * @link http://elgg.com/
+ */
+
+global $CONFIG;
+if (get_include_path())
+ set_include_path(get_include_path() . PATH_SEPARATOR . $CONFIG->path . 'mod/openid_api/vendors/php-openid/' . PATH_SEPARATOR . $CONFIG->path . 'mod/openid_server/');
+else
+ set_include_path($CONFIG->path . 'mod/openid_api/vendors/php-openid/' . PATH_SEPARATOR . $CONFIG->path . 'mod/openid_server/');
+
+elgg_register_event_handler('init','system','openid_server_init',1);
+
+function openid_server_init() {
+
+ global $CONFIG;
+ elgg_register_event_handler('login','user','openid_server_handle_login');
+ elgg_register_event_handler('logout','user','openid_server_handle_logout');
+
+ elgg_set_view_location("openid_server/forms/trust", $CONFIG->path.'mod/openid_server/views/');
+
+ $base = elgg_get_plugins_path() . 'openid_server/actions';
+ elgg_register_action('openid_server/trust', "$base/trust.php", 'public');
+
+ elgg_extend_view("page/elements/head", "openid_server/metatags");
+ elgg_extend_view("xrds/services", "openid_server/service");
+ elgg_extend_view("user/default", "openid_server/profile");
+}
+
+
+function openid_server_handle_login($event, $object_type, $object) {
+ global $CONFIG;
+
+ require_once('openid_server_include.php');
+
+ $store = getOpenIDServerStore();
+
+ if ($store->getAutoLoginSites()) {
+ forward($CONFIG->wwwroot.'mod/openid_server/actions/autologin.php');
+ }
+
+ return true;
+}
+
+function openid_server_handle_logout($event, $object_type, $object) {
+ global $CONFIG;
+
+ /*$store = getOpenIDServerStore();
+
+ if ($store->getAutoLogoutSites()) {
+ forward($CONFIG->wwwroot.'mod/openid_server/actions/autologout.php');
+ }*/
+
+ return true;
+}
+
+
+?>
|