mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 04:15:43 +00:00
implemented getFieldNamesByCategory() in the user data source, and used it to fill in the list of contact methods for the loginFailed output handler.
This commit is contained in:
parent
25760a3e0a
commit
b5ef59ba98
@ -155,6 +155,13 @@ sub getFieldByName {
|
||||
# return [type, fieldID, category, name, typeData]
|
||||
}
|
||||
|
||||
sub getFieldNamesByCategory {
|
||||
my $self = shift;
|
||||
my($app, $category) = @_;
|
||||
$self->notImplemented();
|
||||
# return [name, name, name, name ...]
|
||||
}
|
||||
|
||||
sub setField {
|
||||
my $self = shift;
|
||||
my($app, $fieldID, $category, $name, $type, $data) = @_;
|
||||
|
@ -171,6 +171,17 @@ sub getFieldByName {
|
||||
# return [type, fieldID, category, name, typeData]
|
||||
}
|
||||
|
||||
sub getFieldNamesByCategory {
|
||||
my $self = shift;
|
||||
my($app, $category) = @_;
|
||||
my $rows = $self->database($app)->execute('SELECT name FROM userDataTypes WHERE category = ?', $category)->rows;
|
||||
foreach my $row (@$rows) {
|
||||
$row = $row->[0];
|
||||
}
|
||||
return @$rows;
|
||||
# return [name, name, name, name ...]
|
||||
}
|
||||
|
||||
sub setField {
|
||||
my $self = shift;
|
||||
my($app, $fieldID, $category, $name, $type, $data, $mode) = @_;
|
||||
|
@ -161,7 +161,7 @@ sub outputLoginFailed {
|
||||
my($app, $output, $tried) = @_;
|
||||
$output->output('login.failed', {
|
||||
'tried' => $tried, # 0 = no username; 1 = unknown username; 2 = invalid username
|
||||
'contacts' => 0, # XXX should fill this in
|
||||
'contacts' => [$app->getService('dataSource.user')->getFieldNamesByCategory($app, 'contact')],
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user