login_form.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <?php startup_gettext(); ?>
  2. <html>
  3. <head>
  4. <title>Tiny Tiny RSS : Login</title>
  5. <?php echo stylesheet_tag("lib/dijit/themes/claro/claro.css") ?>
  6. <?php echo stylesheet_tag("css/default.css") ?>
  7. <link rel="shortcut icon" type="image/png" href="images/favicon.png">
  8. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  9. <?php
  10. foreach (array("lib/prototype.js",
  11. "lib/dojo/dojo.js",
  12. "lib/dojo/tt-rss-layer.js",
  13. "js/common.js",
  14. "errors.php?mode=js") as $jsfile) {
  15. echo javascript_tag($jsfile);
  16. } ?>
  17. <script type="text/javascript">
  18. require({cache:{}});
  19. </script>
  20. </head>
  21. <body class="claro ttrss_main ttrss_login">
  22. <script type="text/javascript">
  23. require(['dojo/parser', "dojo/ready", 'dijit/form/Button','dijit/form/CheckBox','dijit/form/Form',
  24. 'dijit/form/Select','dijit/form/TextBox','dijit/form/ValidationTextBox'],function(parser, ready){
  25. ready(function() {
  26. parser.parse();
  27. //show tooltip node only after this widget is instaniated.
  28. dojo.query('div[dojoType="dijit.Tooltip"]').style({
  29. display:''
  30. });
  31. fetchProfiles();
  32. dijit.byId("bw_limit").attr("checked", Cookie.get("ttrss_bwlimit") == 'true');
  33. document.forms.loginForm.login.focus();
  34. });
  35. });
  36. function fetchProfiles() {
  37. const query = "op=getProfiles&login=" + encodeURIComponent(document.forms["loginForm"].login.value);
  38. new Ajax.Request("public.php", {
  39. parameters: query,
  40. onComplete: function(transport) {
  41. if (transport.responseText.match("select")) {
  42. $('profile_box').innerHTML = transport.responseText;
  43. //dojo.parser.parse('profile_box');
  44. }
  45. } });
  46. }
  47. function gotoRegForm() {
  48. window.location.href = "register.php";
  49. return false;
  50. }
  51. function bwLimitChange(elem) {
  52. Cookie.set("ttrss_bwlimit", elem.checked,
  53. <?php print SESSION_COOKIE_LIFETIME ?>);
  54. }
  55. </script>
  56. <?php $return = urlencode($_SERVER["REQUEST_URI"]) ?>
  57. <form action="public.php?return=<?php echo $return ?>"
  58. dojoType="dijit.form.Form" method="POST" id="loginForm" name="loginForm">
  59. <input dojoType="dijit.form.TextBox" style="display : none" name="op" value="login">
  60. <div class='header'>
  61. <img src="images/logo_wide.png">
  62. </div>
  63. <div class='form'>
  64. <fieldset>
  65. <?php if ($_SESSION["login_error_msg"]) { ?>
  66. <div class="row-error">
  67. <?php echo $_SESSION["login_error_msg"] ?>
  68. </div>
  69. <?php $_SESSION["login_error_msg"] = ""; ?>
  70. <?php } ?>
  71. <div class="row">
  72. <label><?php echo __("Login:") ?></label>
  73. <input name="login" class="input input-text" type="text"
  74. onchange="fetchProfiles()" onfocus="fetchProfiles()" onblur="fetchProfiles()"
  75. style="width : 220px"
  76. required="1"
  77. value="<?php echo $_SESSION["fake_login"] ?>" />
  78. </div>
  79. <div class="row">
  80. <label><?php echo __("Password:") ?></label>
  81. <input type="password" name="password" required="1"
  82. style="width : 220px" class="input input-text"
  83. value="<?php echo $_SESSION["fake_password"] ?>"/>
  84. <label></label>
  85. <?php if (strpos(PLUGINS, "auth_internal") !== FALSE) { ?>
  86. <a class='forgotpass' href="public.php?op=forgotpass"><?php echo __("I forgot my password") ?></a>
  87. <?php } ?>
  88. </div>
  89. <div class="row">
  90. <label><?php echo __("Profile:") ?></label>
  91. <span id='profile_box'><select disabled='disabled' dojoType='dijit.form.Select'
  92. style='width : 220px; margin : 0px'>
  93. <option><?php echo __("Default profile") ?></option></select></span>
  94. </div>
  95. <div class="row">
  96. <label>&nbsp;</label>
  97. <input dojoType="dijit.form.CheckBox" name="bw_limit" id="bw_limit" type="checkbox"
  98. onchange="bwLimitChange(this)">
  99. <label id="bw_limit_label" style='display : inline' for="bw_limit"><?php echo __("Use less traffic") ?></label>
  100. </div>
  101. <div dojoType="dijit.Tooltip" connectId="bw_limit_label" position="below" style="display:none">
  102. <?php echo __("Does not display images in articles, reduces automatic refreshes."); ?>
  103. </div>
  104. <?php if (SESSION_COOKIE_LIFETIME > 0) { ?>
  105. <div class="row">
  106. <label>&nbsp;</label>
  107. <input dojoType="dijit.form.CheckBox" name="remember_me" id="remember_me" type="checkbox">
  108. <label style='display : inline' for="remember_me"><?php echo __("Remember me") ?></label>
  109. </div>
  110. <?php } ?>
  111. <div class="row" style='text-align : right'>
  112. <button dojoType="dijit.form.Button" type="submit"><?php echo __('Log in') ?></button>
  113. <?php if (defined('ENABLE_REGISTRATION') && ENABLE_REGISTRATION) { ?>
  114. <button onclick="return gotoRegForm()" dojoType="dijit.form.Button">
  115. <?php echo __("Create new account") ?></button>
  116. <?php } ?>
  117. </div>
  118. </fieldset>
  119. </div>
  120. <div class='footer'>
  121. <a href="http://tt-rss.org/">Tiny Tiny RSS</a>
  122. &copy; 2005&ndash;<?php echo date('Y') ?> <a href="http://fakecake.org/">Andrew Dolgov</a>
  123. </div>
  124. </form>
  125. </body></html>