Changeset 26604 for extensions/oAuth/include/functions.inc.php
- Timestamp:
- Jan 10, 2014, 9:51:32 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/oAuth/include/functions.inc.php
r26556 r26604 23 23 } 24 24 25 function get_activated_providers()25 function oauth_assign_template_vars($u_redirect=null) 26 26 { 27 global $ hybridauth_conf;27 global $template, $conf, $hybridauth_conf; 28 28 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; 29 $conf['oauth']['include_common_template'] = true; 35 30 36 if ($template->get_template_vars('OAUTH _URL') == null)31 if ($template->get_template_vars('OAUTH') == null) 37 32 { 33 $template->assign('OAUTH', array( 34 'conf' => $conf['oauth'], 35 'u_login' => get_root_url() . OAUTH_PATH . 'auth.php?provider=', 36 'providers' => $hybridauth_conf['providers'], 37 )); 38 38 $template->assign(array( 39 'oauth' => $conf['oauth'],40 'OAUTH_URL' => get_root_url() . OAUTH_PATH . 'auth.php?provider=',41 39 'OAUTH_PATH' => OAUTH_PATH, 42 40 'OAUTH_ABS_PATH' => realpath(OAUTH_PATH) . '/', 43 'PROVIDERS' => get_activated_providers(),44 41 'ABS_ROOT_URL' => rtrim(get_gallery_home_url(), '/') . '/', 45 42 )); 46 43 } 44 45 if (isset($u_redirect)) 46 { 47 $template->append('OAUTH', compact('u_redirect'), true); 48 } 47 49 } 50 51 function get_oauth_id($user_id) 52 { 53 global $conf; 54 55 $query = ' 56 SELECT oauth_id FROM ' . USERS_TABLE . ' 57 WHERE ' . $conf['user_fields']['id'] . ' = ' . $user_id . ' 58 AND oauth_id != "" 59 ;'; 60 $result = pwg_query($query); 61 62 if (!pwg_db_num_rows($result)) 63 { 64 return null; 65 } 66 else 67 { 68 list($oauth_id) = pwg_db_fetch_row($result); 69 return $oauth_id; 70 } 71 }
Note: See TracChangeset
for help on using the changeset viewer.