summaryrefslogtreecommitdiffstats
path: root/application/models/muser.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/models/muser.php
parentb6998760012aa38ac92b886350ef766649e33fd0 (diff)
Refactor querying action table
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/models/muser.php')
-rw-r--r--application/models/muser.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/application/models/muser.php b/application/models/muser.php
index ee086994d..c277118f2 100644
--- a/application/models/muser.php
+++ b/application/models/muser.php
@@ -144,6 +144,22 @@ class Muser extends CI_Model {
}
}
+ function get_action($action, $key)
+ {
+ $query = $this->db->query("
+ SELECT *
+ FROM actions
+ WHERE `key` = ?
+ AND `action` = ?
+ ", array($key, $action))->row_array();
+
+ if (!isset($query["key"]) || $key != $query["key"]) {
+ show_error("Invalid action key");
+ }
+
+ return $query;
+ }
+
function hash_password($password)
{