/include/misc.php

Description

Miscellaneous functions that do not really fit elsewhere.

$Id: misc.php 499 2005-08-19 08:41:14Z stijn $

Constants
NOT_CONFIGGED_FOR_HTTPS = -1 (line 13)

Site configuration disallows https status value.

Functions
allowInsecureLogin (line 254)

Returns true if insecure logins are allowed.

Insecure logins are logins using the unencrypted http:// method.

  • return: true if insecure logins are allowed
bool allowInsecureLogin ()
completeEncryptedMe (line 116)

Return the complete URL to the current page, including the query string, prefixed with 'https://'.

  • return: the complete URL to the current page, including the query string, prefixed with 'https://'.
string completeEncryptedMe ()
completeMe (line 67)

Return the complete URL to the current page, including the query string but without the 'http://' part.

  • return: the complete URL to the current page
string completeMe ()
completeQualifiedMe (line 91)

Return the complete URL to the current page, including the query string and the 'http://' or 'https://' part.

  • return: the complete URL to the current page including prefix
string completeQualifiedMe ()
encryptedMe (line 127)

Return the complete URL to the current page, without the query string, prefixed with 'https://'.

  • return: the complete URL to the current page, without the query string, prefixed with 'https://'.
string encryptedMe ()
encryptProtocol (line 193)

Redirect the user to the encrypted version of the current URL.

Will not work if output has been sent to the browser before calling. Respects the configuration setting for 'https' enabled sites. Returns only if the page is requested by secure a method.

void encryptProtocol ()
getReferrer (line 56)

Return the canonicalized referrer of the current webpage.

Canonicalized because the query string of the referrer is stripped before being returned. Returns "" if no referrer information was present in the request.

  • return: the referrer of the webpage or ""
string getReferrer ()
getUserURL (line 176)

Return the base URL for the user site if the current request is for a user site.

Returns "" if the current request is not for a user site.

  • return: the base URL for the user site.
string getUserURL ()
getUserUser (line 159)

Return a username if the current request is for a user site.

Returns "" if the current request is not for a user site.

  • return: the username of the user for the current site request
string getUserUser ()
matchReferrer (line 141)

Return true if the referrer to the current page matches.

The function defaults to checking whether the referrer is the same as the current page, either in SSL or non-SSL mode. An optional referrer may be specified to match against.

  • return: true if a referrer was specified and it matched
bool matchReferrer ([string $goodReferrer = ""])
  • string $goodReferrer: the referrer to match against
me (line 81)

Return the complete URL to the current page, without the query string (if any) and without the 'http://' part.

  • return: the complete URL to the current page without the query string
string me ()
qualifiedMe (line 105)

Return the complete URL to the current page, without the query string but with the 'http://' or 'https://' part.

  • return: the complete URL to the current page including prefix, but without the query string.
string qualifiedMe ()
remoteAddress (line 273)

Return the address of the client, as specified by the client.

DO NOT USE FOR SECURITY PURPOSES!. This is not to be trusted. Any client can fake this. It is only useful for identifying the same client during web requests.

Returns "unknown" if the remote client address was not sent along with the request.

  • return: the remote address or "unknown"
string remoteAddress ()
stripPathInfo (line 35)

Strip the PATH_INFO of an URL.

  • return: the URL with the optional PATH_INFO information stripped
string stripPathInfo (string $url)
  • string $url: the URL
stripQuerystring (line 21)

Strip the query string of an (optional) GET request URL, and return it.

  • return: the URL, with the GET request portion (?foo=bar&xyzzy=frob) stripped
string stripQuerystring (string $url)
  • string $url: the URL
unencryptProtocol (line 226)

Redirect the user to the unencrypted version of the current URL.

Basically the opposite of encryptProtocol, this function works about the same. No output may have been sent to the browser yet, and it will only return if the page is requested using an insecure method.

void unencryptProtocol ()

Documentation generated on Fri, 30 Jun 2006 10:31:38 +0200 by phpDocumentor 1.3.0RC3