comment with intendation

git-svn-id: file:///svn/phpbb/trunk@9229 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2008-12-25 14:30:26 +00:00
parent 7396cf6dd4
commit ddfef8d832
2 changed files with 101 additions and 73 deletions

View file

@ -79,6 +79,7 @@ abstract class phpbb_session
/**
* Init session. Empties the user data and assigns the system object (phpbb::$instances['system'])
* @access public
*/
public function __construct()
{
@ -114,7 +115,9 @@ abstract class phpbb_session
* running on a system which makes such information readily available) and
* halt if it's above an admin definable limit.
*
* @param bool $update_session_page If true the session page gets updated. This can be set to false to circumvent certain scripts to update the users last visited page.
* @param bool $update_session_page If true the session page gets updated.
* This can be set to false to circumvent certain scripts to update the users last visited page.
*
* @return bool True if the session exist or has been created, else False.
* @access public
*/
@ -169,6 +172,7 @@ abstract class phpbb_session
* @param bool $set_admin Set the users admin field to identify him/her as an admin?
* @param bool $persist_login Allow persistent login
* @param bool $viewonline If false then the user will be logged in as hidden
*
* @return bool True if session got created successfully.
* @access public
*/
@ -633,9 +637,10 @@ abstract class phpbb_session
/**
* Sets a cookie of the given name with the specified data for the given length of time. If no time is specified, a session cookie will be set.
*
* @param string $name Name of the cookie, will be automatically prefixed with the phpBB cookie name. track becomes [cookie_name]_track then.
* @param string $name Name of the cookie, will be automatically prefixed with the phpBB cookie name. Track becomes [cookie_name]_track then.
* @param string $cookiedata The data to hold within the cookie
* @param int $cookietime The expiration time as UNIX timestamp. If 0 is provided, a session cookie is set.
*
* @access public
*/
public function set_cookie($name, $cookiedata, $cookietime)
@ -659,7 +664,9 @@ abstract class phpbb_session
* @param string|array $user_ips Can contain a string with one IP or an array of multiple IPs. If false then no ips are checked.
* @param int $user_email The email address to check
* @param bool $return If false then the banned message is displayed and script halted
* @return bool|string True if banned and no reason given. False if not banned. A ban reason if banned and ban reason given. Check for !== false.
*
* @return bool|string True if banned and no reason given.
* False if not banned. A ban reason if banned and ban reason given. Check for !== false.
* @access public
*/
public function check_ban($user_id = false, $user_ips = false, $user_email = false, $return = false)
@ -848,10 +855,12 @@ abstract class phpbb_session
*
* Only IPv4 (rbldns does not support AAAA records/IPv6 lookups)
*
* @author satmd (from the php manual)
* @param string $mode register/post - spamcop for example is ommitted for posting
* @param string $mode Possible modes are: register and post
* spamhaus.org is used for both modes. Spamcop.net is additionally used for register.
* @param string $ip The ip to check. If false then the current IP is used
* @return bool|array false if ip is not blacklisted, else an array([checked server], [lookup])
*
* @return bool|array False if ip is not blacklisted, else an array([checked server], [lookup])
* @author satmd (from the php manual)
* @access public
*/
public function check_dnsbl($mode, $ip = false)
@ -1002,7 +1011,7 @@ abstract class phpbb_session
/**
* Check if a valid, non-expired session exist. Also make sure it errors out correctly if we do not have a db-setup yet. ;)
*
* @return bool true if a valid, non-expired session exist
* @return bool True if a valid, non-expired session exist
* @access private
*/
private function session_exist()
@ -1094,6 +1103,7 @@ abstract class phpbb_session
* Check if the request originated from the same page.
*
* @param bool $check_script_path If true, the path will be checked as well
*
* @return bool True if the referer is valid
* @access private
*/
@ -1135,7 +1145,7 @@ abstract class phpbb_session
/**
* Fill data array with a "faked" user account
*
* @return array default user data array
* @return array Default user data array
* @access private
*/
private function default_data()
@ -1196,7 +1206,8 @@ abstract class phpbb_session
* Check if session is valid by comparing ip, forwarded for, browser and referer
*
* @param bool $log_failure If true then a non-match will be logged. Can cause huge logs.
* @return bool true if the session is valid
*
* @return bool True if the session is valid
* @access private
*/
private function session_valid($log_failure = true)

View file

@ -107,6 +107,7 @@ class phpbb_user extends phpbb_session
*
* @param string $auth_method The authentication method to use, for example 'db'
* @param string $custom_lang_path An optional language pack path.
* @access public
*/
public function __construct($auth_method, $custom_lang_path = false)
{
@ -128,7 +129,8 @@ class phpbb_user extends phpbb_session
/**
* Initialize user session
*
* @param bool $update_session_page If true the session page gets updated. This can be set to false to circumvent certain scripts to update the users last visited page.
* @param bool $update_session_page If true the session page gets updated.
* This can be set to false to circumvent certain scripts to update the users last visited page.
* @access public
*/
public function init($update_session_page = true)
@ -156,8 +158,11 @@ class phpbb_user extends phpbb_session
/**
* Setup basic user-specific items (style, language, ...)
*
* @param string|array $lang_set Language set to setup. Can be a string or an array of language files without a path and extension. Format must match {@link add_lang() add_lang}.
* @param int $style If not set to false this specifies the style id to use. The page will then use the specified style id instead of the default one.
* @param string|array $lang_set Language set to setup.
* Can be a string or an array of language files without a path and extension.
* Format must match {@link add_lang() add_lang}.
* @param int $style If not set to false this specifies the style id to use.
* The page will then use the specified style id instead of the default one.
* @access public
*/
public function setup($lang_set = false, $style = false)
@ -739,11 +744,13 @@ class phpbb_user extends phpbb_session
/**
* Format user date
*
* @param int $gmepoch unix timestamp to format
* @param string $format date format in date() notation. | used to indicate relative dates, for example |d m Y|, h:i is translated to Today, h:i.
* @param bool $forcedate force non-relative date format.
* @param int $gmepoch Unix timestamp to format
* @param string $format Date format in date() notation.
* The character | used to indicate relative dates, for example |d m Y|, h:i is translated to Today, h:i.
* @param bool $forcedate Force non-relative date format.
*
* @staticvar int $midnight Midnight time offset
* @staticvar array $date_cache array to cache commonly needed structures within this function
* @staticvar array $date_cache Array to cache commonly needed structures within this function
*
* @return mixed translated date
* @access public
@ -816,6 +823,7 @@ class phpbb_user extends phpbb_session
/**
* Get language id currently used by the user
*
* @return int language id
* @access public
*/
@ -844,8 +852,9 @@ class phpbb_user extends phpbb_session
/**
* Get users profile fields
*
* @param int $user_id user id. If not specified the current users profile fields are grabbed.
* @return array profile fields. If the current user then they are also stored as property $profile_fields.
* @param int $user_id User id. If not specified the current users profile fields are grabbed.
*
* @return array Profile fields. If the current user then they are also stored as property $profile_fields.
* @access public
*/
public function get_profile_fields($user_id = false)
@ -875,10 +884,12 @@ class phpbb_user extends phpbb_session
/**
* Specify/Get image from style imageset
*
* @param string $img the imageset image key name
* @param string $alt an optional alternative image attribute. If a corresponding language key exist it will be used: phpbb::$user->lang[$alt]
* @param string $type the preferred type to return. Allowed types are: full_tag, src, width, height
* @param int $width set image width
* @param string $img The imageset image key name
* @param string $alt An optional alternative image attribute.
* If a corresponding language key exist it will be used: phpbb::$user->lang[$alt]
* @param string $type The preferred type to return. Allowed types are: full_tag, src, width, height
* @param int $width Set image width
*
* @return mixed returns the preferred type from $type
* @access public
*/
@ -929,9 +940,11 @@ class phpbb_user extends phpbb_session
/**
* Get option bit field from user options.
*
* @param string $key the option key from {@link $keyoptions keyoptions}
* @param int $data optional user options bitfield. If not specified then {@link $data $data['user_options']} is used.
* @return bool corresponding option value returned. Is the option enabled or disabled.
* @param string $key The option key from {@link $keyoptions keyoptions}
* @param int $data Optional user options bitfield.
* If not specified then {@link $data $data['user_options']} is used.
*
* @return bool Corresponding option value returned. Is the option enabled or disabled.
* @access public
*/
public function optionget($key, $data = false)
@ -952,10 +965,13 @@ class phpbb_user extends phpbb_session
/**
* Set option bit field for user options.
*
* @param string $key the option key from {@link $keyoptions keyoptions}
* @param bool $value true to enable the option, false to disable it
* @param int $data optional user options bitfield. If not specified then {@link $data $data['user_options']} is used.
* @return bool the new user options bitfield is returned if $data is specified, else: false is returned if user options not changed, true if changed.
* @param string $key The option key from {@link $keyoptions keyoptions}
* @param bool $value True to enable the option, false to disable it
* @param int $data Optional user options bitfield.
* If not specified then {@link $data $data['user_options']} is used.
*
* @return bool The new user options bitfield is returned if $data is specified.
* Else: false is returned if user options not changed, true if changed.
* @access public
*/
public function optionset($key, $value, $data = false)
@ -987,12 +1003,13 @@ class phpbb_user extends phpbb_session
/**
* User login. Log the user in.
*
* @param string $username the specified user name
* @param string $password the specified password
* @param bool $autologin enable/disable persistent login
* @param string $username The specified user name
* @param string $password The specified password
* @param bool $autologin Enable/disable persistent login
* @param bool $viewonline If false then the user will be logged in as hidden
* @param bool $admin If true the user requests an admin login
* @return array login result array. This array returns results to the login script to show errors, notices, confirmations.
*
* @return array Login result array. This array returns results to the login script to show errors, notices, confirmations.
* @access public
*/
public function login($username, $password, $autologin = false, $viewonline = 1, $admin = 0)