tbrehm
2009-11-19 f92de226be118b700f391264ea73fd4a7a090da1
Implemented: FS#983 - Make webmail and phpmyadmin link configurable
7 files modified
57 ■■■■■ changed files
install/tpl/system.ini.master 2 ●●●●● patch | view | raw | blame | history
interface/web/admin/form/system_config.tform.php 24 ●●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/en_system_config.lng 2 ●●●●● patch | view | raw | blame | history
interface/web/admin/templates/system_config_mail_edit.htm 4 ●●●● patch | view | raw | blame | history
interface/web/admin/templates/system_config_sites_edit.htm 4 ●●●● patch | view | raw | blame | history
interface/web/mail/webmailer.php 14 ●●●● patch | view | raw | blame | history
interface/web/sites/database_phpmyadmin.php 7 ●●●●● patch | view | raw | blame | history
install/tpl/system.ini.master
@@ -8,6 +8,7 @@
[mail]
mailboxlist_webmail_link=y
webmail_url=
[monitor]
@@ -17,5 +18,6 @@
ftpuser_prefix=[CLIENTNAME]
shelluser_prefix=[CLIENTNAME]
dblist_phpmyadmin_link=y
phpmyadmin_url=
[tools]
interface/web/admin/form/system_config.tform.php
@@ -112,6 +112,18 @@
            '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 @@
            '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
    ##################################
interface/web/admin/lib/lang/en_system_config.lng
@@ -11,5 +11,7 @@
$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';
?>
interface/web/admin/templates/system_config_mail_edit.htm
@@ -11,6 +11,10 @@
                        {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'}">
interface/web/admin/templates/system_config_sites_edit.htm
@@ -27,6 +27,10 @@
                        {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'}">
interface/web/mail/webmailer.php
@@ -49,14 +49,20 @@
    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');
    header('Location:' . $http . '://' . $serverData['server_name'] . '/webmail');
}
exit;
?>
interface/web/sites/database_phpmyadmin.php
@@ -54,10 +54,17 @@
    "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
 */
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;
?>