summaryrefslogtreecommitdiff
path: root/modules/rest/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/rest/helpers')
-rw-r--r--modules/rest/helpers/rest.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/rest/helpers/rest.php b/modules/rest/helpers/rest.php
index b382cb29..0bad58f6 100644
--- a/modules/rest/helpers/rest.php
+++ b/modules/rest/helpers/rest.php
@@ -66,9 +66,9 @@ class rest_Core {
identity::set_active_user($user);
}
- static function get_access_key($user_id) {
+ static function access_key() {
$key = ORM::factory("user_access_key")
- ->where("user_id", "=", $user_id)
+ ->where("user_id", "=", identity::active_user()->id)
->find();
if (!$key->loaded()) {
@@ -76,7 +76,8 @@ class rest_Core {
$key->access_key = md5(md5(uniqid(mt_rand(), true) . access::private_key()));
$key->save();
}
- return $key;
+
+ return $key->access_key;
}
/**