Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
15dcb2ec
Commit
15dcb2ec
authored
Mar 09, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use php session_status to check for active session ( >= php 5.4 )
parent
f8e25189
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
9 deletions
+15
-9
auth.inc
src/etc/inc/auth.inc
+2
-1
config.lib.inc
src/etc/inc/config.lib.inc
+2
-2
csrf-magic.php
src/www/csrf/csrf-magic.php
+1
-1
firewall_virtual_ip.php
src/www/firewall_virtual_ip.php
+2
-1
headjs.php
src/www/headjs.php
+2
-1
system_usermanager_passwordmg.php
src/www/system_usermanager_passwordmg.php
+6
-3
No files found.
src/etc/inc/auth.inc
View file @
15dcb2ec
...
...
@@ -1333,8 +1333,9 @@ function session_auth() {
true
);
if
(
!
session_id
())
if
(
session_status
()
==
PHP_SESSION_NONE
)
{
session_start
();
}
// Detect protocol change
if
(
!
isset
(
$_POST
[
'login'
])
&&
!
empty
(
$_SESSION
[
'Logged_In'
])
&&
$_SESSION
[
'protocol'
]
!=
$config
[
'system'
][
'webgui'
][
'protocol'
])
...
...
src/etc/inc/config.lib.inc
View file @
15dcb2ec
...
...
@@ -466,8 +466,8 @@ function write_config($desc = 'Unknown', $backup = true)
$config_xml
=
'/conf/config.xml'
;
if
(
!
empty
(
$_SERVER
[
'REMOTE_ADDR'
]))
{
if
(
!
session_id
()
)
{
@
session_start
();
if
(
session_status
()
==
PHP_SESSION_NONE
)
{
session_start
();
}
if
(
!
empty
(
$_SESSION
[
'Username'
])
&&
(
$_SESSION
[
'Username'
]
!=
'root'
))
{
$user
=
getUserEntry
(
$_SESSION
[
'Username'
]);
...
...
src/www/csrf/csrf-magic.php
View file @
15dcb2ec
...
...
@@ -347,7 +347,7 @@ function csrf_conf($key, $val) {
* Starts a session if we're allowed to.
*/
function
csrf_start
()
{
if
(
$GLOBALS
[
'csrf'
][
'auto-session'
]
&&
!
session_id
()
)
{
if
(
$GLOBALS
[
'csrf'
][
'auto-session'
]
&&
session_status
()
==
PHP_SESSION_NONE
)
{
session_start
();
}
}
...
...
src/www/firewall_virtual_ip.php
View file @
15dcb2ec
...
...
@@ -146,8 +146,9 @@ if ($_GET['act'] == "del") {
}
if
(
!
$input_errors
)
{
if
(
!
session_id
())
if
(
session_status
()
==
PHP_SESSION_NONE
)
{
session_start
();
}
$user
=
getUserEntry
(
$_SESSION
[
'Username'
]);
if
(
is_array
(
$user
)
&&
userHasPrivilege
(
$user
,
"user-config-readonly"
))
{
header
(
"Location: firewall_virtual_ip.php"
);
...
...
src/www/headjs.php
View file @
15dcb2ec
...
...
@@ -35,8 +35,9 @@ function getHeadJS() {
var input_errors = '';
jQuery(document).ready(init);
"
;
if
(
!
session_id
())
if
(
session_status
()
==
PHP_SESSION_NONE
)
{
session_start
();
}
$_SESSION
[
'NO_AJAX'
]
==
"True"
?
$noajax
=
"var noAjaxOnSubmit = true;"
:
$noajax
=
"var noAjaxOnSubmit = false;"
;
session_write_close
();
...
...
src/www/system_usermanager_passwordmg.php
View file @
15dcb2ec
...
...
@@ -44,8 +44,9 @@ if (isset($_POST['save'])) {
$input_errors
[]
=
gettext
(
"The passwords do not match."
);
if
(
!
$input_errors
)
{
if
(
!
session_id
())
if
(
session_status
()
==
PHP_SESSION_NONE
)
{
session_start
();
}
// all values are okay --> saving changes
$config
[
'system'
][
'user'
][
$userindex
[
$_SESSION
[
'Username'
]]][
'password'
]
=
crypt
(
$_POST
[
'passwordfld1'
],
'$6$'
);
local_user_set
(
$config
[
'system'
][
'user'
][
$userindex
[
$_SESSION
[
'Username'
]]]);
...
...
@@ -57,8 +58,9 @@ if (isset($_POST['save'])) {
}
}
if
(
!
session_id
())
if
(
session_status
()
==
PHP_SESSION_NONE
)
{
session_start
();
}
/* determine if user is not local to system */
$islocal
=
false
;
...
...
@@ -103,8 +105,9 @@ include("head.inc");
<div
class=
"table-responsive"
>
<table
class=
"table table-striped table-sort"
>
<tr>
<?php
if
(
!
session_id
())
<?php
if
(
session_status
()
==
PHP_SESSION_NONE
)
{
session_start
();
}
?>
<td
colspan=
"2"
valign=
"top"
class=
"listtopic"
>
<?=
$_SESSION
[
'Username'
]
?>
's
<?=
gettext
(
"Password"
);
?>
</td>
<?php
session_write_close
();
?>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment