Changeset 20323 for extensions/oAuth/include
- Timestamp:
- Jan 22, 2013, 1:43:58 PM (12 years ago)
- Location:
- extensions/oAuth/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/oAuth/include/install.inc.php
r20293 r20323 11 11 'display_menubar' => true, 12 12 'display_register' => true, 13 'identification_icon' => '38px', 14 'menubar_icon' => '26px', 13 15 )); 14 16 -
extensions/oAuth/include/public_events.inc.php
r20301 r20323 7 7 function oauth_begin_identification() 8 8 { 9 global $template; 10 11 // template icons 12 if ($template->get_template_vars('OAUTH_URL') == null) 13 { 14 $template->assign(array( 15 'OAUTH_URL' => get_root_url() . OAUTH_PATH . 'auth.php?provider=', 16 'OAUTH_PATH' => OAUTH_PATH, 17 'OAUTH_ABS_PATH' => realpath(OAUTH_PATH) . '/', 18 'PROVIDERS' => get_activated_providers(), 19 )); 20 } 21 9 global $template, $conf; 10 11 oauth_assign_template_vars(); 22 12 $template->assign('REDIRECT_TO', !empty($_GET['redirect']) ? urldecode($_GET['redirect']) : get_gallery_home_url()); 23 13 … … 58 48 function oauth_begin_register() 59 49 { 60 global $conf, $template, $hybridauth_conf ;50 global $conf, $template, $hybridauth_conf, $page; 61 51 62 52 // comming from identification page … … 71 61 $adapter = $hybridauth->authenticate($provider); 72 62 $remote_user = $adapter->getUserProfile(); 63 64 $template->assign(array( 65 'OAUTH_PROVIDER' => $provider, 66 'OAUTH_USERNAME' => $remote_user->displayName, 67 'OAUTH_PROFILE_URL' => $remote_user->profileURL, 68 'OAUTH_AVATAR' => $remote_user->photoURL, 69 'OAUTH_PATH' => OAUTH_PATH, 70 )); 71 72 array_push($page['infos'], l10n('Your registration is almost done, please complete the registration form.')); 73 73 74 74 $oauth_id = $provider.'---'.$remote_user->identifier; … … 119 119 120 120 // template 121 $template->set_prefilter('register', 'oauth_add_profile_prefilter'); 121 122 $template->set_prefilter('register', 'oauth_remove_password_fields_prefilter'); 122 123 } … … 128 129 else if ($conf['oauth']['display_register']) 129 130 { 130 // template icons 131 if ($template->get_template_vars('OAUTH_URL') == null) 132 { 133 $template->assign(array( 134 'OAUTH_URL' => get_root_url() . OAUTH_PATH . 'auth.php?provider=', 135 'OAUTH_PATH' => OAUTH_PATH, 136 'OAUTH_ABS_PATH' => realpath(OAUTH_PATH) . '/', 137 'PROVIDERS' => get_activated_providers(), 138 )); 139 } 140 131 oauth_assign_template_vars(); 141 132 $template->assign('REDIRECT_TO', get_gallery_home_url()); 142 133 … … 178 169 'OAUTH_PROVIDER' => $provider, 179 170 'OAUTH_USERNAME' => $remote_user->displayName, 180 'OAUTH_ URL' => $remote_user->profileURL,171 'OAUTH_PROFILE_URL' => $remote_user->profileURL, 181 172 'OAUTH_AVATAR' => $remote_user->photoURL, 182 173 'OAUTH_PATH' => OAUTH_PATH, … … 241 232 } 242 233 243 if ($template->get_template_vars('OAUTH_URL') == null) 244 { 245 $template->assign(array( 246 'OAUTH_URL' => get_root_url() . OAUTH_PATH . 'auth.php?provider=', 247 'OAUTH_PATH' => OAUTH_PATH, 248 'OAUTH_ABS_PATH' => realpath(OAUTH_PATH) . '/', 249 'PROVIDERS' => get_activated_providers(), 250 )); 251 } 252 234 oauth_assign_template_vars(); 253 235 $template->assign('REDIRECT_TO', get_gallery_home_url()); 254 236 … … 282 264 function oauth_add_profile_prefilter($content) 283 265 { 284 $search = ' <legend>{\'Registration\'|@translate}</legend>';266 $search = '#</legend>#'; 285 267 $add = file_get_contents(OAUTH_PATH . 'template/profile.tpl'); 286 return str_replace($search, $search.$add, $content);268 return preg_replace($search, '</legend> '.$add, $content, 1); 287 269 } 288 270 … … 294 276 } 295 277 278 279 function oauth_assign_template_vars() 280 { 281 global $template, $conf; 282 283 if ($template->get_template_vars('OAUTH_URL') == null) 284 { 285 $template->assign(array( 286 'oauth' => $conf['oauth'], 287 'OAUTH_URL' => get_root_url() . OAUTH_PATH . 'auth.php?provider=', 288 'OAUTH_PATH' => OAUTH_PATH, 289 'OAUTH_ABS_PATH' => realpath(OAUTH_PATH) . '/', 290 'PROVIDERS' => get_activated_providers(), 291 'ABS_ROOT_URL' => get_gallery_home_url(), 292 )); 293 } 294 } 296 295 ?>
Note: See TracChangeset
for help on using the changeset viewer.