fixed PHP Fatal error no method emailadmin_imapbase::accountHooks stalling account saving

This commit is contained in:
Ralf Becker 2014-03-18 09:04:29 +00:00
parent b0db615411
commit e60bc19f6f
3 changed files with 1 additions and 115 deletions

View File

@ -20,88 +20,4 @@
class mail_bo extends emailadmin_imapbase
{
/**
* Hook stuff
*/
/**
* 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)
{
error_log(__METHOD__.' ('.__LINE__.') '.' NOT DONE JET!');
//$_profile_id=????
//$icServer = emailadmin_account::read($_profile_id)->imapServer();
//$ogServer = emailadmin_account::read($_profile_id)->smtpServer();
/*
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
}
if(($ogServer instanceof emailadmin_smtp)) {
$ogServer->addAccount($_hookValues);
}
*/
}
/**
* 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)
{
error_log(__METHOD__.' ('.__LINE__.') '.' NOT DONE JET!');
//$_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
}
if(($ogServer instanceof emailadmin_smtp)) {
$ogServer->deleteAccount($_hookValues);
}
*/
}
/**
* 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)
{
error_log(__METHOD__.' ('.__LINE__.') '.' NOT DONE JET!');
//$_profile_id=????
//$icServer = emailadmin_account::read($_profile_id)->imapServer();
//$ogServer = emailadmin_account::read($_profile_id)->smtpServer();
/*
if(($icServer instanceof defaultimap)) {
$icServer->updateAccount($_hookValues);
}
if(($ogServer instanceof emailadmin_smtp)) {
$ogServer->updateAccount($_hookValues);
}
*/
}
}

View File

@ -15,33 +15,6 @@
*/
class mail_hooks
{
/**
* Several hooks calling an instanciated mail_bo, which need to use the mail_bo::getInstance() singelton
*
* @param string|array $hookData
*/
static public function accountHooks($hookData)
{
if (($default_profile_id = emailadmin_bo::getDefaultAccID()))
{
$mail_bo = mail_bo::forceEAProfileLoad($default_profile_id);
switch(is_array($hookData) ? $hookData['location'] : $hookData)
{
case 'addaccount':
$mail_bo->addAccount($hookData);
break;
case 'deleteaccount':
$mail_bo->deleteAccount($hookData);
break;
case 'editaccount':
$mail_bo->updateAccount($hookData);
break;
}
emailadmin_bo::unsetCachedObjects($default_profile_id);
}
}
/**
* Menu for Admin >> Edit accounts
*/

View File

@ -28,9 +28,6 @@ $setup_info['mail']['maintainer_email'] = 'info@stylite.de';
$setup_info['mail']['tables'] = array(); // former felamimail tables are used by mail_sopreferences
/* The hooks this app includes, needed for hooks registration */
$setup_info['mail']['hooks']['addaccount'] = 'mail_hooks::accountHooks';
$setup_info['mail']['hooks']['deleteaccount'] = 'mail_hooks::accountHooks';
$setup_info['mail']['hooks']['editaccount'] = 'mail_hooks::accountHooks';
$setup_info['mail']['hooks']['search_link'] = 'mail_hooks::search_link';
$setup_info['mail']['hooks']['admin'] = 'mail_hooks::admin';
$setup_info['mail']['hooks']['settings'] = 'mail_hooks::settings';