445a681ec76523ec5e56cc7fcd96f04672f5ca08
bernd Erste Version des vmail-Modul

bernd authored 17 years ago

modules/vmail/save.php   1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

modules/email/save.php   2) /*
modules/email/save.php   3) This file belongs to the Webinterface of schokokeks.org Hosting
modules/email/save.php   4) 
modules/email/save.php   5) Written 2008-2012 by schokokeks.org Hosting, namely
modules/email/save.php   6)   Bernd Wurst <bernd@schokokeks.org>
modules/email/save.php   7)   Hanno Böck <hanno@schokokeks.org>
modules/email/save.php   8) 
modules/email/save.php   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.
modules/email/save.php  10) 
modules/email/save.php  11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
modules/email/save.php  12) http://creativecommons.org/publicdomain/zero/1.0/
modules/email/save.php  13) 
modules/email/save.php  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.
modules/email/save.php  15) */
bernd Erste Version des vmail-Modul

bernd authored 17 years ago

modules/vmail/save.php  16) 
modules/vmail/save.php  17) require_once('session/start.php');
modules/vmail/save.php  18) 
modules/vmail/save.php  19) require_once('vmail.php');
modules/vmail/save.php  20) 
bernd VMail-User können ihre Eins...

bernd authored 12 years ago

modules/email/save.php  21) require_role(array(ROLE_SYSTEMUSER, ROLE_VMAIL_ACCOUNT));
bernd Erste Version des vmail-Modul

bernd authored 17 years ago

modules/vmail/save.php  22) 
modules/vmail/save.php  23) require_once("inc/debug.php");
modules/vmail/save.php  24) global $debugmode;
modules/vmail/save.php  25) 
bernd Datums-Check und Daten in u...

bernd authored 12 years ago

modules/email/save.php  26) $section = 'email_vmail';
modules/email/save.php  27) 
bernd Erste Version des vmail-Modul

bernd authored 17 years ago

modules/vmail/save.php  28) 
modules/vmail/save.php  29) if ($_GET['action'] == 'edit')
modules/vmail/save.php  30) {
modules/vmail/save.php  31)   check_form_token('vmail_edit_mailbox');
bernd VMail-User können ihre Eins...

bernd authored 12 years ago

modules/email/save.php  32)   $accountlogin = ($_SESSION['role'] == ROLE_VMAIL_ACCOUNT);
modules/email/save.php  33) 
modules/email/save.php  34)   if ($accountlogin) {
bernd Index-Blöcke werden jetzt v...

bernd authored 12 years ago

modules/email/save.php  35)     $section = 'email_edit';
bernd VMail-User können ihre Eins...

bernd authored 12 years ago

modules/email/save.php  36)     $id = get_vmail_id_by_emailaddr($_SESSION['mailaccount']);
modules/email/save.php  37)     $account = get_account_details($id, false);
modules/email/save.php  38)     // Leere das, sonst werden die vervielfacht
modules/email/save.php  39)     $account['forwards'] = array();
modules/email/save.php  40)   } else {
bernd Datums-Check und Daten in u...

bernd authored 12 years ago

modules/email/save.php  41)     $id = isset($_GET['id']) ? (int) $_GET['id'] : NULL;
Bernd Wurst Erlaube nicht mehr das Ände...

Bernd Wurst authored 12 years ago

modules/email/save.php  42) 
bernd VMail-User können ihre Eins...

bernd authored 12 years ago

modules/email/save.php  43)     $account = empty_account();
modules/email/save.php  44)     $account['id'] = NULL;
Bernd Wurst Erlaube nicht mehr das Ände...

Bernd Wurst authored 12 years ago

modules/email/save.php  45)     if ($id) {
bernd VMail-User können ihre Eins...

bernd authored 12 years ago

modules/email/save.php  46)       $account['id'] = $id;
Bernd Wurst Erlaube nicht mehr das Ände...

Bernd Wurst authored 12 years ago

modules/email/save.php  47)   
modules/email/save.php  48)       $oldaccount = get_account_details($id);
modules/email/save.php  49)       if ($oldaccount['password'] != NULL ) { // Account war vorher eine Mailbox
modules/email/save.php  50)         $account['local'] = $oldaccount['local'];
modules/email/save.php  51)         $account['domain'] = $oldaccount['domain'];
modules/email/save.php  52)       } else {
modules/email/save.php  53)         $account['local'] = $_POST['local'];
modules/email/save.php  54)         $account['domain'] = (int) $_POST['domain'];
modules/email/save.php  55)       }
modules/email/save.php  56)     } else {
modules/email/save.php  57)       $account['local'] = $_POST['local'];
modules/email/save.php  58)       $account['domain'] = (int) $_POST['domain'];
modules/email/save.php  59)     }
bernd VMail-User können ihre Eins...

bernd authored 12 years ago

modules/email/save.php  60)     $account['password'] = $_POST['password'];
modules/email/save.php  61)     if (($account['password'] == '') && ($_POST['mailbox'] == 'yes'))
modules/email/save.php  62)       system_failure("Sie haben ein leeres Passwort eingegeben!");
modules/email/save.php  63)     if ($_POST['password'] == '**********')
modules/email/save.php  64)       $account['password'] = '';
modules/email/save.php  65)     if ($_POST['mailbox'] != 'yes')
modules/email/save.php  66)     {
modules/email/save.php  67)       $account['password'] = NULL;
modules/email/save.php  68)       $account['spamfilter'] = 'none';
modules/email/save.php  69)     }
modules/email/save.php  70)     if (isset($_POST['quota'])) {
modules/email/save.php  71)       $account['quota'] = $_POST['quota'];
modules/email/save.php  72)     }
modules/email/save.php  73)   
modules/email/save.php  74)     $account['quota_threshold'] = -1;
modules/email/save.php  75)     if (isset($_POST['quota_notify']) && isset($_POST['quota_threshold']) && $_POST['quota_notify'] == 1) {
modules/email/save.php  76)       $account['quota_threshold'] = $_POST['quota_threshold'];
modules/email/save.php  77)     }
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/save.php  78) 
bernd Quota-Threshold für Notific...

bernd authored 13 years ago

modules/email/save.php  79)   }
bernd VMail-User können ihre Eins...

bernd authored 12 years ago

modules/email/save.php  80)   $account['spamfilter'] = $_POST['spamfilter_action'];
bernd Konfiguration des Autorespo...

bernd authored 12 years ago

modules/email/save.php  81) 
modules/email/save.php  82) 
modules/email/save.php  83)   $ar = empty_autoresponder_config();
modules/email/save.php  84)   $valid_from_date = time();
modules/email/save.php  85)   $valid_until_date = NULL;
bernd Datums-Check und Daten in u...

bernd authored 12 years ago

modules/email/save.php  86)   if (isset($_POST['ar_valid_from']) && ($_POST['ar_valid_from'] == 'now')) {
modules/email/save.php  87)     $valid_from_date = time();
modules/email/save.php  88)   } else {
modules/email/save.php  89)     if (isset($_POST['ar_valid_from_day']) && isset($_POST['ar_valid_from_month']) && isset($_POST['ar_valid_from_year'])) {
modules/email/save.php  90)       $tmpdate = $_POST['ar_valid_from_year'].'-'.$_POST['ar_valid_from_month'].'-'.$_POST['ar_valid_from_day'];
modules/email/save.php  91)       if (date('Y-n-j', strtotime($tmpdate)) != $tmpdate) {
modules/email/save.php  92)         system_failure('Das Aktivierungs-Datum scheint ungültig zu sein.');
modules/email/save.php  93)       } else {
modules/email/save.php  94)         $valid_from_date = strtotime($tmpdate);
modules/email/save.php  95)       }
modules/email/save.php  96)     }
bernd Konfiguration des Autorespo...

bernd authored 12 years ago

modules/email/save.php  97)   }
bernd Datums-Check und Daten in u...

bernd authored 12 years ago

modules/email/save.php  98)   if ($valid_from_date < time()) {
bernd Konfiguration des Autorespo...

bernd authored 12 years ago

modules/email/save.php  99)     $valid_from_date = time();
bernd Datums-Check und Daten in u...

bernd authored 12 years ago

modules/email/save.php 100)     warning('Das Aktivierungs-Datum liegt in der Vergangenheit. Die Funktion wird ab sofort aktiviert.');
modules/email/save.php 101)   }
modules/email/save.php 102)   if ($valid_from_date > time() + 365*24*60*60) {
modules/email/save.php 103)     warning('Das Aktivierungs-Datum liegt mehr als ein Jahr in der Zukunft. Bitte prüfen Sie ob Sie das korrekte Jahr gewählt haben.');
modules/email/save.php 104)   }
modules/email/save.php 105)   if (isset($_POST['ar_valid_until']) && ($_POST['ar_valid_until'] == 'infinity')) {
modules/email/save.php 106)     $valid_until_date = NULL;
modules/email/save.php 107)   } else {
modules/email/save.php 108)     if (isset($_POST['ar_valid_until_day']) && isset($_POST['ar_valid_until_month']) && isset($_POST['ar_valid_until_year'])) {
modules/email/save.php 109)       $tmpdate = $_POST['ar_valid_until_year'].'-'.$_POST['ar_valid_until_month'].'-'.$_POST['ar_valid_until_day'];
modules/email/save.php 110)       if (date('Y-n-j', strtotime($tmpdate)) != $tmpdate) {
modules/email/save.php 111)         system_failure('Das Deaktivierungs-Datum scheint ungültig zu sein.');
modules/email/save.php 112)       } else {
modules/email/save.php 113)         $valid_until_date = strtotime($tmpdate);
modules/email/save.php 114)       }
modules/email/save.php 115)     }
bernd Konfiguration des Autorespo...

bernd authored 12 years ago

modules/email/save.php 116)   }
modules/email/save.php 117)   if (!isset($_POST['autoresponder']) || $_POST['autoresponder'] != 'yes') {
bernd Datums-Check und Daten in u...

bernd authored 12 years ago

modules/email/save.php 118)     $valid_from_date = NULL;
modules/email/save.php 119)   }
modules/email/save.php 120)   if ($valid_until_date && $valid_until_date < time()) {
modules/email/save.php 121)     warning('Das Deaktivierungs-Datum liegt in der Vergangenheit, eine automatische Deaktivierung wird nicht stattfinden.');
modules/email/save.php 122)     $valid_until_date = NULL;
modules/email/save.php 123)   }
modules/email/save.php 124)   if ($valid_from_date) {
modules/email/save.php 125)     $ar['valid_from'] = date('Y-m-d', $valid_from_date);
modules/email/save.php 126)   } else {
bernd Konfiguration des Autorespo...

bernd authored 12 years ago

modules/email/save.php 127)     $ar['valid_from'] = NULL;
modules/email/save.php 128)   }
bernd Datums-Check und Daten in u...

bernd authored 12 years ago

modules/email/save.php 129)   if ($valid_until_date) {
modules/email/save.php 130)     $ar['valid_until'] = date('Y-m-d', $valid_until_date);
modules/email/save.php 131)   } else {
bernd Konfiguration des Autorespo...

bernd authored 12 years ago

modules/email/save.php 132)     $ar['valid_until'] = NULL;
modules/email/save.php 133)   }
modules/email/save.php 134) 
modules/email/save.php 135)   if (isset($_POST['ar_subject']) && $_POST['ar_subject'] == 'custom' && isset($_POST['ar_subject_value']) && chop($_POST['ar_subject_value']) != '') {
modules/email/save.php 136)     $ar['subject'] = filter_input_general( chop($_POST['ar_subject_value']) );
modules/email/save.php 137)   }
modules/email/save.php 138) 
modules/email/save.php 139)   if (isset($_POST['ar_message'])) {
modules/email/save.php 140)     $ar['message'] = filter_input_general( $_POST['ar_message'] );
modules/email/save.php 141)   }
modules/email/save.php 142) 
modules/email/save.php 143)   if (isset($_POST['ar_quote'])) {
modules/email/save.php 144)     if ($_POST['ar_quote'] == 'inline') {
modules/email/save.php 145)       $ar['quote'] = 'inline';
modules/email/save.php 146)     }
modules/email/save.php 147)     if ($_POST['ar_quote'] == 'attach') {
modules/email/save.php 148)       $ar['quote'] = 'attach';
modules/email/save.php 149)     }
modules/email/save.php 150)   }
modules/email/save.php 151) 
modules/email/save.php 152)   if (isset($_POST['ar_from']) && $_POST['ar_from'] == 'custom' && isset($_POST['ar_fromname'])) {
modules/email/save.php 153)     $ar['fromname'] = filter_input_general( $_POST['ar_fromname']);
modules/email/save.php 154)   }
modules/email/save.php 155)     
modules/email/save.php 156)   $account['autoresponder'] = $ar;
modules/email/save.php 157) 
modules/email/save.php 158) 
modules/email/save.php 159) 
bernd VMail-Quota-Zeug

bernd authored 13 years ago

modules/email/save.php 160)   if (isset($_POST['forward']) && $_POST['forward'] == 'yes')
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/save.php 161)   {
modules/vmail/save.php 162)     $num = 1;
modules/vmail/save.php 163)     while (true)
modules/vmail/save.php 164)     {
bernd JavaScript-Erweiterungen: U...

bernd authored 12 years ago

modules/email/save.php 165)       // Die ersten 50 Einträge in jedem Fall prüfen, danach nur so lange zusätzliche Einträge vorhanden
modules/email/save.php 166)       if (! isset($_POST['forward_to_'.$num]) && ! isset($_POST['spamfilter_action_'.$num]) && $num > 50)
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/save.php 167)         break;
bernd JavaScript-Erweiterungen: U...

bernd authored 12 years ago

modules/email/save.php 168)       if (isset($_POST['forward_to_'.$num]) && chop($_POST['forward_to_'.$num]) != '') {
modules/email/save.php 169)         $fwd = array("spamfilter" => $_POST['spamfilter_action_'.$num], "destination" => chop($_POST['forward_to_'.$num]));
modules/email/save.php 170)         array_push($account['forwards'], $fwd);
modules/email/save.php 171)       }
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/save.php 172)       $num++;
modules/vmail/save.php 173)     }
bernd JavaScript-Erweiterungen: U...

bernd authored 12 years ago

modules/email/save.php 174)     if (count($account['forwards']) == 0) system_failure("Bitte mindestens eine Weiterleitungsadresse angeben.");
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/save.php 175)   }
bernd diverse spezial/fehlerfälle...

bernd authored 16 years ago

modules/vmail/save.php 176) 
bernd VMail-Quota-Zeug

bernd authored 13 years ago

modules/email/save.php 177)   if ((isset($_POST['forward']) && $_POST['forward']!='yes') && ($_POST['mailbox']!='yes'))
bernd diverse spezial/fehlerfälle...

bernd authored 16 years ago

modules/vmail/save.php 178)     system_failure("Entweder eine Mailbox oder eine Weiterleitung muss angegeben werden!");
bernd Erste Version des vmail-Modul

bernd authored 17 years ago

modules/vmail/save.php 179) 
modules/vmail/save.php 180)   DEBUG($account);
modules/vmail/save.php 181) 
modules/vmail/save.php 182)   save_vmail_account($account);
modules/vmail/save.php 183) 
bernd Datums-Check und Daten in u...

bernd authored 12 years ago

modules/email/save.php 184)   if (! ($debugmode || we_have_an_error())) {
bernd VMail-User können ihre Eins...

bernd authored 12 years ago

modules/email/save.php 185)     if ($accountlogin) {
bernd Index-Blöcke werden jetzt v...

bernd authored 12 years ago

modules/email/save.php 186)       header('Location: /');
bernd VMail-User können ihre Eins...

bernd authored 12 years ago

modules/email/save.php 187)     } else {
modules/email/save.php 188)       header('Location: vmail');
modules/email/save.php 189)     }
bernd Datums-Check und Daten in u...

bernd authored 12 years ago

modules/email/save.php 190)   }
bernd Löschen geht jetzt auch

bernd authored 17 years ago

modules/vmail/save.php 191) }
modules/vmail/save.php 192) elseif ($_GET['action'] == 'delete')
modules/vmail/save.php 193) {
modules/vmail/save.php 194)   $title = "E-mail-Adresse löschen";
modules/vmail/save.php 195)   $section = 'vmail_vmail';
modules/vmail/save.php 196) 
modules/vmail/save.php 197)   $account = get_account_details( (int) $_GET['id'] );
modules/vmail/save.php 198) 
modules/vmail/save.php 199)   $domain = NULL;
modules/vmail/save.php 200)   $domains = get_vmail_domains();
modules/vmail/save.php 201)   foreach ($domains as $dom)
modules/vmail/save.php 202)     if ($dom->id == $account['domain'])
modules/vmail/save.php 203)     {
modules/vmail/save.php 204)       $domain = $dom->domainname;
modules/vmail/save.php 205)       break;
modules/vmail/save.php 206)     }
modules/vmail/save.php 207)   $account_string = $account['local'] . "@" . $domain;
modules/vmail/save.php 208)   $sure = user_is_sure();
modules/vmail/save.php 209)   if ($sure === NULL)
modules/vmail/save.php 210)   {
bernd * alle internen Links sinnv...

bernd authored 15 years ago

modules/email/save.php 211)     are_you_sure("action=delete&id={$account['id']}", "Möchten Sie die E-Mail-Adresse »{$account_string}« wirklich löschen?");
bernd Löschen geht jetzt auch

bernd authored 17 years ago

modules/vmail/save.php 212)   }
modules/vmail/save.php 213)   elseif ($sure === true)
modules/vmail/save.php 214)   {
modules/vmail/save.php 215)     delete_account($account['id']);
modules/vmail/save.php 216)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 16 years ago

modules/email/save.php 217)       header("Location: vmail");
bernd Löschen geht jetzt auch

bernd authored 17 years ago

modules/vmail/save.php 218)   }
modules/vmail/save.php 219)   elseif ($sure === false)
modules/vmail/save.php 220)   {
modules/vmail/save.php 221)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 16 years ago

modules/email/save.php 222)       header("Location: vmail");
bernd Löschen geht jetzt auch

bernd authored 17 years ago

modules/vmail/save.php 223)   }