login.html.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php if (!defined('HTMLY')) die('HTMLy'); ?>
  2. <style>.error-message ul {margin:0;padding:0;}</style>
  3. <?php if (isset($error)) { ?>
  4. <div class="error-message"><?php echo $error ?></div>
  5. <?php } ?>
  6. <?php if (!login()) { ?>
  7. <h1><?php echo i18n('Login');?></h1>
  8. <form method="POST" action="login">
  9. <label><?php echo i18n('User');?> <span class="required">*</span></label>
  10. <input type="text" class="form-control <?php if (isset($username)) {
  11. if (empty($username)) {
  12. echo 'error';
  13. }
  14. } ?>" name="user" placeholder="<?php echo i18n('User'); ?>"/>
  15. <br>
  16. <label><?php echo i18n('Password');?> <span class="required">*</span></label>
  17. <input type="password" class="form-control <?php if (isset($password)) {
  18. if (empty($password)) {
  19. echo 'error';
  20. }
  21. } ?>" name="password" placeholder="<?php echo i18n('Password'); ?>"/>
  22. <br>
  23. <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
  24. <?php if (config('login.protect.system') === 'google'): ?>
  25. <script src='https://www.google.com/recaptcha/api.js'></script>
  26. <div class="g-recaptcha" data-sitekey="<?php echo config("login.protect.public"); ?>"></div>
  27. <br/>
  28. <?php endif; ?>
  29. <?php if (config('login.protect.system') === 'cloudflare'): ?>
  30. <script src="https://challenges.cloudflare.com/turnstile/v0/api.js" defer></script>
  31. <div style="text-align:center;" class="cf-turnstile" data-sitekey="<?php echo config("login.protect.public"); ?>"></div>
  32. <br/>
  33. <?php endif; ?>
  34. <input type="submit" class="btn btn-primary" name="submit" value="<?php echo i18n('Login');?>"/>
  35. </form>
  36. <?php } else {
  37. header('location: admin');
  38. } ?>