bernd
Nicht behebbare Fehlermeldungen immer als system_failure() ausgeben.
bernd commited 3bd1e94 at 2010-10-15 07:52:10
<?php
require_once('inc/base.php');
require_once('inc/debug.php');
require_once('hasdomain.php');
require_once('common.php');
function empty_account()
{
$account = array(
'id' => NULL,
'local' => '',
'domain' => NULL,
'password' => NULL,
'spamfilter' => 'folder',
'spamexpire' => 7,
'forwards' => array()
);
return $account;
}
function get_account_details($id, $checkuid = true)
{
$id = (int) $id;
$uid = (int) $_SESSION['userinfo']['uid'];
$uid_check = ($checkuid ? "useraccount='{$uid}' AND " : "");
$result = db_query("SELECT id, local, domain, password, spamfilter, forwards from mail.v_vmail_accounts WHERE {$uid_check}id={$id} LIMIT 1");
if (mysql_num_rows($result) == 0)
system_failure('Ungültige ID oder kein eigener Account');
$acc = empty_account();
$res = mysql_fetch_assoc($result);
foreach ($res AS $key => $value) {
if ($key == 'forwards')
continue;
$acc[$key] = $value;
}
if ($acc['forwards'] > 0) {
$result = db_query("SELECT id, spamfilter, destination FROM mail.vmail_forward WHERE account={$acc['id']};");
while ($item = mysql_fetch_assoc($result)){
array_push($acc['forwards'], array("id" => $item['id'], 'spamfilter' => $item['spamfilter'], 'destination' => $item['destination']));
}
}
return $acc;
}
function get_vmail_accounts()
{
$uid = (int) $_SESSION['userinfo']['uid'];
$result = db_query("SELECT * from mail.v_vmail_accounts WHERE useraccount='{$uid}' ORDER BY domainname,local ASC");
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX