Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Feeds
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MickGe
Feeds
Commits
6c06a266
Commit
6c06a266
authored
3 years ago
by
kdan
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into master
parents
2ccf0e50
f423874e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
classes/config.php
+2
-1
2 additions, 1 deletion
classes/config.php
classes/userhelper.php
+1
-1
1 addition, 1 deletion
classes/userhelper.php
include/sessions.php
+5
-7
5 additions, 7 deletions
include/sessions.php
with
8 additions
and
9 deletions
classes/config.php
+
2
−
1
View file @
6c06a266
...
...
@@ -484,7 +484,8 @@ class Config {
array_push
(
$errors
,
"Data export cache is not writable (chmod -R 777 "
.
self
::
get
(
Config
::
CACHE_DIR
)
.
"/export)"
);
}
if
(
self
::
get
(
Config
::
SINGLE_USER_MODE
)
&&
class_exists
(
"PDO"
))
{
// ttrss_users won't be there on initial startup (before migrations are done)
if
(
!
Config
::
is_migration_needed
()
&&
self
::
get
(
Config
::
SINGLE_USER_MODE
))
{
if
(
UserHelper
::
get_login_by_id
(
1
)
!=
"admin"
)
{
array_push
(
$errors
,
"SINGLE_USER_MODE is enabled but default admin account (ID: 1) is not found."
);
}
...
...
This diff is collapsed.
Click to expand it.
classes/userhelper.php
+
1
−
1
View file @
6c06a266
...
...
@@ -75,7 +75,7 @@ class UserHelper {
$_SESSION
[
"auth_module"
]
=
false
;
if
(
!
$_SESSION
[
"csrf_token"
])
if
(
empty
(
$_SESSION
[
"csrf_token"
])
)
$_SESSION
[
"csrf_token"
]
=
bin2hex
(
get_random_bytes
(
16
));
$_SESSION
[
"ip_address"
]
=
UserHelper
::
get_user_ip
();
...
...
This diff is collapsed.
Click to expand it.
include/sessions.php
+
5
−
7
View file @
6c06a266
...
...
@@ -106,13 +106,11 @@
}
if
(
\Config
::
get_schema_version
()
>=
0
)
{
if
(
!
\Config
::
get
(
\Config
::
SINGLE_USER_MODE
))
{
session_set_save_handler
(
'\Sessions\ttrss_open'
,
'\Sessions\ttrss_close'
,
'\Sessions\ttrss_read'
,
'\Sessions\ttrss_write'
,
'\Sessions\ttrss_destroy'
,
'\Sessions\ttrss_gc'
);
register_shutdown_function
(
'session_write_close'
);
}
session_set_save_handler
(
'\Sessions\ttrss_open'
,
'\Sessions\ttrss_close'
,
'\Sessions\ttrss_read'
,
'\Sessions\ttrss_write'
,
'\Sessions\ttrss_destroy'
,
'\Sessions\ttrss_gc'
);
register_shutdown_function
(
'session_write_close'
);
if
(
!
defined
(
'NO_SESSION_AUTOSTART'
))
{
if
(
isset
(
$_COOKIE
[
session_name
()]))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment