7b78f3b83574fc0171331c59a646f6a783e0c227
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php   1) <?php
modules/vmail/include/vmail.php   2) require_once('inc/base.php');
modules/vmail/include/vmail.php   3) require_once('inc/debug.php');
modules/vmail/include/vmail.php   4) 
bernd Bugfix: Funktion-Dopplung v...

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

modules/email/include/vmail.php   7) require_once('common.php');
modules/email/include/vmail.php   8) 
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php   9) function empty_account()
modules/vmail/include/vmail.php  10) {
modules/vmail/include/vmail.php  11) 	$account = array(
modules/vmail/include/vmail.php  12) 		'id' => NULL,
modules/vmail/include/vmail.php  13) 		'local' => '',
modules/vmail/include/vmail.php  14) 		'domain' => NULL,
bernd Neues VMail-Interface (funk...

bernd authored 16 years ago

modules/vmail/include/vmail.php  15) 		'password' => NULL,
bernd Spam- und viren nur noch ei...

bernd authored 16 years ago

modules/vmail/include/vmail.php  16) 		'spamfilter' => 'folder',
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php  17) 		'spamexpire' => 7,
bernd VMail-Quota-Zeug

bernd authored 13 years ago

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

bernd authored 13 years ago

modules/email/include/vmail.php  19)     'quota_threshold' => 20,
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/include/vmail.php  20) 		'forwards' => array()
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php  21) 		);
modules/vmail/include/vmail.php  22) 	return $account;
modules/vmail/include/vmail.php  23) 
modules/vmail/include/vmail.php  24) }
modules/vmail/include/vmail.php  25) 
bernd VMail-accounts können sich...

bernd authored 16 years ago

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

bernd authored 16 years ago

modules/vmail/include/vmail.php  27) {
modules/vmail/include/vmail.php  28) 	$id = (int) $id;
modules/vmail/include/vmail.php  29) 	$uid = (int) $_SESSION['userinfo']['uid'];
bernd VMail-accounts können sich...

bernd authored 16 years ago

modules/vmail/include/vmail.php  30) 	$uid_check = ($checkuid ? "useraccount='{$uid}' AND " : "");
bernd Quota-Threshold für Notific...

bernd authored 13 years ago

modules/email/include/vmail.php  31) 	$result = db_query("SELECT id, local, domain, password, spamfilter, forwards, server, quota, quota_used, quota_threshold from mail.v_vmail_accounts WHERE {$uid_check}id={$id} LIMIT 1");
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php  32) 	if (mysql_num_rows($result) == 0)
modules/vmail/include/vmail.php  33) 		system_failure('Ungültige ID oder kein eigener Account');
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/include/vmail.php  34) 	$acc = empty_account();
modules/vmail/include/vmail.php  35) 	$res = mysql_fetch_assoc($result);
modules/vmail/include/vmail.php  36) 	foreach ($res AS $key => $value) {
modules/vmail/include/vmail.php  37) 	  if ($key == 'forwards')
modules/vmail/include/vmail.php  38) 	    continue;
modules/vmail/include/vmail.php  39) 	  $acc[$key] = $value;
modules/vmail/include/vmail.php  40) 	}
modules/vmail/include/vmail.php  41) 	if ($acc['forwards'] > 0) {
modules/vmail/include/vmail.php  42) 	  $result = db_query("SELECT id, spamfilter, destination FROM mail.vmail_forward WHERE account={$acc['id']};");
modules/vmail/include/vmail.php  43) 	  while ($item = mysql_fetch_assoc($result)){
modules/vmail/include/vmail.php  44) 	    array_push($acc['forwards'], array("id" => $item['id'], 'spamfilter' => $item['spamfilter'], 'destination' => $item['destination']));
modules/vmail/include/vmail.php  45) 	  }
modules/vmail/include/vmail.php  46) 	}
bernd Quota-Threshold für Notific...

bernd authored 13 years ago

modules/email/include/vmail.php  47)   if ($acc['quota_threshold'] === NULL) {
modules/email/include/vmail.php  48)     $acc['quota_threshold'] = -1;
modules/email/include/vmail.php  49)   }
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/include/vmail.php  50) 	return $acc;
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php  51) }
modules/vmail/include/vmail.php  52) 
modules/vmail/include/vmail.php  53) function get_vmail_accounts()
modules/vmail/include/vmail.php  54) {
modules/vmail/include/vmail.php  55) 	$uid = (int) $_SESSION['userinfo']['uid'];
bernd Sortiere VMail-Anzeige alph...

bernd authored 14 years ago

modules/email/include/vmail.php  56) 	$result = db_query("SELECT * from mail.v_vmail_accounts WHERE useraccount='{$uid}' ORDER BY domainname,local ASC");
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php  57) 	$ret = array();
modules/vmail/include/vmail.php  58) 	while ($line = mysql_fetch_assoc($result))
modules/vmail/include/vmail.php  59) 	{
modules/vmail/include/vmail.php  60) 		array_push($ret, $line);
modules/vmail/include/vmail.php  61) 	}
modules/vmail/include/vmail.php  62) 	DEBUG($ret);
modules/vmail/include/vmail.php  63) 	return $ret;
modules/vmail/include/vmail.php  64) }
modules/vmail/include/vmail.php  65) 
modules/vmail/include/vmail.php  66) 
modules/vmail/include/vmail.php  67) 
modules/vmail/include/vmail.php  68) function get_vmail_domains()
modules/vmail/include/vmail.php  69) {
modules/vmail/include/vmail.php  70) 	$uid = (int) $_SESSION['userinfo']['uid'];
bernd VMail-Quota-Zeug

bernd authored 13 years ago

modules/email/include/vmail.php  71) 	$result = db_query("SELECT id, domainname, server FROM mail.v_vmail_domains WHERE useraccount='{$uid}'");
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php  72) 	if (mysql_num_rows($result) == 0)
modules/vmail/include/vmail.php  73) 		system_failure('Sie haben keine Domains für virtuelle Mail-Verarbeitung');
modules/vmail/include/vmail.php  74) 	$ret = array();
modules/vmail/include/vmail.php  75) 	while ($tmp = mysql_fetch_object($result))
modules/vmail/include/vmail.php  76) 		array_push($ret, $tmp);
modules/vmail/include/vmail.php  77) 	return $ret;
modules/vmail/include/vmail.php  78) }
modules/vmail/include/vmail.php  79) 
modules/vmail/include/vmail.php  80) 
bernd VMail-accounts können sich...

bernd authored 16 years ago

modules/vmail/include/vmail.php  81) function find_account_id($accname)
modules/vmail/include/vmail.php  82) {
modules/vmail/include/vmail.php  83)   $accname = mysql_real_escape_string($accname);
modules/vmail/include/vmail.php  84)   DEBUG($accname);
modules/vmail/include/vmail.php  85)   $tmp = explode('@', $accname, 2);
modules/vmail/include/vmail.php  86)   DEBUG($tmp);
modules/vmail/include/vmail.php  87)   if (count($tmp) != 2)
modules/vmail/include/vmail.php  88)     system_failure("Der Account hat nicht die korrekte Syntax");
modules/vmail/include/vmail.php  89)   list( $local, $domainname) = $tmp;
modules/vmail/include/vmail.php  90) 
modules/vmail/include/vmail.php  91)   $result = db_query("SELECT id FROM mail.v_vmail_accounts WHERE local='{$local}' AND domainname='{$domainname}' LIMIT 1");
modules/vmail/include/vmail.php  92)   if (mysql_num_rows($result) == 0)
modules/vmail/include/vmail.php  93)     system_failure("Der Account konnte nicht gefunden werden");
modules/vmail/include/vmail.php  94)   $tmp = mysql_fetch_array($result);
modules/vmail/include/vmail.php  95)   return $tmp[0];
modules/vmail/include/vmail.php  96) }
modules/vmail/include/vmail.php  97) 
modules/vmail/include/vmail.php  98) 
modules/vmail/include/vmail.php  99) function change_vmail_password($accname, $newpass)
modules/vmail/include/vmail.php 100) {
modules/vmail/include/vmail.php 101)   $accid = find_account_id($accname);
modules/vmail/include/vmail.php 102)   $encpw = mysql_real_escape_string(encrypt_mail_password($newpass));
modules/vmail/include/vmail.php 103)   db_query("UPDATE mail.vmail_accounts SET password='{$encpw}' WHERE id={$accid} LIMIT 1;");
modules/vmail/include/vmail.php 104) }
modules/vmail/include/vmail.php 105) 
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 106) 
modules/vmail/include/vmail.php 107) function domainselect($selected = NULL, $selectattribute = '')
modules/vmail/include/vmail.php 108) {
bernd Bugfix: Funktion-Dopplung v...

bernd authored 16 years ago

modules/vmail/include/vmail.php 109)   $domainlist = get_vmail_domains();
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 110)   $selected = (int) $selected;
modules/vmail/include/vmail.php 111) 
modules/vmail/include/vmail.php 112)   $ret = '<select id="domain" name="domain" size="1" '.$selectattribute.' >';
modules/vmail/include/vmail.php 113)   foreach ($domainlist as $dom)
modules/vmail/include/vmail.php 114)   {
modules/vmail/include/vmail.php 115)     $s = ($selected == $dom->id) ? ' selected="selected" ': '';
modules/vmail/include/vmail.php 116)     $ret .= "<option value=\"{$dom->id}\"{$s}>{$dom->domainname}</option>\n";
modules/vmail/include/vmail.php 117)   }
modules/vmail/include/vmail.php 118)   $ret .= '</select>';
modules/vmail/include/vmail.php 119)   return $ret;
modules/vmail/include/vmail.php 120) }
modules/vmail/include/vmail.php 121) 
modules/vmail/include/vmail.php 122) 
bernd VMail-Quota-Zeug

bernd authored 13 years ago

modules/email/include/vmail.php 123) function get_max_mailboxquota($server, $oldquota) {
modules/email/include/vmail.php 124)   $uid = (int) $_SESSION['userinfo']['uid'];
modules/email/include/vmail.php 125)   $server = (int) $server;
modules/email/include/vmail.php 126)   $result = db_query("SELECT systemquota - (systemquota_used + mailquota) AS free FROM system.v_quota WHERE uid='{$uid}' AND server='{$server}'");
modules/email/include/vmail.php 127)   $item = mysql_fetch_assoc($result);
modules/email/include/vmail.php 128)   DEBUG("Free space: ".$item['free']." / Really: ".($item['free'] + ($oldquota - config('vmail_basequota'))));
modules/email/include/vmail.php 129)   return $item['free'] + ($oldquota - config('vmail_basequota'));
modules/email/include/vmail.php 130) }
modules/email/include/vmail.php 131) 
modules/email/include/vmail.php 132) 
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) function save_vmail_account($account)
modules/vmail/include/vmail.php 136) {
modules/vmail/include/vmail.php 137)   $uid = (int) $_SESSION['userinfo']['uid'];
modules/vmail/include/vmail.php 138)   $id = $account['id'];
modules/vmail/include/vmail.php 139)   if ($id != NULL)
modules/vmail/include/vmail.php 140)   {
modules/vmail/include/vmail.php 141)     $id = (int) $id;
modules/vmail/include/vmail.php 142)     $oldaccount = get_account_details($id);
modules/vmail/include/vmail.php 143)     // Erzeugt einen system_error() wenn ID ungültig
modules/vmail/include/vmail.php 144)   }
modules/vmail/include/vmail.php 145)   // Ab hier ist $id sicher, entweder NULL oder eine gültige ID des aktuellen users
modules/vmail/include/vmail.php 146) 
modules/vmail/include/vmail.php 147)   $account['local'] = filter_input_username($account['local']);
modules/vmail/include/vmail.php 148)   if ($account['local'] == '')
modules/vmail/include/vmail.php 149)   {
bernd Nicht behebbare Fehlermeldu...

bernd authored 14 years ago

modules/email/include/vmail.php 150)     system_failure('Die E-Mail-Adresse braucht eine Angabe vor dem »@«!');
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 151)     return false;
modules/vmail/include/vmail.php 152)   }
modules/vmail/include/vmail.php 153)   $account['domain'] = (int) $account['domain'];
modules/vmail/include/vmail.php 154)   $domainlist = get_vmail_domains();
modules/vmail/include/vmail.php 155)   $valid_domain = false;
bernd Benachrichtige vmail-userac...

bernd authored 16 years ago

modules/vmail/include/vmail.php 156)   $domainname = NULL;
bernd VMail-Quota-Zeug

bernd authored 13 years ago

modules/email/include/vmail.php 157)   $server = NULL;
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 158)   foreach ($domainlist as $dom)
modules/vmail/include/vmail.php 159)   {
modules/vmail/include/vmail.php 160)     if ($dom->id == $account['domain'])
modules/vmail/include/vmail.php 161)     {
bernd Benachrichtige vmail-userac...

bernd authored 16 years ago

modules/vmail/include/vmail.php 162)       $domainname = $dom->domainname;
bernd VMail-Quota-Zeug

bernd authored 13 years ago

modules/email/include/vmail.php 163)       $server = $dom->server;
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 164)       $valid_domain = true;
modules/vmail/include/vmail.php 165)       break;
modules/vmail/include/vmail.php 166)     }
modules/vmail/include/vmail.php 167)   }
modules/vmail/include/vmail.php 168)   if (($account['domain'] == 0) || (! $valid_domain))
modules/vmail/include/vmail.php 169)   {
bernd Nicht behebbare Fehlermeldu...

bernd authored 14 years ago

modules/email/include/vmail.php 170)     system_failure('Bitte wählen Sie eine Ihrer Domains aus!');
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 171)     return false;
modules/vmail/include/vmail.php 172)   }
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/include/vmail.php 173)   
modules/vmail/include/vmail.php 174)   $forwards = array();
modules/vmail/include/vmail.php 175)   if (count($account['forwards']) > 0) 
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 176)   {
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/include/vmail.php 177)     for ($i=0;$i < count($account['forwards']); $i++)
modules/vmail/include/vmail.php 178)     {
modules/vmail/include/vmail.php 179)       if ($account['forwards'][$i]['spamfilter'] != 'tag' && $account['forwards'][$i]['spamfilter'] != 'delete')
modules/vmail/include/vmail.php 180)         $account['forwards'][$i]['spamfilter'] = '';
modules/vmail/include/vmail.php 181)       $account['forwards'][$i]['destination'] = filter_input_general($account['forwards'][$i]['destination']);
modules/vmail/include/vmail.php 182)       if (! check_emailaddr($account['forwards'][$i]['destination']))
modules/vmail/include/vmail.php 183)         system_failure('Das Weiterleitungs-Ziel »'.$account['forwards'][$i]['destination'].'« ist keine E-Mail-Adresse!');
modules/vmail/include/vmail.php 184)     }
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

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

bernd authored 16 years ago

modules/vmail/include/vmail.php 186)     
modules/vmail/include/vmail.php 187)   $password='NULL';
modules/vmail/include/vmail.php 188)   if ($account['password'] != '')
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 189)   {
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/include/vmail.php 190)     $account['password'] = stripslashes($account['password']);
modules/vmail/include/vmail.php 191)     $crack = strong_password($account['password']);
modules/vmail/include/vmail.php 192)     if ($crack !== true)
modules/vmail/include/vmail.php 193)     {
bernd Nicht behebbare Fehlermeldu...

bernd authored 14 years ago

modules/email/include/vmail.php 194)       system_failure('Ihr Passwort ist zu einfach. bitte wählen Sie ein sicheres Passwort!'."\nDie Fehlermeldung lautet: »{$crack}«");
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/include/vmail.php 195)       return false;
modules/vmail/include/vmail.php 196)     }
modules/vmail/include/vmail.php 197)     $password = "'".encrypt_mail_password($account['password'])."'";
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

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

bernd authored 16 years ago

modules/vmail/include/vmail.php 199)   $set_password = ($id == NULL || $password != 'NULL');
modules/vmail/include/vmail.php 200)   if ($account['password'] === NULL)
modules/vmail/include/vmail.php 201)     $set_password=true;
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 202) 
modules/vmail/include/vmail.php 203)   $spam = 'NULL';
modules/vmail/include/vmail.php 204)   switch ($account['spamfilter'])
modules/vmail/include/vmail.php 205)   {
modules/vmail/include/vmail.php 206)     case 'folder':
modules/vmail/include/vmail.php 207)       $spam = "'folder'";
modules/vmail/include/vmail.php 208)       break;
modules/vmail/include/vmail.php 209)     case 'tag':
modules/vmail/include/vmail.php 210)       $spam = "'tag'";
modules/vmail/include/vmail.php 211)       break;
modules/vmail/include/vmail.php 212)     case 'delete':
modules/vmail/include/vmail.php 213)       $spam = "'delete'";
modules/vmail/include/vmail.php 214)       break;
modules/vmail/include/vmail.php 215)   }
bernd VMail-Quota-Zeug

bernd authored 13 years ago

modules/email/include/vmail.php 216)   
modules/email/include/vmail.php 217)   $free = config('vmail_basequota');
modules/email/include/vmail.php 218)   if ($id == NULL) {
modules/email/include/vmail.php 219)     // Neues Postfach
modules/email/include/vmail.php 220)     $free = get_max_mailboxquota($server, config('vmail_basequota'));
modules/email/include/vmail.php 221)   } else {
modules/email/include/vmail.php 222)     $free = get_max_mailboxquota($oldaccount['server'], $oldaccount['quota']);
modules/email/include/vmail.php 223)   }
modules/email/include/vmail.php 224)   
modules/email/include/vmail.php 225)   $newquota = max((int) config('vmail_basequota'), (int) $account['quota']);
modules/email/include/vmail.php 226)   if ($newquota > config('vmail_basequota') && $newquota > ($free+config('vmail_basequota'))) {
modules/email/include/vmail.php 227)     $newquota = $free + config('vmail_basequota');
modules/email/include/vmail.php 228)     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 229)   }
modules/email/include/vmail.php 230)   
modules/email/include/vmail.php 231)   $account['quota'] = $newquota;
bernd Mailaccount-Quota auch bei...

bernd authored 13 years ago

modules/email/include/vmail.php 232) 
bernd Quota-Threshold für Notific...

bernd authored 13 years ago

modules/email/include/vmail.php 233)   if ($account['quota_threshold'] == -1) {
modules/email/include/vmail.php 234)     $account['quota_threshold'] = 'NULL';
modules/email/include/vmail.php 235)   }
modules/email/include/vmail.php 236)   else {
modules/email/include/vmail.php 237)     $account['quota_threshold'] = min( (int) $account['quota_threshold'], (int) $account['quota'] );
modules/email/include/vmail.php 238)   }
modules/email/include/vmail.php 239)   
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 240)   $account['local'] = mysql_real_escape_string($account['local']);
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/include/vmail.php 241)   $account['password'] = mysql_real_escape_string($account['password']);
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 242)   $account['spamexpire'] = (int) $account['spamexpire'];
modules/vmail/include/vmail.php 243) 
modules/vmail/include/vmail.php 244)   $query = '';
modules/vmail/include/vmail.php 245)   if ($id == NULL)
modules/vmail/include/vmail.php 246)   {
bernd Quota-Threshold für Notific...

bernd authored 13 years ago

modules/email/include/vmail.php 247)     $query = "INSERT INTO mail.vmail_accounts (local, domain, spamfilter, spamexpire, password, quota, quota_threshold) VALUES ";
modules/email/include/vmail.php 248)     $query .= "('{$account['local']}', {$account['domain']}, {$spam}, {$account['spamexpire']}, {$password}, {$account['quota']}, {$account['quota_threshold']});";
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 249)   }
modules/vmail/include/vmail.php 250)   else
modules/vmail/include/vmail.php 251)   {
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/include/vmail.php 252)     if ($set_password)
modules/vmail/include/vmail.php 253)       $password=", password={$password}";
modules/vmail/include/vmail.php 254)     else
modules/vmail/include/vmail.php 255)       $password='';
modules/vmail/include/vmail.php 256)     $query = "UPDATE mail.vmail_accounts SET local='{$account['local']}', domain={$account['domain']}{$password}, ";
bernd Quota-Threshold für Notific...

bernd authored 13 years ago

modules/email/include/vmail.php 257)     $query .= "spamfilter={$spam}, spamexpire={$account['spamexpire']}, quota={$account['quota']}, quota_threshold={$account['quota_threshold']} ";
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 258)     $query .= "WHERE id={$id} LIMIT 1;";
modules/vmail/include/vmail.php 259)   }
modules/vmail/include/vmail.php 260)   db_query($query); 
bernd Bugfixes

bernd authored 16 years ago

modules/vmail/include/vmail.php 261)   if ($id)
modules/vmail/include/vmail.php 262)     db_query("DELETE FROM mail.vmail_forward WHERE account={$id}");
bernd VMail-accounts können sich...

bernd authored 16 years ago

modules/vmail/include/vmail.php 263)   else
modules/vmail/include/vmail.php 264)     $id = mysql_insert_id();
modules/vmail/include/vmail.php 265) 
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/include/vmail.php 266)   if (count($account['forwards']) > 0)
modules/vmail/include/vmail.php 267)   {
modules/vmail/include/vmail.php 268)     $forward_query = "INSERT INTO mail.vmail_forward (account,spamfilter,destination) VALUES ";
modules/vmail/include/vmail.php 269)     $first = true;
modules/vmail/include/vmail.php 270)     for ($i=0;$i < count($account['forwards']); $i++)
modules/vmail/include/vmail.php 271)     { 
modules/vmail/include/vmail.php 272)       if ($first)
modules/vmail/include/vmail.php 273)         $first = false;
modules/vmail/include/vmail.php 274)       else
modules/vmail/include/vmail.php 275)         $forward_query .= ', ';
modules/vmail/include/vmail.php 276)       $forward_query .= "({$id}, ".maybe_null($account['forwards'][$i]['spamfilter']).", '{$account['forwards'][$i]['destination']}')";
modules/vmail/include/vmail.php 277)     }
modules/vmail/include/vmail.php 278)     db_query($forward_query);
modules/vmail/include/vmail.php 279)   }
bernd Mailaccount-Quota auch bei...

bernd authored 13 years ago

modules/email/include/vmail.php 280)   if ($password != 'NULL')
bernd Benachrichtige vmail-userac...

bernd authored 16 years ago

modules/vmail/include/vmail.php 281)   {
modules/vmail/include/vmail.php 282)     # notify the vmail subsystem of this new account
bernd Mehr config-optionen und co...

bernd authored 15 years ago

modules/email/include/vmail.php 283)     mail('vmail@'.config('vmail_server'), 'command', "user={$account['local']}\nhost={$domainname}", "X-schokokeks-org-message: command");
bernd Benachrichtige vmail-userac...

bernd authored 16 years ago

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

bernd authored 13 years ago

modules/email/include/vmail.php 285) 
modules/email/include/vmail.php 286)   // Update Mail-Quota-Cache
modules/email/include/vmail.php 287)   $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 GROUP BY useraccount, server");
modules/email/include/vmail.php 288)   while ($line = mysql_fetch_assoc($result)) {
modules/email/include/vmail.php 289)     if ($line['quota'] !== NULL) {
modules/email/include/vmail.php 290)       db_query("REPLACE INTO mail.vmailquota (uid, server, quota, used) VALUES ('{$line['useraccount']}', '{$line['server']}', '{$line['quota']}', '{$line['used']}')");
modules/email/include/vmail.php 291)     }
modules/email/include/vmail.php 292)   }
modules/email/include/vmail.php 293) 
bernd Nicht behebbare Fehlermeldu...

bernd authored 14 years ago

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

bernd authored 16 years ago

modules/vmail/include/vmail.php 295) }
modules/vmail/include/vmail.php 296) 
modules/vmail/include/vmail.php 297) 
modules/vmail/include/vmail.php 298) 
bernd Löschen geht jetzt auch

bernd authored 16 years ago

modules/vmail/include/vmail.php 299) function delete_account($id)
modules/vmail/include/vmail.php 300) {
modules/vmail/include/vmail.php 301)   $account = get_account_details($id);
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/include/vmail.php 302)   db_query("DELETE FROM mail.vmail_accounts WHERE id={$account['id']};");
bernd Löschen geht jetzt auch

bernd authored 16 years ago

modules/vmail/include/vmail.php 303) }
modules/vmail/include/vmail.php 304) 
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

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

bernd authored 16 years ago

modules/email/include/vmail.php 306) 
modules/email/include/vmail.php 307) function domainsettings($only_domain=NULL) {
modules/email/include/vmail.php 308)   $uid = (int) $_SESSION['userinfo']['uid'];
bernd Subdomains und Domains bess...

bernd authored 15 years ago

modules/email/include/vmail.php 309)   if ($only_domain)
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/include/vmail.php 310)     $only_domain = (int) $only_domain;
modules/email/include/vmail.php 311)   $domains = array();
modules/email/include/vmail.php 312)   $subdomains = array();
bernd Subdomains und Domains bess...

bernd authored 15 years ago

modules/email/include/vmail.php 313) 
modules/email/include/vmail.php 314)   // Domains
modules/email/include/vmail.php 315)   $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 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};");
modules/email/include/vmail.php 316) 
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/include/vmail.php 317)   while ($mydom = mysql_fetch_assoc($result)) {
modules/email/include/vmail.php 318)     if (! array_key_exists($mydom['id'], $domains)) {
bernd Subdomains und Domains bess...

bernd authored 15 years ago

modules/email/include/vmail.php 319)       if ($mydom['v_id'])
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/include/vmail.php 320)         $mydom['mail'] = 'virtual';
modules/email/include/vmail.php 321)       $domains[$mydom['id']] = array(
modules/email/include/vmail.php 322)         "name" => $mydom['name'],
modules/email/include/vmail.php 323)         "type" => $mydom['mail']
modules/email/include/vmail.php 324)         );
modules/email/include/vmail.php 325)       if ($only_domain && $only_domain == $mydom['id'])
modules/email/include/vmail.php 326)         return $domains[$only_domain];
modules/email/include/vmail.php 327)     }
bernd Subdomains und Domains bess...

bernd authored 15 years ago

modules/email/include/vmail.php 328)   }      
modules/email/include/vmail.php 329) 
modules/email/include/vmail.php 330)   // Subdomains
bernd Subdomains nur auslesen wo...

bernd authored 15 years ago

modules/email/include/vmail.php 331)   $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};");
bernd Subdomains und Domains bess...

bernd authored 15 years ago

modules/email/include/vmail.php 332)   while ($mydom = mysql_fetch_assoc($result)) {
modules/email/include/vmail.php 333)     if (! array_key_exists($mydom['id'], $subdomains))
modules/email/include/vmail.php 334)       $subdomains[$mydom['id']] = array();
bernd Großer VMail-move

bernd authored 16 years ago

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

bernd authored 15 years ago

modules/email/include/vmail.php 336)     $type = 'auto';
modules/email/include/vmail.php 337)     if ($mydom['v_id'])
modules/email/include/vmail.php 338)       $type = 'virtual';
modules/email/include/vmail.php 339)     $subdomains[$mydom['id']][] = array(
modules/email/include/vmail.php 340)       "name" => $mydom['hostname'],
modules/email/include/vmail.php 341)       "type" => $type
modules/email/include/vmail.php 342)       );
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/include/vmail.php 343)   }
modules/email/include/vmail.php 344)   return array("domains" => $domains, "subdomains" => $subdomains);
modules/email/include/vmail.php 345) }
modules/email/include/vmail.php 346) 
modules/email/include/vmail.php 347) 
modules/email/include/vmail.php 348) function domain_has_vmail_accounts($domid)
modules/email/include/vmail.php 349) {
modules/email/include/vmail.php 350)   $domid = (int) $domid;
modules/email/include/vmail.php 351)   $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={$domid}");
modules/email/include/vmail.php 352)   return (mysql_num_rows($result) > 0);
modules/email/include/vmail.php 353) }
modules/email/include/vmail.php 354) 
modules/email/include/vmail.php 355) 
modules/email/include/vmail.php 356) function change_domain($id, $type)
modules/email/include/vmail.php 357) {
modules/email/include/vmail.php 358)   $id = (int) $id;
modules/email/include/vmail.php 359)   $type = mysql_real_escape_string($type);
modules/email/include/vmail.php 360)   if (domain_has_vmail_accounts($id))
modules/email/include/vmail.php 361)     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 362)   
modules/email/include/vmail.php 363)   if (! in_array($type, array('none','auto','virtual')))
modules/email/include/vmail.php 364)     system_failure("Ungültige Aktion");
modules/email/include/vmail.php 365)   
modules/email/include/vmail.php 366)   $old = domainsettings($id);
modules/email/include/vmail.php 367)   if ($old['type'] == $type)
modules/email/include/vmail.php 368)     system_failure('Domain ist bereits so konfiguriert');
modules/email/include/vmail.php 369) 
modules/email/include/vmail.php 370)   if ($type == 'none') {
modules/email/include/vmail.php 371)     db_query("DELETE FROM mail.virtual_mail_domains WHERE domain={$id} AND hostname IS NULL LIMIT 1;");
modules/email/include/vmail.php 372)     db_query("DELETE FROM mail.custom_mappings WHERE domain={$id} AND subdomain IS NULL LIMIT 1;");
bernd lastchange immer setzen

bernd authored 16 years ago

modules/email/include/vmail.php 373)     db_query("UPDATE kundendaten.domains SET mail='none', lastchange=NOW() WHERE id={$id} LIMIT 1;");
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/include/vmail.php 374)   }
modules/email/include/vmail.php 375)   elseif ($type == 'virtual') {
bernd Info-Seite über Mail-Login-...

bernd authored 13 years ago

modules/email/include/vmail.php 376)     $vmailserver = (int) $_SESSION['userinfo']['server'];
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/include/vmail.php 377)     db_query("DELETE FROM mail.custom_mappings WHERE domain={$id} AND subdomain IS NULL LIMIT 1;");
bernd lastchange immer setzen

bernd authored 16 years ago

modules/email/include/vmail.php 378)     db_query("UPDATE kundendaten.domains SET mail='auto', lastchange=NOW() WHERE id={$id} LIMIT 1;");
bernd Server bei vmail-domain mit...

bernd authored 13 years ago

modules/email/include/vmail.php 379)     db_query("INSERT INTO mail.virtual_mail_domains (domain, server) VALUES ({$id}, {$vmailserver});");
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/include/vmail.php 380)   }
modules/email/include/vmail.php 381)   elseif ($type == 'auto') {
modules/email/include/vmail.php 382)     db_query("DELETE FROM mail.virtual_mail_domains WHERE domain={$id} AND hostname IS NULL LIMIT 1;");
modules/email/include/vmail.php 383)     db_query("DELETE FROM mail.custom_mappings WHERE domain={$id} AND subdomain IS NULL LIMIT 1;");
bernd lastchange immer setzen

bernd authored 16 years ago

modules/email/include/vmail.php 384)     db_query("UPDATE kundendaten.domains SET mail='auto', lastchange=NOW() WHERE id={$id} LIMIT 1;");