From 8e5b8f593709d8a535dd5d8bbb6e75fbbe27e5e8 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 12 Sep 2011 15:09:37 +0000 Subject: [PATCH] * emailadmin: is_a compatibility vs. php5.3.8 resolving to instanceof operator --- emailadmin/inc/class.ea_preferences.inc.php | 153 ++++++++++++++++++++ emailadmin/inc/class.emailadmin_bo.inc.php | 8 +- 2 files changed, 157 insertions(+), 4 deletions(-) create mode 100644 emailadmin/inc/class.ea_preferences.inc.php diff --git a/emailadmin/inc/class.ea_preferences.inc.php b/emailadmin/inc/class.ea_preferences.inc.php new file mode 100644 index 0000000000..2fc092cd63 --- /dev/null +++ b/emailadmin/inc/class.ea_preferences.inc.php @@ -0,0 +1,153 @@ +identities[$_id]; + } + else + { + return $this->identities; + } + } + + function getIncomingServer($_id = -1) + { + if($_id != -1) + { + return $this->ic_server[$_id]; + } + else + { + return $this->ic_server; + } + } + + function getOutgoingServer($_id = -1) + { + if($_id != -1) + { + return $this->og_server[$_id]; + } + else + { + return $this->og_server; + } + } + + function getPreferences() { + return $this->preferences; + } + + function getUserEMailAddresses() { + $identities = $this->getIdentity(); + + if(count($identities) == 0) { + return false; + } + + $userEMailAdresses = array(); + + foreach($identities as $identity) { + $userEMailAdresses[$identity->emailAddress] = $identity->realName; + } + + return $userEMailAdresses; + } + + function setIdentity($_identityObject, $_id = -1) + { + if(($_identityObject instanceof ea_identity)) + { + if($_id != -1) + { + $this->identities[$_id] = $_identityObject; + } + else + { + $this->identities[] = $_identityObject; + } + + return true; + } + + return false; + } + + function setIncomingServer($_serverObject, $_id = -1) + { + if(($_serverObject instanceof defaultimap)) + { + if($_id != -1) + { + $this->ic_server[$_id] = $_serverObject; + } + else + { + $this->ic_server[] = $_serverObject; + } + + return true; + } + + return false; + } + + function setOutgoingServer($_serverObject, $_id = -1) + { + if(($_serverObject instanceof defaultsmtp)) + { + if($_id != -1) + { + $this->og_server[$_id] = $_serverObject; + } + else + { + $this->og_server[] = $_serverObject; + } + + return true; + } + + return false; + } + + function setPreferences($_preferences) + { + $this->preferences = $_preferences; + + return true; + } + } +?> diff --git a/emailadmin/inc/class.emailadmin_bo.inc.php b/emailadmin/inc/class.emailadmin_bo.inc.php index 55e0584474..0cd019742d 100644 --- a/emailadmin/inc/class.emailadmin_bo.inc.php +++ b/emailadmin/inc/class.emailadmin_bo.inc.php @@ -604,12 +604,12 @@ if($userProfile = $this->getUserProfile('felamimail')) { $icServer = $userProfile->getIncomingServer(0); - if(is_a($icServer, 'defaultimap') && $username = $GLOBALS['egw']->accounts->id2name($_accountID)) { + if(($icServer instanceof defaultimap) && $username = $GLOBALS['egw']->accounts->id2name($_accountID)) { $icUserData = $icServer->getUserData($username); } $ogServer = $userProfile->getOutgoingServer(0); - if(is_a($ogServer, 'defaultsmtp')) { + if(($ogServer instanceof defaultsmtp)) { $ogUserData = $ogServer->getUserData($_accountID); } @@ -820,7 +820,7 @@ if($userProfile = $this->getUserProfile('felamimail')) { $ogServer = $userProfile->getOutgoingServer(0); - if(is_a($ogServer, 'defaultsmtp')) { + if(($ogServer instanceof defaultsmtp)) { $ogServer->setUserData($_accountID, (array)$_formData['mailAlternateAddress'], (array)$_formData['mailForwardingAddress'], @@ -831,7 +831,7 @@ } $icServer = $userProfile->getIncomingServer(0); - if(is_a($icServer, 'defaultimap') && $username = $GLOBALS['egw']->accounts->id2name($_accountID)) { + if(($icServer instanceof defaultimap) && $username = $GLOBALS['egw']->accounts->id2name($_accountID)) { $icServer->setUserData($username, $_formData['quotaLimit']); }