2 package IkiWiki::Receive;
9 my $user=(getpwuid(exists $ENV{CALLER_UID} ? $ENV{CALLER_UID} : $<))[0];
10 if (! defined $user) {
11 error("cannot determine username for $<");
18 return ! ref $config{untrusted_committers} ||
19 ! grep { $_ eq $user } @{$config{untrusted_committers}};
23 # Test for commits from untrusted committers in the wrapper, to
24 # avoid starting ikiwiki proper at all for trusted commits.
34 error(sprintf(gettext("cannot determine id of untrusted committer %s"), $_));
37 } @{$config{untrusted_committers}}).
42 asprintf(&s, "CALLER_UID=%i", u);
55 # Dummy up a cgi environment to use when calling check_canedit
61 # And dummy up a session object.
63 my $session=IkiWiki::cgi_getsession($cgi);
64 $session->param("name", getuser());
65 # Make sure whatever user was authed is in the
67 require IkiWiki::UserInfo;
68 if (! IkiWiki::userinfo_get($session->param("name"), "regdate")) {
69 IkiWiki::userinfo_setall($session->param("name"), {
73 }) || error("failed adding user");
79 changes => [IkiWiki::rcs_receive()]