]> git.wh0rd.org - tt-rss.git/commitdiff
reinstate redirecting login system (problems with Gears)
authorAndrew Dolgov <fox@bah.org.ru>
Thu, 12 Feb 2009 07:29:19 +0000 (10:29 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Thu, 12 Feb 2009 07:29:19 +0000 (10:29 +0300)
functions.js
functions.php
login.php [new file with mode: 0644]
manifest.json

index 896b6029b280a6972d466c4a8b7eb2e32f74f0c9..5c0564897f967130d05c5292caf3201bee26935b 100644 (file)
@@ -1503,7 +1503,7 @@ function fatalError(code, msg, ext_info) {
                if (!ext_info) ext_info = "N/A";
 
                if (code == 6) {
-                       window.location.href = "tt-rss.php?login";                      
+                       window.location.href = "login.php";                     
                } else if (code == 5) {
                        window.location.href = "update.php";
                } else {
index 21355f7822858b238eceadf3d4197d89c0bb0215..6e386c508082dbbc2d7b6859542f6dbd89c2c9a5 100644 (file)
                        }
 
                        if (!$_SESSION["uid"] || !validate_session($link)) {
-                               render_login_form($link, $mobile);
+                               //render_login_form($link, $mobile);
+                               header("Location: login.php");
                                exit;
                        } else {
                                /* bump login timestamp */
diff --git a/login.php b/login.php
new file mode 100644 (file)
index 0000000..71f2e73
--- /dev/null
+++ b/login.php
@@ -0,0 +1,186 @@
+<?php
+       error_reporting(E_ERROR | E_WARNING | E_PARSE);
+
+       require_once "functions.php"; 
+       require_once "sessions.php";
+       require_once "sanity_check.php";
+       require_once "version.php"; 
+       require_once "config.php";
+       require_once "db-prefs.php";
+
+       $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); 
+
+
+       $dt_add = get_script_dt_add();
+
+       no_cache_incantation();
+
+       header('Content-Type: text/html; charset=utf-8');
+       
+?>
+
+<html>
+<head>
+       <title>Tiny Tiny RSS : Login</title>
+       <link rel="stylesheet" type="text/css" href="tt-rss.css">
+       <link rel="shortcut icon" type="image/png" href="images/favicon.png">
+       <!--[if gte IE 5.5000]>
+               <script type="text/javascript" src="pngfix.js"></script>
+       <![endif]-->
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+       <script type="text/javascript" src="lib/prototype.js"></script>
+       <script type="text/javascript" src="lib/scriptaculous/scriptaculous.js"></script>
+       <script type="text/javascript" src="functions.js"></script>
+</head>
+
+<body>
+
+<script type="text/javascript">
+function init() {
+
+       if (arguments.callee.done) return;
+       arguments.callee.done = true;           
+
+       var login = document.forms["loginForm"].login;
+
+       var limit_set = getCookie("ttrss_bwlimit");
+
+       if (limit_set == "true") {
+               document.forms["loginForm"].bw_limit.checked = true;
+       }
+
+       login.focus();
+
+}
+function languageChange(elem) {
+       try {
+               document.forms['loginForm']['click'].disabled = true;
+       
+               var lang = elem[elem.selectedIndex].value;
+               setCookie("ttrss_lang", lang, <?php print SESSION_COOKIE_LIFETIME ?>);
+               window.location.reload();
+       } catch (e) {
+               exception_error("languageChange", e);
+       }
+}
+
+function gotoRegForm() {
+       window.location.href = "register.php";
+       return false;
+}
+
+function bwLimitChange(elem) {
+       try {
+               var limit_set = elem.checked;
+
+               setCookie("ttrss_bwlimit", limit_set, 
+                       <?php print SESSION_COOKIE_LIFETIME ?>);
+
+       } catch (e) {
+               exception_error("bwLimitChange", e);
+       }
+}
+
+function validateLoginForm(f) {
+       try {
+
+               if (f.login.value.length == 0) {
+                       new Effect.Highlight(f.login);
+                       return false;
+               }
+
+               if (f.password.value.length == 0) {
+                       new Effect.Highlight(f.password);
+                       return false;
+               }
+
+               document.forms['loginForm']['click'].disabled = true;
+
+               return true;
+       } catch (e) {
+               exception_error("validateLoginForm", e);
+               return true;
+       }
+}
+</script>
+
+<script type="text/javascript">
+if (document.addEventListener) {
+       document.addEventListener("DOMContentLoaded", init, null);
+}
+window.onload = init;
+</script>
+
+<form action="tt-rss.php" method="POST" name="loginForm" onsubmit="return validateLoginForm(this)">
+<input type="hidden" name="login_action" value="do_login">
+
+<table width="100%" class="loginForm2">
+<tr>
+       <td class="loginTop" valign="bottom" align="left">
+               <img src="images/ttrss_logo_big.png" alt="Logo">
+       </td>
+</tr><tr>
+       <td align="center" valign="middle" class="loginMiddle" height="100%">
+               <?php if ($_SESSION['login_error_msg']) { ?>
+                       <div class="loginError"><?php echo $_SESSION['login_error_msg'] ?></div>
+                       <?php $_SESSION['login_error_msg'] = ""; ?>
+               <?php } ?>
+               <table>
+                       <tr><td align="right"><?php echo __("Login:") ?></td>
+                       <td align="right"><input name="login" 
+                               value="<?php echo $_SERVER["REMOTE_USER"] ?>"></td></tr>
+                       <tr><td align="right"><?php echo __("Password:") ?></td>
+                       <td align="right"><input type="password" name="password"
+                               value="<?php echo $_SERVER["REMOTE_USER"] ?>"></td></tr>
+                       <?php if (ENABLE_TRANSLATIONS) { ?>
+                       <tr><td align="right"><?php echo __("Language:") ?></td>
+                       <td align="right">
+                       <?php
+                               print_select_hash("language", $_COOKIE["ttrss_lang"], get_translations(),
+                                       "style='width : 100%' onchange='languageChange(this)'");
+
+                       ?>
+                       </td></tr>
+                       <?php } ?>
+                       <!-- <tr><td colspan="2">
+                               <input type="checkbox" name="remember_me" id="remember_me">
+                               <label for="remember_me">Remember me on this computer</label>
+                       </td></tr> -->
+
+                       <tr><td colspan="2" align="right" class="innerLoginCell">
+
+                       <input type="submit" class="button" value="<?php echo __('Log in') ?>" name='click'>
+                       <?php if (defined('ENABLE_REGISTRATION') && ENABLE_REGISTRATION) { ?>
+                               <input type="submit" class="button" onclick="return gotoRegForm()"
+                                       value="<?php echo __("Create new account") ?>"/>
+                       <?php } ?>
+
+                               <input type="hidden" name="action" value="login">
+                               <input type="hidden" name="rt" 
+                                       value="<?php if ($return_to != 'none') { echo $return_to; } ?>">
+                       </td></tr>
+
+                       <tr><td colspan="2" align="right" class="innerLoginCell">
+
+                       <div class="small">
+                       <input name="bw_limit" id="bw_limit" type="checkbox"
+                               onchange="bwLimitChange(this)">
+                       <label for="bw_limit">
+                       <?php echo __("Limit bandwidth usage") ?></label></div>
+
+                       </td></tr>
+
+
+               </table>
+       </td>
+</tr><tr>
+       <td align="center" class="loginBottom">
+               <a href="http://tt-rss.org/">Tiny Tiny RSS</a> &copy; 2005&ndash;2009 <a href="http://bah.org.ru/">Andrew Dolgov</a>
+       </td>
+</tr>
+
+</table>
+
+</form>
+
+</body></html>
index 0d96199e14501b744677e1165fe012d3dd1dd91a..025ef889c075b4a2506037c0cab5b7334e6657dc 100644 (file)
@@ -1,6 +1,6 @@
 {
   "betaManifestVersion": 1,
-  "version": "3",
+  "version": "4",
   "entries": [
       { "url": "tt-rss.php"},
       { "url": "tt-rss.css"},