summaryrefslogtreecommitdiffstats
path: root/application/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'application/controllers')
-rw-r--r--application/controllers/user.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/application/controllers/user.php b/application/controllers/user.php
index 079f1665c..45bd93816 100644
--- a/application/controllers/user.php
+++ b/application/controllers/user.php
@@ -102,11 +102,13 @@ class User extends MY_Controller {
$key = random_alphanum(32);
- $this->db->query("
- INSERT INTO `apikeys`
- (`key`, `user`, `comment`, `access_level`)
- VALUES (?, ?, ?, ?)
- ", array($key, $userid, $comment, $access_level));
+ $this->db->set([
+ 'key' => $key,
+ 'user' => $userid,
+ 'comment' => $comment,
+ 'access_level' => $access_level
+ ])
+ ->insert('apikeys');
if (static_storage("response_type") == "json") {
return send_json_reply(array("new_key" => $key));