isMobile(); function haes_decrypt($string) { if ( ! $string) return FALSE; $string = pack('H*', $string); return mcrypt_decrypt(MCRYPT_RIJNDAEL_128, 'Hanbiro_Groupware_Root_key______', $string, MCRYPT_MODE_ECB, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); } function ie_check() { if (preg_match('/Trident\/(\d{1,2}).\d{1,2}/', $_SERVER['HTTP_USER_AGENT'], $version)) { if ($version[1] < 6) { return FALSE; } } else if (preg_match('/MSIE ([0-9]{1,2}).[0-9]{1,2}/i', $_SERVER['HTTP_USER_AGENT'], $version)) { if ($version[1] < 10) { return FALSE; } } return TRUE; } $new_theme = ie_check(); if ($_COOKIE['HANBIRO_GW']) { $global_file_path = sprintf("/home/HanbiroMailcore/GWDATA/%s/config/global.ini", $_SERVER['HTTP_HOST']); $_global_config_ = parseINI($global_file_path); $_CRYPT_USER_ = haes_decrypt($_COOKIE['HANBIRO_GW']); list ($_session_id_,$_session_domain_,$_session_time_) = explode(',', $_CRYPT_USER_); if ($_global_config_['interface']['cloud']) { if ($_session_id_ == 'postmaster') { $url = "/sadmin/"; } else { $url = "/cloud/"; } echo ""; exit; } else if ($_session_id_ == 'postmaster') { if ($isMobile || ($new_theme && ($_global_config_['interface']['theme'] == 'blue' || $_global_config_['interface']['theme'] == 'bs'))) { if(isset($_global_config_['aspinfo']['admin_url'])) { $url = "/".$_global_config_['aspinfo']['admin_url']."/app/"; } else { $url = "/admin/app/"; } } else { $url = "/groupware/?category=admin§ion=index"; } echo ""; exit; } else { $user_file_path = sprintf("/home/HanbiroMailcore/GWDATA/%s/config/config_%s.ini", $_SERVER['HTTP_HOST'], $_session_id_); $_user_config_ = parseINI($user_file_path); $new_theme = ($new_theme && ($_user_config_['theme'] == 'bs' || $_user_config_['theme'] == 'blue')) ? TRUE : FALSE; } } else { $vpop = new VpopmailAdmin; $_global_config_ = parseINI('',unserialize(base64_decode($vpop->get_global_data($_SERVER['HMAIL_HOST'])))); } if ($isMobile || ($new_theme && ($_global_config_['interface']['theme'] == 'blue' || $_global_config_['interface']['theme'] == 'bs'))) { if(isset($_global_config_['aspinfo']['user_url'])) { $url = "/".$_global_config_['aspinfo']['user_url']."/app/"; } else { $url = "/ngw/app/"; } } else { $url = "/groupware/?category=index§ion=main"; } if ($_SERVER['HMAIL_HOST'] == 'esamho.com') $url = "/ngw/app/"; echo ""; exit;