FIX: Combine auth.php to login.php
[phorkie.git] / src / openid / config.php
1 <?php
2 /**
3  * OpenID 
4  * 
5  * PHP Version 5.2.0+
6  * 
7  * @category  Auth
8  * @package   OpenID
9  * @author    Bill Shupp <hostmaster@shupp.org> 
10  * @copyright 2009 Bill Shupp
11  * @license   http://www.opensource.org/licenses/bsd-license.php FreeBSD
12  * @link      http://github.com/shupp/openid
13  */
14
15 set_include_path(dirname(__FILE__) . '/../../:' . get_include_path());
16
17 /**
18  * Required files
19  */
20 require_once 'OpenID/RelyingParty.php';
21 require_once 'OpenID/Discover.php';
22 require_once 'OpenID/Store.php';
23 require_once 'OpenID/Extension/SREG10.php';
24 require_once 'OpenID/Extension/SREG11.php';
25 require_once 'OpenID/Extension/AX.php';
26 require_once 'OpenID/Extension/UI.php';
27 require_once 'OpenID/Extension/OAuth.php';
28 require_once 'OpenID/Message.php';
29 require_once 'OpenID/Observer/Log.php';
30 require_once 'Net/URL2.php';
31
32 // Determine realm and return_to
33 $base = 'http';
34 if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
35     $base .= 's';
36 }
37 $base .= '://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'];
38
39 $realm    = $base . '/';
40 $returnTo = $base . dirname($_SERVER['PHP_SELF']);
41 if ($returnTo[strlen($returnTo) - 1] != '/') {
42     $returnTo .= '/';
43 }
44 $returnTo .= 'login';
45
46 // SQL storage example
47 // $storeOptions = array(
48 //     'dsn' => 'mysql://user:pass@db.example.com/openid'
49 // );
50 // OpenID::setStore(OpenID_Store::factory('MDB2', $storeOptions));
51 //
52 // // The first time you run it, you'll also need to create the tables:
53 // OpenID::getStore()->createTables();
54
55 ?>