mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
New functions for login failure display
This commit is contained in:
parent
a7e0783741
commit
b4bac9b6b6
2 changed files with 89 additions and 6 deletions
|
@ -976,6 +976,27 @@ function print_header ($title="", $heading="", $navigation="", $focus="", $meta=
|
|||
$menu = "<font size=\"2\"><a target=\"$CFG->framename\" href=\"$wwwroot/login/index.php\">".get_string("login")."</a></font>";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($SESSION->justloggedin)) {
|
||||
unset($SESSION->justloggedin);
|
||||
if (!empty($CFG->displayloginfailures)) {
|
||||
if (!empty($USER->username) and !isguest()) {
|
||||
if ($count = count_login_failures($CFG->displayloginfailures, $USER->username, $USER->lastlogin)) {
|
||||
$menu .= ' <font size="1">';
|
||||
if (empty($count->accounts)) {
|
||||
$menu .= get_string('failedloginattempts', '', $count);
|
||||
} else {
|
||||
$menu .= get_string('failedloginattemptsall', '', $count);
|
||||
}
|
||||
if (isadmin()) {
|
||||
$menu .= ' (<a href="'.$CFG->wwwroot.'/course/log.php'.
|
||||
'?chooselog=1&id=1&modid=site_errors">'.get_string('logs').'</a>)';
|
||||
}
|
||||
$menu .= '</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add a stylesheet for the HTML editor
|
||||
$meta = "<style type=\"text/css\">@import url($CFG->wwwroot/lib/editor/htmlarea.css);</style>\n$meta\n";
|
||||
|
@ -2292,6 +2313,9 @@ function rebuildnolinktag($text) {
|
|||
return $text;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// ================================================
|
||||
// THREE FUNCTIONS MOVED HERE FROM course/lib.php
|
||||
// ================================================
|
||||
|
@ -2369,6 +2393,8 @@ function print_side_block_start($heading='', $attributes = array()) {
|
|||
echo '<tbody style="background-color: '.$THEME->cellcontent2.';"><tr><td class="sideblockmain">';
|
||||
}
|
||||
|
||||
|
||||
|
||||
function print_side_block_end() {
|
||||
echo '</td></tr></tbody></table><br />';
|
||||
echo "\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue