9086c9ad77db90633e0629e9e86a88366265ded0
bernd webinterface => /webinterface

bernd authored 17 years ago

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

Bernd Wurst authored 12 years ago

modules/email/imap.php      2) /*
modules/email/imap.php      3) This file belongs to the Webinterface of schokokeks.org Hosting
modules/email/imap.php      4) 
Bernd Wurst Copyright year update

Bernd Wurst authored 6 years ago

modules/email/imap.php      5) Written 2008-2018 by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

modules/email/imap.php      6)   Bernd Wurst <bernd@schokokeks.org>
modules/email/imap.php      7)   Hanno Böck <hanno@schokokeks.org>
modules/email/imap.php      8) 
modules/email/imap.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/imap.php     10) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/email/imap.php     11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

modules/email/imap.php     12) http://creativecommons.org/publicdomain/zero/1.0/
modules/email/imap.php     13) 
modules/email/imap.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/imap.php     15) */
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php  16) 
modules/imap/accounts.php  17) require_once('session/start.php');
modules/imap/accounts.php  18) 
bernd Domain-Klasse benutzen

bernd authored 16 years ago

modules/imap/accounts.php  19) require_once('class/domain.php');
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php  20) require_once('mailaccounts.php');
modules/imap/accounts.php  21) 
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

modules/email/imap.php     22) require_once('inc/icons.php');
modules/email/imap.php     23) 
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php  24) require_role(ROLE_SYSTEMUSER);
modules/imap/accounts.php  25) 
bernd Benutzer config-Variablen f...

bernd authored 15 years ago

modules/email/imap.php     26) 
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php  27) $user = $_SESSION['userinfo'];
modules/imap/accounts.php  28) 
bernd Benutze überall title() sta...

bernd authored 13 years ago

modules/email/imap.php     29) title("E-Mail-Accounts");
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php  30) 
modules/imap/accounts.php  31) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/email/imap.php     32) if (isset($_GET['action']) && $_GET['action'] == 'save') {
modules/email/imap.php     33)     if (isset($_GET['id'])) {
modules/email/imap.php     34)         check_form_token('email_imap_edit');
modules/email/imap.php     35)         $account = $_POST['user'].'@'.$_POST['domain'];
modules/email/imap.php     36)         if (isset($_POST['enabled']) && $_POST['enabled'] == 'true') {
modules/email/imap.php     37)             $enabled = 'Y';
modules/email/imap.php     38)         } else {
modules/email/imap.php     39)             $enabled = 'N';
modules/email/imap.php     40)         }
modules/email/imap.php     41)         $acc = array('id' => $_GET['id'], 'account' => $account, 'mailbox' => $_POST['mailbox'], 'enabled' => $enabled);
modules/email/imap.php     42)         if ($_POST['password'] != '') {
modules/email/imap.php     43)             $acc['password'] = $_POST['password'];
modules/email/imap.php     44)         }
modules/email/imap.php     45)         $error = check_valid($acc);
modules/email/imap.php     46)         if ($error != "") {
modules/email/imap.php     47)             input_error($error);
modules/email/imap.php     48)             $title = "E-Mail-Accounts";
modules/email/imap.php     49)             output("");
modules/email/imap.php     50)         } else {
modules/email/imap.php     51)             change_mailaccount($_GET['id'], $acc);
modules/email/imap.php     52)             if (! $debugmode) {
modules/email/imap.php     53)                 header('Location: imap');
modules/email/imap.php     54)             }
modules/email/imap.php     55)             die();
modules/email/imap.php     56)         }
modules/email/imap.php     57)     } elseif (isset($_POST['create'])) {
modules/email/imap.php     58)         check_form_token('email_imap_create');
modules/email/imap.php     59)         $account = $_POST['user'].'@'.$_POST['domain'];
modules/email/imap.php     60)         if (isset($_POST['enabled']) && $_POST['enabled'] == 'true') {
modules/email/imap.php     61)             $enabled = 'Y';
modules/email/imap.php     62)         } else {
modules/email/imap.php     63)             $enabled = 'N';
modules/email/imap.php     64)         }
modules/email/imap.php     65)         $acc = array('account' => $account, 'mailbox' => $_POST['mailbox'], 'enabled' => $enabled);
modules/email/imap.php     66)         if ($_POST['password'] != '') {
modules/email/imap.php     67)             $acc['password'] = $_POST['password'];
modules/email/imap.php     68)         }
modules/email/imap.php     69)         $error = check_valid($acc);
modules/email/imap.php     70)         if ($error != "") {
modules/email/imap.php     71)             system_failure($error);
modules/email/imap.php     72)         } else {
modules/email/imap.php     73)             create_mailaccount($acc);
modules/email/imap.php     74)             if (! $debugmode) {
modules/email/imap.php     75)                 header('Location: imap');
modules/email/imap.php     76)             }
modules/email/imap.php     77)             die();
modules/email/imap.php     78)         }
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php  79)     }
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/email/imap.php     80) } elseif (isset($_GET['action']) && $_GET['action'] == 'create') {
modules/email/imap.php     81)     $options = '';
modules/email/imap.php     82)     $domains = get_domain_list($user['customerno'], $user['uid']);
modules/email/imap.php     83)     if (count($domains) > 0) {
modules/email/imap.php     84)         $options .= '<option>----------------------------</option>';
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php  85)     }
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/email/imap.php     86)     foreach ($domains as $dom) {
modules/email/imap.php     87)         $options .= '<option value="'.$dom->fqdn.'">'.$dom->fqdn.'</option>';
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php  88)     }
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/email/imap.php     89) 
modules/email/imap.php     90)     title("IMAP-Account anlegen");
modules/email/imap.php     91)     output('<p>Hier können Sie ein neues POP3/IMAP-Konto anlegen.</p>
bernd eliminate .php extensions f...

bernd authored 15 years ago

modules/email/imap.php     92) <p style="border: 2px solid red; background-color: white; padding:1em;"><strong>ACHTUNG:</strong> ein POP3-/IMAP-Account ist <strong>keine E-Mail-Adresse</strong>. Wenn Sie sich nicht sicher sind, lesen Sie bitte die Anleitung <a href="https://wiki.schokokeks.org/E-Mail/Konfiguration">in unserem Wiki</a>. Sie können Ihre E-Mail-Konten auch über eine einfachere Möglichkeit verwalten, dann ist eine Einrichtung über diese Weboberfläche möglich. Die Umstellung erfolgt '.internal_link("../email/domains", "unter Domains").'.</p>
modules/email/imap.php     93)   '.html_form('email_imap_create', 'imap', 'action=save', '
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php  94)   <table style="margin-bottom: 1em;">
bernd Entities repariert

bernd authored 16 years ago

modules/imap/accounts.php  95)   <tr><th>Einstellung:</th><th>Wert:</th><th>&#160;</th></tr>
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php  96)   <tr>
modules/imap/accounts.php  97)     <td>Benutzername:</td>
modules/imap/accounts.php  98)     <td><input type="text" id="user" name="user" />@<select name="domain" size="1">
bernd Mehr config-optionen und co...

bernd authored 14 years ago

modules/email/imap.php     99)     <option value="'.config('masterdomain').'">'.config('masterdomain').'</option>
bernd XSS/CSRF-Bugs behoben

bernd authored 16 years ago

modules/imap/accounts.php 100)   '.$options.'
modules/imap/accounts.php 101)     </select></td>
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 102)   </tr>
modules/imap/accounts.php 103)   <tr>
modules/imap/accounts.php 104)     <td>Mailbox:</td>
modules/imap/accounts.php 105)     <td><input type="text" id="mailbox" name="mailbox" value="'.$user['homedir'].'/" /></td>
modules/imap/accounts.php 106)   </tr>
modules/imap/accounts.php 107)   <tr>
modules/imap/accounts.php 108)     <td>Passwort:</td>
modules/imap/accounts.php 109)     <td><input type="password" id="password" name="password" value="" /></td>
modules/imap/accounts.php 110)   </tr>
modules/imap/accounts.php 111)   <tr>
modules/imap/accounts.php 112)     <td>Account sofort aktivieren:</td>
modules/imap/accounts.php 113)     <td><input type="checkbox" id="enabled" name="enabled" value="true" /></td>
modules/imap/accounts.php 114)   </tr>
modules/imap/accounts.php 115)   </table>
bernd XML-Fehler

bernd authored 16 years ago

modules/imap/accounts.php 116)   <p><input type="submit" name="create" value="Anlegen" /></p>
bernd XSS/CSRF-Bugs behoben

bernd authored 16 years ago

modules/imap/accounts.php 117)   '));
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/email/imap.php    118) } elseif (isset($_GET['action']) && $_GET['action'] == 'delete' && $_GET['account'] != '') {
modules/email/imap.php    119)     $sure = user_is_sure();
modules/email/imap.php    120)     if ($sure === null) {
modules/email/imap.php    121)         $_GET['account'] = (int) $_GET['account'];
modules/email/imap.php    122)         $account = get_mailaccount($_GET['account']);
modules/email/imap.php    123)         $enabled = ($account['enabled'] ? 'Ja' : 'Nein');
modules/email/imap.php    124)         are_you_sure("action=delete&account={$_GET['account']}", '
bernd Entities repariert

bernd authored 16 years ago

modules/imap/accounts.php 125)     <p>Soll der folgende Account wirklich gelöscht werden?</p>
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

modules/imap/accounts.php 126)     <table style="margin-bottom: 1em;">
modules/imap/accounts.php 127)       <tr><td>Benutzername:</td>
modules/imap/accounts.php 128)         <td>'.filter_input_general($account['account']).'</td>
modules/imap/accounts.php 129)       </tr>
modules/imap/accounts.php 130)       <tr><td>Mailbox:</td>
modules/imap/accounts.php 131)         <td>'.filter_input_general($account['mailbox']).'</td>
modules/imap/accounts.php 132)       </tr>
modules/imap/accounts.php 133)       <tr><td>Konto aktiv:</td>
modules/imap/accounts.php 134)         <td>'.$enabled.'</td>
modules/imap/accounts.php 135)       </tr>
modules/imap/accounts.php 136)     </table>
modules/imap/accounts.php 137) ');
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/email/imap.php    138)     } elseif ($sure === true) {
modules/email/imap.php    139)         delete_mailaccount($_GET['account']);
modules/email/imap.php    140)         if (! $debugmode) {
modules/email/imap.php    141)             header('Location: imap');
modules/email/imap.php    142)         }
modules/email/imap.php    143)         die();
modules/email/imap.php    144)     } elseif ($sure === false) {
modules/email/imap.php    145)         if (! $debugmode) {
modules/email/imap.php    146)             header("Location: imap");
modules/email/imap.php    147)         }
modules/email/imap.php    148)         die();
modules/email/imap.php    149)     }
modules/email/imap.php    150) } elseif (isset($_GET['edit'])) {
modules/email/imap.php    151)     title("IMAP-Account bearbeiten");
modules/email/imap.php    152)     output('<p>Hier können Sie die Einstellungen des IMAP-Kontos bearbeiten.</p>
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 153) ');
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/email/imap.php    154)     $_GET['edit'] = (int) $_GET['edit'];
modules/email/imap.php    155)     $account = get_mailaccount($_GET['edit']);
modules/email/imap.php    156)     list($username, $domain) = explode('@', $account['account'], 2);
modules/email/imap.php    157)     $enabled = ($account['enabled'] ? ' checked="checked"' : '');
modules/email/imap.php    158)     $form = '
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 159)   <table style="margin-bottom: 1em;">
bernd Entities repariert

bernd authored 16 years ago

modules/imap/accounts.php 160)   <tr><th>Einstellung:</th><th>alter Wert:</th><th>neuer Wert:</th><th>&#160;</th></tr>
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 161)   <tr><td>Benutzername:</td><td><input type="text" id="old_account" name="old_account" value="'.$account['account'].'" readonly="readonly" style="background-color: #C0C0C0;" /></td>
modules/imap/accounts.php 162)           <td><input type="text" id="user" name="user" value="'.$username.'" />@<select name="domain" id="domain" size="1">
bernd Mehr config-optionen und co...

bernd authored 14 years ago

modules/email/imap.php    163)     <option value="'.config('masterdomain').'">'.config('masterdomain').'</option>
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

modules/imap/accounts.php 164)     ';
bernd Domain-Klasse benutzen

bernd authored 16 years ago

modules/imap/accounts.php 165)     $domains = get_domain_list($user['customerno'], $user['uid']);
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/email/imap.php    166)     if (count($domains) > 0) {
modules/email/imap.php    167)         $form .= '<option>----------------------------</option>';
modules/email/imap.php    168)     }
modules/email/imap.php    169)     foreach ($domains as $dom) {
modules/email/imap.php    170)         if ($domain == $dom->fqdn) {
modules/email/imap.php    171)             $form .= '<option value="'.$dom->fqdn.'" selected="selected">'.$dom->fqdn.'</option>';
modules/email/imap.php    172)         } else {
modules/email/imap.php    173)             $form .= '<option value="'.$dom->fqdn.'">'.$dom->fqdn.'</option>';
modules/email/imap.php    174)         }
modules/email/imap.php    175)     }
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 176) 
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

modules/imap/accounts.php 177)     $form .= '</select></td>
bernd Entities repariert

bernd authored 16 years ago

modules/imap/accounts.php 178)           <td><input type="button" onclick="document.getElementById(\'user\').value = \''.$username.'\' ; document.getElementById(\'domain\').value = \''.$domain.'\'" value="Zeile zurücksetzen" /></td></tr>
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 179)   <tr><td>Mailbox:</td><td><input type="text" id="old_mailbox" name="old_mailbox" value="'.$account['mailbox'].'" readonly="readonly" style="background-color: #C0C0C0;" /></td>
modules/imap/accounts.php 180)           <td><input type="text" id="mailbox" name="mailbox" value="'.$account['mailbox'].'" /></td>
bernd Entities repariert

bernd authored 16 years ago

modules/imap/accounts.php 181)           <td><input type="button" onclick="document.getElementById(\'mailbox\').value = document.getElementById(\'old_mailbox\').value" value="Zeile zurücksetzen" /></td></tr>
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 182)   <tr><td>Passwort:</td><td><i>nicht angezeigt</i></td>
modules/imap/accounts.php 183)           <td><input type="password" id="password" name="password" value="" /></td>
bernd Entities repariert

bernd authored 16 years ago

modules/imap/accounts.php 184)           <td><input type="button" onclick="document.getElementById(\'password\').value = \'\'" value="Zeile zurücksetzen" /></td></tr>
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 185)   <tr><td>Konto aktiv:</td>
bernd Entities repariert

bernd authored 16 years ago

modules/imap/accounts.php 186)     <td>&#160;</td>
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 187)     <td><input type="checkbox" id="enabled" name="enabled" value="true"'.$enabled.' /></td>
bernd Entities repariert

bernd authored 16 years ago

modules/imap/accounts.php 188)     <td>&#160;</td></tr>
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 189)   </table>
bernd Entities repariert

bernd authored 16 years ago

modules/imap/accounts.php 190)   <p><input type="submit" value="Änderungen speichern" /><br />
modules/imap/accounts.php 191)   Hinweis: Das Passwort wird nur geändert, wenn Sie auf dieser Seite eines eingeben. Geben Sie keines an, wird das bisherige beibehalten!</p>
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

modules/imap/accounts.php 192)   ';
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/email/imap.php    193)     output(html_form('email_imap_edit', 'imap', 'action=save&id='.$_GET['edit'], $form));
modules/email/imap.php    194) } else {
modules/email/imap.php    195)     title("IMAP-Accounts");
modules/email/imap.php    196)     if (user_has_only_vmail_domains()) {
modules/email/imap.php    197)         output('<div class="error"><strong>Achtung:</strong> Alle Ihre Domains sind auf Webinterface-Verwaltung konfiguriert. Sie können dennoch manuelle IMAP-Konten für Ihre speziellen Konfigurationen anlegen, in der Regel sollten Sie aber hier keine IMAP-Acccounts anlegen. Dies kann zu Fehlfunktionen führen.</div>');
modules/email/imap.php    198)     }
modules/email/imap.php    199)     addnew("imap", "Neuen Account anlegen", "action=create");
modules/email/imap.php    200)     output('<p>Folgende POP3/IMAP-Konten sind eingerichtet:</p>
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 201) <table style="margin-bottom: 1em;">
bernd Entities repariert

bernd authored 16 years ago

modules/imap/accounts.php 202) <tr><th>Kontoname:</th><th>Mailbox-Pfad:</th><th>aktiv</th><th>&#160;</th></tr>
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 203) ');
modules/imap/accounts.php 204) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/email/imap.php    205)     foreach (mailaccounts($user['uid']) as $account) {
modules/email/imap.php    206)         $mailbox = $account['mailbox'];
modules/email/imap.php    207)         if (empty($mailbox)) {
modules/email/imap.php    208)             $mailbox = '<i>nicht festgelegt</i>';
modules/email/imap.php    209)         }
modules/email/imap.php    210)         output('<tr>
bernd eliminate .php extensions f...

bernd authored 15 years ago

modules/email/imap.php    211)             <td>'.internal_link('imap', $account['account'], 'edit='.$account['id']).'</td>
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 212)             <td>'.$mailbox.'</td>
modules/imap/accounts.php 213)             <td><b>'.($account['enabled'] ? 'Ja' : 'Nein').'</b></td>
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

modules/email/imap.php    214)             <td>'.internal_link("imap", icon_delete("»{$account['account']}« löschen"), "action=delete&account=".$account['id']).'</td></tr>');
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/email/imap.php    215)     }
modules/email/imap.php    216)     output('</table>');
modules/email/imap.php    217)     if (imap_on_vmail_domain()) {
modules/email/imap.php    218)         output('<div class="error"><strong>Achtung:</strong> Es scheint als hätten Sie einen (manuellen) IMAP-Account mittels einer Domain angelegt, die für Webinterface-Verwaltung konfiguriert ist. Sollten Sie nicht genau wissen was Sie tun, ist das vermutlich falsch und wird zu Fehlfunktionen führen.</div>');
modules/email/imap.php    219)     }
modules/email/imap.php    220)     addnew("imap", "Neuen Account anlegen", "action=create");
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 221)