diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql index 571d59d5fc0f6adeff60f59a3621075bf0cbc637..5011f16f9fbdb769fe9b424b1e777b9e5dd89e07 100644 --- a/install/sql/ispconfig3.sql +++ b/install/sql/ispconfig3.sql @@ -1621,6 +1621,8 @@ CREATE TABLE `sys_group` ( CREATE TABLE `sys_ini` ( `sysini_id` int(11) unsigned NOT NULL auto_increment, `config` longtext, + `default_logo` text NOT NULL, + `custom_logo` text NOT NULL, PRIMARY KEY (`sysini_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; @@ -2369,7 +2371,7 @@ INSERT INTO `sys_group` (`groupid`, `name`, `description`, `client_id`) VALUES ( -- Dumping data for table `sys_ini` -- -INSERT INTO `sys_ini` (`sysini_id`, `config`) VALUES (1, ''); +INSERT INTO `sys_ini` (`sysini_id`, `config`, `default_logo`, `custom_logo`) VALUES (1, '', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABBCAYAAACU5+uOAAAItUlEQVR42u1dCWwVVRStUJZCK6HsFNAgWpaCJkKICZKApKUFhURQpEnZF4EEUJZYEEpBIamgkQpUQBZRW7YCBqQsggsQEAgKLbIGCYsSCNqyQ8D76h18Hd/MvJk/n/bXc5KT+TNz79vPzNv+/2FhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAe++s0akTsRZxMnE6cGkKcxkwhPofaBPwWRzxxB/EO8UGI8xhxEGoV8EscY8qBKFRcgdoFAhXHC+VUHAbHo5aBQASyrZwL5DoxEjUNeBXI9XIuEMEE1DTgVSA3FA3qIDEtBLnTQiBDUNOAV4EUKhpURojmZQQEAjwKgSwK0bykWQgEU74ABAKBABAIBOIJffoNrkRsS0whDiMO5uNw4gBiSxvfGOJrbDtMOgr2JNa18HmZmETsopnGp4h9xdF0TcQRb8NEPkawTzv2qaWIoybnZYRUBoJD+difGAuBlCy0qsRM4mfERcTFfGygsBUF/xFxE/EQ8RixwIbi/j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jGC09zGwfYKsQdqF/BTKMnEJcTtxC3EPAU3iic5cRkfjc/ZFvZuuZm4gXjOouG35LQ2Yfutkq/4pfpN/E9TDVCjQGkJqQExho+CjYlRPseRiQE3EIriaMZTw4K3mOJv23J8jme23RsEAMqqQJrb9PnnEbPEVpUAuJD4Mf/PoCqeONQCUJYFElGKf7ojpnqjUQtAWRdJaf1t2w8ofSAUBNKulATSEaUPhIpIRj9icbyFUgdCTSRTeR0i2HwfpQ0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQBnG392D9QU+JXhxAAAAAElFTkSuQmCC', ''); -- -------------------------------------------------------- diff --git a/interface/lib/classes/functions.inc.php b/interface/lib/classes/functions.inc.php index 5bbff40158486c372dc17fe67ff2b5f169e1cc94..43eec67fc89467b4003fa6d712f88f480049e8e8 100644 --- a/interface/lib/classes/functions.inc.php +++ b/interface/lib/classes/functions.inc.php @@ -380,6 +380,15 @@ class functions { return true; } + + public function getimagesizefromstring($string){ + if (!function_exists('getimagesizefromstring')) { + $uri = 'data://application/octet-stream;base64,' . base64_encode($string); + return getimagesize($uri); + } else { + return getimagesizefromstring($string); + } + } } diff --git a/interface/lib/classes/tform_base.inc.php b/interface/lib/classes/tform_base.inc.php index f5ae05b8e306a1024e66d1fc8d443d44b30b2ee4..fb943c50b464b17d95a0aa108d02ff87e9dcfc9c 100644 --- a/interface/lib/classes/tform_base.inc.php +++ b/interface/lib/classes/tform_base.inc.php @@ -810,6 +810,9 @@ class tform_base { case 'IDNTOUTF8': $returnval = $app->functions->idn_decode($returnval); break; + case 'TRIM': + $returnval = trim($returnval); + break; default: $this->errorMessage .= "Unknown Filter: ".$filter['type']; break; diff --git a/interface/web/admin/system_config_edit.php b/interface/web/admin/system_config_edit.php index 1e1fdc24ff560a68fa80e575128f0154502e969b..c07810c8d4bee0a3da81e9f0708638b2fd05ce34 100644 --- a/interface/web/admin/system_config_edit.php +++ b/interface/web/admin/system_config_edit.php @@ -96,6 +96,17 @@ class page_action extends tform_actions { if($available_dashlets_txt == '') $available_dashlets_txt = '------'; $app->tpl->setVar("available_dashlets_txt", $available_dashlets_txt); + + // Logo + $sys_ini = $app->db->queryOneRecord("SELECT * FROM sys_ini WHERE sysini_id = ?", $this->id); + if($sys_ini['custom_logo'] != ''){ + $logo = '<img src="'.$sys_ini['custom_logo'].'" /> <a href="#" class="btn btn-default formbutton-danger formbutton-narrow" style="margin:5px" id="del_custom_logo"><span class="icon icon-delete"></span></a>'; + } else { + $logo = '<img src="'.$sys_ini['default_logo'].'" />'; + } + $default_logo = '<img src="'.$sys_ini['default_logo'].'" />'; + $app->tpl->setVar("used_logo", $logo); + $app->tpl->setVar("default_logo", $default_logo); parent::onShowEnd(); } @@ -183,6 +194,20 @@ class page_action extends tform_actions { "FROM web_domain WHERE type NOT IN ('subdomain','vhostsubdomain')"; $app->db->query($sql); } + + //die(print_r($_FILES)); + // Logo + /* + if(isset($_FILES['file']['name']) && is_uploaded_file($_FILES['file']['tmp_name'])){ + //print_r($_FILES); + + $path= $_FILES['file']['tmp_name']; + $type = pathinfo($path, PATHINFO_EXTENSION); + $data = file_get_contents($path); + $base64 = 'data:image/' . $type . ';base64,' . base64_encode($data); + $app->db->query("UPDATE sys_ini SET custom_logo = ? WHERE sysini_id = ?", $base64, $this->id); + } + */ // Maintenance mode if($server_config_array['misc']['maintenance_mode'] == 'y'){ diff --git a/interface/web/admin/templates/system_config_domains_edit.htm b/interface/web/admin/templates/system_config_domains_edit.htm index a9c870510487ac55de56df7df18a9a4591100f88..c651e4246776a38c76c8b230113ce7db4b2b30e0 100644 --- a/interface/web/admin/templates/system_config_domains_edit.htm +++ b/interface/web/admin/templates/system_config_domains_edit.htm @@ -1,10 +1,10 @@ +<tmpl_if name="list_head_txt"> <div class='page-header'> - <h1><tmpl_var name="list_head_txt"></h1> + <h1><tmpl_var name="list_head_txt"></h1> </div> -<p><tmpl_var name="list_desc_txt"></p> +</tmpl_if> +<tmpl_if name="list_desc_txt"><p><tmpl_var name="list_desc_txt"></p></tmpl_if> - - <div class="form-group"> <div style="float:left;width:100%"> <p class="label" style="width:270px">{tmpl_var name='use_domain_module_txt'}</p> diff --git a/interface/web/admin/templates/system_config_misc_edit.htm b/interface/web/admin/templates/system_config_misc_edit.htm index f36962f62acee0bcd8fadd62b667af7f17a4e71f..4674d4cdf183770a78bcffbd0c2470b4a4e9079a 100644 --- a/interface/web/admin/templates/system_config_misc_edit.htm +++ b/interface/web/admin/templates/system_config_misc_edit.htm @@ -3,8 +3,14 @@ </div> <p><tmpl_var name="list_desc_txt"></p> - - <legend>Misc</legend> + <div class="form-group"> + <label for="file" class="col-sm-3 control-label">{tmpl_var name='logo_txt'}</label> + <div class="col-sm-3 col-text"><input name="file" id="file" size="30" type="file" class="fileUpload" /></div><div class="col-sm-6"><button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" id="start_upload">{tmpl_var name='upload_txt'}</button></div> + </div> + <div class="form-group"> + <label for="dashboard_atom_url_admin" class="col-sm-3 control-label">{tmpl_var name='used_logo_txt'}</label> + <div class="col-sm-9" id="used_logo">{tmpl_var name='used_logo'}</div> + </div> <div class="form-group"> <label for="dashboard_atom_url_admin" class="col-sm-3 control-label">{tmpl_var name='dashboard_atom_url_admin_txt'}</label> <div class="col-sm-9"><input type="text" name="dashboard_atom_url_admin" id="dashboard_atom_url_admin" value="{tmpl_var name='dashboard_atom_url_admin'}" size="" maxlength="" class="form-control" /></div></div> @@ -98,9 +104,83 @@ {tmpl_var name='maintenance_mode'} </div> </div> + + <tmpl_if name="msg"> + <div id="OKMsg"><p><tmpl_var name="msg"></p></div> + </tmpl_if> + <tmpl_if name="error"> + <div id="errorMsg"><h3>ERROR</h3><ol><tmpl_var name="error"></ol></div> + </tmpl_if> - <input type="hidden" name="id" value="{tmpl_var name='id'}"> + <input type="hidden" name="id" id="id" value="{tmpl_var name='id'}"> <div class="clear"><div class="right"> <button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="admin/system_config_edit.php">{tmpl_var name='btn_save_txt'}</button> <button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="admin/server_list.php">{tmpl_var name='btn_cancel_txt'}</button> - </div></div> \ No newline at end of file + </div></div> +<script language="JavaScript" type="text/javascript"> + var defaultLogo = '{tmpl_var name='default_logo'}'; + $(document).on('click', '#del_custom_logo', function(){ + delCustomLogo(); + }); + + function delCustomLogo() { + var id = jQuery('input[name="id"]').val(); + + jQuery.getJSON('admin/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {'id': id, 'type': "delcustomlogo"}, function(data) { + //console.log(data); + $('#used_logo').html(defaultLogo); + $('#logo').css({ "background": "url("+data.data+") no-repeat", "width": data.width, "height": data.height }); + }); + } + + // Variable to store your files + var files; + // Add events + $('input[type="file"]').on('change', prepareUpload); + $('#start_upload').on('click', uploadFiles); + + // Grab the files and set them to our variable + function prepareUpload(event){ + files = event.target.files; + } + + // Catch the form submit and upload the files + function uploadFiles(event){ + event.stopPropagation(); // Stop stuff happening + event.preventDefault(); // Totally stop stuff happening + + var id = jQuery('input[name="id"]').val(); + + // Create a formdata object and add the files + var data = new FormData(); + $.each(files, function(key, value){ + data.append(key, value); + }); + + $.ajax({ + url: 'admin/ajax_get_json.php?id='+id+'&type=uploadfile', + type: 'POST', + data: data, + cache: false, + dataType: 'json', + processData: false, // Don't process the files + contentType: false, // Set content type to false as jQuery will tell the server its a query string request + success: function(data, textStatus, jqXHR){ + if(typeof data.error === 'undefined'){ + // Success so call function to process the form + //console.log(data); + $('#used_logo').html('<img src="'+data.data+'" /> <a href="#" class="btn btn-default formbutton-danger formbutton-narrow" style="margin:5px" id="del_custom_logo"><span class="icon icon-delete"></span></a>'); + $('#logo').css({ "background": "url("+data.data+") no-repeat", "width": data.width, "height": data.height }); + } else { + // Handle errors here + //console.log(data); + } + }, + error: function(jqXHR, textStatus, errorThrown){ + // Handle errors here + //console.log(data); + } + }); + } + +</script> \ No newline at end of file diff --git a/interface/web/client/form/client.tform.php b/interface/web/client/form/client.tform.php index 7507c184357a7fa2ef58e4e5c60355678518835e..ef8ce33879ae59ca5dd67e514cf11864c2011757 100644 --- a/interface/web/client/form/client.tform.php +++ b/interface/web/client/form/client.tform.php @@ -116,7 +116,10 @@ $form["tabs"]['address'] = array ( 'maxlength' => '255', 'rows' => '', 'cols' => '', - 'searchable' => 1 + 'searchable' => 1, + 'filters' => array( 0 => array( 'event' => 'SAVE', + 'type' => 'TRIM'), + ), ), 'contact_name' => array ( 'datatype' => 'VARCHAR', @@ -131,7 +134,10 @@ $form["tabs"]['address'] = array ( 'maxlength' => '255', 'rows' => '', 'cols' => '', - 'searchable' => 1 + 'searchable' => 1, + 'filters' => array( 0 => array( 'event' => 'SAVE', + 'type' => 'TRIM'), + ), ), 'customer_no' => array ( 'datatype' => 'VARCHAR', diff --git a/interface/web/client/form/reseller.tform.php b/interface/web/client/form/reseller.tform.php index 75e9fa2e67fe37de78d6d57018279b20aaa5c940..822e96ab72b488dfb92ca8ce0b75ef7ed3c1253f 100644 --- a/interface/web/client/form/reseller.tform.php +++ b/interface/web/client/form/reseller.tform.php @@ -116,7 +116,10 @@ $form["tabs"]['address'] = array ( 'maxlength' => '255', 'rows' => '', 'cols' => '', - 'searchable' => 1 + 'searchable' => 1, + 'filters' => array( 0 => array( 'event' => 'SAVE', + 'type' => 'TRIM'), + ), ), 'contact_name' => array ( 'datatype' => 'VARCHAR', @@ -131,7 +134,10 @@ $form["tabs"]['address'] = array ( 'maxlength' => '255', 'rows' => '', 'cols' => '', - 'searchable' => 1 + 'searchable' => 1, + 'filters' => array( 0 => array( 'event' => 'SAVE', + 'type' => 'TRIM'), + ), ), 'customer_no' => array ( 'datatype' => 'VARCHAR', diff --git a/interface/web/client/templates/client_circle_edit.htm b/interface/web/client/templates/client_circle_edit.htm index ddc3f6e1c9ce05378a10d3e6db2e6c782b427afc..0bdf2f49a059d6465061168d530d8a4bac587100 100644 --- a/interface/web/client/templates/client_circle_edit.htm +++ b/interface/web/client/templates/client_circle_edit.htm @@ -1,10 +1,11 @@ +<tmpl_if name="list_head_txt"> <div class='page-header'> <h1><tmpl_var name="list_head_txt"></h1> </div> -<p><tmpl_var name="list_desc_txt"></p> +</tmpl_if> +<tmpl_if name="list_desc_txt"><p><tmpl_var name="list_desc_txt"></p></tmpl_if> - <legend>{tmpl_var name='circle_txt'}</legend> <div class="form-group"> <label for="circle_name" class="col-sm-3 control-label">{tmpl_var name='circle_name_txt'}*</label> <div class="col-sm-9"><input type="text" name="circle_name" id="circle_name" value="{tmpl_var name='circle_name'}" class="form-control" /></div></div> diff --git a/interface/web/client/templates/client_edit_limits.htm b/interface/web/client/templates/client_edit_limits.htm index ed150b4d12f9dbb6ae979e2aa1e3e7eaa25e4c40..e7de5c66540845b19a40fcbd274bbf18901d5bcc 100644 --- a/interface/web/client/templates/client_edit_limits.htm +++ b/interface/web/client/templates/client_edit_limits.htm @@ -1,20 +1,14 @@ +<tmpl_if name="list_head_txt"> <div class='page-header'> <h1><tmpl_var name="list_head_txt"></h1> </div> -<p><tmpl_var name="list_desc_txt"></p> +</tmpl_if> +<tmpl_if name="list_desc_txt"><p><tmpl_var name="list_desc_txt"></p></tmpl_if> <div class="panel panel_client"> - - <div class="pnl_toolsarea"> - <p class="fieldset-legend">{tmpl_var name="toolsarea_head_txt"}</p> - <div class="buttons topbuttons"> - <button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='add_additional_template_txt'}" onclick="ISPConfig.addAdditionalTemplate();">{tmpl_var name='add_additional_template_txt'}</button> - </div> - - </div> - - <div class="pnl_formsarea"> - <legend>Limits</legend> + + <div class="pnl_formsarea"> + <fieldset class="inlineLabels"><legend>Limits</legend> <div class="form-group"> <label for="template_master" class="col-sm-3 control-label">{tmpl_var name='template_master_txt'}</label> <div class="col-sm-9"><select name="template_master" id="template_master" class="form-control"> @@ -27,9 +21,12 @@ {tmpl_var name='tpl_add_select'} </select></div> </div> + <div class="clear"><div class="right"> + <button class="btn btn-default formbutton-success" type="button" onclick="ISPConfig.addAdditionalTemplate();">{tmpl_var name="add_additional_template_txt"}</button> + </div></div> <div class="form-group"> <label class="col-sm-3 control-label">{tmpl_var name='active_template_additional_txt'}</label> - <div id="template_additional_list" class="multiField"> + <div id="template_additional_list" class="col-sm-9 col-text"> <ul> {tmpl_var name='template_additional_list'} </ul> diff --git a/interface/web/client/templates/client_template_edit_template.htm b/interface/web/client/templates/client_template_edit_template.htm index 5e07d8df0de00afa34ee1489fdc530acdddf6c41..e06d07792d9b5e45a7271378a485a71430f98de9 100644 --- a/interface/web/client/templates/client_template_edit_template.htm +++ b/interface/web/client/templates/client_template_edit_template.htm @@ -1,7 +1,9 @@ +<tmpl_if name="list_head_txt"> <div class='page-header'> <h1><tmpl_var name="list_head_txt"></h1> </div> -<p><tmpl_var name="list_desc_txt"></p> +</tmpl_if> +<tmpl_if name="list_desc_txt"><p><tmpl_var name="list_desc_txt"></p></tmpl_if> <legend>Template</legend> diff --git a/interface/web/client/templates/message_template.htm b/interface/web/client/templates/message_template.htm index 26522d4b687f934d87f52e00a99679f4d4c3285c..aa27d181fc72a5876ac2bf8d7ee5c07b8c663fd7 100644 --- a/interface/web/client/templates/message_template.htm +++ b/interface/web/client/templates/message_template.htm @@ -18,12 +18,13 @@ <div class="col-sm-9"><input type="text" name="template_name" id="template_name" value="{tmpl_var name='template_name'}" class="form-control" /></div></div> <div class="form-group"> <label for="subject" class="col-sm-3 control-label">{tmpl_var name='subject_txt'}</label> - <div class="col-sm-9"><input type="text" name="subject" id="subject" value="{tmpl_var name='subject'}" class="form-control" /></div><br clear="all">{tmpl_var name='variables_txt'}: {tmpl_var name="message_variables"} <br />{tmpl_var name='variables_description_txt'} + <div class="col-sm-9"><input type="text" name="subject" id="subject" value="{tmpl_var name='subject'}" class="form-control" /></div> + <div class="col-sm-3 col-text"></div><div class="col-sm-9 col-text">{tmpl_var name='variables_txt'}: {tmpl_var name="message_variables"} <br />{tmpl_var name='variables_description_txt'}</div> </div> <div class="form-group"> <label for="message" class="col-sm-3 control-label">{tmpl_var name='message_txt'}</label> - <div class="col-sm-9"><textarea class="form-control" name="message" id="message" rows='' cols=''>{tmpl_var name='message'}</textarea></div> - <br clear="all">{tmpl_var name='variables_txt'}: {tmpl_var name="message_variables"} <br />{tmpl_var name='variables_description_txt'} + <div class="col-sm-9"><textarea class="form-control" name="message" id="message" style="height:300px">{tmpl_var name='message'}</textarea></div> + <div class="col-sm-3 col-text"></div><div class="col-sm-9 col-text">{tmpl_var name='variables_txt'}: {tmpl_var name="message_variables"} <br />{tmpl_var name='variables_description_txt'}</div> </div> <div class="clear"><div class="right"> <button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="client/message_template_edit.php">{tmpl_var name='btn_save_txt'}</button> diff --git a/interface/web/client/templates/reseller_edit_limits.htm b/interface/web/client/templates/reseller_edit_limits.htm index 7644b95747c1987334cd548492001e3f1e0bb70b..d58e28416db36db802e9dbce0be99ddc2adce6dd 100644 --- a/interface/web/client/templates/reseller_edit_limits.htm +++ b/interface/web/client/templates/reseller_edit_limits.htm @@ -1,20 +1,12 @@ +<tmpl_if name="list_head_txt"> <div class='page-header'> <h1><tmpl_var name="list_head_txt"></h1> </div> -<p><tmpl_var name="list_desc_txt"></p> +</tmpl_if> +<tmpl_if name="list_desc_txt"><p><tmpl_var name="list_desc_txt"></p></tmpl_if> <div class="panel panel_client"> - <tmpl_if name="is_admin"> - <div class="pnl_toolsarea"> - <p class="fieldset-legend">{tmpl_var name="toolsarea_head_txt"}</p> - <div class="buttons topbuttons"> - <button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='add_additional_template_txt'}" onclick="ISPConfig.addAdditionalTemplate();">{tmpl_var name='add_additional_template_txt'}</button> - </div> - - </div> - </tmpl_if> - <div class="pnl_formsarea"> <legend>Limits</legend> <tmpl_if name="is_admin"> @@ -30,9 +22,14 @@ {tmpl_var name='tpl_add_select'} </select></div> </div> + <tmpl_if name="is_admin"> + <div class="clear"><div class="right"> + <button class="btn btn-default formbutton-success" type="button" onclick="ISPConfig.addAdditionalTemplate();">{tmpl_var name="add_additional_template_txt"}</button> + </div></div> + </tmpl_if> <div class="form-group"> <label class="col-sm-3 control-label">{tmpl_var name='active_template_additional_txt'}</label> - <div id="template_additional_list" class="multiField"> + <div id="template_additional_list" class="col-sm-9 col-text"> <ul> {tmpl_var name='template_additional_list'} </ul> diff --git a/interface/web/dns/templates/dns_import.htm b/interface/web/dns/templates/dns_import.htm index de6d356b6b1cb41fb370a5698a8fe5938897ef53..b72ef920ee1cce150e66905f42060b9f6b23f0b7 100644 --- a/interface/web/dns/templates/dns_import.htm +++ b/interface/web/dns/templates/dns_import.htm @@ -38,11 +38,11 @@ </select></div> <tmpl_else> <div class="col-sm-9"><input type="text" name="domain" id="domain" value="{tmpl_var name='domain'}" class="form-control" onkeydown="keydown(event.which);" /></div></tmpl_if> - <p class="value"><tmpl_var name='domain_field_desc_txt'}</p> + <div class="col-sm-3 col-text"></div><div class="col-sm-9 col-text"><tmpl_var name='domain_field_desc_txt'}</div> </div> <div class="form-group"> <label for="file" class="col-sm-3 control-label">{tmpl_var name='zonefile_to_import_txt'}</label> - <input name="file" id="file" size="30" type="file" class="fileUpload" /> + <div class="col-sm-9 col-text"><input name="file" id="file" size="30" type="file" class="fileUpload" /></div> </div> <tmpl_if name="msg"> diff --git a/interface/web/index.php b/interface/web/index.php index f6929bafc1746cbb472e5875859713995f1596d9..e942c1068810c8eabf587161d638a7e568e7fc9d 100644 --- a/interface/web/index.php +++ b/interface/web/index.php @@ -87,6 +87,19 @@ unset($js_d_files); $app->tpl->setVar('current_theme', isset($_SESSION['s']['theme']) ? $_SESSION['s']['theme'] : 'default'); +// Logo +$logo = $app->db->queryOneRecord("SELECT * FROM sys_ini WHERE sysini_id = 1"); +if($logo['custom_logo'] != ''){ + $base64_logo_txt = $logo['custom_logo']; +} else { + $base64_logo_txt = $logo['default_logo']; +} +$tmp_base64 = explode(',', $base64_logo_txt, 2); +$logo_dimensions = $app->functions->getimagesizefromstring(base64_decode($tmp_base64[1])); +$app->tpl->setVar('base64_logo_width', $logo_dimensions[0]); +$app->tpl->setVar('base64_logo_height', $logo_dimensions[1]); +$app->tpl->setVar('base64_logo_txt', $base64_logo_txt); + $app->tpl_defaults(); $app->tpl->pparse(); ?> diff --git a/interface/web/sites/form/web_childdomain.tform.php b/interface/web/sites/form/web_childdomain.tform.php index 1081a233d5eb8d27f2d3c6174ea8b631cffff02a..09145f9768a71c4aca84ded0b96e7936743b5f10 100644 --- a/interface/web/sites/form/web_childdomain.tform.php +++ b/interface/web/sites/form/web_childdomain.tform.php @@ -58,7 +58,7 @@ $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, $form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete $form["tabs"]['domain'] = array ( - 'title' => "Domain", + 'title' => ($childdomain_type == 'aliasdomain'? 'Aliasdomain' : 'Subdomain'), 'width' => 100, 'template' => "templates/web_childdomain_edit.htm", 'fields' => array ( diff --git a/interface/web/sites/form/web_vhost_domain.tform.php b/interface/web/sites/form/web_vhost_domain.tform.php index 47f8f65ad39195f8f32786056c4ee3d64105412c..3c4723abaed4a764b9b485102f21de3f613f8652 100644 --- a/interface/web/sites/form/web_vhost_domain.tform.php +++ b/interface/web/sites/form/web_vhost_domain.tform.php @@ -41,16 +41,19 @@ $vhostdomain_type = 'domain'; $form_title = "Web Domain"; $validator_function = 'web_domain'; +$first_tab_title = "Domain"; if(isset($_SESSION['s']['var']['vhostdomain_type'])) { if($_SESSION['s']['var']['vhostdomain_type'] == 'subdomain') { $vhostdomain_type = 'subdomain'; $form_title = "Subdomain"; $validator_function = 'sub_domain'; + $first_tab_title = "Subomain"; } elseif($_SESSION['s']['var']['vhostdomain_type'] == 'aliasdomain') { $vhostdomain_type = 'aliasdomain'; $form_title = "Aliasdomain"; $validator_function = 'alias_domain'; + $first_tab_title = "Aliasomain"; } } @@ -96,7 +99,7 @@ $app->uses('getconf'); $web_config = $app->getconf->get_global_config('sites'); $form["tabs"]['domain'] = array ( - 'title' => "Domain", + 'title' => $first_tab_title, 'width' => 100, 'template' => "templates/web_vhost_domain_edit.htm", 'readonly' => $web_domain_edit_readonly, diff --git a/interface/web/sites/lib/module.conf.php b/interface/web/sites/lib/module.conf.php index b6d506a1573eefd9d41d7b7287583f26ae5af321..8e253fd27ea89ada7ca1f0faeb8f17c6bf10d37c 100644 --- a/interface/web/sites/lib/module.conf.php +++ b/interface/web/sites/lib/module.conf.php @@ -96,10 +96,24 @@ if($app->auth->get_client_limit($userid, 'ftp_user') != 0) if($app->auth->get_client_limit($userid, 'webdav_user') != 0) { - $items[] = array( 'title' => "Webdav-User", - 'target' => 'content', - 'link' => 'sites/webdav_user_list.php', - 'html_id' => 'webdav_user_list'); + $apache_in_use = false; + $servers = $app->db->queryAllRecords("SELECT * FROM server WHERE web_server = 1 AND active = 1"); + if(is_array($servers) && !empty($servers)){ + foreach($servers as $server){ + $tmp_web_config = $app->getconf->get_server_config($server['server_id'], 'web'); + if(strtolower($tmp_web_config['server_type']) == 'apache'){ + $apache_in_use = true; + break; + } + } + } + + if($apache_in_use == true){ + $items[] = array( 'title' => "Webdav-User", + 'target' => 'content', + 'link' => 'sites/webdav_user_list.php', + 'html_id' => 'webdav_user_list'); + } } $items[] = array( 'title' => "Folder", diff --git a/interface/web/sites/templates/web_childdomain_list.htm b/interface/web/sites/templates/web_childdomain_list.htm index 0800fd1805b3a7c9a4dbe8044dd6bedc211de118..51aadc157a28b9d63eb3cdab71ca4ddf5d0561c6 100644 --- a/interface/web/sites/templates/web_childdomain_list.htm +++ b/interface/web/sites/templates/web_childdomain_list.htm @@ -1,5 +1,5 @@ <div class='page-header'> - <h1><tmpl_var name="list_head_txt"></h1> + <h1><tmpl_if name='childdomain_type' op='==' value='aliasdomain'><tmpl_var name="aliasdomain_list_head_txt"></tmpl_else><tmpl_var name="subdomain_list_head_txt"></tmpl_if></h1> </div> <p><tmpl_var name="list_desc_txt"></p> @@ -22,7 +22,7 @@ </tmpl_if> <p class="fieldset-legend">{tmpl_var name="toolsarea_head_txt"}</p> - <button class="btn btn-default formbutton-success" type="button" data-load-content="sites/web_childdomain_edit.php?type={tmpl_var name='childdomain_type'}">{tmpl_var name="add_new_record_txt"}</button> + <button class="btn btn-default formbutton-success" type="button" data-load-content="sites/web_childdomain_edit.php?type={tmpl_var name='childdomain_type'}"><tmpl_if name='childdomain_type' op='==' value='aliasdomain'>{tmpl_var name="add_new_aliasdomain_txt"}</tmpl_else>{tmpl_var name="add_new_subdomain_txt"}</tmpl_if></button> @@ -35,7 +35,7 @@ <th class="tiny-col" data-column="active"><tmpl_var name="active_txt"></th> <th data-column="server_id"><tmpl_var name="server_id_txt"></th> <th data-column="parent_domain_id"><tmpl_var name="parent_domain_id_txt"></th> - <th data-column="domain"><tmpl_var name="domain_txt"></th> + <th data-column="domain"><tmpl_if name='childdomain_type' op='==' value='aliasdomain'>{tmpl_var name="aliasdomain_txt"}</tmpl_else>{tmpl_var name="subdomain_txt"}</tmpl_if></th> <th class="small-col text-right">{tmpl_var name='search_limit'}</th> </tr> <tr> diff --git a/interface/web/sites/templates/web_vhost_domain_admin_list.htm b/interface/web/sites/templates/web_vhost_domain_admin_list.htm index 30502079cef32599c6437d5004d439e9f4d2216e..ccd16e21a6dcbebab541389213c8ce75041910fd 100644 --- a/interface/web/sites/templates/web_vhost_domain_admin_list.htm +++ b/interface/web/sites/templates/web_vhost_domain_admin_list.htm @@ -1,11 +1,11 @@ <div class='page-header'> - <h1><tmpl_var name="list_head_txt"></h1> + <h1><tmpl_if name='vhostdomain_type' op='==' value='domain'>{tmpl_var name="domain_list_head_txt"}</tmpl_if><tmpl_if name='vhostdomain_type' op='==' value='subdomain'>{tmpl_var name="subdomain_list_head_txt"}</tmpl_if><tmpl_if name='vhostdomain_type' op='==' value='aliasdomain'>{tmpl_var name="aliasdomain_list_head_txt"}</tmpl_if></h1> </div> <p class="fieldset-legend">{tmpl_var name="toolsarea_head_txt"}</p> - <button class="btn btn-default formbutton-success" type="button" data-load-content="sites/web_vhost_domain_edit.php?type={tmpl_var name='vhostdomain_type'}">{tmpl_var name="add_new_record_txt"}</button> + <button class="btn btn-default formbutton-success" type="button" data-load-content="sites/web_vhost_domain_edit.php?type={tmpl_var name='vhostdomain_type'}"><tmpl_if name='vhostdomain_type' op='==' value='domain'>{tmpl_var name="add_new_record_txt"}</tmpl_if><tmpl_if name='vhostdomain_type' op='==' value='subdomain'>{tmpl_var name="add_new_subdomain_txt"}</tmpl_if><tmpl_if name='vhostdomain_type' op='==' value='aliasdomain'>{tmpl_var name="add_new_aliasdomain_txt"}</tmpl_if></button> @@ -20,7 +20,7 @@ <th data-column="sys_groupid"><tmpl_var name="sys_groupid_txt"></th> <th data-column="server_id"><tmpl_var name="server_id_txt"></th> <tmpl_if name="vhostdomain_type" op="!=" value="domain"><th data-column="parent_domain_id"><tmpl_var name="parent_domain_id_txt"></th></tmpl_if> - <th data-column="domain"><tmpl_var name="domain_txt"></th> + <th data-column="domain"><tmpl_if name='vhostdomain_type' op='==' value='domain'>{tmpl_var name="domain_txt"}</tmpl_if><tmpl_if name='vhostdomain_type' op='==' value='subdomain'>{tmpl_var name="subdomain_txt"}</tmpl_if><tmpl_if name='vhostdomain_type' op='==' value='aliasdomain'>{tmpl_var name="aliasdomain_txt"}</tmpl_if></th> <th class="small-col text-right">{tmpl_var name='search_limit'}</th> </tr> <tr> diff --git a/interface/web/sites/templates/web_vhost_domain_list.htm b/interface/web/sites/templates/web_vhost_domain_list.htm index 7ee6966d3aa2ce24f98f0bc485c2be4aebfb5bb2..b40db40d324e2dd7cc225d8bc5c5f203f5ecabf0 100644 --- a/interface/web/sites/templates/web_vhost_domain_list.htm +++ b/interface/web/sites/templates/web_vhost_domain_list.htm @@ -1,5 +1,5 @@ <div class='page-header'> - <h1><tmpl_var name="list_head_txt"></h1> + <h1><tmpl_if name='vhostdomain_type' op='==' value='domain'>{tmpl_var name="domain_list_head_txt"}</tmpl_if><tmpl_if name='vhostdomain_type' op='==' value='subdomain'>{tmpl_var name="subdomain_list_head_txt"}</tmpl_if><tmpl_if name='vhostdomain_type' op='==' value='aliasdomain'>{tmpl_var name="aliasdomain_list_head_txt"}</tmpl_if></h1> </div> <p><tmpl_var name="list_desc_txt"></p> @@ -22,7 +22,7 @@ </tmpl_if> <p class="fieldset-legend">{tmpl_var name="toolsarea_head_txt"}</p> - <button class="btn btn-default formbutton-success" type="button" data-load-content="sites/web_vhost_domain_edit.php?type={tmpl_var name='vhostdomain_type'}">{tmpl_var name="add_new_record_txt"}</button> + <button class="btn btn-default formbutton-success" type="button" data-load-content="sites/web_vhost_domain_edit.php?type={tmpl_var name='vhostdomain_type'}"><tmpl_if name='vhostdomain_type' op='==' value='domain'>{tmpl_var name="add_new_record_txt"}</tmpl_if><tmpl_if name='vhostdomain_type' op='==' value='subdomain'>{tmpl_var name="add_new_subdomain_txt"}</tmpl_if><tmpl_if name='vhostdomain_type' op='==' value='aliasdomain'>{tmpl_var name="add_new_aliasdomain_txt"}</tmpl_if></button> @@ -36,7 +36,7 @@ <th class="tiny-col" data-column="active"><tmpl_var name="active_txt"></th> <th data-column="server_id"><tmpl_var name="server_id_txt"></th> <tmpl_if name="vhostdomain_type" op="!=" value="domain"><th data-column="parent_domain_id"><tmpl_var name="parent_domain_id_txt"></th></tmpl_if> - <th data-column="domain"><tmpl_var name="domain_txt"></th> + <th data-column="domain"><tmpl_if name='vhostdomain_type' op='==' value='domain'>{tmpl_var name="domain_txt"}</tmpl_if><tmpl_if name='vhostdomain_type' op='==' value='subdomain'>{tmpl_var name="subdomain_txt"}</tmpl_if><tmpl_if name='vhostdomain_type' op='==' value='aliasdomain'>{tmpl_var name="aliasdomain_txt"}</tmpl_if></th> <th class="small-col text-right">{tmpl_var name='search_limit'}</th> </tr> <tr> diff --git a/interface/web/themes/default/assets/stylesheets/ispconfig.css b/interface/web/themes/default/assets/stylesheets/ispconfig.css index 958c2b3d3c9be446ad3dba6f59f15a01cd331a60..40b87ac718dc1d93fc1844b5a9a49788bd11e964 100644 --- a/interface/web/themes/default/assets/stylesheets/ispconfig.css +++ b/interface/web/themes/default/assets/stylesheets/ispconfig.css @@ -65,7 +65,8 @@ body { float: left; width: 200px; height: 65px; - background: url("../images/logo.png") no-repeat; } + margin-top:10px; + /*background: url("../images/logo.png") no-repeat;*/ } #logo a { display: block; width: 100%; diff --git a/interface/web/themes/default/templates/main.tpl.htm b/interface/web/themes/default/templates/main.tpl.htm index 67b37e895d4e346277118390e874fbe74a1c78ed..d29ab0039f8a589427c27cb0c3172de0b88c4c26 100644 --- a/interface/web/themes/default/templates/main.tpl.htm +++ b/interface/web/themes/default/templates/main.tpl.htm @@ -33,7 +33,7 @@ <!-- off canvas menu button --> <div class='menu-btn left'>☰</div> <!-- logo --> - <div id='logo'><a href='#'></a></div> + <div id='logo' style="background: url({tmpl_var name="base64_logo_txt"}) no-repeat;width:{tmpl_var name="base64_logo_width"};height:{tmpl_var name="base64_logo_height"}"><a href='#'></a></div> </div> <div id='headerbar' class='clear'> <!-- logout button -->