Changeset 20369 for extensions/oAuth
- Timestamp:
- Jan 25, 2013, 12:26:05 PM (11 years ago)
- Location:
- extensions/oAuth
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/oAuth/include/hybridauth/Hybrid/Storage.php
r20293 r20369 28 28 29 29 if( $value ){ 30 $_SESSION["HA::CONFIG"][$key] = $value;30 $_SESSION["HA::CONFIG"][$key] = serialize($value); 31 31 } 32 32 elseif( isset( $_SESSION["HA::CONFIG"][$key] ) ){ 33 return $_SESSION["HA::CONFIG"][$key];33 return unserialize($_SESSION["HA::CONFIG"][$key]); 34 34 } 35 35 … … 42 42 43 43 if( isset( $_SESSION["HA::STORE"], $_SESSION["HA::STORE"][$key] ) ){ 44 return $_SESSION["HA::STORE"][$key];44 return unserialize($_SESSION["HA::STORE"][$key]); 45 45 } 46 46 … … 52 52 $key = strtolower( $key ); 53 53 54 $_SESSION["HA::STORE"][$key] = $value;54 $_SESSION["HA::STORE"][$key] = serialize($value); 55 55 } 56 56 -
extensions/oAuth/main.inc.php
r20337 r20369 117 117 118 118 // in case of registration aborded 119 if ( script_basename() != 'register')119 if ( script_basename() != 'register' and ($data=pwg_get_session_var('oauth_new_user')) !== null ) 120 120 { 121 121 pwg_unset_session_var('oauth_new_user'); 122 123 require_once(OAUTH_PATH . 'include/hybridauth/Hybrid/Auth.php'); 124 125 try { 126 $hybridauth = new Hybrid_Auth($hybridauth_conf); 127 $adapter = $hybridauth->getAdapter($data[0]); 128 $adapter->logout(); 129 } 130 catch (Exception $e) { 131 } 122 132 } 123 133 } -
extensions/oAuth/template/identification_common.tpl
r20337 r20369 1 {html_head}{literal} 2 <style type="text/css"> 1 {html_style}{literal} 3 2 #openid_form { 4 3 padding:20px; … … 13 12 font-weight:bold; 14 13 } 15 </style> 16 {/literal}{/html_head} 14 {/literal}{/html_style} 17 15 18 16 {combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'} 19 17 {combine_css path="themes/default/js/plugins/colorbox/style2/colorbox.css"} 20 18 21 {footer_script} 19 {footer_script}{literal} 22 20 // redirect, called from the popup 23 function redirect(type) {ldelim} 21 function redirect(type) { 22 {/literal} 24 23 url = "{$REDIRECT_TO}"; 25 24 if (typeof type != 'undefined' && type != 'default') {ldelim} 26 25 url = "{$ABS_ROOT_URL}"+ type +".php"; 27 26 } 27 {literal} 28 28 window.location.href = url; 29 29 } 30 30 31 31 // open authentication popup 32 function open_auth(url) { ldelim}32 function open_auth(url) { 33 33 window.open( 34 34 url+ "&t=" + (new Date()).getTime(), … … 39 39 40 40 // click on a button 41 $("a.oauth").click(function() { ldelim}41 $("a.oauth").click(function() { 42 42 var idp = $(this).attr('title'); 43 43 44 switch(idp) { ldelim}44 switch(idp) { 45 45 case 'OpenID': case 'Wordpress': case 'Flickr': 46 switch(idp) {ldelim} 46 switch(idp) { 47 {/literal} 47 48 case 'OpenID': 48 49 $("#openid_label").html('{'Please enter your OpenID URL'|@translate|escape:javascript}'); break; … … 50 51 $("#openid_label").html('{'Please enter your username'|@translate|escape:javascript}'); break; 51 52 } 52 53 53 54 $("#openid_form").css('background-color', $("#the_page #content").css('background-color')); 54 55 $("#openid_form img").attr('src', '{$ROOT_URL}{$OAUTH_PATH}template/icons/38px/'+ idp.toLowerCase() +'.png'); 55 56 $("#openid_form h3").html(idp); 56 57 $("#openid_form").data('idp', idp); 57 58 $.colorbox({ ldelim}58 {literal} 59 $.colorbox({ 59 60 inline:true, 60 61 href:"#openid_form", 61 62 initialWidth:0, 62 initialHeight:0 63 initialHeight:0, 64 onComplete:function(){ $.colorbox.resize({speed:0}) } // prevent misalignement when icon not loaded 63 65 }) 64 66 break; 65 67 66 68 default: 69 {/literal} 67 70 open_auth("{$OAUTH_URL}"+ idp); 71 {literal} 68 72 } 69 73 … … 71 75 }); 72 76 73 $("#openid_form").submit(function() { ldelim}77 $("#openid_form").submit(function() { 74 78 var idp = $(this).data('idp'); 75 79 var oi = $("#openid_form input[name='openid_identifier']").val(); … … 77 81 78 82 $("#openid_label").removeClass('error'); 79 if (!oi) { ldelim}83 if (!oi) { 80 84 $("#openid_label").addClass('error'); 81 85 return false; 82 86 } 83 87 84 switch(idp) { ldelim}88 switch(idp) { 85 89 case 'Wordpress': oi = "http://" + oi + ".wordpress.com"; break; 86 90 case 'Flickr': oi = "http://www.flickr.com/photos/" + oi + "/"; break; 87 91 } 88 92 {/literal} 89 93 open_auth("{$OAUTH_URL}OpenID&openid_identifier="+ encodeURI(oi)); 94 {literal} 90 95 $.colorbox.close(); 91 96 return false; 92 97 }); 93 98 94 $("#openid_cancel").click(function() { ldelim}99 $("#openid_cancel").click(function() { 95 100 $("#openid_label").removeClass('error'); 96 101 $.colorbox.close(); 97 102 return false; 98 103 }); 99 {/ footer_script}104 {/literal}{/footer_script} 100 105 101 106 <div style="display:none;"> 102 107 <form id="openid_form" action=""> 103 108 <div> 104 <img src="{$ROOT_URL}{$OAUTH_PATH}template/icons/openid_big.png" >109 <img src="{$ROOT_URL}{$OAUTH_PATH}template/icons/openid_big.png" style="width:38px:height:38px;"> 105 110 <h3>OpendID</h3> 106 111 </div> -
extensions/oAuth/template/identification_menubar.tpl
r20323 r20369 4 4 {include file=$OAUTH_ABS_PATH|@cat:'template/identification_common.tpl'} 5 5 {/if} 6 {html_head}{literal} 7 <style type="text/css"> 6 {html_style}{literal} 8 7 dl#mbIdentification dd:first-of-type { 9 8 padding-bottom:0 !important; … … 12 11 margin:0 1px; 13 12 } 14 </style> 15 {/literal}{/html_head} 13 {/literal}{/html_style} 16 14 17 15 <dd> -
extensions/oAuth/template/identification_page.tpl
r20323 r20369 3 3 {include file=$OAUTH_ABS_PATH|@cat:'template/identification_common.tpl'} 4 4 {/if} 5 {html_head}{literal} 6 <style type="text/css"> 5 {html_style}{literal} 7 6 #oauth_wrap .oauth { 8 7 margin:0 2px; 9 8 } 10 </style> 11 {/literal}{/html_head} 9 {/literal}{/html_style} 12 10 13 11 <fieldset style="text-align:center;" id="oauth_wrap">
Note: See TracChangeset
for help on using the changeset viewer.