d5f2f3f40845c818f65b41258a2ba19f6c494175
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 Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/save.php  35) 
modules/vmail/save.php  36)   if ($_POST['forward'] == 'yes')
modules/vmail/save.php  37)   {
modules/vmail/save.php  38)     $num = 1;
modules/vmail/save.php  39)     while (true)
modules/vmail/save.php  40)     {
modules/vmail/save.php  41)       if (! isset($_POST['forward_to_'.$num]))
modules/vmail/save.php  42)         break;
bernd Bugfixes

bernd authored 16 years ago

modules/vmail/save.php  43)       if ($_POST['forward_to_'.$num] == '')
modules/vmail/save.php  44)         break;
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/save.php  45)       $fwd = array("spamfilter" => $_POST['spamfilter_action_'.$num], "destination" => $_POST['forward_to_'.$num]);
modules/vmail/save.php  46)       array_push($account['forwards'], $fwd);
modules/vmail/save.php  47)       $num++;
modules/vmail/save.php  48)     }
bernd diverse spezial/fehlerfälle...

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

modules/vmail/save.php  51) 
modules/vmail/save.php  52)   if (($_POST['forward']!='yes') && ($_POST['mailbox']!='yes'))
modules/vmail/save.php  53)     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  54) 
modules/vmail/save.php  55)   DEBUG($account);
modules/vmail/save.php  56) 
modules/vmail/save.php  57)   save_vmail_account($account);
modules/vmail/save.php  58) 
modules/vmail/save.php  59)   if (! ($debugmode || we_have_an_error()))
bernd eliminate .php extensions f...

bernd authored 16 years ago

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

bernd authored 17 years ago

modules/vmail/save.php  61) }
modules/vmail/save.php  62) elseif ($_GET['action'] == 'delete')
modules/vmail/save.php  63) {
modules/vmail/save.php  64)   $title = "E-mail-Adresse löschen";
modules/vmail/save.php  65)   $section = 'vmail_vmail';
modules/vmail/save.php  66) 
modules/vmail/save.php  67)   $account = get_account_details( (int) $_GET['id'] );
modules/vmail/save.php  68) 
modules/vmail/save.php  69)   $domain = NULL;
modules/vmail/save.php  70)   $domains = get_vmail_domains();
modules/vmail/save.php  71)   foreach ($domains as $dom)
modules/vmail/save.php  72)     if ($dom->id == $account['domain'])
modules/vmail/save.php  73)     {
modules/vmail/save.php  74)       $domain = $dom->domainname;
modules/vmail/save.php  75)       break;
modules/vmail/save.php  76)     }
modules/vmail/save.php  77)   $account_string = $account['local'] . "@" . $domain;
modules/vmail/save.php  78)   $sure = user_is_sure();
modules/vmail/save.php  79)   if ($sure === NULL)
modules/vmail/save.php  80)   {
bernd * alle internen Links sinnv...

bernd authored 15 years ago

modules/email/save.php  81)     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  82)   }
modules/vmail/save.php  83)   elseif ($sure === true)
modules/vmail/save.php  84)   {
modules/vmail/save.php  85)     delete_account($account['id']);
modules/vmail/save.php  86)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 16 years ago

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

bernd authored 17 years ago

modules/vmail/save.php  88)   }
modules/vmail/save.php  89)   elseif ($sure === false)
modules/vmail/save.php  90)   {
modules/vmail/save.php  91)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 16 years ago

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

bernd authored 17 years ago

modules/vmail/save.php  93)   }