-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
44 lines (30 loc) · 1.59 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
define('NO_OUTPUT_BUFFERING', true);
require_once(dirname(__FILE__) . '/../../../config.php');
$count = optional_param('count', 20, PARAM_INT);
$delay = optional_param('delay', 100, PARAM_INT);
$countdelay = optional_param('countdelay', 500, PARAM_INT);
$readonly = optional_param('readonly', false, PARAM_BOOL);
$PAGE->set_url('/admin/tool/sessionbreaker/index.php');
$PAGE->set_context(context_system::instance());
$PAGE->set_pagelayout('admin');
$strheading = get_string('pluginname', 'tool_sessionbreaker');
$PAGE->set_title($strheading);
$PAGE->set_heading($strheading);
$PAGE->navbar->add(get_string('pluginname', 'tool_sessionbreaker'), $PAGE->url);
require_login();
require_capability('moodle/site:config', context_system::instance());
cache::make('core', 'tagindexbuilder')->set('count', 0);
\core\session\manager::write_close();
echo $OUTPUT->header();
// echo "<p>The session_handler_class is " . $CFG->session_handler_class . "</p>";
echo "<p>This loads a bunch of iframes in parallel which all mess with the same session attribute.
If session locking is working then these are forced to queue and process one at a time, and then
last iframe to load should 'end' with $count .</p>
<p>If any iframes have the same number then session locking is busted (or turned off via readonly sessions)</p>";
for ($c=1; $c<=$count; $c++) {
echo "<p>Frame $c: ";
echo "<iframe src='count.php?c=$c&delay=$countdelay&readonly=$readonly' style='height: 30px;'></iframe>";
usleep($delay * 1000); // Enough to mostly mean the iframes load in order (not required but easier to read).
}
echo $OUTPUT->footer();