c208bd906b3991555db11b9229846c4601ca408c
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) 
modules/email/imap.php      5) Written 2008-2012 by schokokeks.org Hosting, namely
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) 
modules/email/imap.php     11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
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) 
modules/imap/accounts.php  32) if (isset($_GET['action']) && $_GET['action'] == 'save')
modules/imap/accounts.php  33) {
modules/imap/accounts.php  34)   if (isset($_GET['id']))
modules/imap/accounts.php  35)   {
bernd Alles in das email-modul ve...

bernd authored 16 years ago

modules/email/imap.php     36)     check_form_token('email_imap_edit');
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php  37)     $account = $_POST['user'].'@'.$_POST['domain'];
modules/imap/accounts.php  38)     if (isset($_POST['enabled']) && $_POST['enabled'] == 'true')
modules/imap/accounts.php  39)       $enabled = 'Y';
modules/imap/accounts.php  40)     else
modules/imap/accounts.php  41)       $enabled = 'N';
modules/imap/accounts.php  42)     $acc = array('id' => $_GET['id'], 'account' => $account, 'mailbox' => $_POST['mailbox'], 'enabled' => $enabled);
modules/imap/accounts.php  43)     if ($_POST['password'] != '')
modules/imap/accounts.php  44)       $acc['password'] = $_POST['password'];
modules/imap/accounts.php  45)     $error = check_valid($acc);
modules/imap/accounts.php  46)     if ($error != "")
modules/imap/accounts.php  47)     {
modules/imap/accounts.php  48)       input_error($error);
modules/imap/accounts.php  49)       $title = "E-Mail-Accounts";
modules/imap/accounts.php  50)       output("");
modules/imap/accounts.php  51)     }
modules/imap/accounts.php  52)     else
modules/imap/accounts.php  53)     {
modules/imap/accounts.php  54)       change_mailaccount($_GET['id'], $acc);
modules/imap/accounts.php  55)       if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

modules/email/imap.php     56)         header('Location: imap');
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php  57)       die();
modules/imap/accounts.php  58)     }
modules/imap/accounts.php  59)   }
modules/imap/accounts.php  60)   elseif (isset($_POST['create']))
modules/imap/accounts.php  61)   {
bernd Alles in das email-modul ve...

bernd authored 16 years ago

modules/email/imap.php     62)     check_form_token('email_imap_create');
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php  63)     $account = $_POST['user'].'@'.$_POST['domain'];
modules/imap/accounts.php  64)     if (isset($_POST['enabled']) && $_POST['enabled'] == 'true')
modules/imap/accounts.php  65)       $enabled = 'Y';
modules/imap/accounts.php  66)     else
modules/imap/accounts.php  67)       $enabled = 'N';
modules/imap/accounts.php  68)     $acc = array('account' => $account, 'mailbox' => $_POST['mailbox'], 'enabled' => $enabled);
modules/imap/accounts.php  69)     if ($_POST['password'] != '')
modules/imap/accounts.php  70)       $acc['password'] = $_POST['password'];
modules/imap/accounts.php  71)     $error = check_valid($acc);
modules/imap/accounts.php  72)     if ($error != "")
modules/imap/accounts.php  73)     {
modules/imap/accounts.php  74)       input_error($error);
modules/imap/accounts.php  75)       output("");
modules/imap/accounts.php  76)     }
modules/imap/accounts.php  77)     else
modules/imap/accounts.php  78)     {
modules/imap/accounts.php  79)       create_mailaccount($acc);
modules/imap/accounts.php  80)       if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

modules/email/imap.php     81)         header('Location: imap');
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php  82)       die(); 
modules/imap/accounts.php  83)     }
modules/imap/accounts.php  84)   }
modules/imap/accounts.php  85) }
modules/imap/accounts.php  86) elseif (isset($_GET['action']) && $_GET['action'] == 'create')
modules/imap/accounts.php  87) {
bernd XSS/CSRF-Bugs behoben

bernd authored 16 years ago

modules/imap/accounts.php  88)   $options = '';
modules/imap/accounts.php  89)   $domains = get_domain_list($user['customerno'], $user['uid']);
modules/imap/accounts.php  90)   if (count($domains) > 0)
modules/imap/accounts.php  91)     $options .= '<option>----------------------------</option>';
modules/imap/accounts.php  92)   foreach ($domains as $dom)
modules/imap/accounts.php  93)     $options .= '<option value="'.$dom->fqdn.'">'.$dom->fqdn.'</option>';
modules/imap/accounts.php  94) 
bernd Benutze überall title() sta...

bernd authored 13 years ago

modules/email/imap.php     95)   title("IMAP-Account anlegen");
modules/email/imap.php     96)   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     97) <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     98)   '.html_form('email_imap_create', 'imap', 'action=save', '
bernd webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

modules/imap/accounts.php 122)   '));
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 123) }
modules/imap/accounts.php 124) elseif (isset($_GET['action']) && $_GET['action'] == 'delete' && $_GET['account'] != '')
modules/imap/accounts.php 125) {
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

modules/imap/accounts.php 126)   $sure = user_is_sure();
modules/imap/accounts.php 127)   if ($sure === NULL)
modules/imap/accounts.php 128)   {
modules/imap/accounts.php 129)     $_GET['account'] = (int) $_GET['account'];
modules/imap/accounts.php 130)     $account = get_mailaccount($_GET['account']);
modules/imap/accounts.php 131)     $enabled = ($account['enabled'] ? 'Ja' : 'Nein');
bernd * alle internen Links sinnv...

bernd authored 15 years ago

modules/email/imap.php    132)     are_you_sure("action=delete&account={$_GET['account']}", '
bernd Entities repariert

bernd authored 16 years ago

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

bernd authored 16 years ago

modules/imap/accounts.php 134)     <table style="margin-bottom: 1em;">
modules/imap/accounts.php 135)       <tr><td>Benutzername:</td>
modules/imap/accounts.php 136)         <td>'.filter_input_general($account['account']).'</td>
modules/imap/accounts.php 137)       </tr>
modules/imap/accounts.php 138)       <tr><td>Mailbox:</td>
modules/imap/accounts.php 139)         <td>'.filter_input_general($account['mailbox']).'</td>
modules/imap/accounts.php 140)       </tr>
modules/imap/accounts.php 141)       <tr><td>Konto aktiv:</td>
modules/imap/accounts.php 142)         <td>'.$enabled.'</td>
modules/imap/accounts.php 143)       </tr>
modules/imap/accounts.php 144)     </table>
modules/imap/accounts.php 145) ');
modules/imap/accounts.php 146)   }
modules/imap/accounts.php 147)   elseif ($sure === true)
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 148)   {
modules/imap/accounts.php 149)     delete_mailaccount($_GET['account']);
modules/imap/accounts.php 150)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

modules/email/imap.php    151)       header('Location: imap');
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 152)     die();
modules/imap/accounts.php 153)   }
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

modules/imap/accounts.php 154)   elseif ($sure === false)
bernd webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 16 years ago

modules/imap/accounts.php 156)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

modules/email/imap.php    157)       header("Location: imap");
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

modules/imap/accounts.php 158)     die();
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 159)   }
modules/imap/accounts.php 160) }
modules/imap/accounts.php 161) elseif (isset($_GET['edit']))
modules/imap/accounts.php 162) {
bernd Benutze überall title() sta...

bernd authored 13 years ago

modules/email/imap.php    163)   title("IMAP-Account bearbeiten");
modules/email/imap.php    164)   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 165) ');
modules/imap/accounts.php 166)   $_GET['edit'] = (int) $_GET['edit'];
modules/imap/accounts.php 167)   $account = get_mailaccount($_GET['edit']);
modules/imap/accounts.php 168)   list($username, $domain) = explode('@', $account['account'], 2);
modules/imap/accounts.php 169)   $enabled = ($account['enabled'] ? ' checked="checked"' : '');
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

modules/imap/accounts.php 170)   $form = '
bernd webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 16 years ago

modules/imap/accounts.php 172)   <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 173)   <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 174)           <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    175)     <option value="'.config('masterdomain').'">'.config('masterdomain').'</option>
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

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

bernd authored 16 years ago

modules/imap/accounts.php 177)     $domains = get_domain_list($user['customerno'], $user['uid']);
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 178)     if (count($domains) > 0)
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

modules/imap/accounts.php 179)       $form .= '<option>----------------------------</option>';
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 180)     foreach ($domains as $dom)
bernd Domain-Klasse benutzen

bernd authored 16 years ago

modules/imap/accounts.php 181)       if ($domain == $dom->fqdn)
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

modules/imap/accounts.php 182)         $form .= '<option value="'.$dom->fqdn.'" selected="selected">'.$dom->fqdn.'</option>';
bernd webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 16 years ago

modules/imap/accounts.php 184)         $form .= '<option value="'.$dom->fqdn.'">'.$dom->fqdn.'</option>';
bernd webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

modules/imap/accounts.php 199)   <p><input type="submit" value="Änderungen speichern" /><br />
modules/imap/accounts.php 200)   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 201)   ';
bernd eliminate .php extensions f...

bernd authored 15 years ago

modules/email/imap.php    202)   output(html_form('email_imap_edit', 'imap', 'action=save&id='.$_GET['edit'], $form));
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 203) }
modules/imap/accounts.php 204) else
modules/imap/accounts.php 205) {
bernd Benutze überall title() sta...

bernd authored 13 years ago

modules/email/imap.php    206)   title("IMAP-Accounts");
bernd IMAP-Accounts deutlicher de...

bernd authored 14 years ago

modules/email/imap.php    207)   if (user_has_only_vmail_domains())
modules/email/imap.php    208)   {
modules/email/imap.php    209)     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    210)   }
modules/email/imap.php    211)   output('<p>Folgende POP3/IMAP-Konten sind eingerichtet:</p>
bernd webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 16 years ago

modules/imap/accounts.php 213) <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 214) ');
modules/imap/accounts.php 215) 
modules/imap/accounts.php 216)         foreach (mailaccounts($user['uid']) as $account)
modules/imap/accounts.php 217)         {
modules/imap/accounts.php 218)                 $mailbox = $account['mailbox'];
modules/imap/accounts.php 219)                 if (empty($mailbox))
modules/imap/accounts.php 220)                         $mailbox = '<i>nicht festgelegt</i>';
modules/imap/accounts.php 221)                 output('<tr>
bernd eliminate .php extensions f...

bernd authored 15 years ago

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

bernd authored 17 years ago

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

bernd authored 14 years ago

modules/email/imap.php    225)             <td>'.internal_link("imap", icon_delete("»{$account['account']}« löschen"), "action=delete&account=".$account['id']).'</td></tr>');
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 226)         }
bernd IMAP-Accounts deutlicher de...

bernd authored 14 years ago

modules/email/imap.php    227)   output('</table>');
modules/email/imap.php    228)   if (imap_on_vmail_domain())
modules/email/imap.php    229)   {
bernd typo

bernd authored 14 years ago

modules/email/imap.php    230)     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>');
bernd IMAP-Accounts deutlicher de...

bernd authored 14 years ago

modules/email/imap.php    231)   }
bernd addnew() eingeführt

bernd authored 14 years ago

modules/email/imap.php    232)   addnew("imap", "Neuen Account anlegen", "action=create");
bernd Info-Seite über Mail-Login-...

bernd authored 13 years ago

modules/email/imap.php    233) 
modules/email/imap.php    234)   output('<p>'.other_icon('information.png', 'Zugangsdaten anzeigen').' <strong>'.internal_link('logindata', 'Zugangsdaten für E-Mail-Abruf anzeigen', 'server='.get_server_by_id($_SESSION['userinfo']['server']).'&type=manual').'</strong></p>');