THE RESPONSE CLASS
This object is a container for all things to do with the response which we will send back to the requester (the client browser). It is a descendant of the webpage class, and before that, the session and the user classes.
If you use the Phplib framework then a response object is automatically instantiated for you. This object is assigned to the global variable called $RESPONSE. The framework also sets up the response parameters, and then calls the activate() method.
Located in /response-defs.php (line 216)
user | --session | --webstream | --webpage | --response
The browser accept string, as submitted by user-agent
The browser accept-encoding string
The browser accept-language string
Option to take on auth failure
URL to redirect to on auth failure
Type of authentication in effect
The make of browser
The type of browser requesting this response
The version of browser requesting this response
Buffering option to use
Cache control directive, usually passed on URL
Charset for this page
Minimum size in bytes before invoking compression
Compression type to use for response content
Datasources associated with this response
The debugger for this response
Array of DTD specifiers for this response. @see set_dtd()
Globals object. Manages the global vars in this response
The host of this website ie. 'foo.thingy.co.nz'
Our keep. Keeps variables alive in session
Our keep enabled flag (default enabled)
IDs of all languages contained in this page
Whether we have multi-byte string fns available
Metadata edit/generation mode we are in
Microsites edit/generation mode we are in
Name of the microsite detected, or undefined
Whether we are in multi-language mode or not, If this is true then
Dynamic page expiry in seconds. Time to allow a dynamic page to
Page ID - key to ax_sitepage record
Array of hosts we wish to connect persistently to
The remote IP address
Path to the requested script/page
Query string (if any) supplied to requested page
Path to the site document root
The URL of this website
Reponse timer
The user-agent
Inherited from webpage
webpage::$body
webpage::$foot
webpage::$generated
webpage::$head
webpage::$pluginset
webpage::$template
webpage::$templatefile
webpage::$theme
Inherited from webstream
webstream::$buffered
webstream::$cached
webstream::$cache_expiry
webstream::$cache_path
webstream::$cache_regen
webstream::$content
webstream::$replacement
Inherited from session
session::$cookiename
session::$db_backed
session::$error_message
session::$guest_browser_lifetime
session::$last_logintime
session::$lifetime
session::$logins_exceeded_msg
session::$logins_exceeded_option
session::$logins_exceeded_redirect
session::$login_type
session::$session_id
session::$session_record
session::$session_track_logins
Inherited from user
user::$authentication_method
user::$auth_code
user::$email
user::$enabled
user::$first_name
user::$group_info
user::$group_names
user::$hasgroups
user::$hasIPlist
user::$honorific_prefix
user::$IP
user::$last_name
user::$limit_logins
user::$locked
user::$mid_names
user::$name
user::$passwd_alphanum_mixed
user::$passwd_apply_stopwords
user::$passwd_char_uniqueness
user::$passwd_delay_ms
user::$passwd_encryption
user::$passwd_expiry_days
user::$passwd_expiry_ts
user::$passwd_failures
user::$passwd_forever
user::$passwd_history
user::$passwd_history_cycle
user::$passwd_max_attempts
user::$passwd_min_chars
user::$password
user::$remote_auth_dbname
user::$remote_auth_fields
user::$remote_auth_source
user::$remote_auth_tablename
user::$total_logins
user::$userid
user::$user_groups_cnt
user::$user_record
user::$user_type
user::$valid
Constructor Create a new response.
One of these objects must be created to respond to each request from the user agent for a webpage. This object manages that response and is a central marshalling point for all data and functions associated with that process. A response object is automatically created for you at the bottom of this module, and is assigned to the global variable $RESPONSE.
Add database Add a new database to the list of datasources which are going to be used to serve this response. The dbtype and the name are the only mandatory parameters.
Adds another language for the current webpage. Webpages might contain content in multiple languages, hence the need for a list.
Allowed groups This defines the allowed user-groups for this response, otherwise they get an error page returned. The list of allowed groups should be a comma-delimited string.
NB: We look for globals $admin_auth_code, and $auth_code and if available, use these for authorisation.
Set up the Wap page (card) attributes for our response. This is the exact equivalent to the page() method above, but for WAP phones instead.
Check group membership
This check whether the user requesting the page fulfils any group membership requirements. These are optionally expressed as the presence of 'ax_sitepage_group' records. A set of these records represents a set of groups that the user must be member of at least one of, to have access to the page.
Crash the response with message A fatal error ocurred. We die with a message to the system log and to the user. Code supplied is optional.
Set the response timer up. Set it ticking.
Forget kept variables by name. The named variables will have been passed to the remember() function beforehand, and this method causes them to be forgotten.
Globalise specific vars
Set globalise all
Flag that we should globalise all vars from anywhere. This is the same as setting 'register_globals = On' in php.ini. It gives backward compatibility with that setting, if you find that it has been set to 'Off' and this breaks your code. NB: This only takes effect when the session is activated with the activate() method of this class.
Is host in peristent list
Returns true if the given host is in our list of persistent hosts, else returns false. The persistent hosts list we hold will general contain partial hostnames. We therefore check to see if this partial name occurs anywhere in the given hostname.
Set authentication failure option
This sets the option for when authentication fails due to invalid username/password. Options are: AUTHFAIL_DIE_MSG Die, with 'not authorised' message AUTHFAIL_DIE_SILENT Die silently AUTHFAIL_REDIRECT Re-direct to alternate URL AUTHFAIL_GUEST Welcome the user as a guest (the default)
Set up the page attributes for our response. This is an important call, and should be made just after including response-defs.php in your source code. It sets up the page title, the template file which defines the page structure, the theme and stylesheet.
Register vars Register given variables for globalisation.
Remember variables by name, across page requests using our keep functionality. This utilises Php session handling to maintain the value of variables named here. Pass a list of vars as a string delimited by a comma.
Selects a database to use This will connect it if it isn't already connected. Calling this with no database name will select the default one. Returns the database unique identifier, or false if none was selected.
The named database must have been already defined. @see add_database()
Set website authentication
Set the authentication option for the website. Note that although there is NO_AUTHENTICATION, this has no real effect and is mainly there so you can indicate your intent not to bother with authentication. If no username/password is passed then the system will always log the session as a "guest" anyway, regardless of this setting. Options are: NO_AUTHENTICATION Redundant case, no authentication HTTP_AUTHENTICATION User sees a browser username/password popup FORM_AUTHENTICATION Custom form fields $tbxUsername/$tbxPassword
define a blocked IP list.
Set the list of IP addresses which are persona non grata for our site. This might be a list of problem IPs which are hacking, for example. Note that this method may not return, since the IP checking is done immediately, and if the REMOTE_ADDR accessing the site right now is found to match a blocked IP, then we crash and burn the response.
Set buffering option
Set the webstream buffering option. Usually we want to buffer the webpage output to do cool things with the content right up until we send it. If you select NO_BUFFERING, then output won't be buffered and you will probably be processing it yourself. If in doubt, leave it as BUFFERING, the default. Possible options.. BUFFERED Output webstream uses Php buffering (default) UNBUFFERED No buffering of output webstream
Set compression threshold Set the threshold size of content before we use compression.
Set compression type
Set the compression type to use for content delivery. Options are: NO_COMPRESSION Normal delivery of content BUILTIN_COMPRESSION Builtin PHP compression (Requires Php >= v4.04) CUSTOM_COMPRESSION Compression provided by the library
Set the DTDs array for all possible content types for this webpage.
The array is associative, with content type as the key, and the DTD specifier as the value. Currently we only support two content types: "html" and "wml".
Sets the content-type header characterset encoding, and (optionally)
allows you to override the content type itself although it should be set for you automatically, so you should only need to provide the second parameter for special purposes. This method will send the content-type: header to the user agent (browser). It can be called any number of times before send() is called.
Set the hostname of the machine serving this Axyl website. This is usually the same as that in the global $HTTP_HOST variable.
Set keep enable status. If the keep is enabled then there is access to the remember() and forget() methods to control persistent vars using Php session handling functions.
Set metadata mode
This setting determines whether Axyl will implement the metadata enhancements that it has. If true, content-managed layouts will get an extra button 'META', which enables page metadata to be edited Also, when page generation takes place, metadata elements will be procuced in the output.
Set microsites mode
This setting determines whether Axyl will implement the microsites enhancements that it has. If true, then users with content manager privileges will be able to create and maintain "microsites" within the current Axyl website framework. These are essentially simple themes, using Axyl themeing.
Sets the status of the multi-language flag 'multilang'. If this flag is true then multi-language facilities are enabled. This allows the setting of tags to indicate webpage language(s), and for inputting different character encodings via form elements etc.
Set page expiry in seconds. This affects all of the pages returned by Axyl.
Normally this is left at -1, which causes the system to tell the user browser to NOT cache the webpage, and revalidate every time. This is the usual case for a dynamic website where content is always changing. If set to a positive value, the user browser will (probably) keep the page cached for this time.
Define persistent hosts list.
Set the list of hosts recognition strings to connect to with persistent database connections. You can pass either an array of strings or a single string containing a delimited list of hosts.
Inherited From webpage
webpage::webpage()
webpage::add()
webpage::add_named_script()
webpage::add_script()
webpage::add_scriptsrc()
webpage::assign_DTD()
webpage::generate()
webpage::get_stylesheets()
webpage::inline_end()
webpage::inline_start()
webpage::insert_metatag()
webpage::plugin()
webpage::plugin_inline()
webpage::plugin_replace()
webpage::render()
webpage::send()
webpage::set_metatag()
webpage::set_onload()
webpage::set_style()
webpage::set_stylesheet()
webpage::set_template()
webpage::set_theme()
webpage::set_title()
Inherited From webstream
webstream::webstream()
webstream::add_content()
webstream::cache()
webstream::close_webstream()
webstream::discard()
webstream::length()
webstream::open_webstream()
webstream::replace()
webstream::replace_content()
webstream::reset_webstream()
webstream::send_errorcode_and_die()
webstream::send_error_and_die()
webstream::send_to_browser()
webstream::send_to_file()
webstream::webpage_content()
Inherited From session
session::session()
session::delete_cookie()
session::identify_user()
session::on_logins_exceeded()
session::recover()
session::session_clear()
session::session_create()
session::session_delete()
session::session_valid()
session::set_cookie()
session::set_cookiename()
session::set_guest_browser_lifetime()
session::set_lifetime()
session::set_sessiontype()
session::set_session_track_logins()
Inherited From user
user::user()
user::authenticate()
user::authenticate_authid()
user::authenticate_ipaddress()
user::authenticate_password()
user::authenticate_userid()
user::friendlyName()
user::generate_password()
user::get_auth_code()
user::get_groups()
user::get_user_by_auth_code()
user::get_user_by_id()
user::get_user_by_ip()
user::group_ids_list()
user::group_names_list()
user::ismemberof_group()
user::ismemberof_group_in()
user::ismemberof_group_with_id()
user::isvalid()
user::password_expired()
user::push_password_history()
user::save_password_data()
user::set_password()
user::set_password_expiry()
user::set_remote_authentication()
user::set_security_profile()
user::valid_password()
Documentation generated by phpDocumentor 1.3.0RC3