mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-03 07:04:07 +01:00
* [DEV] Improved installer by using AJAX
* [DEV] Bugfixes
This commit is contained in:
@@ -104,6 +104,11 @@ if ($actionId === ActionsInterface::ACTION_USR_USERS_NEW
|
||||
$UserData->setUserIsChangePass(Request::analyze('changepass', false, false, true));
|
||||
$UserData->setUserPass(Request::analyzeEncrypted('pass'));
|
||||
|
||||
|
||||
$CustomFieldData = new CustomFieldData();
|
||||
$CustomFieldData->setId($itemId);
|
||||
$CustomFieldData->setModule(ActionsInterface::ACTION_USR_USERS);
|
||||
|
||||
// Nuevo usuario o editar
|
||||
if ($actionId === ActionsInterface::ACTION_USR_USERS_NEW
|
||||
|| $actionId === ActionsInterface::ACTION_USR_USERS_EDIT
|
||||
@@ -122,10 +127,6 @@ if ($actionId === ActionsInterface::ACTION_USR_USERS_NEW
|
||||
Response::printJson(_('Ey, esto es una DEMO!!'));
|
||||
}
|
||||
|
||||
$CustomFieldData = new CustomFieldData();
|
||||
$CustomFieldData->setId($itemId);
|
||||
$CustomFieldData->setModule(ActionsInterface::ACTION_USR_USERS);
|
||||
|
||||
if ($actionId === ActionsInterface::ACTION_USR_USERS_NEW) {
|
||||
if (!$UserData->getUserPass() || !$userPassR) {
|
||||
Response::printJson(_('La clave no puede estar en blanco'), 2);
|
||||
@@ -203,6 +204,10 @@ if ($actionId === ActionsInterface::ACTION_USR_USERS_NEW
|
||||
$GroupData->setUsergroupDescription(Request::analyze('description'));
|
||||
$GroupData->setUsers(Request::analyze('users', 0));
|
||||
|
||||
$CustomFieldData = new CustomFieldData();
|
||||
$CustomFieldData->setId($itemId);
|
||||
$CustomFieldData->setModule(ActionsInterface::ACTION_USR_GROUPS);
|
||||
|
||||
if ($actionId === ActionsInterface::ACTION_USR_GROUPS_NEW
|
||||
|| $actionId === ActionsInterface::ACTION_USR_GROUPS_EDIT
|
||||
) {
|
||||
@@ -210,10 +215,6 @@ if ($actionId === ActionsInterface::ACTION_USR_USERS_NEW
|
||||
Response::printJson(_('Es necesario un nombre de grupo'), 2);
|
||||
}
|
||||
|
||||
$CustomFieldData = new CustomFieldData();
|
||||
$CustomFieldData->setId($itemId);
|
||||
$CustomFieldData->setModule(ActionsInterface::ACTION_USR_GROUPS);
|
||||
|
||||
if ($actionId === ActionsInterface::ACTION_USR_GROUPS_NEW) {
|
||||
try {
|
||||
Group::getItem($GroupData)->add();
|
||||
|
||||
65
ajax/ajax_install.php
Normal file
65
ajax/ajax_install.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* sysPass
|
||||
*
|
||||
* @author nuxsmin
|
||||
* @link http://syspass.org
|
||||
* @copyright 2012-2016, Rubén Domínguez nuxsmin@$syspass.org
|
||||
*
|
||||
* This file is part of sysPass.
|
||||
*
|
||||
* sysPass is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* sysPass is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with sysPass. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use SP\Core\Exceptions\SPException;
|
||||
use SP\Core\Installer;
|
||||
use SP\DataModel\InstallData;
|
||||
use SP\Http\JsonResponse;
|
||||
use SP\Http\Request;
|
||||
use SP\Util\Json;
|
||||
|
||||
define('APP_ROOT', '..');
|
||||
define('IS_INSTALLER', 1);
|
||||
|
||||
require_once APP_ROOT . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'Base.php';
|
||||
|
||||
Request::checkReferer('POST');
|
||||
|
||||
$Json = new JsonResponse();
|
||||
|
||||
$InstallData = new InstallData();
|
||||
$InstallData->setAdminLogin(Request::analyze('adminlogin', 'admin'));
|
||||
$InstallData->setAdminPass(Request::analyzeEncrypted('adminpass'));
|
||||
$InstallData->setMasterPassword(Request::analyzeEncrypted('masterpassword'));
|
||||
$InstallData->setDbAdminUser(Request::analyze('dbuser', 'root'));
|
||||
$InstallData->setDbAdminPass(Request::analyzeEncrypted('dbpass'));
|
||||
$InstallData->setDbName(Request::analyze('dbname', 'syspass'));
|
||||
$InstallData->setDbHost(Request::analyze('dbhost', 'localhost'));
|
||||
$InstallData->setHostingMode(Request::analyze('hostingmode', false));
|
||||
|
||||
error_log($InstallData->getAdminPass());
|
||||
|
||||
try {
|
||||
$Installer = new Installer($InstallData);
|
||||
$Installer->checkData();
|
||||
$Installer->install();
|
||||
|
||||
$Json->setStatus(0);
|
||||
$Json->setDescription(_('Instalación finalizada'));
|
||||
} catch (SPException $e) {
|
||||
$Json->setDescription($e->getMessage());
|
||||
$Json->addMessage($e->getHint());
|
||||
}
|
||||
|
||||
Json::returnJson($Json);
|
||||
@@ -73,7 +73,7 @@ class Config
|
||||
{
|
||||
$Config = Session::getConfig();
|
||||
|
||||
return (gettype($Config) === 'object') ? $Config : self::arrayMapper();
|
||||
return is_object($Config) ? $Config : self::arrayMapper();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,6 +125,10 @@ class Config
|
||||
|
||||
self::$Config = new ConfigData();
|
||||
|
||||
if (!file_exists(XML_CONFIG_FILE)){
|
||||
return self::$Config;
|
||||
}
|
||||
|
||||
try {
|
||||
$items = DiFactory::getConfigStorage()->load('config')->getItems();
|
||||
$Reflection = new ReflectionObject(self::$Config);
|
||||
|
||||
@@ -35,6 +35,7 @@ use SP\Core\Exceptions\SPException;
|
||||
use SP\Core\DiFactory;
|
||||
use SP\Core\Template;
|
||||
use SP\Core\UI\ThemeIconsBase;
|
||||
use SP\Http\JsonResponse;
|
||||
|
||||
/**
|
||||
* Clase base para los controladores
|
||||
@@ -74,6 +75,10 @@ abstract class ControllerBase
|
||||
* @var string
|
||||
*/
|
||||
protected $controllerName;
|
||||
/**
|
||||
* @var JsonResponse
|
||||
*/
|
||||
protected $Json;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -85,7 +90,7 @@ abstract class ControllerBase
|
||||
global $timeStart;
|
||||
|
||||
$class = get_called_class();
|
||||
$this->controllerName = substr($class, strrpos($class, '\\') + 1, -strlen('Controller'));
|
||||
$this->controllerName = substr($class, strrpos($class, '\\') + 1, -strlen('Controller'));
|
||||
|
||||
$this->view = null === $template ? $this->getTemplate() : $template;
|
||||
$this->view->setBase(strtolower($this->controllerName));
|
||||
@@ -159,6 +164,22 @@ abstract class ControllerBase
|
||||
$this->view->assign('memEnd', memory_get_usage() / 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function getJson()
|
||||
{
|
||||
return $this->Json;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param JsonResponse $Json
|
||||
*/
|
||||
public function setJson(JsonResponse $Json)
|
||||
{
|
||||
$this->Json = $Json;
|
||||
}
|
||||
|
||||
/**
|
||||
* Establecer la instancia del motor de plantillas a utilizar.
|
||||
*
|
||||
|
||||
@@ -266,23 +266,6 @@ class MainController extends ControllerBase implements ActionsInterface
|
||||
*/
|
||||
public function getInstaller()
|
||||
{
|
||||
$this->view->addTemplate('install');
|
||||
$this->view->addTemplate('footer');
|
||||
$this->view->addTemplate('body-end');
|
||||
|
||||
$InstallData = new InstallData();
|
||||
$InstallData->setAdminLogin(Request::analyze('adminlogin', 'admin'));
|
||||
$InstallData->setAdminPass(Request::analyzeEncrypted('adminpass'));
|
||||
$InstallData->setMasterPassword(Request::analyzeEncrypted('masterpassword'));
|
||||
$InstallData->setDbAdminUser(Request::analyze('dbuser', 'root'));
|
||||
$InstallData->setDbAdminPass(Request::analyzeEncrypted('dbpass'));
|
||||
$InstallData->setDbName(Request::analyze('dbname', 'syspass'));
|
||||
$InstallData->setDbHost(Request::analyze('dbhost', 'localhost'));
|
||||
$InstallData->setHostingMode(Request::analyze('hostingmode', false));
|
||||
|
||||
$this->view->assign('isCompleted', false);
|
||||
$this->view->assign('InstallData', $InstallData);
|
||||
|
||||
$errors = array_merge(Checks::checkPhpVersion(), Checks::checkModules());
|
||||
|
||||
if (@file_exists(__FILE__ . "\0Nullbyte")) {
|
||||
@@ -299,24 +282,11 @@ class MainController extends ControllerBase implements ActionsInterface
|
||||
'hint' => _('Sin esta función un atacante puede utilizar su cuenta al resetear la clave')];
|
||||
}
|
||||
|
||||
if (Request::analyze('install', false)) {
|
||||
$Installer = new Installer($InstallData);
|
||||
$resInstall = $Installer->install();
|
||||
|
||||
if ($resInstall === true) {
|
||||
$this->view->append('errors', [
|
||||
'type' => SPException::SP_OK,
|
||||
'description' => _('Instalación finalizada'),
|
||||
'hint' => _('Pulse <a href="index.php" title="Acceder">aquí</a> para acceder')
|
||||
]);
|
||||
$this->view->assign('isCompleted', true);
|
||||
return true;
|
||||
}
|
||||
|
||||
array_push($errors, $resInstall);
|
||||
}
|
||||
|
||||
$this->view->assign('errors', $errors);
|
||||
|
||||
$this->view->addTemplate('install');
|
||||
$this->view->addTemplate('footer');
|
||||
$this->view->addTemplate('body-end');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -129,7 +129,9 @@ class Init
|
||||
self::checkHttps();
|
||||
|
||||
// Comprobar si es necesario inicialización
|
||||
if (self::checkInitSourceInclude()) {
|
||||
if (self::checkInitSourceInclude() ||
|
||||
(defined('IS_INSTALLER') && Request::analyze('isAjax', false, true))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -424,7 +426,7 @@ class Init
|
||||
*/
|
||||
private static function checkInitSourceInclude()
|
||||
{
|
||||
$srcScript = pathinfo($_SERVER["SCRIPT_NAME"], PATHINFO_BASENAME);
|
||||
$srcScript = pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_BASENAME);
|
||||
$skipInit = array('js.php', 'css.php', 'api.php', 'ajax_getEnvironment.php');
|
||||
|
||||
return (in_array($srcScript, $skipInit));
|
||||
@@ -445,13 +447,15 @@ class Init
|
||||
/**
|
||||
* Comprueba que la aplicación esté instalada
|
||||
* Esta función comprueba si la aplicación está instalada. Si no lo está, redirige al instalador.
|
||||
*
|
||||
* @throws \SP\Core\Exceptions\FileNotFoundException
|
||||
*/
|
||||
private static function checkInstalled()
|
||||
{
|
||||
// Redirigir al instalador si no está instalada
|
||||
if (!Config::getConfig()->isInstalled()) {
|
||||
if (self::$SUBURI != '/index.php') {
|
||||
$url = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . self::$WEBROOT . '/index.php';
|
||||
if (self::$SUBURI !== '/index.php') {
|
||||
$url = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . self::$WEBROOT . '/index.php';
|
||||
header("Location: $url");
|
||||
exit();
|
||||
} else {
|
||||
|
||||
@@ -44,8 +44,6 @@ use SP\Util\Util;
|
||||
|
||||
defined('APP_ROOT') || die(_('No es posible acceder directamente a este archivo'));
|
||||
|
||||
define('IS_INSTALLER', 1);
|
||||
|
||||
/**
|
||||
* Esta clase es la encargada de instalar sysPass.
|
||||
*/
|
||||
@@ -73,59 +71,53 @@ class Installer
|
||||
/**
|
||||
* Iniciar instalación.
|
||||
*
|
||||
* @return array resultado del proceso
|
||||
* @return bool
|
||||
* @throws SPException
|
||||
*/
|
||||
public function install()
|
||||
{
|
||||
try {
|
||||
$this->checkData();
|
||||
$this->checkData();
|
||||
|
||||
$Config = Config::getConfig();
|
||||
$Config = Config::getConfig();
|
||||
|
||||
// Generate a random salt that is used to salt the local user passwords
|
||||
$Config->setPasswordSalt(Util::generateRandomBytes(30));
|
||||
$Config->setConfigVersion(implode(Util::getVersion(true)));
|
||||
// Generate a random salt that is used to salt the local user passwords
|
||||
$Config->setPasswordSalt(Util::generateRandomBytes(30));
|
||||
$Config->setConfigVersion(implode(Util::getVersion(true)));
|
||||
|
||||
if (preg_match('/(.*):(\d{1,5})/', $this->InstallData->getDbHost(), $match)) {
|
||||
$this->InstallData->setDbHost($match[1]);
|
||||
$this->InstallData->setDbPort($match[2]);
|
||||
} else {
|
||||
$this->InstallData->setDbPort(3306);
|
||||
}
|
||||
|
||||
if (!preg_match('/(localhost|127.0.0.1)/', $this->InstallData->getDbHost())) {
|
||||
$this->InstallData->setDbAuthHost($_SERVER['SERVER_ADDR']);
|
||||
} else {
|
||||
$this->InstallData->setDbAuthHost('localhost');
|
||||
}
|
||||
|
||||
// Save DB connection info
|
||||
$Config->setDbHost($this->InstallData->getDbHost());
|
||||
$Config->setDbName($this->InstallData->getDbName());
|
||||
|
||||
|
||||
$this->connectDatabase();
|
||||
$this->setupMySQLDatabase();
|
||||
$this->createAdminAccount();
|
||||
|
||||
ConfigDB::setValue('version', implode(Util::getVersion(true)));
|
||||
|
||||
$Config->setInstalled(true);
|
||||
Config::saveConfig($Config);
|
||||
} catch (SPException $e) {
|
||||
return [
|
||||
'type' => $e->getType(),
|
||||
'description' => $e->getMessage(),
|
||||
'hint' => $e->getHint()];
|
||||
if (preg_match('/(.*):(\d{1,5})/', $this->InstallData->getDbHost(), $match)) {
|
||||
$this->InstallData->setDbHost($match[1]);
|
||||
$this->InstallData->setDbPort($match[2]);
|
||||
} else {
|
||||
$this->InstallData->setDbPort(3306);
|
||||
}
|
||||
|
||||
if (!preg_match('/(localhost|127.0.0.1)/', $this->InstallData->getDbHost())) {
|
||||
$this->InstallData->setDbAuthHost($_SERVER['SERVER_ADDR']);
|
||||
} else {
|
||||
$this->InstallData->setDbAuthHost('localhost');
|
||||
}
|
||||
|
||||
// Save DB connection info
|
||||
$Config->setDbHost($this->InstallData->getDbHost());
|
||||
$Config->setDbName($this->InstallData->getDbName());
|
||||
|
||||
|
||||
$this->connectDatabase();
|
||||
$this->setupMySQLDatabase();
|
||||
$this->createAdminAccount();
|
||||
|
||||
ConfigDB::setValue('version', implode(Util::getVersion(true)));
|
||||
|
||||
$Config->setInstalled(true);
|
||||
Config::saveConfig($Config);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
private function checkData()
|
||||
public function checkData()
|
||||
{
|
||||
if (!$this->InstallData->getAdminLogin()) {
|
||||
throw new InvalidArgumentException(
|
||||
@@ -337,7 +329,7 @@ class Installer
|
||||
*/
|
||||
private function createDBStructure()
|
||||
{
|
||||
$fileName = SQL_PATH . DIRECTORY_SEPARATOR . 'dbstructure.sql';
|
||||
$fileName = SQL_PATH . DIRECTORY_SEPARATOR . 'dbstructure.sql';
|
||||
|
||||
if (!file_exists($fileName)) {
|
||||
throw new SPException(SPException::SP_CRITICAL,
|
||||
|
||||
@@ -42,16 +42,16 @@ class Util
|
||||
/**
|
||||
* Generar una clave aleatoria
|
||||
*
|
||||
* @param int $length Longitud de la clave
|
||||
* @param int $length Longitud de la clave
|
||||
* @param bool $useNumbers Usar números
|
||||
* @param bool $useSpecial Usar carácteres especiales
|
||||
* @return string
|
||||
*/
|
||||
public static function randomPassword($length = 16, $useNumbers = true, $useSpecial = true)
|
||||
{
|
||||
$special = "@#$%&/()=?¿!_-:.;,{}[]*^";
|
||||
$numbers = "0123456789";
|
||||
$alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ";
|
||||
$special = '@#$%&/()=?¿!_-:.;,{}[]*^';
|
||||
$numbers = '0123456789';
|
||||
$alphabet = 'abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ';
|
||||
|
||||
if ($useSpecial === true) {
|
||||
$alphabet .= $special;
|
||||
@@ -65,7 +65,7 @@ class Util
|
||||
$alphaLength = strlen($alphabet) - 1; //put the length -1 in cache
|
||||
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
$n = rand(0, $alphaLength);
|
||||
$n = mt_rand(0, $alphaLength);
|
||||
$pass[] = $alphabet[$n];
|
||||
}
|
||||
|
||||
@@ -82,17 +82,14 @@ class Util
|
||||
{
|
||||
// Try to use openssl_random_pseudo_bytes
|
||||
if (function_exists('openssl_random_pseudo_bytes')) {
|
||||
$pseudo_byte = bin2hex(openssl_random_pseudo_bytes($length, $strong));
|
||||
if ($strong == true) {
|
||||
return substr($pseudo_byte, 0, $length); // Truncate it to match the length
|
||||
}
|
||||
$pseudo_byte = bin2hex(openssl_random_pseudo_bytes($length));
|
||||
return substr($pseudo_byte, 0, $length); // Truncate it to match the length
|
||||
}
|
||||
|
||||
// Try to use /dev/urandom
|
||||
$fp = @file_get_contents('/dev/urandom', false, null, 0, $length);
|
||||
if ($fp !== false) {
|
||||
$string = substr(bin2hex($fp), 0, $length);
|
||||
return $string;
|
||||
return substr(bin2hex($fp), 0, $length);
|
||||
}
|
||||
|
||||
// Fallback to mt_rand()
|
||||
@@ -201,7 +198,7 @@ class Util
|
||||
* Obtener datos desde una URL usando CURL
|
||||
*
|
||||
* @param $url string La URL
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @param bool|null $useCookie
|
||||
* @return bool|string
|
||||
* @throws SPException
|
||||
@@ -359,7 +356,7 @@ class Util
|
||||
*/
|
||||
public static function logout()
|
||||
{
|
||||
exit('<script>sysPassApp.doLogout();</script>');
|
||||
exit('<script>sysPassApp.actions().main.logout();</script>');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -367,12 +364,12 @@ class Util
|
||||
*/
|
||||
public static function getMaxUpload()
|
||||
{
|
||||
$max_upload = (int)(ini_get('upload_max_filesize'));
|
||||
$max_post = (int)(ini_get('post_max_size'));
|
||||
$memory_limit = (int)(ini_get('memory_limit'));
|
||||
$max_upload = (int)ini_get('upload_max_filesize');
|
||||
$max_post = (int)ini_get('post_max_size');
|
||||
$memory_limit = (int)ini_get('memory_limit');
|
||||
$upload_mb = min($max_upload, $max_post, $memory_limit);
|
||||
|
||||
Log::writeNewLog(__FUNCTION__, "Max. PHP upload: " . $upload_mb . "MB");
|
||||
Log::writeNewLog(__FUNCTION__, 'Max. PHP upload: ' . $upload_mb . 'MB');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -381,8 +378,8 @@ class Util
|
||||
* such as 'false','N','yes','on','off', etc.
|
||||
*
|
||||
* @author Samuel Levy <sam+nospam@samuellevy.com>
|
||||
* @param mixed $in The variable to check
|
||||
* @param bool $strict If set to false, consider everything that is not false to
|
||||
* @param mixed $in The variable to check
|
||||
* @param bool $strict If set to false, consider everything that is not false to
|
||||
* be true.
|
||||
* @return bool The boolean equivalent or null (if strict, and no exact equivalent)
|
||||
*/
|
||||
@@ -422,7 +419,7 @@ class Util
|
||||
{
|
||||
if (Session::getReload() === true) {
|
||||
Session::setReload(false);
|
||||
exit("<script>location.reload();</script>");
|
||||
exit('<script>location.reload();</script>');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -447,7 +444,7 @@ class Util
|
||||
*/
|
||||
public static function getServerUrl()
|
||||
{
|
||||
$urlScheme = (Checks::httpsEnabled()) ? 'https://' : 'http://';
|
||||
$urlScheme = Checks::httpsEnabled() ? 'https://' : 'http://';
|
||||
$urlPort = ($_SERVER['SERVER_PORT'] != 443) ? ':' . $_SERVER['SERVER_PORT'] : '';
|
||||
|
||||
return $urlScheme . $_SERVER['SERVER_NAME'] . $urlPort;
|
||||
@@ -490,9 +487,9 @@ class Util
|
||||
/**
|
||||
* Comprobar si un valor existe en un array de objetos
|
||||
*
|
||||
* @param array $objectArray
|
||||
* @param array $objectArray
|
||||
* @param string $method
|
||||
* @param mixed $value
|
||||
* @param mixed $value
|
||||
* @return bool
|
||||
*/
|
||||
public static function checkInObjectArray(array $objectArray, $method, $value)
|
||||
|
||||
@@ -7,7 +7,10 @@
|
||||
<div id="fancyContainer" align="center">
|
||||
<h2 class="midround"><?php echo $header; ?></H2>
|
||||
|
||||
<form method="post" name="frmGroups" id="frmGroups" class="form-action" data-onsubmit="appMgmt/save">
|
||||
<form method="post" name="frmGroups" id="frmGroups" class="form-action"
|
||||
data-onsubmit="appMgmt/save"
|
||||
data-activetab="<?php echo isset($activeTab) ? $activeTab : ''; ?>"
|
||||
data-nextaction-id="<?php echo \SP\Core\ActionsInterface::ACTION_USR_GROUPS; ?>">
|
||||
<table class="fancydata">
|
||||
<tbody>
|
||||
<tr>
|
||||
@@ -43,7 +46,7 @@
|
||||
title="<?php echo _('Usuarios'); ?>">
|
||||
<option value=""><?php echo _('Seleccionar Usuarios'); ?></option>
|
||||
<?php foreach ($users as $id => $name): ?>
|
||||
<?php $selected = (\SP\Util\Util::checkInObjectArray($groupUsers, 'getUsertogroupUserId', $id)) ? 'selected' : ''; ?>
|
||||
<?php $selected = \SP\Util\Util::checkInObjectArray($groupUsers, 'getUsertogroupUserId', $id) ? 'selected' : ''; ?>
|
||||
<option
|
||||
value="<?php echo $id; ?>" <?php echo $selected; ?>><?php echo $name; ?></option>
|
||||
<?php endforeach; ?>
|
||||
@@ -58,11 +61,9 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<input type="hidden" name="activeTab" value="<?php echo $activeTab ?>"/>
|
||||
<input type="hidden" name="onCloseAction" value="<?php echo $onCloseAction ?>"/>
|
||||
<input type="hidden" name="itemId" value="<?php echo $group->getUsergroupId(); ?>"/>
|
||||
<input type="hidden" name="actionId" value="<?php echo $actionId; ?>"/>
|
||||
<input type="hidden" name="sk" value="<?php echo $sk; ?>">
|
||||
<input type="hidden" name="sk" value="">
|
||||
<input type="hidden" name="isAjax" value="1">
|
||||
</form>
|
||||
<div id="resCheck"><span id="resFancyAccion"></span></div>
|
||||
|
||||
@@ -6,7 +6,10 @@
|
||||
<div id="fancyContainer" align="center">
|
||||
<h2 class="midround"><?php echo $header; ?></H2>
|
||||
|
||||
<form method="post" name="frmProfiles" id="frmProfiles" class="form-action" data-onsubmit="appMgmt/save">
|
||||
<form method="post" name="frmProfiles" id="frmProfiles" class="form-action"
|
||||
data-onsubmit="appMgmt/save"
|
||||
data-activetab="<?php echo isset($activeTab) ? $activeTab : ''; ?>"
|
||||
data-nextaction-id="<?php echo \SP\Core\ActionsInterface::ACTION_USR_PROFILES; ?>">
|
||||
<table class="fancydata">
|
||||
<tbody>
|
||||
<tr>
|
||||
@@ -26,47 +29,47 @@
|
||||
<div id="btnProfilesAcc" class="btn-checks round5">
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_accadd">
|
||||
<input type="checkbox" id="profile_accadd" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_accadd" <?php echo ($profile->isAccAdd()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_accadd" <?php echo $profile->isAccAdd() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Crear nueva cuenta'); ?>"><?php echo _('Crear'); ?></span>
|
||||
</label>
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_accview">
|
||||
<input type="checkbox" id="profile_accview" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_accview" <?php echo ($profile->isAccView()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_accview" <?php echo $profile->isAccView() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Ver detalles de cuenta'); ?>"><?php echo _('Ver'); ?></span>
|
||||
</label>
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_accviewpass">
|
||||
<input type="checkbox" id="profile_accviewpass" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_accviewpass" <?php echo ($profile->isAccViewPass()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_accviewpass" <?php echo $profile->isAccViewPass() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Ver clave de cuenta'); ?>"><?php echo _('Ver Clave'); ?></span>
|
||||
</label>
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_accviewhistory">
|
||||
<input type="checkbox" id="profile_accviewhistory" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_accviewhistory" <?php echo ($profile->isAccViewHistory()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_accviewhistory" <?php echo $profile->isAccViewHistory() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Ver historial de cuenta'); ?>"><?php echo _('Ver Historial'); ?></span>
|
||||
</label>
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_accedit">
|
||||
<input type="checkbox" id="profile_accedit" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_accedit" <?php echo ($profile->isAccEdit()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_accedit" <?php echo $profile->isAccEdit() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Editar cuenta'); ?>"><?php echo _('Editar'); ?></span>
|
||||
</label>
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_acceditpass">
|
||||
<input type="checkbox" id="profile_acceditpass" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_acceditpass" <?php echo ($profile->isAccEditPass()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_acceditpass" <?php echo $profile->isAccEditPass() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Editar clave de cuenta'); ?>"><?php echo _('Editar Clave'); ?></span>
|
||||
</label>
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_accdel">
|
||||
<input type="checkbox" id="profile_accdel" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_accdel" <?php echo ($profile->isAccDelete()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_accdel" <?php echo $profile->isAccDelete() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Eliminar cuenta'); ?>"><?php echo _('Eliminar'); ?></span>
|
||||
</label>
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_accfiles">
|
||||
<input type="checkbox" id="profile_accfiles" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_accfiles" <?php echo ($profile->isAccFiles()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_accfiles" <?php echo $profile->isAccFiles() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Ver archivos de cuenta'); ?>"><?php echo _('Archivos'); ?></span>
|
||||
</label>
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_accpublinks">
|
||||
<input type="checkbox" id="profile_accpublinks" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_accpublinks" <?php echo ($profile->isAccPublicLinks()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_accpublinks" <?php echo $profile->isAccPublicLinks() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Publicar enlace a cuenta'); ?>"><?php echo _('Publicar Enlace'); ?></span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -78,22 +81,22 @@
|
||||
<div id="btnProfilesConfig" class="btn-checks round5">
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_config">
|
||||
<input type="checkbox" id="profile_config" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_config" <?php echo ($profile->isConfigGeneral()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_config" <?php echo $profile->isConfigGeneral() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Configuración general'); ?>"><?php echo _('General'); ?></span>
|
||||
</label>
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_configmpw">
|
||||
<input type="checkbox" id="profile_configmpw" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_configmpw" <?php echo ($profile->isConfigEncryption()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_configmpw" <?php echo $profile->isConfigEncryption() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Opciones de encriptación'); ?>"><?php echo _('Encriptación'); ?></span>
|
||||
</label>
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_configback">
|
||||
<input type="checkbox" id="profile_configback" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_configback" <?php echo ($profile->isConfigBackup()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_configback" <?php echo $profile->isConfigBackup() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Realizar copia de seguridad y exportar'); ?>"><?php echo _('Backup'); ?></span>
|
||||
</label>
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_configimport">
|
||||
<input type="checkbox" id="profile_configimport" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_configimport" <?php echo ($profile->isConfigImport()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_configimport" <?php echo $profile->isConfigImport() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Realizar importación de cuentas'); ?>"><?php echo _('Importar'); ?></span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -105,42 +108,42 @@
|
||||
<div id="btnProfilesUsers" class="btn-checks round5">
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_users">
|
||||
<input type="checkbox" id="profile_users" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_users" <?php echo ($profile->isMgmUsers()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_users" <?php echo $profile->isMgmUsers() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Gestión de usuarios'); ?>"><?php echo _('Usuarios'); ?></span>
|
||||
</label>
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_groups">
|
||||
<input type="checkbox" id="profile_groups" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_groups" <?php echo ($profile->isMgmGroups()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_groups" <?php echo $profile->isMgmGroups() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Gestión de grupos'); ?>"><?php echo _('Grupos'); ?></span>
|
||||
</label>
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_profiles">
|
||||
<input type="checkbox" id="profile_profiles" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_profiles" <?php echo ($profile->isMgmProfiles()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_profiles" <?php echo $profile->isMgmProfiles() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Gestión de perfiles'); ?>"><?php echo _('Perfiles'); ?></span>
|
||||
</label>
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_categories">
|
||||
<input type="checkbox" id="profile_categories" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_categories" <?php echo ($profile->isMgmCategories()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_categories" <?php echo $profile->isMgmCategories() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Gestión de categorías'); ?>"><?php echo _('Categorías'); ?></span>
|
||||
</label>
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_customers">
|
||||
<input type="checkbox" id="profile_customers" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_customers" <?php echo ($profile->isMgmCustomers()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_customers" <?php echo $profile->isMgmCustomers() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Gestión de clientes'); ?>"><?php echo _('Clientes'); ?></span>
|
||||
</label>
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_customfields">
|
||||
<input type="checkbox" id="profile_customfields" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_customfields" <?php echo ($profile->isMgmCustomFields()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_customfields" <?php echo $profile->isMgmCustomFields() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Gestión de campos personalizados'); ?>"><?php echo _('Campos Personalizados'); ?></span>
|
||||
</label>
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_apitokens">
|
||||
<input type="checkbox" id="profile_apitokens" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_apitokens" <?php echo ($profile->isMgmApiTokens()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_apitokens" <?php echo $profile->isMgmApiTokens() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Gestión de autorizaciones API'); ?>"><?php echo _('Autorizaciones API'); ?></span>
|
||||
</label>
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_publinks">
|
||||
<input type="checkbox" id="profile_publinks" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_publinks" <?php echo ($profile->isMgmPublicLinks()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_publinks" <?php echo $profile->isMgmPublicLinks() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Gestión de enlaces'); ?>"><?php echo _('Enlaces Públicos'); ?></span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -152,7 +155,7 @@
|
||||
<div id="btnProfilesOthers" class="btn-checks round5">
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="profile_eventlog">
|
||||
<input type="checkbox" id="profile_eventlog" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="profile_eventlog" <?php echo ($profile->isEvl()) ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
name="profile_eventlog" <?php echo $profile->isEvl() ? 'CHECKED' : ''; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label" title="<?php echo _('Ver log de eventos'); ?>"><?php echo _('Log de Eventos'); ?></span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -176,10 +179,9 @@
|
||||
</table>
|
||||
|
||||
<?php if (!$isView): ?>
|
||||
<input type="hidden" name="activeTab" value="<?php echo $activeTab ?>"/>
|
||||
<input type="hidden" name="itemId" value="<?php echo $itemId; ?>"/>
|
||||
<input type="hidden" name="actionId" value="<?php echo $actionId; ?>"/>
|
||||
<input type="hidden" name="sk" value="<?php echo $sk; ?>">
|
||||
<input type="hidden" name="sk" value="">
|
||||
<input type="hidden" name="isAjax" value="1">
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
<div id="fancyContainer" align="center">
|
||||
<h2 class="midround"><?php echo $header; ?></H2>
|
||||
|
||||
<form method="post" name="frmTokens" id="frmTokens" class="form-action" data-onsubmit="appMgmt/save">
|
||||
<form method="post" name="frmTokens" id="frmTokens" class="form-action"
|
||||
data-onsubmit="appMgmt/save"
|
||||
data-activetab="<?php echo isset($activeTab) ? $activeTab : ''; ?>"
|
||||
data-nextaction-id="<?php echo \SP\Core\ActionsInterface::ACTION_MGM_APITOKENS; ?>">
|
||||
<table class="fancydata">
|
||||
<tbody>
|
||||
<tr>
|
||||
@@ -45,16 +48,15 @@
|
||||
<?php else: ?>
|
||||
<tr>
|
||||
<td class="descField"><?php echo _('Token'); ?></td>
|
||||
<td class="valField"><?php echo ($gotData) ? $token->authtoken_token : ''; ?></td>
|
||||
<td class="valField"><?php echo $gotData ? $token->authtoken_token : ''; ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<input type="hidden" name="activeTab" value="<?php echo $activeTab ?>"/>
|
||||
<input type="hidden" name="itemId" value="<?php echo ($gotData) ? $token->authtoken_id : ''; ?>"/>
|
||||
<input type="hidden" name="itemId" value="<?php echo $gotData ? $token->authtoken_id : ''; ?>"/>
|
||||
<input type="hidden" name="actionId" value="<?php echo $actionId; ?>"/>
|
||||
<input type="hidden" name="sk" value="<?php echo $sk; ?>">
|
||||
<input type="hidden" name="sk" value="">
|
||||
<input type="hidden" name="isAjax" value="1">
|
||||
</form>
|
||||
<div id="resCheck"><span id="resFancyAccion"></span></div>
|
||||
|
||||
@@ -6,7 +6,10 @@
|
||||
<div id="fancyContainer" align="center">
|
||||
<h2 class="midround"><?php echo $header; ?></h2>
|
||||
|
||||
<form method="post" name="frmUsers" id="frmUsers" class="form-action" data-onsubmit="appMgmt/save">
|
||||
<form method="post" name="frmUsers" id="frmUsers" class="form-action"
|
||||
data-onsubmit="appMgmt/save"
|
||||
data-activetab="<?php echo isset($activeTab) ? $activeTab : ''; ?>"
|
||||
data-nextaction-id="<?php echo \SP\Core\ActionsInterface::ACTION_USR_USERS; ?>">
|
||||
<table class="fancydata">
|
||||
<tbody>
|
||||
<tr>
|
||||
@@ -14,7 +17,8 @@
|
||||
<td class="valField">
|
||||
<?php if (!$isView): ?>
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="name" name="name" type="text" required class="mdl-textfield__input mdl-color-text--indigo-400"
|
||||
<input id="name" name="name" type="text" required
|
||||
class="mdl-textfield__input mdl-color-text--indigo-400"
|
||||
value="<?php echo $user->getUserName(); ?>" maxlength="80">
|
||||
<label class="mdl-textfield__label"
|
||||
for="name"><?php echo _('Nombre de usuario completo'); ?></label>
|
||||
@@ -30,8 +34,10 @@
|
||||
<td class="valField">
|
||||
<?php if (!$isView): ?>
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="login" name="login" type="text" required class="mdl-textfield__input mdl-color-text--indigo-400"
|
||||
value="<?php echo $user->getUserLogin(); ?>" maxlength="80" <?php echo ($user->isUserIsLdap()) ? 'readonly' : ''; ?>>
|
||||
<input id="login" name="login" type="text" required
|
||||
class="mdl-textfield__input mdl-color-text--indigo-400"
|
||||
value="<?php echo $user->getUserLogin(); ?>"
|
||||
maxlength="80" <?php echo $user->isUserIsLdap() ? 'readonly' : ''; ?>>
|
||||
<label class="mdl-textfield__label"
|
||||
for="login"><?php echo _('Login de inicio de sesión'); ?></label>
|
||||
</div>
|
||||
@@ -39,7 +45,8 @@
|
||||
<?php echo $user->getUserLogin(); ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($user->isUserIsLdap()): ?>
|
||||
<i class="material-icons <?php echo $icons->getIconLdapUser()->getClass(); ?>" title="<?php echo $icons->getIconLdapUser()->getTitle(); ?>"><?php echo $icons->getIconLdapUser()->getIcon(); ?></i>
|
||||
<i class="material-icons <?php echo $icons->getIconLdapUser()->getClass(); ?>"
|
||||
title="<?php echo $icons->getIconLdapUser()->getTitle(); ?>"><?php echo $icons->getIconLdapUser()->getIcon(); ?></i>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -77,7 +84,8 @@
|
||||
<td class="valField">
|
||||
<?php if (!$isView): ?>
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="email" name="email" type="email" required class="mdl-textfield__input mdl-color-text--indigo-400"
|
||||
<input id="email" name="email" type="email" required
|
||||
class="mdl-textfield__input mdl-color-text--indigo-400"
|
||||
value="<?php echo $user->getUserEmail(); ?>" maxlength="50">
|
||||
<label class="mdl-textfield__label"
|
||||
for="email"><?php echo _('Dirección de correo'); ?></label>
|
||||
@@ -96,7 +104,7 @@
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="userpass" name="pass" type="password" required
|
||||
class="mdl-textfield__input passwordfield__input mdl-color-text--indigo-400"
|
||||
maxlength="50" OnKeyUp="sysPassUtil.Common.checkPassLevel(this.value)">
|
||||
maxlength="50">
|
||||
<label class="mdl-textfield__label"
|
||||
for="userpass"><?php echo _('Clave'); ?></label>
|
||||
</div>
|
||||
@@ -140,14 +148,14 @@
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="adminapp"
|
||||
title="<?php echo _('Administrador de la aplicación'); ?>">
|
||||
<input type="checkbox" id="adminapp" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="adminapp" <?php echo ($user->isUserIsAdminApp()) ? 'checked' : ' ';?> <?php echo $isDisabled; ?>/>
|
||||
name="adminapp" <?php echo $user->isUserIsAdminApp() ? 'checked' : ' '; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label"><?php echo _('Admin. Aplicación'); ?></span>
|
||||
</label>
|
||||
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="adminacc"
|
||||
title="<?php echo _('Administrador de cuentas'); ?>">
|
||||
<input type="checkbox" id="adminacc" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="adminacc" <?php echo ($user->isUserIsAdminAcc()) ? 'checked' : ' ';?> <?php echo $isDisabled; ?>/>
|
||||
name="adminacc" <?php echo $user->isUserIsAdminAcc() ? 'checked' : ' '; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label"><?php echo _('Admin. Cuentas'); ?></span>
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
@@ -155,14 +163,14 @@
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="disabled"
|
||||
title="<?php echo _('Deshabilitado'); ?>">
|
||||
<input type="checkbox" id="disabled" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="disabled" <?php echo ($user->isUserIsDisabled()) ? 'checked' : ' ';?> <?php echo $isDisabled; ?>/>
|
||||
name="disabled" <?php echo $user->isUserIsDisabled() ? 'checked' : ' '; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label"><?php echo _('Deshabilitado'); ?></span>
|
||||
</label>
|
||||
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="changepass"
|
||||
title="<?php echo _('Forzar cambio de clave'); ?>">
|
||||
<input type="checkbox" id="changepass" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="changepass" <?php echo ($user->isUserIsChangePass()) ? 'checked' : ' ';?> <?php echo $isDisabled; ?>/>
|
||||
name="changepass" <?php echo $user->isUserIsChangePass() ? 'checked' : ' '; ?> <?php echo $isDisabled; ?>/>
|
||||
<span class="mdl-switch__label"><?php echo _('Cambio de Clave'); ?></span>
|
||||
</label>
|
||||
</td>
|
||||
@@ -196,7 +204,6 @@
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if (!$isView): ?>
|
||||
<input type="hidden" name="activeTab" value="<?php echo $activeTab ?>"/>
|
||||
<input type="hidden" name="isLdap" value="<?php echo $user->isUserIsLdap() ? 1 : 0; ?>"/>
|
||||
<input type="hidden" name="itemId" value="<?php echo $user->getUserId(); ?>"/>
|
||||
<input type="hidden" name="actionId" value="<?php echo $actionId; ?>"/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div id="fancyContainer" align="center">
|
||||
<h2 class="midround"><?php echo _('Cambio de Clave'); ?></h2>
|
||||
|
||||
<form method="post" name="updUsrPass" id="frmUpdUsrPass" class="form-action" data-onsubmit="appMgmt/save">
|
||||
<form method="post" name="updUsrPass" id="frmUpdUsrPass" class="form-action" data-onsubmit="user/password">
|
||||
<table class="fancydata">
|
||||
|
||||
<tr>
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
<?php
|
||||
/** @var \SP\DataModel\CategoryData $category */
|
||||
/** @var \SP\Core\ThemeIconsBase $icons */
|
||||
/** @var \SP\Core\UI\ThemeIconsBase $icons */
|
||||
?>
|
||||
<div id="fancyContainer" align="center">
|
||||
<h2 class="midround"><?php echo $header; ?></h2>
|
||||
|
||||
<form method="post" name="frmCategories" id="frmCategories" class="form-action" data-onsubmit="appMgmt/save">
|
||||
<form method="post" name="frmCategories" id="frmCategories" class="form-action"
|
||||
data-onsubmit="appMgmt/save"
|
||||
data-activetab="<?php echo isset($activeTab) ? $activeTab : ''; ?>"
|
||||
data-nextaction-id="<?php echo \SP\Core\ActionsInterface::ACTION_MGM_CATEGORIES; ?>">
|
||||
<table class="fancydata">
|
||||
<tbody>
|
||||
<tr>
|
||||
@@ -38,7 +41,6 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<input type="hidden" name="activeTab" value="<?php echo $activeTab ?>"/>
|
||||
<input type="hidden" name="itemId" value="<?php echo $category->getCategoryId(); ?>"/>
|
||||
<input type="hidden" name="actionId" value="<?php echo $actionId; ?>"/>
|
||||
<input type="hidden" name="sk" value="">
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
<div id="fancyContainer" align="center">
|
||||
<h2 class="midround"><?php echo $header; ?></H2>
|
||||
|
||||
<form method="post" name="frmCustomers" id="frmCustomers" class="form-action" data-onsubmit="appMgmt/save">
|
||||
<form method="post" name="frmCustomers" id="frmCustomers" class="form-action"
|
||||
data-onsubmit="appMgmt/save"
|
||||
data-activetab="<?php echo isset($activeTab) ? $activeTab : ''; ?>"
|
||||
data-nextaction-id="<?php echo \SP\Core\ActionsInterface::ACTION_MGM_CUSTOMERS; ?>">
|
||||
<table class="fancydata">
|
||||
<tbody>
|
||||
<tr>
|
||||
@@ -43,10 +46,9 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<input type="hidden" name="activeTab" value="<?php echo $activeTab ?>"/>
|
||||
<input type="hidden" name="itemId" value="<?php echo $customer->getCustomerId(); ?>"/>
|
||||
<input type="hidden" name="actionId" value="<?php echo $actionId; ?>"/>
|
||||
<input type="hidden" name="sk" value="<?php echo $sk; ?>">
|
||||
<input type="hidden" name="sk" value="">
|
||||
<input type="hidden" name="isAjax" value="1">
|
||||
</form>
|
||||
<div id="resCheck"><span id="resFancyAccion"></span></div>
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
<div id="fancyContainer" align="center">
|
||||
<h2 class="midround"><?php echo $header; ?></H2>
|
||||
|
||||
<form method="post" name="frmCustomFields" id="frmCustomFields" class="form-action" data-onsubmit="appMgmt/save">
|
||||
<form method="post" name="frmCustomFields" id="frmCustomFields" class="form-action"
|
||||
data-onsubmit="appMgmt/save"
|
||||
data-activetab="<?php echo isset($activeTab) ? $activeTab : ''; ?>"
|
||||
data-nextaction-id="<?php echo \SP\Core\ActionsInterface::ACTION_MGM_CUSTOMFIELDS; ?>">
|
||||
<table class="fancydata">
|
||||
<tbody>
|
||||
<tr>
|
||||
@@ -62,7 +65,7 @@
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="required">
|
||||
<input type="checkbox" id="required" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="required"
|
||||
<?php echo ($field->isRequired()) ? 'checked' : ''; ?>/>
|
||||
<?php echo $field->isRequired() ? 'checked' : ''; ?>/>
|
||||
<span class="mdl-switch__label"></span>
|
||||
</label>
|
||||
</td>
|
||||
@@ -70,10 +73,9 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<input type="hidden" name="activeTab" value="<?php echo $activeTab ?>"/>
|
||||
<input type="hidden" name="itemId" value="<?php echo $field->getId(); ?>"/>
|
||||
<input type="hidden" name="actionId" value="<?php echo $actionId; ?>"/>
|
||||
<input type="hidden" name="sk" value="<?php echo $sk; ?>">
|
||||
<input type="hidden" name="sk" value="">
|
||||
<input type="hidden" name="isAjax" value="1">
|
||||
</form>
|
||||
<div id="resCheck"><span id="resFancyAccion"></span></div>
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
<?php
|
||||
/** @var $tag \SP\DataModel\TagData */
|
||||
/** @var $icons \SP\Core\ThemeIconsBase */
|
||||
/** @var $icons \SP\Core\UI\ThemeIconsBase */
|
||||
?>
|
||||
<div id="fancyContainer" align="center">
|
||||
<h2 class="midround"><?php echo $header; ?></h2>
|
||||
|
||||
<form method="post" name="frmTags" id="frmTags" class="form-action" data-onsubmit="appMgmt/save">
|
||||
<form method="post" name="frmTags" id="frmTags" class="form-action"
|
||||
data-onsubmit="appMgmt/save"
|
||||
data-activetab="<?php echo isset($activeTab) ? $activeTab : ''; ?>"
|
||||
data-nextaction-id="<?php echo \SP\Core\ActionsInterface::ACTION_MGM_TAGS; ?>">
|
||||
<table class="fancydata">
|
||||
<tbody>
|
||||
<tr>
|
||||
@@ -23,10 +26,9 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<input type="hidden" name="activeTab" value="<?php echo $activeTab ?>"/>
|
||||
<input type="hidden" name="itemId" value="<?php echo $tag->getTagId(); ?>"/>
|
||||
<input type="hidden" name="actionId" value="<?php echo $actionId; ?>"/>
|
||||
<input type="hidden" name="sk" value="<?php echo $sk; ?>">
|
||||
<input type="hidden" name="sk" value="">
|
||||
<input type="hidden" name="isAjax" value="1">
|
||||
</form>
|
||||
<div id="resCheck"><span id="resFancyAccion"></span></div>
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
<ul>
|
||||
<?php foreach ($data->getData()->getDataRowSources() as $rowSrc): ?>
|
||||
<li class="cell-data" style="width: <?php echo $data->getHeader()->getWidth(); ?>%;">
|
||||
<?php echo (!is_null($dataItem->$rowSrc)) ? $dataItem->$rowSrc : ' '; // Fix height ?>
|
||||
<?php echo (null !== $dataItem->{$rowSrc}) ? $dataItem->{$rowSrc} : ' '; // Fix height ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php if (count($data->getData()->getDataRowSourcesWithIcon()) > 0): ?>
|
||||
<li class="cell-nodata" style="width: <?php echo $data->getHeader()->getWidth(); ?>%;">
|
||||
<?php foreach ($data->getData()->getDataRowSourcesWithIcon() as $rowSrcIcon): ?>
|
||||
<?php if ($dataItem->$rowSrcIcon[0] == 1): ?>
|
||||
<?php if ($dataItem->{$rowSrcIcon[0]} == 1): ?>
|
||||
<i class="material-icons <?php echo $rowSrcIcon[1]->getClass(); ?>" title="<?php echo $rowSrcIcon[1]->getTitle(); ?>">
|
||||
<?php echo $rowSrcIcon[1]->getIcon(); ?>
|
||||
</i>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
console.info("DOMContentLoaded");
|
||||
<?php if ($loggedIn): ?>
|
||||
sysPassApp.triggers().views.main();
|
||||
<?php elseif ($isInstalled === false): ?>
|
||||
<?php elseif ($isInstalled === 0): ?>
|
||||
sysPassApp.triggers().views.install();
|
||||
<?php endif; ?>
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div id="actions" class="installer" align="center">
|
||||
<div id="logo">
|
||||
<div id="pageDesc">
|
||||
<h1><?php echo _('Instalación ') , ' ' , $appVersion; ?></h1>
|
||||
<h1><?php echo _('Instalación '), ' ', $appVersion; ?></h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -23,125 +23,146 @@
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($isCompleted === false): ?>
|
||||
<form id="frmInstall" action="index.php" method="post" class="form-action" data-onsubmit="main/install">
|
||||
<input type="hidden" name="install" value="true"/>
|
||||
<form id="frmInstall" method="post" class="form-action" data-onsubmit="main/install">
|
||||
<input type="hidden" name="install" value="true"/>
|
||||
<input type="hidden" name="isAjax" value="1"/>
|
||||
|
||||
<fieldset id="adminaccount">
|
||||
<legend><?php echo _('Crear cuenta de admin de sysPass'); ?></legend>
|
||||
<fieldset id="adminaccount">
|
||||
<legend><?php echo _('Crear cuenta de admin de sysPass'); ?></legend>
|
||||
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="adminlogin" name="adminlogin" type="text" required
|
||||
class="mdl-textfield__input mdl-color-text--indigo-400"
|
||||
value="<?php echo $InstallData->getAdminLogin(); ?>" maxlength="80" autocomplete="off" autofocus>
|
||||
<label class="mdl-textfield__label"
|
||||
for="adminlogin"><?php echo _('Usuario administrador de sysPass'); ?></label>
|
||||
</div>
|
||||
|
||||
<div id="help-login" class="icon material-icons <?php echo $icons->getIconHelp()->getClass(); ?>"><?php echo $icons->getIconHelp()->getIcon(); ?></div>
|
||||
<div class="mdl-tooltip" for="help-login">
|
||||
<?php echo _('Login del usuario administrador de sysPass'); ?>
|
||||
</div>
|
||||
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="adminpass" name="adminpass" type="password" required
|
||||
class="mdl-textfield__input mdl-color-text--indigo-400 passwordfield__input"
|
||||
value="" maxlength="255" autocomplete="off">
|
||||
<label class="mdl-textfield__label"
|
||||
for="adminlogin"><?php echo _('Clave'); ?></label>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="masterpwd">
|
||||
<legend><?php echo _('Clave Maestra'); ?></legend>
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="masterpassword" name="masterpassword" type="password" required
|
||||
class="mdl-textfield__input mdl-color-text--indigo-400 passwordfield__input"
|
||||
value="" maxlength="255" autocomplete="off">
|
||||
<label class="mdl-textfield__label"
|
||||
for="masterpassword"><?php echo _('Clave Maestra'); ?></label>
|
||||
</div>
|
||||
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="masterpasswordR" name="masterpasswordr" type="password" required
|
||||
class="mdl-textfield__input mdl-color-text--indigo-400"
|
||||
value="" maxlength="255" autocomplete="off">
|
||||
<label class="mdl-textfield__label"
|
||||
for="masterpasswordR"><?php echo _('Clave (repetir)'); ?></label>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id='databaseField'>
|
||||
<legend><?php echo _('Configurar BBDD') . " (MySQL)"; ?></legend>
|
||||
|
||||
<input type='hidden' id='hasMySQL' value='true'/>
|
||||
<input type="hidden" id="dbtype" name="dbtype" value="mysql"/>
|
||||
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="dbuser" name="dbuser" type="text" required class="mdl-textfield__input mdl-color-text--indigo-400"
|
||||
value="<?php echo $InstallData->getDbAdminUser(); ?>" autocomplete="off" autofocus>
|
||||
<label class="mdl-textfield__label"
|
||||
for="dbuser"><?php echo _('Usuario acceso BBDD'); ?></label>
|
||||
</div>
|
||||
|
||||
<div id="help-dblogin" class="icon material-icons <?php echo $icons->getIconHelp()->getClass(); ?>"><?php echo $icons->getIconHelp()->getIcon(); ?></div>
|
||||
<div class="mdl-tooltip" for="help-dblogin">
|
||||
<?php echo _('Usuario con permisos de administrador de MySQL'); ?>
|
||||
</div>
|
||||
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="dbpass" name="dbpass" type="password" required
|
||||
class="mdl-textfield__input mdl-color-text--indigo-400 passwordfield__input-show"
|
||||
value="" autocomplete="off" autofocus>
|
||||
<label class="mdl-textfield__label"
|
||||
for="dbpass"><?php echo _('Clave acceso BBDD'); ?></label>
|
||||
</div>
|
||||
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="dbname" name="dbname" type="text" required class="mdl-textfield__input mdl-color-text--indigo-400"
|
||||
value="<?php echo $InstallData->getDbName(); ?>" autocomplete="off" autofocus pattern="[0-9a-zA-Z$_-]+">
|
||||
<label class="mdl-textfield__label"
|
||||
for="dbuser"><?php echo _('Nombre BBDD para sysPass'); ?></label>
|
||||
</div>
|
||||
|
||||
<div id="help-dbname" class="icon material-icons <?php echo $icons->getIconHelp()->getClass(); ?>"><?php echo $icons->getIconHelp()->getIcon(); ?></div>
|
||||
<div class="mdl-tooltip" for="help-dbname">
|
||||
<?php echo _('Nombre de la base de datos para sysPass'); ?>
|
||||
</div>
|
||||
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="dbhost" name="dbhost" type="text" required class="mdl-textfield__input mdl-color-text--indigo-400"
|
||||
value="<?php echo $InstallData->getDbHost(); ?>" autocomplete="off" autofocus pattern="[0-9a-zA-Z._-]+|([0-9]{1,3}.)+">
|
||||
<label class="mdl-textfield__label"
|
||||
for="dbhost"><?php echo _('Servidor BBDD para sysPass'); ?></label>
|
||||
</div>
|
||||
|
||||
<div id="help-dbhost" class="icon material-icons <?php echo $icons->getIconHelp()->getClass(); ?>"><?php echo $icons->getIconHelp()->getIcon(); ?></div>
|
||||
<div class="mdl-tooltip" for="help-dbhost">
|
||||
<?php echo _('Nombre del servidor para instalar la base de datos de sysPass'); ?>
|
||||
</div>
|
||||
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="hostingmode">
|
||||
<input type="checkbox" id="hostingmode" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="hostingmode" <?php echo ($InstallData->isHostingMode()) ? 'checked' : ''; ?>/>
|
||||
<span class="mdl-switch__label"><?php echo _('Modo Hosting'); ?>
|
||||
|
||||
<div id="help-hostingmode" class="icon material-icons <?php echo $icons->getIconHelp()->getClass(); ?>"><?php echo $icons->getIconHelp()->getIcon(); ?></div>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<div class="mdl-tooltip" for="help-hostingmode">
|
||||
<?php echo _('No crea ni verifica los permisos del usuario sobre la BBDD'); ?>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<div class="buttons">
|
||||
<button class="mdl-button mdl-js-button mdl-button--raised mdl-button--accent">
|
||||
<?php echo _('Instalar'); ?>
|
||||
<i class="material-icons" title="<?php echo _('Instalar'); ?>"><?php echo $icons->getIconPlay()->getIcon(); ?></i>
|
||||
</button>
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="adminlogin" name="adminlogin" type="text" required
|
||||
class="mdl-textfield__input mdl-color-text--indigo-400"
|
||||
value="admin" maxlength="80" autocomplete="off"
|
||||
autofocus>
|
||||
<label class="mdl-textfield__label"
|
||||
for="adminlogin"><?php echo _('Usuario administrador de sysPass'); ?></label>
|
||||
</div>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
|
||||
<div id="help-login"
|
||||
class="icon material-icons <?php echo $icons->getIconHelp()->getClass(); ?>">
|
||||
<?php echo $icons->getIconHelp()->getIcon(); ?>
|
||||
</div>
|
||||
<div class="mdl-tooltip" for="help-login">
|
||||
<?php echo _('Login del usuario administrador de sysPass'); ?>
|
||||
</div>
|
||||
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="adminpass" name="adminpass" type="password" required
|
||||
class="mdl-textfield__input mdl-color-text--indigo-400 passwordfield__input"
|
||||
value="" maxlength="255" autocomplete="off">
|
||||
<label class="mdl-textfield__label"
|
||||
for="adminlogin"><?php echo _('Clave'); ?></label>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="masterpwd">
|
||||
<legend><?php echo _('Clave Maestra'); ?></legend>
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="masterpassword" name="masterpassword" type="password" required
|
||||
class="mdl-textfield__input mdl-color-text--indigo-400 passwordfield__input"
|
||||
value="" maxlength="255" autocomplete="off">
|
||||
<label class="mdl-textfield__label"
|
||||
for="masterpassword"><?php echo _('Clave Maestra'); ?></label>
|
||||
</div>
|
||||
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="masterpasswordR" name="masterpasswordr" type="password" required
|
||||
class="mdl-textfield__input mdl-color-text--indigo-400"
|
||||
value="" maxlength="255" autocomplete="off">
|
||||
<label class="mdl-textfield__label"
|
||||
for="masterpasswordR"><?php echo _('Clave (repetir)'); ?></label>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id='databaseField'>
|
||||
<legend><?php echo _('Configurar BBDD') . " (MySQL)"; ?></legend>
|
||||
|
||||
<input type='hidden' id='hasMySQL' value='true'/>
|
||||
<input type="hidden" id="dbtype" name="dbtype" value="mysql"/>
|
||||
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="dbuser" name="dbuser" type="text" required
|
||||
class="mdl-textfield__input mdl-color-text--indigo-400"
|
||||
value="root" autocomplete="off" autofocus>
|
||||
<label class="mdl-textfield__label"
|
||||
for="dbuser"><?php echo _('Usuario acceso BBDD'); ?></label>
|
||||
</div>
|
||||
|
||||
<div id="help-dblogin"
|
||||
class="icon material-icons <?php echo $icons->getIconHelp()->getClass(); ?>">
|
||||
<?php echo $icons->getIconHelp()->getIcon(); ?>
|
||||
</div>
|
||||
<div class="mdl-tooltip" for="help-dblogin">
|
||||
<?php echo _('Usuario con permisos de administrador de MySQL'); ?>
|
||||
</div>
|
||||
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="dbpass" name="dbpass" type="password" required
|
||||
class="mdl-textfield__input mdl-color-text--indigo-400 passwordfield__input-show"
|
||||
value="" autocomplete="off" autofocus>
|
||||
<label class="mdl-textfield__label"
|
||||
for="dbpass"><?php echo _('Clave acceso BBDD'); ?></label>
|
||||
</div>
|
||||
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="dbname" name="dbname" type="text" required
|
||||
class="mdl-textfield__input mdl-color-text--indigo-400"
|
||||
value="syspass" autocomplete="off" autofocus
|
||||
pattern="[0-9a-zA-Z$_-]+">
|
||||
<label class="mdl-textfield__label"
|
||||
for="dbuser"><?php echo _('Nombre BBDD para sysPass'); ?></label>
|
||||
</div>
|
||||
|
||||
<div id="help-dbname"
|
||||
class="icon material-icons <?php echo $icons->getIconHelp()->getClass(); ?>">
|
||||
<?php echo $icons->getIconHelp()->getIcon(); ?>
|
||||
</div>
|
||||
<div class="mdl-tooltip" for="help-dbname">
|
||||
<?php echo _('Nombre de la base de datos para sysPass'); ?>
|
||||
</div>
|
||||
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input id="dbhost" name="dbhost" type="text" required
|
||||
class="mdl-textfield__input mdl-color-text--indigo-400"
|
||||
value="localhost" autocomplete="off" autofocus
|
||||
pattern="[0-9a-zA-Z._-]+|([0-9]{1,3}.)+">
|
||||
<label class="mdl-textfield__label"
|
||||
for="dbhost"><?php echo _('Servidor BBDD para sysPass'); ?></label>
|
||||
</div>
|
||||
|
||||
<div id="help-dbhost"
|
||||
class="icon material-icons <?php echo $icons->getIconHelp()->getClass(); ?>">
|
||||
<?php echo $icons->getIconHelp()->getIcon(); ?>
|
||||
</div>
|
||||
<div class="mdl-tooltip" for="help-dbhost">
|
||||
<?php echo _('Nombre del servidor para instalar la base de datos de sysPass'); ?>
|
||||
</div>
|
||||
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="hostingmode">
|
||||
<input type="checkbox" id="hostingmode" class="mdl-switch__input mdl-color-text--indigo-400"
|
||||
name="hostingmode"/>
|
||||
<span class="mdl-switch__label"><?php echo _('Modo Hosting'); ?>
|
||||
|
||||
<div id="help-hostingmode"
|
||||
class="icon material-icons <?php echo $icons->getIconHelp()->getClass(); ?>">
|
||||
<?php echo $icons->getIconHelp()->getIcon(); ?>
|
||||
</div>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<div class="mdl-tooltip" for="help-hostingmode">
|
||||
<?php echo _('No crea ni verifica los permisos del usuario sobre la BBDD'); ?>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<div class="buttons">
|
||||
<button class="mdl-button mdl-js-button mdl-button--raised mdl-button--accent" type="submit">
|
||||
<?php echo _('Instalar'); ?>
|
||||
<i class="material-icons"
|
||||
title="<?php echo _('Instalar'); ?>"><?php echo $icons->getIconPlay()->getIcon(); ?></i>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -23,12 +23,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
use SP\Controller\MainController;
|
||||
|
||||
define('APP_ROOT', '.');
|
||||
|
||||
require APP_ROOT . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'Base.php';
|
||||
|
||||
if (!\SP\Core\Init::checkPostLoginActions()) {
|
||||
$controller = new \SP\Controller\MainController(null, 'main');
|
||||
$controller->getMain();
|
||||
$controller->view();
|
||||
$Controller = new MainController(null, 'main');
|
||||
$Controller->getMain();
|
||||
$Controller->view();
|
||||
}
|
||||
532
js/alertify.js
Normal file
532
js/alertify.js
Normal file
@@ -0,0 +1,532 @@
|
||||
(function() {
|
||||
|
||||
"use strict";
|
||||
|
||||
var TRANSITION_FALLBACK_DURATION = 500;
|
||||
var hideElement = function(el) {
|
||||
|
||||
if (! el) {
|
||||
return;
|
||||
}
|
||||
|
||||
var removeThis = function() {
|
||||
if (el && el.parentNode) {
|
||||
el.parentNode.removeChild(el);
|
||||
}
|
||||
};
|
||||
|
||||
el.classList.remove("show");
|
||||
el.classList.add("hide");
|
||||
el.addEventListener("transitionend", removeThis);
|
||||
|
||||
// Fallback for no transitions.
|
||||
setTimeout(removeThis, TRANSITION_FALLBACK_DURATION);
|
||||
|
||||
};
|
||||
|
||||
function Alertify() {
|
||||
|
||||
/**
|
||||
* Alertify private object
|
||||
* @type {Object}
|
||||
*/
|
||||
var _alertify = {
|
||||
|
||||
parent: document.body,
|
||||
version: "1.0.11",
|
||||
defaultOkLabel: "Ok",
|
||||
okLabel: "Ok",
|
||||
defaultCancelLabel: "Cancel",
|
||||
cancelLabel: "Cancel",
|
||||
defaultMaxLogItems: 2,
|
||||
maxLogItems: 2,
|
||||
promptValue: "",
|
||||
promptPlaceholder: "",
|
||||
closeLogOnClick: false,
|
||||
closeLogOnClickDefault: false,
|
||||
delay: 5000,
|
||||
defaultDelay: 5000,
|
||||
logContainerClass: "alertify-logs",
|
||||
logContainerDefaultClass: "alertify-logs",
|
||||
dialogs: {
|
||||
buttons: {
|
||||
holder: "<nav>{{buttons}}</nav>",
|
||||
ok: "<button class='ok' tabindex='1'>{{ok}}</button>",
|
||||
cancel: "<button class='cancel' tabindex='2'>{{cancel}}</button>"
|
||||
},
|
||||
input: "<input type='text'>",
|
||||
message: "<p class='msg'>{{message}}</p>",
|
||||
log: "<div class='{{class}}'>{{message}}</div>"
|
||||
},
|
||||
|
||||
defaultDialogs: {
|
||||
buttons: {
|
||||
holder: "<nav>{{buttons}}</nav>",
|
||||
ok: "<button class='ok' tabindex='1'>{{ok}}</button>",
|
||||
cancel: "<button class='cancel' tabindex='2'>{{cancel}}</button>"
|
||||
},
|
||||
input: "<input type='text'>",
|
||||
message: "<p class='msg'>{{message}}</p>",
|
||||
log: "<div class='{{class}}'>{{message}}</div>"
|
||||
},
|
||||
|
||||
/**
|
||||
* Build the proper message box
|
||||
*
|
||||
* @param {Object} item Current object in the queue
|
||||
*
|
||||
* @return {String} An HTML string of the message box
|
||||
*/
|
||||
build: function(item) {
|
||||
|
||||
var btnTxt = this.dialogs.buttons.ok;
|
||||
var html = "<div class='dialog'>" + "<div>" + this.dialogs.message.replace("{{message}}", item.message);
|
||||
|
||||
if(item.type === "confirm" || item.type === "prompt") {
|
||||
btnTxt = this.dialogs.buttons.cancel + this.dialogs.buttons.ok;
|
||||
}
|
||||
|
||||
if (item.type === "prompt") {
|
||||
html += this.dialogs.input;
|
||||
}
|
||||
|
||||
html = (html + this.dialogs.buttons.holder + "</div>" + "</div>")
|
||||
.replace("{{buttons}}", btnTxt)
|
||||
.replace("{{ok}}", this.okLabel)
|
||||
.replace("{{cancel}}", this.cancelLabel);
|
||||
|
||||
return html;
|
||||
|
||||
},
|
||||
|
||||
setCloseLogOnClick: function(bool) {
|
||||
this.closeLogOnClick = !! bool;
|
||||
},
|
||||
|
||||
/**
|
||||
* Close the log messages
|
||||
*
|
||||
* @param {Object} elem HTML Element of log message to close
|
||||
* @param {Number} wait [optional] Time (in ms) to wait before automatically hiding the message, if 0 never hide
|
||||
*
|
||||
* @return {undefined}
|
||||
*/
|
||||
close: function(elem, wait) {
|
||||
|
||||
if (this.closeLogOnClick) {
|
||||
elem.addEventListener("click", function() {
|
||||
hideElement(elem);
|
||||
});
|
||||
}
|
||||
|
||||
wait = wait && !isNaN(+wait) ? +wait : this.delay;
|
||||
|
||||
if (wait < 0) {
|
||||
hideElement(elem);
|
||||
} else if(wait > 0) {
|
||||
setTimeout(function() {
|
||||
hideElement(elem);
|
||||
}, wait);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Create a dialog box
|
||||
*
|
||||
* @param {String} message The message passed from the callee
|
||||
* @param {String} type Type of dialog to create
|
||||
* @param {Function} onOkay [Optional] Callback function when clicked okay.
|
||||
* @param {Function} onCancel [Optional] Callback function when cancelled.
|
||||
*
|
||||
* @return {Object}
|
||||
*/
|
||||
dialog: function(message, type, onOkay, onCancel) {
|
||||
return this.setup({
|
||||
type: type,
|
||||
message: message,
|
||||
onOkay: onOkay,
|
||||
onCancel: onCancel
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Show a new log message box
|
||||
*
|
||||
* @param {String} message The message passed from the callee
|
||||
* @param {String} type [Optional] Optional type of log message
|
||||
* @param {Number} wait [Optional] Time (in ms) to wait before auto-hiding the log
|
||||
*
|
||||
* @return {Object}
|
||||
*/
|
||||
log: function(message, type, click) {
|
||||
|
||||
var existing = document.querySelectorAll(".alertify-logs > div");
|
||||
if (existing) {
|
||||
var diff = existing.length - this.maxLogItems;
|
||||
if (diff >= 0) {
|
||||
for (var i = 0, _i = diff + 1; i < _i; i++) {
|
||||
this.close(existing[i], -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.notify(message, type, click);
|
||||
},
|
||||
|
||||
setLogPosition: function(str) {
|
||||
this.logContainerClass = "alertify-logs " + str;
|
||||
},
|
||||
|
||||
setupLogContainer: function() {
|
||||
|
||||
var elLog = document.querySelector(".alertify-logs");
|
||||
var className = this.logContainerClass;
|
||||
if (! elLog) {
|
||||
elLog = document.createElement("div");
|
||||
elLog.className = className;
|
||||
this.parent.appendChild(elLog);
|
||||
}
|
||||
|
||||
// Make sure it's positioned properly.
|
||||
if (elLog.className !== className) {
|
||||
elLog.className = className;
|
||||
}
|
||||
|
||||
return elLog;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Add new log message
|
||||
* If a type is passed, a class name "{type}" will get added.
|
||||
* This allows for custom look and feel for various types of notifications.
|
||||
*
|
||||
* @param {String} message The message passed from the callee
|
||||
* @param {String} type [Optional] Type of log message
|
||||
* @param {Number} wait [Optional] Time (in ms) to wait before auto-hiding
|
||||
*
|
||||
* @return {undefined}
|
||||
*/
|
||||
notify: function(message, type, click) {
|
||||
|
||||
var elLog = this.setupLogContainer();
|
||||
var log = document.createElement("div");
|
||||
|
||||
log.className = (type || "default");
|
||||
if (_alertify.logTemplateMethod) {
|
||||
log.innerHTML = _alertify.logTemplateMethod(message);
|
||||
} else {
|
||||
log.innerHTML = message;
|
||||
}
|
||||
|
||||
// Add the click handler, if specified.
|
||||
if ("function" === typeof click) {
|
||||
log.addEventListener("click", click);
|
||||
}
|
||||
|
||||
elLog.appendChild(log);
|
||||
setTimeout(function() {
|
||||
log.className += " show";
|
||||
}, 10);
|
||||
|
||||
this.close(log, this.delay);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Initiate all the required pieces for the dialog box
|
||||
*
|
||||
* @return {undefined}
|
||||
*/
|
||||
setup: function(item) {
|
||||
|
||||
var el = document.createElement("div");
|
||||
el.className = "alertify hide";
|
||||
el.innerHTML = this.build(item);
|
||||
|
||||
var btnOK = el.querySelector(".ok");
|
||||
var btnCancel = el.querySelector(".cancel");
|
||||
var input = el.querySelector("input");
|
||||
var label = el.querySelector("label");
|
||||
|
||||
// Set default value/placeholder of input
|
||||
if (input) {
|
||||
if (typeof this.promptPlaceholder === "string") {
|
||||
// Set the label, if available, for MDL, etc.
|
||||
if (label) {
|
||||
label.textContent = this.promptPlaceholder;
|
||||
} else {
|
||||
input.placeholder = this.promptPlaceholder;
|
||||
}
|
||||
}
|
||||
if (typeof this.promptValue === "string") {
|
||||
input.value = this.promptValue;
|
||||
}
|
||||
}
|
||||
|
||||
function setupHandlers(resolve) {
|
||||
if ("function" !== typeof resolve) {
|
||||
// promises are not available so resolve is a no-op
|
||||
resolve = function () {};
|
||||
}
|
||||
|
||||
if (btnOK) {
|
||||
btnOK.addEventListener("click", function(ev) {
|
||||
if (item.onOkay && "function" === typeof item.onOkay) {
|
||||
if (input) {
|
||||
item.onOkay(input.value, ev);
|
||||
} else {
|
||||
item.onOkay(ev);
|
||||
}
|
||||
}
|
||||
|
||||
if (input) {
|
||||
resolve({
|
||||
buttonClicked: "ok",
|
||||
inputValue: input.value,
|
||||
event: ev
|
||||
});
|
||||
} else {
|
||||
resolve({
|
||||
buttonClicked: "ok",
|
||||
event: ev
|
||||
});
|
||||
}
|
||||
|
||||
hideElement(el);
|
||||
});
|
||||
}
|
||||
|
||||
if (btnCancel) {
|
||||
btnCancel.addEventListener("click", function(ev) {
|
||||
if (item.onCancel && "function" === typeof item.onCancel) {
|
||||
item.onCancel(ev);
|
||||
}
|
||||
|
||||
resolve({
|
||||
buttonClicked: "cancel",
|
||||
event: ev
|
||||
});
|
||||
|
||||
hideElement(el);
|
||||
});
|
||||
}
|
||||
|
||||
if (input) {
|
||||
input.addEventListener("keyup", function(ev) {
|
||||
if (ev.which === 13) {
|
||||
btnOK.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var promise;
|
||||
|
||||
if (typeof Promise === "function") {
|
||||
promise = new Promise(setupHandlers);
|
||||
} else {
|
||||
setupHandlers();
|
||||
}
|
||||
|
||||
this.parent.appendChild(el);
|
||||
setTimeout(function() {
|
||||
el.classList.remove("hide");
|
||||
if(input && item.type && item.type === "prompt") {
|
||||
input.select();
|
||||
input.focus();
|
||||
} else {
|
||||
if (btnOK) {
|
||||
btnOK.focus();
|
||||
}
|
||||
}
|
||||
}, 100);
|
||||
|
||||
return promise;
|
||||
},
|
||||
|
||||
okBtn: function(label) {
|
||||
this.okLabel = label;
|
||||
return this;
|
||||
},
|
||||
|
||||
setDelay: function(time) {
|
||||
time = time || 0;
|
||||
this.delay = isNaN(time) ? this.defaultDelay : parseInt(time, 10);
|
||||
return this;
|
||||
},
|
||||
|
||||
cancelBtn: function(str) {
|
||||
this.cancelLabel = str;
|
||||
return this;
|
||||
},
|
||||
|
||||
setMaxLogItems: function(num) {
|
||||
this.maxLogItems = parseInt(num || this.defaultMaxLogItems);
|
||||
},
|
||||
|
||||
theme: function(themeStr) {
|
||||
switch(themeStr.toLowerCase()) {
|
||||
case "bootstrap":
|
||||
this.dialogs.buttons.ok = "<button class='ok btn btn-primary' tabindex='1'>{{ok}}</button>";
|
||||
this.dialogs.buttons.cancel = "<button class='cancel btn btn-default' tabindex='2'>{{cancel}}</button>";
|
||||
this.dialogs.input = "<input type='text' class='form-control'>";
|
||||
break;
|
||||
case "purecss":
|
||||
this.dialogs.buttons.ok = "<button class='ok pure-button' tabindex='1'>{{ok}}</button>";
|
||||
this.dialogs.buttons.cancel = "<button class='cancel pure-button' tabindex='2'>{{cancel}}</button>";
|
||||
break;
|
||||
case "mdl":
|
||||
case "material-design-light":
|
||||
this.dialogs.buttons.ok = "<button class='ok mdl-button mdl-js-button mdl-js-ripple-effect' tabindex='1'>{{ok}}</button>";
|
||||
this.dialogs.buttons.cancel = "<button class='cancel mdl-button mdl-js-button mdl-js-ripple-effect' tabindex='2'>{{cancel}}</button>";
|
||||
this.dialogs.input = "<div class='mdl-textfield mdl-js-textfield'><input class='mdl-textfield__input'><label class='md-textfield__label'></label></div>";
|
||||
break;
|
||||
case "angular-material":
|
||||
this.dialogs.buttons.ok = "<button class='ok md-primary md-button' tabindex='1'>{{ok}}</button>";
|
||||
this.dialogs.buttons.cancel = "<button class='cancel md-button' tabindex='2'>{{cancel}}</button>";
|
||||
this.dialogs.input = "<div layout='column'><md-input-container md-no-float><input type='text'></md-input-container></div>";
|
||||
break;
|
||||
case "default":
|
||||
default:
|
||||
this.dialogs.buttons.ok = this.defaultDialogs.buttons.ok;
|
||||
this.dialogs.buttons.cancel = this.defaultDialogs.buttons.cancel;
|
||||
this.dialogs.input = this.defaultDialogs.input;
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
reset: function() {
|
||||
this.parent = document.body;
|
||||
this.theme("default");
|
||||
this.okBtn(this.defaultOkLabel);
|
||||
this.cancelBtn(this.defaultCancelLabel);
|
||||
this.setMaxLogItems();
|
||||
this.promptValue = "";
|
||||
this.promptPlaceholder = "";
|
||||
this.delay = this.defaultDelay;
|
||||
this.setCloseLogOnClick(this.closeLogOnClickDefault);
|
||||
this.setLogPosition("bottom left");
|
||||
this.logTemplateMethod = null;
|
||||
},
|
||||
|
||||
injectCSS: function() {
|
||||
if (!document.querySelector("#alertifyCSS")) {
|
||||
var head = document.getElementsByTagName("head")[0];
|
||||
var css = document.createElement("style");
|
||||
css.type = "text/css";
|
||||
css.id = "alertifyCSS";
|
||||
css.innerHTML = "/* style.css */";
|
||||
head.insertBefore(css, head.firstChild);
|
||||
}
|
||||
},
|
||||
|
||||
removeCSS: function() {
|
||||
var css = document.querySelector("#alertifyCSS");
|
||||
if (css && css.parentNode) {
|
||||
css.parentNode.removeChild(css);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
_alertify.injectCSS();
|
||||
|
||||
return {
|
||||
_$$alertify: _alertify,
|
||||
parent: function(elem) {
|
||||
_alertify.parent = elem;
|
||||
},
|
||||
reset: function() {
|
||||
_alertify.reset();
|
||||
return this;
|
||||
},
|
||||
alert: function(message, onOkay, onCancel) {
|
||||
return _alertify.dialog(message, "alert", onOkay, onCancel) || this;
|
||||
},
|
||||
confirm: function(message, onOkay, onCancel) {
|
||||
return _alertify.dialog(message, "confirm", onOkay, onCancel) || this;
|
||||
},
|
||||
prompt: function(message, onOkay, onCancel) {
|
||||
return _alertify.dialog(message, "prompt", onOkay, onCancel) || this;
|
||||
},
|
||||
log: function(message, click) {
|
||||
_alertify.log(message, "default", click);
|
||||
return this;
|
||||
},
|
||||
theme: function(themeStr) {
|
||||
_alertify.theme(themeStr);
|
||||
return this;
|
||||
},
|
||||
success: function(message, click) {
|
||||
_alertify.log(message, "success", click);
|
||||
return this;
|
||||
},
|
||||
error: function(message, click) {
|
||||
_alertify.log(message, "error", click);
|
||||
return this;
|
||||
},
|
||||
cancelBtn: function(label) {
|
||||
_alertify.cancelBtn(label);
|
||||
return this;
|
||||
},
|
||||
okBtn: function(label) {
|
||||
_alertify.okBtn(label);
|
||||
return this;
|
||||
},
|
||||
delay: function(time) {
|
||||
_alertify.setDelay(time);
|
||||
return this;
|
||||
},
|
||||
placeholder: function(str) {
|
||||
_alertify.promptPlaceholder = str;
|
||||
return this;
|
||||
},
|
||||
defaultValue: function(str) {
|
||||
_alertify.promptValue = str;
|
||||
return this;
|
||||
},
|
||||
maxLogItems: function(num) {
|
||||
_alertify.setMaxLogItems(num);
|
||||
return this;
|
||||
},
|
||||
closeLogOnClick: function(bool) {
|
||||
_alertify.setCloseLogOnClick(!! bool);
|
||||
return this;
|
||||
},
|
||||
logPosition: function(str) {
|
||||
_alertify.setLogPosition(str || "");
|
||||
return this;
|
||||
},
|
||||
setLogTemplate: function(templateMethod) {
|
||||
_alertify.logTemplateMethod = templateMethod;
|
||||
return this;
|
||||
},
|
||||
clearLogs: function() {
|
||||
_alertify.setupLogContainer().innerHTML = "";
|
||||
return this;
|
||||
},
|
||||
version: _alertify.version
|
||||
};
|
||||
}
|
||||
|
||||
// AMD, window, and NPM support
|
||||
if ("undefined" !== typeof module && !! module && !! module.exports) {
|
||||
// Preserve backwards compatibility
|
||||
module.exports = function() {
|
||||
return new Alertify();
|
||||
};
|
||||
var obj = new Alertify();
|
||||
for (var key in obj) {
|
||||
module.exports[key] = obj[key];
|
||||
}
|
||||
} else if (typeof define === "function" && define.amd) {
|
||||
define(function() {
|
||||
return new Alertify();
|
||||
});
|
||||
} else {
|
||||
window.alertify = new Alertify();
|
||||
}
|
||||
|
||||
}());
|
||||
16
js/alertify.min.js
vendored
16
js/alertify.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -58,6 +58,8 @@ sysPass.Actions = function (Common) {
|
||||
* @param $obj
|
||||
*/
|
||||
var updateItems = function ($obj) {
|
||||
log.info("updateItems");
|
||||
|
||||
var $dst = $("#" + $obj.data("item-dst"))[0].selectize;
|
||||
|
||||
$dst.clearOptions();
|
||||
@@ -132,12 +134,15 @@ sysPass.Actions = function (Common) {
|
||||
var main = {
|
||||
logout: function () {
|
||||
var search = window.location.search;
|
||||
var url = "";
|
||||
|
||||
if (search.length > 0) {
|
||||
window.location.replace("index.php" + search + "&logout=1");
|
||||
url = "index.php" + search + "&logout=1";
|
||||
} else {
|
||||
window.location.replace("index.php?logout=1");
|
||||
url = "index.php?logout=1";
|
||||
}
|
||||
|
||||
Common.redirect(url);
|
||||
},
|
||||
login: function ($obj) {
|
||||
log.info("main:login");
|
||||
@@ -149,7 +154,7 @@ sysPass.Actions = function (Common) {
|
||||
Common.appRequests().getActionCall(opts, function (json) {
|
||||
switch (json.status) {
|
||||
case 0:
|
||||
window.location.replace(json.data.url);
|
||||
Common.redirect(json.data.url);
|
||||
break;
|
||||
case 2:
|
||||
Common.resMsg("error", json.description);
|
||||
@@ -167,6 +172,23 @@ sysPass.Actions = function (Common) {
|
||||
$obj.find("input:first").focus();
|
||||
}
|
||||
});
|
||||
},
|
||||
install: function ($obj) {
|
||||
log.info("main:install");
|
||||
|
||||
var opts = Common.appRequests().getRequestOpts();
|
||||
opts.url = "/ajax/ajax_install.php";
|
||||
opts.data = $obj.serialize();
|
||||
|
||||
Common.appRequests().getActionCall(opts, function (json) {
|
||||
Common.jsonResponseMessage(json);
|
||||
|
||||
if (json.status == 0) {
|
||||
setTimeout(function () {
|
||||
Common.redirect("index.php");
|
||||
}, 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -679,6 +701,7 @@ sysPass.Actions = function (Common) {
|
||||
opts.data = {
|
||||
itemId: $obj.data("item-id"),
|
||||
actionId: $obj.data("action-id"),
|
||||
activeTab: $obj.data("activetab"),
|
||||
sk: Common.sk.get(),
|
||||
isAjax: 1
|
||||
};
|
||||
@@ -687,7 +710,7 @@ sysPass.Actions = function (Common) {
|
||||
$.fancybox(response, {
|
||||
padding: [0, 10, 10, 10],
|
||||
afterClose: function () {
|
||||
if ($obj.data("action-dst")) {
|
||||
if ($obj.data("item-dst")) {
|
||||
updateItems($obj);
|
||||
}
|
||||
},
|
||||
@@ -738,8 +761,12 @@ sysPass.Actions = function (Common) {
|
||||
Common.appRequests().getActionCall(opts, function (json) {
|
||||
Common.jsonResponseMessage(json);
|
||||
|
||||
if ($obj.data("nextaction-id")) {
|
||||
doAction({actionId: $obj.data("nextaction-id"), itemId: $obj.data("activetab")});
|
||||
if (json.status === 0) {
|
||||
if ($obj.data("nextaction-id") && $obj.data("activetab")) {
|
||||
doAction({actionId: $obj.data("nextaction-id"), itemId: $obj.data("activetab")});
|
||||
}
|
||||
|
||||
$.fancybox.close();
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -785,28 +812,6 @@ sysPass.Actions = function (Common) {
|
||||
});
|
||||
|
||||
return false;
|
||||
},
|
||||
userpass: function ($obj) {
|
||||
log.info("appMgmt:userpass");
|
||||
|
||||
var opts = Common.appRequests().getRequestOpts();
|
||||
opts.type = "html";
|
||||
opts.method = "get";
|
||||
opts.url = "/ajax/ajax_usrpass.php";
|
||||
opts.data = {
|
||||
actionId: $obj.data("action-id"),
|
||||
userId: $obj.data("item-id"),
|
||||
sk: $obj.data("sk"),
|
||||
isAjax: 1
|
||||
};
|
||||
|
||||
Common.appRequests().getActionCall(opts, function (response) {
|
||||
if (response.length === 0) {
|
||||
main.logout();
|
||||
} else {
|
||||
$.fancybox(response, {padding: 0});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
44
js/app-actions.min.js
vendored
44
js/app-actions.min.js
vendored
@@ -1,29 +1,29 @@
|
||||
var $jscomp={scope:{},findInternal:function(c,d,f){c instanceof String&&(c=String(c));for(var e=c.length,h=0;h<e;h++){var k=c[h];if(d.call(f,k,h,c))return{i:h,v:k}}return{i:-1,v:void 0}}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(c,d,f){if(f.get||f.set)throw new TypeError("ES3 does not support getters and setters.");c!=Array.prototype&&c!=Object.prototype&&(c[d]=f.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,f,e){if(d){f=$jscomp.global;c=c.split(".");for(e=0;e<c.length-1;e++){var h=c[e];h in f||(f[h]={});f=f[h]}c=c[c.length-1];e=f[c];d=d(e);d!=e&&null!=d&&$jscomp.defineProperty(f,c,{configurable:!0,writable:!0,value:d})}};
|
||||
$jscomp.polyfill("Array.prototype.find",function(c){return c?c:function(c,f){return $jscomp.findInternal(this,c,f).v}},"es6-impl","es3");
|
||||
sysPass.Actions=function(c){var d=c.log,f,e=function(a){a={actionId:a.actionId,itemId:"undefined"!==typeof a.itemId?a.itemId:0,isAjax:1};var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_getContent.php";b.type="html";b.addHistory=!0;b.data=a;c.appRequests().getActionCall(b,function(a){$("#content").html(a);c.setContentSize()})},h=function(a){var b=$("#"+a.data("item-dst"))[0].selectize;b.clearOptions();b.load(function(b){var g=c.appRequests().getRequestOpts();g.url="/ajax/ajax_getItems.php";
|
||||
g.method="get";g.data={sk:c.sk.get(),itemType:a.data("item-type")};c.appRequests().getActionCall(g,function(a){b(a.items)})})},k={logout:function(){var a=window.location.search;0<a.length?window.location.replace("index.php"+a+"&logout=1"):window.location.replace("index.php?logout=1")},login:function(a){d.info("main:login");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_doLogin.php";b.data=a.serialize();c.appRequests().getActionCall(b,function(b){switch(b.status){case 0:window.location.replace(b.data.url);
|
||||
break;case 2:c.resMsg("error",b.description);a.find("input[type='text'],input[type='password']").val("");a.find("input:first").focus();$("#mpass").prop("disabled",!1);$("#smpass").val("").show();break;default:c.resMsg("error",b.description),a.find("input[type='text'],input[type='password']").val(""),a.find("input:first").focus()}})}},l={show:function(a){d.info("account:show");e({actionId:a.data("action-id"),itemId:a.data("item-id")})},showHistory:function(a){d.info("account:showHistory");e({actionId:a["action-id"],
|
||||
itemId:a["item-id"]})},edit:function(a){d.info("account:edit");e({actionId:a.data("action-id"),itemId:a.data("item-id")})},"delete":function(a){d.info("account:delete");var b='<div id="alert"><p id="alert-text">'+c.config().LANG[3]+"</p></div>";alertify.okBtn(c.config().LANG[43]).cancelBtn(c.config().LANG[44]).confirm(b,function(b){b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_accountSave.php";b.data={accountid:a.data("item-id"),actionId:a.data("action-id"),sk:c.sk.get()};c.appRequests().getActionCall(b,
|
||||
function(a){c.jsonResponseMessage(a)})},function(a){a.preventDefault();alertify.error(c.config().LANG[44])})},showpass:function(a){d.info("account:showpass");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_accViewPass.php";b.data={accountid:a.data("item-id"),isHistory:a.data("history"),isAjax:1};c.appRequests().getActionCall(b,function(a){if(10===a.status)doLogout();else{var b;$("<div></div>").dialog({modal:!0,title:c.config().LANG[47],width:"auto",open:function(){b=$(this);var g,d="";g=
|
||||
'<button class="dialog-clip-user-button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary" data-clipboard-target=".dialog-user-text"><span class="ui-button-icon-primary ui-icon ui-icon-clipboard"></span><span class="ui-button-text">'+c.config().LANG[33]+"</span></button>";var e='<button class="dialog-clip-pass-button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary" data-clipboard-target=".dialog-pass-text"><span class="ui-button-icon-primary ui-icon ui-icon-clipboard"></span><span class="ui-button-text">'+
|
||||
sysPass.Actions=function(c){var d=c.log,f,e=function(a){a={actionId:a.actionId,itemId:"undefined"!==typeof a.itemId?a.itemId:0,isAjax:1};var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_getContent.php";b.type="html";b.addHistory=!0;b.data=a;c.appRequests().getActionCall(b,function(a){$("#content").html(a);c.setContentSize()})},h=function(a){d.info("updateItems");var b=$("#"+a.data("item-dst"))[0].selectize;b.clearOptions();b.load(function(b){var g=c.appRequests().getRequestOpts();g.url="/ajax/ajax_getItems.php";
|
||||
g.method="get";g.data={sk:c.sk.get(),itemType:a.data("item-type")};c.appRequests().getActionCall(g,function(a){b(a.items)})})},k={logout:function(){var a=window.location.search;c.redirect(0<a.length?"index.php"+a+"&logout=1":"index.php?logout=1")},login:function(a){d.info("main:login");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_doLogin.php";b.data=a.serialize();c.appRequests().getActionCall(b,function(b){switch(b.status){case 0:c.redirect(b.data.url);break;case 2:c.resMsg("error",b.description);
|
||||
a.find("input[type='text'],input[type='password']").val("");a.find("input:first").focus();$("#mpass").prop("disabled",!1);$("#smpass").val("").show();break;default:c.resMsg("error",b.description),a.find("input[type='text'],input[type='password']").val(""),a.find("input:first").focus()}})},install:function(a){d.info("main:install");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_install.php";b.data=a.serialize();c.appRequests().getActionCall(b,function(a){c.jsonResponseMessage(a);0==a.status&&
|
||||
setTimeout(function(){c.redirect("index.php")},2E3)})}},l={show:function(a){d.info("account:show");e({actionId:a.data("action-id"),itemId:a.data("item-id")})},showHistory:function(a){d.info("account:showHistory");e({actionId:a["action-id"],itemId:a["item-id"]})},edit:function(a){d.info("account:edit");e({actionId:a.data("action-id"),itemId:a.data("item-id")})},"delete":function(a){d.info("account:delete");var b='<div id="alert"><p id="alert-text">'+c.config().LANG[3]+"</p></div>";alertify.okBtn(c.config().LANG[43]).cancelBtn(c.config().LANG[44]).confirm(b,
|
||||
function(b){b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_accountSave.php";b.data={accountid:a.data("item-id"),actionId:a.data("action-id"),sk:c.sk.get()};c.appRequests().getActionCall(b,function(a){c.jsonResponseMessage(a)})},function(a){a.preventDefault();alertify.error(c.config().LANG[44])})},showpass:function(a){d.info("account:showpass");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_accViewPass.php";b.data={accountid:a.data("item-id"),isHistory:a.data("history"),isAjax:1};c.appRequests().getActionCall(b,
|
||||
function(a){if(10===a.status)doLogout();else{var b;$("<div></div>").dialog({modal:!0,title:c.config().LANG[47],width:"auto",open:function(){b=$(this);var g,d="";g='<button class="dialog-clip-user-button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary" data-clipboard-target=".dialog-user-text"><span class="ui-button-icon-primary ui-icon ui-icon-clipboard"></span><span class="ui-button-text">'+c.config().LANG[33]+"</span></button>";var e='<button class="dialog-clip-pass-button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary" data-clipboard-target=".dialog-pass-text"><span class="ui-button-icon-primary ui-icon ui-icon-clipboard"></span><span class="ui-button-text">'+
|
||||
c.config().LANG[34]+"</span></button>",d=a.useimage,m='<p class="dialog-user-text">'+a.acclogin+"</p>";0===a.status?(0===d?d='<p class="dialog-pass-text">'+a.accpass+"</p>":(d='<img class="dialog-pass-text" src="data:image/png;base64,'+a.accpass+'" />',e=""),g=m+d+'<div class="dialog-buttons">'+g+e+"</div>"):(g='<span class="altTxtRed">'+a.description+"</span>",b.dialog("option","buttons",[{text:"Ok",icons:{primary:"ui-icon-close"},click:function(){b.dialog("close")}}]));b.html(g);b.dialog("option",
|
||||
"position","center");b.parent().on("mouseleave",function(){clearTimeout(f);f=setTimeout(function(){b.dialog("close")},3E4)})},close:function(){clearTimeout(f);b.dialog("destroy")}})}})},copypass:function(a){d.info("account:copypass");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_accViewPass.php";b.async=!1;b.data={accountid:a.data("item-id"),isHistory:a.data("history"),isAjax:1};return c.appRequests().getActionCall(b)},copy:function(a){d.info("account:copy");e({actionId:a.data("action-id"),
|
||||
itemId:a.data("item-id")})},savefavorite:function(a,b){d.info("account:saveFavorite");var g="on"===a.data("status"),e={actionId:g?a.data("action-id-off"):a.data("action-id-on"),accountId:a.data("item-id"),sk:c.sk.get(),isAjax:1},f=c.appRequests().getRequestOpts();f.url="/ajax/ajax_accFavorites.php";f.data=e;c.appRequests().getActionCall(f,function(d){0===d.status?(a.data("status",g?"off":"on"),"function"===typeof b&&b(),c.resMsg("ok",d.description)):1===d.status&&c.resMsg("error",d.description)})},
|
||||
request:function(a){d.info("account:request");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_sendRequest.php";b.data=a.serialize();c.appRequests().getActionCall(b,function(a){c.jsonResponseMessage(a)})},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"));
|
||||
l.search()},editpass:function(a){d.info("account:editpass");e({actionId:a.data("action-id"),itemId:a.data("item-id")})},restore:function(a){d.info("account:restore");e({actionId:a.data("action-id"),itemId:a.data("item-id")})},getfiles:function(a){d.info("account:getfiles");var b=c.appRequests().getRequestOpts();b.method="get";b.type="html";b.url="/ajax/ajax_accGetFiles.php";b.data={id:a.data("item-id"),del:a.data("delete"),sk:c.sk.get()};c.appRequests().getActionCall(b,function(b){a.html(b)})},search:function(a){d.info("account:search");
|
||||
request:function(a){d.info("account:request");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_sendRequest.php";b.data=a.serialize();c.appRequests().getActionCall(b,function(a){c.jsonResponseMessage(a)})},menu:function(a){a.hide();a.parent().children(".actions-optional").show(250)},sort:function(a){d.info("account:sort");var c=$("#frmSearch");c.find('input[name="skey"]').val(a.data("key"));c.find('input[name="sorder"]').val(a.data("dir"));c.find('input[name="start"]').val(a.data("start"));
|
||||
l.search()},editpass:function(a){d.info("account:editpass");e({actionId:a.data("action-id"),itemId:a.data("item-id")})},restore:function(a){d.info("account:restore");e({actionId:a.data("action-id"),itemId:a.data("item-id")})},getfiles:function(a){d.info("account:getfiles");var b=c.appRequests().getRequestOpts();b.method="get";b.type="html";b.url="/ajax/ajax_accGetFiles.php";b.data={id:a.data("item-id"),del:a.data("delete"),sk:c.sk.get()};c.appRequests().getActionCall(b,function(c){a.html(c)})},search:function(a){d.info("account:search");
|
||||
var b=$("#frmSearch");!0===a&&(b.find("select").each(function(){$(this)[0].selectize.clear()}),b.find('input[name="search"]').val(""),b.find('input[name="start"], input[name="skey"], input[name="sorder"]').val(0),b.find('input[name="searchfav"]').val(0).change());a=c.appRequests().getRequestOpts();a.url="/ajax/ajax_accSearch.php";a.data=b.serialize();c.appRequests().getActionCall(a,function(a){"undefined"!==typeof a.sk&&(c.sk.set(a.sk),b.find('input[name="sk"]').val(a.sk));$("#res-content").html(a.html)})},
|
||||
save:function(a){d.info("account:save");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_accSave.php";b.data=a.serialize();c.appRequests().getActionCall(b,function(a){c.jsonResponseMessage(a)})}};return{doAction:e,appMgmt:{show:function(a){d.info("appMgmt:show");var b=c.appRequests().getRequestOpts();b.type="html";b.url="/ajax/ajax_appMgmtData.php";b.data={itemId:a.data("item-id"),actionId:a.data("action-id"),sk:c.sk.get(),isAjax:1};c.appRequests().getActionCall(b,function(b){$.fancybox(b,
|
||||
{padding:[0,10,10,10],afterClose:function(){a.data("action-dst")&&h(a)},beforeShow:function(){c.appTriggers().views.common("#fancyContainer")}})})},"delete":function(a){d.info("appMgmt:delete");var b='<div id="alert"><p id="alert-text">'+c.config().LANG[12]+"</p></div>";alertify.okBtn(c.config().LANG[43]).cancelBtn(c.config().LANG[44]).confirm(b,function(b){b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_appMgmtSave.php";b.data={itemId:a.data("item-id"),actionId:a.data("action-id"),sk:c.sk.get(),
|
||||
isAjax:1};c.appRequests().getActionCall(b,function(b){c.jsonResponseMessage(b);a.data("nextaction-id")&&e({actionId:a.data("nextaction-id"),itemId:a.data("activetab")})})},function(a){a.preventDefault();alertify.error(c.config().LANG[44])})},save:function(a){d.info("appMgmt:save");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_appMgmtSave.php";b.data=a.serialize();c.appRequests().getActionCall(b,function(b){c.jsonResponseMessage(b);a.data("nextaction-id")&&e({actionId:a.data("nextaction-id"),
|
||||
itemId:a.data("activetab")})})},search:function(a){d.info("appMgmt:search");var b=$(a),g=b.find("[name=target]").val();a=c.appRequests().getRequestOpts();a.url="/ajax/ajax_appMgmtSearch.php";a.data=b.serialize();c.appRequests().getActionCall(a,function(a){0===a.status?($("#"+g).html(a.html),b.find("[name='sk']").val(a.sk)):$("#"+g).html(c.resMsg("nofancyerror",a.description))});return!1},nav:function(a){d.info("appMgmt:nav");var b=$("#"+a.data("action-form")),g=c.appRequests().getRequestOpts();g.url=
|
||||
"/ajax/ajax_appMgmtSearch.php";g.data=b.serialize()+"&start="+a.data("start")+"&count="+a.data("count");c.getActionCall(g,function(a){var g=$("#"+b.find("[name=target]").val());0===a.status?(g.html(a.html),b.find("[name='sk']").val(a.sk)):g.html(c.resMsg("nofancyerror",a.description))});return!1},userpass:function(a){d.info("appMgmt:userpass");var b=c.appRequests().getRequestOpts();b.type="html";b.method="get";b.url="/ajax/ajax_usrpass.php";b.data={actionId:a.data("action-id"),userId:a.data("item-id"),
|
||||
sk:a.data("sk"),isAjax:1};c.appRequests().getActionCall(b,function(a){0===a.length?k.logout():$.fancybox(a,{padding:0})})}},account:l,file:{view:function(a){d.info("file:view");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_files.php";b.type="html";b.data={fileId:a.data("item-id"),sk:c.sk.get(),actionId:a.data("action-id")};c.appRequests().getActionCall(b,function(a){"undefined"!==typeof a.status&&1===a.status?c.resMsg("error",a.description):a?($.fancybox(a,{padding:[10,10,10,10]}),setTimeout(function(){$.fancybox.update()},
|
||||
1E3)):c.resMsg("error",c.config().LANG[14])})},download:function(a){d.info("file:download");a={fileId:a.data("item-id"),sk:c.sk.get(),actionId:a.data("action-id")};$.fileDownload(c.config().APP_ROOT+"/ajax/ajax_files.php",{httpMethod:"POST",data:a})},"delete":function(a){d.info("file:delete");var b='<div id="alert"><p id="alert-text">'+c.config().LANG[15]+"</p></div>";alertify.okBtn(c.config().LANG[43]).cancelBtn(c.config().LANG[44]).confirm(b,function(b){b=c.appRequests().getRequestOpts();b.url=
|
||||
"/ajax/ajax_files.php";b.data={fileId:a.data("item-id"),actionId:a.data("action-id"),sk:c.sk.get()};c.appRequests().getActionCall(b,function(a){if(0===a.status){var b=$("#list-account-files");l.getfiles(b);c.resMsg("ok",a.description)}else c.resMsg("error",a.description)})},function(a){a.preventDefault();alertify.error(c.config().LANG[44])})}},checks:{ldap:function(a){d.info("checks:ldap");a=$(a.data("src"));var b=a.find("[name='ldap_bindpass']").val();a={type:"ldap",ldap_server:a.find("[name='ldap_server']").val(),
|
||||
ldap_base:a.find("[name='ldap_base']").val(),ldap_group:a.find("[name='ldap_group']").val(),ldap_binduser:a.find("[name='ldap_binduser']").val(),ldap_bindpass:""!==c.config().PK?c.config().crypt.encrypt(b):b,sk:c.sk.get(),isAjax:1};b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_checkConnection.php";b.data=a;c.appRequests().getActionCall(b,function(a){c.jsonResponseMessage(a)})},wiki:function(a){d.info("checks:wiki");a=$(a.data("src"));a={type:"dokuwiki",dokuwiki_url:a.find("[name='dokuwiki_url']").val(),
|
||||
dokuwiki_user:a.find("[name='dokuwiki_user']").val(),dokuwiki_pass:a.find("[name='dokuwiki_pass']").val(),isAjax:1,sk:c.sk.get()};var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_checkConnection.php";b.data=a;c.appRequests().getActionCall(b,function(a){1===a.status?c.resMsg("error",a.description):0===a.status&&(c.resMsg("ok",a.description),$("#dokuWikiResCheck").html(a.data))})}},config:{save:function(a){d.info("config:save");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_configSave.php";
|
||||
b.data=a.serialize();c.appRequests().getActionCall(b,function(b){c.jsonResponseMessage(b);0===b.status&&"undefined"!==typeof a.data("nextaction-id")&&e({actionId:a.data("nextaction-id"),itemId:a.data("activetab")})})},backup:function(a){d.info("config:backup");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_export.php";b.data=a.serialize();c.appRequests().getActionCall(b,function(b){c.jsonResponseMessage(b);0===b.status&&"undefined"!==typeof a.data("nextaction-id")&&e({actionId:a.data("nextaction-id"),
|
||||
itemId:a.data("activetab")})})},"export":function(a){d.info("config:export");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_export.php";b.data=a.serialize();c.appRequests().getActionCall(b,function(b){c.jsonResponseMessage(b);0===b.status&&"undefined"!==typeof a.data("nextaction-id")&&e({actionId:a.data("nextaction-id"),itemId:a.data("activetab")})})},"import":function(a){d.info("config:import");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_import.php";b.data=a.serialize();c.appRequests().getActionCall(b,
|
||||
function(b){c.jsonResponseMessage(b);0===b.status&&"undefined"!==typeof a.data("nextaction-id")&&e({actionId:a.data("nextaction-id"),itemId:a.data("activetab")})})}},main:k,user:{savePreferences:function(a){d.info("user:savePreferences");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_userPrefsSave.php";b.data=a.serialize();c.appRequests().getActionCall(b,function(a){c.jsonResponseMessage(a);setTimeout(function(){window.location.replace("index.php")},2E3)})},saveSecurity:function(a){d.info("user:saveSecurity");
|
||||
var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_userPrefsSave.php";b.data=a.serialize();c.appRequests().getActionCall(b,function(a){c.jsonResponseMessage(a)})},password:function(a){d.info("user:password");var b=c.appRequests().getRequestOpts();b.type="html";b.method="get";b.url="/ajax/ajax_usrpass.php";b.data={actionId:a.data("action-id"),userId:a.data("item-id"),sk:a.data("sk"),isAjax:1};c.appRequests().getActionCall(b,function(a){0===a.length?k.logout():$.fancybox(a,{padding:0})})}}}};
|
||||
save:function(a){d.info("account:save");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_accSave.php";b.data=a.serialize();c.appRequests().getActionCall(b,function(a){c.jsonResponseMessage(a)})}};return{doAction:e,appMgmt:{show:function(a){d.info("appMgmt:show");var b=c.appRequests().getRequestOpts();b.type="html";b.url="/ajax/ajax_appMgmtData.php";b.data={itemId:a.data("item-id"),actionId:a.data("action-id"),activeTab:a.data("activetab"),sk:c.sk.get(),isAjax:1};c.appRequests().getActionCall(b,
|
||||
function(b){$.fancybox(b,{padding:[0,10,10,10],afterClose:function(){a.data("item-dst")&&h(a)},beforeShow:function(){c.appTriggers().views.common("#fancyContainer")}})})},"delete":function(a){d.info("appMgmt:delete");var b='<div id="alert"><p id="alert-text">'+c.config().LANG[12]+"</p></div>";alertify.okBtn(c.config().LANG[43]).cancelBtn(c.config().LANG[44]).confirm(b,function(b){b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_appMgmtSave.php";b.data={itemId:a.data("item-id"),actionId:a.data("action-id"),
|
||||
sk:c.sk.get(),isAjax:1};c.appRequests().getActionCall(b,function(b){c.jsonResponseMessage(b);a.data("nextaction-id")&&e({actionId:a.data("nextaction-id"),itemId:a.data("activetab")})})},function(a){a.preventDefault();alertify.error(c.config().LANG[44])})},save:function(a){d.info("appMgmt:save");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_appMgmtSave.php";b.data=a.serialize();c.appRequests().getActionCall(b,function(b){c.jsonResponseMessage(b);0===b.status&&(a.data("nextaction-id")&&a.data("activetab")&&
|
||||
e({actionId:a.data("nextaction-id"),itemId:a.data("activetab")}),$.fancybox.close())})},search:function(a){d.info("appMgmt:search");var b=$(a),g=b.find("[name=target]").val();a=c.appRequests().getRequestOpts();a.url="/ajax/ajax_appMgmtSearch.php";a.data=b.serialize();c.appRequests().getActionCall(a,function(a){0===a.status?($("#"+g).html(a.html),b.find("[name='sk']").val(a.sk)):$("#"+g).html(c.resMsg("nofancyerror",a.description))});return!1},nav:function(a){d.info("appMgmt:nav");var b=$("#"+a.data("action-form")),
|
||||
g=c.appRequests().getRequestOpts();g.url="/ajax/ajax_appMgmtSearch.php";g.data=b.serialize()+"&start="+a.data("start")+"&count="+a.data("count");c.getActionCall(g,function(a){var g=$("#"+b.find("[name=target]").val());0===a.status?(g.html(a.html),b.find("[name='sk']").val(a.sk)):g.html(c.resMsg("nofancyerror",a.description))});return!1}},account:l,file:{view:function(a){d.info("file:view");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_files.php";b.type="html";b.data={fileId:a.data("item-id"),
|
||||
sk:c.sk.get(),actionId:a.data("action-id")};c.appRequests().getActionCall(b,function(a){"undefined"!==typeof a.status&&1===a.status?c.resMsg("error",a.description):a?($.fancybox(a,{padding:[10,10,10,10]}),setTimeout(function(){$.fancybox.update()},1E3)):c.resMsg("error",c.config().LANG[14])})},download:function(a){d.info("file:download");a={fileId:a.data("item-id"),sk:c.sk.get(),actionId:a.data("action-id")};$.fileDownload(c.config().APP_ROOT+"/ajax/ajax_files.php",{httpMethod:"POST",data:a})},"delete":function(a){d.info("file:delete");
|
||||
var b='<div id="alert"><p id="alert-text">'+c.config().LANG[15]+"</p></div>";alertify.okBtn(c.config().LANG[43]).cancelBtn(c.config().LANG[44]).confirm(b,function(b){b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_files.php";b.data={fileId:a.data("item-id"),actionId:a.data("action-id"),sk:c.sk.get()};c.appRequests().getActionCall(b,function(a){if(0===a.status){var b=$("#list-account-files");l.getfiles(b);c.resMsg("ok",a.description)}else c.resMsg("error",a.description)})},function(a){a.preventDefault();
|
||||
alertify.error(c.config().LANG[44])})}},checks:{ldap:function(a){d.info("checks:ldap");a=$(a.data("src"));var b=a.find("[name='ldap_bindpass']").val();a={type:"ldap",ldap_server:a.find("[name='ldap_server']").val(),ldap_base:a.find("[name='ldap_base']").val(),ldap_group:a.find("[name='ldap_group']").val(),ldap_binduser:a.find("[name='ldap_binduser']").val(),ldap_bindpass:""!==c.config().PK?c.config().crypt.encrypt(b):b,sk:c.sk.get(),isAjax:1};b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_checkConnection.php";
|
||||
b.data=a;c.appRequests().getActionCall(b,function(a){c.jsonResponseMessage(a)})},wiki:function(a){d.info("checks:wiki");a=$(a.data("src"));a={type:"dokuwiki",dokuwiki_url:a.find("[name='dokuwiki_url']").val(),dokuwiki_user:a.find("[name='dokuwiki_user']").val(),dokuwiki_pass:a.find("[name='dokuwiki_pass']").val(),isAjax:1,sk:c.sk.get()};var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_checkConnection.php";b.data=a;c.appRequests().getActionCall(b,function(a){1===a.status?c.resMsg("error",a.description):
|
||||
0===a.status&&(c.resMsg("ok",a.description),$("#dokuWikiResCheck").html(a.data))})}},config:{save:function(a){d.info("config:save");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_configSave.php";b.data=a.serialize();c.appRequests().getActionCall(b,function(b){c.jsonResponseMessage(b);0===b.status&&"undefined"!==typeof a.data("nextaction-id")&&e({actionId:a.data("nextaction-id"),itemId:a.data("activetab")})})},backup:function(a){d.info("config:backup");var b=c.appRequests().getRequestOpts();
|
||||
b.url="/ajax/ajax_export.php";b.data=a.serialize();c.appRequests().getActionCall(b,function(b){c.jsonResponseMessage(b);0===b.status&&"undefined"!==typeof a.data("nextaction-id")&&e({actionId:a.data("nextaction-id"),itemId:a.data("activetab")})})},"export":function(a){d.info("config:export");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_export.php";b.data=a.serialize();c.appRequests().getActionCall(b,function(b){c.jsonResponseMessage(b);0===b.status&&"undefined"!==typeof a.data("nextaction-id")&&
|
||||
e({actionId:a.data("nextaction-id"),itemId:a.data("activetab")})})},"import":function(a){d.info("config:import");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_import.php";b.data=a.serialize();c.appRequests().getActionCall(b,function(b){c.jsonResponseMessage(b);0===b.status&&"undefined"!==typeof a.data("nextaction-id")&&e({actionId:a.data("nextaction-id"),itemId:a.data("activetab")})})}},main:k,user:{savePreferences:function(a){d.info("user:savePreferences");var b=c.appRequests().getRequestOpts();
|
||||
b.url="/ajax/ajax_userPrefsSave.php";b.data=a.serialize();c.appRequests().getActionCall(b,function(a){c.jsonResponseMessage(a);setTimeout(function(){window.location.replace("index.php")},2E3)})},saveSecurity:function(a){d.info("user:saveSecurity");var b=c.appRequests().getRequestOpts();b.url="/ajax/ajax_userPrefsSave.php";b.data=a.serialize();c.appRequests().getActionCall(b,function(a){c.jsonResponseMessage(a)})},password:function(a){d.info("user:password");var b=c.appRequests().getRequestOpts();
|
||||
b.type="html";b.method="get";b.url="/ajax/ajax_usrpass.php";b.data={actionId:a.data("action-id"),userId:a.data("item-id"),sk:a.data("sk"),isAjax:1};c.appRequests().getActionCall(b,function(a){0===a.length?k.logout():$.fancybox(a,{padding:0})})}}}};
|
||||
|
||||
@@ -106,33 +106,33 @@ sysPass.Main = function () {
|
||||
* Respuesta en formato json para mostrar mensaje
|
||||
*
|
||||
* @param json
|
||||
* @param callback
|
||||
*/
|
||||
var jsonResponseMessage = function (json) {
|
||||
var jsonResponseMessage = function (json, callback) {
|
||||
var status = json.status;
|
||||
var description = json.description;
|
||||
var action = json.action;
|
||||
// var action = json.action;
|
||||
|
||||
if (typeof json.messages !== "undefined" && json.messages.length > 0) {
|
||||
description = description + "<br>" + json.messages.join("<br>");
|
||||
}
|
||||
|
||||
//$.fancybox.close();
|
||||
var $alertify = alertify
|
||||
.logPosition("bottom right")
|
||||
.closeLogOnClick(true)
|
||||
.delay(10000);
|
||||
|
||||
switch (status) {
|
||||
case 0:
|
||||
$.fancybox.close();
|
||||
resMsg("ok", description, undefined, action);
|
||||
$alertify.success(description, callback);
|
||||
break;
|
||||
case 1:
|
||||
$.fancybox.close();
|
||||
$(":input[type='password']").val("");
|
||||
resMsg("error", description, undefined, action);
|
||||
break;
|
||||
case 2:
|
||||
resMsg("error", description, undefined, action);
|
||||
//$("#resFancyAccion").html('<span class="altTxtError">' + description + '</span>').show();
|
||||
$alertify.error(description, callback);
|
||||
break;
|
||||
case 3:
|
||||
$.fancybox.close();
|
||||
resMsg("warn", description, undefined, action);
|
||||
$alertify.warn(description, callback);
|
||||
break;
|
||||
case 10:
|
||||
appActions.main.logout();
|
||||
@@ -284,7 +284,7 @@ sysPass.Main = function () {
|
||||
};
|
||||
|
||||
var redirect = function (url) {
|
||||
location.href = url;
|
||||
window.location.replace(url);
|
||||
};
|
||||
|
||||
// Función para enviar una solicitud de modificación de cuenta
|
||||
|
||||
42
js/app-main.min.js
vendored
42
js/app-main.min.js
vendored
@@ -1,24 +1,24 @@
|
||||
var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,h,k){if(k.get||k.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[h]=k.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof 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,g,h){if(h.get||h.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[g]=h.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof 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 h=0;return $jscomp.iteratorPrototype(function(){return h<a.length?{done:!1,value:a[h++]}:{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,h){$jscomp.initSymbolIterator();a instanceof String&&(a+="");var k=0,e={next:function(){if(k<a.length){var l=k++;return{value:h(l,a[l]),done:!1}}e.next=function(){return{done:!0,value:void 0}};return e.next()}};e[Symbol.iterator]=function(){return e};return e};
|
||||
$jscomp.polyfill=function(a,h,k,e){if(h){k=$jscomp.global;a=a.split(".");for(e=0;e<a.length-1;e++){var l=a[e];l in k||(k[l]={});k=k[l]}a=a[a.length-1];e=k[a];h=h(e);h!=e&&null!=h&&$jscomp.defineProperty(k,a,{configurable:!0,writable:!0,value:h})}};$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,h,k){a instanceof String&&(a=String(a));for(var e=a.length,l=0;l<e;l++){var f=a[l];if(h.call(k,f,l,a))return{i:l,v:f}}return{i:-1,v:void 0}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,k){return $jscomp.findInternal(this,a,k).v}},"es6-impl","es3");
|
||||
sysPass.Main=function(){var a={APP_ROOT:"",LANG:[],PK:"",MAX_FILE_SIZE:1024,crypt:new JSEncrypt,CHECK_UPDATES:!1},h={passLength:0,minPasswordLength:8,complexity:{numbers:!0,symbols:!0,uppercase:!0,numlength:12}},k={},e={},l={},f={},t={},q={},m={log:function(b){console.log(b)},info:function(b){console.info(b)},error:function(b){console.error(b)},warn:function(b){console.warn(b)}},p=function(b){var a=b.status,c=b.description,g=b.action;"undefined"!==typeof b.messages&&0<b.messages.length&&(c=c+"<br>"+
|
||||
b.messages.join("<br>"));switch(a){case 0:$.fancybox.close();n("ok",c,void 0,g);break;case 1:$.fancybox.close();$(":input[type='password']").val("");n("error",c,void 0,g);break;case 2:n("error",c,void 0,g);break;case 3:$.fancybox.close();n("warn",c,void 0,g);break;case 10:l.main.logout()}},z=function(b){m.info("getEnvironment");var d=window.location.pathname.split("/"),c=window.location.protocol+"//"+window.location.host+function(){for(var b="",a=1;a<=d.length-2;a++)b+="/"+d[a];return b}(),g=f.getRequestOpts();
|
||||
g.url=c+"/ajax/ajax_getEnvironment.php";g.method="get";g.async=!1;g.data={isAjax:1};f.getActionCall(g,function(c){a.APP_ROOT=c.app_root;a.LANG=c.lang;a.PK=c.pk;a.CHECK_UPDATES=c.check_updates;a.crypt.setPublicKey(c.pk);"function"===typeof b&&b()})},v={get:function(){m.info("sk:get");return $("#content").attr("data-sk")},set:function(b){m.info("sk:set");$("#content").attr("data-sk",b)}},A=function(){var b=$("#container");if(!b.hasClass("content-no-auto-resize")){var a=$("#content").height()+200;b.css("height",
|
||||
a)}},w=function(){$("html, body").animate({scrollTop:0},"slow")},B=function(a,d){if("undefined"===typeof a)return!1;var b=f.getRequestOpts();b.url="/ajax/ajax_eventlog.php";b.type="html";b.data={start:a,current:d};f.getActionCall(b,function(a){$("#content").html(a);w()})},C=function(a){location.href=a},D=function(){var a=f.getRequestOpts();a.url="/ajax/ajax_sendRequest.php";a.data=$("#frmRequestModify").serialize();f.getActionCall(a,function(a){p(a)})},E=function(b){var d=function(){return{actionId:b.data("action-id"),
|
||||
itemId:b.data("item-id"),sk:v.get()}},c={requestDoneAction:"",requestData:function(a){d=function(){return a}},beforeSendAction:"",url:""},g=function(a){if("undefined"===typeof c.url||""===c.url)return!1;var b=new FormData;b.append("inFile",a);b.append("isAjax",1);var g=d();Object.keys(g).forEach(function(a){m.info(a);b.append(a,g[a])});a=f.getRequestOpts();a.url=c.url;a.processData=!1;a.contentType=!1;a.data=b;f.getActionCall(a,function(a){var b=a.status;a=a.description;0===b?("function"===typeof c.requestDoneAction&&
|
||||
c.requestDoneAction(),n("ok",a)):10===b?l.main.logout():n("error",a)})},r=function(c){if(5<c.length)n("error",a.LANG[17]+" (Max: 5)");else for(var d=0;d<c.length;d++){var f=c[d];if(f.size/1E3>a.MAX_FILE_SIZE)n("error",a.LANG[18]+"<br>"+f.name+" (Max: "+a.MAX_FILE_SIZE+")");else{var e;a:{e=f.name;for(var r=b.data("files-ext").toLowerCase().split(","),h=0;h<=r.length;h++)if(-1!==e.indexOf(r[h])){e=!0;break a}e=!1}e?g(c[d]):n("error",a.LANG[19]+"<br>"+f.name)}}},e=function(a){var b=$("#fileUploadForm");
|
||||
!1===a&&b.hide();a=b.find("input[type='file']");a.on("change",function(){"function"===typeof c.beforeSendAction&&c.beforeSendAction();r(this.files)});return a};window.File&&window.FileList&&window.FileReader?function(){m.info("fileUpload:init");var a=e(!1);b.on("dragover dragenter",function(a){m.info("fileUpload:drag");a.stopPropagation();a.preventDefault()});b.on("drop",function(a){m.info("fileUpload:drop");a.stopPropagation();a.preventDefault();"function"===typeof c.beforeSendAction&&c.beforeSendAction();
|
||||
r(a.dataTransfer.files)});b.on("click",function(){a.click()})}():e(!0);return c},F=function(a,d){var b=f.getRequestOpts();b.url=d;b.data=a;f.getActionCall(b,function(a){p(a)})},G=function(b,d,c){var g={itemId:b,actionId:d,sk:c,isAjax:1};alertify.okBtn(a.LANG[40]).cancelBtn(a.LANG[41]).confirm(a.LANG[48],function(a){$.extend(g,{notify:1});a=f.getRequestOpts();a.url="/ajax/ajax_appMgmtSave.php";a.data=g;f.getActionCall(a,function(a){p(a)})},function(a){a.preventDefault();a=f.getRequestOpts();a.url=
|
||||
"/ajax/ajax_appMgmtSave.php";a.data=g;f.getActionCall(a,function(a){p(a)})})},H=function(a,d,c){var b=$(a).attr("data-itemid"),e=$(a).attr("data-activetab");a=$(a).attr("data-nextactionid");d={itemId:b,actionId:d,sk:c,activeTab:e,onCloseAction:a};c=f.getRequestOpts();c.url="/ajax/ajax_appMgmtSave.php";c.data=d;f.getActionCall(c,function(a){p(a)})},x=function(){var a=f.getRequestOpts();a.type="html";a.method="get";a.timeout=1E4;a.url="/ajax/ajax_checkUpds.php";f.getActionCall(a,function(a){$("#updates").html(a);
|
||||
"undefined"!==typeof componentHandler&&componentHandler.upgradeDom()},function(){$("#updates").html("!")})},I=function(b){var d='<div id="alert"><p id="alert-text">'+a.LANG[20]+"</p></div>";alertify.okBtn(a.LANG[43]).cancelBtn(a.LANG[44]).confirm(d,function(a){a=f.getRequestOpts();a.url="/ajax/ajax_eventlog.php";a.data={clear:1,sk:b,isAjax:1};f.getActionCall(a,function(a){p(a)})},function(b){b.preventDefault();alertify.error(a.LANG[44])})},J=function(a,d){h.passLength=a.length;y(zxcvbn(a),d)},y=function(b,
|
||||
d){var c,g=b.score;c=$(".passLevel-"+d);c.show();c.removeClass("weak good strong strongest");0===h.passLength?c.attr("title","").empty():h.passLength<h.minPasswordLength?c.attr("title",a.LANG[11]).addClass("weak"):0===g?c.attr("title",a.LANG[9]+" - "+b.feedback.warning).addClass("weak"):1===g||2===g?c.attr("title",a.LANG[8]+" - "+b.feedback.warning).addClass("good"):3===g?c.attr("title",a.LANG[7]).addClass("strong"):4===g&&c.attr("title",a.LANG[10]).addClass("strongest")},n=function(b,d,c,g){if("undefined"!==
|
||||
typeof c){var e=f.getRequestOpts();e.type="get";e.method="html";e.url=c;e.async=!1;f.getActionCall(e,function(a){d=a})}d=d.replace(/(\\n|;;)/g,"<br>");switch(b){case "ok":alertify.closeLogOnClick(!0).delay(15E3).success(d);break;case "error":alertify.closeLogOnClick(!0).delay(15E3).error(d);break;case "warn":alertify.delay(3E4).log(d);break;case "nofancyerror":return b='<p class="error round">Oops...<br>'+a.LANG[1]+"<br>"+d+"</p>";default:alertify.error(d)}"undefined"!==typeof g&&eval(g)},K=function(b){$(b).find(".checkbox").button({icons:{primary:"ui-icon-transferthick-e-w"}}).click(function(){var b=
|
||||
$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 g=0;return $jscomp.iteratorPrototype(function(){return g<a.length?{done:!1,value:a[g++]}:{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,g){$jscomp.initSymbolIterator();a instanceof String&&(a+="");var h=0,f={next:function(){if(h<a.length){var k=h++;return{value:g(k,a[k]),done:!1}}f.next=function(){return{done:!0,value:void 0}};return f.next()}};f[Symbol.iterator]=function(){return f};return f};
|
||||
$jscomp.polyfill=function(a,g,h,f){if(g){h=$jscomp.global;a=a.split(".");for(f=0;f<a.length-1;f++){var k=a[f];k in h||(h[k]={});h=h[k]}a=a[a.length-1];f=h[a];g=g(f);g!=f&&null!=g&&$jscomp.defineProperty(h,a,{configurable:!0,writable:!0,value:g})}};$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,g,h){a instanceof String&&(a=String(a));for(var f=a.length,k=0;k<f;k++){var e=a[k];if(g.call(h,e,k,a))return{i:k,v:e}}return{i:-1,v:void 0}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,h){return $jscomp.findInternal(this,a,h).v}},"es6-impl","es3");
|
||||
sysPass.Main=function(){var a={APP_ROOT:"",LANG:[],PK:"",MAX_FILE_SIZE:1024,crypt:new JSEncrypt,CHECK_UPDATES:!1},g={passLength:0,minPasswordLength:8,complexity:{numbers:!0,symbols:!0,uppercase:!0,numlength:12}},h={},f={},k={},e={},t={},r={},m={log:function(b){console.log(b)},info:function(b){console.info(b)},error:function(b){console.error(b)},warn:function(b){console.warn(b)}},q=function(b,a){var c=b.status,d=b.description;"undefined"!==typeof b.messages&&0<b.messages.length&&(d=d+"<br>"+b.messages.join("<br>"));
|
||||
var n=alertify.logPosition("bottom right").closeLogOnClick(!0).delay(1E4);switch(c){case 0:n.success(d,a);break;case 1:case 2:n.error(d,a);break;case 3:n.warn(d,a);break;case 10:k.main.logout()}},z=function(b){m.info("getEnvironment");var d=window.location.pathname.split("/"),c=window.location.protocol+"//"+window.location.host+function(){for(var a="",b=1;b<=d.length-2;b++)a+="/"+d[b];return a}(),l=e.getRequestOpts();l.url=c+"/ajax/ajax_getEnvironment.php";l.method="get";l.async=!1;l.data={isAjax:1};
|
||||
e.getActionCall(l,function(c){a.APP_ROOT=c.app_root;a.LANG=c.lang;a.PK=c.pk;a.CHECK_UPDATES=c.check_updates;a.crypt.setPublicKey(c.pk);"function"===typeof b&&b()})},v={get:function(){m.info("sk:get");return $("#content").attr("data-sk")},set:function(a){m.info("sk:set");$("#content").attr("data-sk",a)}},A=function(){var a=$("#container");if(!a.hasClass("content-no-auto-resize")){var d=$("#content").height()+200;a.css("height",d)}},w=function(){$("html, body").animate({scrollTop:0},"slow")},B=function(a,
|
||||
d){if("undefined"===typeof a)return!1;var b=e.getRequestOpts();b.url="/ajax/ajax_eventlog.php";b.type="html";b.data={start:a,current:d};e.getActionCall(b,function(a){$("#content").html(a);w()})},C=function(a){window.location.replace(a)},D=function(){var a=e.getRequestOpts();a.url="/ajax/ajax_sendRequest.php";a.data=$("#frmRequestModify").serialize();e.getActionCall(a,function(a){q(a)})},E=function(b){var d=function(){return{actionId:b.data("action-id"),itemId:b.data("item-id"),sk:v.get()}},c={requestDoneAction:"",
|
||||
requestData:function(a){d=function(){return a}},beforeSendAction:"",url:""},l=function(a){if("undefined"===typeof c.url||""===c.url)return!1;var b=new FormData;b.append("inFile",a);b.append("isAjax",1);var l=d();Object.keys(l).forEach(function(a){m.info(a);b.append(a,l[a])});a=e.getRequestOpts();a.url=c.url;a.processData=!1;a.contentType=!1;a.data=b;e.getActionCall(a,function(a){var b=a.status;a=a.description;0===b?("function"===typeof c.requestDoneAction&&c.requestDoneAction(),p("ok",a)):10===b?
|
||||
k.main.logout():p("error",a)})},n=function(c){if(5<c.length)p("error",a.LANG[17]+" (Max: 5)");else for(var d=0;d<c.length;d++){var e=c[d];if(e.size/1E3>a.MAX_FILE_SIZE)p("error",a.LANG[18]+"<br>"+e.name+" (Max: "+a.MAX_FILE_SIZE+")");else{var n;a:{n=e.name;for(var f=b.data("files-ext").toLowerCase().split(","),g=0;g<=f.length;g++)if(-1!==n.indexOf(f[g])){n=!0;break a}n=!1}n?l(c[d]):p("error",a.LANG[19]+"<br>"+e.name)}}},f=function(a){var b=$("#fileUploadForm");!1===a&&b.hide();a=b.find("input[type='file']");
|
||||
a.on("change",function(){"function"===typeof c.beforeSendAction&&c.beforeSendAction();n(this.files)});return a};window.File&&window.FileList&&window.FileReader?function(){m.info("fileUpload:init");var a=f(!1);b.on("dragover dragenter",function(a){m.info("fileUpload:drag");a.stopPropagation();a.preventDefault()});b.on("drop",function(a){m.info("fileUpload:drop");a.stopPropagation();a.preventDefault();"function"===typeof c.beforeSendAction&&c.beforeSendAction();n(a.dataTransfer.files)});b.on("click",
|
||||
function(){a.click()})}():f(!0);return c},F=function(a,d){var b=e.getRequestOpts();b.url=d;b.data=a;e.getActionCall(b,function(a){q(a)})},G=function(b,d,c){var l={itemId:b,actionId:d,sk:c,isAjax:1};alertify.okBtn(a.LANG[40]).cancelBtn(a.LANG[41]).confirm(a.LANG[48],function(a){$.extend(l,{notify:1});a=e.getRequestOpts();a.url="/ajax/ajax_appMgmtSave.php";a.data=l;e.getActionCall(a,function(a){q(a)})},function(a){a.preventDefault();a=e.getRequestOpts();a.url="/ajax/ajax_appMgmtSave.php";a.data=l;e.getActionCall(a,
|
||||
function(a){q(a)})})},H=function(a,d,c){var b=$(a).attr("data-itemid"),f=$(a).attr("data-activetab");a=$(a).attr("data-nextactionid");d={itemId:b,actionId:d,sk:c,activeTab:f,onCloseAction:a};c=e.getRequestOpts();c.url="/ajax/ajax_appMgmtSave.php";c.data=d;e.getActionCall(c,function(a){q(a)})},x=function(){var a=e.getRequestOpts();a.type="html";a.method="get";a.timeout=1E4;a.url="/ajax/ajax_checkUpds.php";e.getActionCall(a,function(a){$("#updates").html(a);"undefined"!==typeof componentHandler&&componentHandler.upgradeDom()},
|
||||
function(){$("#updates").html("!")})},I=function(b){var d='<div id="alert"><p id="alert-text">'+a.LANG[20]+"</p></div>";alertify.okBtn(a.LANG[43]).cancelBtn(a.LANG[44]).confirm(d,function(a){a=e.getRequestOpts();a.url="/ajax/ajax_eventlog.php";a.data={clear:1,sk:b,isAjax:1};e.getActionCall(a,function(a){q(a)})},function(b){b.preventDefault();alertify.error(a.LANG[44])})},J=function(a,d){g.passLength=a.length;y(zxcvbn(a),d)},y=function(b,d){var c,e=b.score;c=$(".passLevel-"+d);c.show();c.removeClass("weak good strong strongest");
|
||||
0===g.passLength?c.attr("title","").empty():g.passLength<g.minPasswordLength?c.attr("title",a.LANG[11]).addClass("weak"):0===e?c.attr("title",a.LANG[9]+" - "+b.feedback.warning).addClass("weak"):1===e||2===e?c.attr("title",a.LANG[8]+" - "+b.feedback.warning).addClass("good"):3===e?c.attr("title",a.LANG[7]).addClass("strong"):4===e&&c.attr("title",a.LANG[10]).addClass("strongest")},p=function(b,d,c,f){if("undefined"!==typeof c){var g=e.getRequestOpts();g.type="get";g.method="html";g.url=c;g.async=
|
||||
!1;e.getActionCall(g,function(a){d=a})}d=d.replace(/(\\n|;;)/g,"<br>");switch(b){case "ok":alertify.closeLogOnClick(!0).delay(15E3).success(d);break;case "error":alertify.closeLogOnClick(!0).delay(15E3).error(d);break;case "warn":alertify.delay(3E4).log(d);break;case "nofancyerror":return b='<p class="error round">Oops...<br>'+a.LANG[1]+"<br>"+d+"</p>";default:alertify.error(d)}"undefined"!==typeof f&&eval(f)},K=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])})},u=function(b){var d=$(b),c=d.val();b+="-encrypted";var e=d.next(':input[name="'+b+'"]');if(""!==c&&e.attr("name")!==b||""!==c&&e.attr("name")===b&&parseInt(d.next().val())!==c.length)c=a.crypt.encrypt(c),d.val(c),0<e.length?e.val(c.length):d.after('<input type="hidden" name="'+b+'" value="'+c.length+'" />')},L=function(){m.info("initializeClipboard");var b=new Clipboard(".clip-pass-button",
|
||||
{text:function(a){return l.account.copypass($(a)).responseJSON.accpass}});b.on("success",function(b){n("ok",a.LANG[45])});b.on("error",function(b){n("error",a.LANG[46])});var b=new Clipboard(".dialog-clip-pass-button"),d=new Clipboard(".dialog-clip-user-button");b.on("success",function(a){$(".dialog-pass-text").addClass("dialog-clip-pass-copy round");a.clearSelection()});d.on("success",function(a){a.clearSelection()})},M=function(){m.info("bindPassEncrypt");var a=$("body");a.on("blur",":input[type=password]",
|
||||
function(a){$(this).hasClass("passwordfield__no-pki")||(a=$(this).attr("id"),u("#"+a))});a.on("keypress",":input[type=password]",function(a){if(13===a.keyCode){a.preventDefault();a=$(this).closest("form");var b=$(this).attr("id");u("#"+b);a.submit()}})},N=function(a,d,c){var b=f.getRequestOpts();b.type="html";b.url="/ajax/ajax_wiki.php";b.data={pageName:a,actionId:d,sk:c,isAjax:1};f.getActionCall(b,function(a){$.fancybox(a,{padding:[0,10,10,10]})})},O=function(a,d){console.info("Eval: "+a);if("function"===
|
||||
typeof a)a(d);else throw Error("Function not found: "+a);},P=function(){return $.extend({log:m,config:function(){return a},appTheme:function(){return k},appActions:function(){return l},appTriggers:function(){return e},appRequests:function(){return f},evalAction:O},t)},Q=function(){return{sk:v,actions:function(){return l},triggers:function(){return e},jsonResponseMessage:p,checkboxDetect:K,checkPassLevel:J,checkUpds:x,clearEventlog:I,encryptFormValue:u,fileUpload:E,linksMgmtSave:G,linksMgmtRefresh:H,
|
||||
navLog:B,outputResult:y,passToClip:0,passwordData:h,redirect:C,resMsg:n,scrollUp:w,sendAjax:F,sendRequest:D,setContentSize:A,viewWiki:N}};(function(){m.info("init");t=Q();q=P();e=sysPass.Triggers(q);l=sysPass.Actions(q);f=sysPass.Requests(q);z(function(){""!==a.PK&&M();"function"===typeof sysPass.Theme&&(k=sysPass.Theme(q));!0===a.CHECK_UPDATES&&x();L();m.info("setupCallbacks");0<$("#boxLogin").length&&e.views.login();0<$("#searchbox").length&&e.views.search();0<$("footer").length&&e.views.footer()})})();
|
||||
{text:function(a){return k.account.copypass($(a)).responseJSON.accpass}});b.on("success",function(b){p("ok",a.LANG[45])});b.on("error",function(b){p("error",a.LANG[46])});var b=new Clipboard(".dialog-clip-pass-button"),d=new Clipboard(".dialog-clip-user-button");b.on("success",function(a){$(".dialog-pass-text").addClass("dialog-clip-pass-copy round");a.clearSelection()});d.on("success",function(a){a.clearSelection()})},M=function(){m.info("bindPassEncrypt");var a=$("body");a.on("blur",":input[type=password]",
|
||||
function(a){$(this).hasClass("passwordfield__no-pki")||(a=$(this).attr("id"),u("#"+a))});a.on("keypress",":input[type=password]",function(a){if(13===a.keyCode){a.preventDefault();a=$(this).closest("form");var b=$(this).attr("id");u("#"+b);a.submit()}})},N=function(a,d,c){var b=e.getRequestOpts();b.type="html";b.url="/ajax/ajax_wiki.php";b.data={pageName:a,actionId:d,sk:c,isAjax:1};e.getActionCall(b,function(a){$.fancybox(a,{padding:[0,10,10,10]})})},O=function(a,d){console.info("Eval: "+a);if("function"===
|
||||
typeof a)a(d);else throw Error("Function not found: "+a);},P=function(){return $.extend({log:m,config:function(){return a},appTheme:function(){return h},appActions:function(){return k},appTriggers:function(){return f},appRequests:function(){return e},evalAction:O},t)},Q=function(){return{sk:v,actions:function(){return k},triggers:function(){return f},jsonResponseMessage:q,checkboxDetect:K,checkPassLevel:J,checkUpds:x,clearEventlog:I,encryptFormValue:u,fileUpload:E,linksMgmtSave:G,linksMgmtRefresh:H,
|
||||
navLog:B,outputResult:y,passToClip:0,passwordData:g,redirect:C,resMsg:p,scrollUp:w,sendAjax:F,sendRequest:D,setContentSize:A,viewWiki:N}};(function(){m.info("init");t=Q();r=P();f=sysPass.Triggers(r);k=sysPass.Actions(r);e=sysPass.Requests(r);z(function(){""!==a.PK&&M();"function"===typeof sysPass.Theme&&(h=sysPass.Theme(r));!0===a.CHECK_UPDATES&&x();L();m.info("setupCallbacks");0<$("#boxLogin").length&&f.views.login();0<$("#searchbox").length&&f.views.search();0<$("footer").length&&f.views.footer()})})();
|
||||
return t};
|
||||
|
||||
@@ -161,11 +161,41 @@ sysPass.Triggers = function (Common) {
|
||||
}
|
||||
};
|
||||
|
||||
var bodyHooks = function () {
|
||||
log.info("bodyHooks");
|
||||
|
||||
$("body").on("click", ".btn-action[data-onclick],.btn-action-pager[data-onclick]", function () {
|
||||
btnAction($(this));
|
||||
}).on("click", ".btn-back", function () {
|
||||
var appRequests = Common.appRequests();
|
||||
|
||||
if (appRequests.history.length() > 0) {
|
||||
log.info("back");
|
||||
|
||||
var lastHistory = appRequests.history.del();
|
||||
|
||||
appRequests.getActionCall(lastHistory, lastHistory.callback);
|
||||
}
|
||||
}).on("submit", ".form-action", function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
formAction($(this));
|
||||
}).on("click", ".btn-help", function () {
|
||||
var $this = $(this);
|
||||
|
||||
$("#" + $this.data("help")).dialog("open");
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Triggers que se ejecutan en determinadas vistas
|
||||
*/
|
||||
var views = {
|
||||
main: function () {
|
||||
log.info("views:main");
|
||||
|
||||
bodyHooks();
|
||||
|
||||
$(".btn-menu").click(function () {
|
||||
var $this = $(this);
|
||||
|
||||
@@ -176,33 +206,14 @@ sysPass.Triggers = function (Common) {
|
||||
Common.appActions().doAction({actionId: $(this).data("action-id")});
|
||||
});
|
||||
|
||||
$("body").on("click", ".btn-action[data-onclick],.btn-action-pager[data-onclick]", function () {
|
||||
btnAction($(this));
|
||||
}).on("click", ".btn-back", function () {
|
||||
var appRequests = Common.appRequests();
|
||||
|
||||
if (appRequests.history.length() > 0) {
|
||||
log.info("back");
|
||||
|
||||
var lastHistory = appRequests.history.del();
|
||||
|
||||
appRequests.getActionCall(lastHistory, lastHistory.callback);
|
||||
}
|
||||
}).on("submit", ".form-action", function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
formAction($(this));
|
||||
}).on("click", ".btn-help", function () {
|
||||
var $this = $(this);
|
||||
|
||||
$("#" + $this.data("help")).dialog("open");
|
||||
});
|
||||
|
||||
setFixedMenu();
|
||||
|
||||
Common.appActions().doAction({actionId: 1});
|
||||
},
|
||||
search: function () {
|
||||
log.info("views:search");
|
||||
|
||||
var $frmSearch = $("#frmSearch");
|
||||
|
||||
$frmSearch.on("submit", function (e) {
|
||||
@@ -236,17 +247,17 @@ sysPass.Triggers = function (Common) {
|
||||
}
|
||||
},
|
||||
login: function () {
|
||||
$("#frmLogin").on("submit", function (e) {
|
||||
e.preventDefault();
|
||||
log.info("views:login");
|
||||
|
||||
formAction($(this));
|
||||
});
|
||||
bodyHooks();
|
||||
|
||||
$("#boxLogout").fadeOut(1500, function () {
|
||||
location.href = Common.config().APP_ROOT + "/index.php";
|
||||
});
|
||||
},
|
||||
footer: function () {
|
||||
log.info("views:footer");
|
||||
|
||||
$("#btnLogout").click(function (e) {
|
||||
Common.appActions().main.logout();
|
||||
});
|
||||
@@ -256,10 +267,12 @@ sysPass.Triggers = function (Common) {
|
||||
});
|
||||
|
||||
$("#btnUserPass").click(function (e) {
|
||||
Common.appActions().appMgmt.userpass($(this));
|
||||
Common.appActions().user.password($(this));
|
||||
});
|
||||
},
|
||||
common: function (container) {
|
||||
log.info("views:common");
|
||||
|
||||
var $container = $(container);
|
||||
|
||||
selectDetect($container);
|
||||
@@ -275,6 +288,8 @@ sysPass.Triggers = function (Common) {
|
||||
}
|
||||
},
|
||||
datatabs: function (active) {
|
||||
log.info("views:datatabs");
|
||||
|
||||
$("#tabs").tabs({
|
||||
active: active
|
||||
});
|
||||
@@ -288,6 +303,8 @@ sysPass.Triggers = function (Common) {
|
||||
});
|
||||
},
|
||||
config: function () {
|
||||
log.info("views:config");
|
||||
|
||||
var $dropFiles = $("#drop-import-files");
|
||||
|
||||
if ($dropFiles.length > 0) {
|
||||
@@ -317,6 +334,8 @@ sysPass.Triggers = function (Common) {
|
||||
}
|
||||
},
|
||||
account: function () {
|
||||
log.info("views:account");
|
||||
|
||||
var $listFiles = $("#list-account-files");
|
||||
|
||||
if ($listFiles.length > 0) {
|
||||
@@ -340,8 +359,14 @@ sysPass.Triggers = function (Common) {
|
||||
$form.attr("data-hash", SparkMD5.hash($form.serialize(), false));
|
||||
}
|
||||
},
|
||||
install: function() {
|
||||
Common.appTheme().passwordDetect($("#frmInstall"));
|
||||
install: function () {
|
||||
log.info("views:install");
|
||||
|
||||
bodyHooks();
|
||||
|
||||
var $form = $("#frmInstall");
|
||||
|
||||
Common.appTheme().passwordDetect($form);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
24
js/app-triggers.min.js
vendored
24
js/app-triggers.min.js
vendored
@@ -1,13 +1,13 @@
|
||||
var $jscomp={scope:{},findInternal:function(b,e,c){b instanceof String&&(b=String(b));for(var g=b.length,f=0;f<g;f++){var a=b[f];if(e.call(c,a,f,b))return{i:f,v:a}}return{i:-1,v:void 0}}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(b,e,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");b!=Array.prototype&&b!=Object.prototype&&(b[e]=c.value)};
|
||||
$jscomp.getGlobal=function(b){return"undefined"!=typeof window&&window===b?b:"undefined"!=typeof global?global:b};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(b,e,c,g){if(e){c=$jscomp.global;b=b.split(".");for(g=0;g<b.length-1;g++){var f=b[g];f in c||(c[f]={});c=c[f]}b=b[b.length-1];g=c[b];e=e(g);e!=g&&null!=e&&$jscomp.defineProperty(c,b,{configurable:!0,writable:!0,value:e})}};
|
||||
$jscomp.polyfill("Array.prototype.find",function(b){return b?b:function(b,c){return $jscomp.findInternal(this,b,c).v}},"es6-impl","es3");
|
||||
sysPass.Triggers=function(b){var e=b.log,c=function(a){var d={valueField:"id",labelField:"name",searchField:["name"]};a.find(".select-box").each(function(a){a=$(this);d.plugins=a.hasClass("select-box-deselect")?{clear_selection:{title:b.config().LANG[51]}}:{};if(a.data("onchange")){var c=a.data("onchange").split("/"),h=a.data("action-id");d.onChange=function(a){var b={"action-id":h,"item-id":a};if(0<a)if(2===c.length)sysPassApp.actions()[c[0]][c[1]](b);else sysPassApp.actions()[c[0]](b)}}a.selectize(d)});
|
||||
var $jscomp={scope:{},findInternal:function(b,c,e){b instanceof String&&(b=String(b));for(var g=b.length,f=0;f<g;f++){var a=b[f];if(c.call(e,a,f,b))return{i:f,v:a}}return{i:-1,v:void 0}}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(b,c,e){if(e.get||e.set)throw new TypeError("ES3 does not support getters and setters.");b!=Array.prototype&&b!=Object.prototype&&(b[c]=e.value)};
|
||||
$jscomp.getGlobal=function(b){return"undefined"!=typeof window&&window===b?b:"undefined"!=typeof global?global:b};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(b,c,e,g){if(c){e=$jscomp.global;b=b.split(".");for(g=0;g<b.length-1;g++){var f=b[g];f in e||(e[f]={});e=e[f]}b=b[b.length-1];g=e[b];c=c(g);c!=g&&null!=c&&$jscomp.defineProperty(e,b,{configurable:!0,writable:!0,value:c})}};
|
||||
$jscomp.polyfill("Array.prototype.find",function(b){return b?b:function(b,e){return $jscomp.findInternal(this,b,e).v}},"es6-impl","es3");
|
||||
sysPass.Triggers=function(b){var c=b.log,e=function(a){var d={valueField:"id",labelField:"name",searchField:["name"]};a.find(".select-box").each(function(a){a=$(this);d.plugins=a.hasClass("select-box-deselect")?{clear_selection:{title:b.config().LANG[51]}}:{};if(a.data("onchange")){var c=a.data("onchange").split("/"),e=a.data("action-id");d.onChange=function(a){var b={"action-id":e,"item-id":a};if(0<a)if(2===c.length)sysPassApp.actions()[c[0]][c[1]](b);else sysPassApp.actions()[c[0]](b)}}a.selectize(d)});
|
||||
a.find("#allowed_exts").selectize({create:function(a){return{value:a.toUpperCase(),text:a.toUpperCase()}},createFilter:/^[a-z0-9]{1,4}$/i,plugins:["remove_button"]});a.find("#wikifilter").selectize({create:!0,createFilter:/^[a-z0-9._-]+$/i,plugins:["remove_button"]})},g=function(){var a=$("#actionsBar"),b=$("#actionsBar #actionsBar-logo img"),c=!1,e={position:"fixed",top:0,left:a.offset().left,width:a.width(),padding:"1em 0",backgroundColor:"rgba(255, 255, 255, .75)",borderBottom:"1px solid #ccc"};
|
||||
$(window).scroll(function(){var d=$(this).scrollTop()>a.height();d&&!c?(a.css(e),b.show().css({opacity:.75}),c=!0):!d&&c&&(a.css({backgroundColor:"transparent",border:"0"}),b.hide(),c=!1)});0<a.offset().top&&(a.css(e),b.show().css({opacity:.75}),c=!0)},f=function(a){var d=a.data("onsubmit").split("/"),c=b.appActions(),e=a.attr("data-hash"),f=SparkMD5.hash(a.serialize(),!1);if(e===f)return b.resMsg("ok",b.config().LANG[55]),!1;a.find("input[name='sk']").val(b.sk.get());if(2===d.length)c[d[0]][d[1]](a);
|
||||
else c[d[0]](a)};return{views:{main:function(){$(".btn-menu").click(function(){"1"===$(this).attr("data-history-reset")&&b.appRequests().history.reset();b.appActions().doAction({actionId:$(this).data("action-id")})});$("body").on("click",".btn-action[data-onclick],.btn-action-pager[data-onclick]",function(){var a=$(this),d=a.data("onclick").split("/"),c=b.appActions();if(2===d.length)c[d[0]][d[1]](a);else c[d[0]](a)}).on("click",".btn-back",function(){var a=b.appRequests();if(0<a.history.length()){e.info("back");
|
||||
var d=a.history.del();a.getActionCall(d,d.callback)}}).on("submit",".form-action",function(a){a.preventDefault();f($(this))}).on("click",".btn-help",function(){var a=$(this);$("#"+a.data("help")).dialog("open")});g();b.appActions().doAction({actionId:1})},search:function(){var a=$("#frmSearch");a.on("submit",function(a){a.preventDefault();b.appActions().account.search()});a.find("select, #rpp").on("change",function(){b.appActions().account.search()});a.find("#btnClear").click(function(){b.appActions().account.search(!0)});
|
||||
a.find("input:text:visible:first").focus();$("#chkgsearch").click(function(){var d=1==$(this).prop("checked")?1:0;a.find("input[name='gsearch']").val(d);b.appActions().account.search()});"function"===typeof b.appTheme().viewsTriggers.search&&b.appTheme().viewsTriggers.search()},login:function(){$("#frmLogin").on("submit",function(a){a.preventDefault();f($(this))});$("#boxLogout").fadeOut(1500,function(){location.href=b.config().APP_ROOT+"/index.php"})},footer:function(){$("#btnLogout").click(function(a){b.appActions().main.logout()});
|
||||
$("#btnPrefs").click(function(a){b.appActions().doAction({actionId:$(this).data("action-id")})});$("#btnUserPass").click(function(a){b.appActions().appMgmt.userpass($(this))})},common:function(a){a=$(a);c(a);a.find(".help-box").dialog({autoOpen:!1,title:b.config().LANG[54],width:screen.width/2.5});"function"===typeof b.appTheme().viewsTriggers.common&&b.appTheme().viewsTriggers.common(a)},datatabs:function(a){$("#tabs").tabs({active:a});$(".datagrid-action-search>form").each(function(){var a=$(this);
|
||||
a.find("i.btn-clear").on("click",function(){a.trigger("reset").submit()})})},config:function(){var a=$("#drop-import-files");if(0<a.length){var c=b.fileUpload(a);c.url="/ajax/ajax_import.php";c.beforeSendAction=function(){c.requestData({sk:b.sk.get(),csvDelimiter:$("#csvDelimiter").val(),importPwd:$("#importPwd").val(),import_defaultuser:$("#import_defaultuser").val(),import_defaultgroup:$("#import_defaultgroup").val()})}}a=$(".form-action");0<a.length&&a.each(function(){var a=$(this);"undefined"!==
|
||||
typeof a.attr("data-hash")&&a.attr("data-hash",SparkMD5.hash(a.serialize(),!1))})},account:function(){var a=$("#list-account-files");0<a.length&&b.appActions().account.getfiles(a);var c=$("#drop-account-files");0<c.length&&(c=b.fileUpload(c),c.url="/ajax/ajax_files.php",c.requestDoneAction=function(){b.appActions().account.getfiles(a)});c=$(".form-action");0<c.length&&c.attr("data-hash",SparkMD5.hash(c.serialize(),!1))}},selectDetect:c,updateSk:function(){$("#content").find("[data-sk]").each(function(){e.info("updateSk");
|
||||
$(this).data("sk",b.sk.get())})}}};
|
||||
$(window).scroll(function(){var d=$(this).scrollTop()>a.height();d&&!c?(a.css(e),b.show().css({opacity:.75}),c=!0):!d&&c&&(a.css({backgroundColor:"transparent",border:"0"}),b.hide(),c=!1)});0<a.offset().top&&(a.css(e),b.show().css({opacity:.75}),c=!0)},f=function(){c.info("bodyHooks");$("body").on("click",".btn-action[data-onclick],.btn-action-pager[data-onclick]",function(){var a=$(this),d=a.data("onclick").split("/"),c=b.appActions();if(2===d.length)c[d[0]][d[1]](a);else c[d[0]](a)}).on("click",
|
||||
".btn-back",function(){var a=b.appRequests();if(0<a.history.length()){c.info("back");var d=a.history.del();a.getActionCall(d,d.callback)}}).on("submit",".form-action",function(a){a.preventDefault();a=$(this);var d=a.data("onsubmit").split("/"),c=b.appActions(),e=a.attr("data-hash"),f=SparkMD5.hash(a.serialize(),!1);if(e===f)b.resMsg("ok",b.config().LANG[55]);else if(a.find("input[name='sk']").val(b.sk.get()),2===d.length)c[d[0]][d[1]](a);else c[d[0]](a)}).on("click",".btn-help",function(){var a=$(this);
|
||||
$("#"+a.data("help")).dialog("open")})};return{views:{main:function(){c.info("views:main");f();$(".btn-menu").click(function(){"1"===$(this).attr("data-history-reset")&&b.appRequests().history.reset();b.appActions().doAction({actionId:$(this).data("action-id")})});g();b.appActions().doAction({actionId:1})},search:function(){c.info("views:search");var a=$("#frmSearch");a.on("submit",function(a){a.preventDefault();b.appActions().account.search()});a.find("select, #rpp").on("change",function(){b.appActions().account.search()});
|
||||
a.find("#btnClear").click(function(){b.appActions().account.search(!0)});a.find("input:text:visible:first").focus();$("#chkgsearch").click(function(){var c=1==$(this).prop("checked")?1:0;a.find("input[name='gsearch']").val(c);b.appActions().account.search()});"function"===typeof b.appTheme().viewsTriggers.search&&b.appTheme().viewsTriggers.search()},login:function(){c.info("views:login");f();$("#boxLogout").fadeOut(1500,function(){location.href=b.config().APP_ROOT+"/index.php"})},footer:function(){c.info("views:footer");
|
||||
$("#btnLogout").click(function(a){b.appActions().main.logout()});$("#btnPrefs").click(function(a){b.appActions().doAction({actionId:$(this).data("action-id")})});$("#btnUserPass").click(function(a){b.appActions().user.password($(this))})},common:function(a){c.info("views:common");a=$(a);e(a);a.find(".help-box").dialog({autoOpen:!1,title:b.config().LANG[54],width:screen.width/2.5});"function"===typeof b.appTheme().viewsTriggers.common&&b.appTheme().viewsTriggers.common(a)},datatabs:function(a){c.info("views:datatabs");
|
||||
$("#tabs").tabs({active:a});$(".datagrid-action-search>form").each(function(){var a=$(this);a.find("i.btn-clear").on("click",function(){a.trigger("reset").submit()})})},config:function(){c.info("views:config");var a=$("#drop-import-files");if(0<a.length){var d=b.fileUpload(a);d.url="/ajax/ajax_import.php";d.beforeSendAction=function(){d.requestData({sk:b.sk.get(),csvDelimiter:$("#csvDelimiter").val(),importPwd:$("#importPwd").val(),import_defaultuser:$("#import_defaultuser").val(),import_defaultgroup:$("#import_defaultgroup").val()})}}a=
|
||||
$(".form-action");0<a.length&&a.each(function(){var a=$(this);"undefined"!==typeof a.attr("data-hash")&&a.attr("data-hash",SparkMD5.hash(a.serialize(),!1))})},account:function(){c.info("views:account");var a=$("#list-account-files");0<a.length&&b.appActions().account.getfiles(a);var d=$("#drop-account-files");0<d.length&&(d=b.fileUpload(d),d.url="/ajax/ajax_files.php",d.requestDoneAction=function(){b.appActions().account.getfiles(a)});d=$(".form-action");0<d.length&&d.attr("data-hash",SparkMD5.hash(d.serialize(),
|
||||
!1))},install:function(){c.info("views:install");f();var a=$("#frmInstall");b.appTheme().passwordDetect(a)}},selectDetect:e,updateSk:function(){$("#content").find("[data-sk]").each(function(){c.info("updateSk");$(this).data("sk",b.sk.get())})}}};
|
||||
|
||||
Reference in New Issue
Block a user