dcc202fb249a446ac15c7cf413b9f1b4a3f31b58
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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 1 year ago

5) Written 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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 1 year ago

9) This code is published under a 0BSD license.
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

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

bernd authored 15 years ago

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

Hanno Böck authored 2 years ago

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

Hanno authored 5 years ago

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

bernd authored 15 years ago

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

Bernd Wurst authored 4 years ago

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

bernd authored 15 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 4 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 4 years ago

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

Hanno Böck authored 4 years ago

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

Bernd Wurst authored 4 years ago

38)     } else {
39)         DEBUG("possible new maildomain");
40)         $possible = get_possible_mailmandomains();
41)         $found = false;
42)         foreach ($possible as $domain) {
43)             if ($maildomain == 'd'.$domain['id']) {
44)                 // lege Mailman-Domain neu an
45)                 $found = true;
46)                 $maildomain = insert_mailman_domain('lists', $domain['id']);
47)                 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.');
48)             }
49)         }
50)         if (! $found) {
51)             system_failure('Ihre Domain-Auswahl scheint ungültig zu sein');
52)         }
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

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

bernd authored 15 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 4 years ago

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

Hanno authored 5 years ago

57) } elseif ($_GET['action'] == 'newpw') {
58)     $list = get_list($_GET['id']);
59)     $sure = user_is_sure();
60)     if ($sure === null) {
61)         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.)');
62)     } elseif ($sure === true) {
63)         request_new_password($list['id']);
Bernd Wurst cleanup+

Bernd Wurst authored 4 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 4 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 4 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 4 years ago

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

Hanno authored 5 years ago

78)     }
79) } else {
80)     system_failure('Function not implemented');