<?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,
'quota' => config('vmail_basequota'),
'quota_threshold' => 20,
'forwards' => array(),
'autoresponder' => NULL
);
return $account;
}
function empty_autoresponder_config()
{
$ar = array(
'valid_from' => date( 'Y-m-d H:i:s' ),
'valid_until' => NULL,
'fromname' => NULL,
'fromaddr' => NULL,
'subject' => NULL,
'message' => 'Danke für Ihre E-Mail.
Ich bin aktuell nicht im Büro und werde Ihre Nachricht erst nach meiner Rückkehr beantworten.
Ihre E-Mail wird nicht weitergeleitet.',
'quote' => NULL
);
return $ar;
}
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, autoresponder, server, quota, COALESCE(quota_used, 0) AS quota_used, quota_threshold 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');