/** * Creates a new user */ public function createAction() { if (!$this->request->isPost()) { return $this->dispatcher->forward(array("controller" => "security_group", "action" => "index")); } $security_group = new SecurityGroup(); $security_group->name = $this->request->getPost("name"); $security_group->description = $this->request->getPost("description"); $security_group->organisation_id = $this->request->getPost("organisation_id"); if (!$security_group->save()) { foreach ($security_group->getMessages() as $message) { $this->flash->error($message); } return $this->dispatcher->forward(array("namespace" => "PRIME\\Controllers", "controller" => "security_group", "action" => "index")); } $this->flash->success("Security Group was created successfully"); return $this->dispatcher->forward(array("namespace" => "PRIME\\Controllers", "controller" => "security_group", "action" => "index")); }