![]() ![]() This has the effect of logging out a user for the current request only cookies and database sessions are left intact. logout_requestĮssentially, causes calls to Bugzilla->user to return undef. This is a compatibility function to be used in callsites where there is only a userid and no Bugzilla::User instance. Logs out the specified user (invalidating all his sessions), taking a Bugzilla::User instance. Three options are available from Bugzilla::Constants: LOGOUT_CURRENT (the default), LOGOUT_ALL or LOGOUT_KEEP_CURRENT. ![]() Logs out the current user, which involves invalidating user sessions and cookies. (This is set when you call "login".) logout($option) If the current page always requires the user to log in (for example, enter_bug.cgi or any page called with ?GoAheadAndLogIn=1) then this will return something true. Logs in a user, returning a Bugzilla::User object, or undef if there is no logged in user. For normal use, sudo access should normally be set at login time. It is meant to be used when a session has just started. sudo_request This begins an sudo session for the current request. If no session is in progress, returns the Bugzilla::User object corresponding to the currently logged in user. If an sudo session is in progress, returns the Bugzilla::User object corresponding to the person who logged in and initiated the session. Undef if there is no currently logged in user, the currently logged in user is not in the sudoer group, or there is no session in progress. You can use this if you want to bypass "login" for some reason and directly "log in" a specific Bugzilla::User. ![]() set_userĪllows you to directly set what "user" will return. If no session is in progress, the current Bugzilla::User. If an sudo session is in progress, the Bugzilla::User corresponding to the person who is being impersonated. userĭefault Bugzilla::User object if there is no currently logged in user or if the login code has not yet been run. This means that even if a value can appear multiple times, if it only does appear once, then it will be a scalar in input_params, not an arrayref. Note: When input_params represents the CGI parameters, any parameter specified more than once (like foo=bar&foo=baz) will appear as an arrayref in the hash, but any value specified only once will appear as a scalar. This should be used instead of "cgi" in situations where your code could be being called by either a normal CGI script or a WebService method, such as during a code hook. Modifying this hashref will modify the CGI parameters or the WebService arguments (depending on what input_params currently represents). When running in a normal script, this is a hashref containing the contents of the CGI parameters. When running under the WebService, this is a hashref containing the arguments passed to the WebService method that was called. Its useful as a convenience method for those scripts/templates which are only use via CGI, though. Not all Bugzilla actions are cgi requests. Note that modules should not be using this in general. If the argument is "" (empty string), the language is reset to the current one (the one used by Bugzilla->template). If no argument is passed, it uses the last language set. Also use it if you want to specify the language to use. If you ever need a Bugzilla::Template object while you're already processing a template, use this. The current Template object, to be used for output template_inner ![]() Nothing cares about this now, but don't rely on that. Note that all Bugzilla functionality is method based use Bugzilla->dbh rather than Bugzilla::dbh. Note that items accessible via this object are demand-loaded when requested.įor something to be added to this object, it should either be able to benefit from persistence when run under mod_perl (such as the a template object), or should be something which is globally required by a large ammount of code (such as the current user object). We can reuse objects across requests using mod_perl where appropriate (eg templates), whilst destroying those which are only valid for a single request (such as the current user).Code in modules can get access to these objects without having to have them all passed from the caller, and the caller's caller, and.Everything is in one central place, so it's easy to access, modify, and maintain.They're not global variables, so we don't have issues with them staying around with mod_perl.This module is a singleton intended as a central place to store these objects. This includes database handles, template objects, and so on. Several Bugzilla 'things' are used by a variety of modules and scripts. Bugzilla - Semi-persistent collection of various objects used by scripts and modules SYNOPSIS use Bugzilla ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |