Add option to use existing URL for privacy policy. Pryx/server-status#41

- Also moved the gitbug icon to the left of the footer as it looked like it was part of the imprint/policy link.
- Fixed Imprint & Privacy policy text so that it will be translated.
This commit is contained in:
Thomas Nilsen 2018-11-08 14:15:20 +01:00
parent 2566ae9fd4
commit b4926077fa
3 changed files with 12 additions and 2 deletions

View File

@ -12,6 +12,7 @@ define("ADDRESS", "##address##");
define("POLICY_MAIL", "##policy_mail##"); //contact email in policy
define("POLICY_PHONE", "##policy_phone##");
define("WHO_WE_ARE","##who_we_are##");
define("POLICY_URL","##policy_url##");
define("INSTALL_OVERRIDE", false);
define("DEFAULT_LANGUAGE", "en_GB");

View File

@ -3,6 +3,7 @@ require_once("template.php");
define("WEB_URL", "."); //Website name
define("NAME", _('Status page')); //Website name
define("MINIMUM_PHP_VERSION", "5.4.0");
define("POLICY_URL", "policy.php"); //Default policy URL
require_once("classes/locale-negotiator.php");
$negotiator = new LocaleNegotiator("en_GB");
@ -127,6 +128,8 @@ if(isset($_POST['server']) && empty($message))
$config = str_replace("##policy_mail##", $_POST['policy_mail'], $config);
$config = str_replace("##policy_phone##", $_POST['policy_phone'],$config);
$config = str_replace("##who_we_are##", $_POST['who_we_are'], $config);
$policy_url_conf = ( ! empty($_POST['policy_url']) ) ? $_POST['policy_url'] : POLICY_URL;
$config = str_replace("##policy_url##", $policy_url_conf, $config);
file_put_contents("config.php", $config);
@ -239,6 +242,12 @@ if (!empty($message))
<div class="form-group clearfix">
<div class=""><label for="who_we_are"><?php echo _("Who we are");?>: </label><textarea class="form-control" id="who_we_are" rows="3" name="who_we_are" placeholder="<?php echo _("Some info about yourself");?>" value="<?php echo ((isset($_POST['who_we_are']))?htmlspecialchars($_POST['who_we_are'], ENT_QUOTES):'');?>"></textarea></div>
</div>
<div class="form-group clearfix">
<div class="col-sm-12"><label for="url"><?php echo _("External Policy Url");?>: </label>
<summary><?php echo _("If you alredy have an existing Policy published, please provide the full Url to override the local policy definition. Leave blank to use the local definition");?></summary>
<input type="policy_url" name="policy_url" value="<?php echo ((isset($_POST['policy_url']))?htmlspecialchars($_POST['policy_url'], ENT_QUOTES):'');?>" id="policy_url" placeholder="<?php echo _("External Policy Url");?>" class="form-control">
</div>
</div>
</section>
<section class="install-section clearfix">
<h2><?php echo _("User");?></h2>

View File

@ -138,7 +138,7 @@ class Template{
<div id="footerwrap">
<div class="container">
<div class="row centered">
<div class="col-md-4 text-left">Copyright © <?php echo date("Y");?> Vojtěch Sajdl</div>
<div class="col-md-4 text-left"><a href="https://github.com/Pryx/server-status/" target="_blank"><i class="fab fa-github" aria-hidden="true"></i>&nbsp;</a>Copyright © <?php echo date("Y");?> Vojtěch Sajdl</div>
<div class="col-md-4 text-center">
<div class="btn-group dropup">
<button type="button" class="btn btn-primary"><?php echo '<img src="'.WEB_URL.'/locale/'.$_SESSION['locale'].'/flag.png" alt="'.$lang_names[$_SESSION['locale']].'">'.$lang_names[$_SESSION['locale']];?></button>
@ -157,7 +157,7 @@ class Template{
</div>
</div>
</div>
<div class="col-md-4 text-right"><a href="policy.php">Imprint & Privacy Policy</a><a href="https://github.com/Pryx/server-status/" target="_blank"><i class="fab fa-github" aria-hidden="true"></i></a></div>
<div class="col-md-4 text-right"><a href="<?php echo POLICY_URL; ?>"><?php echo _("Imprint & Privacy Policy");?></a><!-- <a href="https://github.com/Pryx/server-status/" target="_blank"><i class="fab fa-github" aria-hidden="true"></i></a> --></div>
</div><!--/row -->
</div><!--/container -->
</div>