mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-06 08:34:16 +01:00
* [FIX] Fixed wrong behavior when performing Ajax requests through reverse proxy.
* [MOD] Customer list is based on user ACL. * [ADD] Logs X-Forwarded-For on login * [MOD] Minor tweaks
This commit is contained in:
@@ -41,7 +41,7 @@ define('LOCALES_PATH', __DIR__ . DIRECTORY_SEPARATOR . 'locales');
|
||||
define('SQL_PATH', __DIR__ . DIRECTORY_SEPARATOR . 'sql');
|
||||
|
||||
|
||||
define('DEBUG', true);
|
||||
define('DEBUG', false);
|
||||
|
||||
require 'SplClassLoader.php';
|
||||
|
||||
|
||||
@@ -228,20 +228,20 @@ class AccountUtil
|
||||
{
|
||||
$Data = new QueryData();
|
||||
|
||||
$queryWhere = self::getAccountFilterUser($Data);
|
||||
|
||||
if ($accountId !== 0) {
|
||||
$queryWhere[] = 'account_id <> ? AND (account_parentId = 0 OR account_parentId IS NULL)';
|
||||
$Data->addParam($accountId);
|
||||
}
|
||||
|
||||
$query = /** @lang SQL */
|
||||
'SELECT account_id, account_name, customer_name ' .
|
||||
'FROM accounts ' .
|
||||
'LEFT JOIN customers ON customer_id = account_customerId ' .
|
||||
'WHERE ' . implode(' AND ', $queryWhere) . ' ORDER BY customer_name';
|
||||
$Data->setSelect('account_id, account_name, customer_id, customer_name');
|
||||
$Data->setFrom('accounts LEFT JOIN customers ON customer_id = account_customerId');
|
||||
$Data->setOrder('customer_name');
|
||||
|
||||
$Data->setQuery($query);
|
||||
// Si el perfil no permite búsquedas globales, se acotan los resultados
|
||||
if (!Session::getUserProfile()->isAccGlobalSearch()) {
|
||||
$queryWhere = self::getAccountFilterUser($Data);
|
||||
$Data->setWhere(implode(' AND ', $queryWhere));
|
||||
}
|
||||
|
||||
return DB::getResultsArray($Data);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ abstract class AuthDataBase
|
||||
*/
|
||||
public function getAuthenticated()
|
||||
{
|
||||
return (int)$this->authenticated;
|
||||
return $this->authenticated;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -91,7 +91,7 @@ class LdapStd extends LdapBase
|
||||
|| in_array($this->LdapAuthData->getGroupDn(), $this->LdapAuthData->getGroups())
|
||||
) {
|
||||
$this->LogMessage->addDescription(__('Usuario verificado en grupo', false));
|
||||
$this->writeLog();
|
||||
$this->writeLog(Log::INFO);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ class AccountController extends ControllerBase implements ActionsInterface
|
||||
$this->view->assign('actionId', $this->getAction());
|
||||
// $this->view->assign('accountParentId', Session::getLastAcountId());
|
||||
$this->view->assign('categories', Category::getItem()->getItemsForSelect());
|
||||
$this->view->assign('customers', Customer::getItem()->getItemsForSelect());
|
||||
$this->view->assign('customers', Customer::getItem()->getItemsForSelectByUser());
|
||||
$this->view->assign('otherUsers', UserUtil::getUsersLogin());
|
||||
$this->view->assign('otherUsersJson', Json::getJson($this->view->otherUsers));
|
||||
$this->view->assign('otherGroups', Group::getItem()->getItemsForSelect());
|
||||
|
||||
@@ -30,6 +30,7 @@ use SP\Account\AccountSearch;
|
||||
use SP\Account\AccountsSearchItem;
|
||||
use SP\Config\Config;
|
||||
use SP\Core\ActionsInterface;
|
||||
use SP\Core\ItemsTypeInterface;
|
||||
use SP\Core\Session;
|
||||
use SP\Core\SessionUtil;
|
||||
use SP\Core\Template;
|
||||
@@ -137,7 +138,7 @@ class AccountSearchController extends ControllerBase implements ActionsInterface
|
||||
{
|
||||
$this->view->addTemplate('searchbox');
|
||||
|
||||
$this->view->assign('customers', Customer::getItem()->getItemsForSelect());
|
||||
$this->view->assign('customers', Customer::getItem()->getItemsForSelectByUser());
|
||||
$this->view->assign('categories', Category::getItem()->getItemsForSelect());
|
||||
$this->view->assign('tags', Tag::getItem()->getItemsForSelect());
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
namespace SP\Controller;
|
||||
|
||||
use SP\Account\AccountUtil;
|
||||
use SP\Core\ItemsTypeInterface;
|
||||
use SP\DataModel\DataModelInterface;
|
||||
use SP\Mgmt\Categories\Category;
|
||||
@@ -50,6 +51,8 @@ class ItemsController
|
||||
return $this->getCategories();
|
||||
case ItemsTypeInterface::ITEM_CUSTOMERS:
|
||||
return $this->getCustomers();
|
||||
case ItemsTypeInterface::ITEM_CUSTOMERS_USER:
|
||||
return $this->getCustomersForUser();
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
@@ -96,4 +99,14 @@ class ItemsController
|
||||
{
|
||||
return $this->prepareItems(Customer::getItem()->getAll());
|
||||
}
|
||||
|
||||
/**
|
||||
* Devolver los clientes visibles por el usuario
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getCustomersForUser()
|
||||
{
|
||||
return Customer::getItem()->getItemsForSelectByUser();
|
||||
}
|
||||
}
|
||||
@@ -52,6 +52,7 @@ use SP\Mgmt\Users\UserPass;
|
||||
use SP\Mgmt\Users\UserPassRecover;
|
||||
use SP\Mgmt\Users\UserPreferences;
|
||||
use SP\Mgmt\Users\UserUtil;
|
||||
use SP\Util\Checks;
|
||||
use SP\Util\Json;
|
||||
use SP\Util\Util;
|
||||
|
||||
@@ -144,6 +145,12 @@ class LoginController
|
||||
Json::returnJson($this->jsonResponse);
|
||||
}
|
||||
|
||||
$forward = Request::getRequestHeaders('X-Forwarded-For');
|
||||
|
||||
if ($forward) {
|
||||
$this->LogMessage->addDetails('X-Forwarded-For', Checks::demoIsEnabled() ? '***' : $forward);
|
||||
}
|
||||
|
||||
$Log->writeLog();
|
||||
|
||||
$data = ['url' => 'index.php' . Request::importUrlParamsToGet()];
|
||||
@@ -264,6 +271,8 @@ class LoginController
|
||||
|
||||
if ($masterPass) {
|
||||
if (CryptMasterPass::checkTempMasterPass($masterPass)) {
|
||||
$this->LogMessage->addDescription(__('Usando clave temporal', false));
|
||||
|
||||
$masterPass = CryptMasterPass::getTempMasterPass($masterPass);
|
||||
}
|
||||
|
||||
@@ -274,7 +283,7 @@ class LoginController
|
||||
} else {
|
||||
SessionUtil::saveSessionMPass($UserPass->getClearUserMPass());
|
||||
|
||||
Log::writeNewLog(__('Login', false), __('Clave maestra actualizada', false));
|
||||
$this->LogMessage->addDescription(__('Clave maestra actualizada', false));
|
||||
}
|
||||
} else if ($oldPass) {
|
||||
if (!$UserPass->updateMasterPass($oldPass)) {
|
||||
@@ -284,7 +293,7 @@ class LoginController
|
||||
} else {
|
||||
SessionUtil::saveSessionMPass($UserPass->getClearUserMPass());
|
||||
|
||||
Log::writeNewLog(__('Login', false), __('Clave maestra actualizada', false));
|
||||
$this->LogMessage->addDescription(__('Clave maestra actualizada', false));
|
||||
}
|
||||
} else {
|
||||
$loadMPass = $UserPass->loadUserMPass();
|
||||
@@ -392,10 +401,10 @@ class LoginController
|
||||
$this->LogMessage->addDetails(__('Usuario', false), $this->UserData->getUserLogin());
|
||||
|
||||
throw new AuthException(SPException::SP_INFO, $this->LogMessage->getDescription(), '', self::STATUS_INVALID_LOGIN);
|
||||
} elseif ($AuthData->getAuthenticated() === 1) {
|
||||
$this->LogMessage->addDetails(__('Tipo', false), __FUNCTION__);
|
||||
}
|
||||
|
||||
$this->LogMessage->addDetails(__('Tipo', false), __FUNCTION__);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -417,6 +426,8 @@ class LoginController
|
||||
$this->LogMessage->addDetails(__('Autentificación', false), sprintf('%s (%s)', AuthUtil::getServerAuthType(), $AuthData->getName()));
|
||||
|
||||
throw new AuthException(SPException::SP_INFO, $this->LogMessage->getDescription(), '', self::STATUS_INVALID_LOGIN);
|
||||
} elseif ($AuthData->getAuthenticated() === 1) {
|
||||
$this->LogMessage->addDetails(__('Tipo', false), __FUNCTION__);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
namespace SP\Core;
|
||||
|
||||
use SP\Config\ConfigDB;
|
||||
use SP\Log\Log;
|
||||
use SP\Util\Util;
|
||||
|
||||
defined('APP_ROOT') || die();
|
||||
@@ -36,6 +37,11 @@ defined('APP_ROOT') || die();
|
||||
*/
|
||||
class CryptMasterPass
|
||||
{
|
||||
/**
|
||||
* Número máximo de intentos
|
||||
*/
|
||||
const MAX_ATTEMPTS = 50;
|
||||
|
||||
/**
|
||||
* Crea una clave temporal para encriptar la clave maestra y guardarla.
|
||||
*
|
||||
@@ -77,17 +83,27 @@ class CryptMasterPass
|
||||
*/
|
||||
public static function checkTempMasterPass($pass)
|
||||
{
|
||||
$passTime = ConfigDB::getValue('tempmaster_passtime');
|
||||
$passMaxTime = ConfigDB::getValue('tempmaster_maxtime');
|
||||
$attempts = ConfigDB::getValue('tempmaster_attempts');
|
||||
$passTime = (int)ConfigDB::getValue('tempmaster_passtime');
|
||||
$passMaxTime = (int)ConfigDB::getValue('tempmaster_maxtime');
|
||||
$attempts = (int)ConfigDB::getValue('tempmaster_attempts');
|
||||
|
||||
// Comprobar si el tiempo de validez se ha superado
|
||||
if ($passTime !== false && time() - $passTime > $passMaxTime || $attempts >= 5) {
|
||||
// Comprobar si el tiempo de validez o los intentos se han superado
|
||||
if ($passMaxTime === 0) {
|
||||
Log::writeNewLog(__FUNCTION__, __('Clave temporal caducada', false), Log::INFO);
|
||||
|
||||
return false;
|
||||
} elseif ((!empty($passTime) && time() > $passMaxTime)
|
||||
|| $attempts >= self::MAX_ATTEMPTS
|
||||
) {
|
||||
ConfigDB::setCacheConfigValue('tempmaster_pass', '');
|
||||
ConfigDB::setCacheConfigValue('tempmaster_passiv', '');
|
||||
ConfigDB::setCacheConfigValue('tempmaster_passhash', '');
|
||||
ConfigDB::setCacheConfigValue('tempmaster_maxtime', 0);
|
||||
ConfigDB::setCacheConfigValue('tempmaster_attempts', 0);
|
||||
ConfigDB::writeConfig();
|
||||
|
||||
Log::writeNewLog(__FUNCTION__, __('Clave temporal caducada', false), Log::INFO);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ interface ItemsTypeInterface
|
||||
{
|
||||
const ITEM_CATEGORIES = 1;
|
||||
const ITEM_CUSTOMERS = 2;
|
||||
const ITEM_CUSTOMERS_USER = 120;
|
||||
const ITEM_FILES = 3;
|
||||
const ITEM_TAGS = 4;
|
||||
const ITEM_USERS = 5;
|
||||
|
||||
@@ -54,6 +54,12 @@ class Language
|
||||
* @var string|false
|
||||
*/
|
||||
public static $localeStatus;
|
||||
/**
|
||||
* Si se ha establecido a las de la App
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected static $appSet = false;
|
||||
|
||||
/**
|
||||
* Establecer el lenguaje a utilizar
|
||||
@@ -122,7 +128,7 @@ class Language
|
||||
*/
|
||||
private function getBrowserLang()
|
||||
{
|
||||
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
||||
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
||||
return str_replace('-', '_', substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 5));
|
||||
} else {
|
||||
return '';
|
||||
@@ -183,7 +189,10 @@ class Language
|
||||
*/
|
||||
public static function setAppLocales()
|
||||
{
|
||||
self::setLocales(Config::getConfig()->getSiteLang());
|
||||
if (Config::getConfig()->getSiteLang() !== Session::getLocale()) {
|
||||
self::setLocales(Config::getConfig()->getSiteLang());
|
||||
self::$appSet = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -191,6 +200,9 @@ class Language
|
||||
*/
|
||||
public static function unsetAppLocales()
|
||||
{
|
||||
self::setLocales(Session::getLocale());
|
||||
if (self::$appSet === true) {
|
||||
self::setLocales(Session::getLocale());
|
||||
self::$appSet = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -256,4 +256,15 @@ class LogMessage extends MessageBase
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Devuelve los detalles en formato HTML
|
||||
*
|
||||
* @param bool $translate
|
||||
* @return string
|
||||
*/
|
||||
public function getHtmlDetails($translate = false)
|
||||
{
|
||||
return nl2br($this->getDetails($translate));
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ class Email
|
||||
return false;
|
||||
}
|
||||
|
||||
$Mail = self::getMailer($mailTo, utf8_decode($LogMessage->getAction()));
|
||||
$Mail = self::getMailer($mailTo, $LogMessage->getAction());
|
||||
|
||||
if (!is_object($Mail)) {
|
||||
return false;
|
||||
@@ -64,14 +64,14 @@ class Email
|
||||
|
||||
if ($isEvent === true) {
|
||||
$performer = Session::getUserData()->getUserLogin() ?: __('N/D');
|
||||
$body[] = sprintf('%s: %s', Html::strongText(__('Acción')), utf8_decode($LogMessage->getAction()));
|
||||
$body[] = sprintf('%s: %s', Html::strongText(__('Acción')), $LogMessage->getAction());
|
||||
$body[] = sprintf('%s: %s (%s)', Html::strongText(__('Realizado por')), $performer, $_SERVER['REMOTE_ADDR']);
|
||||
|
||||
$Mail->addCC(Config::getConfig()->getMailFrom());
|
||||
}
|
||||
|
||||
$body[] = utf8_decode($LogMessage->getHtmlDescription(true));
|
||||
$body[] = utf8_decode($LogMessage->getDetails(true));
|
||||
$body[] = $LogMessage->getHtmlDescription(true);
|
||||
$body[] = $LogMessage->getHtmlDetails(true);
|
||||
$body[] = '';
|
||||
$body[] = '--';
|
||||
$body[] = sprintf('%s - %s', Util::getAppInfo('appname'), Util::getAppInfo('appdesc'));
|
||||
|
||||
@@ -28,6 +28,7 @@ use SP\Core\DiFactory;
|
||||
use SP\Core\Language;
|
||||
use SP\Core\Messages\LogMessage;
|
||||
use SP\Core\Session;
|
||||
use SP\Http\Request;
|
||||
use SP\Storage\DB;
|
||||
use SP\Storage\QueryData;
|
||||
use SP\Util\Checks;
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace SP\Mgmt\Customers;
|
||||
|
||||
defined('APP_ROOT') || die();
|
||||
|
||||
use SP\Account\AccountUtil;
|
||||
use SP\Core\ActionsInterface;
|
||||
use SP\Core\Exceptions\SPException;
|
||||
use SP\DataModel\CustomerData;
|
||||
@@ -249,4 +250,24 @@ class Customer extends CustomerBase implements ItemInterface, ItemSelectInterfac
|
||||
|
||||
return DB::getResultsArray($Data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Devolver los clientes visibles por el usuario
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getItemsForSelectByUser()
|
||||
{
|
||||
$outItems = [];
|
||||
|
||||
foreach (AccountUtil::getAccountsForUser() as $item){
|
||||
$obj = new \stdClass();
|
||||
$obj->id = $item->customer_id;
|
||||
$obj->name = $item->customer_name;
|
||||
|
||||
$outItems[] = $obj;
|
||||
}
|
||||
|
||||
return $outItems;
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
2
inc/themes/material-blue/js/app-theme.min.js
vendored
2
inc/themes/material-blue/js/app-theme.min.js
vendored
@@ -1,5 +1,5 @@
|
||||
var $jscomp={scope:{},findInternal:function(a,f,d){a instanceof String&&(a=String(a));for(var k=a.length,g=0;g<k;g++){var m=a[g];if(f.call(d,m,g,a))return{i:g,v:m}}return{i:-1,v:void 0}}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,f,d){if(d.get||d.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[f]=d.value)};
|
||||
$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,f,d,k){if(f){d=$jscomp.global;a=a.split(".");for(k=0;k<a.length-1;k++){var g=a[k];g in d||(d[g]={});d=d[g]}a=a[a.length-1];k=d[a];f=f(k);f!=k&&null!=f&&$jscomp.defineProperty(d,a,{configurable:!0,writable:!0,value:f})}};
|
||||
$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,f,d,k){if(f){d=$jscomp.global;a=a.split(".");for(k=0;k<a.length-1;k++){var g=a[k];g in d||(d[g]={});d=d[g]}a=a[a.length-1];k=d[a];f=f(k);f!=k&&null!=f&&$jscomp.defineProperty(d,a,{configurable:!0,writable:!0,value:f})}};
|
||||
$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,d){return $jscomp.findInternal(this,a,d).v}},"es6-impl","es3");
|
||||
sysPass.Theme=function(a){var f=a.log,d=function(b){for(var l=0,e="",c;l<a.passwordData.complexity.numlength;)c=Math.floor(100*Math.random())%94+33,!a.passwordData.complexity.symbols&&(33<=c&&47>=c||58<=c&&64>=c||91<=c&&96>=c||123<=c&&126>=c)||!a.passwordData.complexity.numbers&&48<=c&&57>=c||!a.passwordData.complexity.uppercase&&65<=c&&90>=c||(l++,e+=String.fromCharCode(c));$("#viewPass").attr("title",e);var d=zxcvbn(e);a.passwordData.passLength=e.length;b?(l=b.parent(),c=$("#"+b.attr("id")+"R"),
|
||||
a.outputResult(d,b),b=new MaterialTextfield,l.find("input:password").val(e),l.addClass(b.CssClasses_.IS_DIRTY).removeClass(b.CssClasses_.IS_INVALID),c.val(e).parent().addClass(b.CssClasses_.IS_DIRTY).removeClass(b.CssClasses_.IS_INVALID),a.encryptFormValue(c),l.find("#passLevel").show(500)):(a.outputResult(d),$("input:password, input.password").val(e),$("#passLevel").show(500))},k=function(){$("<div></div>").dialog({modal:!0,title:a.config().LANG[29],width:"400px",open:function(){var b=$(this),l=
|
||||
|
||||
2
js/app-actions.min.js
vendored
2
js/app-actions.min.js
vendored
@@ -1,5 +1,5 @@
|
||||
var $jscomp={scope:{},findInternal:function(c,d,h){c instanceof String&&(c=String(c));for(var e=c.length,g=0;g<e;g++){var n=c[g];if(d.call(h,n,g,c))return{i:g,v:n}}return{i:-1,v:void 0}}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(c,d,h){if(h.get||h.set)throw new TypeError("ES3 does not support getters and setters.");c!=Array.prototype&&c!=Object.prototype&&(c[d]=h.value)};
|
||||
$jscomp.getGlobal=function(c){return"undefined"!=typeof window&&window===c?c:"undefined"!=typeof global?global:c};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(c,d,h,e){if(d){h=$jscomp.global;c=c.split(".");for(e=0;e<c.length-1;e++){var g=c[e];g in h||(h[g]={});h=h[g]}c=c[c.length-1];e=h[c];d=d(e);d!=e&&null!=d&&$jscomp.defineProperty(h,c,{configurable:!0,writable:!0,value:d})}};
|
||||
$jscomp.getGlobal=function(c){return"undefined"!=typeof window&&window===c?c:"undefined"!=typeof global&&null!=global?global:c};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(c,d,h,e){if(d){h=$jscomp.global;c=c.split(".");for(e=0;e<c.length-1;e++){var g=c[e];g in h||(h[g]={});h=h[g]}c=c[c.length-1];e=h[c];d=d(e);d!=e&&null!=d&&$jscomp.defineProperty(h,c,{configurable:!0,writable:!0,value:d})}};
|
||||
$jscomp.polyfill("Array.prototype.find",function(c){return c?c:function(c,h){return $jscomp.findInternal(this,c,h).v}},"es6-impl","es3");
|
||||
sysPass.Actions=function(c){var d=c.log,h=0,e={doAction:"/ajax/ajax_getContent.php",updateItems:"/ajax/ajax_getItems.php",user:{savePreferences:"/ajax/ajax_userPrefsSave.php",password:"/ajax/ajax_usrpass.php",passreset:"/ajax/ajax_passReset.php"},main:{login:"/ajax/ajax_doLogin.php",install:"/ajax/ajax_install.php",getUpdates:"/ajax/ajax_checkUpds.php"},checks:"/ajax/ajax_checkConnection.php",config:{save:"/ajax/ajax_configSave.php","export":"/ajax/ajax_configSave.php","import":"/ajax/ajax_configSave.php"},
|
||||
file:"/ajax/ajax_filesMgmt.php",link:"/ajax/ajax_itemSave.php",plugin:"/ajax/ajax_itemSave.php",account:{save:"/ajax/ajax_itemSave.php",showPass:"/ajax/ajax_accViewPass.php",saveFavorite:"/ajax/ajax_itemSave.php",request:"/ajax/ajax_itemSave.php",getFiles:"/ajax/ajax_accGetFiles.php",search:"/ajax/ajax_accSearch.php"},appMgmt:{show:"/ajax/ajax_itemShow.php",save:"/ajax/ajax_itemSave.php",search:"/ajax/ajax_itemSearch.php"},eventlog:"/ajax/ajax_eventlog.php",wiki:{show:"/ajax/ajax_wiki.php"},notice:{show:"/ajax/ajax_noticeShow.php",
|
||||
|
||||
@@ -234,17 +234,18 @@ sysPass.Main = function () {
|
||||
|
||||
return fullPath;
|
||||
};
|
||||
var base = window.location.protocol + "//" + window.location.host + rootPath();
|
||||
|
||||
config.APP_ROOT = window.location.protocol + "//" + window.location.host + (location.port ? ':' + location.port : '') + rootPath();
|
||||
|
||||
var opts = appRequests.getRequestOpts();
|
||||
opts.url = base + "/ajax/ajax_getEnvironment.php";
|
||||
opts.url = "/ajax/ajax_getEnvironment.php";
|
||||
opts.method = "get";
|
||||
opts.async = false;
|
||||
opts.useLoading = false;
|
||||
opts.data = {isAjax: 1};
|
||||
|
||||
appRequests.getActionCall(opts, function (json) {
|
||||
config.APP_ROOT = json.app_root;
|
||||
// config.APP_ROOT = json.app_root;
|
||||
config.LANG = json.lang;
|
||||
config.PK = json.pk;
|
||||
config.CHECK_UPDATES = json.check_updates;
|
||||
|
||||
38
js/app-main.min.js
vendored
38
js/app-main.min.js
vendored
@@ -1,21 +1,21 @@
|
||||
var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,f,e){if(e.get||e.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[f]=e.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
|
||||
var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,f,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[f]=c.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
|
||||
$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(a){return $jscomp.SYMBOL_PREFIX+(a||"")+$jscomp.symbolCounter_++};
|
||||
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(a){var f=0;return $jscomp.iteratorPrototype(function(){return f<a.length?{done:!1,value:a[f++]}:{done:!0}})};
|
||||
$jscomp.iteratorPrototype=function(a){$jscomp.initSymbolIterator();a={next:a};a[$jscomp.global.Symbol.iterator]=function(){return this};return a};$jscomp.array=$jscomp.array||{};$jscomp.iteratorFromArray=function(a,f){$jscomp.initSymbolIterator();a instanceof String&&(a+="");var e=0,c={next:function(){if(e<a.length){var g=e++;return{value:f(g,a[g]),done:!1}}c.next=function(){return{done:!0,value:void 0}};return c.next()}};c[Symbol.iterator]=function(){return c};return c};
|
||||
$jscomp.polyfill=function(a,f,e,c){if(f){e=$jscomp.global;a=a.split(".");for(c=0;c<a.length-1;c++){var g=a[c];g in e||(e[g]={});e=e[g]}a=a[a.length-1];c=e[a];f=f(c);f!=c&&null!=f&&$jscomp.defineProperty(e,a,{configurable:!0,writable:!0,value:f})}};$jscomp.polyfill("Array.prototype.keys",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(a){return a})}},"es6-impl","es3");
|
||||
$jscomp.findInternal=function(a,f,e){a instanceof String&&(a=String(a));for(var c=a.length,g=0;g<c;g++){var m=a[g];if(f.call(e,m,g,a))return{i:g,v:m}}return{i:-1,v:void 0}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,e){return $jscomp.findInternal(this,a,e).v}},"es6-impl","es3");
|
||||
sysPass.Main=function(){var a={APP_ROOT:"",LANG:[],PK:"",MAX_FILE_SIZE:1024,CRYPT:new JSEncrypt,CHECK_UPDATES:!1,TIMEZONE:"",LOCALE:"",DEBUG:""},f={passLength:0,minPasswordLength:8,complexity:{numbers:!0,symbols:!0,uppercase:!0,numlength:12}},e={},c={},g={},m={},r={},p={},h={log:function(b){!0===a.DEBUG&&console.log(b)},info:function(b){!0===a.DEBUG&&console.info(b)},error:function(b){console.error(b)},warn:function(b){console.warn(b)}};toastr.options={closeButton:!0,debug:!1,newestOnTop:!1,progressBar:!1,
|
||||
positionClass:"toast-top-center",preventDuplicates:!1,onclick:null,showDuration:"300",hideDuration:"1000",timeOut:"5000",extendedTimeOut:"1000",showEasing:"swing",hideEasing:"linear",showMethod:"fadeIn",hideMethod:"fadeOut"};var x=function(){h.info("setupCallbacks");var b=$("#container").data("page");if(""!==b&&"function"===typeof c.views[b])c.views[b]();0<$("footer").length&&c.views.footer();$("#btnBack").click(function(){u("index.php")});c.bodyHooks()},l={ok:function(b){toastr.success(b)},error:function(b){toastr.error(b)},
|
||||
warn:function(b){toastr.warning(b)},info:function(b){toastr.info(b)},out:function(b){if("object"===typeof b){var a=b.status,d=b.description;void 0!==b.messages&&0<b.messages.length&&(d=d+"<br>"+b.messages.join("<br>"));switch(a){case 0:l.ok(d);break;case 1:case 2:l.error(d);break;case 3:l.warn(d);break;case 10:g.main.logout()}}},html:{error:function(b){return'<p class="error round">Oops...<br>'+a.LANG[1]+"<br>"+b+"</p>"}}},y=function(b){h.info("getEnvironment");var k=window.location.pathname.split("/"),
|
||||
d=window.location.protocol+"//"+window.location.host+function(){for(var a="",b=1;b<=k.length-2;b++)a+="/"+k[b];return a}(),n=m.getRequestOpts();n.url=d+"/ajax/ajax_getEnvironment.php";n.method="get";n.async=!1;n.useLoading=!1;n.data={isAjax:1};m.getActionCall(n,function(d){a.APP_ROOT=d.app_root;a.LANG=d.lang;a.PK=d.pk;a.CHECK_UPDATES=d.check_updates;a.CRYPT.setPublicKey(d.pk);a.TIMEZONE=d.timezone;a.LOCALE=d.locale;a.DEBUG=d.debug;"function"===typeof b&&b()})},v={get:function(){h.info("sk:get");return $("#container").attr("data-sk")},
|
||||
set:function(a){h.info("sk:set");$("#container").attr("data-sk",a)}},z=function(){var a=$("#container");if(!a.hasClass("content-no-auto-resize")){var k=$("#content").height()+200;a.css("height",k)}},A=function(){$("html, body").animate({scrollTop:0},"slow")},u=function(a){window.location.replace(a)},B=function(b){var k={actionId:b.data("action-id"),itemId:b.data("item-id"),sk:v.get()},d={requestDoneAction:"",setRequestData:function(a){$.extend(k,a)},getRequestData:function(){return k},beforeSendAction:"",
|
||||
url:""},n=function(a){if(void 0===d.url||""===d.url)return!1;var b=new FormData;b.append("inFile",a);b.append("isAjax",1);Object.keys(k).forEach(function(a){h.info(a);b.append(a,k[a])});a=m.getRequestOpts();a.url=d.url;a.processData=!1;a.contentType=!1;a.data=b;m.getActionCall(a,function(a){var b=a.status;a=a.description;0===b?("function"===typeof d.requestDoneAction&&d.requestDoneAction(),l.ok(a)):10===b?g.main.logout():l.error(a)})},c=function(d){if(5<d.length)l.error(a.LANG[17]+" (Max: 5)");else for(var k=
|
||||
0;k<d.length;k++){var q=d[k];if(q.size/1E3>a.MAX_FILE_SIZE)l.error(a.LANG[18]+"<br>"+q.name+" (Max: "+a.MAX_FILE_SIZE+")");else{var c;a:{c=q.name;for(var e=b.data("files-ext").toLowerCase().split(","),f=0;f<=e.length;f++)if(-1!==c.indexOf(e[f])){c=!0;break a}c=!1}c?n(d[k]):l.error(a.LANG[19]+"<br>"+q.name)}}},e=function(a){var b=$("#fileUploadForm");!1===a&&b.hide();a=b.find("input[type='file']");a.on("change",function(){"function"===typeof d.beforeSendAction&&d.beforeSendAction();c(this.files)});
|
||||
return a};window.File&&window.FileList&&window.FileReader?function(){h.info("fileUpload:init");var a=e(!1);b.on("dragover dragenter",function(a){h.info("fileUpload:drag");a.stopPropagation();a.preventDefault()});b.on("drop",function(a){h.info("fileUpload:drop");a.stopPropagation();a.preventDefault();"function"===typeof d.beforeSendAction&&d.beforeSendAction();c(a.originalEvent.dataTransfer.files)});b.on("click",function(){a.click()})}():e(!0);return d},C=function(a){h.info("checkPassLevel");f.passLength=
|
||||
a.val().length;w(zxcvbn(a.val()),a)},w=function(b,k){h.info("outputResult");var d=$(".passLevel-"+k.attr("id")),c=b.score;d.show();d.removeClass("weak good strong strongest");0===f.passLength?d.attr("title","").empty():f.passLength<f.minPasswordLength?d.attr("title",a.LANG[11]).addClass("weak"):0===c?d.attr("title",a.LANG[9]+" - "+b.feedback.warning).addClass("weak"):1===c||2===c?d.attr("title",a.LANG[8]+" - "+b.feedback.warning).addClass("good"):3===c?d.attr("title",a.LANG[7]).addClass("strong"):
|
||||
4===c&&d.attr("title",a.LANG[10]).addClass("strongest")},D=function(b){$(b).find(".checkbox").button({icons:{primary:"ui-icon-transferthick-e-w"}}).click(function(){var b=$(this);!0===b.prop("checked")?b.button("option","label",a.LANG[40]):b.button("option","label",a.LANG[41])})},t=function(b){h.info("encryptFormValue");var c=b.val();""!==c&&parseInt(b.attr("data-length"))!==c.length&&(c=a.CRYPT.encrypt(c),b.val(c),b.attr("data-length",c.length))},E=function(){h.info("initializeClipboard");var b=
|
||||
new Clipboard(".clip-pass-button",{text:function(a){return g.account.copypass($(a)).responseJSON.data.accpass}});b.on("success",function(b){l.ok(a.LANG[45])});b.on("error",function(b){l.error(a.LANG[46])});var b=new Clipboard(".dialog-clip-pass-button"),c=new Clipboard(".dialog-clip-user-button");b.on("success",function(a){$(".dialog-user-text").removeClass("dialog-clip-copy");$(".dialog-pass-text").addClass("dialog-clip-copy");a.clearSelection()});c.on("success",function(a){$(".dialog-pass-text").removeClass("dialog-clip-copy");
|
||||
$(".dialog-user-text").addClass("dialog-clip-copy");a.clearSelection()})},F=function(){h.info("bindPassEncrypt");$("body").on("blur",":input[type=password]",function(a){a=$(this);a.hasClass("passwordfield__no-pki")||t(a)}).on("keypress",":input[type=password]",function(a){13===a.keyCode&&(a.preventDefault(),a=$(this),t(a),a.closest("form").submit())})},G=function(a,c){console.info("Eval: "+a);if("function"===typeof a)a(c);else throw Error("Function not found: "+a);},H=function(a){h.info("resizeImage");
|
||||
var b=.9*$(window).width(),c=.9*$(window).height(),e={width:a.width(),height:a.height()},f={calc:0,main:0,secondary:0,factor:.9,rel:e.width/e.height},g=function(a){a.main>a.secondary?a.calc=a.main/a.rel:a.main<a.secondary&&(a.calc=a.main*a.rel);a.calc>a.secondary&&(a.main*=a.factor,g(a));return a},l=function(){f.main=b;f.secondary=c;var d=g(f);a.css({width:d.main,height:d.calc});e.width=d.main;e.height=d.calc},m=function(){f.main=c;f.secondary=b;var d=g(f);a.css({width:d.calc,height:d.main});e.width=
|
||||
d.calc;e.height=d.main};e.width>b?l():e.height>c&&(h.info("height"),m());return e},I=function(){return $.extend({log:h,config:function(){return a},appTheme:function(){return e},appActions:function(){return g},appTriggers:function(){return c},appRequests:function(){return m},evalAction:G,resizeImage:H},r)},J=function(){return{actions:function(){return g},triggers:function(){return c},theme:function(){return e},sk:v,msg:l,log:h,passToClip:0,passwordData:f,outputResult:w,checkboxDetect:D,checkPassLevel:C,
|
||||
encryptFormValue:t,fileUpload:B,redirect:u,scrollUp:A,setContentSize:z}};(function(){h.info("init");r=J();p=I();c=sysPass.Triggers(p);g=sysPass.Actions(p);m=sysPass.Requests(p);y(function(){""!==a.PK&&F();"function"===typeof sysPass.Theme&&(e=sysPass.Theme(p));!0===a.CHECK_UPDATES&&g.main.getUpdates();E();x()})})();return r};
|
||||
$jscomp.iteratorPrototype=function(a){$jscomp.initSymbolIterator();a={next:a};a[$jscomp.global.Symbol.iterator]=function(){return this};return a};$jscomp.array=$jscomp.array||{};$jscomp.iteratorFromArray=function(a,f){$jscomp.initSymbolIterator();a instanceof String&&(a+="");var c=0,g={next:function(){if(c<a.length){var e=c++;return{value:f(e,a[e]),done:!1}}g.next=function(){return{done:!0,value:void 0}};return g.next()}};g[Symbol.iterator]=function(){return g};return g};
|
||||
$jscomp.polyfill=function(a,f,c,g){if(f){c=$jscomp.global;a=a.split(".");for(g=0;g<a.length-1;g++){var e=a[g];e in c||(c[e]={});c=c[e]}a=a[a.length-1];g=c[a];f=f(g);f!=g&&null!=f&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:f})}};$jscomp.polyfill("Array.prototype.keys",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(a){return a})}},"es6-impl","es3");
|
||||
$jscomp.findInternal=function(a,f,c){a instanceof String&&(a=String(a));for(var g=a.length,e=0;e<g;e++){var m=a[e];if(f.call(c,m,e,a))return{i:e,v:m}}return{i:-1,v:void 0}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,c){return $jscomp.findInternal(this,a,c).v}},"es6-impl","es3");
|
||||
sysPass.Main=function(){var a={APP_ROOT:"",LANG:[],PK:"",MAX_FILE_SIZE:1024,CRYPT:new JSEncrypt,CHECK_UPDATES:!1,TIMEZONE:"",LOCALE:"",DEBUG:""},f={passLength:0,minPasswordLength:8,complexity:{numbers:!0,symbols:!0,uppercase:!0,numlength:12}},c={},g={},e={},m={},q={},n={},h={log:function(b){!0===a.DEBUG&&console.log(b)},info:function(b){!0===a.DEBUG&&console.info(b)},error:function(b){console.error(b)},warn:function(b){console.warn(b)}};toastr.options={closeButton:!0,debug:!1,newestOnTop:!1,progressBar:!1,
|
||||
positionClass:"toast-top-center",preventDuplicates:!1,onclick:null,showDuration:"300",hideDuration:"1000",timeOut:"5000",extendedTimeOut:"1000",showEasing:"swing",hideEasing:"linear",showMethod:"fadeIn",hideMethod:"fadeOut"};var w=function(){h.info("setupCallbacks");var b=$("#container").data("page");if(""!==b&&"function"===typeof g.views[b])g.views[b]();0<$("footer").length&&g.views.footer();$("#btnBack").click(function(){t("index.php")});g.bodyHooks()},l={ok:function(b){toastr.success(b)},error:function(b){toastr.error(b)},
|
||||
warn:function(b){toastr.warning(b)},info:function(b){toastr.info(b)},out:function(b){if("object"===typeof b){var a=b.status,d=b.description;void 0!==b.messages&&0<b.messages.length&&(d=d+"<br>"+b.messages.join("<br>"));switch(a){case 0:l.ok(d);break;case 1:case 2:l.error(d);break;case 3:l.warn(d);break;case 10:e.main.logout()}}},html:{error:function(b){return'<p class="error round">Oops...<br>'+a.LANG[1]+"<br>"+b+"</p>"}}},x=function(b){h.info("getEnvironment");var k=window.location.pathname.split("/");
|
||||
a.APP_ROOT=window.location.protocol+"//"+window.location.host+(location.port?":"+location.port:"")+function(){for(var a="",b=1;b<=k.length-2;b++)a+="/"+k[b];return a}();var d=m.getRequestOpts();d.url="/ajax/ajax_getEnvironment.php";d.method="get";d.async=!1;d.useLoading=!1;d.data={isAjax:1};m.getActionCall(d,function(d){a.LANG=d.lang;a.PK=d.pk;a.CHECK_UPDATES=d.check_updates;a.CRYPT.setPublicKey(d.pk);a.TIMEZONE=d.timezone;a.LOCALE=d.locale;a.DEBUG=d.debug;"function"===typeof b&&b()})},u={get:function(){h.info("sk:get");
|
||||
return $("#container").attr("data-sk")},set:function(a){h.info("sk:set");$("#container").attr("data-sk",a)}},y=function(){var a=$("#container");if(!a.hasClass("content-no-auto-resize")){var k=$("#content").height()+200;a.css("height",k)}},z=function(){$("html, body").animate({scrollTop:0},"slow")},t=function(a){window.location.replace(a)},A=function(b){var k={actionId:b.data("action-id"),itemId:b.data("item-id"),sk:u.get()},d={requestDoneAction:"",setRequestData:function(a){$.extend(k,a)},getRequestData:function(){return k},
|
||||
beforeSendAction:"",url:""},g=function(a){if(void 0===d.url||""===d.url)return!1;var b=new FormData;b.append("inFile",a);b.append("isAjax",1);Object.keys(k).forEach(function(a){h.info(a);b.append(a,k[a])});a=m.getRequestOpts();a.url=d.url;a.processData=!1;a.contentType=!1;a.data=b;m.getActionCall(a,function(a){var b=a.status;a=a.description;0===b?("function"===typeof d.requestDoneAction&&d.requestDoneAction(),l.ok(a)):10===b?e.main.logout():l.error(a)})},c=function(d){if(5<d.length)l.error(a.LANG[17]+
|
||||
" (Max: 5)");else for(var k=0;k<d.length;k++){var p=d[k];if(p.size/1E3>a.MAX_FILE_SIZE)l.error(a.LANG[18]+"<br>"+p.name+" (Max: "+a.MAX_FILE_SIZE+")");else{var c;a:{c=p.name;for(var f=b.data("files-ext").toLowerCase().split(","),e=0;e<=f.length;e++)if(-1!==c.indexOf(f[e])){c=!0;break a}c=!1}c?g(d[k]):l.error(a.LANG[19]+"<br>"+p.name)}}},f=function(a){var b=$("#fileUploadForm");!1===a&&b.hide();a=b.find("input[type='file']");a.on("change",function(){"function"===typeof d.beforeSendAction&&d.beforeSendAction();
|
||||
c(this.files)});return a};window.File&&window.FileList&&window.FileReader?function(){h.info("fileUpload:init");var a=f(!1);b.on("dragover dragenter",function(a){h.info("fileUpload:drag");a.stopPropagation();a.preventDefault()});b.on("drop",function(a){h.info("fileUpload:drop");a.stopPropagation();a.preventDefault();"function"===typeof d.beforeSendAction&&d.beforeSendAction();c(a.originalEvent.dataTransfer.files)});b.on("click",function(){a.click()})}():f(!0);return d},B=function(a){h.info("checkPassLevel");
|
||||
f.passLength=a.val().length;v(zxcvbn(a.val()),a)},v=function(b,k){h.info("outputResult");var d=$(".passLevel-"+k.attr("id")),c=b.score;d.show();d.removeClass("weak good strong strongest");0===f.passLength?d.attr("title","").empty():f.passLength<f.minPasswordLength?d.attr("title",a.LANG[11]).addClass("weak"):0===c?d.attr("title",a.LANG[9]+" - "+b.feedback.warning).addClass("weak"):1===c||2===c?d.attr("title",a.LANG[8]+" - "+b.feedback.warning).addClass("good"):3===c?d.attr("title",a.LANG[7]).addClass("strong"):
|
||||
4===c&&d.attr("title",a.LANG[10]).addClass("strongest")},C=function(b){$(b).find(".checkbox").button({icons:{primary:"ui-icon-transferthick-e-w"}}).click(function(){var b=$(this);!0===b.prop("checked")?b.button("option","label",a.LANG[40]):b.button("option","label",a.LANG[41])})},r=function(b){h.info("encryptFormValue");var c=b.val();""!==c&&parseInt(b.attr("data-length"))!==c.length&&(c=a.CRYPT.encrypt(c),b.val(c),b.attr("data-length",c.length))},D=function(){h.info("initializeClipboard");var b=
|
||||
new Clipboard(".clip-pass-button",{text:function(a){return e.account.copypass($(a)).responseJSON.data.accpass}});b.on("success",function(b){l.ok(a.LANG[45])});b.on("error",function(b){l.error(a.LANG[46])});var b=new Clipboard(".dialog-clip-pass-button"),c=new Clipboard(".dialog-clip-user-button");b.on("success",function(a){$(".dialog-user-text").removeClass("dialog-clip-copy");$(".dialog-pass-text").addClass("dialog-clip-copy");a.clearSelection()});c.on("success",function(a){$(".dialog-pass-text").removeClass("dialog-clip-copy");
|
||||
$(".dialog-user-text").addClass("dialog-clip-copy");a.clearSelection()})},E=function(){h.info("bindPassEncrypt");$("body").on("blur",":input[type=password]",function(a){a=$(this);a.hasClass("passwordfield__no-pki")||r(a)}).on("keypress",":input[type=password]",function(a){13===a.keyCode&&(a.preventDefault(),a=$(this),r(a),a.closest("form").submit())})},F=function(a,c){console.info("Eval: "+a);if("function"===typeof a)a(c);else throw Error("Function not found: "+a);},G=function(a){h.info("resizeImage");
|
||||
var b=.9*$(window).width(),d=.9*$(window).height(),c={width:a.width(),height:a.height()},f={calc:0,main:0,secondary:0,factor:.9,rel:c.width/c.height},g=function(a){a.main>a.secondary?a.calc=a.main/a.rel:a.main<a.secondary&&(a.calc=a.main*a.rel);a.calc>a.secondary&&(a.main*=a.factor,g(a));return a},e=function(){f.main=b;f.secondary=d;var e=g(f);a.css({width:e.main,height:e.calc});c.width=e.main;c.height=e.calc},l=function(){f.main=d;f.secondary=b;var e=g(f);a.css({width:e.calc,height:e.main});c.width=
|
||||
e.calc;c.height=e.main};c.width>b?e():c.height>d&&(h.info("height"),l());return c},H=function(){return $.extend({log:h,config:function(){return a},appTheme:function(){return c},appActions:function(){return e},appTriggers:function(){return g},appRequests:function(){return m},evalAction:F,resizeImage:G},q)},I=function(){return{actions:function(){return e},triggers:function(){return g},theme:function(){return c},sk:u,msg:l,log:h,passToClip:0,passwordData:f,outputResult:v,checkboxDetect:C,checkPassLevel:B,
|
||||
encryptFormValue:r,fileUpload:A,redirect:t,scrollUp:z,setContentSize:y}};(function(){h.info("init");q=I();n=H();g=sysPass.Triggers(n);e=sysPass.Actions(n);m=sysPass.Requests(n);x(function(){""!==a.PK&&E();"function"===typeof sysPass.Theme&&(c=sysPass.Theme(n));!0===a.CHECK_UPDATES&&e.main.getUpdates();D();w()})})();return q};
|
||||
|
||||
2
js/app-requests.min.js
vendored
2
js/app-requests.min.js
vendored
@@ -1,5 +1,5 @@
|
||||
var $jscomp={scope:{},checkStringArgs:function(b,c,a){if(null==b)throw new TypeError("The 'this' value for String.prototype."+a+" must not be null or undefined");if(c instanceof RegExp)throw new TypeError("First argument to String.prototype."+a+" must not be a regular expression");return b+""}};
|
||||
$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(b,c,a){if(a.get||a.set)throw new TypeError("ES3 does not support getters and setters.");b!=Array.prototype&&b!=Object.prototype&&(b[c]=a.value)};$jscomp.getGlobal=function(b){return"undefined"!=typeof window&&window===b?b:"undefined"!=typeof global?global:b};$jscomp.global=$jscomp.getGlobal(this);
|
||||
$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(b,c,a){if(a.get||a.set)throw new TypeError("ES3 does not support getters and setters.");b!=Array.prototype&&b!=Object.prototype&&(b[c]=a.value)};$jscomp.getGlobal=function(b){return"undefined"!=typeof window&&window===b?b:"undefined"!=typeof global&&null!=global?global:b};$jscomp.global=$jscomp.getGlobal(this);
|
||||
$jscomp.polyfill=function(b,c,a,d){if(c){a=$jscomp.global;b=b.split(".");for(d=0;d<b.length-1;d++){var e=b[d];e in a||(a[e]={});a=a[e]}b=b[b.length-1];d=a[b];c=c(d);c!=d&&null!=c&&$jscomp.defineProperty(a,b,{configurable:!0,writable:!0,value:c})}};
|
||||
$jscomp.polyfill("String.prototype.startsWith",function(b){return b?b:function(b,a){var c=$jscomp.checkStringArgs(this,b,"startsWith");b+="";for(var e=c.length,f=b.length,g=Math.max(0,Math.min(a|0,c.length)),h=0;h<f&&g<e;)if(c[g++]!=b[h++])return!1;return h>=f}},"es6-impl","es3");
|
||||
sysPass.Requests=function(b){var c=b.log,a=[],d={get:function(){return a},add:function(b){var e=""===b.hash?SparkMD5.hash(JSON.stringify(b),!1):b.hash;if(0<a.length&&a[a.length-1].hash===e)return a;c.info("history:add");b.hash=e;a.push(b);15<=a.length&&a.splice(0,10);return a},del:function(){c.info("history:del");if("undefined"!==typeof a.pop())return a[a.length-1]},reset:function(){c.info("history:reset");a=[]},length:function(){return a.length}};return{getRequestOpts:function(){return Object.create({type:"json",
|
||||
|
||||
Reference in New Issue
Block a user