spRoot / cRoot
Inherits from spObject.
component: cRoot
class: spRoot
Every PHsPeed application requires a cRoot, a cBlank or a cModule component. The component defined the type of application that will be generated. A Root (cRoot) component is the most common and declares the module as an executable PHP application.
Properties
|
Group |
Description |
AccessibleByAdmin |
security |
Allow full access for system admin |
AuditAccess |
|
Add audit log record on access by user |
Author |
|
Author as will be used in the HTML header |
CanRunStandAlone |
|
Specifies if the application can run stand-alone (direct from URL) or requires elevation (If set to false, calling the module from the url will automaticall redirect to the defined 'main' application, usually the logon procedure. |
DBConnection |
|
Specifies the database connection for authorization and preferences |
dbDateFormat |
|
Specifies the Database date format. Default: yyyy-mm-dd |
Class |
|
Specifies CSS class. Allows to apply / add your own css specification(s) |
ClearSessionOnGe |
|
Will empty session variables when method is $_GET (prevents hanging variables on application start) [deprecated] |
Container |
|
Specifies the bootstrap container type. coFixed : fixed container (default), coFluid : fluid container. |
CustomLogin |
|
Allows overriding the login page by your own module/method. Enables the execution of the onLogin event. |
CustomRBA |
|
Allows overriding the internal RBA module by your own module/method. Enables the execution of the onGetModuleRightsOf and the onRequestAccessTo events. |
dbDateFormat |
|
Specifies the Database date format. Default: yyyy-mm-dd |
Description |
|
Description as will be used in the HTML header |
Keywords |
|
Keywords as will be used in the HTML header |
Layout |
|
Name of the default layout that will be used by the code generator |
Library |
|
Specifies if the used libraries are being imported from the web or are internal |
PasswordEncryption |
|
Specifies the encryption method for the password. |
phpDateFormat |
|
Specifies the PHP date format. Default:Y-m-d |
Robots |
|
Robots as will be used in the html header |
Style |
|
Specifies CSS style. Allows to apply backgrounds, shading etc. on global and local level. |
Theme |
|
The Bootstrap theme that is used to render the module. Allows adding headers, footers, sides. |
Title |
|
Title as will be used in the HTML header |
TopMargin |
|
Specifies default margin between the top of the browser and the first PHsPeed Panel. If used with a header, it is the space between the header and the detail |
UseAuditTrail |
|
Make use of audit-trail log (you must have setup audit trail for the project, otherwise you will get run time errors) |
UseAuthorisation |
|
Specifies if the access rights of the users applies for this module (Failing access will redirect to the main page, usually the login page) |
UseLogonModule |
|
Causes the application to ignore the 'logged on' status for logon procedures |
UseSecurityModule |
|
Specifies if PHsPeed will generate code to retrieve user access (needed only if you use credentials |
Methods
|
Returns |
Description |
public function simpleLogin( $user, $password, $doencrypt=false, $table='', $userfield='', $pswfield='', $isadminfield=' ') |
true when login succesful, false otherwise |
This function can be used if you need to bind to a simple security table. It requires that you supply the physical names of the table and fields, and supply userid/password. It uses the simpleRBA module. |
public function simpleAddUser( $user, $password, $doencrypt=false, $table='', $userfield='', $pswfield='' ) |
none |
Adds a user to the user table. Currently meant to add an initial user. The simpleRBA module is meant for custom authorization. Consider the standard PHsPeed RBA if you can. |
public function login($user, $passwrd, $doencrypt=false) |
true when login succesful, false otherwise |
If the custom login procedure is used, then the onLogin event will be executed. If the authorisation module is required then the PHsPeed RBA module is used to logon. Finally if both methods are unused, the verification will take place against the encryption values set in the IDE at the project. Encryption key is used as userid and Vector as password. |
public function auditLog($action, $appid, $message='') |
none |
Writes a message to the audit trail (if enabled) |
public function setTheme($theTheme) |
none |
Sets / changes the current bootstrap theme of the application |
public function getCurrentTheme() |
name of the current theme |
Retrieves the current used theme |
public function setLanguage($theLanguage) |
none |
Sets / changes the current language of the application |
getCurrentLanguage() |
name of the current language |
Retrieves the language information |
public function logoff() |
none |
Logges of |
hasAccessTo($module) |
true when access, false if not |
Verifies access to the given module |
secureRedirect($url) |
none |
Redirects to another application within the project, if the rights are sufficient. Uses phspRedirect($url) which also takes care of adding token. |
PHP Events
|
|
Description |
onActivate |
|
|
onAfterDetail |
|
Fires after rendering of detail |
onAfterFooter |
|
Fires after rendering of footer |
onAfterHeader |
|
Fires after rendering of header |
onBeforeDetail |
|
Fires before rendering of detail |
onBeforeFooter |
|
Fires before rendering of footer |
onBeforeHeader |
|
Fires before rendering of header |
onDestroy |
|
|
onExec |
|
Fires when the application enters the 'execute' phase |
onFinish |
|
|
onGetModuleRightsOf |
onGetModuleRights($app, $userid, $module) |
Fires when the application requires the rights of a module (when RBA is bypassed) |
onLogin |
onLogin($app, $userid, $password) |
Fires when the applicaiton requires a login (when RBA is bypassed). It allows you to apply your own login module, like using external sources like Saml etc. |
onRequestAccessTo |
onRequestAccessTo($app, $userid, $module) |
Fires when the application requires to know if a module can be accessed (when RBA is bypassed) |
Javascript Events
|
Description |
onDocumentReady |
Fires when the document is reported ready |