diff --git a/admin/inc/class.boldap_mgr.inc.php b/admin/inc/class.boldap_mgr.inc.php
deleted file mode 100644
index 3633e68491..0000000000
--- a/admin/inc/class.boldap_mgr.inc.php
+++ /dev/null
@@ -1,388 +0,0 @@
- True,
- 'getLDAPStorageData' => True,
- 'getLocals' => True,
- 'getProfile' => True,
- 'getProfileList' => True,
- 'getRcptHosts' => True,
- 'getSMTPServerTypes' => True
- );
-
- function boldap_mgr($_profileID=-1)
- {
- $this->soldapmgr =& CreateObject('admin.soldap_mgr');
-
- $this->SMTPServerType = array(
- '1' => array(
- 'fieldNames' => array(
- 'smtpServer',
- 'smtpPort',
- 'smtpAuth',
- 'smtpType'
- ),
- 'description' => lang('standard SMTP-Server'),
- 'classname' => 'defaultsmtp'
- ),
- '2' => array(
- 'fieldNames' => array(
- 'smtpServer',
- 'smtpPort',
- 'smtpAuth',
- 'smtpType',
- 'smtpLDAPServer',
- 'smtpLDAPAdminDN',
- 'smtpLDAPAdminPW',
- 'smtpLDAPBaseDN',
- 'smtpLDAPUseDefault'
- ),
- 'description' => lang('Postfix with LDAP'),
- 'classname' => 'postfixldap'
- )
- );
-
- $this->IMAPServerType = array(
- '1' => array(
- 'fieldNames' => array(
- 'imapServer',
- 'imapPort',
- 'imapType',
- 'imapLoginType',
- 'imapTLSEncryption',
- 'imapTLSAuthentication',
- 'imapoldcclient'
- ),
- 'description' => lang('standard POP3 server'),
- 'protocol' => 'pop3',
- 'classname' => 'defaultpop'
- ),
- '2' => array(
- 'fieldNames' => array(
- 'imapServer',
- 'imapPort',
- 'imapType',
- 'imapLoginType',
- 'imapTLSEncryption',
- 'imapTLSAuthentication',
- 'imapoldcclient'
- ),
- 'description' => lang('standard IMAP server'),
- 'protocol' => 'imap',
- 'classname' => 'defaultimap'
- ),
- '3' => array(
- 'fieldNames' => array(
- 'imapServer',
- 'imapPort',
- 'imapType',
- 'imapLoginType',
- 'imapTLSEncryption',
- 'imapTLSAuthentication',
- 'imapoldcclient',
- 'imapEnableCyrusAdmin',
- 'imapAdminUsername',
- 'imapAdminPW',
- 'imapEnableSieve',
- 'imapSieveServer',
- 'imapSievePort'
- ),
- 'description' => lang('Cyrus IMAP Server'),
- 'protocol' => 'imap',
- 'classname' => 'cyrusimap'
- )
- );
-
- $this->restoreSessionData();
-
- if($_profileID >= 0)
- {
- $this->profileID = $_profileID;
-
- $this->profileData = $this->getProfile($_profileID);
-
- $this->imapClass = $this->IMAPServerType[$this->profileData['imapType']]['classname'];
- $this->smtpClass = $this->SMTPServerType[$this->profileData['smtpType']]['classname'];
- }
- }
-
- function encodeHeader($_string, $_encoding='q')
- {
- switch($_encoding)
- {
- case 'q':
- if(!preg_match("/[\x80-\xFF]/",$_string))
- {
- // nothing to quote, only 7 bit ascii
- return $_string;
- }
-
- $string = imap_8bit($_string);
- $stringParts = explode("=\r\n",$string);
- while(list($key,$value) = each($stringParts))
- {
- if(!empty($retString)) $retString .= ' ';
- $value = str_replace(' ','_',$value);
- // imap_8bit does not convert '?'
- // it does not need, but it should
- $value = str_replace("?","=3F",$value);
- $retString .= "=?".strtoupper($this->displayCharset)."?Q?".$value."?=";
- }
- #exit;
- return $retString;
- break;
- default:
- return $_string;
- }
- }
-
- function getAccountEmailAddress($_accountName, $_profileID)
- {
- $profileData = $this->getProfile($_profileID);
-
- $smtpClass = $this->SMTPServerType[$profileData['smtpType']]['classname'];
-
- return empty($smtpClass) ? False : ExecMethod("emailadmin.$smtpClass.getAccountEmailAddress",$_accountName,3,$profileData);
- }
-
- function getFieldNames($_serverTypeID, $_class)
- {
- switch($_class)
- {
- case 'imap':
- return $this->IMAPServerType[$_serverTypeID]['fieldNames'];
- break;
- case 'smtp':
- return $this->SMTPServerType[$_serverTypeID]['fieldNames'];
- break;
- }
- }
-
-# function getIMAPClass($_profileID)
-# {
-# if(!is_object($this->imapClass))
-# {
-# $profileData = $this->getProfile($_profileID);
-# $this->imapClass =& CreateObject('emailadmin.cyrusimap',$profileData);
-# }
-#
-# return $this->imapClass;
-# }
-
- function getIMAPServerTypes()
- {
- foreach($this->IMAPServerType as $key => $value)
- {
- $retData[$key]['description'] = $value['description'];
- $retData[$key]['protocol'] = $value['protocol'];
- }
-
- return $retData;
- }
-
- function getLDAPStorageData($_serverid)
- {
- $storageData = $this->soldapmgr->getLDAPStorageData($_serverid);
- return $storageData;
- }
-
- function getMailboxString($_folderName)
- {
- if (!empty($this->imapClass))
- {
- return ExecMethod('emailadmin.'.$this->imapClass.'.getMailboxString',$_folderName,3,$this->profileData);
- }
- else
- {
- return false;
- }
- }
-
- function getProfile($_profileID)
- {
- $profileData = $this->soldapmgr->getProfileList($_profileID);
- $fieldNames = $this->SMTPServerType[$profileData[0]['smtpType']]['fieldNames'];
- $fieldNames = array_merge($fieldNames, $this->IMAPServerType[$profileData[0]['imapType']]['fieldNames']);
- $fieldNames[] = 'description';
- $fieldNames[] = 'defaultDomain';
- $fieldNames[] = 'profileID';
- $fieldNames[] = 'organisationName';
- $fieldNames[] = 'userDefinedAccounts';
-
- return $this->soldapmgr->getProfile($_profileID, $fieldNames);
- }
-
- function getProfileList($_profileID='')
- {
- $profileList = $this->soldapmgr->getProfileList($_profileID);
- return $profileList;
- }
-
-# function getSMTPClass($_profileID)
-# {
-# if(!is_object($this->smtpClass))
-# {
-# $profileData = $this->getProfile($_profileID);
-# $this->smtpClass =& CreateObject('emailadmin.postfixldap',$profileData);
-# }
-#
-# return $this->smtpClass;
-# }
-
- function getSMTPServerTypes()
- {
- foreach($this->SMTPServerType as $key => $value)
- {
- $retData[$key] = $value['description'];
- }
-
- return $retData;
- }
-
- function getUserData($_accountID, $_usecache)
- {
- if ($_usecache)
- {
- $userData = $this->userSessionData[$_accountID];
- }
- else
- {
- $userData = $this->soldapmgr->getUserData($_accountID);
- $this->userSessionData[$_accountID] = $userData;
- $this->saveSessionData();
- }
- return $userData;
- }
-
- function restoreSessionData()
- {
- $this->sessionData = $GLOBALS['egw']->session->appsession('session_data');
- $this->userSessionData = $GLOBALS['egw']->session->appsession('user_session_data');
-
- #while(list($key, $value) = each($this->userSessionData))
- #{
- # print "++ $key: $value
";
- #}
- #print "restored Session
";
- }
-
- function saveProfile($_globalSettings, $_smtpSettings, $_imapSettings)
- {
- if(!isset($_globalSettings['profileID']))
- {
- $this->soldapmgr->addProfile($_globalSettings, $_smtpSettings, $_imapSettings);
- }
- else
- {
- $this->soldapmgr->updateProfile($_globalSettings, $_smtpSettings, $_imapSettings);
- }
- }
-
- function saveSessionData()
- {
- $GLOBALS['egw']->session->appsession('session_data','',$this->sessionData);
- $GLOBALS['egw']->session->appsession('user_session_data','',$this->userSessionData);
- }
-
- function saveUserData($_accountID, $_formData, $_boAction)
- {
- $this->userSessionData[$_accountID]['mail'] = $_formData['mail'];
- $this->userSessionData[$_accountID]['mailForwardingAddress'] = $_formData['mailForwardingAddress'];
- $this->userSessionData[$_accountID]['accountStatus'] = $_formData['accountStatus'];
-
- switch ($_boAction)
- {
- case 'add_mailAlternateAddress':
-
- if (is_array($this->userSessionData[$_accountID]['mailAlternateAddress']))
- {
- $count = count($this->userSessionData[$_accountID]['mailAlternateAddress']);
- }
- else
- {
-//ACHTUNG!!
- $count = 0;
- }
-
- $this->userSessionData[$_accountID]['mailAlternateAddress'][$count] =
- $_formData['add_mailAlternateAddress'];
-
- $this->saveSessionData();
-
- break;
-
- case 'remove_mailAlternateAddress':
- $i=0;
-
- while(list($key, $value) = @each($this->userSessionData[$_accountID]['mailAlternateAddress']))
- {
- #print ".. $key: $value
";
- if ($key != $_formData['remove_mailAlternateAddress'])
- {
- $newMailAlternateAddress[$i]=$value;
- #print "!! $i: $value
";
- $i++;
- }
- }
- $this->userSessionData[$_accountID]['mailAlternateAddress'] = $newMailAlternateAddress;
-
- $this->saveSessionData();
-
- break;
-
- case 'save':
- $this->soldapmgr->saveUserData(
- $_accountID,
- $this->userSessionData[$_accountID]
- );
- $bofelamimail =& CreateObject('felamimail.bofelamimail');
- $bofelamimail->openConnection('','',true);
- $bofelamimail->imapSetQuota(
- $GLOBALS['egw']->accounts->id2name($_accountID),
- $this->userSessionData[$_accountID]['quotaLimit']
- );
- $bofelamimail->closeConnection();
- $GLOBALS['egw']->accounts->cache_invalidate($_accountID);
-
- break;
- }
- }
-
- function updateAccount($_hookValues)
- {
- if (!empty($this->imapClass))
- {
- ExecMethod('emailadmin.'.$this->imapClass.'.updateAccount',$_hookValues,3,$this->profileData);
- }
-
- if (!empty($this->smtpClass))
- {
- ExecMethod('emailadmin.'.$this->smtpClass.'.updateAccount',$_hookValues,3,$this->profileData);
- }
- }
- }
-?>
diff --git a/admin/inc/class.soldap_mgr.inc.php b/admin/inc/class.soldap_mgr.inc.php
deleted file mode 100644
index d87189af06..0000000000
--- a/admin/inc/class.soldap_mgr.inc.php
+++ /dev/null
@@ -1,169 +0,0 @@
-db = clone($GLOBALS['egw']->db);
- include(EGW_INCLUDE_ROOT.'/emailadmin/setup/tables_current.inc.php');
- $this->tables = &$phpgw_baseline;
- unset($phpgw_baseline);
- $this->table = &$this->tables['phpgw_emailadmin'];
- }
-
- function getUserData($_accountID)
- {
- $ldap = $GLOBALS['egw']->common->ldapConnect();
- $filter = "(&(uidnumber=$_accountID))";
-
- $sri = @ldap_search($ldap,$GLOBALS['egw_info']['server']['ldap_context'],$filter);
- if ($sri)
- {
- $allValues = ldap_get_entries($ldap, $sri);
- if ($allValues['count'] > 0)
- {
- #print 'found something
';
- $userData['mail'] = $allValues[0]['mail'][0];
- $userData['mailAlternateAddress'] = $allValues[0]['mailalternateaddress'];
- $userData['accountStatus'] = $allValues[0]['accountstatus'][0];
- $userData['mailForwardingAddress'] = $allValues[0]['mailforwardingaddress'][0];
- $userData['deliveryMode'] = $allValues[0]['deliverymode'][0];
-
- unset($userData['mailAlternateAddress']['count']);
- unset($userData['mailForwardingAddress']['count']);
-
- return $userData;
- }
- }
-
- // if we did not return before, return false
- return false;
- }
-
- function saveUserData($_accountID, $_accountData)
- {
- $ldap = $GLOBALS['egw']->common->ldapConnect();
- // need to be fixed
- if(is_numeric($_accountID))
- {
- $filter = "uidnumber=$_accountID";
- }
- else
- {
- $filter = "uid=$_accountID";
- }
-
- $sri = @ldap_search($ldap,$GLOBALS['egw_info']['server']['ldap_context'],$filter);
- if ($sri)
- {
- $allValues = ldap_get_entries($ldap, $sri);
- $accountDN = $allValues[0]['dn'];
- $uid = $allValues[0]['uid'][0];
- $homedirectory = $allValues[0]['homedirectory'][0];
- $objectClasses = $allValues[0]['objectclass'];
-
- unset($objectClasses['count']);
- }
- else
- {
- return false;
- }
-
- if(empty($homedirectory))
- {
- $homedirectory = "/home/".$uid;
- }
-
- // the old code for qmail ldap
- $newData = array
- (
- 'mail' => $_accountData['mail'],
- 'mailAlternateAddress' => $_accountData['mailAlternateAddress'],
- 'mailForwardingAddress' => $_accountData['mailForwardingAddress'],
-// 'homedirectory' => $homedirectory,
-// 'mailMessageStore' => $homedirectory.'/Maildir/',
-// 'gidnumber' => '1000',
-// 'qmailDotMode' => $_accountData['qmailDotMode'],
-// 'deliveryProgramPath' => $_accountData['deliveryProgramPath']
- );
-
- if(!in_array('qmailUser',$objectClasses) &&
- !in_array('qmailuser',$objectClasses))
- {
- $objectClasses[] = 'qmailuser';
- }
-
- // the new code for postfix+cyrus+ldap
- $newData = array
- (
- 'mail' => $_accountData['mail'],
- 'accountStatus' => $_accountData['accountStatus'],
- 'objectclass' => $objectClasses
- );
-
- if(is_array($_accountData['mailAlternateAddress']))
- {
- $newData['mailAlternateAddress'] = $_accountData['mailAlternateAddress'];
- }
- else
- {
- $newData['mailAlternateAddress'] = array();
- }
-
- if($_accountData['accountStatus'] == 'active')
- {
- $newData['accountStatus'] = 'active';
- }
- else
- {
- $newData['accountStatus'] = 'disabled';
- }
-/*
- if(!empty($_accountData['deliveryMode']))
- {
- $newData['deliveryMode'] = $_accountData['deliveryMode'];
- }
- else
- {
- $newData['deliveryMode'] = array();
- }
-*/
-
-// if(is_array($_accountData['mailForwardingAddress']))
-// {
- $newData['mailForwardingAddress'] = $_accountData['mailForwardingAddress'];
-// }
-// else
-// {
-// $newData['mailForwardingAddress'] = array();
-// }
-
- #print "
DN: $accountDN
";
- ldap_mod_replace ($ldap, $accountDN, $newData);
-
- // also update the account_email field in egw_accounts
- // when using sql account storage
- if($GLOBALS['egw_info']['server']['account_repository'] == 'sql')
- {
- $this->db->update('egw_accounts',array(
- 'account_email' => $_accountData['mail']
- ),
- array(
- 'account_id' => $_accountID
- ),__LINE__,__FILE__
- );
- }
- }
- }
-?>
diff --git a/admin/inc/class.uildap_mgr.inc.php b/admin/inc/class.uildap_mgr.inc.php
deleted file mode 100644
index fc16e22ef6..0000000000
--- a/admin/inc/class.uildap_mgr.inc.php
+++ /dev/null
@@ -1,208 +0,0 @@
- True,
- 'saveUserData' => True
- );
-
- function uildap_mgr()
- {
- $this->t =& CreateObject('phpgwapi.Template',EGW_APP_TPL);
- $this->boldapmgr =& CreateObject('admin.boldap_mgr');
- }
-
- function display_app_header()
- {
- $GLOBALS['egw']->common->egw_header();
- echo parse_navbar();
- }
-
- function editUserData($_useCache='0')
- {
- $accountID = $_GET['account_id'];
- $GLOBALS['account_id'] = $accountID;
-
- $this->display_app_header();
-
- $this->translate();
-
- $this->t->set_file(array('editUserData' => 'account_form_ldapdata.tpl'));
- $this->t->set_block('editUserData','form','form');
- $this->t->set_block('editUserData','link_row','link_row');
- $this->t->set_var('th_bg',$GLOBALS['egw_info']['theme']['th_bg']);
- $this->t->set_var('tr_color1',$GLOBALS['egw_info']['theme']['row_on']);
- $this->t->set_var('tr_color2',$GLOBALS['egw_info']['theme']['row_off']);
-
- $this->t->set_var('lang_email_config',lang('edit email settings'));
- $this->t->set_var('lang_emailAddress',lang('email address'));
- $this->t->set_var('lang_emailaccount_active',lang('email account active'));
- $this->t->set_var('lang_mailAlternateAddress',lang('alternate email address'));
- $this->t->set_var('lang_mailForwardingAddress',lang('forward emails to'));
- $this->t->set_var('lang_forward_also_to',lang('forward also to'));
- $this->t->set_var('lang_button',lang('save'));
- $this->t->set_var('lang_deliver_extern',lang('deliver extern'));
- $this->t->set_var('lang_edit_email_settings',lang('edit email settings'));
- $this->t->set_var('lang_ready',lang('Done'));
- $this->t->set_var('link_back',$GLOBALS['egw']->link('/admin/accounts.php'));
- $this->t->set_var('info_icon',EGW_IMAGES_DIR.'/info.gif');
-
- $linkData = array
- (
- 'menuaction' => 'admin.uildap_mgr.saveUserData',
- 'account_id' => $accountID
- );
- $this->t->set_var('form_action', $GLOBALS['egw']->link('/index.php',$linkData));
-
- // only when we show a existing user
- if($userData = $this->boldapmgr->getUserData($accountID, $_useCache))
- {
- echo '
';
- if ($userData['mailAlternateAddress'] != '')
- {
- $options_mailAlternateAddress = '\n";
- }
- else
- {
- $options_mailAlternateAddress = lang('no alternate email address');
- }
-
- $this->t->set_var('mail',$userData['mail']);
- //$this->t->set_var('mailAlternateAddress',''); could be deleted?
-
- if ($userData['mailForwardingAddress'] == '')
- {
- $this->t->set_var('mailForwardingAddress',$userData['mail']);
- }
- else
- {
- $this->t->set_var('mailForwardingAddress',$userData['mailForwardingAddress']);
- }
-
- $this->t->set_var('options_mailAlternateAddress',$options_mailAlternateAddress);
-
- $this->t->set_var('uid',rawurlencode($_accountData['dn']));
- if ($userData['accountStatus'] == 'active')
- {
- $this->t->set_var('account_checked','checked');
- }
- if ($userData['deliveryMode'] == 'forwardOnly')
- {
- $this->t->set_var('forwardOnly_checked','checked');
- }
- if ($_accountData['deliverExtern'] == 'active')
- {
- $this->t->set_var('deliver_checked','checked');
- }
- }
- else
- {
- $this->t->set_var('mail','');
- $this->t->set_var('mailAlternateAddress','');
- $this->t->set_var('mailForwardingAddress','');
- $this->t->set_var('options_mailAlternateAddress',lang('no alternate email address'));
- $this->t->set_var('account_checked','');
- $this->t->set_var('forwardOnly_checked','');
- }
-
- // create the menu on the left, if needed
- $menuClass =& CreateObject('admin.uimenuclass');
- $this->t->set_var('rows',$menuClass->createHTMLCode('edit_user'));
-
- $this->t->pparse('out','form');
- }
-
- function saveUserData()
- {
- if($_POST['accountStatus'] == 'on')
- {
- $accountStatus = 'active';
- }
- if($_POST['forwardOnly'] == 'on')
- {
- $deliveryMode = 'forwardOnly';
- }
-
- $formData = array
- (
- 'mail' => $_POST['mail'],
- 'mailAlternateAddress' => $_POST['mailAlternateAddress'],
- 'mailForwardingAddress' => $_POST['mailForwardingAddress'],
- 'add_mailAlternateAddress' => $_POST['mailAlternateAddressInput'],
- 'remove_mailAlternateAddress' => $_POST['mailAlternateAddress'],
- 'accountStatus' => $accountStatus,
- 'deliveryMode' => $deliveryMode
- );
-
- //echo "
DebugArray in uiuserdata";
- // echo _debug_array($formData);
-
- if($_POST['add_mailAlternateAddress']) $bo_action='add_mailAlternateAddress';
- if($_POST['remove_mailAlternateAddress']) $bo_action='remove_mailAlternateAddress';
- if($_POST['save']) $bo_action='save';
-
- if (!$_POST['mail'] == '') //attribute 'mail'is not allowed to be empty
- {
-// error generator necessary!!
- $this->boldapmgr->saveUserData($_GET['account_id'], $formData, $bo_action);
- }
- if ($bo_action == 'save')
- {
- // read date fresh from ldap storage
- $this->editUserData();
- }
- else
- {
- // use cached data
- $this->editUserData('1');
- }
- }
-
- function translate()
- {
- $this->t->set_var('th_bg',$GLOBALS['egw_info']['theme']['th_bg']);
-
- $this->t->set_var('lang_add',lang('add'));
- $this->t->set_var('lang_done',lang('Done'));
- $this->t->set_var('lang_remove',lang('remove'));
- $this->t->set_var('lang_remove',lang('remove'));
- $this->t->set_var('lang_advanced_options',lang('advanced options'));
- $this->t->set_var('lang_qmaildotmode',lang('qmaildotmode'));
- $this->t->set_var('lang_default',lang('default'));
- $this->t->set_var('lang_quota_settings',lang('quota settings'));
- $this->t->set_var('lang_quotainmbyte',lang('quota size in MByte'));
- $this->t->set_var('lang_inmbyte',lang('in MByte'));
- $this->t->set_var('lang_0forunlimited',lang('leave empty for no quota'));
- $this->t->set_var('lang_forward_only',lang('forward only'));
- $this->t->set_var('lang_mailAliases',lang('Aliases'));
- $this->t->set_var('lang_info_mailAliases',lang('Attribute mailAlternateAddress explained'));
- $this->t->set_var('lang_masterEmailAddress',lang('Main Email-Address'));
- $this->t->set_var('lang_info_masterEmailAddress',lang('Attribute mail explained'));
- $this->t->set_var('lang_RouteMailsTo',lang('Route all Mails to'));
- $this->t->set_var('lang_info_RouteMailsTo',lang('Attribute mailForwardingAddress explained'));
- $this->t->set_var('lang_info_AccountActive',lang('Attribute accountstatus explained'));
- $this->t->set_var('lang_info_UsageHints',lang('Explanation of LDAPMAN'));
- }
- }
-?>