Changeset 20337 for extensions/oAuth
- Timestamp:
- Jan 22, 2013, 9:01:03 PM (11 years ago)
- Location:
- extensions/oAuth
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/oAuth/admin/providers.php
r20324 r20337 8 8 if (isset($_POST['save_config'])) 9 9 { 10 array_walk_recursive($_POST, 'trim');11 12 10 $providers = array(); 13 11 foreach ($_POST['providers'] as $id => $data) … … 42 40 } 43 41 44 if ( !$error)42 if (is_array(@$data['keys'])) 45 43 { 46 $ providers[$id] = $data;44 $data['keys'] = array_map('trim', $data['keys']); 47 45 } 46 47 $providers[$id] = $data; 48 48 } 49 50 $hybridauth_conf['providers'] = $providers; 49 51 50 52 if (!count($page['errors'])) 51 53 { 52 54 // generate config file 53 $hybridauth_conf['providers'] = $providers;54 55 $content = "<?php\ndefined('PHPWG_ROOT_PATH') or die('Hacking attempt!');\n\nreturn "; 55 56 $content.= var_export(array('providers'=>$providers), true); 56 57 $content.= ";\n?>"; 58 57 59 file_put_contents(OAUTH_CONFIG, $content); 60 array_push($page['infos'], l10n('Information data registered in database')); 58 61 } 59 62 } -
extensions/oAuth/auth.php
r20323 r20337 97 97 case 5: 98 98 $template->assign('ERROR', l10n('Authentication canceled')); break; 99 case 404: 100 $template->assign('ERROR', l10n('User not found')); break; 99 101 default: 100 102 $template->assign('ERROR', sprintf(l10n('An error occured, please contact the gallery owner. <i>Error code : %s</i>'), $e->getCode())); -
extensions/oAuth/include/hybridauth/Hybrid/Providers/Tumblr.php
r20293 r20337 32 32 */ 33 33 function getUserProfile() 34 { 35 $response = $this->api->get( 'http://www.tumblr.com/api/authenticate' ); 36 37 // check the last HTTP status code returned 38 if ( $this->api->http_code != 200 ) 39 { 40 throw new Exception( "User profile request failed! {$this->providerId} returned an error: " . $this->errorMessageByStatus( $this->api->http_code ), 6 ); 41 } 42 34 { 43 35 try{ 44 36 $profile = $this->api->get( 'user/info' ); 45 37 46 foreach ( $profile->response->user->blogs as $blog ) 38 foreach ( $profile->response->user->blogs as $blog ){ 47 39 if( $blog->primary ){ 48 40 $bloghostname = explode( '://', $blog->url ); … … 56 48 $this->user->profile->profileURL = $blog->url; 57 49 $this->user->profile->webSiteURL = $blog->url; 50 $this->user->profile->description = strip_tags( $blog->description ); 58 51 59 52 $avatar = $this->api->get( 'blog/'. $this->token( "primary_blog" ) .'/avatar' ); -
extensions/oAuth/include/providers_stats.inc.php
r20301 r20337 54 54 'label' => 'Yahoo', 55 55 'provider_name' => 'Yahoo!', 56 'new_app_link' => 'https://developer.apps.yahoo.com/ dashboard/createKey.html',56 'new_app_link' => 'https://developer.apps.yahoo.com/projects/', 57 57 'userguide_section' => 'http://hybridauth.sourceforge.net/userguide/IDProvider_info_Yahoo.html', 58 58 ), -
extensions/oAuth/main.inc.php
r20324 r20337 106 106 if (defined('IN_ADMIN')) 107 107 { 108 if ( empty($hybridauth_conf))108 if ( empty($hybridauth_conf) and @$_GET['page'] != 'plugin-'.OAUTH_ID ) 109 109 { 110 110 array_push($page['errors'], l10n('OAuth: You need to configure the credentials')); -
extensions/oAuth/template/identification_common.tpl
r20324 r20337 74 74 var idp = $(this).data('idp'); 75 75 var oi = $("#openid_form input[name='openid_identifier']").val(); 76 $("#openid_form input[name='openid_identifier']").val(''); 76 77 77 78 $("#openid_label").removeClass('error'); … … 86 87 } 87 88 88 open_auth("{$OAUTH_URL}OpenID&openid_identifier="+ encode (oi));89 open_auth("{$OAUTH_URL}OpenID&openid_identifier="+ encodeURI(oi)); 89 90 $.colorbox.close(); 90 91 return false;
Note: See TracChangeset
for help on using the changeset viewer.