5f53b4734501bf3320dda4921ea68eb7da2a9086
bernd Erste Version des vmail-Modul

bernd authored 17 years ago

modules/vmail/save.php   1) <?php
modules/vmail/save.php   2) 
modules/vmail/save.php   3) require_once('session/start.php');
modules/vmail/save.php   4) 
modules/vmail/save.php   5) require_once('vmail.php');
modules/vmail/save.php   6) 
modules/vmail/save.php   7) require_role(ROLE_SYSTEMUSER);
modules/vmail/save.php   8) 
modules/vmail/save.php   9) require_once("inc/debug.php");
modules/vmail/save.php  10) global $debugmode;
modules/vmail/save.php  11) 
modules/vmail/save.php  12) 
modules/vmail/save.php  13) if ($_GET['action'] == 'edit')
modules/vmail/save.php  14) {
modules/vmail/save.php  15)   check_form_token('vmail_edit_mailbox');
modules/vmail/save.php  16)   $id = (int) $_GET['id'];
modules/vmail/save.php  17) 
modules/vmail/save.php  18)   $account = empty_account();
modules/vmail/save.php  19)   $account['id'] = NULL;
modules/vmail/save.php  20)   if ($id)
modules/vmail/save.php  21)     $account['id'] = $id;
modules/vmail/save.php  22)   $account['local'] = $_POST['local'];
modules/vmail/save.php  23)   $account['domain'] = (int) $_POST['domain'];
modules/vmail/save.php  24)   $account['spamfilter'] = $_POST['spamfilter_action'];
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/save.php  25)   $account['password'] = $_POST['password'];
bernd diverse spezial/fehlerfälle...

bernd authored 16 years ago

modules/vmail/save.php  26)   if (($account['password'] == '') && ($_POST['mailbox'] == 'yes'))
modules/vmail/save.php  27)     system_failure("Sie haben ein leeres Passwort eingegeben!");
bernd Sterne in das Passwort-Feld...

bernd authored 16 years ago

modules/vmail/save.php  28)   if ($_POST['password'] == '**********')
modules/vmail/save.php  29)     $account['password'] = '';
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/save.php  30)   if ($_POST['mailbox'] != 'yes')
bernd Setze Spamfilter=none wenn...

bernd authored 16 years ago

modules/vmail/save.php  31)   {
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/save.php  32)     $account['password'] = NULL;
bernd Setze Spamfilter=none wenn...

bernd authored 16 years ago

modules/vmail/save.php  33)     $account['spamfilter'] = 'none';
modules/vmail/save.php  34)   }
bernd Mailaccount-Quota auch bei...

bernd authored 13 years ago

modules/email/save.php  35)   if (isset($_POST['quota'])) {
modules/email/save.php  36)     $account['quota'] = $_POST['quota'];
modules/email/save.php  37)   }
bernd Anpassung auf neues Interface

bernd authored 16 years ago

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

bernd authored 13 years ago

modules/email/save.php  39)   $account['quota_threshold'] = -1;
modules/email/save.php  40)   if (isset($_POST['quota_notify']) && isset($_POST['quota_threshold']) && $_POST['quota_notify'] == 1) {
modules/email/save.php  41)     $account['quota_threshold'] = $_POST['quota_threshold'];
modules/email/save.php  42)   }
modules/email/save.php  43) 
bernd Konfiguration des Autorespo...

bernd authored 12 years ago

modules/email/save.php  44) 
modules/email/save.php  45) 
modules/email/save.php  46)   $ar = empty_autoresponder_config();
modules/email/save.php  47)   $valid_from_date = time();
modules/email/save.php  48)   $valid_until_date = NULL;
modules/email/save.php  49)   if (isset($_POST['ar_valid_from_day']) && isset($_POST['ar_valid_from_month']) && isset($_POST['ar_valid_from_year'])) {
modules/email/save.php  50)     $valid_from_date = strtotime($_POST['ar_valid_from_year'].'-'.$_POST['ar_valid_from_month'].'-'.$_POST['ar_valid_from_day']);
modules/email/save.php  51)   }
modules/email/save.php  52)   if (isset($_POST['ar_valid_until_day']) && isset($_POST['ar_valid_until_month']) && isset($_POST['ar_valid_until_year'])) {
modules/email/save.php  53)     $valid_until_date = strtotime($_POST['ar_valid_until_year'].'-'.$_POST['ar_valid_until_month'].'-'.$_POST['ar_valid_until_day']);
modules/email/save.php  54)   }
modules/email/save.php  55)   if (isset($_POST['ar_valid_from']) && ($_POST['ar_valid_from'] == 'now' || $valid_from_date < time())) {
modules/email/save.php  56)     $valid_from_date = time();
modules/email/save.php  57)   }
modules/email/save.php  58)   $ar['valid_from'] = date('Y-m-d', $valid_from_date);
modules/email/save.php  59)   $ar['valid_until'] = date('Y-m-d', $valid_until_date);
modules/email/save.php  60)   if (!isset($_POST['autoresponder']) || $_POST['autoresponder'] != 'yes') {
modules/email/save.php  61)     $ar['valid_from'] = NULL;
modules/email/save.php  62)   }
modules/email/save.php  63)   if (isset($_POST['ar_valid_until']) && ($_POST['ar_valid_until'] == 'infinity' || $valid_until_date < time())) {
modules/email/save.php  64)     $ar['valid_until'] = NULL;
modules/email/save.php  65)   }
modules/email/save.php  66) 
modules/email/save.php  67)   if (isset($_POST['ar_subject']) && $_POST['ar_subject'] == 'custom' && isset($_POST['ar_subject_value']) && chop($_POST['ar_subject_value']) != '') {
modules/email/save.php  68)     $ar['subject'] = filter_input_general( chop($_POST['ar_subject_value']) );
modules/email/save.php  69)   }
modules/email/save.php  70) 
modules/email/save.php  71)   if (isset($_POST['ar_message'])) {
modules/email/save.php  72)     $ar['message'] = filter_input_general( $_POST['ar_message'] );
modules/email/save.php  73)   }
modules/email/save.php  74) 
modules/email/save.php  75)   if (isset($_POST['ar_quote'])) {
modules/email/save.php  76)     if ($_POST['ar_quote'] == 'inline') {
modules/email/save.php  77)       $ar['quote'] = 'inline';
modules/email/save.php  78)     }
modules/email/save.php  79)     if ($_POST['ar_quote'] == 'attach') {
modules/email/save.php  80)       $ar['quote'] = 'attach';
modules/email/save.php  81)     }
modules/email/save.php  82)   }
modules/email/save.php  83) 
modules/email/save.php  84)   if (isset($_POST['ar_from']) && $_POST['ar_from'] == 'custom' && isset($_POST['ar_fromname'])) {
modules/email/save.php  85)     $ar['fromname'] = filter_input_general( $_POST['ar_fromname']);
modules/email/save.php  86)   }
modules/email/save.php  87)     
modules/email/save.php  88)   $account['autoresponder'] = $ar;
modules/email/save.php  89) 
modules/email/save.php  90) 
modules/email/save.php  91) 
bernd VMail-Quota-Zeug

bernd authored 13 years ago

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

bernd authored 16 years ago

modules/vmail/save.php  93)   {
modules/vmail/save.php  94)     $num = 1;
modules/vmail/save.php  95)     while (true)
modules/vmail/save.php  96)     {
modules/vmail/save.php  97)       if (! isset($_POST['forward_to_'.$num]))
modules/vmail/save.php  98)         break;
bernd Bugfixes

bernd authored 16 years ago

modules/vmail/save.php  99)       if ($_POST['forward_to_'.$num] == '')
modules/vmail/save.php 100)         break;
bernd Filtere Leerzeichen am Anfa...

bernd authored 14 years ago

modules/email/save.php 101)       $fwd = array("spamfilter" => $_POST['spamfilter_action_'.$num], "destination" => chop($_POST['forward_to_'.$num]));
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/save.php 102)       array_push($account['forwards'], $fwd);
modules/vmail/save.php 103)       $num++;
modules/vmail/save.php 104)     }
bernd diverse spezial/fehlerfälle...

bernd authored 16 years ago

modules/vmail/save.php 105)     if ($num == 1) system_failure("Bitte mindestens eine Weiterleitungsadresse angeben.");
bernd Anpassung auf neues Interface

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 13 years ago

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

bernd authored 16 years ago

modules/vmail/save.php 109)     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 110) 
modules/vmail/save.php 111)   DEBUG($account);
modules/vmail/save.php 112) 
modules/vmail/save.php 113)   save_vmail_account($account);
modules/vmail/save.php 114) 
modules/vmail/save.php 115)   if (! ($debugmode || we_have_an_error()))
bernd eliminate .php extensions f...

bernd authored 16 years ago

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

bernd authored 17 years ago

modules/vmail/save.php 117) }
modules/vmail/save.php 118) elseif ($_GET['action'] == 'delete')
modules/vmail/save.php 119) {
modules/vmail/save.php 120)   $title = "E-mail-Adresse löschen";
modules/vmail/save.php 121)   $section = 'vmail_vmail';
modules/vmail/save.php 122) 
modules/vmail/save.php 123)   $account = get_account_details( (int) $_GET['id'] );
modules/vmail/save.php 124) 
modules/vmail/save.php 125)   $domain = NULL;
modules/vmail/save.php 126)   $domains = get_vmail_domains();
modules/vmail/save.php 127)   foreach ($domains as $dom)
modules/vmail/save.php 128)     if ($dom->id == $account['domain'])
modules/vmail/save.php 129)     {
modules/vmail/save.php 130)       $domain = $dom->domainname;
modules/vmail/save.php 131)       break;
modules/vmail/save.php 132)     }
modules/vmail/save.php 133)   $account_string = $account['local'] . "@" . $domain;
modules/vmail/save.php 134)   $sure = user_is_sure();
modules/vmail/save.php 135)   if ($sure === NULL)
modules/vmail/save.php 136)   {
bernd * alle internen Links sinnv...

bernd authored 15 years ago

modules/email/save.php 137)     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 138)   }
modules/vmail/save.php 139)   elseif ($sure === true)
modules/vmail/save.php 140)   {
modules/vmail/save.php 141)     delete_account($account['id']);
modules/vmail/save.php 142)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 16 years ago

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

bernd authored 17 years ago

modules/vmail/save.php 144)   }
modules/vmail/save.php 145)   elseif ($sure === false)
modules/vmail/save.php 146)   {
modules/vmail/save.php 147)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 16 years ago

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

bernd authored 17 years ago

modules/vmail/save.php 149)   }