79544fe5897fb2f6c6de710c6ec960fc4b959566
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

1) <?php
2) 
3) require_once('inc/debug.php');
4) require_once('inc/security.php');
5) 
6) require_once('vmail.php');
7) 
8) $title = "E-Mail-Adresse bearbeiten";
9) $section = 'vmail_accounts';
10) require_role(ROLE_SYSTEMUSER);
11) 
12) $id = (int) $_GET['id'];
bernd huch, was macht das denn da...

bernd authored 16 years ago

13) $account = empty_account();
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

14) 
15) if ($id != 0)
16)   $account = get_account_details($id);
17) 
18) DEBUG($account);
19) if ($id == 0) {
20)   output("<h3>Neue E-Mail-Adresse anlegen</h3>");
21)   $title = "E-Mail-Adresse anlegen";
22) }
23) else {
24)   output("<h3>E-Mail-Adresse bearbeiten</h3>");
25) }
26) 
27) 
bernd Anpassung auf neues Interface

bernd authored 16 years ago

28) $is_forward = (count($account['forwards']) > 0);
29) $is_mailbox = ($account['password'] != NULL  ||  $id == 0);
30) $numforwards = max(count($account['forwards']), 1);
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

31) 
bernd Neues VMail-Interface (funk...

bernd authored 16 years ago

32) output("<script type=\"text/javascript\">
33)   
bernd Anpassung auf neues Interface

bernd authored 16 years ago

34)   var numForwards = {$numforwards};
bernd Neues VMail-Interface (funk...

bernd authored 16 years ago

35) 
36)   function moreForward()
37)   {
38)     numForwards += 1;
39) 
bernd Neues Design für VMail-Edit...

bernd authored 16 years ago

40)     P1 = document.createElement('p');
41) 
42)     TXT1 = document.createTextNode('Weiterleiten an ');
bernd Neues VMail-Interface (funk...

bernd authored 16 years ago

43) 
44)     INPUT = document.createElement('input');
45)     INPUT.type = 'text';
46)     INPUT.name = 'forward_to_' + numForwards;
47)     INPUT.value = '';
48) 
bernd Neues Design für VMail-Edit...

bernd authored 16 years ago

49)     P1.appendChild(TXT1);
50)     P1.appendChild(INPUT);
51) 
52)     P2 = document.createElement('p');
53) 
54)     TXT2 = document.createTextNode('Spam-Mails an diese Adresse ');
55) 
bernd Neues VMail-Interface (funk...

bernd authored 16 years ago

56)     SELECT = document.createElement('select');
57)     SELECT.name = 'spamfilter_action_' + numForwards;
58) 
bernd Sterne in das Passwort-Feld...

bernd authored 16 years ago

59)     SELECT.options[0] = new Option('kein Filter', 'none', 0);
60)     SELECT.options[1] = new Option('markieren und zustellen', 'tag', 1);
bernd Neues VMail-Interface (funk...

bernd authored 16 years ago

61)     SELECT.options[2] = new Option('nicht zustellen', 'delete', 0);
62) 
bernd Neues Design für VMail-Edit...

bernd authored 16 years ago

63)     P2.appendChild(TXT2);
64)     P2.appendChild(SELECT);
65) 
66)     DIV = document.createElement('div');
67)     DIV.className = 'vmail-forward';
bernd Neues VMail-Interface (funk...

bernd authored 16 years ago

68) 
bernd Neues Design für VMail-Edit...

bernd authored 16 years ago

69)     DIV.appendChild(P1);
70)     DIV.appendChild(P2);
bernd Neues VMail-Interface (funk...

bernd authored 16 years ago

71) 
bernd Neues Design für VMail-Edit...

bernd authored 16 years ago

72)     parent = document.getElementById('forward_config');
73)     parent.appendChild(DIV);
bernd Neues VMail-Interface (funk...

bernd authored 16 years ago

74)   }
75) </script>
76) ");
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

77) 
78) $form = "
bernd domain-auswahlfeld korrekt...

bernd authored 16 years ago

79)     <p><strong>E-Mail-Adresse:</strong>&#160;<input type=\"text\" name=\"local\" id=\"local\" size=\"10\" value=\"{$account['local']}\" /><strong style=\"font-size: 1.5em;\">&#160;@&#160;</strong>".domainselect($account['domain'])."</p>";
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

80) 
81) $password_message = '';
bernd Sterne in das Passwort-feld...

bernd authored 16 years ago

82) $password_value = '';
bernd Anpassung auf neues Interface

bernd authored 16 years ago

83) if ($is_mailbox and ($account['password'] != ''))
bernd Sterne in das Passwort-feld...

bernd authored 16 years ago

84) {
bernd Eingabefeld breiter

bernd authored 16 years ago

85)   $password_message = '<span style="font-size: 80%"><br /><em>Sie haben bereits ein Passwort gesetzt. Wenn Sie dieses Feld nicht ändern, wird das bisherige Passwort beibehalten.</em></span>';
bernd Sterne in das Passwort-feld...

bernd authored 16 years ago

86)   $password_value = '**********';
87) } 
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

88) 
bernd Neues VMail-Interface (funk...

bernd authored 16 years ago

89) $form .= "
bernd Eingabefeld breiter

bernd authored 16 years ago

90)     <p><input type=\"checkbox\" id=\"mailbox\" name=\"mailbox\" value=\"yes\" ".($is_mailbox ? 'checked="checked" ' : '')." /><label for=\"mailbox\">&#160;<strong>In Mailbox speichern</strong></label></p>
bernd Sterne in das Passwort-feld...

bernd authored 16 years ago

91)     <p style=\"margin-left: 2em;\" id=\"mailbox_options\">Passwort für Abruf:&#160;<input type=\"password\" id=\"password\" name=\"password\" value=\"{$password_value}\" />{$password_message}</p>";
bernd Neues VMail-Interface (funk...

bernd authored 16 years ago

92) 
bernd Eingabefeld breiter

bernd authored 16 years ago

93) $form.= "<p style=\"margin-left: 2em;\" class=\"spamfilter_options\">Unerwünschte E-Mails (Spam, Viren) in diesem Postfach ".html_select('spamfilter_action', array("none" => 'nicht filtern', "folder" => 'in Unterordner »Spam« ablegen', "tag" => 'markieren und zustellen', "delete" => 'nicht zustellen (löschen)'), $account['spamfilter'])."</p>";
bernd Neues VMail-Interface (funk...

bernd authored 16 years ago

94) 
bernd Eingabefeld breiter

bernd authored 16 years ago

95) $form .= "<p><input type=\"checkbox\" id=\"forward\" name=\"forward\" value=\"yes\" ".($is_forward ? 'checked="checked" ' : '')." /><label for=\"forward\">&#160;<strong>Weiterleitung an andere E-Mail-Adressen</strong></label></p>";
bernd Neues VMail-Interface (funk...

bernd authored 16 years ago

96) 
bernd Neues Design für VMail-Edit...

bernd authored 16 years ago

97) 
98) $form .= "<div style=\"margin-left: 2em;\" id=\"forward_config\">";
bernd Neues VMail-Interface (funk...

bernd authored 16 years ago

99) 
bernd Anpassung auf neues Interface

bernd authored 16 years ago

100) if ($is_forward)
101) {
102)   for ($i = 0 ; $i < $numforwards ; $i++)
103)   {
bernd Neues Design für VMail-Edit...

bernd authored 16 years ago

104)     $num = $i+1;
105)     $form .= "<div class=\"vmail-forward\">
106)     <p>Weiterleiten an <input type=\"text\" id=\"forward_to_{$num}\" name=\"forward_to_{$num}\" value=\"{$account['forwards'][$i]['destination']}\" /></p>
107)     <p>Spam-Mails an diese Adresse ".html_select('spamfilter_action_'.$num, array("none" => 'nicht filtern', "tag" => 'markieren und zustellen', "delete" => 'nicht zustellen'), $account['forwards'][$i]['spamfilter'])."</p>
108)     </div>\n";
bernd Anpassung auf neues Interface

bernd authored 16 years ago

109)   }
110) }
111) else
112) {
bernd Neues Design für VMail-Edit...

bernd authored 16 years ago

113)     $form .= "<div class=\"vmail-forward\">
114)     <p>Weiterleiten an <input type=\"text\" id=\"forward_to_1\" name=\"forward_to_1\" value=\"\" /></p>
115)     <p>Spam-Mails an diese Adresse ".html_select('spamfilter_action_1', array("none" => 'nicht filtern', "tag" => 'markieren und zustellen', "delete" => 'nicht zustellen'), "none")."</p>
116)     </div>\n";
bernd Anpassung auf neues Interface

bernd authored 16 years ago

117) }
118) 
bernd Neues Design für VMail-Edit...

bernd authored 16 years ago

119) $form .= '</div>';
120) 
121) $form .= '<p style="margin-left: 2em;">[ <a href="#" onclick="moreForward();">mehr Empfänger</a> ]</p>