mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 16:49:10 +01:00
* emailadmin: is_a compatibility vs. php5.3.8 resolving to instanceof operator
This commit is contained in:
parent
c75e19cd6b
commit
8e5b8f5937
153
emailadmin/inc/class.ea_preferences.inc.php
Normal file
153
emailadmin/inc/class.ea_preferences.inc.php
Normal file
@ -0,0 +1,153 @@
|
||||
<?php
|
||||
/***************************************************************************\
|
||||
* eGroupWare - EMailAdmin *
|
||||
* http://www.egroupware.org *
|
||||
* Written by : Lars Kneschke [lkneschke@egrouware.org] *
|
||||
* ------------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; version 2 of the License. *
|
||||
\***************************************************************************/
|
||||
/* $Id: class.bopreferences.inc.php,v 1.26 2005/11/28 18:00:18 lkneschke Exp $ */
|
||||
|
||||
class ea_preferences
|
||||
{
|
||||
// users identities
|
||||
var $identities = array();
|
||||
|
||||
// users incoming server(imap/pop3)
|
||||
var $ic_server = array();
|
||||
|
||||
// users outgoing server(smtp)
|
||||
var $og_server = array();
|
||||
|
||||
// users preferences
|
||||
var $preferences = array();
|
||||
|
||||
// enable userdefined accounts
|
||||
var $userDefinedAccounts = false;
|
||||
|
||||
// enable userdefined signatures
|
||||
var $ea_user_defined_signatures = false;
|
||||
|
||||
function getIdentity($_id = -1)
|
||||
{
|
||||
if($_id != -1)
|
||||
{
|
||||
return $this->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;
|
||||
}
|
||||
}
|
||||
?>
|
@ -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']);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user