## Search for all traditions which allow public viewing
## When they exist!
- # $self->search({ public => 1 });
+## This needs to be more sophisticated, probably needs Search::GIN
+# my $list = $self->search({ public => 1 });
## For now, just fetch all
## (could use all_objects or grep down there?)
my ($self, $userinfo) = @_;
my $username = $userinfo->{username};
my $password = $userinfo->{password};
+ my $role = $userinfo->{role};
- return unless $username && $self->validate_password($password);
+ return unless $username;
+ return if($password && !$self->validate_password($password));
my $user = $self->find_user({ username => $username });
return unless $user;
- $user->password(crypt_password($password));
+ if($password) {
+ $user->password(crypt_password($password));
+ }
+ if($role) {
+ $user->role($role);
+ }
$self->update($user);