mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-05-31 23:36:07 +02:00
reflect on thrown out preferences for folder settings; disable non working code in updateAccount, addAccount and deleteAccount hook-functions, and prepare for new account object
This commit is contained in:
parent
a64da9f456
commit
bf09e9e46f
@ -342,7 +342,6 @@ class mail_bo
|
|||||||
{
|
{
|
||||||
$mail = mail_bo::getInstance(false, $_profile_id,false);
|
$mail = mail_bo::getInstance(false, $_profile_id,false);
|
||||||
//_debug_array( $_profile_id);
|
//_debug_array( $_profile_id);
|
||||||
//$mail->mailPreferences = $mail->bopreferences->getPreferences($_profile_id,1);
|
|
||||||
$mail->icServer = emailadmin_account::read($_profile_id)->imapServer();
|
$mail->icServer = emailadmin_account::read($_profile_id)->imapServer();
|
||||||
$mail->ogServer = emailadmin_account::read($_profile_id)->smtpServer();
|
$mail->ogServer = emailadmin_account::read($_profile_id)->smtpServer();
|
||||||
return $mail;
|
return $mail;
|
||||||
@ -2066,7 +2065,8 @@ class mail_bo
|
|||||||
$createfolder=false;
|
$createfolder=false;
|
||||||
break;
|
break;
|
||||||
case 'Junk': //] => Spammails
|
case 'Junk': //] => Spammails
|
||||||
if ($this->mailPreferences['junkFolder'] && $this->mailPreferences['junkFolder']=='none')
|
$junkFolder = $this->getJunkFolder();
|
||||||
|
if ($junkFolder && $junkFolder=='none')
|
||||||
$createfolder=false;
|
$createfolder=false;
|
||||||
break;
|
break;
|
||||||
case 'Sent': //] => Gesendet
|
case 'Sent': //] => Gesendet
|
||||||
@ -2342,6 +2342,7 @@ class mail_bo
|
|||||||
'Template'=>array('prefName'=>'templateFolder','profileKey'=>'acc_folder_template','autoFolderName'=>'Templates'),
|
'Template'=>array('prefName'=>'templateFolder','profileKey'=>'acc_folder_template','autoFolderName'=>'Templates'),
|
||||||
'Trash'=>array('prefName'=>'trashFolder','profileKey'=>'acc_folder_trash','autoFolderName'=>'Trash'),
|
'Trash'=>array('prefName'=>'trashFolder','profileKey'=>'acc_folder_trash','autoFolderName'=>'Trash'),
|
||||||
'Sent'=>array('prefName'=>'sentFolder','profileKey'=>'acc_folder_sent','autoFolderName'=>'Sent'),
|
'Sent'=>array('prefName'=>'sentFolder','profileKey'=>'acc_folder_sent','autoFolderName'=>'Sent'),
|
||||||
|
'Junk'=>array('prefName'=>'junkFolder','profileKey'=>'acc_folder_junk','autoFolderName'=>'Junk'),
|
||||||
);
|
);
|
||||||
if (!isset($types[$_type]))
|
if (!isset($types[$_type]))
|
||||||
{
|
{
|
||||||
@ -2352,8 +2353,9 @@ class mail_bo
|
|||||||
|
|
||||||
//highest precedence
|
//highest precedence
|
||||||
$_folderName = $this->icServer->$types[$_type]['profileKey'];
|
$_folderName = $this->icServer->$types[$_type]['profileKey'];
|
||||||
|
// No folder Prefs any more
|
||||||
//check prefs next
|
//check prefs next
|
||||||
if (empty($_folderName)) $_folderName = $this->mailPreferences[$types[$_type]['prefName']];
|
//if (empty($_folderName)) $_folderName = $this->mailPreferences[$types[$_type]['prefName']];
|
||||||
// does the folder exist???
|
// does the folder exist???
|
||||||
if ($_checkexistance && $_folderName !='none' && !self::folderExists($_folderName)) {
|
if ($_checkexistance && $_folderName !='none' && !self::folderExists($_folderName)) {
|
||||||
$_folderName = false;
|
$_folderName = false;
|
||||||
@ -2371,6 +2373,16 @@ class mail_bo
|
|||||||
return $_folderName;
|
return $_folderName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getDraftFolder wrapper for _getSpecialUseFolder Type Drafts
|
||||||
|
* @param boolean $_checkexistance, trigger check for existance
|
||||||
|
* @return mixed string or false
|
||||||
|
*/
|
||||||
|
function getJunkFolder($_checkexistance=TRUE)
|
||||||
|
{
|
||||||
|
return $this->_getSpecialUseFolder('Junk', $_checkexistance);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getDraftFolder wrapper for _getSpecialUseFolder Type Drafts
|
* getDraftFolder wrapper for _getSpecialUseFolder Type Drafts
|
||||||
* @param boolean $_checkexistance, trigger check for existance
|
* @param boolean $_checkexistance, trigger check for existance
|
||||||
@ -5954,20 +5966,22 @@ class mail_bo
|
|||||||
*/
|
*/
|
||||||
function addAccount($_hookValues)
|
function addAccount($_hookValues)
|
||||||
{
|
{
|
||||||
if ($this->mailPreferences) {
|
error_log(__METHOD__.__LINE__.' NOT DONE JET!');
|
||||||
$icServer = $this->mailPreferences->getIncomingServer($this->profileID);
|
//$_profile_id=????
|
||||||
if(($icServer instanceof defaultimap)) {
|
//$icServer = emailadmin_account::read($_profile_id)->imapServer();
|
||||||
// if not connected, try opening an admin connection
|
//$ogServer = emailadmin_account::read($_profile_id)->smtpServer();
|
||||||
if (!$icServer->_connected) $this->openConnection($this->profileID,true);
|
|
||||||
$icServer->addAccount($_hookValues);
|
|
||||||
if ($icServer->_connected) $this->closeConnection(); // close connection afterwards
|
|
||||||
}
|
|
||||||
|
|
||||||
$ogServer = $this->mailPreferences->getOutgoingServer($this->profileID);
|
/*
|
||||||
if(($ogServer instanceof emailadmin_smtp)) {
|
if(($icServer instanceof defaultimap)) {
|
||||||
$ogServer->addAccount($_hookValues);
|
// 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);
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -5980,20 +5994,22 @@ class mail_bo
|
|||||||
*/
|
*/
|
||||||
function deleteAccount($_hookValues)
|
function deleteAccount($_hookValues)
|
||||||
{
|
{
|
||||||
if ($this->mailPreferences) {
|
error_log(__METHOD__.__LINE__.' NOT DONE JET!');
|
||||||
$icServer = $this->mailPreferences->getIncomingServer($this->profileID);
|
//$_profile_id=????
|
||||||
if(($icServer instanceof defaultimap)) {
|
//$icServer = emailadmin_account::read($_profile_id)->imapServer();
|
||||||
//try to connect with admin rights, when not connected
|
//$ogServer = emailadmin_account::read($_profile_id)->smtpServer();
|
||||||
if (!$icServer->_connected) $this->openConnection($this->profileID,true);
|
/*
|
||||||
$icServer->deleteAccount($_hookValues);
|
if(($icServer instanceof defaultimap)) {
|
||||||
if ($icServer->_connected) $this->closeConnection(); // close connection
|
//try to connect with admin rights, when not connected
|
||||||
}
|
if (!$icServer->_connected) $this->openConnection($this->profileID,true);
|
||||||
|
$icServer->deleteAccount($_hookValues);
|
||||||
$ogServer = $this->mailPreferences->getOutgoingServer($this->profileID);
|
if ($icServer->_connected) $this->closeConnection(); // close connection
|
||||||
if(($ogServer instanceof emailadmin_smtp)) {
|
|
||||||
$ogServer->deleteAccount($_hookValues);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(($ogServer instanceof emailadmin_smtp)) {
|
||||||
|
$ogServer->deleteAccount($_hookValues);
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -6006,14 +6022,18 @@ class mail_bo
|
|||||||
*/
|
*/
|
||||||
function updateAccount($_hookValues)
|
function updateAccount($_hookValues)
|
||||||
{
|
{
|
||||||
if (is_object($this->mailPreferences)) $icServer = $this->mailPreferences->getIncomingServer(0);
|
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(($icServer instanceof defaultimap)) {
|
||||||
$icServer->updateAccount($_hookValues);
|
$icServer->updateAccount($_hookValues);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_object($this->mailPreferences)) $ogServer = $this->mailPreferences->getOutgoingServer(0);
|
|
||||||
if(($ogServer instanceof emailadmin_smtp)) {
|
if(($ogServer instanceof emailadmin_smtp)) {
|
||||||
$ogServer->updateAccount($_hookValues);
|
$ogServer->updateAccount($_hookValues);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user