Umfragen
tools.php File Reference

Go to the source code of this file.

Functions

if(!isset($config_included)) make_auth_object ()
 creates the authentification object according to constants settings
 make_session ()
 starts the session and initialises the user object if there was no login
 load_poll_from_http_request ($db, $method="GET")
 searches the key "pollID" in the POST or GET globals and loads a poll according to it
 load_widget_from_http_request ($poll, $method="GET")
 searches the key "widgetID" in the POST or GET globals and searches for the widget in the given pollobject

Function Documentation

load_poll_from_http_request (   $db,
  $method = "GET" 
)

searches the key "pollID" in the POST or GET globals and loads a poll according to it

Parameters
db$dbdatabase object
string$methodPOST or GET
Exceptions
exceptionif pollobject cannot be created ord database object is not valid
Returns
poll object or string representing a error message (poll does not exist etc)

Definition at line 52 of file tools.php.

load_widget_from_http_request (   $poll,
  $method = "GET" 
)

searches the key "widgetID" in the POST or GET globals and searches for the widget in the given pollobject

Parameters
poll$pollpollobject with loaded widget list
string$methodPOST or GET
Exceptions
exceptionon severe error
Returns
widget object or decribing error message

Definition at line 99 of file tools.php.

if (!isset($config_included)) make_auth_object ( )

creates the authentification object according to constants settings

Exceptions
exceptionon error most likely when the constant (AUTH_METHOD,..) is not defined
Returns
authentification object

Definition at line 12 of file tools.php.

make_session ( )

starts the session and initialises the user object if there was no login

Exceptions
exceptionif the user class was not defined
Returns
bool true

Definition at line 30 of file tools.php.