96649f21ba18d07757afa9d98998f7a22c0d86a3
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) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/email/imap.php     31) if (isset($_GET['action']) && $_GET['action'] == 'save') {
modules/email/imap.php     32)     if (isset($_GET['id'])) {
modules/email/imap.php     33)         check_form_token('email_imap_edit');
modules/email/imap.php     34)         $account = $_POST['user'].'@'.$_POST['domain'];
modules/email/imap.php     35)         if (isset($_POST['enabled']) && $_POST['enabled'] == 'true') {
modules/email/imap.php     36)             $enabled = 'Y';
modules/email/imap.php     37)         } else {
modules/email/imap.php     38)             $enabled = 'N';
modules/email/imap.php     39)         }
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 2 years ago

modules/email/imap.php     40)         $acc = ['id' => $_GET['id'], 'account' => $account, 'mailbox' => $_POST['mailbox'], 'enabled' => $enabled];
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/email/imap.php     41)         if ($_POST['password'] != '') {
modules/email/imap.php     42)             $acc['password'] = $_POST['password'];
modules/email/imap.php     43)         }
modules/email/imap.php     44)         $error = check_valid($acc);
modules/email/imap.php     45)         if ($error != "") {
modules/email/imap.php     46)             input_error($error);
modules/email/imap.php     47)             $title = "E-Mail-Accounts";
modules/email/imap.php     48)             output("");
modules/email/imap.php     49)         } else {
modules/email/imap.php     50)             change_mailaccount($_GET['id'], $acc);
modules/email/imap.php     51)             if (! $debugmode) {
modules/email/imap.php     52)                 header('Location: imap');
modules/email/imap.php     53)             }
modules/email/imap.php     54)             die();
modules/email/imap.php     55)         }
modules/email/imap.php     56)     } elseif (isset($_POST['create'])) {
modules/email/imap.php     57)         check_form_token('email_imap_create');
modules/email/imap.php     58)         $account = $_POST['user'].'@'.$_POST['domain'];
modules/email/imap.php     59)         if (isset($_POST['enabled']) && $_POST['enabled'] == 'true') {
modules/email/imap.php     60)             $enabled = 'Y';
modules/email/imap.php     61)         } else {
modules/email/imap.php     62)             $enabled = 'N';
modules/email/imap.php     63)         }
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 2 years ago

modules/email/imap.php     64)         $acc = ['account' => $account, 'mailbox' => $_POST['mailbox'], 'enabled' => $enabled];
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/email/imap.php     65)         if ($_POST['password'] != '') {
modules/email/imap.php     66)             $acc['password'] = $_POST['password'];
modules/email/imap.php     67)         }
modules/email/imap.php     68)         $error = check_valid($acc);
modules/email/imap.php     69)         if ($error != "") {
modules/email/imap.php     70)             system_failure($error);
modules/email/imap.php     71)         } else {
modules/email/imap.php     72)             create_mailaccount($acc);
modules/email/imap.php     73)             if (! $debugmode) {
modules/email/imap.php     74)                 header('Location: imap');
modules/email/imap.php     75)             }
modules/email/imap.php     76)             die();
modules/email/imap.php     77)         }
bernd webinterface => /webinterface

bernd authored 17 years ago

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

Hanno authored 5 years ago

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

bernd authored 17 years ago

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

Hanno authored 5 years ago

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

bernd authored 17 years ago

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

Hanno authored 5 years ago

modules/email/imap.php     88) 
modules/email/imap.php     89)     title("IMAP-Account anlegen");
Hanno Klarstellen dass Konten auc...

Hanno authored 5 years ago

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

bernd authored 15 years ago

modules/email/imap.php     91) <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     92)   '.html_form('email_imap_create', 'imap', 'action=save', '
bernd webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php  95)   <tr>
modules/imap/accounts.php  96)     <td>Benutzername:</td>
modules/imap/accounts.php  97)     <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     98)     <option value="'.config('masterdomain').'">'.config('masterdomain').'</option>
bernd XSS/CSRF-Bugs behoben

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

Hanno authored 5 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

modules/imap/accounts.php 125)     <table style="margin-bottom: 1em;">
modules/imap/accounts.php 126)       <tr><td>Benutzername:</td>
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 4 years ago

modules/email/imap.php    127)         <td>'.filter_output_html($account['account']).'</td>
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

modules/imap/accounts.php 128)       </tr>
modules/imap/accounts.php 129)       <tr><td>Mailbox:</td>
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 4 years ago

modules/email/imap.php    130)         <td>'.filter_output_html($account['mailbox']).'</td>
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

modules/imap/accounts.php 131)       </tr>
modules/imap/accounts.php 132)       <tr><td>Konto aktiv:</td>
modules/imap/accounts.php 133)         <td>'.$enabled.'</td>
modules/imap/accounts.php 134)       </tr>
modules/imap/accounts.php 135)     </table>
modules/imap/accounts.php 136) ');
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/email/imap.php    137)     } elseif ($sure === true) {
modules/email/imap.php    138)         delete_mailaccount($_GET['account']);
modules/email/imap.php    139)         if (! $debugmode) {
modules/email/imap.php    140)             header('Location: imap');
modules/email/imap.php    141)         }
modules/email/imap.php    142)         die();
modules/email/imap.php    143)     } elseif ($sure === false) {
modules/email/imap.php    144)         if (! $debugmode) {
modules/email/imap.php    145)             header("Location: imap");
modules/email/imap.php    146)         }
modules/email/imap.php    147)         die();
modules/email/imap.php    148)     }
modules/email/imap.php    149) } elseif (isset($_GET['edit'])) {
modules/email/imap.php    150)     title("IMAP-Account bearbeiten");
modules/email/imap.php    151)     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 152) ');
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/email/imap.php    153)     $_GET['edit'] = (int) $_GET['edit'];
modules/email/imap.php    154)     $account = get_mailaccount($_GET['edit']);
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 2 years ago

modules/email/imap.php    155)     [$username, $domain] = explode('@', $account['account'], 2);
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/email/imap.php    156)     $enabled = ($account['enabled'] ? ' checked="checked"' : '');
modules/email/imap.php    157)     $form = '
bernd webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 16 years ago

modules/imap/accounts.php 159)   <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 160)   <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 161)           <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    162)     <option value="'.config('masterdomain').'">'.config('masterdomain').'</option>
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

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

bernd authored 16 years ago

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

Hanno authored 5 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

modules/imap/accounts.php 177)           <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 178)   <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 179)           <td><input type="text" id="mailbox" name="mailbox" value="'.$account['mailbox'].'" /></td>
bernd Entities repariert

bernd authored 16 years ago

modules/imap/accounts.php 180)           <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 181)   <tr><td>Passwort:</td><td><i>nicht angezeigt</i></td>
modules/imap/accounts.php 182)           <td><input type="password" id="password" name="password" value="" /></td>
bernd Entities repariert

bernd authored 16 years ago

modules/imap/accounts.php 183)           <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 184)   <tr><td>Konto aktiv:</td>
bernd Entities repariert

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

modules/imap/accounts.php 189)   <p><input type="submit" value="Änderungen speichern" /><br />
modules/imap/accounts.php 190)   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 191)   ';
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/email/imap.php    192)     output(html_form('email_imap_edit', 'imap', 'action=save&id='.$_GET['edit'], $form));
modules/email/imap.php    193) } else {
modules/email/imap.php    194)     title("IMAP-Accounts");
modules/email/imap.php    195)     if (user_has_only_vmail_domains()) {
modules/email/imap.php    196)         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    197)     }
modules/email/imap.php    198)     addnew("imap", "Neuen Account anlegen", "action=create");
Hanno Klarstellen dass Konten auc...

Hanno authored 5 years ago

modules/email/imap.php    199)     output('<p>Folgende IMAP/POP3/SMTP-Konten sind eingerichtet:</p>
bernd webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 16 years ago

modules/imap/accounts.php 201) <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 202) ');
modules/imap/accounts.php 203) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

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

bernd authored 15 years ago

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

bernd authored 17 years ago

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

bernd authored 14 years ago

modules/email/imap.php    213)             <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    214)     }
modules/email/imap.php    215)     output('</table>');
modules/email/imap.php    216)     if (imap_on_vmail_domain()) {
modules/email/imap.php    217)         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    218)     }
modules/email/imap.php    219)     addnew("imap", "Neuen Account anlegen", "action=create");
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 220)