mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 03:35:55 +00:00
add two helper account access levels:
- read only - can't subscribe to more feeds, feed updates are skipped - disabled - can't login define used access levels as UserHelper constants and refactor code to use them instead of hardcoded numbers
This commit is contained in:
@@ -1027,10 +1027,17 @@ class Feeds extends Handler_Protected {
|
||||
* 5 - Couldn't download the URL content.
|
||||
* 6 - Content is an invalid XML.
|
||||
* 7 - Error while creating feed database entry.
|
||||
* 8 - Permission denied (ACCESS_LEVEL_READONLY).
|
||||
*/
|
||||
static function _subscribe($url, $cat_id = 0,
|
||||
$auth_login = '', $auth_pass = '') : array {
|
||||
|
||||
$user = ORM::for_table("ttrss_users")->find_one($_SESSION['uid']);
|
||||
|
||||
if ($user && $user->access_level == UserHelper::ACCESS_LEVEL_READONLY) {
|
||||
return ["code" => 8];
|
||||
}
|
||||
|
||||
$pdo = Db::pdo();
|
||||
|
||||
$url = UrlHelper::validate($url);
|
||||
|
||||
Reference in New Issue
Block a user