d96a86aa9e8ab73fd3b81d878ecaa669a4cfb1be
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) 
bernd Benutzer config-Variablen f...

bernd authored 15 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php  80) <p>Hier können Sie ein neues POP3/IMAP-Konto anlegen.</p>
bernd eliminate .php extensions f...

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

modules/imap/accounts.php 110)   $sure = user_is_sure();
modules/imap/accounts.php 111)   if ($sure === NULL)
modules/imap/accounts.php 112)   {
modules/imap/accounts.php 113)     $_GET['account'] = (int) $_GET['account'];
modules/imap/accounts.php 114)     $account = get_mailaccount($_GET['account']);
modules/imap/accounts.php 115)     $enabled = ($account['enabled'] ? 'Ja' : 'Nein');
bernd * alle internen Links sinnv...

bernd authored 15 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

modules/imap/accounts.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']);
bernd webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

modules/email/imap.php    205)             <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 206)         }
modules/imap/accounts.php 207)         output('</table>
bernd eliminate .php extensions f...

bernd authored 16 years ago

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