1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

xup controller fix

This commit is contained in:
secretr 2012-08-09 06:10:31 +00:00
parent 9e576b55fd
commit 0940da5af2

View File

@ -21,19 +21,16 @@ class core_system_xup_controller extends eController
var $backUrl = null;
public function __construct()
public function init()
{
//$back = 'system/xup/test';
$this->backUrl = vartrue($_GET['back']) ? base64_decode($_GET['back']) : "";
$this->backUrl = vartrue($_GET['back']) ? base64_decode($_GET['back']) : true;
}
public function actionSignup()
{
// 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
if(vartrue($_GET['provider']))
@ -43,8 +40,6 @@ class core_system_xup_controller extends eController
//$provider->setBackUrl(e107::getUrl()->create('system/xup/endpoint', array(), array('full' => true)));
try
{
$provider->signup($this->backUrl); // redirect to test page is expected, if true - redirect to SITEURL
}
catch (Exception $e)
@ -55,17 +50,15 @@ class core_system_xup_controller extends eController
return;
}
// print_a($provider->getUserProfile());
return;
//return;
}
e107::getRedirect()->redirect(e107::getUrl()->create($this->backUrl));
}
public function actionLogin()
{
echo 'Login controller';
//echo 'Login controller';
// FIXME - pref for default XUP - e.g. Facebook, use it when GET is empty
if(vartrue($_GET['provider']))
@ -85,13 +78,11 @@ class core_system_xup_controller extends eController
return;
}
// print_a($provider->getUserProfile());
return;
//return;
}
e107::getRedirect()->redirect(e107::getUrl()->create($this->backUrl));
}
public function actionTest()
{
echo 'Login controller<br /><br />';
@ -111,8 +102,6 @@ class core_system_xup_controller extends eController
echo '<br /><a href="'.e107::getUrl()->create('system/xup/signup?provider=Facebook').'">Test signup with Facebook</a>';
}
public function actionEndpoint()
{
require_once( e_HANDLER."hybridauth/Hybrid/Auth.php" );