1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 03:40:37 +02:00

XUP - move icons and remove debug data.

This commit is contained in:
CaMer0n
2012-08-06 10:44:40 +00:00
parent e660ed3a43
commit 399b02dc4a
14 changed files with 41 additions and 16 deletions

View File

@@ -8,16 +8,33 @@
* *
* System XUP controller * System XUP controller
* *
* $URL$ * $URL: https://e107.svn.sourceforge.net/svnroot/e107/trunk/e107_0.8/e107_admin/update_routines.php $
* $Id$ * $Revision: 12933 $
* $Id: update_routines.php 12933 2012-08-06 08:55:51Z e107coders $
* $Author: e107coders $
*/ */
class core_system_xup_controller extends eController class core_system_xup_controller extends eController
{ {
var $backUrl = null;
public function __construct()
{
//$back = 'system/xup/test';
$this->backUrl = vartrue($_GET['back']) ? base64_decode($_GET['back']) : "";
}
public function actionSignup() public function actionSignup()
{ {
echo 'Signup controller'; // echo 'Signup controller';
//$back = 'system/xup/test';
$back = vartrue($_GET['back']) ? base64_decode($_GET['back']) : "";
// FIXME - pref for default XUP - e.g. Facebook, use it when GET is empty // FIXME - pref for default XUP - e.g. Facebook, use it when GET is empty
if(vartrue($_GET['provider'])) if(vartrue($_GET['provider']))
{ {
@@ -26,22 +43,26 @@ class core_system_xup_controller extends eController
//$provider->setBackUrl(e107::getUrl()->create('system/xup/endpoint', array(), array('full' => true))); //$provider->setBackUrl(e107::getUrl()->create('system/xup/endpoint', array(), array('full' => true)));
try try
{ {
$provider->signup('system/xup/test'); // redirect to test page is expected, if true - redirect to SITEURL
$provider->signup($this->backUrl); // redirect to test page is expected, if true - redirect to SITEURL
} }
catch (Exception $e) catch (Exception $e)
{ {
e107::getMessage()->addError('['.$e->getCode().']'.$e->getMessage()); e107::getMessage()->addError('['.$e->getCode().']'.$e->getMessage());
print_a($provider->getUserProfile()); // print_a($provider->getUserProfile());
echo '<br /><br /><a href="'.e107::getUrl()->create('system/xup/test').'">Test page</a>'; // echo '<br /><br /><a href="'.e107::getUrl()->create($this->backUrl).'">Test page</a>';
return; return;
} }
print_a($provider->getUserProfile()); // print_a($provider->getUserProfile());
return; return;
} }
e107::getRedirect()->redirect(e107::getUrl()->create('system/xup/test')); e107::getRedirect()->redirect(e107::getUrl()->create($this->backUrl));
} }
public function actionLogin() public function actionLogin()
{ {
echo 'Login controller'; echo 'Login controller';
@@ -54,21 +75,23 @@ class core_system_xup_controller extends eController
//$provider->setBackUrl(e107::getUrl()->create('system/xup/endpoint', array(), array('full' => true))); //$provider->setBackUrl(e107::getUrl()->create('system/xup/endpoint', array(), array('full' => true)));
try try
{ {
$provider->login('system/xup/test'); // redirect to test page is expected, if true - redirect to SITEURL $provider->login($this->backUrl); // redirect to test page is expected, if true - redirect to SITEURL
} }
catch (Exception $e) catch (Exception $e)
{ {
e107::getMessage()->addError('['.$e->getCode().']'.$e->getMessage()); e107::getMessage()->addError('['.$e->getCode().']'.$e->getMessage());
print_a($provider->getUserProfile()); // print_a($provider->getUserProfile());
echo '<br /><br /><a href="'.e107::getUrl()->create('system/xup/test').'">Test page</a>'; // echo '<br /><br /><a href="'.e107::getUrl()->create($this->backUrl).'">Test page</a>';
return; return;
} }
print_a($provider->getUserProfile()); // print_a($provider->getUserProfile());
return; return;
} }
e107::getRedirect()->redirect(e107::getUrl()->create('system/xup/test')); e107::getRedirect()->redirect(e107::getUrl()->create($this->backUrl));
} }
public function actionTest() public function actionTest()
{ {
echo 'Login controller<br /><br />'; echo 'Login controller<br /><br />';
@@ -88,6 +111,8 @@ class core_system_xup_controller extends eController
echo '<br /><a href="'.e107::getUrl()->create('system/xup/signup?provider=Facebook').'">Test signup with Facebook</a>'; echo '<br /><a href="'.e107::getUrl()->create('system/xup/signup?provider=Facebook').'">Test signup with Facebook</a>';
} }
public function actionEndpoint() public function actionEndpoint()
{ {
require_once( e_HANDLER."hybridauth/Hybrid/Auth.php" ); require_once( e_HANDLER."hybridauth/Hybrid/Auth.php" );

View File

@@ -70,7 +70,7 @@ class signup_shortcodes extends e_shortcode
$p = strtolower($p); $p = strtolower($p);
if($v['enabled'] == 1) if($v['enabled'] == 1)
{ {
$text .= "<a href='".e107::getUrl()->create('system/xup/login?provider='.$p)."'><img class='e-tip' title='Register using your {$p} account' src='".e_HANDLER."hybridauth/icons/{$p}.png' alt='' /></a>"; $text .= "<a href='".e107::getUrl()->create('system/xup/login?provider='.$p.'&back='.base64_encode(e_REQUEST_URL))."'><img class='e-tip' title='Register using your {$p} account' src='".e_IMAGE_ABS."xup/{$p}.png' alt='' /></a>";
} }
//TODO different icon options. see: http://zocial.smcllns.com/ //TODO different icon options. see: http://zocial.smcllns.com/
} }
@@ -95,7 +95,7 @@ class signup_shortcodes extends e_shortcode
$p = strtolower($p); $p = strtolower($p);
if($v['enabled'] == 1) if($v['enabled'] == 1)
{ {
$text .= "<a href='".e107::getUrl()->create('system/xup/signup?provider='.$p)."'><img class='e-tip' title='Register using your {$p} account' src='".e_HANDLER."hybridauth/icons/{$p}.png' alt='' /></a>"; $text .= "<a href='".e107::getUrl()->create('system/xup/signup?provider='.$p.'&back='.base64_encode(e_REQUEST_URL))."'><img class='e-tip' title='Register using your {$p} account' src='".e_IMAGE_ABS."xup/{$p}.png' alt='' /></a>";
} }
//TODO different icon options. see: http://zocial.smcllns.com/ //TODO different icon options. see: http://zocial.smcllns.com/
} }

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB