demo stuff

This commit is contained in:
HB9HIL
2024-07-11 21:43:58 +02:00
parent fa1b029304
commit 5f170311f7
3 changed files with 72 additions and 53 deletions

1
.gitignore vendored
View File

@@ -22,4 +22,5 @@ sync.sh
*.swp
.debug
.maintenance
.demo
.htaccess

View File

@@ -923,6 +923,13 @@ class User extends CI_Controller {
*/
function forgot_password() {
if (file_exists('.demo')) {
$this->session->set_flashdata('error', __("Password Reset is disabled on the Demo!"));
redirect('user/login');
} else {
$this->load->helper(array('form', 'url'));
$this->load->library('form_validation');
@@ -995,6 +1002,7 @@ class User extends CI_Controller {
}
}
}
}
// Send an E-Mail to the user. Function is similar to forgot_password() but will be called by an AJAX
public function admin_send_password_reset() {

View File

@@ -38,16 +38,26 @@
<?php } ?>
<div class="my-2 rounded-0 shadow-sm card mb-2 shadow-sm">
<div class="card-body">
<?php // only used for Wavelog Demo
if (file_exists('.demo')) { ?>
<div class="border-bottom mb-3">
<h5><?= __("Welcome to the Demo of Wavelog"); ?></h5>
<p><?= __("This demo will be reset every night at 0200z."); ?><br><br>
<?= __("Username"); ?>: demo<br>
<?= __("Password"); ?>: demo<br><br>
<?= sprintf(__("More Information about Wavelog on <a href='%s' target='_blank'>Github</a>."), "https://www.github.com/wavelog/wavelog"); ?></p>
</div>
<?php } ?>
<form method="post" action="<?php echo site_url('user/login'); ?>" name="users">
<?php $this->form_validation->set_error_delimiters('', ''); ?>
<input type="hidden" name="id" value="<?php echo $this->uri->segment(3); ?>" />
<div class="mb-2">
<label for="floatingInput"><strong><?= __("Username"); ?></strong></label>
<input type="text" name="user_name" class="form-control" id="floatingInput" placeholder="<?= __("Username"); ?>" value="<?php echo $this->input->post('user_name'); ?>" autofocus>
<input type="text" name="user_name" class="form-control" id="floatingInput" placeholder="<?php if (file_exists('.demo')) { echo "demo"; } else { echo __("Username"); } ?>" value="<?php echo $this->input->post('user_name'); ?>" autofocus>
</div>
<div class="mb-2">
<label for="floatingPassword"><strong><?= __("Password"); ?></strong></label>
<input type="password" name="user_password" class="form-control" id="floatingPassword" placeholder="<?= __("Password"); ?>">
<input type="password" name="user_password" class="form-control" id="floatingPassword" placeholder="<?php if (file_exists('.demo')) { echo "demo"; } else { echo __("Password"); } ?>">
</div>
<div class="mb-2">
<div class="row">