Changed some sesskey behaviours SC#73 (admin part)
Plus some minor alignment and CFG->htmleditor not being saved.
This commit is contained in:
+1
-1
@@ -41,7 +41,7 @@
|
||||
get_string('adminhelpbackup'));
|
||||
}
|
||||
|
||||
$table->data[]= array("<strong><a href=\"editor.php?sesskey=$USER->sesskey\">". get_string('editorsettings') ."</a></strong>",
|
||||
$table->data[]= array("<strong><a href=\"editor.php\">". get_string('editorsettings') ."</a></strong>",
|
||||
get_string('adminhelpeditorsettings'));
|
||||
$table->data[]= array("<strong><a href=\"calendar.php?sesskey=$USER->sesskey\">". get_string('calendarsettings', 'admin') ."</a></strong>",
|
||||
get_string('helpcalendarsettings', 'admin'));
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
<table border="0" cellpadding="4" cellspacing="2">
|
||||
<tr>
|
||||
<td align="right" valign="top">htmleditor:</td>
|
||||
<td>
|
||||
<td valign="top">
|
||||
<?php
|
||||
unset($options);
|
||||
$options[0] = get_string("allownot");
|
||||
|
||||
+4
-6
@@ -8,11 +8,7 @@
|
||||
error("Only admins can access this page");
|
||||
}
|
||||
|
||||
if (!confirm_sesskey()) {
|
||||
error(get_string('confirmsesskeybad', 'error'));
|
||||
}
|
||||
|
||||
if ($data = data_submitted()) {
|
||||
if (($data = data_submitted()) && confirm_sesskey()) {
|
||||
|
||||
// do we want default values?
|
||||
if (isset($data->resettodefaults)) {
|
||||
@@ -25,7 +21,7 @@
|
||||
error("Editor settings could not be updated!");
|
||||
}
|
||||
}
|
||||
redirect("$CFG->wwwroot/$CFG->admin/editor.php?sesskey=$USER->sesskey", get_string("changessaved"), 1);
|
||||
redirect("$CFG->wwwroot/$CFG->admin/editor.php", get_string("changessaved"), 1);
|
||||
|
||||
} else {
|
||||
// Generate edit form
|
||||
@@ -72,6 +68,7 @@ function editor_convert_to_array ($string) {
|
||||
}
|
||||
|
||||
function editor_update_config ($data) {
|
||||
|
||||
/// Updates the editor config values.
|
||||
|
||||
if (!is_object($data)) {
|
||||
@@ -101,6 +98,7 @@ function editor_update_config ($data) {
|
||||
|
||||
// make array of values to update
|
||||
$updatedata = array();
|
||||
$updatedata['htmleditor'] = !empty($data->htmleditor) ? $data->htmleditor : 0;
|
||||
$updatedata['editorbackgroundcolor'] = !empty($data->backgroundcolor) ? $data->backgroundcolor : "#ffffff";
|
||||
$updatedata['editorfontfamily'] = !empty($data->fontfamily) ? str_replace($nochars,"",$data->fontfamily) : "Times New Roman, Times";
|
||||
$updatedata['editorfontsize'] = !empty($data->fontsize) ? $data->fontsize : "";
|
||||
|
||||
Reference in New Issue
Block a user