2008-08-11 02:14:48 +02:00
|
|
|
<?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>
|
|
|
|
*
|
2008-08-11 02:21:44 +02:00
|
|
|
* Caution: Please make sure that enabling logging
|
|
|
|
* complies with your privacy standards. We're logging
|
|
|
|
* username and IP.
|
|
|
|
*
|
2008-08-11 02:14:48 +02:00
|
|
|
* @package sapphire
|
|
|
|
* @subpackage security
|
|
|
|
*/
|
|
|
|
class LoginAttempt extends DataObject {
|
|
|
|
|
|
|
|
static $db = array(
|
|
|
|
'Email' => 'Varchar(255)',
|
|
|
|
'Status' => "Enum('Success,Failure')",
|
2008-08-11 02:21:44 +02:00
|
|
|
'IP' => 'Varchar(255)',
|
2008-08-11 02:14:48 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
static $has_one = array(
|
|
|
|
'Member' => 'Member', // only linked if the member actually exists
|
|
|
|
);
|
|
|
|
|
2008-11-02 21:04:10 +01:00
|
|
|
function fieldLabels() {
|
|
|
|
$labels = parent::fieldLabels();
|
|
|
|
$labels['Email'] = _t('LoginAttempt.Email', 'Email Address');
|
|
|
|
$labels['Status'] = _t('LoginAttempt.Status', 'Status');
|
|
|
|
$labels['IP'] = _t('LoginAttempt.IP', 'IP Address');
|
|
|
|
|
|
|
|
return $labels;
|
|
|
|
}
|
|
|
|
|
2008-08-11 02:14:48 +02:00
|
|
|
}
|
|
|
|
?>
|