mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 08:55:55 +00:00
remove $link
This commit is contained in:
14
backend.php
14
backend.php
@@ -50,7 +50,7 @@
|
||||
|
||||
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
||||
|
||||
if (!init_plugins($link)) return;
|
||||
if (!init_plugins()) return;
|
||||
|
||||
header("Content-Type: text/json; charset=utf-8");
|
||||
|
||||
@@ -59,16 +59,16 @@
|
||||
}
|
||||
|
||||
if (SINGLE_USER_MODE) {
|
||||
authenticate_user($link, "admin", null);
|
||||
authenticate_user( "admin", null);
|
||||
}
|
||||
|
||||
if ($_SESSION["uid"]) {
|
||||
if (!validate_session($link)) {
|
||||
if (!validate_session()) {
|
||||
header("Content-Type: text/json");
|
||||
print json_encode(array("error" => array("code" => 6)));
|
||||
return;
|
||||
}
|
||||
load_user_plugins($link, $_SESSION["uid"]);
|
||||
load_user_plugins( $_SESSION["uid"]);
|
||||
}
|
||||
|
||||
$purge_intervals = array(
|
||||
@@ -106,7 +106,7 @@
|
||||
5 => __("Power User"),
|
||||
10 => __("Administrator"));
|
||||
|
||||
#$error = sanity_check($link);
|
||||
#$error = sanity_check();
|
||||
|
||||
#if ($error['code'] != 0 && $op != "logout") {
|
||||
# print json_encode(array("error" => $error));
|
||||
@@ -123,7 +123,7 @@
|
||||
if ($override) {
|
||||
$handler = $override;
|
||||
} else {
|
||||
$handler = new $op($link, $_REQUEST);
|
||||
$handler = new $op(Db::get(), $_REQUEST);
|
||||
}
|
||||
|
||||
if ($handler && implements_interface($handler, 'IHandler')) {
|
||||
@@ -155,5 +155,5 @@
|
||||
print json_encode(array("error" => array("code" => 7)));
|
||||
|
||||
// We close the connection to database.
|
||||
db_close($link);
|
||||
db_close();
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user