nonadminsmaysee
All checks were successful
Build and push / Pulling repo on server (push) Successful in 21s
All checks were successful
Build and push / Pulling repo on server (push) Successful in 21s
This commit is contained in:
@ -11,7 +11,8 @@ class Tournament extends Model
|
||||
'referee' => ['type' => 'text'],
|
||||
'text' => ['type' => 'text'],
|
||||
'url' => ['type' => 'text'], //if there is one
|
||||
'logo' => ['type' => 'text', 'default' => 'https://pictshare.net/prrnrk.jpg']
|
||||
'logo' => ['type' => 'text', 'default' => 'https://pictshare.net/prrnrk.jpg'],
|
||||
'admins' => ['type'=> 'array', 'default'=>[]],
|
||||
);
|
||||
|
||||
function isMyEvent($tournament = false)
|
||||
@ -27,4 +28,18 @@ class Tournament extends Model
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
|
||||
function amIAdmin($tournament = false)
|
||||
{
|
||||
if ($tournament == false)
|
||||
$tournament = $this->id;
|
||||
|
||||
if (!$this->exists($tournament))
|
||||
return false;
|
||||
else {
|
||||
if (in_array($_SESSION['user']->id, $this->data['admins']))
|
||||
return true;
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user