PHPDevShell 3.1.3-Stable
PHP OOP RAD Development Framework
PHPDS_security Class Reference
Inheritance diagram for PHPDS_security:
PHPDS_dependant

Public Member Functions

 securityIni ($validate_token=false)
 sqlWatchdog ($input)
 postValidation ()
 validatePost ()
 searchFormValidation ()
 isRoot ($user_id=false)
 currentUserID ()
 isSameGroup ($user_id)
 encrypt ($string)
 decrypt ($string)
 canAccessMenu ($menu_id, $type= 'menu_id')
 hashPassword ($password= '')
 userIp ()
 getUserIp ()
 validateEmail ($email_string)
 isLoggedIn ()

Data Fields

 $get
 $post
 $request
 $session
 $cookie

Member Function Documentation

canAccessMenu ( menu_id,
type = 'menu_id' 
)

Check if a user has access to a given menu id.

Version:
1.0.1
Date:
20091105 fixed a possible warning when the menu is not in the list (i.e. the user is not allowed)
Deprecated:
Parameters:
mixedThis can have both the menu id as an integer or as a string.
stringThe type of item requested, menu_id, menu_name etc...
Returns:
boolean Will return requested variable if user has access to requested menu item menu item.
currentUserID ( )

Returns current logged in user id.

Deprecated:
Returns:
integer
decrypt ( string)

Decrypts a string with the configuration key provided.

Parameters:
string$string
Returns:
string
encrypt ( string)

Encrypts a string with the configuration key provided.

Parameters:
string$string
Returns:
string
getUserIp ( )

Simple method to return users IP, this method will be improved in the future if needed.

Deprecated:
Returns:
string
hashPassword ( password = '')

Creates a "secret" version of the password

Parameters:
string$password,theclear password
Returns:
string the hashed password
Date:
20100204 greg: created from Jason's original fct
Version:
1.0
Author:
jason, greg
isLoggedIn ( )

Check is user is logged in, return false if not.

Returns:
boolean
isRoot ( user_id = false)

Check if user is a root user.

Deprecated:
Date:
20100608 (v1.0.1) (greg) moved to query system
Parameters:
mixed$user_idIf not logged in user, what user should be checked (primary role check only).
Returns:
boolean
isSameGroup ( user_id)

Check if the currently logged in user is the same group as the given user

This can be used to check if the current user is allowed access to the given user's data

Deprecated:
Date:
20100222
Version:
1.0
Author:
greg
Parameters:
$user_idinteger, the ID of the other user
Returns:
boolean, whether the current user is in the same group
See also:
http://wiki.phpdevshell.org/wiki/Security_with_groups_and_roles
postValidation ( )

Use inside your form brackets to send through a token validation to limit $this->post received from external pages.

Returns:
string Returns hidden input field.
searchFormValidation ( )

This is used in the search filter to validate $this->post made by the search form.

Returns:
string Returns hidden input field.
securityIni ( validate_token = false)

This method does the actual security check, other security checks are done on a per call basis to this method in specific scripts. Improved version reduces the cost of queries by 3, I also believe that this is a more secure method.

Parameters:
boolean$validate_crypt_keySet if you would like the system to verify an encryption before accepting global $_POST variables. Use with method send_crypt_key_validation in your form.
Returns:
string
Author:
Jason Schoeman
sqlWatchdog ( input)

Function just like mysql_real_escape_string, but does so recursive through array.

Parameters:
mixed$input
userIp ( )

Simple method to return users IP, this method will be improved in the future if needed.

Deprecated:
Returns:
string
validateEmail ( email_string)

Validates email address.

Parameters:
stringEmail address.
Returns:
boolean
Author:
Jason Schoeman
validatePost ( )

Use inside your form brackets to send through a token validation to limit $this->post received from external pages.

Returns:
string Returns hidden input field.

Field Documentation

$cookie
$get
$post
$request
$session

The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables Enumerations