2013-02-08 20:11:44 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* EGroupware - Mail - worker class
|
|
|
|
*
|
|
|
|
* @link http://www.egroupware.org
|
|
|
|
* @package mail
|
2013-10-24 09:15:48 +02:00
|
|
|
* @author Stylite AG [info@stylite.de]
|
2014-01-13 10:36:51 +01:00
|
|
|
* @copyright (c) 2013-2014 by Stylite AG <info-AT-stylite.de>
|
2013-02-08 20:11:44 +01:00
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
|
|
|
* @version $Id$
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Mail worker class
|
|
|
|
* -provides backend functionality for all classes in Mail
|
|
|
|
* -provides classes that may be used by other apps too
|
2013-11-10 21:53:51 +01:00
|
|
|
*
|
|
|
|
* @link https://github.com/horde/horde/blob/master/imp/lib/Contents.php
|
2013-02-08 20:11:44 +01:00
|
|
|
*/
|
2014-03-04 13:07:36 +01:00
|
|
|
class mail_bo extends emailadmin_imapbase
|
2013-02-08 20:11:44 +01:00
|
|
|
{
|
2013-09-05 16:52:11 +02:00
|
|
|
|
2013-02-19 17:30:59 +01:00
|
|
|
/**
|
|
|
|
* Hook stuff
|
|
|
|
*/
|
|
|
|
|
2013-02-08 20:11:44 +01:00
|
|
|
/**
|
|
|
|
* hook to add account
|
|
|
|
*
|
|
|
|
* this function is a wrapper function for emailadmin
|
|
|
|
*
|
|
|
|
* @param _hookValues contains the hook values as array
|
|
|
|
* @return nothing
|
|
|
|
*/
|
|
|
|
function addAccount($_hookValues)
|
|
|
|
{
|
2014-03-03 14:42:15 +01:00
|
|
|
error_log(__METHOD__.' ('.__LINE__.') '.' NOT DONE JET!');
|
2014-01-10 11:33:53 +01:00
|
|
|
//$_profile_id=????
|
|
|
|
//$icServer = emailadmin_account::read($_profile_id)->imapServer();
|
|
|
|
//$ogServer = emailadmin_account::read($_profile_id)->smtpServer();
|
2013-02-08 20:11:44 +01:00
|
|
|
|
2014-01-10 11:33:53 +01:00
|
|
|
/*
|
|
|
|
if(($icServer instanceof defaultimap)) {
|
|
|
|
// if not connected, try opening an admin connection
|
|
|
|
if (!$icServer->_connected) $this->openConnection($this->profileID,true);
|
|
|
|
$icServer->addAccount($_hookValues);
|
|
|
|
if ($icServer->_connected) $this->closeConnection(); // close connection afterwards
|
2013-02-08 20:11:44 +01:00
|
|
|
}
|
2014-01-10 11:33:53 +01:00
|
|
|
if(($ogServer instanceof emailadmin_smtp)) {
|
|
|
|
$ogServer->addAccount($_hookValues);
|
|
|
|
}
|
|
|
|
*/
|
2013-02-08 20:11:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* hook to delete account
|
|
|
|
*
|
|
|
|
* this function is a wrapper function for emailadmin
|
|
|
|
*
|
|
|
|
* @param _hookValues contains the hook values as array
|
|
|
|
* @return nothing
|
|
|
|
*/
|
|
|
|
function deleteAccount($_hookValues)
|
|
|
|
{
|
2014-03-03 14:42:15 +01:00
|
|
|
error_log(__METHOD__.' ('.__LINE__.') '.' NOT DONE JET!');
|
2014-01-10 11:33:53 +01:00
|
|
|
//$_profile_id=????
|
|
|
|
//$icServer = emailadmin_account::read($_profile_id)->imapServer();
|
|
|
|
//$ogServer = emailadmin_account::read($_profile_id)->smtpServer();
|
|
|
|
/*
|
|
|
|
if(($icServer instanceof defaultimap)) {
|
|
|
|
//try to connect with admin rights, when not connected
|
|
|
|
if (!$icServer->_connected) $this->openConnection($this->profileID,true);
|
|
|
|
$icServer->deleteAccount($_hookValues);
|
|
|
|
if ($icServer->_connected) $this->closeConnection(); // close connection
|
|
|
|
}
|
2013-02-08 20:11:44 +01:00
|
|
|
|
2014-01-10 11:33:53 +01:00
|
|
|
if(($ogServer instanceof emailadmin_smtp)) {
|
|
|
|
$ogServer->deleteAccount($_hookValues);
|
2013-02-08 20:11:44 +01:00
|
|
|
}
|
2014-01-10 11:33:53 +01:00
|
|
|
*/
|
2013-02-08 20:11:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* hook to update account
|
|
|
|
*
|
|
|
|
* this function is a wrapper function for emailadmin
|
|
|
|
*
|
|
|
|
* @param _hookValues contains the hook values as array
|
|
|
|
* @return nothing
|
|
|
|
*/
|
|
|
|
function updateAccount($_hookValues)
|
|
|
|
{
|
2014-03-03 14:42:15 +01:00
|
|
|
error_log(__METHOD__.' ('.__LINE__.') '.' NOT DONE JET!');
|
2014-01-10 11:33:53 +01:00
|
|
|
//$_profile_id=????
|
|
|
|
//$icServer = emailadmin_account::read($_profile_id)->imapServer();
|
|
|
|
//$ogServer = emailadmin_account::read($_profile_id)->smtpServer();
|
|
|
|
/*
|
2013-02-08 20:11:44 +01:00
|
|
|
if(($icServer instanceof defaultimap)) {
|
|
|
|
$icServer->updateAccount($_hookValues);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(($ogServer instanceof emailadmin_smtp)) {
|
|
|
|
$ogServer->updateAccount($_hookValues);
|
|
|
|
}
|
2014-01-10 11:33:53 +01:00
|
|
|
*/
|
2013-02-08 20:11:44 +01:00
|
|
|
}
|
|
|
|
}
|