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:
@ -44,6 +44,8 @@ class Tournaments extends Page {
|
||||
|
||||
$t->load($tid);
|
||||
|
||||
$this->set('admin',$t->amIAdmin($tid));
|
||||
$this->set('joined',$t->isMyEvent($tid));
|
||||
$this->set('tournament_id',$tid);
|
||||
$this->set('tdata',$t->data);
|
||||
$this->set('template','event.html');
|
||||
@ -111,7 +113,12 @@ class Tournaments extends Page {
|
||||
{
|
||||
$t = new Tournament();
|
||||
if($id)
|
||||
$t->load($id);
|
||||
{
|
||||
if(!in_array($_SESSION['user']->id, $t->data['admins']))
|
||||
return partial('error.html', ['errorTitle' => 'Error', 'errorMessage' => 'Du bist nicht berechtigt, dieses Turnier zu bearbeiten']);
|
||||
else
|
||||
$t->load($id);
|
||||
}
|
||||
|
||||
$t->name = $name;
|
||||
$t->date = $date;
|
||||
@ -119,6 +126,8 @@ class Tournaments extends Page {
|
||||
$t->referee = $tournament_referee;
|
||||
$t->text = $tournament_text;
|
||||
$t->url = $tournament_url;
|
||||
if(!in_array($_SESSION['user']->id, $t->data['admins']))
|
||||
$t->data['admins'][] = $_SESSION['user']->id;
|
||||
if($newlogo)
|
||||
$t->logo = $newlogo;
|
||||
|
||||
|
Reference in New Issue
Block a user