private function handleUserPost() { $request = Request::getInstance(); $user = new NewsLetterUser($this->plugin); $usr_used = $request->getValue('usr_used'); if (!$usr_used) { $usr_used = array(); } try { if (!$request->exists('id')) { throw new Exception('User group is missing.'); } $id = intval($request->getValue('id')); $key = array('id' => $id); $this->removeUser($key); foreach ($usr_used as $item) { $user->addGroup(array('id' => $item), $key); } viewManager::getInstance()->setType(NewsLetter::VIEW_GROUP_OVERVIEW); $this->handleOverview(); } catch (Exception $e) { $template = new TemplateEngine(); $template->setVariable('errorMessage', $e->getMessage(), false); $this->handleUserGet(false); } }