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);
-
-
+
+
@@ -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') .
@@ -491,72 +522,72 @@ $profilesSelProp = array('name' => 'ldap_defaultprofile',