96649f21ba18d07757afa9d98998f7a22c0d86a3
bernd Neues Modul für Mailman-Ver...

bernd authored 15 years ago

1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
Bernd Wurst Copyright year update

Bernd Wurst authored 6 years ago

5) Written 2008-2018 by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

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) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

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) */
bernd Neues Modul für Mailman-Ver...

bernd authored 15 years ago

16) 
17) require_once('mailman.php');
18) require_role(ROLE_SYSTEMUSER);
19) 
20) $title = "Neue Mailingliste erstellen";
21) $domains = get_mailman_domains();
22) 
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 2 years ago

23) $maildomains = ['0' => config('mailman_host')];
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

24) foreach ($domains as $domain) {
25)     $maildomains[$domain['id']] = $domain['fqdn'];
bernd Neues Modul für Mailman-Ver...

bernd authored 15 years ago

26) }
Bernd Wurst Erstelle Mailinglisten-Doma...

Bernd Wurst authored 4 years ago

27) DEBUG("maildomains");
28) DEBUG($maildomains);
bernd Neues Modul für Mailman-Ver...

bernd authored 15 years ago

29) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

30) if ($_GET['action'] == 'new') {
31)     $maildomain = $_POST['maildomain'];
Bernd Wurst Erstelle Mailinglisten-Doma...

Bernd Wurst authored 4 years ago

32)     DEBUG("maildomain: ".$maildomain);
33)     if ($maildomain == null) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

34)         system_failure('Ihre Domain-Auswahl scheint ungültig zu sein');
Bernd Wurst Erstelle Mailinglisten-Doma...

Bernd Wurst authored 4 years ago

35)     } elseif ('0' === (string) $maildomain) {
36)         DEBUG("maildomain == 0");
37)         $maildomain = null;
38)     } elseif (isset($maildomains[$maildomain])) {
39)         // regular, OK
Hanno Böck fix codingstyle

Hanno Böck authored 4 years ago

40)         DEBUG("maildomain in \$maildomains");
Bernd Wurst Erstelle Mailinglisten-Doma...

Bernd Wurst authored 4 years ago

41)     } else {
42)         DEBUG("possible new maildomain");
43)         $possible = get_possible_mailmandomains();
44)         $found = false;
45)         foreach ($possible as $domain) {
46)             if ($maildomain == 'd'.$domain['id']) {
47)                 // lege Mailman-Domain neu an
48)                 $found = true;
49)                 $maildomain = insert_mailman_domain('lists', $domain['id']);
50)                 warning('Die Domain '.$domain['fqdn'].' wurde erstmals für eine Mailingliste benutzt. Aufgrund der dafür nötigen Änderungen kann es bis zu 1 Stunde dauern, bis Mails an diese Adresse korrekt zugestellt werden.');
51)             }
52)         }
53)         if (! $found) {
54)             system_failure('Ihre Domain-Auswahl scheint ungültig zu sein');
55)         }
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

56)     }
bernd Neues Modul für Mailman-Ver...

bernd authored 15 years ago

57) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

58)     create_list($_POST['listname'], $maildomain, $_POST['admin']);
Bernd Wurst cleanup+

Bernd Wurst authored 4 years ago

59)     redirect('lists');
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

60) } elseif ($_GET['action'] == 'newpw') {
61)     $list = get_list($_GET['id']);
62)     $sure = user_is_sure();
63)     if ($sure === null) {
64)         are_you_sure('action=newpw&id='.$list['id'], 'Möchten Sie für die Mailingliste »<strong>'.$list['listname'].'</strong>@'.$list['fqdn'].'« ein neues Passwort anfordern? (Das neue Passwort wird dem Listenverwalter zugeschickt.)');
65)     } elseif ($sure === true) {
66)         request_new_password($list['id']);
Bernd Wurst cleanup+

Bernd Wurst authored 4 years ago

67)         redirect('lists');
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

68)     } elseif ($sure === false) {
Bernd Wurst cleanup+

Bernd Wurst authored 4 years ago

69)         redirect('lists');
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

70)     }
71) } elseif ($_GET['action'] == 'delete') {
72)     $list = get_list($_GET['id']);
73)     $sure = user_is_sure();
74)     if ($sure === null) {
75)         are_you_sure('action=delete&id='.$list['id'], 'Möchten Sie die Mailingliste »<strong>'.$list['listname'].'</strong>@'.$list['fqdn'].'« wirklich löschen?');
76)     } elseif ($sure === true) {
77)         delete_list($list['id']);
Bernd Wurst cleanup+

Bernd Wurst authored 4 years ago

78)         redirect('lists');
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

79)     } elseif ($sure === false) {
Bernd Wurst cleanup+

Bernd Wurst authored 4 years ago

80)         redirect('lists');
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

81)     }
82) } else {
83)     system_failure('Function not implemented');