示例#1
0
 } elseif ($newMasterPass == '' && $currentMasterPass == '') {
     SP\Response::printJSON(_('Clave maestra no indicada'));
 } elseif ($confirmPassChange == 0) {
     SP\Response::printJSON(_('Se ha de confirmar el cambio de clave'));
 }
 if ($newMasterPass == $currentMasterPass) {
     SP\Response::printJSON(_('Las claves son idénticas'));
 } elseif ($newMasterPass != $newMasterPassR) {
     SP\Response::printJSON(_('Las claves maestras no coinciden'));
 } elseif (!SP\Crypt::checkHashPass($currentMasterPass, ConfigDB::getValue('masterPwd'), true)) {
     SP\Response::printJSON(_('La clave maestra actual no coincide'));
 }
 $hashMPass = SP\Crypt::mkHashPassword($newMasterPass);
 if (!$noAccountPassChange) {
     $Account = new SP\Account();
     if (!$Account->updateAccountsMasterPass($currentMasterPass, $newMasterPass)) {
         SP\Response::printJSON(_('Errores al actualizar las claves de las cuentas'));
     }
     $AccountHistory = new SP\AccountHistory();
     if (!$AccountHistory->updateAccountsMasterPass($currentMasterPass, $newMasterPass, $hashMPass)) {
         SP\Response::printJSON(_('Errores al actualizar las claves de las cuentas del histórico'));
     }
     if (!\SP\CustomFields::updateCustomFieldsCrypt($currentMasterPass, $newMasterPass)) {
         SP\Response::printJSON(_('Errores al actualizar datos de campos personalizados'));
     }
 }
 if (SP\Util::demoIsEnabled()) {
     SP\Response::printJSON(_('Ey, esto es una DEMO!!'));
 }
 //    ConfigDB::readConfig();
 ConfigDB::setCacheConfigValue('masterPwd', $hashMPass);