if EGroupware manages a mail server, allow setting an email address for groups

This commit is contained in:
Ralf Becker 2012-11-16 10:36:34 +00:00
parent b82f6516e8
commit 26de26873b

View File

@ -1205,14 +1205,25 @@
$p->set_var ('account_file_space', '<input type=text name="account_file_space_number" value="'.trim($file_space_array[0]).'" size="7">'); $p->set_var ('account_file_space', '<input type=text name="account_file_space_number" value="'.trim($file_space_array[0]).'" size="7">');
$p->set_var ('account_file_space_select','<select name="account_file_space_type">'."\n".$account_file_space_select.'</select>'."\n"); $p->set_var ('account_file_space_select','<select name="account_file_space_type">'."\n".$account_file_space_select.'</select>'."\n");
*/ */
// if EGroupware manages a mail server, allow setting an email address for groups
if ($group_repository['mailAllowed']) if ($group_repository['mailAllowed'] && $GLOBALS['egw_info']['apps']['emailadmin'] &&
$GLOBALS['egw_info']['apps']['felamimail'])
{
$emailadmin = new emailadmin_bo();
if (($default_profile_id = $emailadmin->getDefaultProfileID()))
{
$bofelamimail = felamimail_bo::getInstance(true, $default_profile_id);
$ogServer = $bofelamimail->mailPreferences->getOutgoingServer($default_profile_id);
//error_log(__METHOD__."() default_profile_id = $default_profile_id, get_class(ogServer)=".get_class($ogServer));
if (!in_array(get_class($ogServer), array('defaultsmtp', 'emailadmin_smtp')))
{ {
$p->set_var(array( $p->set_var(array(
'lang_email' => lang('Email'), 'lang_email' => lang('Email'),
'email' => html::input('account_email',$group_repository['account_email'],'',' style="width: 100%;"'), 'email' => html::input('account_email',$group_repository['account_email'],'',' style="width: 100%;"'),
)); ));
} }
}
}
$availableApps = $GLOBALS['egw_info']['apps']; $availableApps = $GLOBALS['egw_info']['apps'];
foreach($availableApps as $app => $data) foreach($availableApps as $app => $data)
{ {