egroupware_official/emailadmin/inc/class.defaultsmtp.inc.php

98 lines
2.5 KiB
PHP
Raw Normal View History

2011-07-01 12:37:47 +02:00
<?php
/***************************************************************************\
* EGroupWare - EMailAdmin *
* http://www.egroupware.org *
* Written by : Lars Kneschke [lkneschke@linux-at-work.de] *
* ------------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\***************************************************************************/
/* $Id$ */
class defaultsmtp
{
/**
* Capabilities of this class (pipe-separated): default, forward
*/
const CAPABILITIES = 'default';
/**
* SmtpServerId
*
2011-07-01 12:37:47 +02:00
* @var int
*/
var $SmtpServerId;
var $smtpAuth = false;
var $editForwardingAddress = false;
2011-07-01 12:37:47 +02:00
var $host;
2011-07-01 12:37:47 +02:00
var $port;
2011-07-01 12:37:47 +02:00
var $username;
2011-07-01 12:37:47 +02:00
var $password;
2011-07-01 12:37:47 +02:00
var $defaultDomain;
2011-07-01 12:37:47 +02:00
// the constructor
function defaultsmtp($defaultDomain=null)
{
$this->defaultDomain = $defaultDomain ? $defaultDomain : $GLOBALS['egw_info']['server']['mail_suffix'];
}
2011-07-01 12:37:47 +02:00
// add a account
function addAccount($_hookValues)
{
return true;
}
2011-07-01 12:37:47 +02:00
// delete a account
function deleteAccount($_hookValues)
{
return true;
}
2011-07-01 12:37:47 +02:00
function getAccountEmailAddress($_accountName)
{
$accountID = $GLOBALS['egw']->accounts->name2id($_accountName);
$emailAddress = $GLOBALS['egw']->accounts->id2name($accountID,'account_email');
if(empty($emailAddress))
$emailAddress = $_accountName.'@'.$this->defaultDomain;
$realName = trim($GLOBALS['egw_info']['user']['account_firstname'] . (!empty($GLOBALS['egw_info']['user']['account_firstname']) ? ' ' : '') . $GLOBALS['egw_info']['user']['account_lastname']);
2011-07-01 12:37:47 +02:00
return array(
array(
'name' => $realName,
'address' => $emailAddress,
2011-07-01 12:37:47 +02:00
'type' => 'default'
)
);
}
function getUserData($_uidnumber) {
$userData = array();
2011-07-01 12:37:47 +02:00
return $userData;
}
function saveSMTPForwarding($_accountID, $_forwardingAddress, $_keepLocalCopy) {
return true;
}
function setUserData($_uidnumber, $_mailAlternateAddress, $_mailForwardingAddress, $_deliveryMode) {
return true;
}
2011-07-01 12:37:47 +02:00
// update a account
function updateAccount($_hookValues) {
return true;
}
}
?>