Commit f7bd85bb authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie

Renamed the set_err_msg method to set_error_msg, for more consistency.

parent 28295202
......@@ -147,13 +147,13 @@ function auth_setup () {
// The user's admin rights have been taken away
log_debug("users admin rights have been revoked!");
$USER->set('admin', 0);
$SESSION->add_err_msg(get_string('accessforbiddentoadminsection'));
$SESSION->add_error_msg(get_string('accessforbiddentoadminsection'));
redirect(get_config('wwwroot'));
}
elseif (!$USER->get('admin')) {
// The user never was an admin
log_debug("denying user access to administration");
$SESSION->add_err_msg(get_string('accessforbiddentoadminsection'));
$SESSION->add_error_msg(get_string('accessforbiddentoadminsection'));
redirect(get_config('wwwroot'));
}
}
......@@ -565,7 +565,7 @@ function login_submit($values) {
// Only admins in the admin section!
if (defined('ADMIN') && !$userdata->admin) {
log_debug('user not allowed in admin section');
$SESSION->add_err_msg(get_string('accessforbiddentoadminsection'));
$SESSION->add_error_msg(get_string('accessforbiddentoadminsection'));
redirect(get_config('wwwroot'));
}
......@@ -590,11 +590,11 @@ function login_submit($values) {
}
else {
// Login attempt failed
$SESSION->add_err_msg(get_string('loginfailed'));
$SESSION->add_error_msg(get_string('loginfailed'));
}
}
catch (AuthUnknownUserException $e) {
$SESSION->add_err_msg(get_string('loginfailed'));
$SESSION->add_error_msg(get_string('loginfailed'));
}
}
......
......@@ -121,12 +121,12 @@ class Session {
* @param string $message The message to add
* @param boolean $escape Whether to HTML escape the message
*/
public function add_err_msg($message, $escape=true) {
public function add_error_msg($message, $escape=true) {
$this->ensure_session();
if ($escape) {
$message = self::escape_message($message);
}
$_SESSION['messages'][] = array('type' => 'err', 'msg' => $message);
$_SESSION['messages'][] = array('type' => 'error', 'msg' => $message);
}
/**
......
......@@ -35,7 +35,7 @@ $id = param_integer('id',null);
$group_data = get_record('usr_group', 'id', $id, 'owner', $USER->get('id'));
if (!$group_data) {
$SESSION->add_err_msg(get_string('canteditdontown'));
$SESSION->add_error_msg(get_string('canteditdontown'));
redirect('./');
}
......@@ -89,7 +89,7 @@ function editgroup_validate(Pieform $form, $values) {
$id = get_field('usr_group', 'id', 'id', $values['id'], 'owner', $USER->get('id'));
if (!$id) {
$SESSION->add_err_msg(get_string('canteditdontown'));
$SESSION->add_error_msg(get_string('canteditdontown'));
redirect('./');
}
}
......
......@@ -177,7 +177,7 @@ function log_message ($message, $loglevel, $escape, $backtrace, $file=null, $lin
$method = 'add_info_msg';
}
else {
$method = 'add_err_msg';
$method = 'add_error_msg';
}
foreach ($loglines as $line) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment