Skip to content

Commit

Permalink
Do not checkout a record when the user is not logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed Sep 21, 2022
1 parent 614a463 commit d660eb9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libraries/src/MVC/Model/FormModel.php
Expand Up @@ -129,6 +129,13 @@ public function checkin($pk = null)
*/
public function checkout($pk = null)
{
$user = $this->getCurrentUser();

// When the user is a guest, don't do a checkout
if (!$user->id) {
return true;
}

// Only attempt to check the row in if it exists.
if ($pk) {
// Get an instance of the row to checkout.
Expand All @@ -150,7 +157,6 @@ public function checkout($pk = null)
return true;
}

$user = $this->getCurrentUser();
$checkedOutField = $table->getColumnAlias('checked_out');

// Check if this is the user having previously checked out the row.
Expand Down

0 comments on commit d660eb9

Please sign in to comment.