Commit 016b31ae authored by Marcelo Jorge Vieira's avatar Marcelo Jorge Vieira

Imported Upstream version 1.4.1

parent 9fb9b29a
This diff is collapsed.
......@@ -4,88 +4,33 @@ Tiny Tiny RSS
Web-based news feed aggregator, designed to allow you to read news from
any location, while feeling as close to a real desktop application as possible.
http://tt-rss.spb.ru
Copyright (C) 2005 Andrew Dolgov unless stated otherwise.
Portions (C):
Bob Osola <bobosola@gmail.com> (pngfix.js)
Sundar Dorai-Raj <sdoraira@vt.edu> (isNumeric() in functions.js)
Sean M. Burke. <sburke@cpan.org> (xsl_mop-up.js)
Other bundled libraries:
Prototype javascript library, from http://prototype.conio.net/
Script.aculo.us javascript library, http://http://script.aculo.us/
MagpieRSS feed parser, http://magpierss.sourceforge.net/
SimplePie feed parser, http://simplepie.org/
PHPMailer class, http://phpmailer.sourceforge.net/
http://tt-rss.org
Licensed under GNU GPL version 2
Features Overview
=================
Updates: http://tt-rss.spb.ru/trac/wiki/FeatureList
* Server-side application, user only needs a web browser
* Supports RSS, RDF, Atom feeds using Magpie or SimplePie library
* Supports OPML import/export
* Easy setup and configuration
* Streamlined interface using XmlHttpRequest (or AJAX for laypeople)
Copyright (c) 2005-2010 Andrew Dolgov (unless explicitly stated otherwise).
Requirements
============
* Compatible browser on the client side
Basically, Firefox, Konqueror or MSIE6 are okay. See here
for more information:
http://tt-rss.spb.ru/trac/wiki/CompatibleBrowsers
* Compatible web browser (http://tt-rss.org/wiki/CompatibleBrowsers)
* Web server, for example Apache
* PHP (requires PHP4 DOMXML extension)
* PostgreSQL (tested on 7.4) or MySQL (InnoDB and version 4.1+ required)
* XML-RPC for PHP library for XML-RPC support. Optional.
http://phpxmlrpc.sourceforge.net
* PHP (with support for mbstring functions)
* PostgreSQL (tested on 8.3) or MySQL (InnoDB and version 4.1+ required)
Installation Notes
==================
Updates: http://tt-rss.spb.ru/trac/wiki/InstallationNotes
* If you are upgrading from the previous version, don't forget to update
schema and logout.
* icons directory should be writable to your httpd user if you plan on
using feed icons
* Leave DB_HOST empty if you want to connect to database via unix socket
* For PostgreSQL don't forget to create database with UTF-8 encoding
createdb -E utf-8 -O owner_user database)
* Don't forget to change your password from default value on your first login
* Check your config.php for blank lines out of PHP code tags (e.g.
before <? and after ?>), See #1
* Default username:password for multiuser mode is admin:password.
http://tt-rss.org/wiki/InstallationNotes
See also
========
* FAQ: http://tt-rss.spb.ru/trac/wiki/FrequentlyAskedQuestions
* Forum: http://tt-rss.spb.ru/forum
* Wiki: http://tt-rss.spb.ru/trac/wiki/WikiStart
* Bug Tracker: http://tt-rss.spb.ru/trac/report
* FAQ: http://tt-rss.org/wiki/FrequentlyAskedQuestions
* Forum: http://tt-rss.org/forum
* Wiki: http://tt-rss.org/wiki/WikiStart
Contact
=======
Send your questions, comments, patches to Andrew Dolgov <cthulhoo@gmail.com>
Send your questions, comments, patches to Andrew Dolgov <cthulhoo(at)gmail.com>
This diff is collapsed.
This diff is collapsed.
......@@ -30,25 +30,13 @@
define('ICONS_DIR', "icons");
define('ICONS_URL', "icons");
// Local and URL path to the directory, where feed favicons are stored.
// Unless you really know what you're doing, please keep those relative
// to tt-rss main directory.
define('SINGLE_USER_MODE', true);
// Operate in single user mode, disables all functionality related to
// multiple users.
define('SMART_RPC_COUNTERS', false);
// If enabled, stores feed counter information on the server side and sends
// only diffs to the client. In the nutshell, it saves your bandwidth and
// makes UI more responsive, but eats server memory.
// This option can introduce a lot of weird interface glitches in
// some use-cases (if you have more than one tt-rss window open, for example)
// so it is disabled by default.
define('GLOBAL_ENABLE_LABELS', false);
// Labels are a security risk, so this option can globally disable them for all users.
define('MAIL_RESET_PASS', true);
// Send mail to user on password reset
define('ENABLE_FEED_BROWSER', true);
// Enable or disable local feed browser
......@@ -112,9 +100,8 @@
// If update daemon and update_feeds should send digests
// Disable if you prefer querying special URL (see wiki)
define('ENABLE_TRANSLATIONS', false);
// Enable experimental support for interface translations
// based on PHP-Gettext. This is of no much use right now.
define('ENABLE_TRANSLATIONS', true);
// Enable support for interface translations
define('MYSQL_CHARSET', '');
// Connection charset for MySQL. Only enable if having charset-related
......@@ -164,7 +151,7 @@
// outgoing mail. Require DIGEST_SMTP_HOST.
define('DAEMON_FEED_LIMIT', 100);
// Limits the amount of feeds daemon updates on one run
// Limits the amount of feeds daemon (or a cronjob) updates on one run
define('ALLOW_REMOTE_USER_AUTH', false);
// Set to 'true' if you trust your web server's REMOTE_USER
......@@ -187,7 +174,29 @@
define('PHP_EXECUTABLE', '/usr/bin/php');
// Path to PHP executable
define('CONFIG_VERSION', 17);
define('ENABLE_REGISTRATION', false);
// Allow users to register themselves. Please be vary that allowing
// random people to access your tt-rss installation is a security risk
// and potentially might lead to data loss or server exploit. Disabled
// by default.
define('REG_NOTIFY_ADDRESS', 'user@your.domain.dom');
// Email address to send new user notifications to.
define('REG_MAX_USERS', 10);
// Maximum amount of users which will be allowed to register on this
// system. 0 - no limit.
define('FEEDBACK_URL', '');
// Displays an URL for users to provide feedback or comments regarding
// this instance of tt-rss. Can lead to a forum, contact email, etc.
define('FORCE_ARTICLE_PURGE', 0);
// When this option is not 0, users ability to control feed purging
// intervals is disabled and all articles (which are not starred)
// older than this amount of days are purged.
define('CONFIG_VERSION', 18);
// Expected config version. Please update this option in config.php
// if necessary (after migrating all new options from this file).
......
......@@ -2,7 +2,7 @@
require_once "config.php";
require_once "db.php";
if (!defined('DISABLE_SESSIONS') && !SINGLE_USER_MODE) {
if (!defined('DISABLE_SESSIONS')) {
if (!$_SESSION["prefs_cache"])
$_SESSION["prefs_cache"] = array();
}
......@@ -14,11 +14,20 @@
if (!$user_id) {
$user_id = $_SESSION["uid"];
$profile = $_SESSION["profile"];
} else {
$user_id = sprintf("%d", $user_id);
$prefs_cache = false;
}
if ($profile) {
$profile_qpart = "profile = '$profile' AND";
} else {
$profile_qpart = "profile IS NULL AND";
}
if (get_schema_version($link) < 63) $profile_qpart = "";
if ($prefs_cache && !defined('DISABLE_SESSIONS') && !SINGLE_USER_MODE) {
if ($_SESSION["prefs_cache"] && $_SESSION["prefs_cache"][$pref_name]) {
$tuple = $_SESSION["prefs_cache"][$pref_name];
......@@ -31,6 +40,7 @@
FROM
ttrss_user_prefs,ttrss_prefs,ttrss_prefs_types
WHERE
$profile_qpart
ttrss_user_prefs.pref_name = '$pref_name' AND
ttrss_prefs_types.id = type_id AND
owner_uid = '$user_id' AND
......@@ -68,17 +78,55 @@
}
}
// doesn't peform any type checking, be vigilant
function set_pref($link, $key, $value) {
function set_pref($link, $key, $value, $user_id = false) {
$key = db_escape_string($key);
$value = db_escape_string($value);
db_query($link, "UPDATE ttrss_user_prefs SET
value = '$value' WHERE pref_name = '$key'
AND owner_uid = " . $_SESSION["uid"]);
$_SESSION["prefs_cache"] = array();
if (!$user_id) {
$user_id = $_SESSION["uid"];
$profile = $_SESSION["profile"];
} else {
$user_id = sprintf("%d", $user_id);
$prefs_cache = false;
}
if ($profile) {
$profile_qpart = "AND profile = '$profile'";
} else {
$profile_qpart = "AND profile IS NULL";
}
if (get_schema_version($link) < 63) $profile_qpart = "";
$result = db_query($link, "SELECT type_name
FROM ttrss_prefs,ttrss_prefs_types
WHERE pref_name = '$key' AND type_id = ttrss_prefs_types.id");
if (db_num_rows($result) > 0) {
$type_name = db_fetch_result($result, 0, "type_name");
if ($type_name == "bool") {
if ($value == "1" || $value == "true") {
$value = "true";
} else {
$value = "false";
}
} else if ($type_name == "integer") {
$value = sprintf("%d", $value);
}
if ($pref_name == 'DEFAULT_ARTICLE_LIMIT' && $value == 0) {
$value = 30;
}
db_query($link, "UPDATE ttrss_user_prefs SET
value = '$value' WHERE pref_name = '$key'
$profile_qpart
AND owner_uid = " . $_SESSION["uid"]);
$_SESSION["prefs_cache"] = array();
}
}
?>
......@@ -45,16 +45,6 @@ function db_escape_string($s) {
}
}
/* I hate MySQL :( */
function db_escape_string_2($s, $link) {
if (DB_TYPE == "pgsql") {
return pg_escape_string($s);
} else {
return mysql_real_escape_string($s, $link);
}
}
function db_query($link, $query, $die_on_error = true) {
if (DB_TYPE == "pgsql") {
$result = pg_query($link, $query);
......@@ -77,14 +67,6 @@ function db_query($link, $query, $die_on_error = true) {
}
}
function db_query_2($query) {
if (DB_TYPE == "pgsql") {
return pg_query($query);
} else if (DB_TYPE == "mysql") {
return mysql_query($link);
}
}
function db_fetch_assoc($result) {
if (DB_TYPE == "pgsql") {
return pg_fetch_assoc($result);
......
......@@ -28,4 +28,6 @@
official site for more information.");
$ERRORS[11] = "[This error is not returned by server]";
$ERRORS[12] = __("SQL escaping test failed, check your database and PHP configuration");
?>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// Copyright 2007, Google Inc.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// 3. Neither the name of Google Inc. nor the names of its contributors may be
// used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Sets up google.gears.*, which is *the only* supported way to access Gears.
//
// Circumvent this file at your own risk!
//
// In the future, Gears may automatically define google.gears.* without this
// file. Gears may use these objects to transparently fix bugs and compatibility
// issues. Applications that use the code below will continue to work seamlessly
// when that happens.
(function() {
// We are already defined. Hooray!
if (window.google && google.gears) {
return;
}
var factory = null;
// Firefox
if (typeof GearsFactory != 'undefined') {
factory = new GearsFactory();
} else {
// IE
try {
factory = new ActiveXObject('Gears.Factory');
// privateSetGlobalObject is only required and supported on IE Mobile on
// WinCE.
if (factory.getBuildInfo().indexOf('ie_mobile') != -1) {
factory.privateSetGlobalObject(this);
}
} catch (e) {
// Safari
if ((typeof navigator.mimeTypes != 'undefined')
&& navigator.mimeTypes["application/x-googlegears"]) {
factory = document.createElement("object");
factory.style.display = "none";
factory.width = 0;
factory.height = 0;
factory.type = "application/x-googlegears";
document.documentElement.appendChild(factory);
}
}
}
// *Do not* define any objects if Gears is not installed. This mimics the
// behavior of Gears defining the objects in the future.
if (!factory) {
return;
}
// Now set up the objects, being careful not to overwrite anything.
//
// Note: In Internet Explorer for Windows Mobile, you can't add properties to
// the window object. However, global objects are automatically added as
// properties of the window object in all browsers.
if (!window.google) {
google = {};
}
if (!google.gears) {
google.gears = {factory: factory};
}
})();
/* #infoBox {
font-size : small;
position : relative;
top : 30%;
left : 30%;
width : 30%;
padding-bottom : 5px;
}
#infoBoxShadow {
background-image : url("images/overlay.png");
left : 0;
top : 0;
height : 100%;
width : 100%;
z-index : 3;
position : absolute;
display : none;
}
*/