]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
added consumer and server libs that can be loaded using Elgg's api
authorCash Costello <cash.costello@gmail.com>
Tue, 13 Dec 2011 00:16:56 +0000 (19:16 -0500)
committerCash Costello <cash.costello@gmail.com>
Tue, 13 Dec 2011 00:16:56 +0000 (19:16 -0500)
lib/openid_consumer.php [new file with mode: 0644]
lib/openid_server.php [new file with mode: 0644]
start.php

diff --git a/lib/openid_consumer.php b/lib/openid_consumer.php
new file mode 100644 (file)
index 0000000..3dfc09a
--- /dev/null
@@ -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 (file)
index 0000000..c689caf
--- /dev/null
@@ -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';
index 26fa340b0d3956442334c25f0d488bdac1453033..09725ab17c4133f25522b26e3d78c50dc3371f23 100644 (file)
--- 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");
+}