mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-25 17:23:00 +00:00
Set the expiry on the session cookie. Fixes #113.\nThis commit adds a new settings property, 'sessionlifetime', so we need to add in #83 now.
This commit is contained in:
parent
fe165bec3e
commit
0ade04c3bb
3 changed files with 6 additions and 0 deletions
|
@ -144,6 +144,7 @@ $guiConfig = <<<'GUICONFIG'
|
||||||
"max_recent_changes": {"type": "number", "description": "The maximum number of recent changes to display on the recent changes page.", "default": 512},
|
"max_recent_changes": {"type": "number", "description": "The maximum number of recent changes to display on the recent changes page.", "default": 512},
|
||||||
"export_allow_only_admins": {"type": "checkbox", "description": "Whether to only allow adminstrators to export the your wiki as a zip using the page-export module.", "default": false},
|
"export_allow_only_admins": {"type": "checkbox", "description": "Whether to only allow adminstrators to export the your wiki as a zip using the page-export module.", "default": false},
|
||||||
"sessionprefix": {"type": "text", "description": "You shouldn't need to change this. The prefix that should be used in the names of the session variables. Defaults to \"auto\", which automatically generates this field. See the readme for more information.", "default": "auto"},
|
"sessionprefix": {"type": "text", "description": "You shouldn't need to change this. The prefix that should be used in the names of the session variables. Defaults to \"auto\", which automatically generates this field. See the readme for more information.", "default": "auto"},
|
||||||
|
"sessionlifetime": { "type": "number", "description": "Again, you shouldn't need to change this under normal circumstances. This setting controls the lifetime of a login session. Defaults to 24 hours, but it may get cut off sooner depending on the underlying PHP session lifetime.", "default": 86400 },
|
||||||
"css": {"type": "textarea", "description": "A string of css to include. Will be included in the <head> of every page inside a <style> tag. This may also be a url - urls will be referenced via a <link rel='stylesheet' /> tag.", "default": "auto"}
|
"css": {"type": "textarea", "description": "A string of css to include. Will be included in the <head> of every page inside a <style> tag. This may also be a url - urls will be referenced via a <link rel='stylesheet' /> tag.", "default": "auto"}
|
||||||
}
|
}
|
||||||
GUICONFIG;
|
GUICONFIG;
|
||||||
|
@ -343,6 +344,8 @@ foreach ($paths as &$path) {
|
||||||
$paths->upload_file_prefix = "Files/"; // The prefix to add to uploaded files
|
$paths->upload_file_prefix = "Files/"; // The prefix to add to uploaded files
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
|
// Make sure that the login cookie lasts beyond the end of the user's session
|
||||||
|
setcookie(session_name(), session_id(), time() + $settings->sessionlifetime);
|
||||||
///////// Login System /////////
|
///////// Login System /////////
|
||||||
// Clear expired sessions
|
// Clear expired sessions
|
||||||
if(isset($_SESSION[$settings->sessionprefix . "-expiretime"]) and
|
if(isset($_SESSION[$settings->sessionprefix . "-expiretime"]) and
|
||||||
|
|
2
core.php
2
core.php
|
@ -36,6 +36,8 @@ foreach ($paths as &$path) {
|
||||||
$paths->upload_file_prefix = "Files/"; // The prefix to add to uploaded files
|
$paths->upload_file_prefix = "Files/"; // The prefix to add to uploaded files
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
|
// Make sure that the login cookie lasts beyond the end of the user's session
|
||||||
|
setcookie(session_name(), session_id(), time() + $settings->sessionlifetime);
|
||||||
///////// Login System /////////
|
///////// Login System /////////
|
||||||
// Clear expired sessions
|
// Clear expired sessions
|
||||||
if(isset($_SESSION[$settings->sessionprefix . "-expiretime"]) and
|
if(isset($_SESSION[$settings->sessionprefix . "-expiretime"]) and
|
||||||
|
|
|
@ -122,5 +122,6 @@
|
||||||
"max_recent_changes": {"type": "number", "description": "The maximum number of recent changes to display on the recent changes page.", "default": 512},
|
"max_recent_changes": {"type": "number", "description": "The maximum number of recent changes to display on the recent changes page.", "default": 512},
|
||||||
"export_allow_only_admins": {"type": "checkbox", "description": "Whether to only allow adminstrators to export the your wiki as a zip using the page-export module.", "default": false},
|
"export_allow_only_admins": {"type": "checkbox", "description": "Whether to only allow adminstrators to export the your wiki as a zip using the page-export module.", "default": false},
|
||||||
"sessionprefix": {"type": "text", "description": "You shouldn't need to change this. The prefix that should be used in the names of the session variables. Defaults to \"auto\", which automatically generates this field. See the readme for more information.", "default": "auto"},
|
"sessionprefix": {"type": "text", "description": "You shouldn't need to change this. The prefix that should be used in the names of the session variables. Defaults to \"auto\", which automatically generates this field. See the readme for more information.", "default": "auto"},
|
||||||
|
"sessionlifetime": { "type": "number", "description": "Again, you shouldn't need to change this under normal circumstances. This setting controls the lifetime of a login session. Defaults to 24 hours, but it may get cut off sooner depending on the underlying PHP session lifetime.", "default": 86400 },
|
||||||
"css": {"type": "textarea", "description": "A string of css to include. Will be included in the <head> of every page inside a <style> tag. This may also be a url - urls will be referenced via a <link rel='stylesheet' /> tag.", "default": "auto"}
|
"css": {"type": "textarea", "description": "A string of css to include. Will be included in the <head> of every page inside a <style> tag. This may also be a url - urls will be referenced via a <link rel='stylesheet' /> tag.", "default": "auto"}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue