From cd1072d2de6bb2827bd8af29fa618fec0a03f42b Mon Sep 17 00:00:00 2001 From: nuxsmin Date: Tue, 3 Feb 2015 13:30:39 +0100 Subject: [PATCH] Merge branch 'v1.1' --- ajax/ajax_accountSave.php | 6 +- ajax/ajax_appMgmtData.php | 50 +- ajax/ajax_appMgmtSave.php | 18 +- ajax/ajax_backup.php | 4 +- ajax/ajax_checkLdap.php | 4 +- ajax/ajax_checkUpds.php | 4 +- ajax/ajax_configSave.php | 32 +- ajax/ajax_doLogin.php | 36 +- ajax/ajax_eventlog.php | 10 +- ajax/ajax_files.php | 4 +- ajax/ajax_getContent.php | 4 +- ajax/ajax_getFiles.php | 4 +- ajax/ajax_import.php | 2 +- ajax/ajax_migrate.php | 2 +- ajax/ajax_passReset.php | 6 +- ajax/ajax_search.php | 16 +- ajax/ajax_sendRequest.php | 6 +- ajax/ajax_usrpass.php | 16 +- ajax/ajax_viewpass.php | 6 +- css/alertify.default.css | 2 +- css/css.php | 4 +- css/jquery.tagsinput.css | 90 +- css/search-grid.css | 88 +- css/smoothness/jquery-ui.css | 1720 ++++++++++++++++++++++++- css/styles.css | 25 +- inc/account.class.php | 38 +- inc/acl.class.php | 8 +- inc/auth.class.php | 8 +- inc/backup.class.php | 10 +- inc/category.class.php | 2 +- inc/common.class.php | 6 +- inc/config.class.php | 10 +- inc/crypt.class.php | 15 +- inc/customer.class.php | 6 +- inc/db.class.php | 18 +- inc/dbstructure.sql | 78 +- inc/ext/cssmin/class.cssmin.php | 532 ++++---- inc/ext/phpmailer/class.phpmailer.php | 358 +++-- inc/ext/phpmailer/class.smtp.php | 85 +- inc/groups.class.php | 12 +- inc/html.class.php | 14 +- inc/import.class.php | 30 +- inc/init.php | 13 +- inc/installer.class.php | 2 +- inc/keepassimport.class.php | 33 +- inc/keepassximport.class.php | 36 +- inc/ldap.class.php | 14 +- inc/log.class.php | 4 +- inc/profiles.class.php | 8 +- inc/tpl/accounts.php | 227 ++-- inc/tpl/backup.php | 2 +- inc/tpl/categories.php | 41 +- inc/tpl/config.php | 285 ++-- inc/tpl/customers.php | 49 +- inc/tpl/editpass.php | 3 +- inc/tpl/error.php | 42 +- inc/tpl/eventlog.php | 81 +- inc/tpl/groups.php | 9 +- inc/tpl/login.php | 10 +- inc/tpl/main.php | 4 +- inc/tpl/migrate.php | 18 +- inc/tpl/passreset.php | 4 +- inc/tpl/profiles.php | 21 +- inc/tpl/request.php | 46 +- inc/tpl/search.php | 34 +- inc/tpl/upgrade.php | 4 +- inc/tpl/users.php | 125 +- inc/upgrade.class.php | 16 +- inc/users.class.php | 13 +- inc/util.class.php | 13 +- index.php | 2 +- js/ZeroClipboard.min.js | 431 ++++++- js/alertify.js | 1166 +++++++++-------- js/functions.js | 53 +- js/jquery.fileDownload.js | 2 +- js/jquery.tagsinput.js | 160 +-- js/js.php | 4 +- 77 files changed, 4507 insertions(+), 1857 deletions(-) diff --git a/ajax/ajax_accountSave.php b/ajax/ajax_accountSave.php index 62a16c06..c60b82b8 100644 --- a/ajax/ajax_accountSave.php +++ b/ajax/ajax_accountSave.php @@ -3,8 +3,8 @@ /** * sysPass * - * @author nuxsmin - * @link http://syspass.org + * @author nuxsmin + * @link http://syspass.org * @copyright 2012-2015 Rubén Domínguez nuxsmin@syspass.org * * This file is part of sysPass. @@ -254,7 +254,7 @@ switch ($frmSaveType) { $account->accountUserEditId = $userId; // Restaurar cuenta y clave - if ($account->updateAccount(true) && $account->updateAccountPass(false,true)) { + if ($account->updateAccount(true) && $account->updateAccountPass(false, true)) { SP_Common::printJSON(_('Cuenta restaurada'), 0); } diff --git a/ajax/ajax_appMgmtData.php b/ajax/ajax_appMgmtData.php index ed07d2d8..f18b5772 100644 --- a/ajax/ajax_appMgmtData.php +++ b/ajax/ajax_appMgmtData.php @@ -1,30 +1,30 @@ . -* -*/ +/** + * sysPass + * + * @author nuxsmin + * @link http://syspass.org + * @copyright 2012-2015 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 . + * + */ define('APP_ROOT', '..'); -require_once APP_ROOT.DIRECTORY_SEPARATOR.'inc'.DIRECTORY_SEPARATOR.'init.php'; +require_once APP_ROOT . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'init.php'; SP_Util::checkReferer('POST'); @@ -32,7 +32,7 @@ if (!SP_Init::isLoggedIn()) { SP_Util::logout(); } -if ( SP_Common::parseParams('p', 'id', false, true) && SP_Common::parseParams('p', 'type', false, true) ) { +if (SP_Common::parseParams('p', 'id', false, true) && SP_Common::parseParams('p', 'type', false, true)) { $tplvars['itemid'] = SP_Common::parseParams('p', 'id', 0); $itemType = $tplvars['itemtype'] = SP_Common::parseParams('p', 'type', 0); $tplvars['activeTab'] = SP_Common::parseParams('p', 'active', 0); diff --git a/ajax/ajax_appMgmtSave.php b/ajax/ajax_appMgmtSave.php index b0d0d3a2..798b3c73 100644 --- a/ajax/ajax_appMgmtSave.php +++ b/ajax/ajax_appMgmtSave.php @@ -3,8 +3,8 @@ /** * sysPass * - * @author nuxsmin - * @link http://syspass.org + * @author nuxsmin + * @link http://syspass.org * @copyright 2012-2015 Rubén Domínguez nuxsmin@syspass.org * * This file is part of sysPass. @@ -25,7 +25,7 @@ */ define('APP_ROOT', '..'); -require_once APP_ROOT.DIRECTORY_SEPARATOR.'inc'.DIRECTORY_SEPARATOR.'init.php'; +require_once APP_ROOT . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'init.php'; SP_Util::checkReferer('POST'); @@ -135,7 +135,7 @@ if ($frmSaveType == 1 || $frmSaveType == 2) { SP_Common::printJSON(_('Error al actualizar el usuario')); } - // Cambio de clave + // Cambio de clave } elseif ($frmAction == 3) { if (SP_Util::demoIsEnabled() && $userLogin == 'demo') { SP_Common::printJSON(_('Ey, esto es una DEMO!!')); @@ -157,7 +157,7 @@ if ($frmSaveType == 1 || $frmSaveType == 2) { } SP_Common::printJSON(_('Error al modificar la clave')); - // Eliminar usuario + // Eliminar usuario } elseif ($frmAction == 4) { if (SP_Util::demoIsEnabled() && $userLogin == 'demo') { SP_Common::printJSON(_('Ey, esto es una DEMO!!')); @@ -210,7 +210,7 @@ if ($frmSaveType == 1 || $frmSaveType == 2) { SP_Common::printJSON(_('Error al actualizar el grupo')); } - // Eliminar grupo + // Eliminar grupo } elseif ($frmAction == 4) { SP_Groups::$groupId = $frmItemId; @@ -290,7 +290,7 @@ if ($frmSaveType == 1 || $frmSaveType == 2) { SP_Common::printJSON(_('Error al actualizar el perfil')); } - // Eliminar perfil + // Eliminar perfil } elseif ($frmAction == 4) { $resProfileUse = SP_Profiles::checkProfileInUse(); @@ -348,7 +348,7 @@ if ($frmSaveType == 1 || $frmSaveType == 2) { SP_Common::printJSON(_('Error al actualizar el cliente')); } - // Eliminar cliente + // Eliminar cliente } elseif ($frmAction == 4) { $resCustomerUse = SP_Customer::checkCustomerInUse($frmItemId); @@ -399,7 +399,7 @@ if ($frmSaveType == 1 || $frmSaveType == 2) { SP_Common::printJSON(_('Error al actualizar la categoría')); } - // Eliminar categoría + // Eliminar categoría } elseif ($frmAction == 4) { $resCategoryUse = SP_Category::checkCategoryInUse($frmItemId); diff --git a/ajax/ajax_backup.php b/ajax/ajax_backup.php index 3341e4aa..eb9ab966 100644 --- a/ajax/ajax_backup.php +++ b/ajax/ajax_backup.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link http://syspass.org + * @author nuxsmin + * @link http://syspass.org * @copyright 2012-2015 Rubén Domínguez nuxsmin@syspass.org * * This file is part of sysPass. diff --git a/ajax/ajax_checkLdap.php b/ajax/ajax_checkLdap.php index 7432eae6..15049006 100644 --- a/ajax/ajax_checkLdap.php +++ b/ajax/ajax_checkLdap.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link http://syspass.org + * @author nuxsmin + * @link http://syspass.org * @copyright 2012-2015 Rubén Domínguez nuxsmin@syspass.org * * This file is part of sysPass. diff --git a/ajax/ajax_checkUpds.php b/ajax/ajax_checkUpds.php index dc209f19..473d9b2e 100644 --- a/ajax/ajax_checkUpds.php +++ b/ajax/ajax_checkUpds.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link http://syspass.org + * @author nuxsmin + * @link http://syspass.org * @copyright 2012-2015 Rubén Domínguez nuxsmin@syspass.org * * This file is part of sysPass. diff --git a/ajax/ajax_configSave.php b/ajax/ajax_configSave.php index 13af3185..266874b1 100644 --- a/ajax/ajax_configSave.php +++ b/ajax/ajax_configSave.php @@ -2,11 +2,11 @@ /** * sysPass - * - * @author nuxsmin - * @link http://syspass.org + * + * @author nuxsmin + * @link http://syspass.org * @copyright 2012-2015 Rubén Domínguez nuxsmin@syspass.org - * + * * This file is part of sysPass. * * sysPass is free software: you can redistribute it and/or modify @@ -25,7 +25,7 @@ */ define('APP_ROOT', '..'); -require_once APP_ROOT.DIRECTORY_SEPARATOR.'inc'.DIRECTORY_SEPARATOR.'init.php'; +require_once APP_ROOT . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'init.php'; SP_Util::checkReferer('POST'); @@ -40,7 +40,7 @@ if (!$sk || !SP_Common::checkSessionKey($sk)) { } // Variables POST del formulario -$frmAction = SP_Common::parseParams('p', 'action'); +$frmAction = SP_Common::parseParams('p', 'action'); $frmOnCloseAction = SP_Common::parseParams('p', 'onCloseAction'); $frmActiveTab = SP_Common::parseParams('p', 'activeTab', 0); @@ -78,7 +78,7 @@ if ($frmAction == "config") { $frmMail = SP_Common::parseParams('p', 'mail_enabled', false, false, true); $frmMailServer = SP_Common::parseParams('p', 'mail_server'); - $frmMailPort = SP_Common::parseParams('p', 'mail_port',25); + $frmMailPort = SP_Common::parseParams('p', 'mail_port', 25); $frmMailUser = SP_Common::parseParams('p', 'mail_user'); $frmMailPass = SP_Common::parseParams('p', 'mail_pass', '', false, false, false); $frmMailSecurity = SP_Common::parseParams('p', 'mail_security'); @@ -92,7 +92,7 @@ if ($frmAction == "config") { $intAccountCount = $frmAccountCount; } - if ($frmWiki && (!$frmWikiSearchUrl || !$frmWikiPageUrl || !$frmWikiFilter )) { + if ($frmWiki && (!$frmWikiSearchUrl || !$frmWikiPageUrl || !$frmWikiFilter)) { SP_Common::printJSON(_('Faltan parámetros de Wiki')); } elseif ($frmWiki) { SP_Config::setValue("wiki_enabled", true); @@ -103,7 +103,7 @@ if ($frmAction == "config") { SP_Config::setValue("wiki_enabled", false); } - if ($frmLdap && (!$frmLdapServer || !$frmLdapBase || !$frmLdapBindUser )) { + if ($frmLdap && (!$frmLdapServer || !$frmLdapBase || !$frmLdapBindUser)) { SP_Common::printJSON(_('Faltan parámetros de LDAP')); } elseif ($frmLdap) { SP_Config::setValue("ldap_enabled", true); @@ -119,7 +119,7 @@ if ($frmAction == "config") { SP_Config::setValue("ldap_enabled", false); } - if ($frmMail && (!$frmMailServer || !$frmMailFrom )) { + if ($frmMail && (!$frmMailServer || !$frmMailFrom)) { SP_Common::printJSON(_('Faltan parámetros de Correo')); } elseif ($frmMail) { SP_Config::setValue("mail_enabled", true); @@ -129,7 +129,7 @@ if ($frmAction == "config") { SP_Config::setValue("mail_security", $frmMailSecurity); SP_Config::setValue("mail_from", $frmMailFrom); - if ( $frmMailAuth ){ + if ($frmMailAuth) { SP_Config::setValue("mail_authenabled", $frmMailAuth); SP_Config::setValue("mail_user", $frmMailUser); SP_Config::setValue("mail_pass", $frmMailPass); @@ -142,7 +142,7 @@ if ($frmAction == "config") { if ($frmAllowedSize > 16384) { SP_Common::printJSON(_('El tamaño máximo de archivo es de 16MB')); - } + } SP_Config::setValue("allowed_exts", $frmAllowedExts); SP_Config::setValue("account_link", $frmAccountLink); @@ -199,14 +199,14 @@ if ($frmAction == "config") { } $hashMPass = SP_Crypt::mkHashPassword($newMasterPass); - + if (!$noAccountPassChange) { $objAccount = new SP_Account; if (!$objAccount->updateAllAccountsMPass($currentMasterPass, $newMasterPass)) { SP_Common::printJSON(_('Errores al actualizar las claves de las cuentas')); } - + $objAccount->updateAllAccountsHistoryMPass($currentMasterPass, $newMasterPass, $hashMPass); } @@ -216,14 +216,14 @@ if ($frmAction == "config") { SP_Config::$arrConfigValue["masterPwd"] = $hashMPass; SP_Config::$arrConfigValue["lastupdatempass"] = time(); - + if (SP_Config::writeConfig()) { $message['action'] = _('Actualizar Clave Maestra'); SP_Common::sendEmail($message); SP_Common::printJSON(_('Clave maestra actualizada'), 0); } - + SP_Common::printJSON(_('Error al guardar el hash de la clave maestra')); } else { SP_Common::printJSON(_('Acción Inválida')); diff --git a/ajax/ajax_doLogin.php b/ajax/ajax_doLogin.php index d21d2d41..1f9771ba 100644 --- a/ajax/ajax_doLogin.php +++ b/ajax/ajax_doLogin.php @@ -2,11 +2,11 @@ /** * sysPass - * - * @author nuxsmin - * @link http://syspass.org + * + * @author nuxsmin + * @link http://syspass.org * @copyright 2012-2015 Rubén Domínguez nuxsmin@syspass.org - * + * * This file is part of sysPass. * * sysPass is free software: you can redistribute it and/or modify @@ -25,7 +25,7 @@ */ define('APP_ROOT', '..'); -require_once APP_ROOT.DIRECTORY_SEPARATOR.'inc'.DIRECTORY_SEPARATOR.'init.php'; +require_once APP_ROOT . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'init.php'; SP_Util::checkReferer('POST'); @@ -41,7 +41,7 @@ if (!$userLogin || !$userPass) { SP_Common::printJSON(_('Usuario/Clave no introducidos')); } -$resLdap = SP_Auth::authUserLDAP($userLogin,$userPass); +$resLdap = SP_Auth::authUserLDAP($userLogin, $userPass); $objUser = new SP_Users; $objUser->userLogin = $userLogin; @@ -96,7 +96,7 @@ if ($resLdap === true) { $message['action'] = _('Inicio sesión (MySQL)'); // Autentificamos con la BBDD - if (!SP_Auth::authUserMySQL($userLogin,$userPass)) { + if (!SP_Auth::authUserMySQL($userLogin, $userPass)) { $message['text'][] = _('Login incorrecto'); $message['text'][] = _('Usuario') . ": " . $userLogin; SP_Log::wrLogInfo($message); @@ -123,7 +123,7 @@ if (!$objUser->getUserInfo()) { } // Comprobamos que la clave maestra del usuario es correcta y está actualizada -if (!$masterPass && (!$objUser->checkUserMPass() || !SP_Users::checkUserUpdateMPass($userLogin) )) { +if (!$masterPass && (!$objUser->checkUserMPass() || !SP_Users::checkUserUpdateMPass($userLogin))) { SP_Common::printJSON(_('La clave maestra no ha sido guardada o es incorrecta'), 3); } elseif ($masterPass) { if (!$objUser->updateUserMPass($masterPass)) { @@ -135,10 +135,10 @@ if (!$masterPass && (!$objUser->checkUserMPass() || !SP_Users::checkUserUpdateMP } // Comprobar si se ha forzado un cambio de clave -if ($objUser->userChangePass){ +if ($objUser->userChangePass) { $hash = SP_Util::generate_random_bytes(); - if (SP_Users::addPassRecover($userLogin, $hash)){ + if (SP_Users::addPassRecover($userLogin, $hash)) { $url = SP_Init::$WEBURI . '/index.php?a=passreset&h=' . $hash . '&t=' . time() . '&f=1'; SP_Common::printJSON($url, 0); } @@ -154,15 +154,15 @@ if ($objUser->getUserMPass()) { $message['text'][] = _('Grupo') . ": " . SP_Groups::getGroupNameById($objUser->userGroupId); SP_Log::wrLogInfo($message); - + // Comprobar si existen parámetros adicionales en URL via GET - foreach ($_POST as $param => $value){ - if(preg_match('/g_.*/', $param)){ - $params[] = substr($param,2).'='.$value; + foreach ($_POST as $param => $value) { + if (preg_match('/g_.*/', $param)) { + $params[] = substr($param, 2) . '=' . $value; } } - - $urlParams = isset($params) ? '?'.implode('&', $params) : ''; - - SP_Common::printJSON('index.php'.$urlParams, 0); + + $urlParams = isset($params) ? '?' . implode('&', $params) : ''; + + SP_Common::printJSON('index.php' . $urlParams, 0); } \ No newline at end of file diff --git a/ajax/ajax_eventlog.php b/ajax/ajax_eventlog.php index 07811d96..cfaf781f 100644 --- a/ajax/ajax_eventlog.php +++ b/ajax/ajax_eventlog.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link http://syspass.org -* @copyright 2012-2015 Rubén Domínguez nuxsmin@syspass.org + * @copyright 2012-2015 Rubén Domínguez nuxsmin@syspass.org * * This file is part of sysPass. * @@ -24,7 +24,7 @@ */ define('APP_ROOT', '..'); -require_once APP_ROOT.DIRECTORY_SEPARATOR.'inc'.DIRECTORY_SEPARATOR.'init.php'; +require_once APP_ROOT . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'init.php'; SP_Util::checkReferer('POST'); @@ -38,10 +38,10 @@ $start = SP_Common::parseParams('p', 'start', 0); $clear = SP_Common::parseParams('p', 'clear', 0); $sk = SP_Common::parseParams('p', 'sk', false); -if ( $clear && $sk && SP_Common::checkSessionKey($sk) ){ - if ( SP_Log::clearEvents() ){ +if ($clear && $sk && SP_Common::checkSessionKey($sk)) { + if (SP_Log::clearEvents()) { SP_Common::printJSON(_('Registro de eventos vaciado'), 0, "doAction('eventlog');scrollUp();"); - } else{ + } else { SP_Common::printJSON(_('Error al vaciar el registro de eventos')); } } diff --git a/ajax/ajax_files.php b/ajax/ajax_files.php index 22c41fae..162e8e1d 100644 --- a/ajax/ajax_files.php +++ b/ajax/ajax_files.php @@ -26,7 +26,7 @@ // TODO: comprobar permisos para eliminar archivos define('APP_ROOT', '..'); -require_once APP_ROOT.DIRECTORY_SEPARATOR.'inc'.DIRECTORY_SEPARATOR.'init.php'; +require_once APP_ROOT . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'init.php'; SP_Util::checkReferer('POST'); @@ -116,7 +116,7 @@ if ($action == 'download' || $action == 'view') { exit(_('No es un ID de archivo válido')); } - $isView = ( $action == 'view' ) ? true : false; + $isView = ($action == 'view') ? true : false; $file = SP_Files::fileDownload($fileId); diff --git a/ajax/ajax_getContent.php b/ajax/ajax_getContent.php index 500ca10c..d8ede047 100644 --- a/ajax/ajax_getContent.php +++ b/ajax/ajax_getContent.php @@ -3,8 +3,8 @@ /** * sysPass * - * @author nuxsmin - * @link http://syspass.org + * @author nuxsmin + * @link http://syspass.org * @copyright 2012-2015 Rubén Domínguez nuxsmin@syspass.org * * This file is part of sysPass. diff --git a/ajax/ajax_getFiles.php b/ajax/ajax_getFiles.php index 913150ad..b5c209b3 100644 --- a/ajax/ajax_getFiles.php +++ b/ajax/ajax_getFiles.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link http://syspass.org + * @author nuxsmin + * @link http://syspass.org * @copyright 2012-2015 Rubén Domínguez nuxsmin@syspass.org * * This file is part of sysPass. diff --git a/ajax/ajax_import.php b/ajax/ajax_import.php index 0272aaab..f05bb901 100644 --- a/ajax/ajax_import.php +++ b/ajax/ajax_import.php @@ -1 +1 @@ -. * */ define('APP_ROOT', '..'); require_once APP_ROOT.DIRECTORY_SEPARATOR.'inc'.DIRECTORY_SEPARATOR.'init.php'; SP_Util::checkReferer('POST'); if (!SP_Init::isLoggedIn()) { SP_Common::printJSON(_('La sesión no se ha iniciado o ha caducado'), 10); } if (SP_Util::demoIsEnabled()) { SP_Common::printJSON(_('Ey, esto es una DEMO!!')); } $sk = SP_Common::parseParams('p', 'sk', false); if (!$sk || !SP_Common::checkSessionKey($sk)) { SP_Common::printJSON(_('CONSULTA INVÁLIDA')); } $res = SP_Import::doImport($_FILES["inFile"]); if (isset($res['error']) && is_array($res['error'])) { foreach ($res['error'] as $error) { $errors [] = $error['description']; $errors [] = $error['hint']; error_log($error['hint']); } $out = implode('\n\n', $errors); SP_Common::printJSON($out); } else if (is_array($res['ok'])) { $out = implode('\n\n', $res['ok']); SP_Common::printJSON($out, 0); } \ No newline at end of file +. * */ define('APP_ROOT', '..'); require_once APP_ROOT . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'init.php'; SP_Util::checkReferer('POST'); if (!SP_Init::isLoggedIn()) { SP_Common::printJSON(_('La sesión no se ha iniciado o ha caducado'), 10); } if (SP_Util::demoIsEnabled()) { SP_Common::printJSON(_('Ey, esto es una DEMO!!')); } $sk = SP_Common::parseParams('p', 'sk', false); if (!$sk || !SP_Common::checkSessionKey($sk)) { SP_Common::printJSON(_('CONSULTA INVÁLIDA')); } $res = SP_Import::doImport($_FILES["inFile"]); if (isset($res['error']) && is_array($res['error'])) { foreach ($res['error'] as $error) { $errors [] = $error['description']; $errors [] = $error['hint']; error_log($error['hint']); } $out = implode('\n\n', $errors); SP_Common::printJSON($out); } else if (is_array($res['ok'])) { $out = implode('\n\n', $res['ok']); SP_Common::printJSON($out, 0); } \ No newline at end of file diff --git a/ajax/ajax_migrate.php b/ajax/ajax_migrate.php index 17dcc5f8..555075e0 100644 --- a/ajax/ajax_migrate.php +++ b/ajax/ajax_migrate.php @@ -1 +1 @@ -. * */ define('APP_ROOT', '..'); require_once APP_ROOT.DIRECTORY_SEPARATOR.'inc'.DIRECTORY_SEPARATOR.'init.php'; SP_Util::checkReferer('POST'); if (!SP_Init::isLoggedIn()) { SP_Common::printJSON(_('La sesión no se ha iniciado o ha caducado'), 10); } if (SP_Util::demoIsEnabled()) { SP_Common::printJSON(_('Ey, esto es una DEMO!!')); } $sk = SP_Common::parseParams('p', 'sk', false); if (!$sk || !SP_Common::checkSessionKey($sk)) { SP_Common::printJSON(_('CONSULTA INVÁLIDA')); } $frmDBUser = SP_Common::parseParams('p', 'dbuser'); $frmDBPass = SP_Common::parseParams('p', 'dbpass'); $frmDBName = SP_Common::parseParams('p', 'dbname'); $frmDBHost = SP_Common::parseParams('p', 'dbhost'); $frmMigrateEnabled = SP_Common::parseParams('p', 'chkmigrate', 0, false, 1); if (!$frmMigrateEnabled) { SP_Common::printJSON(_('Confirmar la importación de cuentas')); } if (!$frmDBUser) { SP_Common::printJSON(_('Es necesario un usuario de conexión')); } if (!$frmDBPass) { SP_Common::printJSON(_('Es necesaria una clave de conexión')); } if (!$frmDBName) { SP_Common::printJSON(_('Es necesario el nombre de la BBDD')); } if (!$frmDBHost) { SP_Common::printJSON(_('Es necesario un nombre de host')); } $options['dbhost'] = $frmDBHost; $options['dbname'] = $frmDBName; $options['dbuser'] = $frmDBUser; $options['dbpass'] = $frmDBPass; $res = SP_Migrate::migrate($options); if (is_array($res['error'])) { foreach ($res['error'] as $error) { $errors [] = $error['description']; $errors [] = $error['hint']; error_log($error['hint']); } $out = implode('
', $errors); SP_Common::printJSON($out); } else if (is_array($res['ok'])) { $out = implode('
', $res['ok']); SP_Common::printJSON($out, 0); } \ No newline at end of file +. * */ define('APP_ROOT', '..'); require_once APP_ROOT . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'init.php'; SP_Util::checkReferer('POST'); if (!SP_Init::isLoggedIn()) { SP_Common::printJSON(_('La sesión no se ha iniciado o ha caducado'), 10); } if (SP_Util::demoIsEnabled()) { SP_Common::printJSON(_('Ey, esto es una DEMO!!')); } $sk = SP_Common::parseParams('p', 'sk', false); if (!$sk || !SP_Common::checkSessionKey($sk)) { SP_Common::printJSON(_('CONSULTA INVÁLIDA')); } $frmDBUser = SP_Common::parseParams('p', 'dbuser'); $frmDBPass = SP_Common::parseParams('p', 'dbpass'); $frmDBName = SP_Common::parseParams('p', 'dbname'); $frmDBHost = SP_Common::parseParams('p', 'dbhost'); $frmMigrateEnabled = SP_Common::parseParams('p', 'chkmigrate', 0, false, 1); if (!$frmMigrateEnabled) { SP_Common::printJSON(_('Confirmar la importación de cuentas')); } if (!$frmDBUser) { SP_Common::printJSON(_('Es necesario un usuario de conexión')); } if (!$frmDBPass) { SP_Common::printJSON(_('Es necesaria una clave de conexión')); } if (!$frmDBName) { SP_Common::printJSON(_('Es necesario el nombre de la BBDD')); } if (!$frmDBHost) { SP_Common::printJSON(_('Es necesario un nombre de host')); } $options['dbhost'] = $frmDBHost; $options['dbname'] = $frmDBName; $options['dbuser'] = $frmDBUser; $options['dbpass'] = $frmDBPass; $res = SP_Migrate::migrate($options); if (is_array($res['error'])) { foreach ($res['error'] as $error) { $errors [] = $error['description']; $errors [] = $error['hint']; error_log($error['hint']); } $out = implode('
', $errors); SP_Common::printJSON($out); } else if (is_array($res['ok'])) { $out = implode('
', $res['ok']); SP_Common::printJSON($out, 0); } \ No newline at end of file diff --git a/ajax/ajax_passReset.php b/ajax/ajax_passReset.php index 9a0eb9d9..55d647c2 100644 --- a/ajax/ajax_passReset.php +++ b/ajax/ajax_passReset.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link http://syspass.org + * @author nuxsmin + * @link http://syspass.org * @copyright 2012-2015 Rubén Domínguez nuxsmin@syspass.org * * This file is part of sysPass. @@ -24,7 +24,7 @@ */ define('APP_ROOT', '..'); -require_once APP_ROOT.DIRECTORY_SEPARATOR.'inc'.DIRECTORY_SEPARATOR.'init.php'; +require_once APP_ROOT . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'init.php'; SP_Util::checkReferer('POST'); diff --git a/ajax/ajax_search.php b/ajax/ajax_search.php index bc9a3637..32aa1ba5 100644 --- a/ajax/ajax_search.php +++ b/ajax/ajax_search.php @@ -2,8 +2,8 @@ /** * sysPass * - * @author nuxsmin - * @link http://syspass.org + * @author nuxsmin + * @link http://syspass.org * @copyright 2012-2015 Rubén Domínguez nuxsmin@syspass.org * * This file is part of sysPass. @@ -160,9 +160,9 @@ foreach ($resQuery as $account) { $color = array_rand($colors); if (!isset($customerColor)) { - $customerColor[$account->account_customerId] = '#'.$colors[$color]; + $customerColor[$account->account_customerId] = '#' . $colors[$color]; } elseif (isset($customerColor) && !array_key_exists($account->account_customerId, $customerColor)) { - $customerColor[$account->account_customerId] = '#'.$colors[$color]; + $customerColor[$account->account_customerId] = '#' . $colors[$color]; } //$hexColor = $customerColor[$account->account_customerId][0]; @@ -218,7 +218,7 @@ foreach ($resQuery as $account) { } } - if ($account->account_notes){ + if ($account->account_notes) { $strAccNotes = (strlen($account->account_notes) > 300) ? substr($account->account_notes, 0, 300) . "..." : $account->account_notes; $strAccNotes = nl2br(wordwrap(htmlspecialchars($strAccNotes), 50, '
', true)); } @@ -334,17 +334,17 @@ SP_Html::printQuerySearchNavBar($sortKey, $arrSearchFilter["limitStart"], $objAc \ No newline at end of file diff --git a/ajax/ajax_sendRequest.php b/ajax/ajax_sendRequest.php index f68ad25b..bf297db9 100644 --- a/ajax/ajax_sendRequest.php +++ b/ajax/ajax_sendRequest.php @@ -3,8 +3,8 @@ /** * sysPass * - * @author nuxsmin - * @link http://syspass.org + * @author nuxsmin + * @link http://syspass.org * @copyright 2012-2015 Rubén Domínguez nuxsmin@syspass.org * * This file is part of sysPass. @@ -24,7 +24,7 @@ * */ define('APP_ROOT', '..'); -require_once APP_ROOT.DIRECTORY_SEPARATOR.'inc'.DIRECTORY_SEPARATOR.'init.php'; +require_once APP_ROOT . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'init.php'; SP_Util::checkReferer('POST'); diff --git a/ajax/ajax_usrpass.php b/ajax/ajax_usrpass.php index 5eb1b9f2..20960fd3 100644 --- a/ajax/ajax_usrpass.php +++ b/ajax/ajax_usrpass.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link http://syspass.org -* @copyright 2012-2015 Rubén Domínguez nuxsmin@syspass.org + * @copyright 2012-2015 Rubén Domínguez nuxsmin@syspass.org * * This file is part of sysPass. * @@ -24,7 +24,7 @@ */ define('APP_ROOT', '..'); -require_once APP_ROOT.DIRECTORY_SEPARATOR.'inc'.DIRECTORY_SEPARATOR.'init.php'; +require_once APP_ROOT . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR . 'init.php'; SP_Util::checkReferer('GET'); @@ -40,7 +40,7 @@ if ( ! $userId ) { $strError = '
'._('No tiene permisos para realizar esta operación').'
'; -SP_ACL::checkUserAccess("acceditpass",$userId) || die ($strError); +SP_ACL::checkUserAccess("acceditpass", $userId) || die ($strError); ?> @@ -54,7 +54,8 @@ SP_ACL::checkUserAccess("acceditpass",$userId) || die ($strError); - + @@ -62,7 +63,7 @@ SP_ACL::checkUserAccess("acceditpass",$userId) || die ($strError); - + @@ -78,13 +79,14 @@ SP_ACL::checkUserAccess("acceditpass",$userId) || die ($strError);
  • - <?php echo _('Guardar'); ?> + <?php echo _('Guardar'); ?>
+ @@ -479,7 +483,7 @@ $maxFileSize = round(SP_Config::getValue('files_allowed_size') / 1024, 1); - user_editName) ? $accountData->user_editName : $accountData->user_editLogin ; ?> + user_editName) ? $accountData->user_editName : $accountData->user_editLogin; ?> @@ -499,70 +503,71 @@ $maxFileSize = round(SP_Config::getValue('files_allowed_size') / 1024, 1);
    accountIsHistory): ?> -
  • - -
  • - -
  • - -
  • +
  • + +
  • + +
  • + +
  • - -
  • - -
  • + +
  • + +
  • - -
  • - -
  • -
  • - -
  • + +
  • + +
  • +
  • + +
  • - -
  • - -
  • + +
  • + +
  • - -
  • - -
  • + +
  • + +
  • - -
  • - -
  • - -
  • - -
  • + +
  • + +
  • + +
  • + +
  • - +
  • - +
@@ -596,7 +601,9 @@ $maxFileSize = round(SP_Config::getValue('files_allowed_size') / 1024, 1); } }); - $('#passGen').click(function(){password(11, true, true);}); + $('#passGen').click(function () { + password(11, true, true); + }); @@ -606,19 +613,19 @@ $maxFileSize = round(SP_Config::getValue('files_allowed_size') / 1024, 1); \ No newline at end of file diff --git a/inc/tpl/backup.php b/inc/tpl/backup.php index 431f3cc7..24f05b05 100644 --- a/inc/tpl/backup.php +++ b/inc/tpl/backup.php @@ -68,7 +68,7 @@ $lastBackupTime = (file_exists($backupFile['absolute'])) ? _('Último backup') .
- + diff --git a/inc/tpl/categories.php b/inc/tpl/categories.php index f4c761c1..77ac415c 100644 --- a/inc/tpl/categories.php +++ b/inc/tpl/categories.php @@ -32,36 +32,41 @@ $activeTab = $data['activeTab'];

+ - - - - + + + + - - - - + + + +
- " /> -
+ "/> +
" /> -
"/> +
- - - - " /> - " /> - + + + + "/> + "/> +
    -
  • +
\ No newline at end of file diff --git a/inc/tpl/config.php b/inc/tpl/config.php index f10a6f27..24340fdd 100644 --- a/inc/tpl/config.php +++ b/inc/tpl/config.php @@ -30,33 +30,33 @@ $activeTab = $data['activeTab']; $onCloseAction = $data['onCloseAction']; SP_ACL::checkUserAccess($action) || SP_Html::showCommonError('unavailable'); - + $arrLangAvailable = array( 'Español' => 'es_ES', 'English' => 'en_US', 'Deutsch' => 'de_DE', 'Magyar' => 'hu_HU', 'Français' => 'fr_FR'); -$arrAccountCount = array(6,9,12,15,21,27,30,51,99); -$mailSecurity = array('SSL','TLS'); +$arrAccountCount = array(6, 9, 12, 15, 21, 27, 30, 51, 99); +$mailSecurity = array('SSL', 'TLS'); $isDemoMode = SP_Util::demoIsEnabled(); -$isDisabled = ( $isDemoMode ) ? "DISABLED" : ""; -$chkLog = ( SP_Config::getValue('log_enabled') ) ? 'checked="checked"' : ''; +$isDisabled = ($isDemoMode) ? "DISABLED" : ""; +$chkLog = (SP_Config::getValue('log_enabled')) ? 'checked="checked"' : ''; $chkDebug = ( SP_Config::getValue('debug') ) ? 'checked="checked"' : ''; $chkMaintenance = ( SP_Config::getValue('maintenance') ) ? 'checked="checked"' : ''; $chkUpdates = ( SP_Config::getValue('checkupdates') ) ? 'checked="checked"' : ''; -$chkGlobalSearch = ( SP_Config::getValue('globalsearch') ) ? 'checked="checked"' : ''; +$chkGlobalSearch = (SP_Config::getValue('globalsearch')) ? 'checked="checked"' : ''; $chkAccountLink = ( SP_Config::getValue('account_link') ) ? 'checked="checked"' : ''; -$chkFiles = ( SP_Config::getValue('files_enabled') ) ? 'checked="checked"' : ''; -$chkWiki = ( SP_Config::getValue('wiki_enabled') ) ? 'checked="checked"' : ''; -$chkLdap = ( SP_Config::getValue('ldap_enabled') ) ? 'checked="checked"' : ''; -$chkLdapADS = ( SP_Config::getValue('ldap_ads') ) ? 'checked="checked"' : ''; -$chkMail = ( SP_Config::getValue('mail_enabled') ) ? 'checked="checked"' : ''; -$chkMailRequests = ( SP_Config::getValue('mail_requestsenabled') ) ? 'checked="checked"' : ''; -$chkMailAuth = ( SP_Config::getValue('mail_authenabled') ) ? 'checked="checked"' : ''; -$chkResultsAsCards = ( SP_Config::getValue('resultsascards') ) ? 'checked="checked"' : ''; +$chkFiles = (SP_Config::getValue('files_enabled')) ? 'checked="checked"' : ''; +$chkWiki = (SP_Config::getValue('wiki_enabled')) ? 'checked="checked"' : ''; +$chkLdap = (SP_Config::getValue('ldap_enabled')) ? 'checked="checked"' : ''; +$chkLdapADS = (SP_Config::getValue('ldap_ads')) ? 'checked="checked"' : ''; +$chkMail = (SP_Config::getValue('mail_enabled')) ? 'checked="checked"' : ''; +$chkMailRequests = (SP_Config::getValue('mail_requestsenabled')) ? 'checked="checked"' : ''; +$chkMailAuth = (SP_Config::getValue('mail_authenabled')) ? 'checked="checked"' : ''; +$chkResultsAsCards = (SP_Config::getValue('resultsascards')) ? 'checked="checked"' : ''; $allowedExts = SP_Config::getValue('files_allowed_exts'); $groupsSelProp = array('name' => 'ldap_defaultgroup', @@ -67,7 +67,7 @@ $groupsSelProp = array('name' => 'ldap_defaultgroup', 'selected' => SP_Config::getValue('ldap_defaultgroup'), 'default' => '', 'js' => '', - 'attribs' => array('required',$isDisabled)); + 'attribs' => array('required', $isDisabled)); $profilesSelProp = array('name' => 'ldap_defaultprofile', 'id' => 'ldap_defaultprofile', @@ -77,7 +77,7 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', 'selected' => SP_Config::getValue('ldap_defaultprofile'), 'default' => '', 'js' => '', - 'attribs' => array('required',$isDisabled)); + 'attribs' => array('required', $isDisabled)); ?>
@@ -92,9 +92,9 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', /> + /> @@ -116,7 +117,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', - /> + /> @@ -126,7 +128,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', - /> + /> @@ -136,7 +139,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', - /> + /> @@ -146,7 +150,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', - /> + /> @@ -156,7 +161,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', - /> + /> @@ -166,7 +172,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', - /> + /> @@ -176,7 +183,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', - /> + /> @@ -194,7 +202,9 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', - /> + /> @@ -204,9 +214,9 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', /> + /> @@ -238,7 +249,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', - /> + /> @@ -247,7 +259,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', - + @@ -256,7 +269,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', - + @@ -265,7 +279,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', - + @@ -277,7 +292,7 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile',
- + @@ -294,7 +310,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', @@ -303,7 +320,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', @@ -312,7 +330,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', @@ -321,7 +340,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', @@ -330,45 +350,48 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -398,7 +422,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', @@ -406,7 +431,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', @@ -415,7 +441,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', @@ -423,7 +450,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', @@ -431,7 +459,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', @@ -442,9 +471,9 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', @@ -465,20 +495,21 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile',
@@ -285,7 +300,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', - /> + />
- /> + />
- /> + />
- /> + />
- /> + />
- /> -
- - - - -
- - - - -
- - - - - /> -
- - - + />
+ + + + +
+ + + + +
+ + + + + /> +
+ + + +
@@ -390,7 +413,8 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile', - /> + />
- +
- +
- /> + />
- +
- +
- +
- /> + />
- - - + + + - - - - + + + + @@ -491,72 +522,72 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile',