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

bernd authored 15 years ago

16) 
17) require_once('inc/base.php');
18) require_once('inc/debug.php');
19) require_once('inc/security.php');
20) 
21) 
22) function get_lists()
23) {
24)   $uid = (int) $_SESSION['userinfo']['uid'];
bernd Zeige Archivgröße der Maili...

bernd authored 12 years ago

25)   $result = db_query("SELECT id, status, listname, fqdn, admin, archivesize FROM mail.v_mailman_lists WHERE owner={$uid};");
bernd Neues Modul für Mailman-Ver...

bernd authored 15 years ago

26)   $ret = array();
27)   while ($list = mysql_fetch_assoc($result))
28)     $ret[] = $list;
29)   DEBUG($ret);
30)   return $ret;
31) }
32) 
33) 
34) function get_list($id)
35) {
36)   $id = (int) $id;
37)   $uid = (int) $_SESSION['userinfo']['uid'];
bernd Zeige Archivgröße der Maili...

bernd authored 12 years ago

38)   $result = db_query("SELECT id, status, listname, fqdn, admin, archivesize FROM mail.v_mailman_lists WHERE owner={$uid} AND id={$id};");
bernd Neues Modul für Mailman-Ver...

bernd authored 15 years ago

39)   if (mysql_num_rows($result) < 1)
40)     system_failure('Die gewünschte Mailingliste konnte nicht gefunden werden');
41)   $list = mysql_fetch_assoc($result);
42)   DEBUG($list);
43) 
44)   return $list;
45) }
46) 
47) 
48) function delete_list($id)
49) {
50)   $uid = (int) $_SESSION['userinfo']['uid'];
51)   $id = (int) $id;
52)   db_query("UPDATE mail.mailman_lists SET status='delete' WHERE owner={$uid} AND id={$id};");
53) }
54) 
55) 
56) function create_list($listname, $maildomain, $admin)
57) {
bernd bei ungültigen Zeichen abbr...

bernd authored 15 years ago

58)   verify_input_username($listname);
bernd Neues Modul für Mailman-Ver...

bernd authored 15 years ago

59)   $maildomain = maybe_null( (int) $maildomain );
60)   $owner = (int) $_SESSION['userinfo']['uid'];
bernd bei ungültigen Zeichen abbr...

bernd authored 15 years ago

61)   verify_input_general($admin);
bernd Neues Modul für Mailman-Ver...

bernd authored 15 years ago

62)   if (! check_emailaddr($admin))
63)     system_failure('Der Verwalter muss eine gültige E-Mail-Adresse sein ('.$admin.').');
bernd bei ungültigen Zeichen abbr...

bernd authored 15 years ago

64)   $admin = mysql_real_escape_string($admin);