Closed Bug 280994 Opened 19 years ago Closed 19 years ago

Move ValidateNewUser out of globals.pl

Categories

(Bugzilla :: Bugzilla-General, enhancement)

2.19.2
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: mkanat, Assigned: mkanat)

References

Details

Attachments

(1 file)

We need to move ValidateNewUser. It also needs a name change. I was thinking
is_unused_username or is_available_username.

I also need to change the SendSQL stuff to DBI stuff.
OK, here's the patch! I've tested all the locations where this occured, and it
still seems to work quite well.
Attachment #173323 - Flags: review?
Status: NEW → ASSIGNED
Target Milestone: --- → Bugzilla 2.20
Attachment #173323 - Flags: review? → review+
Flags: approval?
(probably an issue for another bug, but) shouldn't is_available_username also
check the profiles table, and not just tokens? (would seem cleaner than having
separate functions for it)
Flags: approval? → approval+
(In reply to comment #2)
> (probably an issue for another bug, but) shouldn't is_available_username also
> check the profiles table, and not just tokens?

If something suitable would exist in the profile table, then the function would
return 0 via this code path:

-    if(DBname_to_id($username) != 0) {
-        return 0;
-    }
(In reply to comment #2)
> (probably an issue for another bug, but) shouldn't is_available_username also
> check the profiles table, and not just tokens? (would seem cleaner than having
> separate functions for it)

  Yeah, Vlad is basically right. And we need to call DBname_to_id all the time,
whereas we need to call is_available_username only rarely.

  I'll think about how I'm going to refactor DBname_to_id, though, and who
knows, maybe something magical will appear. :-)
Checking in createaccount.cgi;
/cvsroot/mozilla/webtools/bugzilla/createaccount.cgi,v  <--  createaccount.cgi
new revision: 1.36; previous revision: 1.35
done
Checking in editusers.cgi;
/cvsroot/mozilla/webtools/bugzilla/editusers.cgi,v  <--  editusers.cgi
new revision: 1.73; previous revision: 1.72
done
Checking in globals.pl;
/cvsroot/mozilla/webtools/bugzilla/globals.pl,v  <--  globals.pl
new revision: 1.299; previous revision: 1.298
done
Checking in token.cgi;
/cvsroot/mozilla/webtools/bugzilla/token.cgi,v  <--  token.cgi
new revision: 1.29; previous revision: 1.28
done
Checking in userprefs.cgi;
/cvsroot/mozilla/webtools/bugzilla/userprefs.cgi,v  <--  userprefs.cgi
new revision: 1.64; previous revision: 1.63
done
Checking in Bugzilla/User.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/User.pm,v  <--  User.pm
new revision: 1.35; previous revision: 1.34
done
Checking in Bugzilla/Auth/Verify/LDAP.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify/LDAP.pm,v  <--  LDAP.pm
new revision: 1.5; previous revision: 1.4
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: