From 6658d57b223f5d9ef82eab4d0aed84e38f7f1c0c Mon Sep 17 00:00:00 2001 From: Julio Cesar Laura Date: Wed, 14 May 2014 13:27:08 -0400 Subject: [PATCH] BUG 14801 Requerimiento de compatibilidad con Safari de Mac SOLVED - La computadora del cliente tiene una hora muy diferente a la hora del servidor, por lo que las cookies creadas son inmediatamente deshechadas por el navegador - La validcion adicional para las cookies no se aplica cuando se tiene la bandera "safari_cookie_lifetime" con valor "0" - OJO. ESTE CAMBIO SOLO ARREGLA EL PROBLEMA EXISTENTE EN VIVA PARA LA AUTENTIFICACION DE USUARIOS, CUALQUIER OTRO ISSUE RELACIONADO A FUNCIONAMIENTO DE PM EN SAFARI NO ESTA GARANTIZADO (ESPECIALMENTE ISSUES DE JAVASCRIPT), YA QUE PM NO ES OFICIALMENTE PROBADO EN PM Y NO SABEMOS HASTA CUANDO SEA ASI, ASI QUE FUTUROS ISSUES EN SAFARI SERAN ENVIADOS AL ROADMAP Y DEBE SER APROBADO POR INSTANCIAS SUPERIORES EL VISTO BUENO PARA IR ADELANTE CON LAS PRUEBAS EN SAFARI --- gulliver/system/class.bootstrap.php | 2 +- workflow/public_html/sysGeneric.php | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/gulliver/system/class.bootstrap.php b/gulliver/system/class.bootstrap.php index 1a50bb526..c4415c865 100644 --- a/gulliver/system/class.bootstrap.php +++ b/gulliver/system/class.bootstrap.php @@ -85,7 +85,7 @@ class Bootstrap } // default configuration - $config = array('debug' => 0, 'debug_sql' => 0, 'debug_time' => 0, 'debug_calendar' => 0, 'wsdl_cache' => 1, 'memory_limit' => "256M", 'time_zone' => 'America/New_York', 'memcached' => 0, 'memcached_server' => '', 'default_skin' => 'neoclassic', 'default_lang' => 'en', 'proxy_host' => '', 'proxy_port' => '', 'proxy_user' => '', 'proxy_pass' => '' , 'size_log_file' => 5000000 , 'number_log_file' => 5, 'ie_cookie_lifetime' => 1); + $config = array('debug' => 0, 'debug_sql' => 0, 'debug_time' => 0, 'debug_calendar' => 0, 'wsdl_cache' => 1, 'memory_limit' => "256M", 'time_zone' => 'America/New_York', 'memcached' => 0, 'memcached_server' => '', 'default_skin' => 'neoclassic', 'default_lang' => 'en', 'proxy_host' => '', 'proxy_port' => '', 'proxy_user' => '', 'proxy_pass' => '' , 'size_log_file' => 5000000 , 'number_log_file' => 5, 'ie_cookie_lifetime' => 1, 'safari_cookie_lifetime' => 1); // read the global env.ini configuration file if ($readGlobalIniFile && ($globalConf = @parse_ini_file($globalIniFile)) !== false) { diff --git a/workflow/public_html/sysGeneric.php b/workflow/public_html/sysGeneric.php index ec6f6a11c..96dd851e8 100755 --- a/workflow/public_html/sysGeneric.php +++ b/workflow/public_html/sysGeneric.php @@ -285,7 +285,10 @@ if (is_null($timelife)) { $timelife = 1440; } ini_set('session.gc_maxlifetime', $timelife); -if (preg_match("/msie/i", $_SERVER ['HTTP_USER_AGENT']) != 1 || $config['ie_cookie_lifetime'] == 1) { +if ((preg_match("/msie/i", $_SERVER ['HTTP_USER_AGENT']) != 1 || + $config['ie_cookie_lifetime'] == 1) && + (!(preg_match("/safari/i", $_SERVER ['HTTP_USER_AGENT']) == 1 && preg_match("/chrome/i", $_SERVER ['HTTP_USER_AGENT']) == 0) || + $config['safari_cookie_lifetime'] == 1)) { ini_set('session.cookie_lifetime', $timelife); } session_start(); @@ -888,7 +891,10 @@ if (! defined( 'EXECUTE_BY_CRON' )) { define( 'SYS_LANG_DIRECTION', $oServerConf->getLanDirection() ); if ((isset( $_SESSION['USER_LOGGED'] )) && (! (isset( $_GET['sid'] )))) { - if (preg_match("/msie/i", $_SERVER ['HTTP_USER_AGENT']) != 1 || $config['ie_cookie_lifetime'] == 1) { + if ((preg_match("/msie/i", $_SERVER ['HTTP_USER_AGENT']) != 1 || + $config['ie_cookie_lifetime'] == 1) && + (!(preg_match("/safari/i", $_SERVER ['HTTP_USER_AGENT']) == 1 && preg_match("/chrome/i", $_SERVER ['HTTP_USER_AGENT']) == 0) || + $config['safari_cookie_lifetime'] == 1)) { if (PHP_VERSION < 5.2) { setcookie(session_name(), session_id(), time() + $timelife, '/', '; HttpOnly'); } else { @@ -957,7 +963,10 @@ if (! defined( 'EXECUTE_BY_CRON' )) { $_SESSION['USER_LOGGED'] = $aUser['USR_UID']; $_SESSION['USR_USERNAME'] = $aUser['USR_USERNAME']; $bRedirect = false; - if (preg_match("/msie/i", $_SERVER ['HTTP_USER_AGENT']) != 1 || $config['ie_cookie_lifetime'] == 1) { + if ((preg_match("/msie/i", $_SERVER ['HTTP_USER_AGENT']) != 1 || + $config['ie_cookie_lifetime'] == 1) && + (!(preg_match("/safari/i", $_SERVER ['HTTP_USER_AGENT']) == 1 && preg_match("/chrome/i", $_SERVER ['HTTP_USER_AGENT']) == 0) || + $config['safari_cookie_lifetime'] == 1)) { if (PHP_VERSION < 5.2) { setcookie(session_name(), session_id(), time() + $timelife, '/', '; HttpOnly'); } else {