added telegram to install.php

This commit is contained in:
jhuesser 2018-06-07 10:44:42 +02:00 committed by Thomas Nilsen
parent bc92eea651
commit 781c938118

View File

@ -130,6 +130,8 @@ if(isset($_POST['server']) && empty($message))
$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);
$config = str_replace("##tg_bot_token##", $_POST['tgtoken'], $config);
$config = str_replace("##tg_bot_username##", $_POST['tgbot'], $config);
file_put_contents("config.php", $config);
@ -245,6 +247,19 @@ 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>
</section>
<section class="install-section clearfix">
<h2><?php echo _("Telegram");?></h2>
<summary><?php echo _("You can provide a subscription feature through telegram.");?></summary>
<div class="form-group clearfix">
<div class="col-sm-6"><label for="tgtoken"><?php echo _("Telegram bot API Token");?>: </label><input type="text" name="tgtoken" value="<?php echo ((isset($_POST['tgtoken']))?htmlspecialchars($_POST['tgtoken'], ENT_QUOTES):'');?>" id="tgtoken" placeholder="<?php echo _("Telegram Bot API Token");?>" class="form-control" required></div>
<div class="col-sm-6"><label for="tgbot"><?php echo _("Telegram Bot Username");?>: </label><input type="text" name="tgbot" value="<?php echo ((isset($_POST['tgbot']))?htmlspecialchars($_POST['tgbot'], ENT_QUOTES):'');?>" id="tgbot" placeholder="<?php echo _("Telegram Bot Username");?>" class="form-control" required></div>
</div>
</section>
<section class="install-section clearfix">
<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>