diff --git a/ajax/ajax_configSave.php b/ajax/ajax_configSave.php index af049b90..8538fda1 100644 --- a/ajax/ajax_configSave.php +++ b/ajax/ajax_configSave.php @@ -59,6 +59,7 @@ if ($frmAction == "config") { $frmAccountCount = SP_Common::parseParams('p', 'account_count', 10); $frmAllowedSize = SP_Common::parseParams('p', 'files_allowed_size', 1024); $frmAllowedExts = SP_Common::parseParams('p', 'files_allowed_exts'); + $frmResultsAsCards = SP_Common::parseParams('p', 'resultsascards', false, false, true); $frmWiki = SP_Common::parseParams('p', 'wiki_enabled', false, false, true); $frmWikiSearchUrl = SP_Common::parseParams('p', 'wiki_searchurl'); @@ -147,6 +148,7 @@ if ($frmAction == "config") { SP_Config::setValue("maintenance", $frmMaintenance); SP_Config::setValue("checkupdates", $frmCheckUpdates); SP_Config::setValue("files_enabled", $frmFiles); + SP_Config::setValue("resultsascards", $frmResultsAsCards); SP_Config::setValue("globalsearch", $frmGlobalSearch); SP_Config::setValue("files_allowed_size", $frmAllowedSize); @@ -155,6 +157,9 @@ if ($frmAction == "config") { SP_Log::wrLogInfo($message); SP_Common::sendEmail($message); + // Recargar la aplicación completa para establecer nuevos valores + SP_Util::reload(); + SP_Common::printJSON(_('Configuración actualizada'), 0, $doActionOnClose); } elseif ($frmAction == "crypt") { $currentMasterPass = SP_Common::parseParams('p', 'curMasterPwd', '', false, false, false); diff --git a/ajax/ajax_getContent.php b/ajax/ajax_getContent.php index fbf972de..f8a53d6b 100644 --- a/ajax/ajax_getContent.php +++ b/ajax/ajax_getContent.php @@ -32,6 +32,8 @@ if (!SP_Init::isLoggedIn()) { SP_Util::logout(); } +SP_Util::checkReload(); + if (SP_Common::parseParams('p', 'action', '', true)) { $action = $tplvars['action'] = SP_Common::parseParams('p', 'action'); $itemId = $tplvars['id'] = SP_Common::parseParams('p', 'id', 0); diff --git a/ajax/ajax_search.php b/ajax/ajax_search.php index 3f5ff640..2948ec19 100644 --- a/ajax/ajax_search.php +++ b/ajax/ajax_search.php @@ -51,6 +51,7 @@ if ($wikiEnabled) { $wikiPageUrl = SP_Config::getValue('wiki_pageurl'); } $requestEnabled = SP_Util::mailrequestIsEnabled(); +$maxTextLength = (SP_Util::resultsCardsIsEnabled()) ? 30 : 60; // Valores POST $sortKey = SP_Common::parseParams('p', 'skey', 0); @@ -68,6 +69,26 @@ $userId = SP_Common::parseParams('s', 'uid', 0); $filterOn = ($sortKey > 1 || $customerId || $categoryId || $searchTxt) ? true : false; +$colors = array( + 'FF66CC', + 'FF99FF', + 'CC99FF', + '9999FF', + '6699FF', + '3399FF', + '0099FF', + '6699FF', + '3399FF', + '00CC66', + '00CC66', + '00CC99', + '00CCCC', + 'FFCC66', + 'FF9999', + 'FF6699', + 'FF99CC' +); + $objAccount = new SP_Account; $arrSearchFilter = array("txtSearch" => $searchTxt, "userId" => $userId, @@ -133,23 +154,24 @@ foreach ($resQuery as $account) { $show = ($accView || $accViewPass || $accEdit || $accCopy || $accDel); - $randomRGB = array(rand(150, 210), rand(150, 210), rand(150, 210)); - $color = array($account->account_customerId => array(SP_Html::rgb2hex($randomRGB), $randomRGB)); + //$randomRGB = array(rand(150, 210), rand(150, 210), rand(150, 210)); + //$color = array($account->account_customerId => array(SP_Html::rgb2hex($randomRGB), $randomRGB)); + $color = array_rand($colors); if (!isset($customerColor)) { - $customerColor = $color; + $customerColor[$account->account_customerId] = '#'.$colors[$color]; } elseif (isset($customerColor) && !array_key_exists($account->account_customerId, $customerColor)) { - $customerColor = $color; + $customerColor[$account->account_customerId] = '#'.$colors[$color]; } - $hexColor = $customerColor[$account->account_customerId][0]; - //$rgbaColor = implode(',',$customerColor[$account->account_customerId][1]).',0.1'; + //$hexColor = $customerColor[$account->account_customerId][0]; + $hexColor = $customerColor[$account->account_customerId]; if ($wikiEnabled) { $wikiLink = $wikiSearchUrl . $account->customer_name; - $customerName = '' . SP_Html::truncate($account->customer_name, 31) . ''; + $customerName = '' . SP_Html::truncate($account->customer_name, $maxTextLength) . ''; } else { - $customerName = SP_Html::truncate($account->customer_name, 31); + $customerName = SP_Html::truncate($account->customer_name, $maxTextLength); } if ($accountLink && $show) { @@ -163,14 +185,15 @@ foreach ($resQuery as $account) { $accountName = $account->account_name; } + // Obtenemos datos si el usuario tiene acceso a los datos de la cuenta if ($show) { - $vacLogin = (strlen($account->account_login) >= 31) ? SP_Html::truncate($account->account_login, 31) : $account->account_login; + $vacLogin = (strlen($account->account_login) >= $maxTextLength) ? SP_Html::truncate($account->account_login, $maxTextLength) : $account->account_login; $strAccUrl = $account->account_url; $urlIsLink = ($strAccUrl && preg_match("#^https?://.*#i", $strAccUrl)); - if (strlen($strAccUrl) >= 31) { - $strAccUrl_short = SP_Html::truncate($strAccUrl, 31); + if (strlen($strAccUrl) >= $maxTextLength) { + $strAccUrl_short = SP_Html::truncate($strAccUrl, $maxTextLength); $strAccUrl = ($urlIsLink) ? '' . $strAccUrl_short . '' : $strAccUrl_short; } else { @@ -200,28 +223,29 @@ foreach ($resQuery as $account) { //echo '
'; echo '
'; - echo '
'; + echo '
'; echo '
' . _('Cliente') . '
'; echo ''; echo '
'; - echo '
'; + echo ''; - echo '
'; + echo '
'; echo '
' . _('Categoría') . '
'; echo '
' . $account->category_name . '
'; echo '
'; + // Mostramos datos si el usuario tiene acceso a los datos de la cuenta if ($show) { - echo '
'; + echo '
'; echo '
' . _('Usuario') . '
'; echo '
' . $vacLogin . '
'; echo '
'; - echo '
'; + echo '
'; echo '
' . _('URL / IP') . '
'; echo '
' . $strAccUrl . '
'; echo '
'; @@ -261,10 +285,10 @@ foreach ($resQuery as $account) { if ($accViewPass) { echo ''; - echo ''; + echo ''; } - if ($accEdit || $accCopy || $accDel) { + if ($accEdit || $accCopy || $accDel || $accViewPass) { echo ''; } @@ -308,16 +332,15 @@ SP_Html::printQuerySearchNavBar($sortKey, $arrSearchFilter["limitStart"], $objAc var client = new ZeroClipboard( $('.clip_pass_button'), { moviePath: "js/ZeroClipboard.swf", - debug: true - } ); + debug: false + }); //client.setText(data); client.on( 'load', function(client) { $('#global-zeroclipboard-html-bridge').attr('rel', 'tooltip').attr('title', ''); - } ); + }); client.on( "complete", function(client, args) { resMsg("ok", ""); - //console.log("Copied text to clipboard: " + args.text ); - } ); + }); \ No newline at end of file diff --git a/ajax/ajax_viewpass.php b/ajax/ajax_viewpass.php index ceb9d05e..3f1ba737 100644 --- a/ajax/ajax_viewpass.php +++ b/ajax/ajax_viewpass.php @@ -29,7 +29,7 @@ require_once APP_ROOT.DIRECTORY_SEPARATOR.'inc'.DIRECTORY_SEPARATOR.'init.php'; SP_Util::checkReferer('POST'); if (!SP_Init::isLoggedIn()) { - return; + return -1; } $accountId = SP_Common::parseParams('p', 'accountid', false); @@ -75,18 +75,16 @@ $crypt = new SP_Crypt; $masterPass = $crypt->getSessionMasterPass(); $accountClearPass = $crypt->decrypt($accountData->account_pass, $masterPass, $accountData->account_IV); - -if (!$isHistory) { +if (!$isHistory && $fullTxt) { $account->incrementDecryptCounter(); + + $message['action'] = _('Ver Clave'); + $message['text'][] = _('ID') . ': ' . $accountId; + $message['text'][] = _('Cuenta') . ': ' . $accountData->customer_name . " / " . $accountData->account_name; + + SP_Log::wrLogInfo($message); } -$message['action'] = _('Ver Clave'); -$message['text'][] = _('ID') . ': ' . $accountId; -$message['text'][] = _('Cuenta') . ': ' . $accountData->customer_name . " / " . $accountData->account_name; -$message['text'][] = _('IP') . ': ' . $_SERVER['REMOTE_ADDR']; - -SP_Log::wrLogInfo($message); - if ($fullTxt) { ?>
diff --git a/css/search-grid.css b/css/search-grid.css new file mode 100644 index 00000000..442fee0c --- /dev/null +++ b/css/search-grid.css @@ -0,0 +1,54 @@ +#content #data-search .account-info img, +#content #data-search .account-actions img {width: 24px; height: 24px;margin: 0 0.5em;} + +#content #data-search {text-align: center; padding: 0.5em 0;} +#content #data-search .account-label{ + width: 95%; + height: 70px; + text-align: left; + margin: 0; + margin-bottom: 0.2em; + padding: 0.5em; + color: #696969; + background-color: #fcfcfc; + display: inline-block; +} +#content #data-search .account-label .label-field{float: left; width: 18%; height: 3em;} +#content #data-search .account-label .field-name{float: left; width: 80px; padding: 0.3em 0.2em; color: #b9b9b9; display: none} +#content #data-search .account-label .field-text{float: left; width: 95%; padding: 0.3em 0.3em; word-wrap: break-word;} +#content #data-search .account-label .header .field-name{color: white; font-weight: bold} + +#content #data-search .account-label .field-text a{color: #4895FA} +#content #data-search .account-label .no-link a{color: white; font-weight: bold;} + +#content #data-search .field-customer .field-text{height: 2.5em} + +#content #data-search .field-category{width: 10% !important;} + +#content #data-search .account-info{ + float: left; + clear: left; + width: 20%; + /*height: 2em;*/ + padding: 0.5em 0; + text-align: left; + /*border-top: 1px solid #d9d9d9;*/ + border: none; +} + +#content #data-search .account-actions{ + float: right; + position: relative; + top: -3em; + width: auto; + max-width: 18%; + height: auto; + padding: 0.5em; + text-align: right; + /*border-top: 1px solid #c9c9c9;*/ + background-color: transparent; + box-shadow: 0 0 8px rgba(0, 0, 0, 0.075) inset; +} +#content #data-search .account-actions img{margin:3px 5px;} +#content .actions-optional{display: none;} +#content #data-search .account-spacer{width: 100%; height: 8em;} \ No newline at end of file diff --git a/css/styles.css b/css/styles.css index a4a46812..071ec515 100644 --- a/css/styles.css +++ b/css/styles.css @@ -235,9 +235,9 @@ A:focus {text-decoration: none; color: #FF0000;} #content TD.valField, #fancyContainer TD.valField { padding-left:20px; width: 100%;} -#content #tblTools{min-width: 875px; height: 5em; padding-left: 15px;padding: 5px;} +#content #tblTools{min-width: 875px; height: 5em; padding: 5px; padding-left: 15px;} -#content #resBuscar{ min-width: 875px; min-height: 450px;} +#content #resBuscar{ min-width: 875px; min-height: 450px; margin-bottom: 50px;} #content #resBuscar IMG {vertical-align:middle;} #content #pageNav { @@ -615,14 +615,15 @@ A:focus {text-decoration: none; color: #FF0000;} .fancydata {min-width: 400px; border: none; text-align: left;} .fancydata .descField{min-width: 100px; font-weight: bold;} -#footer{ +footer{ position: fixed; bottom: 0; z-index: 100; float:left; width:100%; - margin:0 auto; - padding: 1em 0; + height: 1.5em; + margin: 0 auto; + padding: .5em 0; background-color: #F5F5F5; color:#b9b9b9; font-size:13px; @@ -631,14 +632,14 @@ A:focus {text-decoration: none; color: #FF0000;} -moz-box-shadow: 0px -8px 6px -6px #c9c9c9; } -#footer #project{float: right;width: 40%;text-align:right; padding-right: 20px;} -#footer #updates{float: left;width: 20%;text-align:left; padding-left: 20px;} -#footer #status{float: left;width: 20%;text-align:left;color: #ffbbb4;} +footer #project{float: right;width: 40%;text-align:right; padding-right: 20px;} +footer #updates{float: left;width: 20%;text-align:left; padding-left: 20px;} +footer #status{float: left;width: 20%;text-align:left;color: #ffbbb4;} -#footer A{color:#b9b9b9;} -#footer #project A:hover{color:#a9c1d7;border-bottom: 1px solid #a9c1d7;} -#footer #updates A:hover{color:#a9c1d7;} -#footer IMG{border: none;width: 16px;height: 16px;vertical-align: middle;} +footer a, footer a:visited{color:#b9b9b9;} +footer #project a:hover{color:#a9c1d7;border-bottom: 1px solid #a9c1d7;} +footer #updates a:hover{color:#a9c1d7;} +footer img{border: none;width: 16px;height: 16px;vertical-align: middle;} /* GENERIC CLASSES */ diff --git a/inc/common.class.php b/inc/common.class.php index de15385d..be360c5b 100644 --- a/inc/common.class.php +++ b/inc/common.class.php @@ -226,6 +226,8 @@ class SP_Common $msgHelp[21] = _('Comprobar actualizaciones de la aplicación (sólo para los usuarios administradores)'); $msgHelp[22] = _('Extensiones de máximo 4 caracteres.') . "

" . _('Escribir extensión y pulsar intro para añadir.'); $msgHelp[23] = _('Importar desde un archivo CSV con el formato') . ":

" . _('nombre_de_cuenta;cliente;categoría;url;usuario;clave;notas') . "

" . _('Si el cliente o la categoría no están creados, se crean automáticamente.'); + $msgHelp[24] = _('Permite que las cuentas sin acceso sean visibles sólo para las búsquedas.'); + $msgHelp[25] = _('Muestra los resultados de búsqueda de cuentas en formato tarjeta.'); if (array_key_exists($id, $msgHelp)) { echo ''; diff --git a/inc/html.class.php b/inc/html.class.php index 70a1733f..9a70c0c2 100644 --- a/inc/html.class.php +++ b/inc/html.class.php @@ -183,6 +183,10 @@ class SP_Html array("href" => "js/fancybox/jquery.fancybox.css", "media" => "screen"), array("href" => "css/styles.css", "media" => "")); + if ( ! SP_Util::resultsCardsIsEnabled() ){ + array_push($cssProp,array("href" => "css/search-grid.css", "media" => "")); + } + foreach ($cssProp as $css) { self::$htmlPage[] = ''; } @@ -261,14 +265,14 @@ class SP_Html { $info = self::getAppInfo(); - self::$htmlPage[] = ' '; + self::$htmlPage[] = ' '; self::$htmlPage[] = ''; } diff --git a/inc/tpl/config.php b/inc/tpl/config.php index 5a61e588..93172872 100644 --- a/inc/tpl/config.php +++ b/inc/tpl/config.php @@ -54,6 +54,7 @@ $chkLdap = ( SP_Config::getValue('ldap_enabled') ) ? 'checked="checked"' : ''; $chkMail = ( SP_Config::getValue('mail_enabled') ) ? 'checked="checked"' : ''; $chkMailRequests = ( SP_Config::getValue('mail_requestsenabled') ) ? 'checked="checked"' : ''; $chkMailAuth = ( SP_Config::getValue('mail_authenabled') ) ? 'checked="checked"' : ''; +$chkResultsAsCards = ( SP_Config::getValue('resultsascards') ) ? 'checked="checked"' : ''; $allowedExts = SP_Config::getValue('files_allowed_exts'); ?> @@ -190,6 +191,16 @@ $allowedExts = SP_Config::getValue('files_allowed_exts'); + + + + + + + + /> + + diff --git a/inc/util.class.php b/inc/util.class.php index 7889a431..9d49d617 100644 --- a/inc/util.class.php +++ b/inc/util.class.php @@ -254,7 +254,7 @@ class SP_Util */ public static function getVersion($retBuild = false) { - $build = 5; + $build = 7; $version = array(1, 1, 2); if ($retBuild) { @@ -368,4 +368,36 @@ class SP_Util { return SP_Config::getValue('log_enabled', false); } + + /** + * @brief Comprobar si está habilitado el formato de tarjeta en los resultados + * @return bool + */ + public static function resultsCardsIsEnabled() + { + return SP_Config::getValue('resultsascards', false); + } + + /** + * @brief Establecer variable de sesión para recargar la aplicación + * @return none + */ + public static function reload() + { + if (!isset($_SESSION["reload"]) || $_SESSION["reload"] === 0) { + $_SESSION["reload"] = 1; + } + } + + /** + * @brief Comprobar si se necesita recargar la aplicación + * @return none + */ + public static function checkReload() + { + if (isset($_SESSION["reload"]) && $_SESSION["reload"] === 1) { + $_SESSION["reload"] = 0; + exit(""); + } + } } \ No newline at end of file diff --git a/js/functions.js b/js/functions.js index f31628c3..8ab5395d 100644 --- a/js/functions.js +++ b/js/functions.js @@ -5,7 +5,10 @@ var order = {}; order.key = 0; order.dir = 0; +// Variable para determinar si una clave de cuenta ha sido copiada al portapapeles var passToClip = 0; +// Variable para el ajuste óptimo del contenido a la altura del documento +var windowAdjustSize = 350; var strPassword; var charPassword; @@ -45,11 +48,13 @@ $(document).ready(function () { $("[title]").powerTip(powertipOptions); $('input, textarea').placeholder(); setContentSize(); + setWindowAdjustSize(); }).ajaxComplete(function () { $("[title]").powerTip(powertipOptions); $('input, textarea').placeholder(); }); +// Función para cargar el contenido de la acción del menú seleccionada function doAction(action, lastAction, id) { var data = {'action': action, 'lastAction': lastAction, 'id': id, isAjax: 1}; @@ -75,16 +80,26 @@ function doAction(action, lastAction, id) { }); } +// Función para establecer la altura del contenedor ajax function setContentSize() { // Calculate total height for full body resize var totalHeight = $("#content").height() + 100; //var totalWidth = $("#wrap").width(); -// alert(totalWidth + 'x' + totalHeight); $("#container").css("height", totalHeight); -// $("#wrap").css("width",totalWidth); } +// Función para establecer la variable de ajuste óptimo de altura +function setWindowAdjustSize() { + var browser = getBrowser(); + + if ( browser == "MSIE" ){ + windowAdjustSize = 150; + } + console.log(windowAdjustSize); +} + +// Función para retornar el scroll a la posición inicial function scrollUp() { $('html, body').animate({ scrollTop: 0 }, 'slow'); } @@ -100,6 +115,8 @@ function Clear(id, search) { $('#frmSearch').find('input[name="skey"]').val(0); $('#frmSearch').find('input[name="sorder"]').val(0); $(".select-box").val('').trigger("chosen:updated"); + order.key = 0; + order.dir = 0; } } @@ -113,7 +130,7 @@ function mkChosen(options) { }); } -// Función para realizar una búsqueda +// Función para la búsqueda de cuentas mediante filtros function accSearch(continous, event) { var lenTxtSearch = $('#txtSearch').val().length; @@ -127,33 +144,13 @@ function accSearch(continous, event) { window.lastlen = lenTxtSearch; - var datos = $("#frmSearch").serialize(); - $.fancybox.showLoading(); - - $.ajax({ - type: 'POST', - dataType: 'html', - url: APP_ROOT + '/ajax/ajax_search.php', - data: datos, - success: function (response) { - $('#resBuscar').html(response); - $('#data-search').css("max-height", $('html').height() - 300); - }, - error: function () { - $('#resBuscar').html(resMsg("nofancyerror")); - }, - complete: function () { - $.fancybox.hideLoading(); - } - }); + doSearch(); } -// Función para buscar con la ordenación por campos +// Función para la búsqueda de cuentas mediante ordenación function searchSort(skey, start, nav) { if (typeof(skey) === "undefined" || typeof(start) === "undefined") return false; - var sorder = 0; - if (order.key > 0 && order.key != skey) { order.key = skey; order.dir = 0; @@ -164,14 +161,18 @@ function searchSort(skey, start, nav) { order.dir = 0; } else { order.dir = 1; - sorder = 1; } } - $('#frmSearch').find('input[name="skey"]').val(skey); - $('#frmSearch').find('input[name="sorder"]').val(sorder); + $('#frmSearch').find('input[name="skey"]').val(order.key); + $('#frmSearch').find('input[name="sorder"]').val(order.dir); $('#frmSearch').find('input[name="start"]').val(start); + doSearch(); +} + +// Función para la búsqueda de cuentas +function doSearch(){ var frmData = $("#frmSearch").serialize(); $.fancybox.showLoading(); @@ -183,12 +184,15 @@ function searchSort(skey, start, nav) { data: frmData, success: function (response) { $('#resBuscar').html(response); - $('#data-search').css("max-height", $('html').height() - 300); - $('#search-sort-' + skey).addClass('filterOn'); - if (order.dir == 0) { - $('#search-sort-' + skey).append(''); - } else { - $('#search-sort-' + skey).append(''); + $('#resBuscar').css("max-height", $('html').height() - windowAdjustSize); + + if ( order.key ){ + $('#search-sort-' + order.key).addClass('filterOn'); + if (order.dir == 0) { + $('#search-sort-' + order.key).append(''); + } else { + $('#search-sort-' + order.key).append(''); + } } }, error: function () { @@ -201,7 +205,7 @@ function searchSort(skey, start, nav) { }); } -// Función para buscar con la ordenación por campos +// Función para navegar por el log de eventos function navLog(start, current) { if (typeof(start) === "undefined") return false; @@ -239,7 +243,7 @@ function viewPass(id, full, history) { async: false, data: {'accountid': id, 'full': full, 'isHistory': history}, success: function(data){ - if (data.length === 0) { + if (data === "-1") { doLogout(); } else { if ( full === 0 ){ @@ -254,7 +258,7 @@ function viewPass(id, full, history) { }); } -// Función para las variables de la URL y parsearlas a un array. +// Función para obtener las variables de la URL y parsearlas a un array. function getUrlVars() { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); @@ -311,6 +315,7 @@ function doLogin() { return false; } +// Función para salir de la sesión function doLogout() { var url = window.location.search; @@ -321,6 +326,7 @@ function doLogout() { } } +// Función para comprobar si se ha salido de la sesión function checkLogout() { var session = getUrlVars()["session"]; @@ -498,6 +504,7 @@ function delFile(id, sk, accid) { }); } +// Función para activar el Drag&Drop de archivos en las cuentas function dropFile(accountId, sk, maxsize) { var dropfiles = $('#dropzone'); var file_exts_ok = dropfiles.attr('data-files-ext').toLowerCase().split(','); @@ -547,6 +554,7 @@ function dropFile(accountId, sk, maxsize) { }); } +// Función para activar el Drag&Drop de archivos en la importación de cuentas function importFile(sk) { var dropfiles = $('#dropzone'); var file_exts_ok = ['csv']; @@ -602,7 +610,7 @@ function importFile(sk) { }); } -// Función para realizar la petición ajax +// Función para realizar una petición ajax function sendAjax(data, url) { $.fancybox.showLoading(); @@ -902,7 +910,7 @@ function outputResult(dstId) { } } -// Función para mostrar mensaje con Fancybox +// Función para mostrar mensaje con alertify function resMsg(type, txt, url, action) { if (typeof(url) !== "undefined") { $.ajax({ url: url, type: 'get', dataType: 'html', async: false, success: function (data) { @@ -916,15 +924,12 @@ function resMsg(type, txt, url, action) { switch (type) { case "ok": - //html = '
' + txt + '
'; alertify.set({ beforeCloseAction: action }); return alertify.success(txt); case "error": - //html = '
' + txt + '
'; alertify.set({ beforeCloseAction: action }); return alertify.error(txt); case "warn": - //html = '
' + txt + '
'; alertify.set({ beforeCloseAction: action }); return alertify.log(txt); case "info": @@ -938,7 +943,6 @@ function resMsg(type, txt, url, action) { return html; break; default: - //html = '
Oops...
'; alertify.set({ beforeCloseAction: action }); return alertify.error(txt); } @@ -966,4 +970,19 @@ function checkLdapConn() { // Función para volver al login function goLogin() { setTimeout(function () { location.href = "index.php";}, 2000); +} + +// Función para obtener el navegador usado +function getBrowser() +{ + var version = -1; // Return value assumes failure. + var ua = navigator.userAgent; + var re = new RegExp("(MSIE|Firefox)[ /]?([0-9]{1,}[\.0-9]{0,})", "i"); + if (re.exec(ua) != null) { + var browser = RegExp.$1; + //version = parseFloat( RegExp.$2 ); + } + + return browser; + //return version; } \ No newline at end of file