mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
Update all controllers to standard behavior
This commit is contained in:
parent
18c7cb019d
commit
ccfc69baca
25 changed files with 112 additions and 125 deletions
|
@ -49,7 +49,7 @@ namespace controllers\publics;
|
|||
|
||||
foreach ($receiveds as $key => $received)
|
||||
{
|
||||
if (!$contact = $this->internal_contact->get_by_number($received['origin']))
|
||||
if (!$contact = $this->internal_contact->get_by_number_and_user($_SESSION['user']['id'], $received['origin']))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -78,19 +78,6 @@ namespace controllers\publics;
|
|||
$ids = $_GET['ids'] ?? [];
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
$received = $this->internal_received->get($id);
|
||||
|
||||
if (!$received)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$is_owner = (bool) $this->internal_phone->get_by_number_and_user($received['destination'], $_SESSION['user']['id']);
|
||||
if (!$is_owner)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->internal_received->delete_for_user($_SESSION['user']['id'], $id);
|
||||
}
|
||||
|
||||
|
@ -109,7 +96,7 @@ namespace controllers\publics;
|
|||
|
||||
foreach ($receiveds as $key => $received)
|
||||
{
|
||||
if (!$contact = $this->internal_contact->get_by_number($received['origin']))
|
||||
if (!$contact = $this->internal_contact->get_by_number_and_user($_SESSION['user']['id'], $received['origin']))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue