2626dd47daad110c63a82c0560b134e2364eeac3
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php   1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

modules/email/include/vmail.php   2) /*
modules/email/include/vmail.php   3) This file belongs to the Webinterface of schokokeks.org Hosting
modules/email/include/vmail.php   4) 
Bernd Wurst Copyright year update

Bernd Wurst authored 6 years ago

modules/email/include/vmail.php   5) Written 2008-2018 by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

modules/email/include/vmail.php   6)   Bernd Wurst <bernd@schokokeks.org>
modules/email/include/vmail.php   7)   Hanno Böck <hanno@schokokeks.org>
modules/email/include/vmail.php   8) 
modules/email/include/vmail.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/include/vmail.php  10) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php  11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

modules/email/include/vmail.php  12) http://creativecommons.org/publicdomain/zero/1.0/
modules/email/include/vmail.php  13) 
modules/email/include/vmail.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/include/vmail.php  15) */
modules/email/include/vmail.php  16) 
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php  17) require_once('inc/base.php');
modules/vmail/include/vmail.php  18) require_once('inc/debug.php');
modules/vmail/include/vmail.php  19) 
bernd Bugfix: Funktion-Dopplung v...

bernd authored 16 years ago

modules/vmail/include/vmail.php  20) require_once('hasdomain.php');
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php  21) 
bernd Alles in das email-modul ve...

bernd authored 16 years ago

modules/email/include/vmail.php  22) require_once('common.php');
modules/email/include/vmail.php  23) 
Bernd Wurst Vorbereitung für Warnungen...

Bernd Wurst authored 10 years ago

modules/email/include/vmail.php  24) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php  25) function forward_type($target)
modules/email/include/vmail.php  26) {
modules/email/include/vmail.php  27)     list($l, $d) = explode('@', strtolower($target), 2);
modules/email/include/vmail.php  28)     DEBUG('Weiterleitung an '.$l.' @ '.$d);
modules/email/include/vmail.php  29)     $result = db_query("SELECT id FROM kundendaten.domains WHERE CONCAT_WS('.', domainname, tld) = ?", array($d));
modules/email/include/vmail.php  30)     if ($result->rowCount() > 0) {
modules/email/include/vmail.php  31)         // Lokale Domain
modules/email/include/vmail.php  32)         return 'local';
modules/email/include/vmail.php  33)     }
modules/email/include/vmail.php  34)     // Auswärtige Domain aber keine aus der Liste
modules/email/include/vmail.php  35)     return 'external';
Bernd Wurst Vorbereitung für Warnungen...

Bernd Wurst authored 10 years ago

modules/email/include/vmail.php  36) }
modules/email/include/vmail.php  37) 
modules/email/include/vmail.php  38) 
modules/email/include/vmail.php  39) 
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php  40) function empty_account()
modules/vmail/include/vmail.php  41) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php  42)     $account = array(
modules/email/include/vmail.php  43)         'id' => null,
modules/email/include/vmail.php  44)         'local' => '',
modules/email/include/vmail.php  45)         'domain' => null,
modules/email/include/vmail.php  46)         'password' => null,
modules/email/include/vmail.php  47)     'smtpreply' => null,
bernd VMail-Quota-Zeug

bernd authored 13 years ago

modules/email/include/vmail.php  48)     'quota' => config('vmail_basequota'),
bernd Quota-Threshold für Notific...

bernd authored 13 years ago

modules/email/include/vmail.php  49)     'quota_threshold' => 20,
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php  50)         'forwards' => array(),
modules/email/include/vmail.php  51)         'autoresponder' => null
modules/email/include/vmail.php  52)         );
modules/email/include/vmail.php  53)     return $account;
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php  54) }
modules/vmail/include/vmail.php  55) 
bernd Konfiguration des Autorespo...

bernd authored 12 years ago

modules/email/include/vmail.php  56) function empty_autoresponder_config()
modules/email/include/vmail.php  57) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php  58)     $ar = array(
modules/email/include/vmail.php  59)     'valid_from' => date('Y-m-d'),
modules/email/include/vmail.php  60)     'valid_until' => null,
modules/email/include/vmail.php  61)     'fromname' => null,
modules/email/include/vmail.php  62)     'fromaddr' => null,
modules/email/include/vmail.php  63)     'subject' => null,
bernd Konfiguration des Autorespo...

bernd authored 12 years ago

modules/email/include/vmail.php  64)     'message' => 'Danke für Ihre E-Mail.
modules/email/include/vmail.php  65) Ich bin aktuell nicht im Büro und werde Ihre Nachricht erst nach meiner Rückkehr beantworten.
modules/email/include/vmail.php  66) Ihre E-Mail wird nicht weitergeleitet.',
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php  67)     'quote' => null
bernd Konfiguration des Autorespo...

bernd authored 12 years ago

modules/email/include/vmail.php  68)     );
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php  69)     return $ar;
bernd Konfiguration des Autorespo...

bernd authored 12 years ago

modules/email/include/vmail.php  70) }
modules/email/include/vmail.php  71) 
modules/email/include/vmail.php  72) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php  73) function get_vmail_id_by_emailaddr($emailaddr)
bernd VMail-User können ihre Eins...

bernd authored 12 years ago

modules/email/include/vmail.php  74) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php  75)     $result = db_query("SELECT id FROM mail.v_vmail_accounts WHERE CONCAT(local, '@', domainname) = ?", array($emailaddr));
modules/email/include/vmail.php  76)     $entry = $result->fetch();
modules/email/include/vmail.php  77)     return (int) $entry['id'];
bernd VMail-User können ihre Eins...

bernd authored 12 years ago

modules/email/include/vmail.php  78) }
modules/email/include/vmail.php  79) 
bernd VMail-accounts können sich...

bernd authored 16 years ago

modules/vmail/include/vmail.php  80) function get_account_details($id, $checkuid = true)
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php  81) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php  82)     $id = (int) $id;
modules/email/include/vmail.php  83)     $uid_check = '';
modules/email/include/vmail.php  84)     DEBUG("checkuid: ".$checkuid);
modules/email/include/vmail.php  85)     $args = array(":id" => $id);
modules/email/include/vmail.php  86)     if ($checkuid) {
modules/email/include/vmail.php  87)         $uid = (int) $_SESSION['userinfo']['uid'];
modules/email/include/vmail.php  88)         $uid_check = "useraccount=:uid AND ";
modules/email/include/vmail.php  89)         $args[":uid"] = $uid;
modules/email/include/vmail.php  90)     }
modules/email/include/vmail.php  91)     $result = db_query("SELECT id, local, domain, password, smtpreply, forwards, autoresponder, server, quota, COALESCE(quota_used, 0) AS quota_used, quota_threshold from mail.v_vmail_accounts WHERE {$uid_check}id=:id LIMIT 1", $args);
modules/email/include/vmail.php  92)     if ($result->rowCount() == 0) {
modules/email/include/vmail.php  93)         system_failure('Ungültige ID oder kein eigener Account');
modules/email/include/vmail.php  94)     }
modules/email/include/vmail.php  95)     $acc = empty_account();
modules/email/include/vmail.php  96)     $res = $result->fetch();
modules/email/include/vmail.php  97)     foreach ($res as $key => $value) {
modules/email/include/vmail.php  98)         if ($key == 'forwards') {
modules/email/include/vmail.php  99)             continue;
modules/email/include/vmail.php 100)         }
modules/email/include/vmail.php 101)         $acc[$key] = $value;
modules/email/include/vmail.php 102)     }
modules/email/include/vmail.php 103)     if ($acc['forwards'] > 0) {
modules/email/include/vmail.php 104)         $result = db_query("SELECT id, destination FROM mail.vmail_forward WHERE account=?", array($acc['id']));
modules/email/include/vmail.php 105)         while ($item = $result->fetch()) {
modules/email/include/vmail.php 106)             array_push($acc['forwards'], array("id" => $item['id'], 'destination' => $item['destination']));
modules/email/include/vmail.php 107)         }
modules/email/include/vmail.php 108)     }
modules/email/include/vmail.php 109)     if ($acc['autoresponder'] > 0) {
modules/email/include/vmail.php 110)         $result = db_query("SELECT id, IF(valid_from IS NULL OR valid_from > NOW() OR valid_until < NOW(), 0, 1) AS active, DATE(valid_from) AS valid_from, DATE(valid_until) AS valid_until, fromname, fromaddr, subject, message, quote FROM mail.vmail_autoresponder WHERE account=?", array($acc['id']));
modules/email/include/vmail.php 111)         $item = $result->fetch();
modules/email/include/vmail.php 112)         DEBUG($item);
modules/email/include/vmail.php 113)         $acc['autoresponder'] = $item;
modules/email/include/vmail.php 114)     } else {
modules/email/include/vmail.php 115)         $acc['autoresponder'] = null;
modules/email/include/vmail.php 116)     }
modules/email/include/vmail.php 117)     if ($acc['quota_threshold'] === null) {
modules/email/include/vmail.php 118)         $acc['quota_threshold'] = -1;
modules/email/include/vmail.php 119)     }
modules/email/include/vmail.php 120)     return $acc;
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 121) }
modules/vmail/include/vmail.php 122) 
modules/vmail/include/vmail.php 123) function get_vmail_accounts()
modules/vmail/include/vmail.php 124) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 125)     $uid = (int) $_SESSION['userinfo']['uid'];
modules/email/include/vmail.php 126)     $result = db_query("SELECT * from mail.v_vmail_accounts WHERE useraccount=? ORDER BY domainname,local ASC", array($uid));
modules/email/include/vmail.php 127)     $ret = array();
modules/email/include/vmail.php 128)     while ($line = $result->fetch()) {
modules/email/include/vmail.php 129)         array_push($ret, $line);
modules/email/include/vmail.php 130)     }
modules/email/include/vmail.php 131)     DEBUG($ret);
modules/email/include/vmail.php 132)     return $ret;
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 133) }
modules/vmail/include/vmail.php 134) 
modules/vmail/include/vmail.php 135) 
modules/vmail/include/vmail.php 136) 
modules/vmail/include/vmail.php 137) function get_vmail_domains()
modules/vmail/include/vmail.php 138) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 139)     $uid = (int) $_SESSION['userinfo']['uid'];
modules/email/include/vmail.php 140)     $result = db_query("SELECT id, domainname, server FROM mail.v_vmail_domains WHERE useraccount=? ORDER BY domainname", array($uid));
modules/email/include/vmail.php 141)     if ($result->rowCount() == 0) {
modules/email/include/vmail.php 142)         system_failure('Sie haben keine Domains für virtuelle Mail-Verarbeitung');
modules/email/include/vmail.php 143)     }
modules/email/include/vmail.php 144)     $ret = array();
modules/email/include/vmail.php 145)     while ($tmp = $result->fetch()) {
modules/email/include/vmail.php 146)         array_push($ret, $tmp);
modules/email/include/vmail.php 147)     }
modules/email/include/vmail.php 148)     return $ret;
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 149) }
modules/vmail/include/vmail.php 150) 
modules/vmail/include/vmail.php 151) 
bernd VMail-accounts können sich...

bernd authored 16 years ago

modules/vmail/include/vmail.php 152) function find_account_id($accname)
modules/vmail/include/vmail.php 153) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 154)     DEBUG($accname);
modules/email/include/vmail.php 155)     $tmp = explode('@', $accname, 2);
modules/email/include/vmail.php 156)     DEBUG($tmp);
modules/email/include/vmail.php 157)     if (count($tmp) != 2) {
modules/email/include/vmail.php 158)         system_failure("Der Account hat nicht die korrekte Syntax");
modules/email/include/vmail.php 159)     }
modules/email/include/vmail.php 160)     list($local, $domainname) = $tmp;
modules/email/include/vmail.php 161) 
modules/email/include/vmail.php 162)     $result = db_query("SELECT id FROM mail.v_vmail_accounts WHERE local=? AND domainname=? LIMIT 1", array($local, $domainname));
modules/email/include/vmail.php 163)     if ($result->rowCount() == 0) {
modules/email/include/vmail.php 164)         system_failure("Der Account konnte nicht gefunden werden");
modules/email/include/vmail.php 165)     }
modules/email/include/vmail.php 166)     $tmp = $result->fetch();
modules/email/include/vmail.php 167)     return $tmp[0];
bernd VMail-accounts können sich...

bernd authored 16 years ago

modules/vmail/include/vmail.php 168) }
modules/vmail/include/vmail.php 169) 
modules/vmail/include/vmail.php 170) 
modules/vmail/include/vmail.php 171) function change_vmail_password($accname, $newpass)
modules/vmail/include/vmail.php 172) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 173)     $accid = find_account_id($accname);
modules/email/include/vmail.php 174)     $encpw = encrypt_mail_password($newpass);
modules/email/include/vmail.php 175)     db_query("UPDATE mail.vmail_accounts SET password=:encpw WHERE id=:accid", array(":encpw" => $encpw, ":accid" => $accid));
bernd VMail-accounts können sich...

bernd authored 16 years ago

modules/vmail/include/vmail.php 176) }
modules/vmail/include/vmail.php 177) 
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 178) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 179) function domainselect($selected = null, $selectattribute = '')
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 180) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 181)     $domainlist = get_vmail_domains();
modules/email/include/vmail.php 182)     $selected = (int) $selected;
modules/email/include/vmail.php 183) 
modules/email/include/vmail.php 184)     $ret = '<select id="domain" name="domain" size="1" '.$selectattribute.' >';
modules/email/include/vmail.php 185)     foreach ($domainlist as $dom) {
modules/email/include/vmail.php 186)         $s = ($selected == $dom['id']) ? ' selected="selected" ': '';
modules/email/include/vmail.php 187)         $ret .= "<option value=\"{$dom['id']}\"{$s}>{$dom['domainname']}</option>\n";
modules/email/include/vmail.php 188)     }
modules/email/include/vmail.php 189)     $ret .= '</select>';
modules/email/include/vmail.php 190)     return $ret;
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 191) }
modules/vmail/include/vmail.php 192) 
modules/vmail/include/vmail.php 193) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 194) function get_max_mailboxquota($server, $oldquota)
modules/email/include/vmail.php 195) {
modules/email/include/vmail.php 196)     $uid = (int) $_SESSION['userinfo']['uid'];
modules/email/include/vmail.php 197)     $server = (int) $server;
modules/email/include/vmail.php 198)     $result = db_query("SELECT systemquota - (COALESCE(systemquota_used,0) + COALESCE(mailquota,0)) AS free FROM system.v_quota WHERE uid=:uid AND server=:server", array(":uid" => $uid, ":server" => $server));
modules/email/include/vmail.php 199)     $item = $result->fetch();
modules/email/include/vmail.php 200)     DEBUG("Free space: ".$item['free']." / Really: ".($item['free'] + ($oldquota - config('vmail_basequota'))));
modules/email/include/vmail.php 201)     return max(0, $item['free'] + ($oldquota - config('vmail_basequota')));
bernd VMail-Quota-Zeug

bernd authored 13 years ago

modules/email/include/vmail.php 202) }
modules/email/include/vmail.php 203) 
modules/email/include/vmail.php 204) 
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 205) 
modules/vmail/include/vmail.php 206) 
modules/vmail/include/vmail.php 207) function save_vmail_account($account)
modules/vmail/include/vmail.php 208) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 209)     $accountlogin = ($_SESSION['role'] == ROLE_VMAIL_ACCOUNT);
modules/email/include/vmail.php 210)     $id = $account['id'];
modules/email/include/vmail.php 211)     if ($id != null) {
modules/email/include/vmail.php 212)         $id = (int) $id;
modules/email/include/vmail.php 213)         $oldaccount = get_account_details($id, !$accountlogin);
modules/email/include/vmail.php 214)         // Erzeugt einen system_error() wenn ID ungültig
modules/email/include/vmail.php 215)     }
modules/email/include/vmail.php 216)     // Ab hier ist $id sicher, entweder NULL oder eine gültige ID des aktuellen users
bernd VMail-User können ihre Eins...

bernd authored 12 years ago

modules/email/include/vmail.php 217) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 218)     $newaccount = false;
modules/email/include/vmail.php 219)     if ($id === null) {
modules/email/include/vmail.php 220)         $newaccount = true;
bernd VMail-User können ihre Eins...

bernd authored 12 years ago

modules/email/include/vmail.php 221)     }
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 222) 
modules/email/include/vmail.php 223)     if ($accountlogin) {
modules/email/include/vmail.php 224)         if ($account['domain'] != $oldaccount['domain']) {
modules/email/include/vmail.php 225)             system_failure('Sie können die E-Mail-Adresse nicht ändern!');
modules/email/include/vmail.php 226)         }
modules/email/include/vmail.php 227)         if ($account['local'] != $oldaccount['local']) {
modules/email/include/vmail.php 228)             system_failure('Sie können die E-Mail-Adresse nicht ändern!');
modules/email/include/vmail.php 229)         }
modules/email/include/vmail.php 230)         if ($account['quota'] != $oldaccount['quota']) {
modules/email/include/vmail.php 231)             system_failure('Sie können Ihren eigenen Speicherplatz nicht verändern.');
modules/email/include/vmail.php 232)         }
modules/email/include/vmail.php 233)         if ($account['smtpreply'] != null) {
modules/email/include/vmail.php 234)             system_failure("Sie können nicht den Account stilllegen mit dem Sie grade angemeldet sind.");
modules/email/include/vmail.php 235)         }
modules/email/include/vmail.php 236)     } else {
modules/email/include/vmail.php 237)         $account['local'] = filter_input_username($account['local']);
modules/email/include/vmail.php 238)         if ($account['local'] == '') {
modules/email/include/vmail.php 239)             system_failure('Die E-Mail-Adresse braucht eine Angabe vor dem »@«!');
modules/email/include/vmail.php 240)             return false;
modules/email/include/vmail.php 241)         }
modules/email/include/vmail.php 242)         $account['domain'] = (int) $account['domain'];
modules/email/include/vmail.php 243)         $domainlist = get_vmail_domains();
modules/email/include/vmail.php 244)         $valid_domain = false;
modules/email/include/vmail.php 245)         $domainname = null;
modules/email/include/vmail.php 246)         $server = null;
modules/email/include/vmail.php 247)         foreach ($domainlist as $dom) {
modules/email/include/vmail.php 248)             if ($dom['id'] == $account['domain']) {
modules/email/include/vmail.php 249)                 $domainname = $dom['domainname'];
modules/email/include/vmail.php 250)                 $server = $dom['server'];
modules/email/include/vmail.php 251)                 $valid_domain = true;
modules/email/include/vmail.php 252)                 break;
modules/email/include/vmail.php 253)             }
modules/email/include/vmail.php 254)         }
modules/email/include/vmail.php 255)         if (($account['domain'] == 0) || (! $valid_domain)) {
modules/email/include/vmail.php 256)             system_failure('Bitte wählen Sie eine Ihrer Domains aus!');
modules/email/include/vmail.php 257)             return false;
modules/email/include/vmail.php 258)         }
modules/email/include/vmail.php 259)         if ($id == null && get_vmail_id_by_emailaddr($account['local'].'@'.$domainname)) {
modules/email/include/vmail.php 260)             system_failure('Diese E-Mail-Adresse gibt es bereits.');
modules/email/include/vmail.php 261)             return false;
modules/email/include/vmail.php 262)         }
Bernd Wurst Verständliche Fehlermeldung...

Bernd Wurst authored 8 years ago

modules/email/include/vmail.php 263)     }
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/include/vmail.php 264)   
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 265)     $forwards = array();
modules/email/include/vmail.php 266)     if (count($account['forwards']) > 0) {
modules/email/include/vmail.php 267)         for ($i = 0 ; $i < count($account['forwards']) ; $i++) {
modules/email/include/vmail.php 268)             $account['forwards'][$i]['destination'] = filter_input_general($account['forwards'][$i]['destination']);
modules/email/include/vmail.php 269)             if (! check_emailaddr($account['forwards'][$i]['destination'])) {
modules/email/include/vmail.php 270)                 system_failure('Das Weiterleitungs-Ziel »'.$account['forwards'][$i]['destination'].'« ist keine E-Mail-Adresse!');
modules/email/include/vmail.php 271)             }
modules/email/include/vmail.php 272)         }
Bernd Wurst fehlende for-Schleife einge...

Bernd Wurst authored 7 years ago

modules/email/include/vmail.php 273)     }
bernd Konfiguration des Autorespo...

bernd authored 12 years ago

modules/email/include/vmail.php 274) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 275)     if ($accountlogin) {
modules/email/include/vmail.php 276)         $password = null;
modules/email/include/vmail.php 277)         $set_password = false;
bernd VMail-User können ihre Eins...

bernd authored 12 years ago

modules/email/include/vmail.php 278)     } else {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 279)         $password= null;
modules/email/include/vmail.php 280)         if ($account['password'] != '') {
modules/email/include/vmail.php 281)             $account['password'] = stripslashes($account['password']);
modules/email/include/vmail.php 282)             $crack = strong_password($account['password']);
modules/email/include/vmail.php 283)             if ($crack !== true) {
modules/email/include/vmail.php 284)                 system_failure('Ihr Passwort ist zu einfach. bitte wählen Sie ein sicheres Passwort!'."\nDie Fehlermeldung lautet: »{$crack}«");
modules/email/include/vmail.php 285)                 return false;
modules/email/include/vmail.php 286)             }
modules/email/include/vmail.php 287)             $password = encrypt_mail_password($account['password']);
modules/email/include/vmail.php 288)         }
modules/email/include/vmail.php 289)         $set_password = ($id == null || $password != null);
modules/email/include/vmail.php 290)         if ($account['password'] === null) {
modules/email/include/vmail.php 291)             $set_password=true;
modules/email/include/vmail.php 292)         }
bernd VMail-User können ihre Eins...

bernd authored 12 years ago

modules/email/include/vmail.php 293)     }
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 294) 
modules/email/include/vmail.php 295)     if (!$accountlogin) {
modules/email/include/vmail.php 296)         $free = config('vmail_basequota');
modules/email/include/vmail.php 297)         if ($newaccount) {
modules/email/include/vmail.php 298)             // Neues Postfach
modules/email/include/vmail.php 299)             $free = get_max_mailboxquota($server, config('vmail_basequota'));
modules/email/include/vmail.php 300)         } else {
modules/email/include/vmail.php 301)             $free = get_max_mailboxquota($oldaccount['server'], $oldaccount['quota']);
modules/email/include/vmail.php 302)         }
bernd VMail-Quota-Zeug

bernd authored 13 years ago

modules/email/include/vmail.php 303)   
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 304)         $newquota = max((int) config('vmail_basequota'), (int) $account['quota']);
modules/email/include/vmail.php 305)         if ($newquota > config('vmail_basequota') && $newquota > ($free+config('vmail_basequota'))) {
modules/email/include/vmail.php 306)             $newquota = $free + config('vmail_basequota');
modules/email/include/vmail.php 307)             if (isset($oldaccount) && $account['quota'] >= $oldaccount['quota'] && $newquota < $oldaccount['quota']) {
modules/email/include/vmail.php 308)                 # Wenn das Limit künstlich reduziert wurde, dann maximal auf den alten Wert.
modules/email/include/vmail.php 309)                 $newquota = $oldaccount['quota'];
modules/email/include/vmail.php 310)             }
modules/email/include/vmail.php 311)             warning("Ihr Speicherplatz reicht für diese Postfach-Größe nicht mehr aus. Ihr Postfach wurde auf {$newquota} MB reduziert. Bitte beachten Sie, dass damit Ihr Benutzerkonto keinen freien Speicherplatz mehr aufweist!");
modules/email/include/vmail.php 312)         }
bernd VMail-Quota-Zeug

bernd authored 13 years ago

modules/email/include/vmail.php 313)   
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 314)         $account['quota'] = $newquota;
modules/email/include/vmail.php 315)     }
bernd Mailaccount-Quota auch bei...

bernd authored 13 years ago

modules/email/include/vmail.php 316) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 317)     if ($account['quota_threshold'] == -1) {
modules/email/include/vmail.php 318)         $account['quota_threshold'] = null;
modules/email/include/vmail.php 319)     } else {
modules/email/include/vmail.php 320)         $account['quota_threshold'] = min((int) $account['quota_threshold'], (int) $account['quota']);
modules/email/include/vmail.php 321)     }
bernd Quota-Threshold für Notific...

bernd authored 13 years ago

modules/email/include/vmail.php 322)   
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 323)     $account['local'] = strtolower($account['local']);
modules/email/include/vmail.php 324)     # Leerstring wird zu NULL
modules/email/include/vmail.php 325)     $account['smtpreply'] = ($account['smtpreply'] ? $account['smtpreply'] : null);
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 326) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 327)     $args = array(":local" => $account['local'],
Bernd Wurst email-Modul auf prepared-st...

Bernd Wurst authored 10 years ago

modules/email/include/vmail.php 328)                 ":domain" => $account['domain'],
modules/email/include/vmail.php 329)                 ":password" => $password,
Bernd Wurst SMTP-seitige Autoresponder...

Bernd Wurst authored 10 years ago

modules/email/include/vmail.php 330)                 ":smtpreply" => $account['smtpreply'],
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 331)                 ":quota" => $account['quota'],
Bernd Wurst email-Modul auf prepared-st...

Bernd Wurst authored 10 years ago

modules/email/include/vmail.php 332)                 ":quota_threshold" => $account['quota_threshold'],
modules/email/include/vmail.php 333)                 ":id" => $id
modules/email/include/vmail.php 334)                 );
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 335)     $query = '';
modules/email/include/vmail.php 336)     if ($newaccount) {
modules/email/include/vmail.php 337)         unset($args[":id"]);
modules/email/include/vmail.php 338)         $query = "INSERT INTO mail.vmail_accounts (local, domain, password, smtpreply, quota, quota_threshold) VALUES (:local, :domain, :password, :smtpreply, :quota, :quota_threshold)";
modules/email/include/vmail.php 339)     } else {
modules/email/include/vmail.php 340)         if ($set_password) {
modules/email/include/vmail.php 341)             $pw=", password=:password";
modules/email/include/vmail.php 342)         } else {
modules/email/include/vmail.php 343)             unset($args[":password"]);
modules/email/include/vmail.php 344)             $pw='';
modules/email/include/vmail.php 345)         }
modules/email/include/vmail.php 346)         $query = "UPDATE mail.vmail_accounts SET local=:local, domain=:domain{$pw}, smtpreply=:smtpreply, quota=:quota, quota_threshold=:quota_threshold WHERE id=:id";
modules/email/include/vmail.php 347)     }
modules/email/include/vmail.php 348)     db_query($query, $args);
modules/email/include/vmail.php 349)     if ($newaccount) {
modules/email/include/vmail.php 350)         $id = db_insert_id();
modules/email/include/vmail.php 351)     }
bernd Bugfix: Fehler bei neu erst...

bernd authored 12 years ago

modules/email/include/vmail.php 352) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 353)     if (is_array($account['autoresponder'])) {
modules/email/include/vmail.php 354)         $ar = $account['autoresponder'];
modules/email/include/vmail.php 355)         $quote = null;
modules/email/include/vmail.php 356)         if ($ar['quote'] == 'attach') {
modules/email/include/vmail.php 357)             $quote = "attach";
modules/email/include/vmail.php 358)         } elseif ($ar['quote'] == 'inline') {
modules/email/include/vmail.php 359)             $quote = 'inline';
modules/email/include/vmail.php 360)         } elseif ($ar['quote'] == 'teaser') {
modules/email/include/vmail.php 361)             $quote = 'teaser';
modules/email/include/vmail.php 362)         }
modules/email/include/vmail.php 363)         if (! check_emailaddr($ar['fromaddr'])) {
modules/email/include/vmail.php 364)             input_error("Die Absenderadresse sieht ungültig aus. Es wird Ihre E-Mail-Adresse benutzt!");
modules/email/include/vmail.php 365)             $ar['fromaddr'] = null;
modules/email/include/vmail.php 366)         }
modules/email/include/vmail.php 367)         $query = "REPLACE INTO mail.vmail_autoresponder (account, valid_from, valid_until, fromname, fromaddr, subject, message, quote) ".
Bernd Wurst email-Modul auf prepared-st...

Bernd Wurst authored 10 years ago

modules/email/include/vmail.php 368)              "VALUES (:id, :valid_from, :valid_until, :fromname, :fromaddr, :subject, :message, :quote)";
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 369)         $args = array(":id" => $id,
Bernd Wurst email-Modul auf prepared-st...

Bernd Wurst authored 10 years ago

modules/email/include/vmail.php 370)                   ":valid_from" => $ar['valid_from'],
modules/email/include/vmail.php 371)                   ":valid_until" => $ar['valid_until'],
modules/email/include/vmail.php 372)                   ":fromname" => $ar['fromname'],
Bernd Wurst Bugfix: Autoresponder-From-...

Bernd Wurst authored 10 years ago

modules/email/include/vmail.php 373)                   ":fromaddr" => $ar['fromaddr'],
Bernd Wurst email-Modul auf prepared-st...

Bernd Wurst authored 10 years ago

modules/email/include/vmail.php 374)                   ":subject" => $ar['subject'],
modules/email/include/vmail.php 375)                   ":message" => $ar['message'],
modules/email/include/vmail.php 376)                   ":quote" => $quote);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 377)         db_query($query, $args);
modules/email/include/vmail.php 378)     }
bernd Bugfix: Fehler bei neu erst...

bernd authored 12 years ago

modules/email/include/vmail.php 379)     
modules/email/include/vmail.php 380) 
modules/email/include/vmail.php 381) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 382)     if (! $newaccount) {
modules/email/include/vmail.php 383)         db_query("DELETE FROM mail.vmail_forward WHERE account=?", array($id));
modules/email/include/vmail.php 384)     }
bernd VMail-accounts können sich...

bernd authored 16 years ago

modules/vmail/include/vmail.php 385) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 386)     if (count($account['forwards']) > 0) {
modules/email/include/vmail.php 387)         $forward_query = "INSERT INTO mail.vmail_forward (account,destination) VALUES (:account, :destination)";
modules/email/include/vmail.php 388)         for ($i=0;$i < count($account['forwards']); $i++) {
modules/email/include/vmail.php 389)             if (! isset($account['forwards'][$i]['destination'])) {
modules/email/include/vmail.php 390)                 continue;
modules/email/include/vmail.php 391)             }
modules/email/include/vmail.php 392)             db_query($forward_query, array(":account" => $id, ":destination" => $account['forwards'][$i]['destination']));
modules/email/include/vmail.php 393)         }
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/include/vmail.php 394)     }
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 395)     if ($newaccount && $password) {
modules/email/include/vmail.php 396)         $servername = get_server_by_id($server);
modules/email/include/vmail.php 397)         $emailaddr = 'vmail-'.$account['local'].'%'.$domainname.'@'.$servername;
modules/email/include/vmail.php 398)         $username = $account['local'].'@'.$domainname;
modules/email/include/vmail.php 399)         $webmailurl = config('webmail_url');
modules/email/include/vmail.php 400)         $servername = get_server_by_id($server);
modules/email/include/vmail.php 401)         $message = 'Ihr neues E-Mail-Postfach '.$username.' ist einsatzbereit!
bernd Welcome-Mail für neue VMail...

bernd authored 12 years ago

modules/email/include/vmail.php 402) 
modules/email/include/vmail.php 403) Wenn Sie diese Nachricht sehen, haben Sie das Postfach erfolgreich 
modules/email/include/vmail.php 404) abgerufen. Sie können diese Nachricht nach Kenntnisnahme löschen.
modules/email/include/vmail.php 405) 
modules/email/include/vmail.php 406) Wussten Sie schon, dass Sie auf mehrere Arten Ihre E-Mails abrufen können?
modules/email/include/vmail.php 407) 
modules/email/include/vmail.php 408) - Für unterwegs: Webmail
modules/email/include/vmail.php 409)   Rufen Sie dazu einfach die Seite '.$webmailurl.' auf und 
modules/email/include/vmail.php 410)   geben Sie Ihre E-Mail-Adresse und das Passwort ein.
modules/email/include/vmail.php 411) 
modules/email/include/vmail.php 412) - Mit Ihrem Computer oder Smartphone: IMAP oder POP3
modules/email/include/vmail.php 413)   Tragen Sie bitte folgende Zugangsdaten in Ihrem Programm ein:
bernd Falsche Variable benutzt, j...

bernd authored 12 years ago

modules/email/include/vmail.php 414)     Server-Name: '.$servername.'
Bernd Wurst E-Mail-Adressen immer lower...

Bernd Wurst authored 11 years ago

modules/email/include/vmail.php 415)     Benutzername: '.$username.'
bernd Welcome-Mail für neue VMail...

bernd authored 12 years ago

modules/email/include/vmail.php 416)   (Achten Sie bitte darauf, dass die Verschlüsselung mit SSL oder TLS 
modules/email/include/vmail.php 417)   aktiviert ist.)
modules/email/include/vmail.php 418) ';
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 419)         # send welcome message
modules/email/include/vmail.php 420)         mail($emailaddr, 'Ihr neues Postfach ist bereit', $message, "X-schokokeks-org-message: welcome\nFrom: ".config('company_name').' <'.config('adminmail').">\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\n");
modules/email/include/vmail.php 421)         # notify the vmail subsystem of this new account
bernd Welcome-Mail für neue VMail...

bernd authored 12 years ago

modules/email/include/vmail.php 422)     #mail('vmail@'.config('vmail_server'), 'command', "user={$account['local']}\nhost={$domainname}", "X-schokokeks-org-message: command");
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 423)     }
bernd Mailaccount-Quota auch bei...

bernd authored 13 years ago

modules/email/include/vmail.php 424) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 425)     // Clean up obsolete quota
modules/email/include/vmail.php 426)     if ($_SESSION['role'] == ROLE_SYSTEMUSER) {
modules/email/include/vmail.php 427)         db_query("UPDATE mail.vmail_accounts SET quota_used=NULL, quota=NULL WHERE password IS NULL");
modules/email/include/vmail.php 428)     }
Bernd Wurst Räume Quota auf wenn ein Po...

Bernd Wurst authored 11 years ago

modules/email/include/vmail.php 429) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 430)     // Update Mail-Quota-Cache
modules/email/include/vmail.php 431)     if ($_SESSION['role'] == ROLE_SYSTEMUSER) {
modules/email/include/vmail.php 432)         $uid = (int) $_SESSION['userinfo']['uid'];
modules/email/include/vmail.php 433)         $result = db_query("SELECT useraccount, server, SUM(quota-(SELECT value FROM misc.config WHERE `key`='vmail_basequota')) AS quota, SUM(GREATEST(quota_used-(SELECT value FROM misc.config WHERE `key`='vmail_basequota'), 0)) AS used FROM mail.v_vmail_accounts WHERE useraccount=? GROUP BY useraccount, server", array($uid));
modules/email/include/vmail.php 434)         while ($line = $result->fetch()) {
modules/email/include/vmail.php 435)             if ($line['quota'] !== null) {
modules/email/include/vmail.php 436)                 db_query("REPLACE INTO mail.vmailquota (uid, server, quota, used) VALUES (:uid, :server, :quota, :used)", array(":uid" => $line['useraccount'], ":server" => $line['server'], ":quota" => $line['quota'], ":used" => $line['used']));
modules/email/include/vmail.php 437)             }
modules/email/include/vmail.php 438)         }
bernd Mailaccount-Quota auch bei...

bernd authored 13 years ago

modules/email/include/vmail.php 439)     }
modules/email/include/vmail.php 440) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 441)     return true;
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 442) }
modules/vmail/include/vmail.php 443) 
modules/vmail/include/vmail.php 444) 
modules/vmail/include/vmail.php 445) 
bernd Löschen geht jetzt auch

bernd authored 16 years ago

modules/vmail/include/vmail.php 446) function delete_account($id)
modules/vmail/include/vmail.php 447) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 448)     $account = get_account_details($id);
modules/email/include/vmail.php 449)     db_query("DELETE FROM mail.vmail_accounts WHERE id=?", array($account['id']));
bernd Löschen geht jetzt auch

bernd authored 16 years ago

modules/vmail/include/vmail.php 450) }
modules/vmail/include/vmail.php 451) 
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 452) 
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/include/vmail.php 453) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 454) function domainsettings($only_domain=null)
modules/email/include/vmail.php 455) {
modules/email/include/vmail.php 456)     $uid = (int) $_SESSION['userinfo']['uid'];
modules/email/include/vmail.php 457)     if ($only_domain) {
modules/email/include/vmail.php 458)         $only_domain = (int) $only_domain;
modules/email/include/vmail.php 459)     }
modules/email/include/vmail.php 460)     $domains = array();
modules/email/include/vmail.php 461)     $subdomains = array();
modules/email/include/vmail.php 462) 
modules/email/include/vmail.php 463)     // Domains
modules/email/include/vmail.php 464)     $result = db_query("SELECT d.id, CONCAT_WS('.',d.domainname,d.tld) AS name, d.mail, d.mailserver_lock, m.id AS m_id, v.id AS v_id FROM kundendaten.domains AS d LEFT JOIN mail.virtual_mail_domains AS v ON (d.id=v.domain AND v.hostname IS NULL) LEFT JOIN mail.custom_mappings AS m ON (d.id=m.domain AND m.subdomain IS NULL) WHERE d.useraccount=:uid OR m.uid=:uid ORDER BY CONCAT_WS('.',d.domainname,d.tld);", array(":uid" => $uid));
modules/email/include/vmail.php 465) 
modules/email/include/vmail.php 466)     while ($mydom = $result->fetch()) {
modules/email/include/vmail.php 467)         if (! array_key_exists($mydom['id'], $domains)) {
modules/email/include/vmail.php 468)             if ($mydom['v_id']) {
modules/email/include/vmail.php 469)                 $mydom['mail'] = 'virtual';
modules/email/include/vmail.php 470)             }
modules/email/include/vmail.php 471)             $domains[$mydom['id']] = array(
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/include/vmail.php 472)         "name" => $mydom['name'],
Bernd Wurst Zeige mailserver_lock im We...

Bernd Wurst authored 11 years ago

modules/email/include/vmail.php 473)         "type" => $mydom['mail'],
modules/email/include/vmail.php 474)         "mailserver_lock" => $mydom['mailserver_lock']
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/include/vmail.php 475)         );
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 476)             if ($only_domain && $only_domain == $mydom['id']) {
modules/email/include/vmail.php 477)                 return $domains[$only_domain];
modules/email/include/vmail.php 478)             }
modules/email/include/vmail.php 479)         }
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/include/vmail.php 480)     }
bernd Subdomains und Domains bess...

bernd authored 15 years ago

modules/email/include/vmail.php 481) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 482)     // Subdomains
modules/email/include/vmail.php 483)     $result = db_query("SELECT d.id, CONCAT_WS('.',d.domainname,d.tld) AS name, d.mail, m.id AS m_id, v.id AS v_id, IF(ISNULL(v.hostname),m.subdomain,v.hostname) AS hostname FROM kundendaten.domains AS d LEFT JOIN mail.virtual_mail_domains AS v ON (d.id=v.domain AND v.hostname IS NOT NULL) LEFT JOIN mail.custom_mappings AS m ON (d.id=m.domain AND m.subdomain IS NOT NULL) WHERE (m.id IS NOT NULL OR v.id IS NOT NULL) AND d.useraccount=:uid OR m.uid=:uid;", array(":uid" => $uid));
modules/email/include/vmail.php 484)     while ($mydom = $result->fetch()) {
modules/email/include/vmail.php 485)         if (! array_key_exists($mydom['id'], $subdomains)) {
modules/email/include/vmail.php 486)             $subdomains[$mydom['id']] = array();
modules/email/include/vmail.php 487)         }
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/include/vmail.php 488)         
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 489)         $type = 'auto';
modules/email/include/vmail.php 490)         if ($mydom['v_id']) {
modules/email/include/vmail.php 491)             $type = 'virtual';
modules/email/include/vmail.php 492)         }
modules/email/include/vmail.php 493)         $subdomains[$mydom['id']][] = array(
bernd Subdomains und Domains bess...

bernd authored 15 years ago

modules/email/include/vmail.php 494)       "name" => $mydom['hostname'],
modules/email/include/vmail.php 495)       "type" => $type
modules/email/include/vmail.php 496)       );
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 497)     }
modules/email/include/vmail.php 498)     return array("domains" => $domains, "subdomains" => $subdomains);
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/include/vmail.php 499) }
modules/email/include/vmail.php 500) 
modules/email/include/vmail.php 501) 
modules/email/include/vmail.php 502) function domain_has_vmail_accounts($domid)
modules/email/include/vmail.php 503) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 504)     $domid = (int) $domid;
modules/email/include/vmail.php 505)     $result = db_query("SELECT dom.id FROM mail.vmail_accounts AS acc LEFT JOIN mail.virtual_mail_domains AS dom ON (dom.id=acc.domain) WHERE dom.domain=?", array($domid));
modules/email/include/vmail.php 506)     return ($result->rowCount() > 0);
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/include/vmail.php 507) }
modules/email/include/vmail.php 508) 
modules/email/include/vmail.php 509) 
modules/email/include/vmail.php 510) function change_domain($id, $type)
modules/email/include/vmail.php 511) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 512)     $id = (int) $id;
modules/email/include/vmail.php 513)     if (domain_has_vmail_accounts($id)) {
modules/email/include/vmail.php 514)         system_failure("Sie müssen zuerst alle E-Mail-Konten mit dieser Domain löschen, bevor Sie die Webinterface-Verwaltung für diese Domain abschalten können.");
modules/email/include/vmail.php 515)     }
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/include/vmail.php 516)   
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 517)     if (! in_array($type, array('none','auto','virtual'))) {
modules/email/include/vmail.php 518)         system_failure("Ungültige Aktion");
modules/email/include/vmail.php 519)     }
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/include/vmail.php 520)   
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 521)     $old = domainsettings($id);
modules/email/include/vmail.php 522)     if ($old['type'] == $type) {
modules/email/include/vmail.php 523)         system_failure('Domain ist bereits so konfiguriert');
modules/email/include/vmail.php 524)     }
modules/email/include/vmail.php 525) 
modules/email/include/vmail.php 526)     if ($type == 'none') {
modules/email/include/vmail.php 527)         db_query("DELETE FROM mail.virtual_mail_domains WHERE domain=? AND hostname IS NULL", array($id));
modules/email/include/vmail.php 528)         db_query("DELETE FROM mail.custom_mappings WHERE domain=? AND subdomain IS NULL", array($id));
modules/email/include/vmail.php 529)         db_query("UPDATE kundendaten.domains SET mail='none', lastchange=NOW() WHERE id=?", array($id));
modules/email/include/vmail.php 530)     } elseif ($type == 'virtual') {
modules/email/include/vmail.php 531)         $vmailserver = (int) $_SESSION['userinfo']['server'];
modules/email/include/vmail.php 532)         db_query("DELETE FROM mail.custom_mappings WHERE domain=? AND subdomain IS NULL", array($id));
modules/email/include/vmail.php 533)         db_query("UPDATE kundendaten.domains SET mail='auto', lastchange=NOW() WHERE id=?", array($id));
modules/email/include/vmail.php 534)         db_query("INSERT INTO mail.virtual_mail_domains (domain, server) VALUES (?, ?)", array($id, $vmailserver));
modules/email/include/vmail.php 535)     } elseif ($type == 'auto') {
modules/email/include/vmail.php 536)         db_query("DELETE FROM mail.virtual_mail_domains WHERE domain=? AND hostname IS NULL LIMIT 1;", array($id));
modules/email/include/vmail.php 537)         db_query("DELETE FROM mail.custom_mappings WHERE domain=? AND subdomain IS NULL LIMIT 1;", array($id));
modules/email/include/vmail.php 538)         db_query("UPDATE kundendaten.domains SET mail='auto', lastchange=NOW() WHERE id=? LIMIT 1;", array($id));
modules/email/include/vmail.php 539)     }
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/include/vmail.php 540) }
modules/email/include/vmail.php 541) 
modules/email/include/vmail.php 542) 
modules/email/include/vmail.php 543) /*
modules/email/include/vmail.php 544) function maildomain_type($type) {
modules/email/include/vmail.php 545)   switch ($type) {
modules/email/include/vmail.php 546)     case 'none':
modules/email/include/vmail.php 547)       $type = 'Diese Domain empfängt keine E-Mails';
modules/email/include/vmail.php 548)       break;
modules/email/include/vmail.php 549)     case 'auto':
modules/email/include/vmail.php 550)       $type = 'E-Mail-Adressen werden manuell über .courier-Dateien verwaltet';
modules/email/include/vmail.php 551)       break;
modules/email/include/vmail.php 552)     case 'virtual':
modules/email/include/vmail.php 553)       $type = 'E-Mail-Adressen werden über Webinterface verwaltet';
modules/email/include/vmail.php 554)       break;
modules/email/include/vmail.php 555)     case 'manual':
modules/email/include/vmail.php 556)       $type = 'Manuelle Konfiguration, kann nur von den Admins geändert werden';
modules/email/include/vmail.php 557)       break;
modules/email/include/vmail.php 558)   }
modules/email/include/vmail.php 559)   return $type;
modules/email/include/vmail.php 560) }
modules/email/include/vmail.php 561) */
modules/email/include/vmail.php 562) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 563) function maildomain_type($type)
modules/email/include/vmail.php 564) {
modules/email/include/vmail.php 565)     switch ($type) {
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/include/vmail.php 566)     case 'none':
modules/email/include/vmail.php 567)       $type = 'Deaktiviert';
modules/email/include/vmail.php 568)       break;
modules/email/include/vmail.php 569)     case 'auto':
modules/email/include/vmail.php 570)       $type = '.courier-Dateien';
modules/email/include/vmail.php 571)       break;
modules/email/include/vmail.php 572)     case 'virtual':
modules/email/include/vmail.php 573)       $type = 'Webinterface';
modules/email/include/vmail.php 574)       break;
modules/email/include/vmail.php 575)     case 'manual':
modules/email/include/vmail.php 576)       $type = 'Manuell';
modules/email/include/vmail.php 577)       break;
modules/email/include/vmail.php 578)   }
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

modules/email/include/vmail.php 579)     return $type;