forked from ZwiiCMS-Team/ZwiiCampus
Désinscription okay
This commit is contained in:
parent
851f6421d6
commit
a39024fe92
@ -19,6 +19,7 @@ class course extends common
|
||||
public static $actions = [
|
||||
'swap' => self::GROUP_VISITOR,
|
||||
'suscribe' => self::GROUP_VISITOR,
|
||||
'unsuscribe' => self::GROUP_VISITOR,
|
||||
'index' => self::GROUP_ADMIN,
|
||||
'edit' => self::GROUP_ADMIN,
|
||||
'add' => self::GROUP_ADMIN,
|
||||
@ -770,6 +771,20 @@ class course extends common
|
||||
}
|
||||
}
|
||||
|
||||
public function unsuscribe()
|
||||
{
|
||||
$courseId = $this->getUrl(2);
|
||||
$userId = $this->getUser('id');
|
||||
$this->deleteData(['enrolment', $courseId, $userId]);
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl(),
|
||||
'notification' => helper::translate('Désinscription'),
|
||||
'state' => true,
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Autorise l'accès à un cours
|
||||
|
Loading…
Reference in New Issue
Block a user