function edit($data, $tpl = 'edit') { //call htmlrender fn $aclObject = XiptAclFactory::getAclObject($data['aclname']); $aclObject->bind($data); $helpMsg = XiptAclHelper::getHelpMessage($data['aclname']); $this->assign('helpMsg', $helpMsg); $this->assignRef('coreParamsHtml', $aclObject->getCoreParamsHtml()); $this->assignRef('aclParamsHtml', $aclObject->getAclParamsHtml()); $this->assign('aclruleInfo', $data); $this->setToolbar($tpl); return parent::display($tpl); }
function onAfterRoute() { $app = JFactory::getApplication(); // get option, view and task $option = JRequest::getVar('option', 'BLANK'); $view = JRequest::getVar('view', 'BLANK'); $task = JRequest::getVar('task', 'BLANK'); $component = JRequest::getVar('component', 'BLANK'); $jsconfig = JRequest::getVar('jsconfiguration', 'BLANK'); if ($app->isAdmin() && $option == 'com_community' && $view == 'configuration' && $jsconfig == 'privacy') { $this->_addResetPrivacyScript(); return true; } if ($app->isAdmin()) { return false; } if ($option === 'com_community') { $userid = JFactory::getUser()->id; $this->_pluginHandler->hideJSToolbar($userid); } /* When XiPT is integrated with subscription method and user does not pay or subscribe any plan, * till then XiPT apply default profile-type. */ if ($option == 'com_community' && $task == 'registerUpdateProfile' && ($view == 'register' || $view == 'registration')) { $subscription = XiptFactory::getSettings('subscription_integrate', 0); if ($subscription) { // Change post data (only profile-type and template field). $profiletypeId = XiptHelperJomsocial::getFieldId(PROFILETYPE_CUSTOM_FIELD_CODE); $templateId = XiptHelperJomsocial::getFieldId(TEMPLATE_CUSTOM_FIELD_CODE); //set current PT in other variable for further use $defaultPT = XiptLibProfiletypes::getDefaultProfiletype(); $this->_pluginHandler->setDataInSession('sessionpt', JRequest::getVar("field{$profiletypeId}", $defaultPT)); JRequest::setVar("field{$profiletypeId}", $defaultPT); JRequest::setVar("field{$templateId}", XiptLibProfiletypes::getProfiletypeData($defaultPT, 'template')); } } // perform all acl check from here XiptAclHelper::performACLCheck(false, false, false); //do routine works $eventName = $this->_eventPreText . strtolower($option) . '_' . strtolower($view) . '_' . strtolower($task); //call defined event to handle work $exist = method_exists($this, $eventName); if ($exist) { $this->{$eventName}(); } return false; }
function isApplicableonFriend($accesserid, $ownerid) { //check rule applicable on friend if yes than return true if ($this->aclparams->get('acl_applicable_to_friend', 1) == true) { return true; } //check accesser is friend of resource owner, //if they are friend then do not apply rule $isFriend = XiptAclHelper::isFriend($accesserid, $ownerid); if ($isFriend) { return false; } return true; }
/** * Filter the fields, which are allowed to user. * @param $userid * @param $fields * @return true */ function onProfileLoad(&$userid, &$fields, $from) { $none = false; $args['triggerForEvents'] = 'onprofileload'; $args['field'] =& $fields; XiptAclHelper::performACLCheck($none, $none, $args); // field according to profiletype $view = JRequest::getVar('view', ''); $task = JRequest::getVar('task', ''); //dont apply field privacy on admin approval plugin if (JRequest::getVar('option', '') == 'com_user' && $task == 'activate') { $activation = JRequest::getVar('activation', null); if (!empty($activation)) { return true; } } if ($view === 'search' && $task === 'advancesearch') { $userid = JFactory::getUser()->id; } XiptLibProfiletypes::filterCommunityFields($userid, $fields, $from); return true; }