iPeer v2 Technical Documentation
Based on file: iPeer-v2-Technical-Documentation.doc
rdAuth Components:
rdAuth components monitors the current user’s information such as id, role, username, fullname. To get the current user’s attribute, we can call: From View: $rdAuth->id From Controller: $this->rdAuth->id
Sys_Parameter Settings:
System Parameters are loaded once the users has login successfully. There are 2 core parameters that control the iPeer integration with UBC CWL:
For General version:
Parameter Code | Parameter Value |
custom.login_control | ipeer |
custom.login_page_pathname | Leave it as empty |
For UBC CWL customization:
Parameter Code | Parameter Value |
custom.login_control | UBC_CWL |
custom.login_page_pathname | custom_ubc_cwl_login |
To check whether the iPeer is UBC CWL integrated or not:
if (isset($this->rdAuth->customIntegrateCWL) && $this->rdAuth->customIntegrateCWL) { // ipeer is integrated with CWL }
Get Sys_Parameter from iPeer:
e.g. Get the parameter code ‘system.upload_dir’:
$uploadDir = $this->sysContainer->getParamByParamCode('system.upload_dir'); $uploadFile = APP.$uploadDir['parameter_value'] . $filename;
Some useful functions:
1.Get all accessible courses:
$courseList = $this->sysContainer->getMyCourseList();
2.Get no. of members within a group:
$numMembers=$event['Event']['self_eval'] ? $this->GroupsMembers->findCount('group_id='.$groupId) : $this->GroupsMembers->findCount('group_id='.$groupId) - 1;
Caution: To upgrade CakePHP library for iPeer, please also look into the following files to change for iPeer customization:
- replace all thtml -> tpl.php, since iPeer use php extension instead of thtml
- change the controller.php in \cake\libs\controller
- change html.php helper in \cake\libs\view\helpers
- change dbo_source.php in \cake\libs\model\datasources