summaryrefslogtreecommitdiff
path: root/includes/model
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2016-09-30 16:55:47 +0200
committermsquare <msquare@notrademark.de>2016-09-30 16:55:47 +0200
commit1debe567f5f9fdeff5a2afbaa4619992da67f437 (patch)
tree285c426c316d726f5f5b05eac4a4af56448aebe4 /includes/model
parent9fce3b22aa76fe68abe81f36b46a763df0535aef (diff)
simplify user_angeltype_add_controller
Diffstat (limited to 'includes/model')
-rw-r--r--includes/model/UserAngelTypes_model.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/includes/model/UserAngelTypes_model.php b/includes/model/UserAngelTypes_model.php
index d3538f09..fe5293f8 100644
--- a/includes/model/UserAngelTypes_model.php
+++ b/includes/model/UserAngelTypes_model.php
@@ -5,6 +5,24 @@
*/
/**
+ * Checks if a user joined an angeltype.
+ *
+ * @param User $user
+ * The user to be checked
+ * @param Angeltype $angeltype
+ * The angeltype to be checked
+ * @return boolean
+ */
+function UserAngelType_exists($user, $angeltype) {
+ return sql_num_query("
+ SELECT `id`
+ FROM `UserAngelTypes`
+ WHERE `UserAngelTypes`.`user_id`='" . sql_escape($user['UID']) . "'
+ AND `angeltype_id`='" . sql_escape($angeltype['id']) . "'
+ ") > 0;
+}
+
+/**
* List users angeltypes.
*
* @param User $user