mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-04 15:44:07 +01:00
* [FIX] Solves #435. Wrong returning code when updating a record and data is the same stored. Thanks to @wernerreuser for the feedback.
This commit is contained in:
@@ -199,10 +199,6 @@ class Customer extends CustomerBase implements ItemInterface, ItemSelectInterfac
|
||||
|
||||
DB::getQuery($Data);
|
||||
|
||||
if ($Data->getQueryNumRows() === 0) {
|
||||
throw new SPException(SPException::SP_INFO, __('Cliente no encontrado', false));
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,10 +82,10 @@ class Notice extends NoticeBase implements ItemInterface
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
$query = 'DELETE FROM notices WHERE notice_id = ? AND BIN(notice_sticky) = 0 LIMIT 1';
|
||||
|
||||
if (Session::getUserData()->isUserIsAdminApp()) {
|
||||
$query = 'DELETE FROM notices WHERE notice_id = ? LIMIT 1';
|
||||
} else {
|
||||
$query = 'DELETE FROM notices WHERE notice_id = ? AND BIN(notice_sticky) = 0 LIMIT 1';
|
||||
}
|
||||
|
||||
$Data = new QueryData();
|
||||
@@ -133,10 +133,6 @@ class Notice extends NoticeBase implements ItemInterface
|
||||
|
||||
DB::getQuery($Data);
|
||||
|
||||
if ($Data->getQueryNumRows() === 0) {
|
||||
throw new SPException(SPException::SP_INFO, __('Notificación no encontrada', false));
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
@@ -116,10 +116,6 @@ class Plugin extends PluginBase implements ItemInterface
|
||||
|
||||
DB::getQuery($Data);
|
||||
|
||||
if ($Data->getQueryNumRows() === 0) {
|
||||
throw new SPException(SPException::SP_INFO, __('Plugin no encontrado', false));
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
@@ -197,12 +197,10 @@ class Profile extends ProfileBase implements ItemInterface, ItemSelectInterface
|
||||
|
||||
DB::getQuery($Data);
|
||||
|
||||
if ($Data->getQueryNumRows() === 0) {
|
||||
throw new SPException(SPException::SP_INFO, __('Perfil no encontrado', false));
|
||||
if ($Data->getQueryNumRows() > 0) {
|
||||
$this->updateSessionProfile();
|
||||
}
|
||||
|
||||
$this->updateSessionProfile();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,10 +105,6 @@ class PublicLink extends PublicLinkBase implements ItemInterface
|
||||
|
||||
DB::getQuery($Data);
|
||||
|
||||
if ($Data->getQueryNumRows() === 0) {
|
||||
throw new SPException(SPException::SP_INFO, __('Enlace no encontrado', false));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -138,10 +138,6 @@ class Tag extends TagBase implements ItemInterface, ItemSelectInterface
|
||||
|
||||
DB::getQuery($Data);
|
||||
|
||||
if ($Data->getQueryNumRows() === 0) {
|
||||
throw new SPException(SPException::SP_INFO, __('Etiqueta no encontrada', false));
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
@@ -184,12 +184,10 @@ class User extends UserBase implements ItemInterface, ItemSelectInterface
|
||||
|
||||
DB::getQuery($Data);
|
||||
|
||||
if ($Data->getQueryNumRows() === 0) {
|
||||
throw new SPException(SPException::SP_INFO, __('Usuario no encontrado', false));
|
||||
if ($Data->getQueryNumRows() > 0) {
|
||||
$this->itemData->setUserId(DB::getLastId());
|
||||
}
|
||||
|
||||
$this->itemData->setUserId(DB::getLastId());
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user