XOOPS API 2.5.11 Beta1
UI v0.5
Réalisé par monxoops.fr
|
Espaces de nommage | |
profile | |
Variables | |
$uid = isset($_GET['uid']) ? (int)$_GET['uid'] : 0 | |
if($uid<=0) | $gperm_handler = xoops_getHandler('groupperm') |
$groups = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getGroups() : array(XOOPS_GROUP_ANONYMOUS) | |
if(is_object($GLOBALS['xoopsUser']) && $uid==$GLOBALS['xoopsUser']->getVar('uid')) | else |
$thisUser = $member_handler->getUser($uid) | |
if(!is_object($thisUser)||(! $thisUser->isActive() &&(! $GLOBALS['xoopsUser']||! $GLOBALS['xoopsUser']->isAdmin()))) | $groups_basic = array(XOOPS_GROUP_ADMIN, XOOPS_GROUP_USERS, XOOPS_GROUP_ANONYMOUS) |
$groups_thisUser = $thisUser->getGroups() | |
$groups_thisUser_nonbasic = array_diff($groups_thisUser, $groups_basic) | |
$groups_xoopsUser = $groups | |
$groups_accessible = $gperm_handler->getItemIds('profile_access', $groups_xoopsUser, $GLOBALS['xoopsModule']->getVar('mid')) | |
$rejected = false | |
if($rejected) if(is_object($GLOBALS['xoopsUser']) && $GLOBALS['xoopsUser']->isAdmin()) | $GLOBALS ['xoopsOption']['template_main'] = 'profile_userinfo.tpl' |
if(is_object($GLOBALS['xoopsUser']) && $GLOBALS['xoopsUser']->isAdmin()) | $xoopsOption ['xoops_pagetitle'] = sprintf(_US_ALLABOUT, $thisUser->getVar('uname')) |
$thisUsergroups = $thisUser->getGroups() | |
$visibility_handler = xoops_getModuleHandler('visibility') | |
$field_ids_visible = $visibility_handler->getVisibleFields($thisUsergroups, $groups) | |
$profile_handler = xoops_getModuleHandler('profile') | |
$fields = $profile_handler->loadFields() | |
$cat_handler = xoops_getModuleHandler('category') | |
$cat_crit = new CriteriaCompo() | |
$cats = $cat_handler->getObjects($cat_crit, true, false) | |
$avatar = '' | |
if($thisUser->getVar('user_avatar') && 'blank.gif' !==$thisUser->getVar('user_avatar')) | $email = '' |
$profile = $profile_handler->get($thisUser->getVar('uid')) | |
$xoBreadcrumbs [] = array('title' => _PROFILE_MA_USERINFO) | |
$avatar = '' |
$cat_crit = new CriteriaCompo() |
$cat_handler = xoops_getModuleHandler('category') |
if ( $thisUser->getVar( 'user_avatar') &&'blank.gif' !==$thisUser->getVar( 'user_avatar')) $email = '' |
$field_ids_visible = $visibility_handler->getVisibleFields($thisUsergroups, $groups) |
$fields = $profile_handler->loadFields() |
if ( $rejected) if (is_object( $GLOBALS[ 'xoopsUser']) &&$GLOBALS[ 'xoopsUser']->isAdmin()) $GLOBALS[ 'xoopsOption'][ 'template_main'] = 'profile_userinfo.tpl' |
$gperm_handler = xoops_getHandler('groupperm') |
$groups = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getGroups() : array(XOOPS_GROUP_ANONYMOUS) |
$groups_accessible = $gperm_handler->getItemIds('profile_access', $groups_xoopsUser, $GLOBALS['xoopsModule']->getVar('mid')) |
if (!is_object( $thisUser)||(! $thisUser->isActive() &&(! $GLOBALS[ 'xoopsUser']||! $GLOBALS[ 'xoopsUser']->isAdmin()))) $groups_basic = array(XOOPS_GROUP_ADMIN, XOOPS_GROUP_USERS, XOOPS_GROUP_ANONYMOUS) |
Access permission check
Note: "thisUser" refers to the user whose profile will be accessed; "xoopsUser" refers to the current user $GLOBALS['xoopsUser'] "Basic Groups" refer to XOOPS_GROUP_ADMIN, XOOPS_GROUP_USERS and XOOPS_GROUP_ANONYMOUS; "Non Basic Groups" refer to all other custom groups
Admin groups: If thisUser belongs to admin groups, the xoopsUser has access if and only if one of xoopsUser's groups is allowed to access admin group; else Non basic groups: If thisUser belongs to one or more non basic groups, the xoopsUser has access if and only if one of xoopsUser's groups is allowed to allowed to any of the non basic groups; else User group: If thisUser belongs to User group only, the xoopsUser has access if and only if one of his groups is allowed to access User group
$groups_thisUser = $thisUser->getGroups() |
$groups_thisUser_nonbasic = array_diff($groups_thisUser, $groups_basic) |
$groups_xoopsUser = $groups |
$profile = $profile_handler->get($thisUser->getVar('uid')) |
if ( $thisUser->getVar( 'user_viewemail')==1) elseif (is_object( $GLOBALS[ 'xoopsUser'])) foreach (array_keys( $cats) as $i) $profile_handler = xoops_getModuleHandler('profile') |
$rejected = false |
$thisUser = $member_handler->getUser($uid) |
$thisUsergroups = $thisUser->getGroups() |
$uid = isset($_GET['uid']) ? (int)$_GET['uid'] : 0 |
$visibility_handler = xoops_getModuleHandler('visibility') |
$xoBreadcrumbs[] = array('title' => _PROFILE_MA_USERINFO) |
if (is_object( $GLOBALS[ 'xoopsUser']) &&$GLOBALS[ 'xoopsUser']->isAdmin()) $xoopsOption[ 'xoops_pagetitle'] = sprintf(_US_ALLABOUT, $thisUser->getVar('uname')) |
if ( $thisUser->isAdmin()) elseif ( $groups_thisUser_nonbasic) else |