]> git.wh0rd.org - tt-rss.git/blobdiff - classes/handler/public.php
daemon: add sigterm handler for master
[tt-rss.git] / classes / handler / public.php
index 79ed9d0aed74331cfd583b6d8a57cc9ecbfa7068..3e868d56e8e111d475527f9ae23828ab7d9b4ef7 100644 (file)
@@ -368,14 +368,7 @@ class Handler_Public extends Handler {
                include "rssfuncs.php";
                // Update all feeds needing a update.
                update_daemon_common(0, true, false);
-
-               // Update feedbrowser
-               update_feedbrowser_cache();
-
-               // Purge orphans and cleanup tags
-               purge_orphans();
-
-               cleanup_tags(14, 50000);
+               housekeeping_common(false);
 
                PluginHost::getInstance()->run_hooks(PluginHost::HOOK_UPDATE_TASK, "hook_update_task", $op);
 
@@ -389,9 +382,9 @@ class Handler_Public extends Handler {
                header('Content-Type: text/html; charset=utf-8');
                print "<html><head><title>Tiny Tiny RSS</title>";
 
-               print stylesheet_tag("utility.css");
-               print javascript_tag("lib/prototype.js");
-               print javascript_tag("lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls");
+               stylesheet_tag("css/utility.css");
+               javascript_tag("lib/prototype.js");
+               javascript_tag("lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls");
                print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>
                        </head><body id='sharepopup'>";
 
@@ -485,14 +478,6 @@ class Handler_Public extends Handler {
                                <tr><td align="right"><?php echo __("Password:") ?></td>
                                <td align="right"><input type="password" name="password"
                                value="<?php echo $_SESSION["fake_password"] ?>"></td></tr>
-                       <tr><td align="right"><?php echo __("Language:") ?></td>
-                       <td align="right">
-                       <?php
-                               print_select_hash("language", $_COOKIE["ttrss_lang"], get_translations(),
-                                       "style='width : 100%''");
-
-                       ?>
-                       </td></tr>
                        <tr><td colspan='2'>
                                <button type="submit">
                                        <?php echo __('Log in') ?></button>
@@ -525,7 +510,10 @@ class Handler_Public extends Handler {
                        if (authenticate_user($login, $password)) {
                                $_POST["password"] = "";
 
-                               $_SESSION["language"] = $_POST["language"];
+                               if (get_schema_version() >= 120) {
+                                       $_SESSION["language"] = get_pref("USER_LANGUAGE", $_SESSION["uid"]);
+                               }
+
                                $_SESSION["ref_schema_version"] = get_schema_version(true);
                                $_SESSION["bw_limit"] = !!$_POST["bw_limit"];
 
@@ -565,7 +553,7 @@ class Handler_Public extends Handler {
                        print "<html>
                                <head>
                                        <title>Tiny Tiny RSS</title>
-                                       <link rel=\"stylesheet\" type=\"text/css\" href=\"utility.css\">
+                                       <link rel=\"stylesheet\" type=\"text/css\" href=\"css/utility.css\">
                                        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>
                                </head>
                                <body>
@@ -655,6 +643,7 @@ class Handler_Public extends Handler {
                $feed_url = $this->dbh->escape_string(trim($_REQUEST["feed_url"]));
                $cat_id = $this->dbh->escape_string($_REQUEST["cat_id"]);
                $from = $this->dbh->escape_string($_REQUEST["from"]);
+               $feed_urls = array();
 
                /* only read authentication information from POST */
 
@@ -678,8 +667,10 @@ class Handler_Public extends Handler {
                        break;
                case 4:
                        print_notice(__("Multiple feed URLs found."));
-
-                       $feed_urls = get_feeds_from_html($feed_url);
+                       $contents = @fetch_file_contents($url, false, $auth_login, $auth_pass);
+                       if (is_html($contents)) {
+                               $feed_urls = get_feeds_from_html($url, $contents);
+                       }
                        break;
                case 5:
                        print_error(T_sprintf("Could not subscribe to <b>%s</b>.<br>Can't download the Feed URL.", $feed_url));
@@ -744,8 +735,8 @@ class Handler_Public extends Handler {
                header('Content-Type: text/html; charset=utf-8');
                print "<html><head><title>Tiny Tiny RSS</title>";
 
-               print stylesheet_tag("utility.css");
-               print javascript_tag("lib/prototype.js");
+               stylesheet_tag("css/utility.css");
+               javascript_tag("lib/prototype.js");
 
                print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>
                        </head><body id='forgotpass'>";
@@ -844,7 +835,7 @@ class Handler_Public extends Handler {
                        <head>
                        <title>Database Updater</title>
                        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-                       <link rel="stylesheet" type="text/css" href="utility.css"/>
+                       <link rel="stylesheet" type="text/css" href="css/utility.css"/>
                        </head>
                        <style type="text/css">
                                span.ok { color : #009000; font-weight : bold; }
@@ -929,7 +920,7 @@ class Handler_Public extends Handler {
 
                                        } else {
 
-                                               print "<h2>" . "Tiny Tiny RSS database is up to date." . "</h2>";
+                                               print_notice("Tiny Tiny RSS database is up to date.");
 
                                                print "<p><form method=\"GET\" action=\"index.php\">
                                                        <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\">