aboutsummaryrefslogtreecommitdiff
path: root/app/Models
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-01-06 12:19:26 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-01-06 12:19:26 +0100
commita26eff8a2084a779959f5bef96a4bc72c7ec6ab7 (patch)
tree03e7f8ebef3fcfc67018e19034fbbb841d9dc6bf /app/Models
parent30327efecd4fa7f4131cd0d7a5ac80b460af95d1 (diff)
parent15d74d934708896706278574af159a9dcb3a4313 (diff)
Merge branch 'FreshRSS/dev' into FreshRSS/dev-1.14.0
Diffstat (limited to 'app/Models')
-rw-r--r--app/Models/Auth.php9
-rw-r--r--app/Models/Entry.php1
-rw-r--r--app/Models/UserDAO.php10
3 files changed, 11 insertions, 9 deletions
diff --git a/app/Models/Auth.php b/app/Models/Auth.php
index 9c3e31952..513a9cb2f 100644
--- a/app/Models/Auth.php
+++ b/app/Models/Auth.php
@@ -28,13 +28,13 @@ class FreshRSS_Auth {
if (self::$login_ok) {
self::giveAccess();
- } elseif (self::accessControl()) {
- self::giveAccess();
+ } elseif (self::accessControl() && self::giveAccess()) {
FreshRSS_UserDAO::touch();
} else {
// Be sure all accesses are removed!
self::removeAccess();
}
+ return self::$login_ok;
}
/**
@@ -60,7 +60,7 @@ class FreshRSS_Auth {
return $current_user != '';
case 'http_auth':
$current_user = httpAuthUser();
- $login_ok = $current_user != '';
+ $login_ok = $current_user != '' && FreshRSS_UserDAO::exists($current_user);
if ($login_ok) {
Minz_Session::_param('currentUser', $current_user);
}
@@ -81,7 +81,7 @@ class FreshRSS_Auth {
$user_conf = get_user_configuration($current_user);
if ($user_conf == null) {
self::$login_ok = false;
- return;
+ return false;
}
$system_conf = Minz_Configuration::get('system');
@@ -102,6 +102,7 @@ class FreshRSS_Auth {
Minz_Session::_param('loginOk', self::$login_ok);
Minz_Session::_param('REMOTE_USER', httpAuthUser());
+ return self::$login_ok;
}
/**
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index 985276734..f2f3d08fe 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -209,6 +209,7 @@ class FreshRSS_Entry extends Minz_Model {
$feed_timeout = empty($attributes['timeout']) ? 0 : intval($attributes['timeout']);
if ($system_conf->simplepie_syslog_enabled) {
+ prepareSyslog();
syslog(LOG_INFO, 'FreshRSS GET ' . SimplePie_Misc::url_remove_credentials($url));
}
diff --git a/app/Models/UserDAO.php b/app/Models/UserDAO.php
index 5fb46c947..e9d3a7329 100644
--- a/app/Models/UserDAO.php
+++ b/app/Models/UserDAO.php
@@ -65,7 +65,7 @@ class FreshRSS_UserDAO extends Minz_ModelPdo {
require_once(APP_PATH . '/SQL/install.sql.' . $db['type'] . '.php');
if ($db['type'] === 'sqlite') {
- return unlink(join_path(DATA_PATH, 'users', $username, 'db.sqlite'));
+ return unlink(USERS_PATH . '/' . $username . '/db.sqlite');
} else {
$userPDO = new Minz_ModelPdo($username);
@@ -81,18 +81,18 @@ class FreshRSS_UserDAO extends Minz_ModelPdo {
}
}
- public static function exist($username) {
- return is_dir(join_path(DATA_PATH, 'users', $username));
+ public static function exists($username) {
+ return is_dir(USERS_PATH . '/' . $username);
}
public static function touch($username = '') {
if (!FreshRSS_user_Controller::checkUsername($username)) {
$username = Minz_Session::param('currentUser', '_');
}
- return touch(join_path(DATA_PATH, 'users', $username, 'config.php'));
+ return touch(USERS_PATH . '/' . $username . '/config.php');
}
public static function mtime($username) {
- return @filemtime(join_path(DATA_PATH, 'users', $username, 'config.php'));
+ return @filemtime(USERS_PATH . '/' . $username . '/config.php');
}
}