bernd commited on 2008-02-02 15:58:14
Zeige 1 geänderte Dateien mit 37 Einfügungen und 0 Löschungen.
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@934 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -0,0 +1,37 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+require_once('inc/base.php'); |
|
4 |
+ |
|
5 |
+function user_has_accounts() |
|
6 |
+{ |
|
7 |
+ $uid = (int) $_SESSION['userinfo']['uid']; |
|
8 |
+ $result = db_query("SELECT id from `mail`.`mailaccounts` WHERE uid=$uid"); |
|
9 |
+ DEBUG(mysql_num_rows($result)." accounts"); |
|
10 |
+ return (mysql_num_rows($result) > 0); |
|
11 |
+} |
|
12 |
+ |
|
13 |
+if (! function_exists("user_has_vmail_domain")) |
|
14 |
+{ |
|
15 |
+ function user_has_vmail_domain() |
|
16 |
+ { |
|
17 |
+ $role = $_SESSION['role']; |
|
18 |
+ if (! ($role & ROLE_SYSTEMUSER)) { |
|
19 |
+ return false; |
|
20 |
+ } |
|
21 |
+ $uid = (int) $_SESSION['userinfo']['uid']; |
|
22 |
+ $result = db_query("SELECT COUNT(*) FROM mail.v_vmail_domains WHERE useraccount='{$uid}'"); |
|
23 |
+ $row = mysql_fetch_array($result); |
|
24 |
+ $count = $row[0]; |
|
25 |
+ DEBUG("User has {$count} vmail-domains"); |
|
26 |
+ return ( (int) $count > 0 ); |
|
27 |
+ } |
|
28 |
+} |
|
29 |
+ |
|
30 |
+function user_has_regular_domain() |
|
31 |
+{ |
|
32 |
+ $result = db_query("SELECT id FROM kundendaten.domains AS dom WHERE id NOT IN (SELECT domain FROM mail.virtual_mail_domains WHERE hostname IS NULL)"); |
|
33 |
+ return (mysql_num_rows() > 0); |
|
34 |
+} |
|
35 |
+ |
|
36 |
+ |
|
37 |
+?> |
|
0 | 38 |