summaryrefslogtreecommitdiffstats
path: root/application/controllers/user.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-01-25 23:24:31 +0100
committerFlorian Pritz <bluewind@xinu.at>2013-01-25 23:24:31 +0100
commite8d30fa25470f3912c0d4e8629fc7b764aae1c72 (patch)
treef4ed522170bde253d86b9a77704b7e6543c7273d /application/controllers/user.php
parentb6998760012aa38ac92b886350ef766649e33fd0 (diff)
Refactor querying action table
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers/user.php')
-rw-r--r--application/controllers/user.php23
1 files changed, 2 insertions, 21 deletions
diff --git a/application/controllers/user.php b/application/controllers/user.php
index 4a79a6730..1562ae9fd 100644
--- a/application/controllers/user.php
+++ b/application/controllers/user.php
@@ -131,16 +131,7 @@ class User extends CI_Controller {
);
$error = array();
- $query = $this->db->query("
- SELECT `user`, `key`
- FROM actions
- WHERE `key` = ?
- AND `action` = 'invitation'
- ", array($key))->row_array();
-
- if (!isset($query["key"]) || $key != $query["key"]) {
- show_error("Invalid invitation key.");
- }
+ $query = $this->muser->get_action("invitation", $key);
$referrer = $query["user"];
@@ -285,17 +276,7 @@ class User extends CI_Controller {
$key = $this->uri->segment(3);
$error = array();
- // TODO: refactor into common function
- $query = $this->db->query("
- SELECT `user`, `key`
- FROM actions
- WHERE `key` = ?
- AND `action` = 'passwordreset'
- ", array($key))->row_array();
-
- if (!isset($query["key"]) || $key != $query["key"]) {
- show_error("Invalid reset key.");
- }
+ $query = $this->muser->get_action("passwordreset", $key);
$userid = $query["user"];