Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: ../phpdbedittk/sess.php
PHPDBEditTk -

sess_manager

sess_manager

URL and state manager class.

 

private class sess_manager

URL and state manager class.
Handles the state of URL variables and attaches them to URLs if they contain a value.

Values can be set for one URL only and the class will reset it to the old value,after the next URl has been built. This allows building of link lists to differentparameterized pages without having to restore the old value of the variable implicitly.

There is also a fixed value which it will go back to, even if multiple URLs are built. Thisvalue can be used to set up avalue on a page after processing the input.

 

Public Method Summary

void

sess_manager([ array $arr_setup ])

Constructor
void

add_sess_setup(array $arr_setup)

Add state setup
void

set_sid(string $sid)

Sets the Session Identifier
string

get_sid()

Returns the Session Identifier
void

set_selffn(string $selffn)

Sets the self filename
void

set_type(string $lname, string $ltype, [ string $ldbname, string $ltablename, string $lcolname ])

Sets up one statedef
void

alter_value(string $lname, string $lvalue)

Sets the permament value of a state var
void

set_value(string $lname, string $lvalue)

Sets the temporary value of a state var
void

set_values_to_empty(array $arrval)

Sets a set of state vars temporarily to the empty string
mixed

un_set(string $lname)

Unsets the permament value of a state var
mixed

get_value(string $lname)

Get Value of state var
string

assemble([ string $lhref ])

Build an URL from the state vars.
void

get()

Reads the incoming URL
void

session_start_logged_in(string $userdata)

Saves parameters for a login session
void

session_logout()

Logs out, deletes the session and cleans up the data
integer

session_is_logged_in()

Check if login session is still valid and make it current

Private Field Summary

array

$stateval

state var array.
array

$statedef

state var definition.
array

$oldstate

state old values
array

$fixedstate

fixed state values
string

$sess_identifier

sess identifier
string

$selffn

self filename

Private Constant Summary

MAX_SESSION_LOGIN_TIME >>7200<< Maximum login time
SESS_STATE_TYPE >>0<< array index in URL state var definition

Public Method Details

sess_manager

public void sess_manager( [ array $arr_setup ] )

  Constructor
Setup state variable containers, if they are passed and initialise the PHP4 session

Parameter
array $arr_setup = >>array()<<
Returns void


add_sess_setup

public void add_sess_setup( array $arr_setup )

  Add state setup
Adds state variable setup to the current setup.This can be used to check and add from different classes that need their own variables.

Parameter
array $arr_setup
Returns void


set_sid

public void set_sid( string $sid )

  Sets the Session Identifier

Parameter
string $sid
Returns void

See Also $sess_identifier

get_sid

public string get_sid( )

  Returns the Session Identifier

Returns string

Session identifier

See Also $sess_identifier

set_selffn

public void set_selffn( string $selffn )

  Sets the self filename

Parameter
string $selffn
filename
Returns void

See Also $selffn

set_type

public void set_type( string $lname, string $ltype, [ string $ldbname, string $ltablename, string $lcolname ] )

  Sets up one statedef

Parameter
string $lname
string $ltype
. Only GET is used at the moment
string $ldbname = >>""<<
. Deprecated
string $ltablename = >>""<<
. Deprecated
string $lcolname = >>""<<
. Deprecated
Returns void

See Also $statedef

alter_value

public void alter_value( string $lname, string $lvalue )

  Sets the permament value of a state var

Parameter
string $lname
name of state variable
string $lvalue
new value
Returns void

See Also $fixedstate

set_value

public void set_value( string $lname, string $lvalue )

  Sets the temporary value of a state var
This value will be set until a URl is build.

Parameter
string $lname
name of state variable
string $lvalue
new value
Returns void

See Also $fixedstate

set_values_to_empty

public void set_values_to_empty( array $arrval )

  Sets a set of state vars temporarily to the empty string
This function is merely used for convenience

Parameter
array $arrval
names of the state variables
Returns void

See Also $fixedstate

un_set

public mixed un_set( string $lname )

  Unsets the permament value of a state var

Parameter
string $lname
name of the var
Returns mixed

value of the state var

See Also $fixedstate

get_value

public mixed get_value( string $lname )

  Get Value of state var

Parameter
string $lname
name of state var
Returns mixed

value of state var

See Also $fixedstate

assemble

public string assemble( [ string $lhref ] )

  Build an URL from the state vars.
Assemble will on call use all defined state vars and build a URL string from them.URL parameters will be named as the state var is named. If the variable currentlycontains an object or array, it will be serialized and preceded with the string "SR".

If $lhref is set, it will be used as the file to link to. The function also preserves GETparameters which are part of the URL passed with $lhref as well as relative links in the URL.If $lhref is not set, assemble() will use $selffn

Parameter
string $lhref = >>""<<
URL to build the link to.
Returns string

resulting URL

See Also $selffn

get

public void get( )

  Reads the incoming URL
Reads the URL and decodes all URL paramters which are defined in the state vardefinitions. The function does basically the reverse function for assemble

Returns void

See Also $stateval

session_start_logged_in

public void session_start_logged_in( string $userdata )

  Saves parameters for a login session
Saves data for login time to the SESSION array and adds the Session identifier to thestate vars. Also saves userdata to the SESSION array.

Parameter
string $userdata
data to save
Returns void


session_logout

public void session_logout( )

  Logs out, deletes the session and cleans up the data

Returns void


session_is_logged_in

public integer session_is_logged_in( )

  Check if login session is still valid and make it current
Checks, if the login session is still valid, depending on time saved inthe session vars and set the time to a current value.

Returns integer

1 if still valid


Private Field Details

$stateval

private array $stateval

>><<

state var array.
Stores the values of the current state of a variable.


$statedef

private array $statedef

>><<

state var definition.
Defines parameters on a state variable.

This is unused and contains only GET variables yet.


$oldstate

private array $oldstate

>><<

state old values
Old values of state variables


$fixedstate

private array $fixedstate

>><<

fixed state values
Fixed values of state variables. These come into place, if there is no temporary one set


$sess_identifier

private string $sess_identifier

>><<

sess identifier
Stores the value of the Session identifier.


$selffn

private string $selffn

>><<

self filename
Filename to be used for links by default. This is normally the name of the current file,if the application is mainly built on one file.


Private Constant Details

MAX_SESSION_LOGIN_TIME

define( MAX_SESSION_LOGIN_TIME, >>7200<< )
Case: default: case sensitive

Maximum login time
Defines the maximum time between clicks, until a user isautomatically logged out.

See Also session_is_logged_in()

SESS_STATE_TYPE

define( SESS_STATE_TYPE, >>0<< )
Case: default: case sensitive

array index in URL state var definition
Defines the index in the URL state var array definition, which is used for the usage type.Currently, only GET parameters are supported

See Also assemble(), get()


Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta