8561dcc482e93e1f6870885841541bb315368864
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 Anpassung auf neues Interface

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

modules/vmail/include/vmail.php  28) 	$uid_check = ($checkuid ? "useraccount='{$uid}' AND " : "");
modules/vmail/include/vmail.php  29) 	$result = db_query("SELECT id, local, domain, password, spamfilter, forwards 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  30) 	if (mysql_num_rows($result) == 0)
modules/vmail/include/vmail.php  31) 		system_failure('Ungültige ID oder kein eigener Account');
bernd Anpassung auf neues Interface

bernd authored 16 years ago

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

bernd authored 16 years ago

modules/vmail/include/vmail.php  46) }
modules/vmail/include/vmail.php  47) 
modules/vmail/include/vmail.php  48) function get_vmail_accounts()
modules/vmail/include/vmail.php  49) {
modules/vmail/include/vmail.php  50) 	$uid = (int) $_SESSION['userinfo']['uid'];
bernd Sortiere VMail-Anzeige alph...

bernd authored 14 years ago

modules/email/include/vmail.php  51) 	$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  52) 	$ret = array();
modules/vmail/include/vmail.php  53) 	while ($line = mysql_fetch_assoc($result))
modules/vmail/include/vmail.php  54) 	{
modules/vmail/include/vmail.php  55) 		array_push($ret, $line);
modules/vmail/include/vmail.php  56) 	}
modules/vmail/include/vmail.php  57) 	DEBUG($ret);
modules/vmail/include/vmail.php  58) 	return $ret;
modules/vmail/include/vmail.php  59) }
modules/vmail/include/vmail.php  60) 
modules/vmail/include/vmail.php  61) 
modules/vmail/include/vmail.php  62) 
modules/vmail/include/vmail.php  63) function get_vmail_domains()
modules/vmail/include/vmail.php  64) {
modules/vmail/include/vmail.php  65) 	$uid = (int) $_SESSION['userinfo']['uid'];
modules/vmail/include/vmail.php  66) 	$result = db_query("SELECT id, domainname FROM mail.v_vmail_domains WHERE useraccount='{$uid}'");
modules/vmail/include/vmail.php  67) 	if (mysql_num_rows($result) == 0)
modules/vmail/include/vmail.php  68) 		system_failure('Sie haben keine Domains für virtuelle Mail-Verarbeitung');
modules/vmail/include/vmail.php  69) 	$ret = array();
modules/vmail/include/vmail.php  70) 	while ($tmp = mysql_fetch_object($result))
modules/vmail/include/vmail.php  71) 		array_push($ret, $tmp);
modules/vmail/include/vmail.php  72) 	return $ret;
modules/vmail/include/vmail.php  73) }
modules/vmail/include/vmail.php  74) 
modules/vmail/include/vmail.php  75) 
bernd VMail-accounts können sich...

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

modules/vmail/include/vmail.php 105)   $selected = (int) $selected;
modules/vmail/include/vmail.php 106) 
modules/vmail/include/vmail.php 107)   $ret = '<select id="domain" name="domain" size="1" '.$selectattribute.' >';
modules/vmail/include/vmail.php 108)   foreach ($domainlist as $dom)
modules/vmail/include/vmail.php 109)   {
modules/vmail/include/vmail.php 110)     $s = ($selected == $dom->id) ? ' selected="selected" ': '';
modules/vmail/include/vmail.php 111)     $ret .= "<option value=\"{$dom->id}\"{$s}>{$dom->domainname}</option>\n";
modules/vmail/include/vmail.php 112)   }
modules/vmail/include/vmail.php 113)   $ret .= '</select>';
modules/vmail/include/vmail.php 114)   return $ret;
modules/vmail/include/vmail.php 115) }
modules/vmail/include/vmail.php 116) 
modules/vmail/include/vmail.php 117) 
modules/vmail/include/vmail.php 118) 
modules/vmail/include/vmail.php 119) 
modules/vmail/include/vmail.php 120) function save_vmail_account($account)
modules/vmail/include/vmail.php 121) {
modules/vmail/include/vmail.php 122)   $uid = (int) $_SESSION['userinfo']['uid'];
modules/vmail/include/vmail.php 123)   $id = $account['id'];
modules/vmail/include/vmail.php 124)   if ($id != NULL)
modules/vmail/include/vmail.php 125)   {
modules/vmail/include/vmail.php 126)     $id = (int) $id;
modules/vmail/include/vmail.php 127)     $oldaccount = get_account_details($id);
modules/vmail/include/vmail.php 128)     // Erzeugt einen system_error() wenn ID ungültig
modules/vmail/include/vmail.php 129)   }
modules/vmail/include/vmail.php 130)   // Ab hier ist $id sicher, entweder NULL oder eine gültige ID des aktuellen users
modules/vmail/include/vmail.php 131) 
modules/vmail/include/vmail.php 132)   $account['local'] = filter_input_username($account['local']);
modules/vmail/include/vmail.php 133)   if ($account['local'] == '')
modules/vmail/include/vmail.php 134)   {
bernd Nicht behebbare Fehlermeldu...

bernd authored 14 years ago

modules/email/include/vmail.php 135)     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 136)     return false;
modules/vmail/include/vmail.php 137)   }
modules/vmail/include/vmail.php 138)   $account['domain'] = (int) $account['domain'];
modules/vmail/include/vmail.php 139)   $domainlist = get_vmail_domains();
modules/vmail/include/vmail.php 140)   $valid_domain = false;
bernd Benachrichtige vmail-userac...

bernd authored 16 years ago

modules/vmail/include/vmail.php 141)   $domainname = NULL;
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 142)   foreach ($domainlist as $dom)
modules/vmail/include/vmail.php 143)   {
modules/vmail/include/vmail.php 144)     if ($dom->id == $account['domain'])
modules/vmail/include/vmail.php 145)     {
bernd Benachrichtige vmail-userac...

bernd authored 16 years ago

modules/vmail/include/vmail.php 146)       $domainname = $dom->domainname;
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 147)       $valid_domain = true;
modules/vmail/include/vmail.php 148)       break;
modules/vmail/include/vmail.php 149)     }
modules/vmail/include/vmail.php 150)   }
modules/vmail/include/vmail.php 151)   if (($account['domain'] == 0) || (! $valid_domain))
modules/vmail/include/vmail.php 152)   {
bernd Nicht behebbare Fehlermeldu...

bernd authored 14 years ago

modules/email/include/vmail.php 153)     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 154)     return false;
modules/vmail/include/vmail.php 155)   }
bernd Anpassung auf neues Interface

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

modules/vmail/include/vmail.php 160)     for ($i=0;$i < count($account['forwards']); $i++)
modules/vmail/include/vmail.php 161)     {
modules/vmail/include/vmail.php 162)       if ($account['forwards'][$i]['spamfilter'] != 'tag' && $account['forwards'][$i]['spamfilter'] != 'delete')
modules/vmail/include/vmail.php 163)         $account['forwards'][$i]['spamfilter'] = '';
modules/vmail/include/vmail.php 164)       $account['forwards'][$i]['destination'] = filter_input_general($account['forwards'][$i]['destination']);
modules/vmail/include/vmail.php 165)       if (! check_emailaddr($account['forwards'][$i]['destination']))
modules/vmail/include/vmail.php 166)         system_failure('Das Weiterleitungs-Ziel »'.$account['forwards'][$i]['destination'].'« ist keine E-Mail-Adresse!');
modules/vmail/include/vmail.php 167)     }
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

modules/vmail/include/vmail.php 173)     $account['password'] = stripslashes($account['password']);
modules/vmail/include/vmail.php 174)     $crack = strong_password($account['password']);
modules/vmail/include/vmail.php 175)     if ($crack !== true)
modules/vmail/include/vmail.php 176)     {
bernd Nicht behebbare Fehlermeldu...

bernd authored 14 years ago

modules/email/include/vmail.php 177)       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 178)       return false;
modules/vmail/include/vmail.php 179)     }
modules/vmail/include/vmail.php 180)     $password = "'".encrypt_mail_password($account['password'])."'";
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

modules/vmail/include/vmail.php 185) 
modules/vmail/include/vmail.php 186)   $spam = 'NULL';
modules/vmail/include/vmail.php 187)   switch ($account['spamfilter'])
modules/vmail/include/vmail.php 188)   {
modules/vmail/include/vmail.php 189)     case 'folder':
modules/vmail/include/vmail.php 190)       $spam = "'folder'";
modules/vmail/include/vmail.php 191)       break;
modules/vmail/include/vmail.php 192)     case 'tag':
modules/vmail/include/vmail.php 193)       $spam = "'tag'";
modules/vmail/include/vmail.php 194)       break;
modules/vmail/include/vmail.php 195)     case 'delete':
modules/vmail/include/vmail.php 196)       $spam = "'delete'";
modules/vmail/include/vmail.php 197)       break;
modules/vmail/include/vmail.php 198)   }
modules/vmail/include/vmail.php 199) 
modules/vmail/include/vmail.php 200)   $account['local'] = mysql_real_escape_string($account['local']);
bernd Anpassung auf neues Interface

bernd authored 16 years ago

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

bernd authored 16 years ago

modules/vmail/include/vmail.php 202)   $account['spamexpire'] = (int) $account['spamexpire'];
modules/vmail/include/vmail.php 203) 
modules/vmail/include/vmail.php 204)   $query = '';
modules/vmail/include/vmail.php 205)   if ($id == NULL)
modules/vmail/include/vmail.php 206)   {
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/include/vmail.php 207)     $query = "INSERT INTO mail.vmail_accounts (local, domain, spamfilter, spamexpire, password) VALUES ";
bernd Bei neuen Accounts wurde da...

bernd authored 16 years ago

modules/vmail/include/vmail.php 208)     $query .= "('{$account['local']}', {$account['domain']}, {$spam}, {$account['spamexpire']}, {$password});";
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 209)   }
modules/vmail/include/vmail.php 210)   else
modules/vmail/include/vmail.php 211)   {
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/include/vmail.php 212)     if ($set_password)
modules/vmail/include/vmail.php 213)       $password=", password={$password}";
modules/vmail/include/vmail.php 214)     else
modules/vmail/include/vmail.php 215)       $password='';
modules/vmail/include/vmail.php 216)     $query = "UPDATE mail.vmail_accounts SET local='{$account['local']}', domain={$account['domain']}{$password}, ";
modules/vmail/include/vmail.php 217)     $query .= "spamfilter={$spam}, spamexpire={$account['spamexpire']} ";
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

modules/vmail/include/vmail.php 218)     $query .= "WHERE id={$id} LIMIT 1;";
modules/vmail/include/vmail.php 219)   }
modules/vmail/include/vmail.php 220)   db_query($query); 
bernd Bugfixes

bernd authored 16 years ago

modules/vmail/include/vmail.php 221)   if ($id)
modules/vmail/include/vmail.php 222)     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 223)   else
modules/vmail/include/vmail.php 224)     $id = mysql_insert_id();
modules/vmail/include/vmail.php 225) 
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/include/vmail.php 226)   if (count($account['forwards']) > 0)
modules/vmail/include/vmail.php 227)   {
modules/vmail/include/vmail.php 228)     $forward_query = "INSERT INTO mail.vmail_forward (account,spamfilter,destination) VALUES ";
modules/vmail/include/vmail.php 229)     $first = true;
modules/vmail/include/vmail.php 230)     for ($i=0;$i < count($account['forwards']); $i++)
modules/vmail/include/vmail.php 231)     { 
modules/vmail/include/vmail.php 232)       if ($first)
modules/vmail/include/vmail.php 233)         $first = false;
modules/vmail/include/vmail.php 234)       else
modules/vmail/include/vmail.php 235)         $forward_query .= ', ';
modules/vmail/include/vmail.php 236)       $forward_query .= "({$id}, ".maybe_null($account['forwards'][$i]['spamfilter']).", '{$account['forwards'][$i]['destination']}')";
modules/vmail/include/vmail.php 237)     }
modules/vmail/include/vmail.php 238)     db_query($forward_query);
modules/vmail/include/vmail.php 239)   }
modules/vmail/include/vmail.php 240)   if ($account['password'] != 'NULL')
bernd Benachrichtige vmail-userac...

bernd authored 16 years ago

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

bernd authored 15 years ago

modules/email/include/vmail.php 243)     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 244)   }
bernd Nicht behebbare Fehlermeldu...

bernd authored 14 years ago

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

bernd authored 16 years ago

modules/vmail/include/vmail.php 246) }
modules/vmail/include/vmail.php 247) 
modules/vmail/include/vmail.php 248) 
modules/vmail/include/vmail.php 249) 
bernd Löschen geht jetzt auch

bernd authored 16 years ago

modules/vmail/include/vmail.php 250) function delete_account($id)
modules/vmail/include/vmail.php 251) {
modules/vmail/include/vmail.php 252)   $account = get_account_details($id);
bernd Anpassung auf neues Interface

bernd authored 16 years ago

modules/vmail/include/vmail.php 253)   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 254) }
modules/vmail/include/vmail.php 255) 
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

modules/email/include/vmail.php 261)     $only_domain = (int) $only_domain;
modules/email/include/vmail.php 262)   $domains = array();
modules/email/include/vmail.php 263)   $subdomains = array();
bernd Subdomains und Domains bess...

bernd authored 15 years ago

modules/email/include/vmail.php 264) 
modules/email/include/vmail.php 265)   // Domains
modules/email/include/vmail.php 266)   $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 267) 
bernd Großer VMail-move

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

modules/email/include/vmail.php 271)         $mydom['mail'] = 'virtual';
modules/email/include/vmail.php 272)       $domains[$mydom['id']] = array(
modules/email/include/vmail.php 273)         "name" => $mydom['name'],
modules/email/include/vmail.php 274)         "type" => $mydom['mail']
modules/email/include/vmail.php 275)         );
modules/email/include/vmail.php 276)       if ($only_domain && $only_domain == $mydom['id'])
modules/email/include/vmail.php 277)         return $domains[$only_domain];
modules/email/include/vmail.php 278)     }
bernd Subdomains und Domains bess...

bernd authored 15 years ago

modules/email/include/vmail.php 279)   }      
modules/email/include/vmail.php 280) 
modules/email/include/vmail.php 281)   // Subdomains
bernd Subdomains nur auslesen wo...

bernd authored 15 years ago

modules/email/include/vmail.php 282)   $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 283)   while ($mydom = mysql_fetch_assoc($result)) {
modules/email/include/vmail.php 284)     if (! array_key_exists($mydom['id'], $subdomains))
modules/email/include/vmail.php 285)       $subdomains[$mydom['id']] = array();
bernd Großer VMail-move

bernd authored 16 years ago

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

bernd authored 15 years ago

modules/email/include/vmail.php 287)     $type = 'auto';
modules/email/include/vmail.php 288)     if ($mydom['v_id'])
modules/email/include/vmail.php 289)       $type = 'virtual';
modules/email/include/vmail.php 290)     $subdomains[$mydom['id']][] = array(
modules/email/include/vmail.php 291)       "name" => $mydom['hostname'],
modules/email/include/vmail.php 292)       "type" => $type
modules/email/include/vmail.php 293)       );
bernd Großer VMail-move

bernd authored 16 years ago

modules/email/include/vmail.php 294)   }
modules/email/include/vmail.php 295)   return array("domains" => $domains, "subdomains" => $subdomains);
modules/email/include/vmail.php 296) }
modules/email/include/vmail.php 297) 
modules/email/include/vmail.php 298) 
modules/email/include/vmail.php 299) function domain_has_vmail_accounts($domid)
modules/email/include/vmail.php 300) {
modules/email/include/vmail.php 301)   $domid = (int) $domid;
modules/email/include/vmail.php 302)   $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 303)   return (mysql_num_rows($result) > 0);
modules/email/include/vmail.php 304) }
modules/email/include/vmail.php 305) 
modules/email/include/vmail.php 306) 
modules/email/include/vmail.php 307) function change_domain($id, $type)
modules/email/include/vmail.php 308) {
modules/email/include/vmail.php 309)   $id = (int) $id;
modules/email/include/vmail.php 310)   $type = mysql_real_escape_string($type);
modules/email/include/vmail.php 311)   if (domain_has_vmail_accounts($id))
modules/email/include/vmail.php 312)     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 313)   
modules/email/include/vmail.php 314)   if (! in_array($type, array('none','auto','virtual')))
modules/email/include/vmail.php 315)     system_failure("Ungültige Aktion");
modules/email/include/vmail.php 316)   
modules/email/include/vmail.php 317)   $old = domainsettings($id);
modules/email/include/vmail.php 318)   if ($old['type'] == $type)
modules/email/include/vmail.php 319)     system_failure('Domain ist bereits so konfiguriert');
modules/email/include/vmail.php 320) 
modules/email/include/vmail.php 321)   if ($type == 'none') {
modules/email/include/vmail.php 322)     db_query("DELETE FROM mail.virtual_mail_domains WHERE domain={$id} AND hostname IS NULL LIMIT 1;");
modules/email/include/vmail.php 323)     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 324)     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 325)   }
modules/email/include/vmail.php 326)   elseif ($type == 'virtual') {
bernd Info-Seite über Mail-Login-...

bernd authored 13 years ago

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

bernd authored 16 years ago

modules/email/include/vmail.php 328)     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 329)     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 330)     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 331)   }
modules/email/include/vmail.php 332)   elseif ($type == 'auto') {
modules/email/include/vmail.php 333)     db_query("DELETE FROM mail.virtual_mail_domains WHERE domain={$id} AND hostname IS NULL LIMIT 1;");
modules/email/include/vmail.php 334)     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 335)     db_query("UPDATE kundendaten.domains SET mail='auto', lastchange=NOW() WHERE id={$id} LIMIT 1;");