Reply To: add volunteer name to 'clear' area

#7806
Anonymous
Inactive

Hm,

I guess you refer to the situation when the options require a person to be logged in. In this case storing a user_id might make sense even if it is mine. But I refer to the situation where the option “Login required?” is set to false.

If a guest signs up (without logging in) then the code also has no access to a user_id and stores the signup as is without user_id (the field user_id is 0). The guest has of course no “clear” link, but I as admin or a user having the right permission has access to the clear link for this signup.

If I as a logged in user sign up in behalf for another person I would expect exactly the same behavior, meaning my user_id is not listed in the guests signup record.
Right now my user id is listed in their signup records if I sign up for them in their behalf. If they sign up by them self, it is not listed (field user_id is 0).

Here the code that makes sense from my point of view

if (login required == true) {
   validate entered information.
   Store current users id in field user_id if the entered data can not be correlated to any user  in WP.
}
else {
   validate entered information.
   if ( entered information can be correlated to a user) {
      store that entered users id in field user_id.
   } else {
      store 0 in field user_id.
   }
}

Cheers,
Ulf