summaryrefslogtreecommitdiffstats
path: root/application/controllers/User.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/controllers/User.php')
-rw-r--r--application/controllers/User.php20
1 files changed, 1 insertions, 19 deletions
diff --git a/application/controllers/User.php b/application/controllers/User.php
index 892bbe1b6..a2ce5c823 100644
--- a/application/controllers/User.php
+++ b/application/controllers/User.php
@@ -128,25 +128,7 @@ class User extends MY_Controller {
$userid = $this->muser->get_userid();
- $invitations = $this->db->select('user')
- ->from('actions')
- ->where('user', $userid)
- ->where('action', 'invitation')
- ->count_all_results();
-
- if ($invitations + 1 > $this->config->item('max_invitation_keys')) {
- throw new \exceptions\PublicApiException("user/invitation-limit", "You can't create more invitation keys at this time.");
- }
-
- $key = random_alphanum(12, 16);
-
- $this->db->set(array(
- 'key' => $key,
- 'user' => $userid,
- 'date' => time(),
- 'action' => 'invitation'
- ))
- ->insert('actions');
+ \service\user::create_invitation_key($userid);
redirect("user/invite");
}