aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-12-12 19:16:56 -0500
committerCash Costello <cash.costello@gmail.com>2011-12-12 19:16:56 -0500
commit3811d359431522fb368650bac36e941e0002bb67 (patch)
treec9fbd5a787e23c7646c98fcafd707c66a6d2fee0
parent72c3e7ccdbb316c2a13c38183655d56b0548af59 (diff)
downloadelgg-3811d359431522fb368650bac36e941e0002bb67.tar.gz
elgg-3811d359431522fb368650bac36e941e0002bb67.tar.bz2
added consumer and server libs that can be loaded using Elgg's api
-rw-r--r--lib/openid_consumer.php14
-rw-r--r--lib/openid_server.php13
-rw-r--r--start.php8
3 files changed, 34 insertions, 1 deletions
diff --git a/lib/openid_consumer.php b/lib/openid_consumer.php
new file mode 100644
index 000000000..3dfc09a1e
--- /dev/null
+++ b/lib/openid_consumer.php
@@ -0,0 +1,14 @@
+<?php
+/**
+ * OpenID library loader for consumers
+ */
+
+$openid_path = dirname(dirname(__FILE__)) . '/vendors/php-openid/';
+$path = ini_get('include_path');
+$path = $openid_path . PATH_SEPARATOR . $path;
+ini_set('include_path', $path);
+
+require_once 'Auth/OpenID.php';
+require_once 'Auth/OpenID/Consumer.php';
+require_once 'Auth/OpenID/SReg.php';
+require_once 'Auth/OpenID/AX.php';
diff --git a/lib/openid_server.php b/lib/openid_server.php
new file mode 100644
index 000000000..c689caf57
--- /dev/null
+++ b/lib/openid_server.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * OpenID library loader for consumers
+ */
+
+$openid_path = dirname(dirname(__FILE__)) . '/vendors/php-openid/';
+$path = ini_get('include_path');
+$path = $openid_path . PATH_SEPARATOR . $path;
+ini_set('include_path', $path);
+
+require_once 'Auth/OpenID.php';
+require_once 'Auth/OpenID/Server.php';
+require_once 'Auth/OpenID/SReg.php';
diff --git a/start.php b/start.php
index 26fa340b0..09725ab17 100644
--- a/start.php
+++ b/start.php
@@ -1,6 +1,12 @@
<?php
/**
- *
+ * OpenID API Library
*/
+elgg_register_event_handler('init', 'system', 'openid_api_init');
+function openid_api_init() {
+ $dir = elgg_get_plugins_path() . 'openid_api/lib/';
+ elgg_register_library('openid_comsumer', "$dir/openid_consumer.php");
+ elgg_register_library('openid_server', "$dir/openid_server.php");
+}