Rev | Line | |
---|
[20293] | 1 | <?php |
---|
| 2 | defined('OAUTH_PATH') or die('Hacking attempt!'); |
---|
| 3 | |
---|
| 4 | function load_hybridauth_conf() |
---|
| 5 | { |
---|
[20368] | 6 | global $hybridauth_conf, $conf; |
---|
[20293] | 7 | |
---|
| 8 | if (file_exists(PHPWG_ROOT_PATH.OAUTH_CONFIG)) |
---|
| 9 | { |
---|
| 10 | $hybridauth_conf = include(PHPWG_ROOT_PATH.OAUTH_CONFIG); |
---|
| 11 | $hybridauth_conf['base_url'] = OAUTH_PUBLIC; |
---|
[20368] | 12 | if (!empty($conf['oauth_debug_file'])) |
---|
| 13 | { |
---|
| 14 | $hybridauth_conf['debug_mode'] = true; |
---|
| 15 | $hybridauth_conf['debug_file'] = $conf['oauth_debug_file']; |
---|
| 16 | } |
---|
[20293] | 17 | return true; |
---|
| 18 | } |
---|
| 19 | else |
---|
| 20 | { |
---|
| 21 | return false; |
---|
| 22 | } |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | function get_activated_providers() |
---|
| 26 | { |
---|
| 27 | global $hybridauth_conf; |
---|
| 28 | |
---|
[23808] | 29 | return array_filter($hybridauth_conf['providers'], create_function('$p', 'return $p["enabled"];')); |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | function oauth_assign_template_vars() |
---|
| 33 | { |
---|
| 34 | global $template, $conf; |
---|
[20293] | 35 | |
---|
[23808] | 36 | if ($template->get_template_vars('OAUTH_URL') == null) |
---|
[20293] | 37 | { |
---|
[23808] | 38 | $template->assign(array( |
---|
| 39 | 'oauth' => $conf['oauth'], |
---|
| 40 | 'OAUTH_URL' => get_root_url() . OAUTH_PATH . 'auth.php?provider=', |
---|
| 41 | 'OAUTH_PATH' => OAUTH_PATH, |
---|
| 42 | 'OAUTH_ABS_PATH' => realpath(OAUTH_PATH) . '/', |
---|
| 43 | 'PROVIDERS' => get_activated_providers(), |
---|
| 44 | 'ABS_ROOT_URL' => rtrim(get_gallery_home_url(), '/') . '/', |
---|
| 45 | )); |
---|
[20293] | 46 | } |
---|
| 47 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.