login_form.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <html>
  2. <head>
  3. <title>Tiny Tiny RSS : Login</title>
  4. <link rel="stylesheet" type="text/css" href="lib/dijit/themes/claro/claro.css"/>
  5. <link rel="stylesheet" type="text/css" href="tt-rss.css">
  6. <link rel="shortcut icon" type="image/png" href="images/favicon.png">
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  8. <script type="text/javascript" src="lib/dojo/dojo.js"></script>
  9. <script type="text/javascript" src="lib/dijit/dijit.js"></script>
  10. <script type="text/javascript" src="lib/dojo/tt-rss-layer.js"></script>
  11. <script type="text/javascript" src="lib/prototype.js"></script>
  12. <script type="text/javascript" src="js/functions.js"></script>
  13. <script type="text/javascript" charset="utf-8" src="errors.php?mode=js"></script>
  14. <script type="text/javascript">
  15. Event.observe(window, 'load', function() {
  16. init();
  17. });
  18. </script>
  19. <style type="text/css">
  20. body#ttrssLogin {
  21. padding : 2em;
  22. font-size : 14px;
  23. }
  24. fieldset {
  25. margin-left : auto;
  26. margin-right : auto;
  27. display : block;
  28. width : 400px;
  29. border-width : 0px;
  30. }
  31. input.input {
  32. font-family : sans-serif;
  33. font-size : medium;
  34. border-spacing : 2px;
  35. border : 1px solid #b5bcc7;
  36. padding : 2px;
  37. }
  38. label {
  39. width : 120px;
  40. margin-right : 20px;
  41. display : inline-block;
  42. text-align : right;
  43. color : gray;
  44. }
  45. div.header {
  46. border-width : 0px 0px 1px 0px;
  47. border-style : solid;
  48. border-color : #88b0f0;
  49. margin-bottom : 1em;
  50. padding-bottom : 5px;
  51. }
  52. div.footer {
  53. margin-top : 1em;
  54. padding-top : 5px;
  55. border-width : 1px 0px 0px 0px;
  56. border-style : solid;
  57. border-color : #88b0f0;
  58. text-align : center;
  59. color : gray;
  60. font-size : 12px;
  61. }
  62. div.footer a {
  63. color : gray;
  64. }
  65. div.footer a:hover {
  66. color : #88b0f0;
  67. }
  68. div.row {
  69. padding : 0px 0px 5px 0px;
  70. }
  71. div.row-error {
  72. color : red;
  73. text-align : center;
  74. padding : 0px 0px 5px 0px;
  75. }
  76. </style>
  77. </head>
  78. <body id="ttrssLogin" class="claro">
  79. <script type="text/javascript">
  80. function init() {
  81. dojo.require("dijit.form.Button");
  82. dojo.require("dijit.form.CheckBox");
  83. dojo.require("dijit.form.Form");
  84. dojo.require("dijit.form.Select");
  85. dojo.require("dijit.form.TextBox");
  86. dojo.require("dijit.form.ValidationTextBox");
  87. dojo.parser.parse();
  88. fetchProfiles();
  89. dijit.byId("bw_limit").attr("checked", getCookie("ttrss_bwlimit") == 'true');
  90. document.forms.loginForm.login.focus();
  91. }
  92. function fetchProfiles() {
  93. try {
  94. var query = "?op=getProfiles&login=" + param_escape(document.forms["loginForm"].login.value);
  95. if (query) {
  96. new Ajax.Request("public.php", {
  97. parameters: query,
  98. onComplete: function(transport) {
  99. if (transport.responseText.match("select")) {
  100. $('profile_box').innerHTML = transport.responseText;
  101. dojo.parser.parse('profile_box');
  102. }
  103. } });
  104. }
  105. } catch (e) {
  106. exception_error("fetchProfiles", e);
  107. }
  108. }
  109. function gotoRegForm() {
  110. window.location.href = "register.php";
  111. return false;
  112. }
  113. function bwLimitChange(elem) {
  114. try {
  115. var limit_set = elem.checked;
  116. setCookie("ttrss_bwlimit", limit_set,
  117. <?php print SESSION_COOKIE_LIFETIME ?>);
  118. } catch (e) {
  119. exception_error("bwLimitChange", e);
  120. }
  121. }
  122. </script>
  123. <?php $return = urlencode($_SERVER["REQUEST_URI"]) ?>
  124. <form action="public.php?return=<?php echo $return ?>"
  125. dojoType="dijit.form.Form" method="POST" id="loginForm" name="loginForm">
  126. <input dojoType="dijit.form.TextBox" style="display : none" name="op" value="login">
  127. <div class='header'>
  128. <img src="images/logo_wide.png">
  129. </div>
  130. <div class='form'>
  131. <fieldset>
  132. <?php if ($_SESSION["login_error_msg"]) { ?>
  133. <div class="row-error">
  134. <?php echo $_SESSION["login_error_msg"] ?>
  135. </div>
  136. <?php $_SESSION["login_error_msg"] = ""; ?>
  137. <?php } ?>
  138. <div class="row">
  139. <label><?php echo __("Login:") ?></label>
  140. <input name="login" class="input"
  141. onchange="fetchProfiles()" onfocus="fetchProfiles()" onblur="fetchProfiles()"
  142. style="width : 220px"
  143. required="1"
  144. value="<?php echo $_SESSION["fake_login"] ?>" />
  145. </div>
  146. <div class="row">
  147. <label><?php echo __("Password:") ?></label>
  148. <input type="password" name="password" required="1"
  149. style="width : 220px" class="input"
  150. value="<?php echo $_SESSION["fake_password"] ?>"/>
  151. </div>
  152. <div class="row">
  153. <label><?php echo __("Language:") ?></label>
  154. <?php
  155. print_select_hash("language", $_COOKIE["ttrss_lang"], get_translations(),
  156. "style='width : 220px; margin : 0px' dojoType='dijit.form.Select'");
  157. ?>
  158. </div>
  159. <div class="row">
  160. <label><?php echo __("Profile:") ?></label>
  161. <span id='profile_box'><select disabled='disabled' dojoType='dijit.form.Select'
  162. style='width : 220px; margin : 0px'>
  163. <option><?php echo __("Default profile") ?></option></select></span>
  164. </div>
  165. <div class="row">
  166. <label>&nbsp;</label>
  167. <input dojoType="dijit.form.CheckBox" name="bw_limit" id="bw_limit" type="checkbox"
  168. onchange="bwLimitChange(this)">
  169. <label style='display : inline' for="bw_limit"><?php echo __("Use less traffic") ?></label>
  170. </div>
  171. <div class="row" style='text-align : right'>
  172. <button dojoType="dijit.form.Button" type="submit"><?php echo __('Log in') ?></button>
  173. <?php if (defined('ENABLE_REGISTRATION') && ENABLE_REGISTRATION) { ?>
  174. <button onclick="return gotoRegForm()" dojoType="dijit.form.Button">
  175. <?php echo __("Create new account") ?></button>
  176. <?php } ?>
  177. </div>
  178. </fieldset>
  179. </div>
  180. <div class='footer'>
  181. <a href="http://tt-rss.org/">Tiny Tiny RSS</a>
  182. <?php if (!defined('HIDE_VERSION')) { ?>
  183. v<?php echo VERSION ?>
  184. <?php } ?>
  185. &copy; 2005&ndash;<?php echo date('Y') ?> <a href="http://fakecake.org/">Andrew Dolgov</a>
  186. </div>
  187. </form>
  188. </body></html>