From: moodler Date: Sun, 25 Jul 2004 14:39:19 +0000 (+0000) Subject: FIxed some variables for login error logging X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=27106bac92b5391b23edf49a4bf6ca129a6fb3ed;p=moodle.git FIxed some variables for login error logging --- diff --git a/admin/config.html b/admin/config.html index d94fdd128d..0e3290a29c 100644 --- a/admin/config.html +++ b/admin/config.html @@ -264,18 +264,18 @@ -

notifythreshold:

+

notifyloginthreshold:

notifythreshold,"","",""); + choose_from_menu($options,"notifyloginthreshold",$config->notifyloginthreshold,"","",""); ?> - + diff --git a/lang/en/moodle.php b/lang/en/moodle.php index fc3383153e..5ba5a2373d 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -177,7 +177,7 @@ $string['configmaxbytes'] = 'This specifies a maximum size that uploaded files c $string['configmaxeditingtime'] = 'This specifies the amount of time people have to re-edit forum postings, journal feedback etc. Usually 30 minutes is a good value.'; $string['confignoreplyaddress'] = 'Emails are sometimes sent out on behalf of a user (eg forum posts). The email address you specify here will be used as the \"From\" address in those cases when the recipients should not be able to reply directly to the user (eg when a user chooses to keep their address private).'; $string['confignotifyloginfailures'] = 'If login failures have been recorded, email notifications can be sent out. Who should see these notifications?'; -$string['confignotifythreshold'] = 'If notifications about failed logins are active, how many failed login attempts by one user or one IP address is it worth notifying about?'; +$string['confignotifyloginthreshold'] = 'If notifications about failed logins are active, how many failed login attempts by one user or one IP address is it worth notifying about?'; $string['configopentogoogle'] = 'If you enable this setting, then Google will be allowed to enter your site as a Guest. In addition, people coming in to your site via a Google search will automatically be logged in as a Guest. Note that this only provides transparent access to courses that already allow guest access.'; $string['configproxyhost'] = 'If this server needs to use a proxy computer (eg a firewall) to access the Internet, then provide the proxy hostname and port here. Otherwise leave it blank.'; $string['configsecureforms'] = 'Moodle can use an additional level of security when accepting data from web forms. If this is enabled, then the browser\'s HTTP_REFERER variable is checked against the current form address. In a very few cases this can cause problems if the user is using a firewall (eg Zonealarm) configured to strip HTTP_REFERER from their web traffic. Symptoms are getting \'stuck\' on a form. If your users are having problems with the login page (for example) you might want to disable this setting, although it might leave your site more open to brute-force password attacks. If in doubt, leave this set to \'Yes\'.'; diff --git a/lib/defaults.php b/lib/defaults.php index 56abb7d800..d5b7140a59 100644 --- a/lib/defaults.php +++ b/lib/defaults.php @@ -4,54 +4,57 @@ // It defines default values for any important configuration variables $defaults = array ( - "auth" => "email", - "autologinguests" => 0, - "allowunenroll" => true, - "cachetext" => 60, - "changepassword" => true, - "country" => "", - "debug" => 7, - "deleteunconfirmed" => 168, - "enablerssfeeds" => 0, - "enrol" => 'internal', - "extendedusernamechars" => false, - "filteruploadedfiles" => true, - "forcelogin" => false, - "forceloginforprofiles" => false, - "fullnamedisplay" => "firstname lastname", - "framename" => "_top", - "frontpage" => 0, - "gdversion" => 1, - "guestloginbutton" => 1, - "htmleditor" => true, - "lang" => "en", - "langmenu" => 1, - "langlist" => "", - "locale" => "en", - "loglifetime" => 0, - "longtimenosee" => 100, - "maxbytes" => 0, - "maxeditingtime" => 1800, - "noreplyaddress" => 'noreply@'.$_SERVER['HTTP_HOST'], - "opentogoogle" => false, - "prefix" => "", - "proxyhost" => "", - "proxyport" => "", - "secureforms" => false, - "sessioncookie" => "", - "sessiontimeout" => 7200, - "slasharguments" => 1, - "smtphosts" => "", - "smtppass" => "", - "smtpuser" => "", - "style" => "default", - "teacherassignteachers" => true, - "template" => "default", - "textfilters" => "mod/glossary/dynalink.php", - "timezone" => 99, - "theme" => "standard", - "unzip" => "", - "zip" => "" + "auth" => "email", + "autologinguests" => 0, + "allowunenroll" => true, + "cachetext" => 60, + "changepassword" => true, + "country" => "", + "debug" => 7, + "deleteunconfirmed" => 168, + "displayloginfailures" => '', + "enablerssfeeds" => 0, + "enrol" => 'internal', + "extendedusernamechars" => false, + "filteruploadedfiles" => true, + "forcelogin" => false, + "forceloginforprofiles" => false, + "fullnamedisplay" => "firstname lastname", + "framename" => "_top", + "frontpage" => 0, + "gdversion" => 1, + "guestloginbutton" => 1, + "htmleditor" => true, + "lang" => "en", + "langmenu" => 1, + "langlist" => "", + "locale" => "en", + "loglifetime" => 0, + "longtimenosee" => 100, + "maxbytes" => 0, + "maxeditingtime" => 1800, + "noreplyaddress" => 'noreply@'.$_SERVER['HTTP_HOST'], + "notifyloginfailures" => '', + "notifyloginthreshold" => 10, + "opentogoogle" => false, + "prefix" => "", + "proxyhost" => "", + "proxyport" => "", + "secureforms" => false, + "sessioncookie" => "", + "sessiontimeout" => 7200, + "slasharguments" => 1, + "smtphosts" => "", + "smtppass" => "", + "smtpuser" => "", + "style" => "default", + "teacherassignteachers" => true, + "template" => "default", + "textfilters" => "mod/glossary/dynalink.php", + "timezone" => 99, + "theme" => "standard", + "unzip" => "", + "zip" => "" ); ?> diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 166b365d69..19c1c4bc0c 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -2383,15 +2383,15 @@ function notify_login_failures() { } // we need to deal with the threshold stuff first. - if (empty($CFG->notifythreshold)) { - $CFG->notifythreshold = 10; // default to something sensible. + if (empty($CFG->notifyloginthreshold)) { + $CFG->notifyloginthreshold = 10; // default to something sensible. } $notifyipsrs = $db->Execute("SELECT ip FROM {$CFG->prefix}log WHERE time > {$CFG->lastnotifyfailure} - AND module='login' AND action='error' GROUP BY ip HAVING count(*) > $CFG->notifythreshold"); + AND module='login' AND action='error' GROUP BY ip HAVING count(*) > $CFG->notifyloginthreshold"); $notifyusersrs = $db->Execute("SELECT info FROM {$CFG->prefix}log WHERE time > {$CFG->lastnotifyfailure} - AND module='login' AND action='error' GROUP BY info HAVING count(*) > $CFG->notifythreshold"); + AND module='login' AND action='error' GROUP BY info HAVING count(*) > $CFG->notifyloginthreshold"); if ($notifyipsrs) { while ($row = $notifyipsrs->FetchRow()) {