... | ... |
@@ -2,14 +2,11 @@ |
2 | 2 |
/* |
3 | 3 |
This file belongs to the Webinterface of schokokeks.org Hosting |
4 | 4 |
|
5 |
-Written 2008-2018 by schokokeks.org Hosting, namely |
|
5 |
+Written by schokokeks.org Hosting, namely |
|
6 | 6 |
Bernd Wurst <bernd@schokokeks.org> |
7 | 7 |
Hanno Böck <hanno@schokokeks.org> |
8 | 8 |
|
9 |
-To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. |
|
10 |
- |
|
11 |
-You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see |
|
12 |
-http://creativecommons.org/publicdomain/zero/1.0/ |
|
9 |
+This code is published under a 0BSD license. |
|
13 | 10 |
|
14 | 11 |
Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code. |
15 | 12 |
*/ |
... | ... |
@@ -19,7 +19,7 @@ require_once('inc/base.php'); |
19 | 19 |
function user_has_accounts() |
20 | 20 |
{ |
21 | 21 |
$uid = (int) $_SESSION['userinfo']['uid']; |
22 |
- $result = db_query("SELECT id from `mail`.`mailaccounts` WHERE uid=?", array($uid)); |
|
22 |
+ $result = db_query("SELECT id from `mail`.`mailaccounts` WHERE uid=?", [$uid]); |
|
23 | 23 |
DEBUG($result->rowCount()." accounts"); |
24 | 24 |
return ($result->rowCount() > 0); |
25 | 25 |
} |
... | ... |
@@ -32,7 +32,7 @@ if (! function_exists("user_has_vmail_domain")) { |
32 | 32 |
return false; |
33 | 33 |
} |
34 | 34 |
$uid = (int) $_SESSION['userinfo']['uid']; |
35 |
- $result = db_query("SELECT COUNT(*) FROM mail.v_vmail_domains WHERE useraccount=?", array($uid)); |
|
35 |
+ $result = db_query("SELECT COUNT(*) FROM mail.v_vmail_domains WHERE useraccount=?", [$uid]); |
|
36 | 36 |
$row = $result->fetch(); |
37 | 37 |
$count = $row[0]; |
38 | 38 |
DEBUG("User has {$count} vmail-domains"); |
... | ... |
@@ -8,7 +8,7 @@ Written 2008-2018 by schokokeks.org Hosting, namely |
8 | 8 |
|
9 | 9 |
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. |
10 | 10 |
|
11 |
-You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see |
|
11 |
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see |
|
12 | 12 |
http://creativecommons.org/publicdomain/zero/1.0/ |
13 | 13 |
|
14 | 14 |
Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code. |
... | ... |
@@ -18,26 +18,24 @@ require_once('inc/base.php'); |
18 | 18 |
|
19 | 19 |
function user_has_accounts() |
20 | 20 |
{ |
21 |
- $uid = (int) $_SESSION['userinfo']['uid']; |
|
22 |
- $result = db_query("SELECT id from `mail`.`mailaccounts` WHERE uid=?", array($uid)); |
|
23 |
- DEBUG($result->rowCount()." accounts"); |
|
24 |
- return ($result->rowCount() > 0); |
|
21 |
+ $uid = (int) $_SESSION['userinfo']['uid']; |
|
22 |
+ $result = db_query("SELECT id from `mail`.`mailaccounts` WHERE uid=?", array($uid)); |
|
23 |
+ DEBUG($result->rowCount()." accounts"); |
|
24 |
+ return ($result->rowCount() > 0); |
|
25 | 25 |
} |
26 | 26 |
|
27 |
-if (! function_exists("user_has_vmail_domain")) |
|
28 |
-{ |
|
29 |
- function user_has_vmail_domain() |
|
30 |
- { |
|
27 |
+if (! function_exists("user_has_vmail_domain")) { |
|
28 |
+ function user_has_vmail_domain() |
|
29 |
+ { |
|
31 | 30 |
$role = $_SESSION['role']; |
32 | 31 |
if (! ($role & ROLE_SYSTEMUSER)) { |
33 |
- return false; |
|
32 |
+ return false; |
|
34 | 33 |
} |
35 | 34 |
$uid = (int) $_SESSION['userinfo']['uid']; |
36 | 35 |
$result = db_query("SELECT COUNT(*) FROM mail.v_vmail_domains WHERE useraccount=?", array($uid)); |
37 | 36 |
$row = $result->fetch(); |
38 | 37 |
$count = $row[0]; |
39 | 38 |
DEBUG("User has {$count} vmail-domains"); |
40 |
- return ( (int) $count > 0 ); |
|
41 |
- } |
|
39 |
+ return ((int) $count > 0); |
|
40 |
+ } |
|
42 | 41 |
} |
43 |
- |
... | ... |
@@ -19,7 +19,7 @@ require_once('inc/base.php'); |
19 | 19 |
function user_has_accounts() |
20 | 20 |
{ |
21 | 21 |
$uid = (int) $_SESSION['userinfo']['uid']; |
22 |
- $result = db_query("SELECT id from `mail`.`mailaccounts` WHERE uid=$uid"); |
|
22 |
+ $result = db_query("SELECT id from `mail`.`mailaccounts` WHERE uid=?", array($uid)); |
|
23 | 23 |
DEBUG($result->rowCount()." accounts"); |
24 | 24 |
return ($result->rowCount() > 0); |
25 | 25 |
} |
... | ... |
@@ -33,7 +33,7 @@ if (! function_exists("user_has_vmail_domain")) |
33 | 33 |
return false; |
34 | 34 |
} |
35 | 35 |
$uid = (int) $_SESSION['userinfo']['uid']; |
36 |
- $result = db_query("SELECT COUNT(*) FROM mail.v_vmail_domains WHERE useraccount='{$uid}'"); |
|
36 |
+ $result = db_query("SELECT COUNT(*) FROM mail.v_vmail_domains WHERE useraccount=?", array($uid)); |
|
37 | 37 |
$row = $result->fetch(); |
38 | 38 |
$count = $row[0]; |
39 | 39 |
DEBUG("User has {$count} vmail-domains"); |
... | ... |
@@ -20,8 +20,8 @@ function user_has_accounts() |
20 | 20 |
{ |
21 | 21 |
$uid = (int) $_SESSION['userinfo']['uid']; |
22 | 22 |
$result = db_query("SELECT id from `mail`.`mailaccounts` WHERE uid=$uid"); |
23 |
- DEBUG(mysql_num_rows($result)." accounts"); |
|
24 |
- return (mysql_num_rows($result) > 0); |
|
23 |
+ DEBUG($result->rowCount()." accounts"); |
|
24 |
+ return ($result->rowCount() > 0); |
|
25 | 25 |
} |
26 | 26 |
|
27 | 27 |
if (! function_exists("user_has_vmail_domain")) |
... | ... |
@@ -34,7 +34,7 @@ if (! function_exists("user_has_vmail_domain")) |
34 | 34 |
} |
35 | 35 |
$uid = (int) $_SESSION['userinfo']['uid']; |
36 | 36 |
$result = db_query("SELECT COUNT(*) FROM mail.v_vmail_domains WHERE useraccount='{$uid}'"); |
37 |
- $row = mysql_fetch_array($result); |
|
37 |
+ $row = $result->fetch(); |
|
38 | 38 |
$count = $row[0]; |
39 | 39 |
DEBUG("User has {$count} vmail-domains"); |
40 | 40 |
return ( (int) $count > 0 ); |
... | ... |
@@ -1,4 +1,18 @@ |
1 | 1 |
<?php |
2 |
+/* |
|
3 |
+This file belongs to the Webinterface of schokokeks.org Hosting |
|
4 |
+ |
|
5 |
+Written 2008-2012 by schokokeks.org Hosting, namely |
|
6 |
+ Bernd Wurst <bernd@schokokeks.org> |
|
7 |
+ Hanno Böck <hanno@schokokeks.org> |
|
8 |
+ |
|
9 |
+To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. |
|
10 |
+ |
|
11 |
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see |
|
12 |
+http://creativecommons.org/publicdomain/zero/1.0/ |
|
13 |
+ |
|
14 |
+Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code. |
|
15 |
+*/ |
|
2 | 16 |
|
3 | 17 |
require_once('inc/base.php'); |
4 | 18 |
|
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1693 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -27,11 +27,3 @@ if (! function_exists("user_has_vmail_domain")) |
27 | 27 |
} |
28 | 28 |
} |
29 | 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($result) > 0); |
|
34 |
-} |
|
35 |
- |
|
36 |
- |
|
37 |
-?> |
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1182 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -30,7 +30,7 @@ if (! function_exists("user_has_vmail_domain")) |
30 | 30 |
function user_has_regular_domain() |
31 | 31 |
{ |
32 | 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); |
|
33 |
+ return (mysql_num_rows($result) > 0); |
|
34 | 34 |
} |
35 | 35 |
|
36 | 36 |
|
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1012 87cf0b9e-d624-0410-a070-f6ee81989793
1 | 1 |
new file mode 100644 |
... | ... |
@@ -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 |
+?> |