Browse code

Change license from CC0 to 0BSD, all contributors agreed

Hanno Böck authored on 20/08/2022 09:22:23
Showing 1 changed files
... ...
@@ -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
 */
Browse code

Codingstyle PSR12 + array syntax

Hanno Böck authored on 30/10/2021 21:18:17
Showing 1 changed files
... ...
@@ -22,7 +22,7 @@ if (! function_exists("user_has_vmail_domain")) {
22 22
             return false;
23 23
         }
24 24
         $uid = (int) $_SESSION['userinfo']['uid'];
25
-        $result = db_query("SELECT COUNT(*) FROM mail.v_vmail_domains WHERE useraccount=?", array($uid));
25
+        $result = db_query("SELECT COUNT(*) FROM mail.v_vmail_domains WHERE useraccount=?", [$uid]);
26 26
         $row = $result->fetch();
27 27
         $count = $row[0];
28 28
         DEBUG("User has {$count} vmail-domains");
... ...
@@ -39,7 +39,7 @@ if (! function_exists("user_has_dotcourier_domain")) {
39 39
         }
40 40
         $uid = (int) $_SESSION['userinfo']['uid'];
41 41
         $result = db_query("select 1 from mail.custom_mappings as c left join mail.v_domains as d on (d.id=c.domain) where d.user=:uid or c.uid=:uid UNION ".
42
-            "SELECT 1 FROM mail.v_domains AS d WHERE d.user=:uid AND d.mail != 'none' AND d.id != ALL(SELECT domain FROM mail.virtual_mail_domains)", array(":uid" => $uid));
42
+            "SELECT 1 FROM mail.v_domains AS d WHERE d.user=:uid AND d.mail != 'none' AND d.id != ALL(SELECT domain FROM mail.virtual_mail_domains)", [":uid" => $uid]);
43 43
         $ret = ($result->rowCount() > 0);
44 44
         if ($ret) {
45 45
             DEBUG("User {$uid} has dotcourier-domains");
Browse code

do not show manual IMAP account section when mail handling is turned off for some domains

Bernd Wurst authored on 10/08/2020 17:42:19
Showing 1 changed files
... ...
@@ -39,7 +39,7 @@ if (! function_exists("user_has_dotcourier_domain")) {
39 39
         }
40 40
         $uid = (int) $_SESSION['userinfo']['uid'];
41 41
         $result = db_query("select 1 from mail.custom_mappings as c left join mail.v_domains as d on (d.id=c.domain) where d.user=:uid or c.uid=:uid UNION ".
42
-            "SELECT 1 FROM mail.v_domains AS d WHERE d.user=:uid AND d.id != ALL(SELECT domain FROM mail.virtual_mail_domains)", array(":uid" => $uid));
42
+            "SELECT 1 FROM mail.v_domains AS d WHERE d.user=:uid AND d.mail != 'none' AND d.id != ALL(SELECT domain FROM mail.virtual_mail_domains)", array(":uid" => $uid));
43 43
         $ret = ($result->rowCount() > 0);
44 44
         if ($ret) {
45 45
             DEBUG("User {$uid} has dotcourier-domains");
Browse code

fix undefined variable

Bernd Wurst authored on 31/07/2019 07:30:47
Showing 1 changed files
... ...
@@ -43,7 +43,8 @@ if (! function_exists("user_has_dotcourier_domain")) {
43 43
         $ret = ($result->rowCount() > 0);
44 44
         if ($ret) {
45 45
             DEBUG("User {$uid} has dotcourier-domains");
46
+            return true;
46 47
         }
47
-        return $ret;
48
+        return false;
48 49
     }
49 50
 }
Browse code

Fix coding style with php-cs-checker, see https://cs.sensiolabs.org/

Hanno authored on 26/06/2018 13:58:19
Showing 1 changed files
... ...
@@ -8,45 +8,42 @@ 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.
15 15
 */
16 16
 
17
-if (! function_exists("user_has_vmail_domain"))
18
-{
19
-  function user_has_vmail_domain() 
20
-  {
21
-	$role = $_SESSION['role'];
22
-	if (! ($role & ROLE_SYSTEMUSER)) {
23
-		return false;
24
-	}
25
-	$uid = (int) $_SESSION['userinfo']['uid'];
26
-	$result = db_query("SELECT COUNT(*) FROM mail.v_vmail_domains WHERE useraccount=?", array($uid));
27
-	$row = $result->fetch();
28
-	$count = $row[0];
29
-	DEBUG("User has {$count} vmail-domains");
30
-	return ( (int) $count > 0 );
31
-  }  
17
+if (! function_exists("user_has_vmail_domain")) {
18
+    function user_has_vmail_domain()
19
+    {
20
+        $role = $_SESSION['role'];
21
+        if (! ($role & ROLE_SYSTEMUSER)) {
22
+            return false;
23
+        }
24
+        $uid = (int) $_SESSION['userinfo']['uid'];
25
+        $result = db_query("SELECT COUNT(*) FROM mail.v_vmail_domains WHERE useraccount=?", array($uid));
26
+        $row = $result->fetch();
27
+        $count = $row[0];
28
+        DEBUG("User has {$count} vmail-domains");
29
+        return ((int) $count > 0);
30
+    }
32 31
 }
33 32
 
34
-if (! function_exists("user_has_dotcourier_domain"))
35
-{
36
-  function user_has_dotcourier_domain() 
37
-  {
38
-	$role = $_SESSION['role'];
39
-	if (! ($role & ROLE_SYSTEMUSER)) {
40
-		return false;
41
-	}
42
-	$uid = (int) $_SESSION['userinfo']['uid'];
43
-	$result = db_query("select 1 from mail.custom_mappings as c left join mail.v_domains as d on (d.id=c.domain) where d.user=:uid or c.uid=:uid UNION ". 
33
+if (! function_exists("user_has_dotcourier_domain")) {
34
+    function user_has_dotcourier_domain()
35
+    {
36
+        $role = $_SESSION['role'];
37
+        if (! ($role & ROLE_SYSTEMUSER)) {
38
+            return false;
39
+        }
40
+        $uid = (int) $_SESSION['userinfo']['uid'];
41
+        $result = db_query("select 1 from mail.custom_mappings as c left join mail.v_domains as d on (d.id=c.domain) where d.user=:uid or c.uid=:uid UNION ".
44 42
             "SELECT 1 FROM mail.v_domains AS d WHERE d.user=:uid AND d.id != ALL(SELECT domain FROM mail.virtual_mail_domains)", array(":uid" => $uid));
45
-  $ret = ($result->rowCount() > 0);
46
-  if ($ret)
47
-    DEBUG("User {$uid} has dotcourier-domains");
48
-  return $ret;
49
-  }  
43
+        $ret = ($result->rowCount() > 0);
44
+        if ($ret) {
45
+            DEBUG("User {$uid} has dotcourier-domains");
46
+        }
47
+        return $ret;
48
+    }
50 49
 }
51
-
52
-?>
Browse code

Copyright year update

Bernd Wurst authored on 13/01/2018 06:07:05
Showing 1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2014 by schokokeks.org Hosting, namely
5
+Written 2008-2018 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Lizenzinfos in eigenes Modul ausgelagert und Copyright auf 2014 angepasst

Bernd Wurst authored on 08/02/2014 05:45:07
Showing 1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2013 by schokokeks.org Hosting, namely
5
+Written 2008-2014 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Typo repariert

Bernd Wurst authored on 02/02/2014 17:03:49
Showing 1 changed files
... ...
@@ -40,7 +40,7 @@ if (! function_exists("user_has_dotcourier_domain"))
40 40
 		return false;
41 41
 	}
42 42
 	$uid = (int) $_SESSION['userinfo']['uid'];
43
-	$result = db_query("select 1 from mail.custom_mappings as c left join mail.v_domains as d on (d.id=c.domain) where d.user=:uid or c.uid=:uid}UNION ". 
43
+	$result = db_query("select 1 from mail.custom_mappings as c left join mail.v_domains as d on (d.id=c.domain) where d.user=:uid or c.uid=:uid UNION ". 
44 44
             "SELECT 1 FROM mail.v_domains AS d WHERE d.user=:uid AND d.id != ALL(SELECT domain FROM mail.virtual_mail_domains)", array(":uid" => $uid));
45 45
   $ret = ($result->rowCount() > 0);
46 46
   if ($ret)
Browse code

email-Modul auf prepared-statements umgestellt

Bernd Wurst authored on 02/02/2014 08:03:52
Showing 1 changed files
... ...
@@ -23,7 +23,7 @@ if (! function_exists("user_has_vmail_domain"))
23 23
 		return false;
24 24
 	}
25 25
 	$uid = (int) $_SESSION['userinfo']['uid'];
26
-	$result = db_query("SELECT COUNT(*) FROM mail.v_vmail_domains WHERE useraccount='{$uid}'");
26
+	$result = db_query("SELECT COUNT(*) FROM mail.v_vmail_domains WHERE useraccount=?", array($uid));
27 27
 	$row = $result->fetch();
28 28
 	$count = $row[0];
29 29
 	DEBUG("User has {$count} vmail-domains");
... ...
@@ -40,8 +40,8 @@ if (! function_exists("user_has_dotcourier_domain"))
40 40
 		return false;
41 41
 	}
42 42
 	$uid = (int) $_SESSION['userinfo']['uid'];
43
-	$result = db_query("select 1 from mail.custom_mappings as c left join mail.v_domains as d on (d.id=c.domain) where d.user={$uid} or c.uid={$uid} UNION ". 
44
-            "SELECT 1 FROM mail.v_domains AS d WHERE d.user={$uid} AND d.id != ALL(SELECT domain FROM mail.virtual_mail_domains);");
43
+	$result = db_query("select 1 from mail.custom_mappings as c left join mail.v_domains as d on (d.id=c.domain) where d.user=:uid or c.uid=:uid}UNION ". 
44
+            "SELECT 1 FROM mail.v_domains AS d WHERE d.user=:uid AND d.id != ALL(SELECT domain FROM mail.virtual_mail_domains)", array(":uid" => $uid));
45 45
   $ret = ($result->rowCount() > 0);
46 46
   if ($ret)
47 47
     DEBUG("User {$uid} has dotcourier-domains");
Browse code

Umstellung auf PDO-Datenbankverbindung

Bernd Wurst authored on 01/02/2014 18:38:23
Showing 1 changed files
... ...
@@ -24,7 +24,7 @@ if (! function_exists("user_has_vmail_domain"))
24 24
 	}
25 25
 	$uid = (int) $_SESSION['userinfo']['uid'];
26 26
 	$result = db_query("SELECT COUNT(*) FROM mail.v_vmail_domains WHERE useraccount='{$uid}'");
27
-	$row = mysql_fetch_array($result);
27
+	$row = $result->fetch();
28 28
 	$count = $row[0];
29 29
 	DEBUG("User has {$count} vmail-domains");
30 30
 	return ( (int) $count > 0 );
... ...
@@ -42,7 +42,7 @@ if (! function_exists("user_has_dotcourier_domain"))
42 42
 	$uid = (int) $_SESSION['userinfo']['uid'];
43 43
 	$result = db_query("select 1 from mail.custom_mappings as c left join mail.v_domains as d on (d.id=c.domain) where d.user={$uid} or c.uid={$uid} UNION ". 
44 44
             "SELECT 1 FROM mail.v_domains AS d WHERE d.user={$uid} AND d.id != ALL(SELECT domain FROM mail.virtual_mail_domains);");
45
-  $ret = (mysql_num_rows($result) > 0);
45
+  $ret = ($result->rowCount() > 0);
46 46
   if ($ret)
47 47
     DEBUG("User {$uid} has dotcourier-domains");
48 48
   return $ret;
Browse code

Updated copyright notice (2012 => 2013)

Bernd Wurst authored on 19/01/2013 10:49:50
Showing 1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2012 by schokokeks.org Hosting, namely
5
+Written 2008-2013 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Added license tags for CC0, README and COPYING

Bernd Wurst authored on 11/03/2012 15:40:04
Showing 1 changed files
... ...
@@ -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
 if (! function_exists("user_has_vmail_domain"))
4 18
 {
Browse code

IMAP/POP3 nur anzeigen wenn es benötigt wird

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1693 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on 11/03/2010 10:37:59
Showing 1 changed files
... ...
@@ -17,4 +17,22 @@ if (! function_exists("user_has_vmail_domain"))
17 17
   }  
18 18
 }
19 19
 
20
+if (! function_exists("user_has_dotcourier_domain"))
21
+{
22
+  function user_has_dotcourier_domain() 
23
+  {
24
+	$role = $_SESSION['role'];
25
+	if (! ($role & ROLE_SYSTEMUSER)) {
26
+		return false;
27
+	}
28
+	$uid = (int) $_SESSION['userinfo']['uid'];
29
+	$result = db_query("select 1 from mail.custom_mappings as c left join mail.v_domains as d on (d.id=c.domain) where d.user={$uid} or c.uid={$uid} UNION ". 
30
+            "SELECT 1 FROM mail.v_domains AS d WHERE d.user={$uid} AND d.id != ALL(SELECT domain FROM mail.virtual_mail_domains);");
31
+  $ret = (mysql_num_rows($result) > 0);
32
+  if ($ret)
33
+    DEBUG("User {$uid} has dotcourier-domains");
34
+  return $ret;
35
+  }  
36
+}
37
+
20 38
 ?>
Browse code

Großer VMail-move

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1012 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on 03/04/2008 10:38:22
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,20 @@
1
+<?php
2
+
3
+if (! function_exists("user_has_vmail_domain"))
4
+{
5
+  function user_has_vmail_domain() 
6
+  {
7
+	$role = $_SESSION['role'];
8
+	if (! ($role & ROLE_SYSTEMUSER)) {
9
+		return false;
10
+	}
11
+	$uid = (int) $_SESSION['userinfo']['uid'];
12
+	$result = db_query("SELECT COUNT(*) FROM mail.v_vmail_domains WHERE useraccount='{$uid}'");
13
+	$row = mysql_fetch_array($result);
14
+	$count = $row[0];
15
+	DEBUG("User has {$count} vmail-domains");
16
+	return ( (int) $count > 0 );
17
+  }  
18
+}
19
+
20
+?>