GI-181 Gmail Integration> Notice de busqueda de lenguaje

This commit is contained in:
Dante
2015-12-04 10:42:38 -04:00
parent f471f5cad7
commit ac867a1651

View File

@@ -12,8 +12,8 @@ $proUid = $_GET['proUid'];
$server = isset($_GET['server']) ? $_GET['server'] : ''; $server = isset($_GET['server']) ? $_GET['server'] : '';
//We do need the server to continue. //We do need the server to continue.
if( !isset($_GET['server']) || $server == "" ){ if( !isset($_GET['server']) || $server == "" ){
throw new \Exception(Bootstrap::LoadTranslation( 'ID_GMAIL_NEED_SERVER' )); throw new \Exception(Bootstrap::LoadTranslation( 'ID_GMAIL_NEED_SERVER' ));
} }
//First check if the feature is enabled in the license. //First check if the feature is enabled in the license.
@@ -44,6 +44,10 @@ $curl_response = curl_exec( $curl );
curl_close($curl); curl_close($curl);
$decodedResp = json_decode($curl_response); $decodedResp = json_decode($curl_response);
if(!is_object($decodedResp) || property_exists($decodedResp,'error')) {
die($decodedResp->error->message);
}
//getting the enviroment //getting the enviroment
$enviroment = $decodedResp->enviroment; $enviroment = $decodedResp->enviroment;
@@ -51,7 +55,7 @@ if(count($decodedResp->user) > 1){
echo Bootstrap::LoadTranslation( 'ID_EMAIL_MORE_THAN_ONE_USER' ); echo Bootstrap::LoadTranslation( 'ID_EMAIL_MORE_THAN_ONE_USER' );
die; die;
} else if(count($decodedResp->user) < 1){ } else if(count($decodedResp->user) < 1){
echo Bootstrap::LoadTranslation( 'ID_USER_NOT_FOUND' ); echo Bootstrap::LoadTranslation( 'ID_USER_NOT_FOUND' );
die; die;
} }
@@ -79,8 +83,8 @@ if( !isset($_SESSION['USER_LOGGED']) || $_SESSION['USER_LOGGED'] != $decodedResp
//If the email corresponds I get the username and with the gmail user_id the session is created. //If the email corresponds I get the username and with the gmail user_id the session is created.
if($decodedResp->user['0']->USR_STATUS == "ACTIVE"){ if($decodedResp->user['0']->USR_STATUS == "ACTIVE"){
//User Active! lets create the Session //User Active! lets create the Session
@session_destroy(); @session_destroy();
session_start(); session_start();
session_regenerate_id(); session_regenerate_id();
if (PHP_VERSION < 5.2) { if (PHP_VERSION < 5.2) {
@@ -89,17 +93,17 @@ if( !isset($_SESSION['USER_LOGGED']) || $_SESSION['USER_LOGGED'] != $decodedResp
setcookie("workspaceSkin", $enviroment, time() + (24 * 60 * 60), "/sys" . $enviroment, null, false, true); setcookie("workspaceSkin", $enviroment, time() + (24 * 60 * 60), "/sys" . $enviroment, null, false, true);
} }
$_SESSION = array(); $_SESSION = array();
$_SESSION['__EE_INSTALLATION__'] = 2; $_SESSION['__EE_INSTALLATION__'] = 2;
$_SESSION['__EE_SW_PMLICENSEMANAGER__'] = 1; $_SESSION['__EE_SW_PMLICENSEMANAGER__'] = 1;
$_SESSION['phpLastFileFound'] = ''; $_SESSION['phpLastFileFound'] = '';
$_SESSION['USERNAME_PREVIOUS1'] = $decodedResp->user['0']->USR_USERNAME; $_SESSION['USERNAME_PREVIOUS1'] = $decodedResp->user['0']->USR_USERNAME;
$_SESSION['USERNAME_PREVIOUS2'] = $decodedResp->user['0']->USR_USERNAME; $_SESSION['USERNAME_PREVIOUS2'] = $decodedResp->user['0']->USR_USERNAME;
$_SESSION['WORKSPACE'] = $pmws; $_SESSION['WORKSPACE'] = $pmws;
$_SESSION['USER_LOGGED'] = $decodedResp->user['0']->USR_UID; $_SESSION['USER_LOGGED'] = $decodedResp->user['0']->USR_UID;
$_SESSION['USR_USERNAME'] = $decodedResp->user['0']->USR_USERNAME; $_SESSION['USR_USERNAME'] = $decodedResp->user['0']->USR_USERNAME;
$_SESSION['USR_FULLNAME'] = $decodedResp->user['0']->USR_FIRSTNAME. ' ' .$decodedResp->user['0']->USR_LASTNAME; $_SESSION['USR_FULLNAME'] = $decodedResp->user['0']->USR_FIRSTNAME. ' ' .$decodedResp->user['0']->USR_LASTNAME;
$_SESSION['__sw__'] = 1; $_SESSION['__sw__'] = 1;
//session created //session created
} else { } else {
echo Bootstrap::LoadTranslation( 'ID_USER_NOT_ACTIVE' ); echo Bootstrap::LoadTranslation( 'ID_USER_NOT_ACTIVE' );