mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 09:35:28 +00:00
add magnet form lock to prevent moderation overwrite
This commit is contained in:
parent
3ffe4a8651
commit
64e841ec4c
4 changed files with 39 additions and 1 deletions
|
|
@ -155,6 +155,20 @@ else if (!($user->address == $db->getUser($magnet->userId)->address || in_array(
|
|||
// Process form
|
||||
else {
|
||||
|
||||
// Validate magnet lock
|
||||
if ($lastMagnetLock = $db->findLastMagnetLock($magnet->magnetId))
|
||||
{
|
||||
if ($lastMagnetLock->userId != $user->userId &&
|
||||
$lastMagnetLock->timeAdded > time() - MAGNET_EDITOR_LOCK_TIMEOUT)
|
||||
{
|
||||
$response->success = false;
|
||||
$response->message = _('This form have opened by owner or moderator, to prevent overwriting, try attempt later!');
|
||||
}
|
||||
}
|
||||
|
||||
// Lock form for moderators
|
||||
$db->addMagnetLock($magnet->magnetId, $user->userId, time());
|
||||
|
||||
// Update form
|
||||
if (!empty($_POST)) {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue