From 43d0c82c9c74798ed2d2174159a2e3aa6f957864 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 17 Jun 2008 10:49:42 -0400 Subject: beginnings of OpenID login darcs-hash:20080617144942-84dde-a2a1040a42254903a64cff0aae3c1912ed951473.gz --- lib/openid.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 lib/openid.php (limited to 'lib/openid.php') diff --git a/lib/openid.php b/lib/openid.php new file mode 100644 index 000000000..2485976ee --- /dev/null +++ b/lib/openid.php @@ -0,0 +1,40 @@ +. + */ + +if (!defined('LACONICA')) { exit(1); } + +require_once('Auth/OpenID/Consumer.php'); +require_once('Auth/OpenID/MySQLStore.php'); + +function oid_store() { + static $store = NULL; + if (!$store) { + # Can't be called statically + $user = new User(); + $conn = $user->getDatabaseConnection(); + $store = new Auth_OpenID_SQLStore($conn); + } + return $store; +} + +function oid_consumer() { + $store = oid_store(); + $consumer = Auth_OpenID_Consumer($store); + return $consumer; +} \ No newline at end of file -- cgit v1.2.3-54-g00ecf