738d6edbc60486cb8f5190c21657b3dc1e0b602a
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php   1) <?php
modules/imap/accounts.php   2) 
modules/imap/accounts.php   3) require_once('session/start.php');
modules/imap/accounts.php   4) 
bernd Domain-Klasse benutzen

bernd authored 16 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php   6) require_once('mailaccounts.php');
modules/imap/accounts.php   7) 
modules/imap/accounts.php   8) require_role(ROLE_SYSTEMUSER);
modules/imap/accounts.php   9) 
bernd Benutzer config-Variablen f...

bernd authored 15 years ago

modules/email/imap.php     10) global $config;
modules/email/imap.php     11) 
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php  12) $user = $_SESSION['userinfo'];
modules/imap/accounts.php  13) 
modules/imap/accounts.php  14) $title = "E-Mail-Accounts";
modules/imap/accounts.php  15) 
modules/imap/accounts.php  16) 
modules/imap/accounts.php  17) if (isset($_GET['action']) && $_GET['action'] == 'save')
modules/imap/accounts.php  18) {
modules/imap/accounts.php  19)   if (isset($_GET['id']))
modules/imap/accounts.php  20)   {
bernd Alles in das email-modul ve...

bernd authored 16 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php  22)     $account = $_POST['user'].'@'.$_POST['domain'];
modules/imap/accounts.php  23)     if (isset($_POST['enabled']) && $_POST['enabled'] == 'true')
modules/imap/accounts.php  24)       $enabled = 'Y';
modules/imap/accounts.php  25)     else
modules/imap/accounts.php  26)       $enabled = 'N';
modules/imap/accounts.php  27)     $acc = array('id' => $_GET['id'], 'account' => $account, 'mailbox' => $_POST['mailbox'], 'enabled' => $enabled);
modules/imap/accounts.php  28)     if ($_POST['password'] != '')
modules/imap/accounts.php  29)       $acc['password'] = $_POST['password'];
modules/imap/accounts.php  30)     $error = check_valid($acc);
modules/imap/accounts.php  31)     if ($error != "")
modules/imap/accounts.php  32)     {
modules/imap/accounts.php  33)       input_error($error);
modules/imap/accounts.php  34)       $title = "E-Mail-Accounts";
modules/imap/accounts.php  35)       output("");
modules/imap/accounts.php  36)     }
modules/imap/accounts.php  37)     else
modules/imap/accounts.php  38)     {
modules/imap/accounts.php  39)       change_mailaccount($_GET['id'], $acc);
modules/imap/accounts.php  40)       if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php  42)       die();
modules/imap/accounts.php  43)     }
modules/imap/accounts.php  44)   }
modules/imap/accounts.php  45)   elseif (isset($_POST['create']))
modules/imap/accounts.php  46)   {
bernd Alles in das email-modul ve...

bernd authored 16 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php  48)     $account = $_POST['user'].'@'.$_POST['domain'];
modules/imap/accounts.php  49)     if (isset($_POST['enabled']) && $_POST['enabled'] == 'true')
modules/imap/accounts.php  50)       $enabled = 'Y';
modules/imap/accounts.php  51)     else
modules/imap/accounts.php  52)       $enabled = 'N';
modules/imap/accounts.php  53)     $acc = array('account' => $account, 'mailbox' => $_POST['mailbox'], 'enabled' => $enabled);
modules/imap/accounts.php  54)     if ($_POST['password'] != '')
modules/imap/accounts.php  55)       $acc['password'] = $_POST['password'];
modules/imap/accounts.php  56)     $error = check_valid($acc);
modules/imap/accounts.php  57)     if ($error != "")
modules/imap/accounts.php  58)     {
modules/imap/accounts.php  59)       input_error($error);
modules/imap/accounts.php  60)       output("");
modules/imap/accounts.php  61)     }
modules/imap/accounts.php  62)     else
modules/imap/accounts.php  63)     {
modules/imap/accounts.php  64)       create_mailaccount($acc);
modules/imap/accounts.php  65)       if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php  67)       die(); 
modules/imap/accounts.php  68)     }
modules/imap/accounts.php  69)   }
modules/imap/accounts.php  70) }
modules/imap/accounts.php  71) elseif (isset($_GET['action']) && $_GET['action'] == 'create')
modules/imap/accounts.php  72) {
bernd XSS/CSRF-Bugs behoben

bernd authored 16 years ago

modules/imap/accounts.php  73)   $options = '';
modules/imap/accounts.php  74)   $domains = get_domain_list($user['customerno'], $user['uid']);
modules/imap/accounts.php  75)   if (count($domains) > 0)
modules/imap/accounts.php  76)     $options .= '<option>----------------------------</option>';
modules/imap/accounts.php  77)   foreach ($domains as $dom)
modules/imap/accounts.php  78)     $options .= '<option value="'.$dom->fqdn.'">'.$dom->fqdn.'</option>';
modules/imap/accounts.php  79) 
bernd eliminate .php extensions f...

bernd authored 15 years ago

modules/email/imap.php     80)   output('<h3>IMAP-Account anlegen</h3>
bernd Entities repariert

bernd authored 16 years ago

modules/imap/accounts.php  81) <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     82) <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     83)   '.html_form('email_imap_create', 'imap', 'action=save', '
bernd webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php  86)   <tr>
modules/imap/accounts.php  87)     <td>Benutzername:</td>
modules/imap/accounts.php  88)     <td><input type="text" id="user" name="user" />@<select name="domain" size="1">
bernd Benutzer config-Variablen f...

bernd authored 15 years ago

modules/email/imap.php     89)     <option value="'.$config['masterdomain'].'">'.$config['masterdomain'].'</option>
bernd XSS/CSRF-Bugs behoben

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

modules/imap/accounts.php 111)   $sure = user_is_sure();
modules/imap/accounts.php 112)   if ($sure === NULL)
modules/imap/accounts.php 113)   {
modules/imap/accounts.php 114)     $_GET['account'] = (int) $_GET['account'];
modules/imap/accounts.php 115)     $account = get_mailaccount($_GET['account']);
modules/imap/accounts.php 116)     $enabled = ($account['enabled'] ? 'Ja' : 'Nein');
modules/imap/accounts.php 117)     are_you_sure("action=delete&amp;account={$_GET['account']}", '
bernd Entities repariert

bernd authored 16 years ago

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

bernd authored 16 years ago

modules/imap/accounts.php 119)     <table style="margin-bottom: 1em;">
modules/imap/accounts.php 120)       <tr><td>Benutzername:</td>
modules/imap/accounts.php 121)         <td>'.filter_input_general($account['account']).'</td>
modules/imap/accounts.php 122)       </tr>
modules/imap/accounts.php 123)       <tr><td>Mailbox:</td>
modules/imap/accounts.php 124)         <td>'.filter_input_general($account['mailbox']).'</td>
modules/imap/accounts.php 125)       </tr>
modules/imap/accounts.php 126)       <tr><td>Konto aktiv:</td>
modules/imap/accounts.php 127)         <td>'.$enabled.'</td>
modules/imap/accounts.php 128)       </tr>
modules/imap/accounts.php 129)     </table>
modules/imap/accounts.php 130) ');
modules/imap/accounts.php 131)   }
modules/imap/accounts.php 132)   elseif ($sure === true)
bernd webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 15 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php 144)   }
modules/imap/accounts.php 145) }
modules/imap/accounts.php 146) elseif (isset($_GET['edit']))
modules/imap/accounts.php 147) {
bernd eliminate .php extensions f...

bernd authored 15 years ago

modules/email/imap.php    148)   output('<h3>IMAP-Account bearbeiten</h3>
bernd Entities repariert

bernd authored 16 years ago

modules/imap/accounts.php 149) <p>Hier können Sie die Einstellungen des IMAP-Kontos bearbeiten.</p>
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 150) ');
modules/imap/accounts.php 151)   $_GET['edit'] = (int) $_GET['edit'];
modules/imap/accounts.php 152)   $account = get_mailaccount($_GET['edit']);
modules/imap/accounts.php 153)   list($username, $domain) = explode('@', $account['account'], 2);
modules/imap/accounts.php 154)   $enabled = ($account['enabled'] ? ' checked="checked"' : '');
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

modules/imap/accounts.php 157)   <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 158)   <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 159)           <td><input type="text" id="user" name="user" value="'.$username.'" />@<select name="domain" id="domain" size="1">
bernd Benutzer config-Variablen f...

bernd authored 15 years ago

modules/email/imap.php    160)     <option value="'.$config['masterdomain'].'">'.$config['masterdomain'].'</option>
bernd Umfangreiche Code-Aufräumar...

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

modules/email/imap.php    187)   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 188) }
modules/imap/accounts.php 189) else
modules/imap/accounts.php 190) {
bernd eliminate .php extensions f...

bernd authored 15 years ago

modules/email/imap.php    191)   output('<h3>IMAP-Accounts</h3>
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 192) <p>Folgende POP3/IMAP-Konten sind eingerichtet:</p>
modules/imap/accounts.php 193) <table style="margin-bottom: 1em;">
bernd Entities repariert

bernd authored 16 years ago

modules/imap/accounts.php 194) <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 195) ');
modules/imap/accounts.php 196) 
modules/imap/accounts.php 197)         foreach (mailaccounts($user['uid']) as $account)
modules/imap/accounts.php 198)         {
modules/imap/accounts.php 199)                 $mailbox = $account['mailbox'];
modules/imap/accounts.php 200)                 if (empty($mailbox))
modules/imap/accounts.php 201)                         $mailbox = '<i>nicht festgelegt</i>';
modules/imap/accounts.php 202)                 output('<tr>
bernd eliminate .php extensions f...

bernd authored 15 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php 204)             <td>'.$mailbox.'</td>
modules/imap/accounts.php 205)             <td><b>'.($account['enabled'] ? 'Ja' : 'Nein').'</b></td>
bernd eliminate .php extensions f...

bernd authored 15 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php 207)         }
modules/imap/accounts.php 208)         output('</table>
bernd eliminate .php extensions f...

bernd authored 15 years ago

modules/email/imap.php    209) <p>'.internal_link("imap", "Neuen Account anlegen", "action=create").'</p>