Merge branch 'master' into jremote

latest master checkins
This commit is contained in:
justauser 2013-05-29 07:52:20 -04:00
commit 7aab5617b6
8 changed files with 39 additions and 25 deletions

View File

@ -732,6 +732,8 @@ class Handler_Public extends Handler {
}
function forgotpass() {
startup_gettext();
header('Content-Type: text/html; charset=utf-8');
print "<html><head><title>Tiny Tiny RSS</title>";
@ -825,6 +827,8 @@ class Handler_Public extends Handler {
}
function dbupdate() {
startup_gettext();
if (!SINGLE_USER_MODE && $_SESSION["access_level"] < 10) {
$_SESSION["login_error_msg"] = __("Your access level is insufficient to run this script.");
render_login_form();

View File

@ -961,23 +961,28 @@
}
function file_is_locked($filename) {
if (function_exists('flock') && file_exists(LOCK_DIRECTORY . "/$filename")) {
$fp = @fopen(LOCK_DIRECTORY . "/$filename", "r");
if ($fp) {
if (flock($fp, LOCK_EX | LOCK_NB)) {
flock($fp, LOCK_UN);
if (file_exists(LOCK_DIRECTORY . "/$filename")) {
if (function_exists('flock')) {
$fp = @fopen(LOCK_DIRECTORY . "/$filename", "r");
if ($fp) {
if (flock($fp, LOCK_EX | LOCK_NB)) {
flock($fp, LOCK_UN);
fclose($fp);
return false;
}
fclose($fp);
return true;
} else {
return false;
}
fclose($fp);
return true;
} else {
return false;
}
return true; // consider the file always locked and skip the test
} else {
return false;
}
return true; // consider the file always locked and skip the test
}
function make_lockfile($filename) {
$fp = fopen(LOCK_DIRECTORY . "/$filename", "w");

View File

@ -1,3 +1,4 @@
<?php startup_gettext(); ?>
<html>
<head>
<title>Tiny Tiny RSS : Login</title>
@ -6,12 +7,12 @@
<link rel="shortcut icon" type="image/png" href="images/favicon.png">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="lib/dojo/dojo.js"></script>
<script type="text/javascript" src="lib/dijit/dijit.js"></script>
<script type="text/javascript" src="lib/dojo/tt-rss-layer.js"></script>
<script type="text/javascript" src="lib/prototype.js"></script>
<script type="text/javascript" src="js/functions.js"></script>
<script type="text/javascript" charset="utf-8" src="errors.php?mode=js"></script>
<script type="text/javascript">
require({cache:{}});
Event.observe(window, 'load', function() {
init();
});
@ -104,20 +105,19 @@
<script type="text/javascript">
function init() {
dojo.require("dijit.form.Button");
dojo.require("dijit.form.CheckBox");
dojo.require("dijit.form.Form");
dojo.require("dijit.form.Select");
dojo.require("dijit.form.TextBox");
dojo.require("dijit.form.ValidationTextBox");
dojo.parser.parse();
require(['dojo/parser','dijit/form/Button','dijit/form/CheckBox','dijit/form/Form',
'dijit/form/Select','dijit/form/TextBox','dijit/form/ValidationTextBox'],function(parser){
parser.parse();
//show tooltip node only after this widget is instaniated.
dojo.query('div[dojoType="dijit.Tooltip"]').style({
display:''
});
fetchProfiles();
dijit.byId("bw_limit").attr("checked", getCookie("ttrss_bwlimit") == 'true');
document.forms.loginForm.login.focus();
});
fetchProfiles();
dijit.byId("bw_limit").attr("checked", getCookie("ttrss_bwlimit") == 'true');
document.forms.loginForm.login.focus();
}
function fetchProfiles() {
@ -217,7 +217,7 @@ function bwLimitChange(elem) {
<label id="bw_limit_label" style='display : inline' for="bw_limit"><?php echo __("Use less traffic") ?></label>
</div>
<div dojoType="dijit.Tooltip" connectId="bw_limit_label" position="below">
<div dojoType="dijit.Tooltip" connectId="bw_limit_label" position="below" style="display:none">
<?php echo __("Does not display images in articles, reduces automatic refreshes."); ?>
</div>

View File

@ -191,7 +191,7 @@
if (!$result) {
$query = htmlspecialchars($query);
if ($die_on_error) {
die("Query <i>$query</i> failed: " . ($link ? mysql_error($link) : "No connection"));
die("Query <i>$query</i> failed: " . ($link ? function_exists("mysqli_connect") ? mysqli_error($link) : mysql_error($link) : "No connection"));
}
}
return $result;

View File

@ -15,6 +15,8 @@
require_once "config.php";
require_once "db.php";
startup_gettext();
$action = $_REQUEST["action"];
if (!init_plugins()) return;

View File

@ -14,6 +14,7 @@ drop table if exists ttrss_labels;
drop table if exists ttrss_filters2_actions;
drop table if exists ttrss_filters2_rules;
drop table if exists ttrss_filters2;
drop table if exists ttrss_filters;
drop table if exists ttrss_filter_types;
drop table if exists ttrss_filter_actions;
drop table if exists ttrss_user_prefs;

View File

@ -11,6 +11,7 @@ drop table if exists ttrss_labels;
drop table if exists ttrss_filters2_rules;
drop table if exists ttrss_filters2_actions;
drop table if exists ttrss_filters2;
drop table if exists ttrss_filters;
drop table if exists ttrss_filter_types;
drop table if exists ttrss_filter_actions;
drop table if exists ttrss_user_prefs;

View File

@ -203,6 +203,7 @@
if (!$master_handlers_installed) {
_debug("[MASTER] installing shutdown handlers");
pcntl_signal(SIGINT, 'sigint_handler');
pcntl_signal(SIGTERM, 'sigint_handler');
register_shutdown_function('shutdown', posix_getpid());
$master_handlers_installed = true;
}