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 ($@) { #{{{
73 foreach my $file (@_) {
74 push @pages, grep { $pagesources{$_} eq $file } keys %pagesources;
78 my $userinfo=userinfo_retrieve();
79 foreach my $user (keys %{$userinfo}) {
80 next if $user eq $committer;
81 if (exists $userinfo->{$user}->{subscriptions} &&
82 length $userinfo->{$user}->{subscriptions} &&
83 exists $userinfo->{$user}->{email} &&
84 length $userinfo->{$user}->{email} &&
85 grep { globlist_match($_, $userinfo->{$user}->{subscriptions}) } @pages) {
86 push @ret, $userinfo->{$user}->{email};