- $ENV{REMOTE_ADDR}='unknown' unless exists $ENV{REMOTE_ADDR};
-
- # Wiki is not locked because we lack permission to do so.
- # So, relying on atomic index file updates to avoid trouble.
- IkiWiki::loadindex();
-
+ # Make sure whatever user was authed is in the
+ # userinfo db.
+ require IkiWiki::UserInfo;
+ if (! IkiWiki::userinfo_get($session->param("name"), "regdate")) {
+ IkiWiki::userinfo_setall($session->param("name"), {
+ email => "",
+ password => "",
+ regdate => time,
+ }) || error("failed adding user");
+ }
+