mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 01:25:39 +00:00
auto-approve magnets by users approved
This commit is contained in:
parent
7b1fdc9018
commit
14c35feca6
2 changed files with 19 additions and 5 deletions
|
|
@ -234,6 +234,13 @@ switch (isset($_GET['target']) ? urldecode($_GET['target']) : false)
|
|||
$response->message = _('Could not init user session');
|
||||
}
|
||||
|
||||
// Get user
|
||||
else if (!$user = $db->getUser($userId))
|
||||
{
|
||||
$response->success = false;
|
||||
$response->message = _('Could not init user info');
|
||||
}
|
||||
|
||||
// Validate link
|
||||
if (empty($_GET['magnet']))
|
||||
{
|
||||
|
|
@ -266,7 +273,7 @@ switch (isset($_GET['target']) ? urldecode($_GET['target']) : false)
|
|||
// Init magnet
|
||||
if (Yggverse\Parser\Urn::parse($magnet->xt))
|
||||
{
|
||||
if ($magnetId = $db->initMagnetId($userId,
|
||||
if ($magnetId = $db->initMagnetId($user->userId,
|
||||
strip_tags($magnet->xt),
|
||||
strip_tags($magnet->xl),
|
||||
strip_tags($magnet->dn),
|
||||
|
|
@ -274,7 +281,7 @@ switch (isset($_GET['target']) ? urldecode($_GET['target']) : false)
|
|||
MAGNET_DEFAULT_PUBLIC,
|
||||
MAGNET_DEFAULT_COMMENTS,
|
||||
MAGNET_DEFAULT_SENSITIVE,
|
||||
MAGNET_DEFAULT_APPROVED,
|
||||
$user->approved ? true : MAGNET_DEFAULT_APPROVED,
|
||||
time()))
|
||||
{
|
||||
foreach ($magnet as $key => $value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue