Changeset 26556 for extensions/oAuth
- Timestamp:
- Jan 9, 2014, 7:55:29 PM (10 years ago)
- Location:
- extensions/oAuth
- Files:
-
- 1 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/oAuth/admin.php
r21303 r26556 6 6 if (!$conf['allow_user_registration']) 7 7 { 8 array_push($page['warnings'], l10n('Users are not allowed to register on your gallery. OAuth will not work correctly.'));8 $page['warnings'][] = l10n('Users are not allowed to register on your gallery. OAuth will not work correctly.'); 9 9 } 10 10 … … 31 31 // send page content 32 32 $template->assign_var_from_handle('ADMIN_CONTENT', 'oauth_content'); 33 34 ?> -
extensions/oAuth/admin/config.php
r20323 r26556 1 1 <?php 2 2 defined('OAUTH_PATH') or die('Hacking attempt!'); 3 4 3 5 4 if (isset($_POST['save_config'])) … … 14 13 15 14 conf_update_param('oauth', serialize($conf['oauth'])); 16 array_push($page['infos'], l10n('Information data registered in database'));15 $page['infos'][] = l10n('Information data registered in database'); 17 16 } 18 17 … … 21 20 // define template file 22 21 $template->set_filename('oauth_content', realpath(OAUTH_PATH . 'admin/template/config.tpl')); 23 24 ?> -
extensions/oAuth/admin/providers.php
r23808 r26556 19 19 (!@$PROVIDERS_CONFIG[$id]['require_client_id'] and empty($data['keys']['key'])) 20 20 ) { 21 array_push($page['errors'], sprintf(l10n('%s: invalid keys'), $PROVIDERS_CONFIG[$id]['provider_name']));21 $page['errors'][] = l10n('%s: invalid keys', $PROVIDERS_CONFIG[$id]['provider_name']); 22 22 } 23 23 } … … 25 25 if ( ($id=='Wordpress' or $id=='Flickr' or $id=='Steam') and $data['enabled'] and !@$providers['OpenID']['enabled'] ) // in the template, OpenID must be before other OpenID based providers 26 26 { 27 array_push($page['errors'], sprintf(l10n('OpenID must be enabled in order to use %s authentication'), $id));27 $page['errors'][] = l10n('OpenID must be enabled in order to use %s authentication', $id); 28 28 } 29 29 … … 52 52 53 53 file_put_contents(OAUTH_CONFIG, $content); 54 array_push($page['infos'], l10n('Information data registered in database'));54 $page['infos'][] = l10n('Information data registered in database'); 55 55 } 56 56 } … … 66 66 // define template file 67 67 $template->set_filename('oauth_content', realpath(OAUTH_PATH . 'admin/template/providers.tpl')); 68 69 ?> -
extensions/oAuth/admin/template/config.tpl
r20620 r26556 1 {combine_css path=$OAUTH_PATH|cat: "admin/template/style.css"}1 {combine_css path=$OAUTH_PATH|cat:'admin/template/style.css'} 2 2 {combine_css path=$OAUTH_PATH|cat:'template/oauth_sprites.css'} 3 3 … … 12 12 <label> 13 13 <input type="checkbox" name="display_menubar" {if $display_menubar}checked="checked"{/if}> 14 <b>{'Display sign in buttons in the menubar'| @translate}</b>14 <b>{'Display sign in buttons in the menubar'|translate}</b> 15 15 </label> 16 16 </li> … … 19 19 <label> 20 20 <input type="checkbox" name="display_register" {if $display_register}checked="checked"{/if}> 21 <b>{'Display sign in buttons on the register page'| @translate}</b>21 <b>{'Display sign in buttons on the register page'|translate}</b> 22 22 </label> 23 23 </li> … … 28 28 <ul> 29 29 <li> 30 <b>{'Icon size on the identification page'| @translate} :</b><br>30 <b>{'Icon size on the identification page'|translate} :</b><br> 31 31 <label> 32 32 <input type="radio" name="identification_icon" value="16px" {if $identification_icon=='16px'}checked="checked"{/if}> … … 53 53 54 54 <li> 55 <b>{'Icon size in the menubar'| @translate} :</b><br>55 <b>{'Icon size in the menubar'|translate} :</b><br> 56 56 <label> 57 57 <input type="radio" name="menubar_icon" value="16px" {if $menubar_icon=='16px'}checked="checked"{/if}> … … 79 79 </fieldset> 80 80 81 <p style="text-align:left;"><input type="submit" name="save_config" value="{'Save Settings'| @translate}"></p>81 <p style="text-align:left;"><input type="submit" name="save_config" value="{'Save Settings'|translate}"></p> 82 82 </form> 83 83 -
extensions/oAuth/admin/template/providers.tpl
r26555 r26556 1 {combine_css path=$OAUTH_PATH|cat: "admin/template/style.css"}1 {combine_css path=$OAUTH_PATH|cat:'admin/template/style.css'} 2 2 {combine_css path=$OAUTH_PATH|cat:'template/oauth_sprites.css'} 3 3 4 {footer_script} {literal}4 {footer_script} 5 5 jQuery("select.enable").change(function() { 6 6 var $top = $(this).closest("div.provider"); … … 20 20 21 21 jQuery("#close_help").click(function() { 22 jQuery("#help_container").animate({ "margin-right": "-550px"}, 'fast');22 jQuery("#help_container").animate({ "margin-right": "-550px" }, 'fast'); 23 23 return false; 24 24 }); … … 30 30 $("#help_container h5").html($top.find("h4").html()); 31 31 $("#help_container div").html($top.find("div.help").html()); 32 $("#help_container").animate({ "margin-right": "0px"}, 'fast');32 $("#help_container").animate({ "margin-right": "0px" }, 'fast'); 33 33 return false; 34 34 }); 35 {/ literal}{/footer_script}35 {/footer_script} 36 36 37 37 … … 41 41 42 42 <div id="help_container"> 43 <a href="#" id="close_help" title="{'Close'| @translate}">×</a>43 <a href="#" id="close_help" title="{'Close'|translate}">×</a> 44 44 <h5></h5> 45 45 <div></div> … … 60 60 <td> 61 61 <select name="providers[{$p}][enabled]" class="enable"> 62 <option value="true" {if $CONFIG[$p].enabled}selected="selected"{/if}>{'Enabled'| @translate}</option>63 <option value="false" {if not $CONFIG[$p].enabled}selected="selected"{/if}>{'Disabled'| @translate}</option>62 <option value="true" {if $CONFIG[$p].enabled}selected="selected"{/if}>{'Enabled'|translate}</option> 63 <option value="false" {if not $CONFIG[$p].enabled}selected="selected"{/if}>{'Disabled'|translate}</option> 64 64 </select> 65 <br><a href="#" class="open-help">{'Help'| @translate}</a>65 <br><a href="#" class="open-help">{'Help'|translate}</a> 66 66 </td> 67 67 … … 85 85 {if $provider.new_app_link} 86 86 <ol> 87 <li>{'Go to <a href="%s" target="_blank">%s</a> and create a new application'| @translate|sprintf:$provider.new_app_link:$provider.new_app_link}</li>87 <li>{'Go to <a href="%s" target="_blank">%s</a> and create a new application'|translate|sprintf:$provider.new_app_link:$provider.new_app_link}</li> 88 88 89 89 {if $p=='Google'} 90 <li>{'On the <b>APIs & auth -> Credentials</b> tab, <b>Create new client ID</b>'| @translate}</li>90 <li>{'On the <b>APIs & auth -> Credentials</b> tab, <b>Create new client ID</b>'|translate}</li> 91 91 {else} 92 <li>{'Fill out any required fields such as the application name and description'| @translate}</li>92 <li>{'Fill out any required fields such as the application name and description'|translate}</li> 93 93 {/if} 94 94 … … 96 96 <li> 97 97 {assign var=callback value=$OAUTH_CALLBACK|cat:$p} 98 {'Provide this URL as the Callback/Redirect URL for your application: <em>%s</em>'| @translate|sprintf:$callback}98 {'Provide this URL as the Callback/Redirect URL for your application: <em>%s</em>'|translate|sprintf:$callback} 99 99 </li> 100 100 {/if} 101 101 102 102 {if $p=='Live'} 103 <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'| @translate|sprintf:'<b>Redirect Domain</b>':$SERVERNAME}</li>103 <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|translate|sprintf:'<b>Redirect Domain</b>':$SERVERNAME}</li> 104 104 {elseif $p=='Facebook'} 105 105 <li>{'Go to <b>Settings->Advanced</b> and activate <em>Client OAuth Login</em>.'|translate}</li> 106 <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'| @translate|sprintf:'<b>Valid OAuth redirect URIs</b>':$SERVERNAME}</li>106 <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|translate|sprintf:'<b>Valid OAuth redirect URIs</b>':$SERVERNAME}</li> 107 107 {elseif $p=='LinkedIn'} 108 <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'| @translate|sprintf:'<b>Website URL</b>':$SERVERNAME}</li>109 <li>{'Set <b>%s</b> to <em>%s</em>'| @translate|sprintf:'Application Type':'Web Application'}</li>110 <li>{'Set <b>%s</b> to <em>%s</em>'| @translate|sprintf:'Default Scope':'r_basicprofile & r_emailaddress'}</li>108 <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|translate|sprintf:'<b>Website URL</b>':$SERVERNAME}</li> 109 <li>{'Set <b>%s</b> to <em>%s</em>'|translate|sprintf:'Application Type':'Web Application'}</li> 110 <li>{'Set <b>%s</b> to <em>%s</em>'|translate|sprintf:'Default Scope':'r_basicprofile & r_emailaddress'}</li> 111 111 {elseif $p=='Yahoo'} 112 <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'| @translate|sprintf:'<b>Application URL</b>, <b>Application Domain</b>':$SERVERNAME}</li>113 <li>{'Set <b>%s</b> to <em>%s</em>'| @translate|sprintf:'Kind of Application':'Web-based'}</li>114 <li>{'Set <b>%s</b> to <em>%s</em>'| @translate|sprintf:'Access Scopes':'This app will only access public...'}</li>115 <li>{'Once the application is registered update the permissions : set <b>Contacts</b> as <em>Read</em> and <b>Social Directory</b> as <em>Read Public</em>'| @translate}</li>112 <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|translate|sprintf:'<b>Application URL</b>, <b>Application Domain</b>':$SERVERNAME}</li> 113 <li>{'Set <b>%s</b> to <em>%s</em>'|translate|sprintf:'Kind of Application':'Web-based'}</li> 114 <li>{'Set <b>%s</b> to <em>%s</em>'|translate|sprintf:'Access Scopes':'This app will only access public...'}</li> 115 <li>{'Once the application is registered update the permissions : set <b>Contacts</b> as <em>Read</em> and <b>Social Directory</b> as <em>Read Public</em>'|translate}</li> 116 116 {elseif $p=='Twitter'} 117 <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'| @translate|sprintf:'<b>Website</b>, <b>Callback URL</b>':$SERVERNAME}</li>117 <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|translate|sprintf:'<b>Website</b>, <b>Callback URL</b>':$SERVERNAME}</li> 118 118 {elseif $p=='Tumblr'} 119 <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'| @translate|sprintf:'<b>Application Website</b>, <b>Default Callback URL</b>':$SERVERNAME}</li>119 <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|translate|sprintf:'<b>Application Website</b>, <b>Default Callback URL</b>':$SERVERNAME}</li> 120 120 {elseif $p=='Instagram'} 121 <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'| @translate|sprintf:'<b>Website</b>':$SERVERNAME}</li>121 <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|translate|sprintf:'<b>Website</b>':$SERVERNAME}</li> 122 122 {elseif $p=='Google'} 123 <li>{'Set <b>%s</b> to <em>%s</em>'| @translate|sprintf:'Application Type':'Web Application'}</li>124 <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'| @translate|sprintf:'<b>Authorized Javascript origins </b>':$SERVERNAME}</li>123 <li>{'Set <b>%s</b> to <em>%s</em>'|translate|sprintf:'Application Type':'Web Application'}</li> 124 <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|translate|sprintf:'<b>Authorized Javascript origins </b>':$SERVERNAME}</li> 125 125 {/if} 126 126 127 <li>{'Once you have registered, copy and past the created application credentials into this setup page'| @translate}</li>127 <li>{'Once you have registered, copy and past the created application credentials into this setup page'|translate}</li> 128 128 </ol> 129 129 {else} 130 <p>{'No registration required for OpenID based providers'| @translate}</p>130 <p>{'No registration required for OpenID based providers'|translate}</p> 131 131 {/if} 132 132 </div> … … 136 136 </fieldset> 137 137 138 <p style="text-align:left;"><input type="submit" name="save_config" value="{'Save Settings'| @translate}"></p>138 <p style="text-align:left;"><input type="submit" name="save_config" value="{'Save Settings'|translate}"></p> 139 139 140 140 </form> -
extensions/oAuth/admin/template/style.css
r23808 r26556 1 .showInfo {2 position:static;3 display:inline-block;4 padding:1px 6px;5 width:4px;6 height:14px;7 line-height:14px;8 font-size:0.8em;9 }10 11 1 .content h4 { 12 2 text-align:left; -
extensions/oAuth/auth.php
r23808 r26556 100 100 $template->assign('ERROR', l10n('User not found')); break; 101 101 default: 102 $template->assign('ERROR', sprintf(l10n('An error occured, please contact the gallery owner. <i>Error code : %s</i>'), '<span title="'.$e->getMessage().'">'.$e->getCode().'</span>'));102 $template->assign('ERROR', l10n('An error occured, please contact the gallery owner. <i>Error code : %s</i>', '<span title="'.$e->getMessage().'">'.$e->getCode().'</span>')); 103 103 } 104 104 } … … 117 117 $template->set_filename('index', realpath(OAUTH_PATH . 'template/auth.tpl')); 118 118 $template->pparse('index'); 119 ?> -
extensions/oAuth/include/functions.inc.php
r23808 r26556 46 46 } 47 47 } 48 49 ?> -
extensions/oAuth/include/public_events.inc.php
r24142 r26556 1 1 <?php 2 2 defined('OAUTH_PATH') or die('Hacking attempt!'); 3 4 function oauth_anti_lightbox($tpl_thumbnails_var)5 {6 global $template, $page;7 8 if ($page['section'] == 'collections' && !empty($template->css_by_priority[0]))9 {10 foreach ($template->css_by_priority[0] as $file)11 {12 if (strpos($file[0], 'colorbox.css') !== false)13 {14 $template->assign('OAUTH_NO_LIGHTBOX', true);15 break;16 }17 }18 }19 20 return $tpl_thumbnails_var;21 }22 3 23 4 /** … … 52 33 list($oauth_id) = pwg_db_fetch_row($result); 53 34 list($provider) = explode('---', $oauth_id); 54 $_SESSION['page_errors'][] = sprintf(l10n('You registered with a %s account, please sign in with the same account.'), $provider);35 $_SESSION['page_errors'][] = l10n('You registered with a %s account, please sign in with the same account.', $provider); 55 36 56 37 $redirect_to = get_root_url().'identification.php'; // variable used by identification.php … … 96 77 )); 97 78 98 array_push($page['infos'], l10n('Your registration is almost done, please complete the registration form.'));79 $page['infos'][] = l10n('Your registration is almost done, please complete the registration form.'); 99 80 100 81 $oauth_id = $provider.'---'.$remote_user->identifier; … … 141 122 } 142 123 catch (Exception $e) { 143 array_push($page['errors'], sprintf(l10n('An error occured, please contact the gallery owner. <i>Error code : %s</i>'), $e->getCode()));124 $page['errors'][] = l10n('An error occured, please contact the gallery owner. <i>Error code : %s</i>', $e->getCode()); 144 125 } 145 126 } … … 196 177 } 197 178 catch (Exception $e) { 198 array_push($page['errors'], sprintf(l10n('An error occured, please contact the gallery owner. <i>Error code : %s</i>'), $e->getCode()));179 $page['errors'][] = l10n('An error occured, please contact the gallery owner. <i>Error code : %s</i>', $e->getCode()); 199 180 } 200 181 } … … 231 212 } 232 213 catch (Exception $e) { 233 $_SESSION['page_errors'][] = sprintf(l10n('An error occured, please contact the gallery owner. <i>Error code : %s</i>'), $e->getCode());214 $_SESSION['page_errors'][] = l10n('An error occured, please contact the gallery owner. <i>Error code : %s</i>', $e->getCode()); 234 215 } 235 216 } … … 245 226 $menu = &$menu_ref_arr[0]; 246 227 247 if ( !$conf['oauth']['display_menubar'] or $menu->get_block('mbIdentification') == null)228 if (!$conf['oauth']['display_menubar'] or $menu->get_block('mbIdentification') == null) 248 229 { 249 230 return; … … 293 274 return str_replace($search, $search.$add, $content); 294 275 } 295 296 ?> -
extensions/oAuth/main.inc.php
r24142 r26556 11 11 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 12 12 13 // +-----------------------------------------------------------------------+ 14 // | Define plugin constants | 15 // +-----------------------------------------------------------------------+ 16 defined('OAUTH_ID') or define('OAUTH_ID', basename(dirname(__FILE__))); 13 14 define('OAUTH_ID', basename(dirname(__FILE__))); 17 15 define('OAUTH_PATH' , PHPWG_PLUGINS_PATH . OAUTH_ID . '/'); 18 16 define('OAUTH_ADMIN', get_root_url() . 'admin.php?page=plugin-' . OAUTH_ID); … … 22 20 23 21 24 // +-----------------------------------------------------------------------+ 25 // | Event handlers | 26 // +-----------------------------------------------------------------------+ 27 global $conf, $hybridauth_conf; 28 29 add_event_handler('init', 'oauth_init'); 22 // try to load hybridauth config 23 global $hybridauth_conf; 30 24 31 25 include_once(OAUTH_PATH . 'include/functions.inc.php'); 32 26 33 // try to load hybridauth config34 27 if (file_exists(PHPWG_ROOT_PATH.OAUTH_CONFIG)) 35 28 { … … 37 30 } 38 31 32 33 add_event_handler('init', 'oauth_init'); 34 39 35 if (defined('IN_ADMIN')) 40 36 { 41 37 add_event_handler('get_admin_plugin_menu_links', 'oauth_admin_plugin_menu_links'); 42 43 function oauth_admin_plugin_menu_links($menu)44 {45 array_push($menu, array(46 'NAME' => l10n('OAuth'),47 'URL' => OAUTH_ADMIN,48 ));49 return $menu;50 }51 38 } 52 39 else if (!empty($hybridauth_conf) and function_exists('curl_init')) … … 61 48 add_event_handler('blockmanager_apply', 'oauth_blockmanager'); 62 49 63 add_event_handler('loc_end_index_thumbnails', 'oauth_anti_lightbox', 41);64 65 50 include_once(OAUTH_PATH . 'include/public_events.inc.php'); 66 51 } … … 72 57 function oauth_init() 73 58 { 74 global $conf, $p wg_loaded_plugins, $page, $hybridauth_conf;59 global $conf, $page, $hybridauth_conf; 75 60 76 // apply upgrade if needed 77 if ( 78 OAUTH_VERSION == 'auto' or 79 $pwg_loaded_plugins[OAUTH_ID]['version'] == 'auto' or 80 version_compare($pwg_loaded_plugins[OAUTH_ID]['version'], OAUTH_VERSION, '<') 81 ) 82 { 83 include_once(OAUTH_PATH . 'include/install.inc.php'); 84 oauth_install(); 85 86 if ( $pwg_loaded_plugins[OAUTH_ID]['version'] != 'auto' and OAUTH_VERSION != 'auto' ) 87 { 88 $query = ' 89 UPDATE '. PLUGINS_TABLE .' 90 SET version = "'. OAUTH_VERSION .'" 91 WHERE id = "'. OAUTH_ID .'"'; 92 pwg_query($query); 93 94 $pwg_loaded_plugins[OAUTH_ID]['version'] = OAUTH_VERSION; 95 96 if (defined('IN_ADMIN')) 97 { 98 $_SESSION['page_infos'][] = 'OAuth updated to version '. OAUTH_VERSION; 99 } 100 } 101 } 61 include_once(OAUTH_PATH . 'maintain.inc.php'); 62 $maintain = new oAuth_maintain(OAUTH_ID); 63 $maintain->autoUpdate(OAUTH_VERSION, 'install'); 102 64 103 65 load_language('plugin.lang', OAUTH_PATH); … … 108 70 if (defined('IN_ADMIN')) 109 71 { 110 if ( empty($hybridauth_conf) and strpos(@$_GET['page'],'plugin-'.OAUTH_ID)===false)72 if (empty($hybridauth_conf) and strpos(@$_GET['page'],'plugin-'.OAUTH_ID)===false) 111 73 { 112 array_push($page['warnings'], '<a href="'.OAUTH_ADMIN.'">'.l10n('OAuth: You need to configure the credentials').'</a>');74 $page['warnings'][] = '<a href="'.OAUTH_ADMIN.'">'.l10n('OAuth: You need to configure the credentials').'</a>'; 113 75 } 114 76 if (!function_exists('curl_init')) 115 77 { 116 array_push($page['warnings'], l10n('OAuth: PHP Curl extension is needed'));78 $page['warnings'][] = l10n('OAuth: PHP Curl extension is needed'); 117 79 } 118 80 } … … 136 98 } 137 99 138 ?> 100 function oauth_admin_plugin_menu_links($menu) 101 { 102 $menu[] = array( 103 'NAME' => l10n('OAuth'), 104 'URL' => OAUTH_ADMIN, 105 ); 106 return $menu; 107 } -
extensions/oAuth/maintain.inc.php
r20293 r26556 2 2 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 3 3 4 defined('OAUTH_ID') or define('OAUTH_ID', basename(dirname(__FILE__))); 5 include_once(PHPWG_PLUGINS_PATH . OAUTH_ID . '/include/install.inc.php'); 4 class oAuth_maintain extends PluginMaintain 5 { 6 private $installed = false; 7 8 private $default_conf = array( 9 'display_menubar' => true, 10 'display_register' => true, 11 'identification_icon' => '38px', 12 'menubar_icon' => '26px', 13 ); 6 14 15 function install($plugin_version, &$errors=array()) 16 { 17 global $conf; 7 18 8 function plugin_install() 9 { 10 oauth_install(); 11 define('oauth_installed', true); 12 } 19 if (empty($conf['oauth'])) 20 { 21 $conf['oauth'] = serialize($this->default_conf); 22 conf_update_param('oauth', $conf['oauth']); 23 } 24 25 $result = pwg_query('SHOW COLUMNS FROM `' . USERS_TABLE . '` LIKE "oauth_id";'); 26 if (!pwg_db_num_rows($result)) 27 { 28 pwg_query('ALTER TABLE `' . USERS_TABLE . '` ADD `oauth_id` VARCHAR(255) DEFAULT NULL;'); 29 } 13 30 31 $this->installed = true; 32 } 14 33 15 function plugin_activate() 16 { 17 if (!defined('oauth_installed')) 34 function activate($plugin_version, &$errors=array()) 18 35 { 19 oauth_install(); 36 if (!$this->installed) 37 { 38 $this->install($plugin_version, $errors); 39 } 40 } 41 42 function deactivate() 43 { 44 } 45 46 function uninstall() 47 { 48 conf_delete_param('oauth'); 49 50 pwg_query('ALTER TABLE `'. USERS_TABLE .'` DROP `oauth_id`;'); 51 52 @unlink(PHPWG_PLUGINS_PATH . PWG_LOCAL_DIR . 'config/hybridauth.inc.php'); 20 53 } 21 54 } 22 23 function plugin_uninstall()24 {25 pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param = "oauth" LIMIT 1;');26 pwg_query('ALTER TABLE `'. USERS_TABLE .'` DROP `oauth_id`;');27 @unlink(PHPWG_PLUGINS_PATH . PWG_LOCAL_DIR . 'config/hybridauth.inc.php');28 }29 30 ?> -
extensions/oAuth/template/auth.tpl
r23808 r26556 2 2 <html lang="{$lang_info.code}" dir="{$lang_info.direction}"> 3 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset={$CONTENT_ENCODING}">5 <title>{'Sign in with %s'| @translate|sprintf:$PROVIDER} | {$GALLERY_TITLE}</title>4 <meta charset="{$CONTENT_ENCODING}"> 5 <title>{'Sign in with %s'|translate:$PROVIDER} | {$GALLERY_TITLE}</title> 6 6 </head> 7 7 … … 11 11 {if $ERROR} 12 12 <img id="loader" src="{$OAUTH_PATH}template/images/alert.png"> 13 <h3>{'Error...'| @translate}</h3>13 <h3>{'Error...'|translate}</h3> 14 14 {$ERROR}<br> 15 <a href="#" id="close">{'Close'| @translate}</a>15 <a href="#" id="close">{'Close'|translate}</a> 16 16 17 17 <script type="text/javascript"> 18 document.getElementById('close').onclick = function() { ldelim}window.self.close(); };18 document.getElementById('close').onclick = function() { window.self.close(); }; 19 19 </script> 20 20 21 21 {elseif $LOADING} 22 22 <img id="loader" src="{$OAUTH_PATH}template/images/ajax-loader-big.gif"> 23 <h3>{'Loading...'| @translate}</h3>24 {'Contacting <b>%s</b>. Please wait.'| @translate|sprintf:$PROVIDER}23 <h3>{'Loading...'|translate}</h3> 24 {'Contacting <b>%s</b>. Please wait.'|translate:$PROVIDER} 25 25 26 26 <script type="text/javascript"> -
extensions/oAuth/template/identification_common.tpl
r24142 r26556 1 1 {combine_css path=$OAUTH_PATH|cat:'template/oauth_sprites.css'} 2 2 3 {html_style}{literal} 4 #openid_form { 5 padding:20px; 6 } 7 #openid_form h3, #openid_form .oauth_38px { 8 display:inline-block; 9 vertical-align:middle; 10 margin:0; 11 } 12 #openid_label.error { 13 color:red; 14 font-weight:bold; 15 } 16 {/literal}{/html_style} 3 {combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'} 4 {combine_css id='colorbox' path="themes/default/js/plugins/colorbox/style2/colorbox.css"} 17 5 18 {if not isset($OAUTH_NO_LIGHTBOX)} 19 {combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'} 20 {combine_css path="themes/default/js/plugins/colorbox/style2/colorbox.css"} 21 {/if} 6 {html_style} 7 #openid_form { padding:20px; } 8 #openid_form h3, #openid_form .oauth_38px { display:inline-block; vertical-align:middle; margin:0; } 9 #openid_label.error { color:red; font-weight:bold; } 10 {/html_style} 22 11 23 {footer_script} {literal}12 {footer_script} 24 13 // redirect, called from the popup 25 14 function redirect(type) { 26 {/literal} 27 url = "{$REDIRECT_TO}"; 28 if (typeof type != 'undefined' && type != 'default') {ldelim} 15 var url = "{$REDIRECT_TO}"; 16 if (typeof type != 'undefined' && type != 'default') { 29 17 url = "{$ABS_ROOT_URL}"+ type +".php"; 30 18 } 31 {literal} 19 32 20 window.location.href = url; 33 21 } … … 49 37 case 'OpenID': case 'Wordpress': case 'Flickr': case 'Steam': 50 38 switch(idp) { 51 {/literal}52 39 case 'OpenID': 53 jQuery("#openid_label").html('{'Please enter your OpenID URL'| @translate|escape:javascript}'); break;40 jQuery("#openid_label").html('{'Please enter your OpenID URL'|translate|escape:javascript}'); break; 54 41 case 'Wordpress': case 'Flickr': case 'Steam': 55 jQuery("#openid_label").html('{'Please enter your username'| @translate|escape:javascript}'); break;42 jQuery("#openid_label").html('{'Please enter your username'|translate|escape:javascript}'); break; 56 43 } 57 44 58 jQuery("#openid_form").css('background-color', $("#the_page #content").css('background-color')); 45 var bg_color = $('#the_page #content').css('background-color'); 46 if (!bg_color || bg_color=='transparent') { 47 bg_color = $('body').css('background-color'); 48 } 49 jQuery("#openid_form").css('background-color', bg_color); 50 59 51 jQuery("#openid_form .oauth_38px").removeClass().addClass("oauth_38px " + idp.toLowerCase()); 60 52 jQuery("#openid_form h3").html(idp); 61 53 jQuery("#openid_form").data('idp', idp); 62 {literal} 54 63 55 jQuery.colorbox({ 64 56 inline:true, … … 66 58 initialWidth:0, 67 59 initialHeight:0, 68 onComplete: function(){ jQuery.colorbox.resize({speed:0}) } // prevent misalignement when icon not loaded60 onComplete: function(){ jQuery.colorbox.resize({ speed:0 }) } // prevent misalignement when icon not loaded 69 61 }) 70 62 break; 71 63 72 64 default: 73 {/literal}74 65 open_auth("{$OAUTH_URL}"+ idp); 75 {literal}76 66 } 77 67 … … 95 85 case 'Steam': oi = "http://steamcommunity.com/openid/" + oi; break; 96 86 } 97 {/literal} 87 98 88 open_auth("{$OAUTH_URL}OpenID&openid_identifier="+ encodeURI(oi)); 99 {literal} 89 100 90 jQuery.colorbox.close(); 101 91 return false; … … 107 97 return false; 108 98 }); 109 {/ literal}{/footer_script}99 {/footer_script} 110 100 111 101 <div style="display:none;"> … … 123 113 <div> 124 114 <br> 125 <input type="submit" name="{'Submit'| @translate}">126 <a href="#" id="openid_cancel">{'Cancel'| @translate}</a>115 <input type="submit" name="{'Submit'|translate}"> 116 <a href="#" id="openid_cancel">{'Cancel'|translate}</a> 127 117 </div> 128 118 </form> -
extensions/oAuth/template/identification_menubar.tpl
r21584 r26556 4 4 {include file=$OAUTH_ABS_PATH|cat:'template/identification_common.tpl'} 5 5 {/if} 6 {html_style}{literal} 7 dl#mbIdentification dd:first-of-type { 8 padding-bottom:0 !important; 9 } 10 #mbIdentification .oauth { 11 margin:0 1px; 12 } 13 {/literal}{/html_style} 6 {html_style} 7 dl#mbIdentification dd:first-of-type { padding-bottom:0 !important; 8 #mbIdentification .oauth { margin:0 1px; } 9 {/html_style} 14 10 15 11 <dd> 16 12 <form id="quickconnect"> 17 13 <fieldset style="text-align:center;"> 18 <legend>{'Or sign in with'| @translate}</legend>14 <legend>{'Or sign in with'|translate}</legend> 19 15 20 16 {foreach from=$PROVIDERS item=provider key=p}{strip} -
extensions/oAuth/template/identification_page.tpl
r21584 r26556 4 4 {include file=$OAUTH_ABS_PATH|cat:'template/identification_common.tpl'} 5 5 {/if} 6 {html_style}{literal} 7 #oauth_wrap .oauth { 8 margin:0 2px; 9 } 10 {/literal}{/html_style} 6 {html_style} 7 #oauth_wrap .oauth { margin:0 2px; } 8 {/html_style} 11 9 12 10 <fieldset style="text-align:center;" id="oauth_wrap"> 13 <legend>{'Or sign in with'| @translate}</legend>11 <legend>{'Or sign in with'|translate}</legend> 14 12 15 13 {foreach from=$PROVIDERS item=provider key=p}{strip} -
extensions/oAuth/template/profile.tpl
r20368 r26556 1 {html_head}{literal} 2 <style type="text/css"> 3 #oauth { 4 width:400px; 5 height:48px; 6 overflow:hidden; 7 margin:0 auto 15px auto; 8 padding:5px; 9 background:rgba(128,128,128,0.2); 10 border:1px solid #7e7e7e; 11 border-radius:5px; 12 } 13 #oauth .avatar { 14 width:48px; 15 border-radius:5px; 16 margin-right:5px; 17 float:left; 18 } 19 </style> 20 {/literal}{/html_head} 1 {html_style} 2 #oauth { 3 width:400px; 4 height:48px; 5 overflow:hidden; 6 margin:0 auto 15px auto; 7 padding:5px; 8 background:rgba(128,128,128,0.2); 9 border:1px solid #7e7e7e; 10 border-radius:5px; 11 } 12 #oauth .avatar { 13 width:48px; 14 border-radius:5px; 15 margin-right:5px; 16 float:left; 17 } 18 {/html_style} 21 19 22 20 <div id="oauth"> … … 27 25 {/if} 28 26 29 {'Logged with'| @translate} : <b>{$OAUTH_PROVIDER}</b><br>30 <b>{'Username'| @translate}</b> : {$OAUTH_USERNAME}<br>31 {if $OAUTH_PROFILE_URL}<b>{'Profile URL'| @translate}</b> : <a href="{$OAUTH_PROFILE_URL}">{$OAUTH_PROFILE_URL|truncate:40:' ... ':true:true}</a>{/if}27 {'Logged with'|translate} : <b>{$OAUTH_PROVIDER}</b><br> 28 <b>{'Username'|translate}</b> : {$OAUTH_USERNAME}<br> 29 {if $OAUTH_PROFILE_URL}<b>{'Profile URL'|translate}</b> : <a href="{$OAUTH_PROFILE_URL}">{$OAUTH_PROFILE_URL|truncate:40:' ... ':true:true}</a>{/if} 32 30 </div>
Note: See TracChangeset
for help on using the changeset viewer.