mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-11 16:38:52 +01:00
* eMail: is_a compatibility vs. php5.3.8 resolving to instanceof operator
This commit is contained in:
parent
711280c17e
commit
7b0942d998
@ -277,7 +277,7 @@
|
||||
{
|
||||
if ($this->mailPreferences) {
|
||||
$icServer = $this->mailPreferences->getIncomingServer(0);
|
||||
if(is_a($icServer,'defaultimap')) {
|
||||
if(($icServer instanceof defaultimap)) {
|
||||
// if not connected, try opening an admin connection
|
||||
if (!$icServer->_connected) $this->openConnection(0,true);
|
||||
$icServer->addAccount($_hookValues);
|
||||
@ -285,7 +285,7 @@
|
||||
}
|
||||
|
||||
$ogServer = $this->mailPreferences->getOutgoingServer(0);
|
||||
if(is_a($ogServer,'defaultsmtp')) {
|
||||
if(($ogServer instanceof defaultsmtp)) {
|
||||
$ogServer->addAccount($_hookValues);
|
||||
}
|
||||
}
|
||||
@ -599,7 +599,7 @@
|
||||
{
|
||||
if ($this->mailPreferences) {
|
||||
$icServer = $this->mailPreferences->getIncomingServer(0);
|
||||
if(is_a($icServer,'defaultimap')) {
|
||||
if(($icServer instanceof defaultimap)) {
|
||||
//try to connect with admin rights, when not connected
|
||||
if (!$icServer->_connected) $this->openConnection(0,true);
|
||||
$icServer->deleteAccount($_hookValues);
|
||||
@ -607,7 +607,7 @@
|
||||
}
|
||||
|
||||
$ogServer = $this->mailPreferences->getOutgoingServer(0);
|
||||
if(is_a($ogServer,'defaultsmtp')) {
|
||||
if(($ogServer instanceof defaultsmtp)) {
|
||||
$ogServer->deleteAccount($_hookValues);
|
||||
}
|
||||
}
|
||||
@ -1432,7 +1432,7 @@
|
||||
|
||||
// does the folder exist???
|
||||
$folderInfo = $this->icServer->getMailboxes('', $_folderName, true);
|
||||
if(is_a($folderInfo, 'PEAR_Error') || !is_array($folderInfo[0])) {
|
||||
if(($folderInfo instanceof PEAR_Error) || !is_array($folderInfo[0])) {
|
||||
if (self::$debug) error_log(__METHOD__." returned Info for folder $_folderName:".print_r($folderInfo->message,true));
|
||||
return false;
|
||||
}
|
||||
@ -2085,7 +2085,7 @@
|
||||
function getHierarchyDelimiter()
|
||||
{
|
||||
$HierarchyDelimiter = '/';
|
||||
if(is_a($this->icServer,'defaultimap'))
|
||||
if(($this->icServer instanceof defaultimap))
|
||||
{
|
||||
$HierarchyDelimiter = $this->icServer->getHierarchyDelimiter();
|
||||
if (PEAR::isError($HierarchyDelimiter)) $HierarchyDelimiter = '/';
|
||||
@ -2888,10 +2888,10 @@
|
||||
//try to connect
|
||||
if (!$this->icServer->_connected) $this->openConnection();
|
||||
}
|
||||
if(is_a($this->icServer,'defaultimap')) $folderInfo[$_folder] = $this->icServer->mailboxExist($_folder);
|
||||
if(($this->icServer instanceof defaultimap)) $folderInfo[$_folder] = $this->icServer->mailboxExist($_folder);
|
||||
//error_log(__METHOD__.__LINE__.' Folder Exists:'.$folderInfo[$_folder]);
|
||||
|
||||
if(is_a($folderInfo[$_folder], 'PEAR_Error') || $folderInfo[$_folder] !== true)
|
||||
if(($folderInfo[$_folder] instanceof PEAR_Error) || $folderInfo[$_folder] !== true)
|
||||
{
|
||||
return false;
|
||||
} else {
|
||||
@ -3077,12 +3077,12 @@
|
||||
function updateAccount($_hookValues)
|
||||
{
|
||||
if (is_object($this->mailPreferences)) $icServer = $this->mailPreferences->getIncomingServer(0);
|
||||
if(is_a($icServer,'defaultimap')) {
|
||||
if(($icServer instanceof defaultimap)) {
|
||||
$icServer->updateAccount($_hookValues);
|
||||
}
|
||||
|
||||
if (is_object($this->mailPreferences)) $ogServer = $this->mailPreferences->getOutgoingServer(0);
|
||||
if(is_a($ogServer,'defaultsmtp')) {
|
||||
if(($ogServer instanceof defaultsmtp)) {
|
||||
$ogServer->updateAccount($_hookValues);
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@
|
||||
self::saveSessionData();
|
||||
}
|
||||
//error_log(__METHOD__.print_r($this->sessionData,true));
|
||||
if (isset($this->sessionData['profileData']) && is_a($this->sessionData['profileData'],'ea_preferences')) {
|
||||
if (isset($this->sessionData['profileData']) && ($this->sessionData['profileData'] instanceof ea_preferences)) {
|
||||
$this->profileData = $this->sessionData['profileData'];
|
||||
}
|
||||
}
|
||||
@ -86,7 +86,7 @@
|
||||
function getAccountData(&$_profileData, $_accountID=NULL)
|
||||
{
|
||||
#echo "<p>backtrace: ".function_backtrace()."</p>\n";
|
||||
if(!is_a($_profileData, 'ea_preferences'))
|
||||
if(!($_profileData instanceof ea_preferences))
|
||||
die(__FILE__.': '.__LINE__);
|
||||
$accountData = parent::getAccountData($GLOBALS['egw_info']['user']['account_id'],$_accountID);
|
||||
|
||||
@ -136,7 +136,7 @@
|
||||
|
||||
function getAllAccountData(&$_profileData)
|
||||
{
|
||||
if(!is_a($_profileData, 'ea_preferences'))
|
||||
if(!($_profileData instanceof ea_preferences))
|
||||
die(__FILE__.': '.__LINE__);
|
||||
$AllAccountData = parent::getAccountData($GLOBALS['egw_info']['user']['account_id'],'all');
|
||||
#_debug_array($accountData);
|
||||
@ -185,7 +185,7 @@
|
||||
function getUserDefinedIdentities()
|
||||
{
|
||||
$profileData = $this->boemailadmin->getUserProfile('felamimail');
|
||||
if(!is_a($profileData, 'ea_preferences') || !is_a($profileData->ic_server[0], 'defaultimap')) {
|
||||
if(!($profileData instanceof ea_preferences) || !($profileData->ic_server[0] instanceof defaultimap)) {
|
||||
return false;
|
||||
}
|
||||
if($profileData->userDefinedAccounts || $profileData->userDefinedIdentities) {
|
||||
@ -204,14 +204,14 @@
|
||||
|
||||
function getPreferences($getUserDefinedProfiles=true)
|
||||
{
|
||||
if (isset($this->sessionData['profileData']) && is_a($this->sessionData['profileData'],'ea_preferences')) {
|
||||
if (isset($this->sessionData['profileData']) && ($this->sessionData['profileData'] instanceof ea_preferences)) {
|
||||
$this->profileData = $this->sessionData['profileData'];
|
||||
}
|
||||
if(!is_a($this->profileData,'ea_preferences')) {
|
||||
if(!($this->profileData instanceof ea_preferences)) {
|
||||
$imapServerTypes = $this->boemailadmin->getIMAPServerTypes();
|
||||
$profileData = $this->boemailadmin->getUserProfile('felamimail');
|
||||
|
||||
if(!is_a($profileData, 'ea_preferences') || !is_a($profileData->ic_server[0], 'defaultimap')) {
|
||||
if(!($profileData instanceof ea_preferences) || !($profileData->ic_server[0] instanceof defaultimap)) {
|
||||
return false;
|
||||
}
|
||||
if($profileData->userDefinedAccounts && $GLOBALS['egw_info']['user']['apps']['felamimail'] && $getUserDefinedProfiles) {
|
||||
@ -221,15 +221,15 @@
|
||||
if($accountData['active']) {
|
||||
|
||||
// replace the global defined IMAP Server
|
||||
if(is_a($accountData['icServer'],'defaultimap'))
|
||||
if(($accountData['icServer'] instanceof defaultimap))
|
||||
$profileData->setIncomingServer($accountData['icServer'],0);
|
||||
|
||||
// replace the global defined SMTP Server
|
||||
if(is_a($accountData['ogServer'],'defaultsmtp'))
|
||||
if(($accountData['ogServer'] instanceof defaultsmtp))
|
||||
$profileData->setOutgoingServer($accountData['ogServer'],0);
|
||||
|
||||
// replace the global defined identity
|
||||
if(is_a($accountData['identity'],'ea_identity')) {
|
||||
if(($accountData['identity'] instanceof ea_identity)) {
|
||||
//_debug_array($profileData);
|
||||
$rememberIdentities = $profileData->identities;
|
||||
$profileData->setIdentity($accountData['identity'],0);
|
||||
|
@ -719,7 +719,7 @@ class felamimail_hooks
|
||||
}
|
||||
|
||||
if (is_object($preferences)) $icServer = $preferences->getIncomingServer(0);
|
||||
if(is_a($icServer, 'defaultimap')) {
|
||||
if(($icServer instanceof defaultimap)) {
|
||||
if($icServer->enableSieve)
|
||||
{
|
||||
$linkData = array
|
||||
@ -748,7 +748,7 @@ class felamimail_hooks
|
||||
}
|
||||
|
||||
if (is_object($preferences)) $ogServer = $preferences->getOutgoingServer(0);
|
||||
if(is_a($ogServer, 'defaultsmtp')) {
|
||||
if(($ogServer instanceof defaultsmtp)) {
|
||||
if($ogServer->editForwardingAddress)
|
||||
{
|
||||
$linkData = array
|
||||
|
@ -546,7 +546,7 @@
|
||||
$refreshURL = $GLOBALS['egw']->link('/index.php',$linkData);
|
||||
$this->t->set_var('reloadView',$refreshURL);
|
||||
// display a warning if vacation notice is active
|
||||
if(is_a($imapServer,'defaultimap') && $imapServer->enableSieve) {
|
||||
if(($imapServer instanceof defaultimap) && $imapServer->enableSieve) {
|
||||
$imapServer->retrieveRules($imapServer->scriptName);
|
||||
$vacation = $imapServer->getVacation($imapServer->scriptName);
|
||||
//_debug_array($vacation);
|
||||
|
@ -123,7 +123,7 @@ require_once(EGW_INCLUDE_ROOT.'/felamimail/inc/class.felamimail_bosignatures.inc
|
||||
$mailPrefs = $this->bofelamimail->getMailPreferences();
|
||||
$ogServer = $mailPrefs->getOutgoingServer(0);
|
||||
|
||||
if(!is_a($ogServer, 'defaultsmtp') || !$ogServer->editForwardingAddress) {
|
||||
if(!($ogServer instanceof defaultsmtp) || !$ogServer->editForwardingAddress) {
|
||||
die('You should not be here!');
|
||||
}
|
||||
|
||||
|
@ -87,9 +87,9 @@
|
||||
|
||||
$icServer = $this->bofelamimail->icServer;
|
||||
|
||||
if(is_a($icServer,'defaultimap') && $icServer->enableSieve) {
|
||||
if(($icServer instanceof defaultimap) && $icServer->enableSieve) {
|
||||
$this->bosieve = $icServer;
|
||||
$this->timed_vacation = is_a($icServer,'cyrusimap') && $icServer->enableCyrusAdmin &&
|
||||
$this->timed_vacation = ($icServer instanceof cyrusimap) && $icServer->enableCyrusAdmin &&
|
||||
$icServer->adminUsername && $icServer->adminPassword;
|
||||
} else {
|
||||
die('Sieve not activated');
|
||||
@ -584,7 +584,7 @@
|
||||
$newVacation['status'] = get_var('vacationStatus',array('POST'));
|
||||
if (empty($preferences->preferences['prefpreventforwarding']) ||
|
||||
$preferences->preferences['prefpreventforwarding'] == 0 ) # ||
|
||||
#is_a($ogServer, 'defaultsmtp') || $ogServer->editForwardingAddress)
|
||||
#($ogServer instanceof defaultsmtp) || $ogServer->editForwardingAddress)
|
||||
{
|
||||
$newVacation['forwards'] = get_var('vacation_forwards',array('POST'));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user