diff --git a/app/config/strings.js.inc b/app/config/strings.js.inc index 75b30168..85c370f5 100644 --- a/app/config/strings.js.inc +++ b/app/config/strings.js.inc @@ -93,5 +93,6 @@ return [ 68 => __('Actualizado'), 69 => __('Error al comprobar actualizaciones'), 70 => __('Avisos de sysPass'), - 71 => __('Vaciar los tracks?') + 71 => __('Vaciar los tracks?'), + 72 => __('Archivo descargado') ]; \ No newline at end of file diff --git a/app/modules/web/Controllers/AccountController.php b/app/modules/web/Controllers/AccountController.php index fa9f6917..d4426004 100644 --- a/app/modules/web/Controllers/AccountController.php +++ b/app/modules/web/Controllers/AccountController.php @@ -218,6 +218,8 @@ final class AccountController extends ControllerBase implements CrudControllerIn $this->view->assign('accountData', $accountData); + $clientAddress = $this->configData->isDemoEnabled() ? '***' : $this->request->getClientAddress(true); + $this->eventDispatcher->notifyEvent('show.account.link', new Event($this, EventMessage::factory() ->addDescription(__u('Enlace visualizado')) @@ -225,11 +227,12 @@ final class AccountController extends ControllerBase implements CrudControllerIn ->addDetail(__u('Cliente'), $accountData->getClientName()) ->addDetail(__u('Agente'), $this->router->request()->headers()->get('User-Agent')) ->addDetail(__u('HTTPS'), $this->router->request()->isSecure() ? __u('ON') : __u('OFF')) + ->addDetail(__u('IP'), $clientAddress) ->addData('userId', $publicLinkData->getUserId()) ->addData('notify', $publicLinkData->isNotify())) ); } else { - ErrorUtil::showErrorInView($this->view, ErrorUtil::ERR_PAGE_NO_PERMISSION, 'account-link'); + ErrorUtil::showErrorInView($this->view, ErrorUtil::ERR_PAGE_NO_PERMISSION, true, 'account-link'); } $this->view(); diff --git a/app/modules/web/Controllers/AccountFileController.php b/app/modules/web/Controllers/AccountFileController.php index 56b9b96b..49586b4d 100644 --- a/app/modules/web/Controllers/AccountFileController.php +++ b/app/modules/web/Controllers/AccountFileController.php @@ -49,6 +49,8 @@ use SP\Util\Util; */ final class AccountFileController extends ControllerBase implements CrudControllerInterface { + const EXTENSIONS_VIEW = ['TXT']; + use JsonTrait, ItemTrait; /** @@ -89,7 +91,10 @@ final class AccountFileController extends ControllerBase implements CrudControll return $this->returnJsonResponseData(['html' => $this->render()]); } - if (mb_strtoupper($fileData->getExtension()) === 'TXT') { + $extension = mb_strtoupper($fileData->getExtension()); + + if (in_array($extension, self::EXTENSIONS_VIEW)) { + $this->view->assign('extension', $extension); $this->view->assign('data', htmlentities($fileData->getContent())); $this->eventDispatcher->notifyEvent('show.accountFile', @@ -122,26 +127,38 @@ final class AccountFileController extends ControllerBase implements CrudControll try { $this->checkSecurityToken($this->previousSk, $this->request); + // Set the security toke to its previous value because we can't tell + // the browser which will be the new security token (not so good...) + $this->session->setSecurityKey($this->previousSk); + if (null === ($fileData = $this->accountFileService->getById($id))) { throw new SPException(__u('El archivo no existe'), SPException::INFO); } - // Enviamos el archivo al navegador - header('Set-Cookie: fileDownload=true; path=/'); - header('Cache-Control: max-age=60, must-revalidate'); - header('Content-length: ' . $fileData->getSize()); - header('Content-type: ' . $fileData->getType()); - header('Content-Disposition: attachment; filename="' . $fileData->getName() . '"'); - header('Content-Description: PHP Generated Data'); - header('Content-transfer-encoding: binary'); - $this->eventDispatcher->notifyEvent('download.accountFile', new Event($this, EventMessage::factory() ->addDescription(__u('Archivo descargado')) ->addDetail(__u('Archivo'), $fileData->getName())) ); - return $fileData->getContent(); + $response = $this->router->response(); + $response->header('Cache-Control', 'max-age=60, must-revalidate'); + $response->header('Content-length', $fileData->getSize()); + $response->header('Content-type', $fileData->getType()); + $response->header('Content-Description', ' sysPass file'); + $response->header('Content-transfer-encoding', 'binary'); + + $extension = mb_strtoupper($fileData->getExtension()); + + if ($extension === 'PDF') { + $response->header('Content-Disposition', 'inline; filename="' . $fileData->getName() . '"'); + } else { + $response->header('Set-Cookie', 'fileDownload=true; path=/'); + $response->header('Content-Disposition', 'attachment; filename="' . $fileData->getName() . '"'); + } + + $response->body($fileData->getContent()); + $response->send(true); } catch (\Exception $e) { processException($e); } @@ -413,7 +430,7 @@ final class AccountFileController extends ControllerBase implements CrudControll } catch (\Exception $e) { processException($e); - ErrorUtil::showErrorInView($this->view, ErrorUtil::ERR_EXCEPTION); + ErrorUtil::showErrorInView($this->view, ErrorUtil::ERR_EXCEPTION, true, 'files-list'); } $this->view(); diff --git a/app/modules/web/Controllers/UserPassResetController.php b/app/modules/web/Controllers/UserPassResetController.php index 543cfd7a..12f30a01 100644 --- a/app/modules/web/Controllers/UserPassResetController.php +++ b/app/modules/web/Controllers/UserPassResetController.php @@ -67,7 +67,7 @@ final class UserPassResetController extends ControllerBase ->getCustomLayout('request', strtolower($this->controllerName)); if (!$this->configData->isMailEnabled()) { - ErrorUtil::showErrorInView($this->view, self::ERR_UNAVAILABLE, 'request'); + ErrorUtil::showErrorInView($this->view, self::ERR_UNAVAILABLE, true, 'request'); } $this->view(); @@ -156,7 +156,7 @@ final class UserPassResetController extends ControllerBase if ($hash && $this->configData->isMailEnabled()) { $this->view->assign('hash', $hash); } else { - ErrorUtil::showErrorInView($this->view, self::ERR_UNAVAILABLE, 'reset'); + ErrorUtil::showErrorInView($this->view, self::ERR_UNAVAILABLE, true, 'reset'); } $this->view(); diff --git a/app/modules/web/themes/material-blue/views/account/files-list.inc b/app/modules/web/themes/material-blue/views/account/files-list.inc index 8c4fcbfa..43293aa5 100644 --- a/app/modules/web/themes/material-blue/views/account/files-list.inc +++ b/app/modules/web/themes/material-blue/views/account/files-list.inc @@ -9,7 +9,9 @@
"),k=c.find("img");if(0===k.length)return h(b);k.hide();$.magnificPopup.open({items:{src:c, -type:"inline"},callbacks:{open:function(){var a=this;k.on("click",function(){a.close()});setTimeout(function(){var a=sysPassApp.util.resizeImage(k);c.css({backgroundColor:"#fff",width:a.width,height:"auto"});k.show("slow")},500)}}})},q=function(){$.magnificPopup.close()},n={view:function(a){d.info("account:show");f(sysPassApp.requests.getRouteForQuery(a.data("action-route"),a.data("item-id")),"account")},viewHistory:function(a){d.info("account:showHistory");f(sysPassApp.requests.getRouteForQuery(a.data("action-route"), -a.val()),"account")},edit:function(a){d.info("account:edit");f(sysPassApp.requests.getRouteForQuery(a.data("action-route"),a.data("item-id")),"account")},delete:function(a){d.info("account:delete");var b='

'+sysPassApp.config.LANG[3]+"

";mdlDialog().show({text:b,negative:{title:sysPassApp.config.LANG[44],onClick:function(a){a.preventDefault();sysPassApp.msg.error(sysPassApp.config.LANG[44])}},positive:{title:sysPassApp.config.LANG[43],onClick:function(c){c= -sysPassApp.requests.getRequestOpts();c.url=e.entrypoint;c.data={r:"account/saveDelete/"+a.data("item-id"),sk:sysPassApp.sk.get()};sysPassApp.requests.getActionCall(c,function(c){sysPassApp.msg.out(c);sysPassApp.sk.set(c.csrf);n.search(a)})}}})},viewPass:function(a){d.info("account:viewPass");var b=a.data("parent-id")||0,c=0===b?a.data("item-id"):b,k=sysPassApp.requests.getRequestOpts();k.url=e.entrypoint;k.method="get";k.data={r:a.data("action-route")+"/"+c+"/"+b,sk:sysPassApp.sk.get(),isAjax:1}; -sysPassApp.requests.getActionCall(k,function(a){0!==a.status?sysPassApp.msg.out(a):(a=$(a.data.html),h(a),l=setTimeout(function(){q()},3E4),a.on("mouseleave",function(){clearTimeout(l);l=setTimeout(function(){q()},3E4)}).on("mouseenter",function(){0!==l&&clearTimeout(l)}))})},viewPassHistory:function(a){d.info("account:viewPassHistory");n.viewPass(a)},copyPass:function(a){d.info("account:copyPass");var b=a.data("parent-id");b=0===b?a.data("item-id"):b;var c=sysPassApp.requests.getRequestOpts();c.url= -e.entrypoint;c.method="get";c.async=!1;c.data={r:a.data("action-route")+"/"+b,sk:sysPassApp.sk.get(),isAjax:1};return sysPassApp.requests.getActionCall(c)},copyPassHistory:function(a){d.info("account:copyPassHistory");n.copyPassHistory(a)},copy:function(a){d.info("account:copy");f(sysPassApp.requests.getRouteForQuery(a.data("action-route"),a.data("item-id")),"account")},saveFavorite:function(a,b){d.info("account:saveFavorite");var c="on"===a.data("status"),k=c?a.data("action-route-off"):a.data("action-route-on"), -r=sysPassApp.requests.getRequestOpts();r.url=e.entrypoint;r.data={r:k+"/"+a.data("item-id"),sk:sysPassApp.sk.get(),isAjax:1};sysPassApp.requests.getActionCall(r,function(k){sysPassApp.msg.out(k);0===k.status&&(a.data("status",c?"off":"on"),"function"===typeof b&&b())})},request:function(a){d.info("account:request");var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint+"?r="+a.data("action-route")+"/"+a.data("item-id");b.data=a.serialize()+"&sk="+sysPassApp.sk.get();sysPassApp.requests.getActionCall(b, -function(a){sysPassApp.msg.out(a);0===a.status&&void 0!==a.data.nextAction&&(sysPassApp.sk.set(a.csrf),f({r:a.data.nextAction.nextAction},"account"))})},menu:function(a){a.hide();a.parent().children(".actions-optional").show(250)},sort:function(a){d.info("account:sort");var b=$("#frmSearch");b.find('input[name="skey"]').val(a.data("key"));b.find('input[name="sorder"]').val(a.data("dir"));b.find('input[name="start"]').val(a.data("start"));n.search()},editPass:function(a){d.info("account:editpass"); -var b=a.data("parent-id");b=void 0===b?a.data("item-id"):b;a=sysPassApp.requests.getRouteForQuery(a.data("action-route"),b);f(a,"account")},saveEditRestore:function(a){d.info("account:restore");var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint;b.data={r:a.data("action-route")+"/"+a.data("history-id")+"/"+a.data("item-id"),sk:sysPassApp.sk.get()};sysPassApp.requests.getActionCall(b,function(a){sysPassApp.msg.out(a);void 0!==a.data.itemId&&void 0!==a.data.nextAction&&(a=sysPassApp.requests.getRouteForQuery(a.data.nextAction, -a.data.itemId),f(a,"account"))})},listFiles:function(a){d.info("account:getfiles");var b=sysPassApp.requests.getRequestOpts();b.method="get";b.type="html";b.url=e.entrypoint;b.data={r:a.data("action-route")+"/"+a.data("item-id"),del:a.data("delete"),sk:sysPassApp.sk.get()};sysPassApp.requests.getActionCall(b,function(c){a.html(c)})},search:function(a){d.info("account:search");var b=$("#frmSearch");b.find("input[name='sk']").val(sysPassApp.sk.get());b.find("input[name='skey']").val();b.find("input[name='sorder']").val(); -void 0!==a&&b.find("input[name='start']").val(0);a=sysPassApp.requests.getRequestOpts();a.url=e.entrypoint+"?r="+b.data("action-route");a.method="get";a.data=b.serialize();sysPassApp.requests.getActionCall(a,function(a){10===a.status&&sysPassApp.msg.out(a);$("#res-content").empty().html(a.data.html)})},save:function(a){d.info("account:save");var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint+"?r="+a.data("action-route")+"/"+a.data("item-id");b.data=a.serialize();$("select.select-box-tags[data-hash][data-updated=true]").each(function(a, -k){b.data+="&"+k.getAttribute("id")+"_update=1"});sysPassApp.requests.getActionCall(b,function(a){sysPassApp.msg.out(a);void 0!==a.data.itemId&&void 0!==a.data.nextAction&&(a=sysPassApp.requests.getRouteForQuery(a.data.nextAction,a.data.itemId),f(a,"account"))})}},w={logout:function(){sysPassApp.util.redirect("index.php?r=login/logout")},login:function(a){d.info("main:login");var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint+"?r="+a.data("route");b.method="get";b.data=a.serialize();sysPassApp.requests.getActionCall(b, -function(b){var c=$(".extra-hidden");switch(b.status){case 0:sysPassApp.util.redirect(b.data.url);break;case 2:sysPassApp.msg.out(b);a.find("input[type='text'],input[type='password']").val("");a.find("input:visible:first").focus();0";mdlDialog().show({text:b,negative:{title:sysPassApp.config.LANG[44],onClick:function(a){a.preventDefault();sysPassApp.msg.error(sysPassApp.config.LANG[44])}},positive:{title:sysPassApp.config.LANG[43],onClick:function(b){var c;(b=a.find("input[name='taskId']").val())&&(c=v(b));var d=sysPassApp.requests.getRequestOpts();d.url=e.entrypoint+"?r="+a.data("action-route");d.method="get";d.useFullLoading=!!b;d.data=a.serialize(); -sysPassApp.requests.getActionCall(d,function(b){sysPassApp.msg.out(b);0!==b.status?a.find(":input[name=key]").val(""):(void 0!==c&&c.close(),setTimeout(function(){sysPassApp.util.redirect("index.php")},5E3))})}}})},getUpdates:function(){d.info("main:getUpdates");var a=sysPassApp.requests.getRequestOpts();a.url=e.entrypoint+"?r=status/checkRelease";a.method="get";a.timeout=1E4;a.useLoading=!1;a.data={isAjax:1};var b=$("#updates");sysPassApp.requests.getActionCall(a,function(a){0===a.status?0'+a.data.title+'\n
cloud_download
\n \n '+a.data.description+""):b.html('
check_circle
\n '+ +var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(c,k,e){c instanceof String&&(c=String(c));for(var f=c.length,h=0;h'+b+""),l=d.find("img");if(0===l.length)return h(b); +l.hide();$.magnificPopup.open({items:{src:d,type:"inline"},callbacks:{open:function(){var a=this;l.on("click",function(){a.close()});setTimeout(function(){var a=sysPassApp.util.resizeImage(l);d.css({backgroundColor:"#fff",width:a.width,height:"auto"});l.show("slow")},500)}}})},q=function(){$.magnificPopup.close()},n={view:function(a){c.info("account:show");f({r:[a.data("action-route"),a.data("item-id")]},"account")},viewHistory:function(a){c.info("account:showHistory");f({r:[a.data("action-route"), +a.val()]},"account")},edit:function(a){c.info("account:edit");f({r:[a.data("action-route"),a.data("item-id")]},"account")},delete:function(a){c.info("account:delete");var b='

'+sysPassApp.config.LANG[3]+"

";mdlDialog().show({text:b,negative:{title:sysPassApp.config.LANG[44],onClick:function(a){a.preventDefault();sysPassApp.msg.error(sysPassApp.config.LANG[44])}},positive:{title:sysPassApp.config.LANG[43],onClick:function(d){d=sysPassApp.requests.getRequestOpts(); +d.url=e.entrypoint;d.data={r:"account/saveDelete/"+a.data("item-id"),sk:sysPassApp.sk.get()};sysPassApp.requests.getActionCall(d,function(d){sysPassApp.msg.out(d);sysPassApp.sk.set(d.csrf);n.search(a)})}}})},viewPass:function(a){c.info("account:viewPass");var b=a.data("parent-id")||0,d=0===b?a.data("item-id"):b,l=sysPassApp.requests.getRequestOpts();l.method="get";l.url=sysPassApp.util.getUrl(e.entrypoint,{r:[a.data("action-route"),d,b],sk:sysPassApp.sk.get(),isAjax:1});sysPassApp.requests.getActionCall(l, +function(a){0!==a.status?sysPassApp.msg.out(a):(a=$(a.data.html),h(a),k=setTimeout(function(){q()},3E4),a.on("mouseleave",function(){clearTimeout(k);k=setTimeout(function(){q()},3E4)}).on("mouseenter",function(){0!==k&&clearTimeout(k)}))})},viewPassHistory:function(a){c.info("account:viewPassHistory");n.viewPass(a)},copyPass:function(a){c.info("account:copyPass");var b=a.data("parent-id");b=0===b?a.data("item-id"):b;var d=sysPassApp.requests.getRequestOpts();d.method="get";d.async=!1;d.url=sysPassApp.util.getUrl(e.entrypoint, +{r:[a.data("action-route"),b],sk:sysPassApp.sk.get(),isAjax:1});return sysPassApp.requests.getActionCall(d)},copyPassHistory:function(a){c.info("account:copyPassHistory");n.copyPassHistory(a)},copy:function(a){c.info("account:copy");f({r:[a.data("action-route"),a.data("item-id")]},"account")},saveFavorite:function(a,b){c.info("account:saveFavorite");var d="on"===a.data("status"),l=d?a.data("action-route-off"):a.data("action-route-on"),t=sysPassApp.requests.getRequestOpts();t.url=e.entrypoint;t.data= +{r:l+"/"+a.data("item-id"),sk:sysPassApp.sk.get(),isAjax:1};sysPassApp.requests.getActionCall(t,function(c){sysPassApp.msg.out(c);0===c.status&&(a.data("status",d?"off":"on"),"function"===typeof b&&b())})},request:function(a){c.info("account:request");var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint+"?r="+a.data("action-route")+"/"+a.data("item-id");b.data=a.serialize()+"&sk="+sysPassApp.sk.get();sysPassApp.requests.getActionCall(b,function(a){sysPassApp.msg.out(a);0===a.status&&void 0!== +a.data.nextAction&&(sysPassApp.sk.set(a.csrf),f({r:a.data.nextAction},"account"))})},menu:function(a){a.hide();a.parent().children(".actions-optional").show(250)},sort:function(a){c.info("account:sort");var b=$("#frmSearch");b.find('input[name="skey"]').val(a.data("key"));b.find('input[name="sorder"]').val(a.data("dir"));b.find('input[name="start"]').val(a.data("start"));n.search()},editPass:function(a){c.info("account:editpass");var b=a.data("parent-id");b=void 0===b?a.data("item-id"):b;f({r:[a.data("action-route"), +b]},"account")},saveEditRestore:function(a){c.info("account:restore");var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint;b.data={r:a.data("action-route")+"/"+a.data("history-id")+"/"+a.data("item-id"),sk:sysPassApp.sk.get()};sysPassApp.requests.getActionCall(b,function(a){sysPassApp.msg.out(a);void 0!==a.data.itemId&&void 0!==a.data.nextAction&&f({r:[a.data.nextAction,a.data.itemId]},"account")})},listFiles:function(a){c.info("account:getfiles");var b=sysPassApp.requests.getRequestOpts(); +b.method="get";b.type="html";b.url=sysPassApp.util.getUrl(e.entrypoint,{r:[a.data("action-route"),a.data("item-id")],del:a.data("delete"),sk:sysPassApp.sk.get()});sysPassApp.requests.getActionCall(b,function(d){a.html(d)})},search:function(a){c.info("account:search");var b=$("#frmSearch");b.find("input[name='sk']").val(sysPassApp.sk.get());b.find("input[name='skey']").val();b.find("input[name='sorder']").val();void 0!==a&&b.find("input[name='start']").val(0);var d=sysPassApp.requests.getRequestOpts(); +d.method="get";d.url=sysPassApp.util.getUrl(e.entrypoint,{r:a.data("action-route")});d.data=b.serialize();sysPassApp.requests.getActionCall(d,function(a){10===a.status&&sysPassApp.msg.out(a);$("#res-content").empty().html(a.data.html)})},save:function(a){c.info("account:save");var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint+"?r="+a.data("action-route")+"/"+a.data("item-id");b.data=a.serialize();$("select.select-box-tags[data-hash][data-updated=true]").each(function(a,c){b.data+="&"+ +c.getAttribute("id")+"_update=1"});sysPassApp.requests.getActionCall(b,function(a){sysPassApp.msg.out(a);void 0!==a.data.itemId&&void 0!==a.data.nextAction&&f({r:[a.data.nextAction,a.data.itemId]},"account")})}},w={logout:function(){sysPassApp.util.redirect("index.php?r=login/logout")},login:function(a){c.info("main:login");var b=sysPassApp.requests.getRequestOpts();b.url=sysPassApp.util.getUrl(e.entrypoint,{r:a.data("route")});b.method="get";b.data=a.serialize();sysPassApp.requests.getActionCall(b, +function(b){var d=$(".extra-hidden");switch(b.status){case 0:sysPassApp.util.redirect(b.data.url);break;case 2:sysPassApp.msg.out(b);a.find("input[type='text'],input[type='password']").val("");a.find("input:visible:first").focus();0";mdlDialog().show({text:b,negative:{title:sysPassApp.config.LANG[44],onClick:function(a){a.preventDefault();sysPassApp.msg.error(sysPassApp.config.LANG[44])}},positive:{title:sysPassApp.config.LANG[43],onClick:function(b){var d;(b=a.find("input[name='taskId']").val())&&(d=v(b));var c=sysPassApp.requests.getRequestOpts();c.url=sysPassApp.util.getUrl(e.entrypoint,{r:a.data("action-route")});c.method="get";c.useFullLoading= +!!b;c.data=a.serialize();sysPassApp.requests.getActionCall(c,function(b){sysPassApp.msg.out(b);0!==b.status?a.find(":input[name=key]").val(""):(void 0!==d&&d.close(),setTimeout(function(){sysPassApp.util.redirect("index.php")},5E3))})}}})},getUpdates:function(){c.info("main:getUpdates");var a=sysPassApp.requests.getRequestOpts();a.method="get";a.url=sysPassApp.util.getUrl(e.entrypoint,{r:"status/checkRelease",isAjax:1});a.timeout=1E4;a.useLoading=!1;var b=$("#updates");sysPassApp.requests.getActionCall(a, +function(a){0===a.status?0'+a.data.title+'\n
cloud_download
\n \n '+a.data.description+""):b.html('
check_circle
\n '+ sysPassApp.config.LANG[68]+""):b.html('
warning
\n '+sysPassApp.config.LANG[69]+"");sysPassApp.theme.update()},function(){b.html('
warning
\n '+ -sysPassApp.config.LANG[69]+"")})},getNotices:function(){d.info("main:getNotices");var a=sysPassApp.requests.getRequestOpts();a.url=e.entrypoint+"?r=status/checkNotices";a.method="get";a.timeout=1E4;a.useLoading=!1;a.data={isAjax:1};var b=$("#notices");sysPassApp.requests.getActionCall(a,function(a){0===a.status&&0\n
")})},getNotices:function(){c.info("main:getNotices");var a=sysPassApp.requests.getRequestOpts();a.method="get";a.url=sysPassApp.util.getUrl(e.entrypoint,{r:"status/checkNotices",isAjax:1});a.timeout=1E4;a.useLoading=!1;a.data={isAjax:1};var b=$("#notices");sysPassApp.requests.getActionCall(a,function(a){0===a.status&&0\n
feedback
\n \n \n
'+sysPassApp.config.LANG[70]+"
"+a.data.map(function(a){return a.title}).join("
")+"\n
");sysPassApp.theme.update()})}},g={state:{tab:{index:0,refresh:!0,route:""},itemId:0,update:function(a){var b=$("#content").find("[id^='tabs-'].is-active"); -0
",d=m.getSelection(a);!1!==d&&mdlDialog().show({text:c,negative:{title:sysPassApp.config.LANG[44],onClick:function(a){a.preventDefault();sysPassApp.msg.error(sysPassApp.config.LANG[44])}},positive:{title:sysPassApp.config.LANG[43],onClick:function(a){a.preventDefault();"function"===typeof b&&b(d)}}})},getSelection:function(a){a=a.data("selection");var b=[];return a&&($(a).find(".is-selected").each(function(){b.push($(this).data("item-id"))}),0===b.length)?!1: -b}},v=function(a){var b=$("#taskStatus");b.empty().html(sysPassApp.config.LANG[62]);var c=sysPassApp.requests.getRequestOpts();c.method="get";c.url=e.entrypoint+"?r=task/runTask/"+a;return sysPassApp.requests.getActionEvent(c,function(a){a=a.task+" - "+a.message+" - "+a.time+" - "+a.progress+"%";a+="
"+sysPassApp.config.LANG[62];b.empty().html(a)})};return{getContent:f,showFloatingBox:h,closeFloatingBox:q,appMgmt:t,account:n,accountManager:{restore:function(a){d.info("accountManager:restore"); -g.state.update(a);var b=a.data("item-id"),c=sysPassApp.requests.getRequestOpts();c.url=e.entrypoint;c.method="get";c.data={r:a.data("action-route")+"/"+b,sk:sysPassApp.sk.get(),isAjax:1};sysPassApp.requests.getActionCall(c,function(c){sysPassApp.msg.out(c);0===c.status&&((c=a.data("action-next"))?f({r:c+"/"+b}):f({r:g.state.tab.route,tabIndex:g.state.tab.index}))})}},file:{view:function(a){d.info("file:view");var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint;b.method="get";b.data={r:a.data("action-route")+ -"/"+a.data("item-id"),sk:sysPassApp.sk.get()};sysPassApp.requests.getActionCall(b,function(b){if(0!==b.status)return sysPassApp.msg.out(b);p(a,b.data.html)})},download:function(a){d.info("file:download");a={r:a.data("action-route")+"/"+a.data("item-id"),sk:sysPassApp.sk.get()};$.fileDownload(e.entrypoint,{httpMethod:"GET",data:a})},delete:function(a){d.info("file:delete");var b='

'+sysPassApp.config.LANG[15]+"

";mdlDialog().show({text:b,negative:{title:sysPassApp.config.LANG[44], -onClick:function(a){a.preventDefault();sysPassApp.msg.error(sysPassApp.config.LANG[44])}},positive:{title:sysPassApp.config.LANG[43],onClick:function(b){b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint;b.method="get";b.data={r:a.data("action-route")+"/"+a.data("item-id"),sk:sysPassApp.sk.get()};sysPassApp.requests.getActionCall(b,function(a){sysPassApp.msg.out(a);0===a.status&&n.listFiles($("#list-account-files"))})}}})}},checks:{wiki:function(a){d.info("checks:wiki");a=$(a.data("src")); -a.find("[name='sk']").val(sysPassApp.sk.get());var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint;b.data=a.serialize();sysPassApp.requests.getActionCall(b,function(a){sysPassApp.msg.out(a);0===a.status&&$("#dokuWikiResCheck").html(a.data)})}},config:{save:function(a){d.info("config:save");g.save(a)},masterpass:function(a){var b='

'+sysPassApp.config.LANG[59]+"

";mdlDialog().show({text:b,negative:{title:sysPassApp.config.LANG[44],onClick:function(b){b.preventDefault(); -sysPassApp.msg.error(sysPassApp.config.LANG[44]);a.find(":input[type=password]").val("")}},positive:{title:sysPassApp.config.LANG[43],onClick:function(b){var c;(b=a.find("input[name='taskId']").val())&&(c=v(b));var d=sysPassApp.requests.getRequestOpts();d.url=e.entrypoint;d.useFullLoading=!!b;d.data=a.serialize();sysPassApp.requests.getActionCall(d,function(b){sysPassApp.msg.out(b);a.find(":input[type=password]").val("");void 0!==c&&c.close()})}}})},backup:function(a){d.info("config:backup");g.state.update(a); -var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint+"?r="+a.data("action-route");b.useFullLoading=!0;b.data=a.serialize()+"&sk="+sysPassApp.sk.get();sysPassApp.requests.getActionCall(b,function(a){sysPassApp.msg.out(a);0===a.status&&f({r:g.state.tab.route,tabIndex:g.state.tab.index})})},export:function(a){d.info("config:export");g.save(a)},import:function(a){d.info("config:import");var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint+"?r="+a.data("action-route");b.data=a.serialize()+ -"&sk="+sysPassApp.sk.get();sysPassApp.requests.getActionCall(b,function(a){sysPassApp.msg.out(a)})},refreshMpass:function(a){d.info("config:import");var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint+"?r="+a.data("action-route");b.data={sk:a.data("sk"),isAjax:1};sysPassApp.requests.getActionCall(b,function(a){sysPassApp.msg.out(a)})},mailCheck:function(a){d.info("config:mailCheck");var b=$(a.data("src")),c=sysPassApp.requests.getRequestOpts();c.url=e.entrypoint+"?r="+a.data("action-route"); -c.data=b.serialize()+"&sk="+sysPassApp.sk.get();sysPassApp.requests.getActionCall(c,function(a){sysPassApp.msg.out(a)})}},main:w,user:{showSettings:function(a){d.info("user:showSettings");f({r:a.data("action-route")},"userSettings")},saveSettings:function(a){d.info("user:saveSettings");g.save(a)},password:function(a){d.info("user:password");var b=sysPassApp.requests.getRequestOpts();b.type="html";b.method="get";b.url=e.entrypoint;b.data={r:a.data("action-route")+"/"+a.data("item-id"),sk:sysPassApp.sk.get(), -isAjax:1};sysPassApp.requests.getActionCall(b,function(a){0===a.length?w.logout():h(a)})},passreset:function(a){d.info("user:passreset");var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint+"/?r="+a.data("action-route");b.data=a.serialize();sysPassApp.requests.getActionCall(b,function(a){sysPassApp.msg.out(a);0===a.status&&setTimeout(function(){sysPassApp.util.redirect("index.php")},2E3)})}},link:{save:function(a){d.info("link:save");var b=function(b){var c=a.data("account-id"),d=sysPassApp.requests.getRequestOpts(); -c?d.url=e.entrypoint+"?r="+a.data("action-route")+"/"+c+"/"+b:(d.url=e.entrypoint+"?r="+a.data("action-route"),d.data=a.serialize()+"&sk="+sysPassApp.sk.get());sysPassApp.requests.getActionCall(d,function(b){sysPassApp.msg.out(b);0===b.status&&f({r:a.data("action-next")+"/"+c})})},c='

'+sysPassApp.config.LANG[48]+"

";mdlDialog().show({text:c,negative:{title:sysPassApp.config.LANG[44],onClick:function(a){a.preventDefault();b(0)}},positive:{title:sysPassApp.config.LANG[43], -onClick:function(a){a.preventDefault();b(1)}}})},delete:function(a){d.info("link:delete");var b='

'+sysPassApp.config.LANG[12]+"

";mdlDialog().show({text:b,negative:{title:sysPassApp.config.LANG[44],onClick:function(a){a.preventDefault();sysPassApp.msg.error(sysPassApp.config.LANG[44])}},positive:{title:sysPassApp.config.LANG[43],onClick:function(b){b.preventDefault();b=a.data("item-id");var c=sysPassApp.requests.getRequestOpts();c.url=e.entrypoint+"?r="+ -a.data("action-route")+"/"+b;sysPassApp.requests.getActionCall(c,function(b){sysPassApp.msg.out(b);0===b.status&&f({r:a.data("action-next")+"/"+a.data("account-id")})})}}})},refresh:function(a){d.info("link:refresh");g.state.update(a);var b=a.data("item-id"),c=sysPassApp.requests.getRequestOpts();c.url=e.entrypoint;c.method="get";c.data={r:a.data("action-route")+"/"+b,sk:sysPassApp.sk.get(),isAjax:1};sysPassApp.requests.getActionCall(c,function(b){sysPassApp.msg.out(b);0===b.status&&((b=a.data("action-next"))? -f({r:b+"/"+a.data("account-id")}):f({r:g.state.tab.route,tabIndex:g.state.tab.index}))})}},eventlog:{clear:function(a){var b='

'+sysPassApp.config.LANG[20]+"

";mdlDialog().show({text:b,negative:{title:sysPassApp.config.LANG[44],onClick:function(a){a.preventDefault();sysPassApp.msg.error(sysPassApp.config.LANG[44])}},positive:{title:sysPassApp.config.LANG[43],onClick:function(b){b.preventDefault();g.save(a)}}})}},ajaxUrl:e,plugin:{toggle:function(a){d.info("plugin:enable"); -g.state.update(a);var b=a.data("item-id"),c=sysPassApp.requests.getRequestOpts();c.url=e.entrypoint;c.method="get";c.data={r:a.data("action-route")+"/"+b,sk:sysPassApp.sk.get(),isAjax:1};sysPassApp.requests.getActionCall(c,function(a){sysPassApp.msg.out(a);0===a.status&&setTimeout(function(){sysPassApp.util.redirect("index.php")},2E3)})},reset:function(a){d.info("plugin:reset");var b='

'+sysPassApp.config.LANG[58]+"

";mdlDialog().show({text:b,negative:{title:sysPassApp.config.LANG[44], -onClick:function(a){a.preventDefault();sysPassApp.msg.error(sysPassApp.config.LANG[44])}},positive:{title:sysPassApp.config.LANG[43],onClick:function(b){b.preventDefault();g.save(a)}}})},search:function(a){d.info("plugin:search");m.search(a)},show:function(a){d.info("plugin:show");t.show(a)},save:function(a){d.info("plugin:save");var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint+"?r="+a.data("route");b.data=a.serialize()+"&sk="+sysPassApp.sk.get();sysPassApp.requests.getActionCall(b,function(b){sysPassApp.msg.out(b); -0===b.status&&(f({r:a.data("action-next")}),$.magnificPopup.close())})},nav:function(a){d.info("plugin:nav");m.nav(a)}},notification:u,wiki:{show:function(a){d.info("wiki:show");var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint;b.method="get";b.data={pageName:a.data("pagename"),actionId:a.data("action-id"),sk:sysPassApp.sk.get(),isAjax:1};sysPassApp.requests.getActionCall(b,function(a){0!==a.status?sysPassApp.msg.out(a):h(a.data.html)})}},items:{get:function(a){d.info("items:get");var b= -a[0].selectize;b.clearOptions();b.load(function(c){var d=sysPassApp.requests.getRequestOpts();d.url=e.entrypoint;d.method="get";d.data={r:a.data("action-route")+"/"+a.data("item-id"),sk:a.data("sk")};sysPassApp.requests.getActionCall(d,function(d){c(d.data);b.setValue(a.data("selected-id"),!0);sysPassApp.triggers.updateFormHash()})})},update:function(a){d.info("items:update");var b=$("#"+a.data("item-dst"))[0].selectize,c=b.getValue();b.clearOptions();b.load(function(d){var f=sysPassApp.requests.getRequestOpts(); -f.url=e.entrypoint;f.method="get";f.data={r:a.data("item-route"),sk:sysPassApp.sk.get()};sysPassApp.requests.getActionCall(f,function(a){d(a);b.setValue(c,!0)})})}},ldap:{check:function(a){d.info("ldap:check");var b=$(a.data("src")),c=sysPassApp.requests.getRequestOpts();c.url=e.entrypoint+"?r="+a.data("action-route");c.data=b.serialize()+"&sk="+sysPassApp.sk.get();sysPassApp.requests.getActionCall(c,function(a){sysPassApp.msg.out(a);0===a.status&&void 0!==a.data.template&&void 0!==a.data.items&& -h(a.data.template,{open:function(){var b=$("#ldap-results").find(".list-wrap").empty();a.data.items.forEach(function(a){b.append(sysPassApp.theme.html.getList(a.items,a.icon))})}})})},import:function(a){d.info("ldap:import");var b='

'+sysPassApp.config.LANG[57]+"

";mdlDialog().show({text:b,negative:{title:sysPassApp.config.LANG[44],onClick:function(a){a.preventDefault();sysPassApp.msg.error(sysPassApp.config.LANG[44])}},positive:{title:sysPassApp.config.LANG[43], -onClick:function(b){b=$(a.data("src"));var c=sysPassApp.requests.getRequestOpts();c.url=e.entrypoint+"?r="+a.data("action-route");c.data=b.serialize()+"&sk="+sysPassApp.sk.get();sysPassApp.requests.getActionCall(c,function(a){sysPassApp.msg.out(a)})}}})}},track:{unlock:function(a){d.info("track:unlock");var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint;b.method="get";b.data={r:a.data("action-route")+"/"+a.data("item-id"),sk:sysPassApp.sk.get(),isAjax:1};sysPassApp.requests.getActionCall(b, -function(b){sysPassApp.msg.out(b);g.refresh(a)})},clear:function(a){d.info("track:clear");var b='

'+sysPassApp.config.LANG[71]+"

";mdlDialog().show({text:b,negative:{title:sysPassApp.config.LANG[44],onClick:function(a){a.preventDefault();sysPassApp.msg.error(sysPassApp.config.LANG[44])}},positive:{title:sysPassApp.config.LANG[43],onClick:function(b){b.preventDefault();g.save(a)}}})}}}}; +0",c=m.getSelection(a);!1!==c&&mdlDialog().show({text:d,negative:{title:sysPassApp.config.LANG[44],onClick:function(a){a.preventDefault();sysPassApp.msg.error(sysPassApp.config.LANG[44])}},positive:{title:sysPassApp.config.LANG[43],onClick:function(a){a.preventDefault();"function"===typeof b&&b(c)}}})},getSelection:function(a){a=a.data("selection");var b=[]; +return a&&($(a).find(".is-selected").each(function(){b.push($(this).data("item-id"))}),0===b.length)?!1:b}},v=function(a){var b=$("#taskStatus");b.empty().html(sysPassApp.config.LANG[62]);var d=sysPassApp.requests.getRequestOpts();d.method="get";d.url=sysPassApp.util.getUrl(e.entrypoint,{r:["task/runTask",a]});return sysPassApp.requests.getActionEvent(d,function(a){a=a.task+" - "+a.message+" - "+a.time+" - "+a.progress+"%";a+="
"+sysPassApp.config.LANG[62];b.empty().html(a)})};return{getContent:f, +showFloatingBox:h,closeFloatingBox:q,appMgmt:u,account:n,accountManager:{restore:function(a){c.info("accountManager:restore");g.state.update(a);var b=a.data("item-id"),d=sysPassApp.requests.getRequestOpts();d.method="get";d.url=sysPassApp.util.getUrl(e.entrypoint,{r:[a.data("action-route"),a.data("item-id")],sk:sysPassApp.sk.get(),isAjax:1});sysPassApp.requests.getActionCall(d,function(d){sysPassApp.msg.out(d);0===d.status&&((d=a.data("action-next"))?f({r:[d,b]}):f({r:g.state.tab.route,tabIndex:g.state.tab.index}))})}}, +file:{view:function(a){c.info("file:view");var b=sysPassApp.requests.getRequestOpts();b.method="get";b.url=sysPassApp.util.getUrl(e.entrypoint,{r:[a.data("action-route"),a.data("item-id")],sk:sysPassApp.sk.get()});sysPassApp.requests.getActionCall(b,function(b){if(0!==b.status)return sysPassApp.msg.out(b);p(a,b.data.html)})},download:function(a){c.info("file:download");var b=a.data("item-type");a=sysPassApp.util.getUrl(e.entrypoint,{r:[a.data("action-route"),a.data("item-id")],sk:sysPassApp.sk.get()}); +"PDF"===b?window.open(a,"_blank"):$.fileDownload(a,{httpMethod:"GET",successCallback:function(a){sysPassApp.msg.ok(sysPassApp.config.LANG[72])}})},delete:function(a){c.info("file:delete");var b='

'+sysPassApp.config.LANG[15]+"

";mdlDialog().show({text:b,negative:{title:sysPassApp.config.LANG[44],onClick:function(a){a.preventDefault();sysPassApp.msg.error(sysPassApp.config.LANG[44])}},positive:{title:sysPassApp.config.LANG[43],onClick:function(b){b=sysPassApp.requests.getRequestOpts(); +b.method="get";b.url=sysPassApp.util.getUrl(e.entrypoint,{r:[a.data("action-route"),a.data("item-id")],sk:sysPassApp.sk.get()});sysPassApp.requests.getActionCall(b,function(a){sysPassApp.msg.out(a);0===a.status&&n.listFiles($("#list-account-files"))})}}})}},checks:{wiki:function(a){c.info("checks:wiki");a=$(a.data("src"));a.find("[name='sk']").val(sysPassApp.sk.get());var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint;b.data=a.serialize();sysPassApp.requests.getActionCall(b,function(a){sysPassApp.msg.out(a); +0===a.status&&$("#dokuWikiResCheck").html(a.data)})}},config:{save:function(a){c.info("config:save");g.save(a)},masterpass:function(a){var b='

'+sysPassApp.config.LANG[59]+"

";mdlDialog().show({text:b,negative:{title:sysPassApp.config.LANG[44],onClick:function(b){b.preventDefault();sysPassApp.msg.error(sysPassApp.config.LANG[44]);a.find(":input[type=password]").val("")}},positive:{title:sysPassApp.config.LANG[43],onClick:function(b){var d;(b=a.find("input[name='taskId']").val())&& +(d=v(b));var c=sysPassApp.requests.getRequestOpts();c.url=e.entrypoint;c.useFullLoading=!!b;c.data=a.serialize();sysPassApp.requests.getActionCall(c,function(b){sysPassApp.msg.out(b);a.find(":input[type=password]").val("");void 0!==d&&d.close()})}}})},backup:function(a){c.info("config:backup");g.state.update(a);var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint+"?r="+a.data("action-route");b.useFullLoading=!0;b.data=a.serialize()+"&sk="+sysPassApp.sk.get();sysPassApp.requests.getActionCall(b, +function(a){sysPassApp.msg.out(a);0===a.status&&f({r:g.state.tab.route,tabIndex:g.state.tab.index})})},export:function(a){c.info("config:export");g.save(a)},import:function(a){c.info("config:import");var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint+"?r="+a.data("action-route");b.data=a.serialize()+"&sk="+sysPassApp.sk.get();sysPassApp.requests.getActionCall(b,function(a){sysPassApp.msg.out(a)})},refreshMpass:function(a){c.info("config:import");var b=sysPassApp.requests.getRequestOpts(); +b.method="get";b.url=sysPassApp.util.getUrl(e.entrypoint,{r:a.data("action-route"),sk:sysPassApp.sk.get(),isAjax:1});sysPassApp.requests.getActionCall(b,function(a){sysPassApp.msg.out(a)})},mailCheck:function(a){c.info("config:mailCheck");var b=$(a.data("src")),d=sysPassApp.requests.getRequestOpts();d.url=e.entrypoint+"?r="+a.data("action-route");d.data=b.serialize()+"&sk="+sysPassApp.sk.get();sysPassApp.requests.getActionCall(d,function(a){sysPassApp.msg.out(a)})}},main:w,user:{showSettings:function(a){c.info("user:showSettings"); +f({r:a.data("action-route")},"userSettings")},saveSettings:function(a){c.info("user:saveSettings");g.save(a)},password:function(a){c.info("user:password");var b=sysPassApp.requests.getRequestOpts();b.type="html";b.method="get";b.url=sysPassApp.util.getUrl(e.entrypoint,{r:[a.data("action-route"),a.data("item-id")],sk:sysPassApp.sk.get(),isAjax:1});sysPassApp.requests.getActionCall(b,function(a){0===a.length?w.logout():h(a)})},passreset:function(a){c.info("user:passreset");var b=sysPassApp.requests.getRequestOpts(); +b.url=e.entrypoint+"/?r="+a.data("action-route");b.data=a.serialize();sysPassApp.requests.getActionCall(b,function(a){sysPassApp.msg.out(a);0===a.status&&setTimeout(function(){sysPassApp.util.redirect("index.php")},2E3)})}},link:{save:function(a){c.info("link:save");var b=function(b){var d=a.data("account-id"),c=sysPassApp.requests.getRequestOpts();c.method="get";d?c.url=sysPassApp.util.getUrl(e.entrypoint,{r:[a.data("action-route"),d,b],sk:sysPassApp.sk.get(),isAjax:1}):(c.url=sysPassApp.util.getUrl(e.entrypoint, +{r:a.data("action-route"),sk:sysPassApp.sk.get(),isAjax:1}),c.data=a.serialize());sysPassApp.requests.getActionCall(c,function(b){sysPassApp.msg.out(b);0===b.status&&f({r:[a.data("action-next"),d]})})},d='

'+sysPassApp.config.LANG[48]+"

";mdlDialog().show({text:d,negative:{title:sysPassApp.config.LANG[44],onClick:function(a){a.preventDefault();b(0)}},positive:{title:sysPassApp.config.LANG[43],onClick:function(a){a.preventDefault();b(1)}}})},delete:function(a){c.info("link:delete"); +var b='

'+sysPassApp.config.LANG[12]+"

";mdlDialog().show({text:b,negative:{title:sysPassApp.config.LANG[44],onClick:function(a){a.preventDefault();sysPassApp.msg.error(sysPassApp.config.LANG[44])}},positive:{title:sysPassApp.config.LANG[43],onClick:function(b){b.preventDefault();b=sysPassApp.requests.getRequestOpts();b.method="get";b.url=sysPassApp.util.getUrl(e.entrypoint,{r:[a.data("action-route"),a.data("item-id")],sk:sysPassApp.sk.get(),isAjax:1});sysPassApp.requests.getActionCall(b, +function(b){sysPassApp.msg.out(b);0===b.status&&f({r:[a.data("action-next"),a.data("account-id")]})})}}})},refresh:function(a){c.info("link:refresh");g.state.update(a);var b=sysPassApp.requests.getRequestOpts();b.method="get";b.url=sysPassApp.util.getUrl(e.entrypoint,{r:[a.data("action-route"),a.data("item-id")],sk:sysPassApp.sk.get(),isAjax:1});sysPassApp.requests.getActionCall(b,function(b){sysPassApp.msg.out(b);0===b.status&&((b=a.data("action-next"))?f({r:[b,a.data("account-id")]}):f({r:g.state.tab.route, +tabIndex:g.state.tab.index}))})}},eventlog:{clear:function(a){var b='

'+sysPassApp.config.LANG[20]+"

";mdlDialog().show({text:b,negative:{title:sysPassApp.config.LANG[44],onClick:function(a){a.preventDefault();sysPassApp.msg.error(sysPassApp.config.LANG[44])}},positive:{title:sysPassApp.config.LANG[43],onClick:function(b){b.preventDefault();g.save(a)}}})}},ajaxUrl:e,plugin:{toggle:function(a){c.info("plugin:enable");g.state.update(a);var b=sysPassApp.requests.getRequestOpts(); +b.method="get";b.url=sysPassApp.util.getUrl(e.entrypoint,{r:[a.data("action-route"),a.data("item-id")],sk:sysPassApp.sk.get(),isAjax:1});sysPassApp.requests.getActionCall(b,function(a){sysPassApp.msg.out(a);0===a.status&&setTimeout(function(){sysPassApp.util.redirect("index.php")},2E3)})},reset:function(a){c.info("plugin:reset");var b='

'+sysPassApp.config.LANG[58]+"

";mdlDialog().show({text:b,negative:{title:sysPassApp.config.LANG[44],onClick:function(a){a.preventDefault(); +sysPassApp.msg.error(sysPassApp.config.LANG[44])}},positive:{title:sysPassApp.config.LANG[43],onClick:function(b){b.preventDefault();g.save(a)}}})},search:function(a){c.info("plugin:search");m.search(a)},show:function(a){c.info("plugin:show");u.show(a)},save:function(a){c.info("plugin:save");var b=sysPassApp.requests.getRequestOpts();b.url=e.entrypoint+"?r="+a.data("route");b.data=a.serialize()+"&sk="+sysPassApp.sk.get();sysPassApp.requests.getActionCall(b,function(b){sysPassApp.msg.out(b);0===b.status&& +(f({r:a.data("action-next")}),$.magnificPopup.close())})},nav:function(a){c.info("plugin:nav");m.nav(a)}},notification:r,wiki:{show:function(a){c.info("wiki:show");var b=sysPassApp.requests.getRequestOpts();b.method="get";b.url=sysPassApp.util.getUrl(e.entrypoint,{r:a.data("action-route"),pageName:a.data("pagename"),actionId:a.data("action-id"),sk:sysPassApp.sk.get(),isAjax:1});sysPassApp.requests.getActionCall(b,function(a){0!==a.status?sysPassApp.msg.out(a):h(a.data.html)})}},items:{get:function(a){c.info("items:get"); +var b=a[0].selectize;b.clearOptions();b.load(function(d){var c=sysPassApp.requests.getRequestOpts();c.method="get";c.url=sysPassApp.util.getUrl(e.entrypoint,{r:[a.data("action-route"),a.data("item-id")],sk:sysPassApp.sk.get()});sysPassApp.requests.getActionCall(c,function(c){d(c.data);b.setValue(a.data("selected-id"),!0);sysPassApp.triggers.updateFormHash()})})},update:function(a){c.info("items:update");var b=$("#"+a.data("item-dst"))[0].selectize,d=b.getValue();b.clearOptions();b.load(function(c){var f= +sysPassApp.requests.getRequestOpts();f.method="get";f.url=sysPassApp.util.getUrl(e.entrypoint,{r:a.data("action-route"),sk:sysPassApp.sk.get()});sysPassApp.requests.getActionCall(f,function(a){c(a);b.setValue(d,!0)})})}},ldap:{check:function(a){c.info("ldap:check");var b=$(a.data("src")),d=sysPassApp.requests.getRequestOpts();d.url=e.entrypoint+"?r="+a.data("action-route");d.data=b.serialize()+"&sk="+sysPassApp.sk.get();sysPassApp.requests.getActionCall(d,function(a){sysPassApp.msg.out(a);0===a.status&& +void 0!==a.data.template&&void 0!==a.data.items&&h(a.data.template,{open:function(){var b=$("#ldap-results").find(".list-wrap").empty();a.data.items.forEach(function(a){b.append(sysPassApp.theme.html.getList(a.items,a.icon))})}})})},import:function(a){c.info("ldap:import");var b='

'+sysPassApp.config.LANG[57]+"

";mdlDialog().show({text:b,negative:{title:sysPassApp.config.LANG[44],onClick:function(a){a.preventDefault();sysPassApp.msg.error(sysPassApp.config.LANG[44])}}, +positive:{title:sysPassApp.config.LANG[43],onClick:function(b){b=$(a.data("src"));var c=sysPassApp.requests.getRequestOpts();c.url=e.entrypoint+"?r="+a.data("action-route");c.data=b.serialize()+"&sk="+sysPassApp.sk.get();sysPassApp.requests.getActionCall(c,function(a){sysPassApp.msg.out(a)})}}})}},track:{unlock:function(a){c.info("track:unlock");var b=sysPassApp.requests.getRequestOpts();b.method="get";b.url=sysPassApp.util.getUrl(e.entrypoint,{r:[a.data("action-route"),a.data("item-id")],sk:sysPassApp.sk.get(), +isAjax:1});sysPassApp.requests.getActionCall(b,function(b){sysPassApp.msg.out(b);g.refresh(a)})},clear:function(a){c.info("track:clear");var b='

'+sysPassApp.config.LANG[71]+"

";mdlDialog().show({text:b,negative:{title:sysPassApp.config.LANG[44],onClick:function(a){a.preventDefault();sysPassApp.msg.error(sysPassApp.config.LANG[44])}},positive:{title:sysPassApp.config.LANG[43],onClick:function(b){b.preventDefault();g.save(a)}}})}}}}; diff --git a/public/js/app-requests.js b/public/js/app-requests.js index 338710e5..c2336a35 100644 --- a/public/js/app-requests.js +++ b/public/js/app-requests.js @@ -236,26 +236,10 @@ sysPass.Requests = function (sysPassApp) { return source; }; - /** - * Returns an object for a given route and query - * - * @param route - * @param query - * @returns {{r: string}} - */ - const getRouteForQuery = function (route, query) { - if (typeof query === "object") { - return {r: route + "/" + query.join("/")}; - } - - return {r: route + "/" + query}; - }; - return { getRequestOpts: getRequestOpts, getActionCall: getActionCall, getActionEvent: getActionEvent, - getRouteForQuery: getRouteForQuery, history: history }; }; diff --git a/public/js/app-requests.min.js b/public/js/app-requests.min.js index f1fd343e..b2adf648 100644 --- a/public/js/app-requests.min.js +++ b/public/js/app-requests.min.js @@ -1,5 +1,5 @@ -sysPass.Requests=function(c){var e=c.log,b=[],h={type:"json",url:"",method:"post",callback:"",async:!0,data:"",cache:!1,processData:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",timeout:0,addHistory:!1,hash:"",useLoading:!0,useFullLoading:!1};Object.seal(h);var k={get:function(){return b},add:function(a){var f=""===a.hash?c.util.hash.md5(JSON.stringify(a)):a.hash;if(0

"+b.responseText+"

",e.error(d),"html"===a.type&&$("#content").html(c.msg.html.error(d)), +sysPass.Requests=function(c){var e=c.log,b=[],g={type:"json",url:"",method:"post",callback:"",async:!0,data:"",cache:!1,processData:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",timeout:0,addHistory:!1,hash:"",useLoading:!0,useFullLoading:!1};Object.seal(g);var k={get:function(){return b},add:function(a){var h=""===a.hash?c.util.hash.md5(JSON.stringify(a)):a.hash;if(0

"+b.responseText+"

",e.error(d),"html"===a.type&&$("#content").html(c.msg.html.error(d)), c.msg.error(d)):m()},complete:function(b){!0===a.useLoading&&c.theme.loading.hide();void 0!==c.theme&&c.theme.ajax.complete()}})},getActionEvent:function(a,b,c){var f=l(a.url);f+="?"+$.param(a.data);var d=new EventSource(f);d.addEventListener("message",function(a){a=JSON.parse(a.data);e.debug(a);1===a.end?(e.info("getActionEvent:Ending"),d.close(),"function"===typeof c&&c(a)):"function"===typeof b&&b(a)});d.addEventListener("error",function(a){e.error("getActionEvent:Error occured");d.close()});return d}, -getRouteForQuery:function(a,b){return"object"===typeof b?{r:a+"/"+b.join("/")}:{r:a+"/"+b}},history:k}}; +history:k}}; diff --git a/public/js/app-util.js b/public/js/app-util.js index 4772612c..c6b23ef9 100644 --- a/public/js/app-util.js +++ b/public/js/app-util.js @@ -480,7 +480,7 @@ sysPass.Util = function (log) { */ const notifications = { state: { - lastHash : '' + lastHash: '' }, send: function (title, message, id) { log.info("sendNotification"); @@ -523,6 +523,22 @@ sysPass.Util = function (log) { } }; + /** + * Returns a serialized URL for a GET request + * @param base + * @param parts + * @returns {string} + */ + const getUrl = function (base, parts) { + return base + "?" + Object.keys(parts).map(function (key) { + if (Array.isArray(parts[key])) { + return key + "=" + parts[key].join("/"); + } + + return key + "=" + parts[key]; + }).join("&"); + }; + return { decodeEntities: decodeEntities, resizeImage: resizeImage, @@ -531,6 +547,7 @@ sysPass.Util = function (log) { setContentSize: setContentSize, redirect: redirect, uniqueId: uniqueId, + getUrl: getUrl, sendNotification: notifications.send, password: password, hash: hash diff --git a/public/vendor/js/jquery.fileDownload.js b/public/vendor/js/jquery.fileDownload.js new file mode 100644 index 00000000..353ac645 --- /dev/null +++ b/public/vendor/js/jquery.fileDownload.js @@ -0,0 +1,493 @@ +/* +* jQuery File Download Plugin v1.4.5 +* +* http://www.johnculviner.com +* +* Copyright (c) 2013 - John Culviner +* +* Licensed under the MIT license: +* http://www.opensource.org/licenses/mit-license.php +* +* !!!!NOTE!!!! +* You must also write a cookie in conjunction with using this plugin as mentioned in the orignal post: +* http://johnculviner.com/jquery-file-download-plugin-for-ajax-like-feature-rich-file-downloads/ +* !!!!NOTE!!!! +*/ + +(function($, window){ + // i'll just put them here to get evaluated on script load + var htmlSpecialCharsRegEx = /[<>&\r\n"']/gm; + var htmlSpecialCharsPlaceHolders = { + '<': 'lt;', + '>': 'gt;', + '&': 'amp;', + '\r': "#13;", + '\n': "#10;", + '"': 'quot;', + "'": '#39;' /*single quotes just to be safe, IE8 doesn't support ', so use ' instead */ + }; + +$.extend({ + // + //$.fileDownload('/path/to/url/', options) + // see directly below for possible 'options' + fileDownload: function (fileUrl, options) { + + //provide some reasonable defaults to any unspecified options below + var settings = $.extend({ + + // + //Requires jQuery UI: provide a message to display to the user when the file download is being prepared before the browser's dialog appears + // + preparingMessageHtml: null, + + // + //Requires jQuery UI: provide a message to display to the user when a file download fails + // + failMessageHtml: null, + + // + //the stock android browser straight up doesn't support file downloads initiated by a non GET: http://code.google.com/p/android/issues/detail?id=1780 + //specify a message here to display if a user tries with an android browser + //if jQuery UI is installed this will be a dialog, otherwise it will be an alert + //Set to null to disable the message and attempt to download anyway + // + androidPostUnsupportedMessageHtml: "Unfortunately your Android browser doesn't support this type of file download. Please try again with a different browser.", + + // + //Requires jQuery UI: options to pass into jQuery UI Dialog + // + dialogOptions: { modal: true }, + + // + //a function to call while the dowload is being prepared before the browser's dialog appears + //Args: + // url - the original url attempted + // + prepareCallback: function (url) { }, + + // + //a function to call after a file download successfully completed + //Args: + // url - the original url attempted + // + successCallback: function (url) { }, + + // + //a function to call after a file download request was canceled + //Args: + // url - the original url attempted + // + abortCallback: function (url) { }, + + // + //a function to call after a file download failed + //Args: + // responseHtml - the html that came back in response to the file download. this won't necessarily come back depending on the browser. + // in less than IE9 a cross domain error occurs because 500+ errors cause a cross domain issue due to IE subbing out the + // server's error message with a "helpful" IE built in message + // url - the original url attempted + // error - original error cautch from exception + // + failCallback: function (responseHtml, url, error) { }, + + // + // the HTTP method to use. Defaults to "GET". + // + httpMethod: "GET", + + // + // if specified will perform a "httpMethod" request to the specified 'fileUrl' using the specified data. + // data must be an object (which will be $.param serialized) or already a key=value param string + // + data: null, + + // + //a period in milliseconds to poll to determine if a successful file download has occured or not + // + checkInterval: 100, + + // + //the cookie name to indicate if a file download has occured + // + cookieName: "fileDownload", + + // + //the cookie value for the above name to indicate that a file download has occured + // + cookieValue: "true", + + // + //the cookie path for above name value pair + // + cookiePath: "/", + + // + //if specified it will be used when attempting to clear the above name value pair + //useful for when downloads are being served on a subdomain (e.g. downloads.example.com) + // + cookieDomain: null, + + // + //the title for the popup second window as a download is processing in the case of a mobile browser + // + popupWindowTitle: "Initiating file download...", + + // + //Functionality to encode HTML entities for a POST, need this if data is an object with properties whose values contains strings with quotation marks. + //HTML entity encoding is done by replacing all &,<,>,',",\r,\n characters. + //Note that some browsers will POST the string htmlentity-encoded whilst others will decode it before POSTing. + //It is recommended that on the server, htmlentity decoding is done irrespective. + // + encodeHTMLEntities: true + + }, options); + + var deferred = new $.Deferred(); + + //Setup mobile browser detection: Partial credit: http://detectmobilebrowser.com/ + var userAgent = (navigator.userAgent || navigator.vendor || window.opera).toLowerCase(); + + var isIos; //has full support of features in iOS 4.0+, uses a new window to accomplish this. + var isAndroid; //has full support of GET features in 4.0+ by using a new window. Non-GET is completely unsupported by the browser. See above for specifying a message. + var isOtherMobileBrowser; //there is no way to reliably guess here so all other mobile devices will GET and POST to the current window. + + if (/ip(ad|hone|od)/.test(userAgent)) { + + isIos = true; + + } else if (userAgent.indexOf('android') !== -1) { + + isAndroid = true; + + } else { + + isOtherMobileBrowser = /avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|playbook|silk|iemobile|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(userAgent.substr(0, 4)); + + } + + var httpMethodUpper = settings.httpMethod.toUpperCase(); + + if (isAndroid && httpMethodUpper !== "GET" && settings.androidPostUnsupportedMessageHtml) { + //the stock android browser straight up doesn't support file downloads initiated by non GET requests: http://code.google.com/p/android/issues/detail?id=1780 + + if ($().dialog) { + $("
").html(settings.androidPostUnsupportedMessageHtml).dialog(settings.dialogOptions); + } else { + alert(settings.androidPostUnsupportedMessageHtml); + } + + return deferred.reject(); + } + + var $preparingDialog = null; + + var internalCallbacks = { + + onPrepare: function (url) { + + //wire up a jquery dialog to display the preparing message if specified + if (settings.preparingMessageHtml) { + + $preparingDialog = $("
").html(settings.preparingMessageHtml).dialog(settings.dialogOptions); + + } else if (settings.prepareCallback) { + + settings.prepareCallback(url); + + } + + }, + + onSuccess: function (url) { + + //remove the perparing message if it was specified + if ($preparingDialog) { + $preparingDialog.dialog('close'); + } + + settings.successCallback(url); + + deferred.resolve(url); + }, + + onAbort: function (url) { + + //remove the perparing message if it was specified + if ($preparingDialog) { + $preparingDialog.dialog('close'); + }; + + settings.abortCallback(url); + + deferred.reject(url); + }, + + onFail: function (responseHtml, url, error) { + + //remove the perparing message if it was specified + if ($preparingDialog) { + $preparingDialog.dialog('close'); + } + + //wire up a jquery dialog to display the fail message if specified + if (settings.failMessageHtml) { + $("
").html(settings.failMessageHtml).dialog(settings.dialogOptions); + } + + settings.failCallback(responseHtml, url, error); + + deferred.reject(responseHtml, url); + } + }; + + internalCallbacks.onPrepare(fileUrl); + + //make settings.data a param string if it exists and isn't already + if (settings.data !== null && typeof settings.data !== "string") { + settings.data = $.param(settings.data); + } + + + var $iframe, + downloadWindow, + formDoc, + $form; + + if (httpMethodUpper === "GET") { + + if (settings.data !== null) { + //need to merge any fileUrl params with the data object + + var qsStart = fileUrl.indexOf('?'); + + if (qsStart !== -1) { + //we have a querystring in the url + + if (fileUrl.substring(fileUrl.length - 1) !== "&") { + fileUrl = fileUrl + "&"; + } + } else { + + fileUrl = fileUrl + "?"; + } + + fileUrl = fileUrl + settings.data; + } + + if (isIos || isAndroid) { + + downloadWindow = window.open(fileUrl); + downloadWindow.document.title = settings.popupWindowTitle; + window.focus(); + + } else if (isOtherMobileBrowser) { + + window.location(fileUrl); + + } else { + + //create a temporary iframe that is used to request the fileUrl as a GET request + $iframe = $("").appendTo("body"); + formDoc = getiframeDocument($iframe); + } + + formDoc.write("
" + formInnerHtml + "
" + settings.popupWindowTitle + ""); + $form = $(formDoc).find('form'); + } + + $form.submit(); + } + + + //check if the file download has completed every checkInterval ms + setTimeout(checkFileDownloadComplete, settings.checkInterval); + + + function checkFileDownloadComplete() { + //has the cookie been written due to a file download occuring? + + var cookieValue = settings.cookieValue; + if(typeof cookieValue == 'string') { + cookieValue = cookieValue.toLowerCase(); + } + + var lowerCaseCookie = settings.cookieName.toLowerCase() + "=" + cookieValue; + + if (document.cookie.toLowerCase().indexOf(lowerCaseCookie) > -1) { + + //execute specified callback + internalCallbacks.onSuccess(fileUrl); + + //remove cookie + var cookieData = settings.cookieName + "=; path=" + settings.cookiePath + "; expires=" + new Date(0).toUTCString() + ";"; + if (settings.cookieDomain) cookieData += " domain=" + settings.cookieDomain + ";"; + document.cookie = cookieData; + + //remove iframe + cleanUp(false); + + return; + } + + //has an error occured? + //if neither containers exist below then the file download is occuring on the current window + if (downloadWindow || $iframe) { + + //has an error occured? + try { + + var formDoc = downloadWindow ? downloadWindow.document : getiframeDocument($iframe); + + if (formDoc && formDoc.body !== null && formDoc.body.innerHTML.length) { + + var isFailure = true; + + if ($form && $form.length) { + var $contents = $(formDoc.body).contents().first(); + + try { + if ($contents.length && $contents[0] === $form[0]) { + isFailure = false; + } + } catch (e) { + if (e && e.number == -2146828218) { + // IE 8-10 throw a permission denied after the form reloads on the "$contents[0] === $form[0]" comparison + isFailure = true; + } else { + throw e; + } + } + } + + if (isFailure) { + // IE 8-10 don't always have the full content available right away, they need a litle bit to finish + setTimeout(function () { + internalCallbacks.onFail(formDoc.body.innerHTML, fileUrl); + cleanUp(true); + }, 100); + + return; + } + } + } + catch (err) { + + //500 error less than IE9 + internalCallbacks.onFail('', fileUrl, err); + + cleanUp(true); + + return; + } + } + + + //keep checking... + setTimeout(checkFileDownloadComplete, settings.checkInterval); + } + + //gets an iframes document in a cross browser compatible manner + function getiframeDocument($iframe) { + var iframeDoc = $iframe[0].contentWindow || $iframe[0].contentDocument; + if (iframeDoc.document) { + iframeDoc = iframeDoc.document; + } + return iframeDoc; + } + + function cleanUp(isFailure) { + + setTimeout(function() { + + if (downloadWindow) { + + if (isAndroid) { + downloadWindow.close(); + } + + if (isIos) { + if (downloadWindow.focus) { + downloadWindow.focus(); //ios safari bug doesn't allow a window to be closed unless it is focused + if (isFailure) { + downloadWindow.close(); + } + } + } + } + + //iframe cleanup appears to randomly cause the download to fail + //not doing it seems better than failure... + //if ($iframe) { + // $iframe.remove(); + //} + + }, 0); + } + + + function htmlSpecialCharsEntityEncode(str) { + return str.replace(htmlSpecialCharsRegEx, function(match) { + return '&' + htmlSpecialCharsPlaceHolders[match]; + }); + } + var promise = deferred.promise(); + promise.abort = function() { + cleanUp(); + $iframe.attr('src', '').html(''); + internalCallbacks.onAbort(fileUrl); + }; + return promise; + } +}); + +})(jQuery, this || window); diff --git a/public/vendor/js/jquery.fileDownload.min.js b/public/vendor/js/jquery.fileDownload.min.js index a18884ef..5ccf6b71 100644 --- a/public/vendor/js/jquery.fileDownload.min.js +++ b/public/vendor/js/jquery.fileDownload.min.js @@ -1 +1,12 @@ -(function(c,a){var d=/[<>&\r\n"']/gm;var b={"<":"lt;",">":"gt;","&":"amp;","\r":"#13;","\n":"#10;",'"':"quot;","'":"apos;"};c.extend({fileDownload:function(n,g){var t=c.extend({preparingMessageHtml:null,failMessageHtml:null,androidPostUnsupportedMessageHtml:"Unfortunately your Android browser doesn't support this type of file download. Please try again with a different browser.",dialogOptions:{modal:true},prepareCallback:function(z){},successCallback:function(z){},failCallback:function(z,A){},httpMethod:"GET",data:null,checkInterval:100,cookieName:"fileDownload",cookieValue:"true",cookiePath:"/",popupWindowTitle:"Initiating file download...",encodeHTMLEntities:true},g);var y=new c.Deferred();var w=(navigator.userAgent||navigator.vendor||a.opera).toLowerCase();var q;var v;var f;if(/ip(ad|hone|od)/.test(w)){q=true}else{if(w.indexOf("android")!==-1){v=true}else{f=/avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|playbook|silk|iemobile|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(w)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(w.substr(0,4))}}var s=t.httpMethod.toUpperCase();if(v&&s!=="GET"){if(c().dialog){c("
").html(t.androidPostUnsupportedMessageHtml).dialog(t.dialogOptions)}else{alert(t.androidPostUnsupportedMessageHtml)}return y.reject()}var x=null;var l={onPrepare:function(z){if(t.preparingMessageHtml){x=c("
").html(t.preparingMessageHtml).dialog(t.dialogOptions)}else{if(t.prepareCallback){t.prepareCallback(z)}}},onSuccess:function(z){if(x){x.dialog("close")}t.successCallback(z);y.resolve(z)},onFail:function(z,A){if(x){x.dialog("close")}if(t.failMessageHtml){c("
").html(t.failMessageHtml).dialog(t.dialogOptions)}t.failCallback(z,A);y.reject(z,A)}};l.onPrepare(n);if(t.data!==null&&typeof t.data!=="string"){t.data=c.param(t.data)}var p,h,u,i;if(s==="GET"){if(t.data!==null){var r=n.indexOf("?");if(r!==-1){if(n.substring(n.length-1)!=="&"){n=n+"&"}}else{n=n+"?"}n=n+t.data}if(q||v){h=a.open(n);h.document.title=t.popupWindowTitle;a.focus()}else{if(f){a.location(n)}else{p=c("").appendTo("body");u=e(p)}u.write("
"+k+"
"+t.popupWindowTitle+"");i=c(u).find("form")}i.submit()}setTimeout(m,t.checkInterval);function m(){if(document.cookie.indexOf(t.cookieName+"="+t.cookieValue)!=-1){l.onSuccess(n);document.cookie=t.cookieName+"=; expires="+new Date(1000).toUTCString()+"; path="+t.cookiePath;o(false);return}if(h||p){try{var z=h?h.document:e(p);if(z&&z.body!=null&&z.body.innerHTML.length){var C=true;if(i&&i.length){var A=c(z.body).contents().first();if(A.length&&A[0]===i[0]){C=false}}if(C){l.onFail(z.body.innerHTML,n);o(true);return}}}catch(B){l.onFail("",n);o(true);return}}setTimeout(m,t.checkInterval)}function e(z){var A=z[0].contentWindow||z[0].contentDocument;if(A.document){A=A.document}return A}function o(z){setTimeout(function(){if(h){if(v){h.close()}if(q){h.focus();if(z){h.close()}}}},0)}function j(z){return z.replace(d,function(A){return"&"+b[A]})}return y.promise()}})})(jQuery,this); \ No newline at end of file +var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(b,e,f){b instanceof String&&(b=String(b));for(var k=b.length,d=0;d&\r\n"']/gm,k={"<":"lt;",">":"gt;","&":"amp;","\r":"#13;","\n":"#10;",'"':"quot;","'":"#39;"};b.extend({fileDownload:function(d,g){function y(){var a=c.cookieValue;"string"==typeof a&&(a=a.toLowerCase());a=c.cookieName.toLowerCase()+"="+a;if(-1").html(c.androidPostUnsupportedMessageHtml).dialog(c.dialogOptions):alert(c.androidPostUnsupportedMessageHtml),t.reject();var m=null,q={onPrepare:function(a){c.preparingMessageHtml?m=b("
").html(c.preparingMessageHtml).dialog(c.dialogOptions):c.prepareCallback&&c.prepareCallback(a)},onSuccess:function(a){m&&m.dialog("close");c.successCallback(a);t.resolve(a)},onAbort:function(a){m&& +m.dialog("close");c.abortCallback(a);t.reject(a)},onFail:function(a,d,e){m&&m.dialog("close");c.failMessageHtml&&b("
").html(c.failMessageHtml).dialog(c.dialogOptions);c.failCallback(a,d,e);t.reject(a,d)}};q.onPrepare(d);null!==c.data&&"string"!==typeof c.data&&(c.data=b.param(c.data));var n;if("GET"===g)if(null!==c.data&&(-1!==d.indexOf("?")?"&"!==d.substring(d.length-1)&&(d+="&"):d+="?",d+=c.data),w||v){var h=e.open(d);h.document.title=c.popupWindowTitle;e.focus()}else l?e.location(d):n=b("").appendTo("body"),l=z(n)),l.write("
"+x+"
"+c.popupWindowTitle+""),p=b(l).find("form");p.submit()}setTimeout(y,c.checkInterval);l=t.promise();l.abort=function(){u();n.attr("src","").html("");q.onAbort(d)};return l}})})(jQuery,this||window);