diff options
author | Florian Pritz <bluewind@xinu.at> | 2017-09-18 12:13:12 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2017-09-18 12:13:12 +0200 |
commit | b0e09e9db4cef075491ef683d89390faa2e6b8c3 (patch) | |
tree | 32799b1aed99f9e1632569e9b183117fd284e1ca /application/controllers/api/v2/user.php | |
parent | 7a2ef40a39c3d9f34240453db8305e6607005089 (diff) |
Remove unsupported secondary controller
Having more than one controller per request doesn't work with CI3.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers/api/v2/user.php')
-rw-r--r-- | application/controllers/api/v2/user.php | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/application/controllers/api/v2/user.php b/application/controllers/api/v2/user.php index 655dc62f3..3c2eafad0 100644 --- a/application/controllers/api/v2/user.php +++ b/application/controllers/api/v2/user.php @@ -13,31 +13,31 @@ class user extends \controllers\api\api_controller { { parent::__construct(); - $this->load->model('muser'); + $this->CI->load->model('muser'); } public function apikeys() { - $this->muser->require_access("full"); - return \service\user::apikeys($this->muser->get_userid()); + $this->CI->muser->require_access("full"); + return \service\user::apikeys($this->CI->muser->get_userid()); } public function create_apikey() { - $username = $this->input->post("username"); - $password = $this->input->post("password"); + $username = $this->CI->input->post("username"); + $password = $this->CI->input->post("password"); if ($username && $password) { - if (!$this->muser->login($username, $password)) { + if (!$this->CI->muser->login($username, $password)) { throw new \exceptions\NotAuthenticatedException("user/login-failed", "Login failed"); } } - $this->muser->require_access("full"); + $this->CI->muser->require_access("full"); - $userid = $this->muser->get_userid(); - $comment = $this->input->post("comment"); + $userid = $this->CI->muser->get_userid(); + $comment = $this->CI->input->post("comment"); $comment = $comment === false ? "" : $comment; - $access_level = $this->input->post("access_level"); + $access_level = $this->CI->input->post("access_level"); $key = \service\user::create_apikey($userid, $comment, $access_level); @@ -48,16 +48,16 @@ class user extends \controllers\api\api_controller { public function delete_apikey() { - $this->muser->require_access("full"); + $this->CI->muser->require_access("full"); - $userid = $this->muser->get_userid(); - $key = $this->input->post("delete_key"); + $userid = $this->CI->muser->get_userid(); + $key = $this->CI->input->post("delete_key"); - $this->db->where('user', $userid) + $this->CI->db->where('user', $userid) ->where('key', $key) ->delete('apikeys'); - $affected = $this->db->affected_rows(); + $affected = $this->CI->db->affected_rows(); assert($affected >= 0 && $affected <= 1); if ($affected == 1) { |