Skip to content

Commit

Permalink
Merge pull request #767 from KuJoe/master
Browse files Browse the repository at this point in the history
Added option to hide HTMLy version publicly and added version to admin layout by @KuJoe
  • Loading branch information
danpros authored May 22, 2024
2 parents b16423f + 4bdc39f commit 6d92d70
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 4 deletions.
4 changes: 3 additions & 1 deletion lang/en_US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,6 @@ login_protect_system = "Login protection system"
cloudflare_info = "Review Cloudflare's Turnstile documentation: "
mfa_config = "Multi Factor Authentication (MFA)"
set_mfa_globally = "Set the status of MFA"
explain_mfa = "When enabled, MFA is optional for all users. When disabled, no users can use it and it hides the field on the login page."
explain_mfa = "When enabled, MFA is optional for all users. When disabled, no users can use it and it hides the field on the login page."
set_version_publicly = "Version Visibility"
explain_version = "By default the version of HTMLy is visible publicly in the source code, some bots and bad actors can use this information for bad reasons so some admins may prefer to hide this."
21 changes: 21 additions & 0 deletions system/admin/views/config.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,27 @@
<input type="text" name="-config-blog.copyright" class="form-control" id="blog.copyright" value="<?php echo valueMaker(config('blog.copyright'));?>" placeholder="<?php echo i18n('Copyright_Line_Placeholder');?>">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label"><?php echo i18n('set_version_publicly');?></label>
<div class="col-sm-10">
<div class="col-sm-10">
<div class="form-check">
<input class="form-check-input" type="radio" name="-config-show.version" id="show.version1" value="true" <?php if (config('show.version') === 'true'):?>checked<?php endif;?>>
<label class="form-check-label" for="show.version1">
<?php echo i18n('Enable');?>
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="-config-show.version" id="show.version2" value="false" <?php if (config('show.version') === 'false'):?>checked<?php endif;?>>
<label class="form-check-label" for="show.version2">
<?php echo i18n('Disable');?>
</label>
</div>
</div>
<small><em><?php echo i18n('explain_version');?></em></small>
</div>
</div>
<hr />
<div class="form-group row">
<div class="col-sm-10">
<button type="submit" class="btn btn-primary"><?php echo i18n('Save_Config');?></button>
Expand Down
2 changes: 1 addition & 1 deletion system/admin/views/layout.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@
<small><?php echo i18n('Admin_panel_style_based_on');?> <a rel="nofollow" target="_blank" href="https://github.com/ColorlibHQ/AdminLTE">AdminLTE</a></small>
</div>
<!-- Default to the left -->
<?php echo i18n('Proudly_powered_by');?> <a href="https://www.htmly.com" target="_blank">HTMLy</a>
<?php echo i18n('Proudly_powered_by');?> <a href="https://www.htmly.com" target="_blank"><?php echo 'HTMLy ' . constant('HTMLY_VERSION'); ?></a>
</footer>
</div>
<!-- ./wrapper -->
Expand Down
3 changes: 2 additions & 1 deletion system/configList.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,6 @@
"views.root",
"views.layout",
"autosave.enable",
"mfa.state"
"mfa.state",
"show.version"
]
4 changes: 3 additions & 1 deletion system/includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3440,7 +3440,9 @@ function head_contents()
$output .= '<meta charset="utf-8" />' . "\n";
$output .= '<meta http-equiv="X-UA-Compatible" content="IE=edge" />' . "\n";
$output .= '<meta name="viewport" content="width=device-width, initial-scale=1" />' . "\n";
$output .= '<meta name="generator" content="' . $version . '" />' . "\n";
if (config('show.version') == 'true') {
$output .= '<meta name="generator" content="' . $version . '" />' . "\n";
}
$output .= $favicon;
$output .= '<link rel="sitemap" href="' . site_url() . 'sitemap.xml" />' . "\n";
$output .= '<link rel="alternate" type="application/rss+xml" title="' . blog_title() . ' Feed" href="' . site_url() . 'feed/rss" />' . "\n";
Expand Down

0 comments on commit 6d92d70

Please sign in to comment.