$config = CRM_Core_Config::singleton();
$session = CRM_Core_Session::singleton();
$uid = CRM_Core_BAO_UFMatch::getUFId($cid);
+ $userRecordUrl = NULL;
if ($uid) {
if ($config->userSystem->is_drupal == '1' &&
($session->get('userID') == $cid || CRM_Core_Permission::checkAnyPerm(array('cms:administer users', 'cms:view user account')))
$userRecordUrl = $config->userFrameworkBaseURL . "index.php?option=com_admin&view=profile&layout=edit&id=" . $uid;
}
}
- else {
- $userRecordUrl = NULL;
+ // For WordPress, provide link to user profile is contact belongs to logged in user OR user has administrator role
+ elseif ($config->userFramework == 'WordPress' &&
+ ($session->get('userID') == $cid || CRM_Core_Permission::checkAnyPerm(array('cms:administer users')))
+ ) {
+ $userRecordUrl = $config->userFrameworkBaseURL . "wp-admin/user-edit.php?user_id=" . $uid;
}
$obj->assign('userRecordUrl', $userRecordUrl);
$obj->assign('userRecordId', $uid);
* @access public
*/
function check($str) {
+ // Generic cms 'administer users' role tranlates to 'administrator' WordPress role
$str = $this->translatePermission($str, 'WordPress', array(
- 'view user account' => 'administrator',
+ 'administer users' => 'administrator',
));
if ($str == CRM_Core_Permission::ALWAYS_DENY_PERMISSION) {
return FALSE;