SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/views/admin/login_form.php

  1. <?php
  2. /*
  3.  * kate: tab-width 4; indent-width 4; space-indent on; word-wrap off; word-wrap-column 120;
  4.  * :tabSize=4:indentSize=4:noTabs=true:wrap=false:maxLineLen=120:mode=php:
  5.  *
  6.  * Copyright (C) 2015 Karmabunny Pty Ltd.
  7.  *
  8.  * This file is a part of SproutCMS.
  9.  *
  10.  * SproutCMS is free software: you can redistribute it and/or modify it under the terms
  11.  * of the GNU General Public License as published by the Free Software Foundation, either
  12.  * version 3 of the License, or (at your option) any later version.
  13.  *
  14.  * For more information, visit <http://getsproutcms.com>.
  15.  */
  16.  
  17. use Sprout\Helpers\Csrf;
  18. use Sprout\Helpers\Enc;
  19.  
  20.  
  21. if (!empty($_GET['username'])) {
  22. $autofocus = 'p';
  23. } else {
  24. $autofocus = 'u';
  25. }
  26. ?>
  27.  
  28.  
  29. <form action="SITE/admin/login_action" method="post" class="login-form" autocomplete="off">
  30. <?= Csrf::token(); ?>
  31.  
  32. <input type="hidden" name="redirect" value="<?php echo Enc::html(@$_GET['redirect']); ?>">
  33.  
  34. <div class="field-element field-element--text field-element--required">
  35. <div class="field-label -vis-hidden">
  36. <label for="field0">Username <span class="field-label__required">required</span></label>
  37. </div>
  38. <div class="field-input">
  39. <input id="field0" class="textbox" type="text" name="Username" <?php if ($autofocus == 'u') echo 'autofocus'; ?> value="<?= Enc::html(@$_GET['username']); ?>" placeholder="Username">
  40. </div>
  41. </div>
  42.  
  43. <div class="field-element field-element--text field-element--required">
  44. <div class="field-label -vis-hidden">
  45. <label for="field1">Password <span class="field-label__required">required</span></label>
  46. </div>
  47. <div class="field-input">
  48. <input id="field1" class="textbox" type="password" name="Password" <?php if ($autofocus == 'p') echo 'autofocus'; ?> placeholder="Password">
  49. </div>
  50. </div>
  51.  
  52. <div class="text-align-right">
  53. <button type="submit" class="login-button button button-regular button-green">Log in</button>
  54. </div>
  55. </form>
  56.  
  57.  
  58.