Commit f92de226 authored by tbrehm's avatar tbrehm
Browse files

Implemented: FS#983 - Make webmail and phpmyadmin link configurable

parent 05b8eaad
......@@ -8,6 +8,7 @@
[mail]
mailboxlist_webmail_link=y
webmail_url=
[monitor]
......@@ -17,5 +18,6 @@ dbuser_prefix=c[CLIENTID]
ftpuser_prefix=[CLIENTNAME]
shelluser_prefix=[CLIENTNAME]
dblist_phpmyadmin_link=y
phpmyadmin_url=
[tools]
\ No newline at end of file
......@@ -112,6 +112,18 @@ $form["tabs"]['sites'] = array (
'default' => 'n',
'value' => array(0 => 'n',1 => 'y')
),
'phpmyadmin_url' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX',
'regex' => '/^[0-9a-zA-Z\:\/\-]{0,255}$/',
'errmsg'=> 'phpmyadmin_url_error_regex'),
),
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
),
##################################
# ENDE Datatable fields
##################################
......@@ -132,6 +144,18 @@ $form["tabs"]['mail'] = array (
'default' => 'n',
'value' => array(0 => 'n',1 => 'y')
),
'webmail_url' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX',
'regex' => '/^[0-9a-zA-Z\:\/\-]{0,255}$/',
'errmsg'=> 'webmail_url_error_regex'),
),
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
),
##################################
# ENDE Datatable fields
##################################
......
......@@ -11,5 +11,7 @@ $wb['ftpuser_prefix_error_regex'] = 'Char not allowed in ftp user prefix.';
$wb['shelluser_prefix_error_regex'] = 'Char not allowed in shell user prefix.';
$wb['dblist_phpmyadmin_link_txt'] = 'Link to phpmyadmin in DB list';
$wb['mailboxlist_webmail_link_txt'] = 'Link to webmail in Mailbox list';
$wb['webmail_url_txt'] = 'Webmail URL';
$wb['phpmyadmin_url_txt'] = 'PHPMyAdmin URL';
?>
\ No newline at end of file
<h2><tmpl_var name="list_head_txt"></h2>
<p><tmpl_var name="list_desc_txt"></p>
<div class="panel panel_system_config">
<div class="pnl_formsarea">
<fieldset class="inlineLabels">
<div class="ctrlHolder">
<p class="label">{tmpl_var name='mailboxlist_webmail_link_txt'}</p>
<div class="multiField">
{tmpl_var name='mailboxlist_webmail_link'}
</div>
</div>
</fieldset>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<div class="buttonHolder buttons">
<button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','admin/system_config_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button>
<button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('admin/users_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
</div>
</div>
</div>
<h2><tmpl_var name="list_head_txt"></h2>
<p><tmpl_var name="list_desc_txt"></p>
<div class="panel panel_system_config">
<div class="pnl_formsarea">
<fieldset class="inlineLabels">
<div class="ctrlHolder">
<p class="label">{tmpl_var name='mailboxlist_webmail_link_txt'}</p>
<div class="multiField">
{tmpl_var name='mailboxlist_webmail_link'}
</div>
</div>
<div class="ctrlHolder">
<label for="webmail_url">{tmpl_var name='webmail_url_txt'}</label>
<input name="webmail_url" id="webmail_url" value="{tmpl_var name='webmail_url'}" size="30" maxlength="255" type="text" class="textInput" />
</div>
</fieldset>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<div class="buttonHolder buttons">
<button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','admin/system_config_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button>
<button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('admin/users_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
</div>
</div>
</div>
<h2><tmpl_var name="list_head_txt"></h2>
<p><tmpl_var name="list_desc_txt"></p>
<div class="panel panel_system_config">
<div class="pnl_formsarea">
<fieldset class="inlineLabels">
<div class="ctrlHolder">
<label for="dbname_prefix">{tmpl_var name='dbname_prefix_txt'}</label>
<input name="dbname_prefix" id="dbname_prefix" value="{tmpl_var name='dbname_prefix'}" size="30" maxlength="255" type="text" class="textInput formLengthHalf" />
</div>
<div class="ctrlHolder">
<label for="dbuser_prefix">{tmpl_var name='dbuser_prefix_txt'}</label>
<input name="dbuser_prefix" id="dbuser_prefix" value="{tmpl_var name='dbuser_prefix'}" size="30" maxlength="255" type="text" class="textInput formLengthHalf" />
</div>
<div class="ctrlHolder">
<label for="ftpuser_prefix">{tmpl_var name='ftpuser_prefix_txt'}</label>
<input name="ftpuser_prefix" id="ftpuser_prefix" value="{tmpl_var name='ftpuser_prefix'}" size="30" maxlength="255" type="text" class="textInput formLengthHalf" />
</div>
<div class="ctrlHolder">
<label for="shelluser_prefix">{tmpl_var name='shelluser_prefix_txt'}</label>
<input name="shelluser_prefix" id="shelluser_prefix" value="{tmpl_var name='shelluser_prefix'}" size="30" maxlength="255" type="text" class="textInput formLengthHalf" />
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='dblist_phpmyadmin_link_txt'}</p>
<div class="multiField">
{tmpl_var name='dblist_phpmyadmin_link'}
</div>
</div>
</fieldset>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<div class="buttonHolder buttons">
<button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','admin/system_config_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button>
<button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('admin/users_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
</div>
</div>
</div>
<h2><tmpl_var name="list_head_txt"></h2>
<p><tmpl_var name="list_desc_txt"></p>
<div class="panel panel_system_config">
<div class="pnl_formsarea">
<fieldset class="inlineLabels">
<div class="ctrlHolder">
<label for="dbname_prefix">{tmpl_var name='dbname_prefix_txt'}</label>
<input name="dbname_prefix" id="dbname_prefix" value="{tmpl_var name='dbname_prefix'}" size="30" maxlength="255" type="text" class="textInput formLengthHalf" />
</div>
<div class="ctrlHolder">
<label for="dbuser_prefix">{tmpl_var name='dbuser_prefix_txt'}</label>
<input name="dbuser_prefix" id="dbuser_prefix" value="{tmpl_var name='dbuser_prefix'}" size="30" maxlength="255" type="text" class="textInput formLengthHalf" />
</div>
<div class="ctrlHolder">
<label for="ftpuser_prefix">{tmpl_var name='ftpuser_prefix_txt'}</label>
<input name="ftpuser_prefix" id="ftpuser_prefix" value="{tmpl_var name='ftpuser_prefix'}" size="30" maxlength="255" type="text" class="textInput formLengthHalf" />
</div>
<div class="ctrlHolder">
<label for="shelluser_prefix">{tmpl_var name='shelluser_prefix_txt'}</label>
<input name="shelluser_prefix" id="shelluser_prefix" value="{tmpl_var name='shelluser_prefix'}" size="30" maxlength="255" type="text" class="textInput formLengthHalf" />
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='dblist_phpmyadmin_link_txt'}</p>
<div class="multiField">
{tmpl_var name='dblist_phpmyadmin_link'}
</div>
</div>
<div class="ctrlHolder">
<label for="phpmyadmin_url">{tmpl_var name='phpmyadmin_url_txt'}</label>
<input name="phpmyadmin_url" id="phpmyadmin_url" value="{tmpl_var name='phpmyadmin_url'}" size="30" maxlength="255" type="text" class="textInput" />
</div>
</fieldset>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<div class="buttonHolder buttons">
<button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','admin/system_config_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button>
<button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('admin/users_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
</div>
</div>
</div>
......@@ -49,14 +49,20 @@ if ($serverId == 0){
die ("No E-Mail - Server found!");
}
$serverData = $app->db->queryOneRecord(
"SELECT server_name FROM server WHERE server_id = " .
$serverId);
$serverData = $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = ".$serverId);
$app->uses('getconf');
$global_config = $app->getconf->get_global_config('mail');
if($global_config['webmail_url'] != '') {
header('Location:' . $global_config['webmail_url']);
} else {
/*
* We only redirect to the login-form, so there is no need, to check any rights
*/
isset($_SERVER['HTTPS'])? $http = 'https' : $http = 'http';
header('location:' . $http . '://' . $serverData['server_name'] . '/webmail');
isset($_SERVER['HTTPS'])? $http = 'https' : $http = 'http';
header('Location:' . $http . '://' . $serverData['server_name'] . '/webmail');
}
exit;
?>
\ No newline at end of file
......@@ -53,11 +53,18 @@ if ($serverId == 0){
$serverData = $app->db->queryOneRecord(
"SELECT server_name FROM server WHERE server_id = " .
$serverId);
$app->uses('getconf');
$global_config = $app->getconf->get_global_config('sites');
/*
* We only redirect to the login-form, so there is no need, to check any rights
*/
isset($_SERVER['HTTPS'])? $http = 'https' : $http = 'http';
header('location:' . $http . '://' . $serverData['server_name'] . '/phpmyadmin');
if($global_config['phpmyadmin_url'] != '') {
header('Location:'.$global_config['phpmyadmin_url']);
} else {
isset($_SERVER['HTTPS'])? $http = 'https' : $http = 'http';
header('location:' . $http . '://' . $serverData['server_name'] . '/phpmyadmin');
}
exit;
?>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment