9 sub userinfo_retrieve () { #{{{
10 my $userinfo=eval{ Storable::lock_retrieve("$config{wikistatedir}/userdb") };
14 sub userinfo_store ($) { #{{{
17 my $oldmask=umask(077);
18 my $ret=Storable::lock_store($userinfo, "$config{wikistatedir}/userdb");
23 sub userinfo_get ($$) { #{{{
27 my $userinfo=userinfo_retrieve();
28 if (! defined $userinfo ||
29 ! exists $userinfo->{$user} || ! ref $userinfo->{$user} ||
30 ! exists $userinfo->{$user}->{$field}) {
33 return $userinfo->{$user}->{$field};
36 sub userinfo_set ($$$) { #{{{
41 my $userinfo=userinfo_retrieve();
42 if (! defined $userinfo ||
43 ! exists $userinfo->{$user} || ! ref $userinfo->{$user}) {
47 $userinfo->{$user}->{$field}=$value;
48 return userinfo_store($userinfo);
51 sub userinfo_setall ($$) { #{{{
55 my $userinfo=userinfo_retrieve();
56 if (! defined $userinfo) {
59 $userinfo->{$user}=$info;
60 return userinfo_store($userinfo);
63 sub is_admin ($) { #{{{
66 return grep { $_ eq $user_name } @{$config{adminuser}};
69 sub commit_notify_list ($@) { #{{{
74 my $userinfo=userinfo_retrieve();
75 foreach my $user (keys %{$userinfo}) {
76 next if $user eq $committer;
77 if (exists $userinfo->{$user}->{subscriptions} &&
78 length $userinfo->{$user}->{subscriptions} &&
79 exists $userinfo->{$user}->{email} &&
80 length $userinfo->{$user}->{email} &&
81 grep { globlist_match($_, $userinfo->{$user}->{subscriptions}) } @pages) {
82 push @ret, $userinfo->{$user}->{email};