login_form.php 6.3 KB

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