public function __construct() { $groups = new Groups(); $doc = new Documents(); /** * Wenn gepostet wurde */ if ($_POST) { // Gruppe wird erstellt if (isset($_POST["group_name"])) { $groups->saveGroup($this->saveInputs($_POST["group_name"]), $this->saveInputs($_POST["group_description"]), get_current_user_id()); } // User wird hinzugefügt if (isset($_POST["userToAdd"])) { $groups->addUser($this->saveInputs($_POST["group_id"]), $this->saveInputs($_POST["userToAdd"])); } if (isset($_POST["userToDelete"])) { $groups->deleteUser($this->saveInputs($_POST["group_id"]), $this->saveInputs($_POST["userToDelete"])); } } // Bestimmte ID wird abgefragt if (isset($_GET["id"])) { $user = wp_get_current_user(); $detailGroup = $groups->getGroupAndUsers($this->saveInputs($_GET["id"])); $detailGroup->userToAdd = array(); if ($user->roles[0] == "dokuAdmin" || $user->roles[0] == "administrator") { $detailGroup->userToAdd = $groups->getUserNotInGroup($this->saveInputs($_GET["id"])); } $documentsInGroup = $doc->getDocumentsInGroup($this->saveInputs($_GET["id"])); echo $this->detailView($detailGroup, $documentsInGroup); } else { $arGroups = $groups->getAuthGroups(); echo $this->groupView($arGroups); } }