28667e96bdcc072a7485ff50021f54f555c59ea3
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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 2 years ago

modules/email/imap.php      5) Written 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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 2 years ago

modules/email/imap.php      9) This code is published under a 0BSD license.
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

modules/email/imap.php     10) 
modules/email/imap.php     11) 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     12) */
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php  13) 
modules/imap/accounts.php  14) require_once('session/start.php');
modules/imap/accounts.php  15) 
bernd Domain-Klasse benutzen

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 15 years ago

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

bernd authored 17 years ago

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

bernd authored 15 years ago

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

bernd authored 17 years ago

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

bernd authored 14 years ago

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

bernd authored 17 years ago

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

Hanno authored 6 years ago

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

Hanno Böck authored 3 years ago

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

Hanno authored 6 years ago

modules/email/imap.php     38)         if ($_POST['password'] != '') {
modules/email/imap.php     39)             $acc['password'] = $_POST['password'];
modules/email/imap.php     40)         }
modules/email/imap.php     41)         $error = check_valid($acc);
modules/email/imap.php     42)         if ($error != "") {
modules/email/imap.php     43)             input_error($error);
modules/email/imap.php     44)             $title = "E-Mail-Accounts";
modules/email/imap.php     45)             output("");
modules/email/imap.php     46)         } else {
modules/email/imap.php     47)             change_mailaccount($_GET['id'], $acc);
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 1 year ago

modules/email/imap.php     48)             if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/imap.php     49)                 header('Location: imap');
modules/email/imap.php     50)             }
modules/email/imap.php     51)             die();
modules/email/imap.php     52)         }
modules/email/imap.php     53)     } elseif (isset($_POST['create'])) {
modules/email/imap.php     54)         check_form_token('email_imap_create');
modules/email/imap.php     55)         $account = $_POST['user'].'@'.$_POST['domain'];
modules/email/imap.php     56)         if (isset($_POST['enabled']) && $_POST['enabled'] == 'true') {
modules/email/imap.php     57)             $enabled = 'Y';
modules/email/imap.php     58)         } else {
modules/email/imap.php     59)             $enabled = 'N';
modules/email/imap.php     60)         }
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

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

Hanno authored 6 years ago

modules/email/imap.php     62)         if ($_POST['password'] != '') {
modules/email/imap.php     63)             $acc['password'] = $_POST['password'];
modules/email/imap.php     64)         }
modules/email/imap.php     65)         $error = check_valid($acc);
modules/email/imap.php     66)         if ($error != "") {
modules/email/imap.php     67)             system_failure($error);
modules/email/imap.php     68)         } else {
modules/email/imap.php     69)             create_mailaccount($acc);
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 1 year ago

modules/email/imap.php     70)             if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/imap.php     71)                 header('Location: imap');
modules/email/imap.php     72)             }
modules/email/imap.php     73)             die();
modules/email/imap.php     74)         }
bernd webinterface => /webinterface

bernd authored 17 years ago

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

Hanno authored 6 years ago

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

bernd authored 17 years ago

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

Hanno authored 6 years ago

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

bernd authored 17 years ago

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

Hanno authored 6 years ago

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

Hanno authored 5 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 15 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

Hanno authored 6 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

Bernd Wurst authored 5 years ago

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

bernd authored 17 years ago

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

Bernd Wurst authored 5 years ago

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

bernd authored 17 years ago

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

Hanno authored 6 years ago

modules/email/imap.php    134)     } elseif ($sure === true) {
modules/email/imap.php    135)         delete_mailaccount($_GET['account']);
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 1 year ago

modules/email/imap.php    136)         if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/imap.php    137)             header('Location: imap');
modules/email/imap.php    138)         }
modules/email/imap.php    139)         die();
modules/email/imap.php    140)     } elseif ($sure === false) {
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 1 year ago

modules/email/imap.php    141)         if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/imap.php    142)             header("Location: imap");
modules/email/imap.php    143)         }
modules/email/imap.php    144)         die();
modules/email/imap.php    145)     }
modules/email/imap.php    146) } elseif (isset($_GET['edit'])) {
modules/email/imap.php    147)     title("IMAP-Account bearbeiten");
modules/email/imap.php    148)     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 149) ');
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

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

Hanno Böck authored 3 years ago

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

Hanno authored 6 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php 156)   <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 157)   <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 158)           <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 15 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

Hanno authored 6 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php 186)   <p><input type="submit" value="Änderungen speichern" /><br />
modules/imap/accounts.php 187)   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 17 years ago

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

Hanno authored 6 years ago

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

Hanno authored 5 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php 198) <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 199) ');
modules/imap/accounts.php 200) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 15 years ago

modules/email/imap.php    210)             <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 6 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php 217)