8d3da69039fd501f0664b6cfcf9c4945c4ad8383
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 17 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) 
modules/imap/accounts.php  10) $user = $_SESSION['userinfo'];
modules/imap/accounts.php  11) 
modules/imap/accounts.php  12) $title = "E-Mail-Accounts";
modules/imap/accounts.php  13) 
modules/imap/accounts.php  14) 
modules/imap/accounts.php  15) if (isset($_GET['action']) && $_GET['action'] == 'save')
modules/imap/accounts.php  16) {
modules/imap/accounts.php  17)   if (isset($_GET['id']))
modules/imap/accounts.php  18)   {
bernd XSRF-kram fixed

bernd authored 17 years ago

modules/imap/accounts.php  19)     check_form_token('imap_accounts_edit');
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php  20)     $account = $_POST['user'].'@'.$_POST['domain'];
modules/imap/accounts.php  21)     if (isset($_POST['enabled']) && $_POST['enabled'] == 'true')
modules/imap/accounts.php  22)       $enabled = 'Y';
modules/imap/accounts.php  23)     else
modules/imap/accounts.php  24)       $enabled = 'N';
modules/imap/accounts.php  25)     $acc = array('id' => $_GET['id'], 'account' => $account, 'mailbox' => $_POST['mailbox'], 'enabled' => $enabled);
modules/imap/accounts.php  26)     if ($_POST['password'] != '')
modules/imap/accounts.php  27)       $acc['password'] = $_POST['password'];
modules/imap/accounts.php  28)     $error = check_valid($acc);
modules/imap/accounts.php  29)     if ($error != "")
modules/imap/accounts.php  30)     {
modules/imap/accounts.php  31)       input_error($error);
modules/imap/accounts.php  32)       $title = "E-Mail-Accounts";
modules/imap/accounts.php  33)       output("");
modules/imap/accounts.php  34)     }
modules/imap/accounts.php  35)     else
modules/imap/accounts.php  36)     {
modules/imap/accounts.php  37)       change_mailaccount($_GET['id'], $acc);
modules/imap/accounts.php  38)       if (! $debugmode)
modules/imap/accounts.php  39)         header('Location: accounts.php');
modules/imap/accounts.php  40)       die();
modules/imap/accounts.php  41)     }
modules/imap/accounts.php  42)   }
modules/imap/accounts.php  43)   elseif (isset($_POST['create']))
modules/imap/accounts.php  44)   {
bernd XSRF-kram fixed

bernd authored 17 years ago

modules/imap/accounts.php  45)     check_form_token('imap_accounts_create');
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php  46)     $account = $_POST['user'].'@'.$_POST['domain'];
modules/imap/accounts.php  47)     if (isset($_POST['enabled']) && $_POST['enabled'] == 'true')
modules/imap/accounts.php  48)       $enabled = 'Y';
modules/imap/accounts.php  49)     else
modules/imap/accounts.php  50)       $enabled = 'N';
modules/imap/accounts.php  51)     $acc = array('account' => $account, 'mailbox' => $_POST['mailbox'], 'enabled' => $enabled);
modules/imap/accounts.php  52)     if ($_POST['password'] != '')
modules/imap/accounts.php  53)       $acc['password'] = $_POST['password'];
modules/imap/accounts.php  54)     $error = check_valid($acc);
modules/imap/accounts.php  55)     if ($error != "")
modules/imap/accounts.php  56)     {
modules/imap/accounts.php  57)       input_error($error);
modules/imap/accounts.php  58)       output("");
modules/imap/accounts.php  59)     }
modules/imap/accounts.php  60)     else
modules/imap/accounts.php  61)     {
modules/imap/accounts.php  62)       create_mailaccount($acc);
modules/imap/accounts.php  63)       if (! $debugmode)
modules/imap/accounts.php  64)         header('Location: accounts.php');
modules/imap/accounts.php  65)       die(); 
modules/imap/accounts.php  66)     }
modules/imap/accounts.php  67)   }
modules/imap/accounts.php  68) }
modules/imap/accounts.php  69) elseif (isset($_GET['action']) && $_GET['action'] == 'create')
modules/imap/accounts.php  70) {
bernd XSS/CSRF-Bugs behoben

bernd authored 17 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php  78)   output('<h3>E-Mail-Account anlegen</h3>
bernd Entities repariert

bernd authored 17 years ago

modules/imap/accounts.php  79) <p>Hier können Sie ein neues POP3/IMAP-Konto anlegen.</p>
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/imap.php     80) <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 <a href="../vmail/domains.php">unter Domains</a>.</p>
bernd XSS/CSRF-Bugs behoben

bernd authored 17 years ago

modules/imap/accounts.php  81)   '.html_form('imap_accounts_create', 'accounts.php', 'action=save', '
bernd webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php  84)   <tr>
modules/imap/accounts.php  85)     <td>Benutzername:</td>
modules/imap/accounts.php  86)     <td><input type="text" id="user" name="user" />@<select name="domain" size="1">
modules/imap/accounts.php  87)     <option value="schokokeks.org">schokokeks.org</option>
bernd XSS/CSRF-Bugs behoben

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php 131)   {
modules/imap/accounts.php 132)     delete_mailaccount($_GET['account']);
modules/imap/accounts.php 133)     if (! $debugmode)
modules/imap/accounts.php 134)       header('Location: accounts.php');
modules/imap/accounts.php 135)     die();
modules/imap/accounts.php 136)   }
bernd Umfangreiche Code-Aufräumar...

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php 139)     if (! $debugmode)
modules/imap/accounts.php 140)       header("Location: accounts.php");
modules/imap/accounts.php 141)     die();
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 142)   }
modules/imap/accounts.php 143) }
modules/imap/accounts.php 144) elseif (isset($_GET['edit']))
modules/imap/accounts.php 145) {
modules/imap/accounts.php 146)   output('<h3>E-Mail-Account bearbeiten</h3>
bernd Entities repariert

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php 155)   <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 156)   <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 157)           <td><input type="text" id="user" name="user" value="'.$username.'" />@<select name="domain" id="domain" size="1">
modules/imap/accounts.php 158)     <option value="schokokeks.org">schokokeks.org</option>
bernd Umfangreiche Code-Aufräumar...

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php 182)   <p><input type="submit" value="Änderungen speichern" /><br />
modules/imap/accounts.php 183)   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 184)   ';
modules/imap/accounts.php 185)   output(html_form('imap_accounts_edit', 'accounts.php', 'action=save&id='.$_GET['edit'], $form));
bernd webinterface => /webinterface

bernd authored 17 years ago

modules/imap/accounts.php 186) }
modules/imap/accounts.php 187) else
modules/imap/accounts.php 188) {
modules/imap/accounts.php 189)   output('<h3>E-Mail-Accounts</h3>
modules/imap/accounts.php 190) <p>Folgende POP3/IMAP-Konten sind eingerichtet:</p>
modules/imap/accounts.php 191) <table style="margin-bottom: 1em;">
bernd Entities repariert

bernd authored 17 years ago

modules/imap/accounts.php 192) <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 193) ');
modules/imap/accounts.php 194) 
modules/imap/accounts.php 195)         foreach (mailaccounts($user['uid']) as $account)
modules/imap/accounts.php 196)         {
modules/imap/accounts.php 197)                 $mailbox = $account['mailbox'];
modules/imap/accounts.php 198)                 if (empty($mailbox))
modules/imap/accounts.php 199)                         $mailbox = '<i>nicht festgelegt</i>';
modules/imap/accounts.php 200)                 output('<tr>
bernd Auf die Account-Namen klick...

bernd authored 17 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php 202)             <td>'.$mailbox.'</td>
modules/imap/accounts.php 203)             <td><b>'.($account['enabled'] ? 'Ja' : 'Nein').'</b></td>
bernd Entities repariert

bernd authored 17 years ago

modules/imap/accounts.php 204)             <td><a href="accounts.php?action=delete&amp;account='.$account['id'].'">löschen</a></td></tr>');