public function create_apikey() { $this->muser->require_access("full"); $userid = $this->muser->get_userid(); $comment = $this->input->post("comment"); $comment = $comment === false ? "" : $comment; $access_level = $this->input->post("access_level"); $key = \service\user::create_apikey($userid, $comment, $access_level); return array("new_key" => $key); }
function create_apikey() { $this->muser->require_access(); $userid = $this->muser->get_userid(); $comment = $this->input->post("comment"); $comment = $comment === false ? "" : $comment; $access_level = $this->input->post("access_level"); if ($access_level === false) { $access_level = "apikey"; } $key = \service\user::create_apikey($userid, $comment, $access_level); if (is_cli_client()) { echo "{$key}\n"; } else { redirect("user/apikeys"); } }
private function createApikey($userid, $access_level = "apikey") { return \service\user::create_apikey($userid, "", $access_level); }