[Home]WikiBugs/GetNewUserIdWhenDoSave

UseModWiki | WikiBugs | RecentChanges | Preferences

UserId? suffers an increment with only touch action=newlogin (even if after, user goes out). It would be more conservative if it is confirmed to save.

Preliminary: first of all, remove GetNewUserId? from DoNewLogin.

The rest of implementation is possible with patchs like WikiPatches/LoginRework.

# Create a new user file/cookie pair
sub DoNewLogin {
  # Consider warning if cookie already exists
  # (maybe use "replace=1" parameter)
  &CreateUserDir();
  - $SetCookie{'id'} = &GetNewUserId();
  - $SetCookie{'randkey'} = int(rand(1000000000));
  - $SetCookie{'rev'} = 1;
  - %UserCookie = %SetCookie;
  - $UserID = $SetCookie{'id'};
  - # The cookie will be transmitted in the next header
  - %UserData = %UserCookie;
  - $UserData{'createtime'} = $Now;
  - $UserData{'createip'} = $ENV{REMOTE_ADDR};
  &SaveUserData();
}

I will try it.

--JuanmaMP


UseModWiki | WikiBugs | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited September 21, 2009 10:16 pm by 38.Red-80-58-205.staticIP.rima-tde.net (diff)
Search: