mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
13b358a8dd
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75582 467b73ca-7a2a-4603-9d3b-597d59a354a9
51 lines
1.2 KiB
PHP
51 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Record all login attempts through the {@link LoginForm} object.
|
|
* This behaviour is disabled by default.
|
|
*
|
|
* Enable through a setting in your _config.php:
|
|
* <code>
|
|
* Security::set_login_recording(true);
|
|
* </code>
|
|
*
|
|
* Caution: Please make sure that enabling logging
|
|
* complies with your privacy standards. We're logging
|
|
* username and IP.
|
|
*
|
|
* @package sapphire
|
|
* @subpackage security
|
|
*/
|
|
class LoginAttempt extends DataObject {
|
|
|
|
static $db = array(
|
|
'Email' => 'Varchar(255)',
|
|
'Status' => "Enum('Success,Failure')",
|
|
'IP' => 'Varchar(255)',
|
|
);
|
|
|
|
static $has_one = array(
|
|
'Member' => 'Member', // only linked if the member actually exists
|
|
);
|
|
|
|
static $has_many = array();
|
|
|
|
static $many_many = array();
|
|
|
|
static $belongs_many_many = array();
|
|
|
|
/**
|
|
*
|
|
* @param boolean $includerelations a boolean value to indicate if the labels returned include relation fields
|
|
*
|
|
*/
|
|
function fieldLabels($includerelations = true) {
|
|
$labels = parent::fieldLabels($includerelations);
|
|
$labels['Email'] = _t('LoginAttempt.Email', 'Email Address');
|
|
$labels['Status'] = _t('LoginAttempt.Status', 'Status');
|
|
$labels['IP'] = _t('LoginAttempt.IP', 'IP Address');
|
|
|
|
return $labels;
|
|
}
|
|
|
|
}
|
|
?>
|