XOOPS API 2.5.11 Beta1  UI v0.5
Réalisé par monxoops.fr
Référence du fichier userinfo.php

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)
 

Documentation des variables

◆ $avatar

$avatar = ''

◆ $cat_crit

$cat_crit = new CriteriaCompo()

◆ $cat_handler

$cat_handler = xoops_getModuleHandler('category')

◆ $cats

$cats = $cat_handler->getObjects($cat_crit, true, false)

◆ $email

if ( $thisUser->getVar( 'user_avatar') &&'blank.gif' !==$thisUser->getVar( 'user_avatar')) $email = ''

◆ $field_ids_visible

$field_ids_visible = $visibility_handler->getVisibleFields($thisUsergroups, $groups)

◆ $fields

$fields = $profile_handler->loadFields()

◆ $GLOBALS

if ( $rejected) if (is_object( $GLOBALS[ 'xoopsUser']) &&$GLOBALS[ 'xoopsUser']->isAdmin()) $GLOBALS[ 'xoopsOption'][ 'template_main'] = 'profile_userinfo.tpl'

◆ $gperm_handler

$gperm_handler = xoops_getHandler('groupperm')

◆ $groups

$groups = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getGroups() : array(XOOPS_GROUP_ANONYMOUS)

◆ $groups_accessible

$groups_accessible = $gperm_handler->getItemIds('profile_access', $groups_xoopsUser, $GLOBALS['xoopsModule']->getVar('mid'))

◆ $groups_basic

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

$groups_thisUser = $thisUser->getGroups()

◆ $groups_thisUser_nonbasic

$groups_thisUser_nonbasic = array_diff($groups_thisUser, $groups_basic)

◆ $groups_xoopsUser

$groups_xoopsUser = $groups

◆ $profile

$profile = $profile_handler->get($thisUser->getVar('uid'))

◆ $profile_handler

if ( $thisUser->getVar( 'user_viewemail')==1) elseif (is_object( $GLOBALS[ 'xoopsUser'])) foreach (array_keys( $cats) as $i) $profile_handler = xoops_getModuleHandler('profile')

◆ $rejected

$rejected = false

◆ $thisUser

$thisUser = $member_handler->getUser($uid)

◆ $thisUsergroups

$thisUsergroups = $thisUser->getGroups()

◆ $uid

$uid = isset($_GET['uid']) ? (int)$_GET['uid'] : 0

◆ $visibility_handler

$visibility_handler = xoops_getModuleHandler('visibility')

◆ $xoBreadcrumbs

$xoBreadcrumbs[] = array('title' => _PROFILE_MA_USERINFO)

◆ $xoopsOption

if (is_object( $GLOBALS[ 'xoopsUser']) &&$GLOBALS[ 'xoopsUser']->isAdmin()) $xoopsOption[ 'xoops_pagetitle'] = sprintf(_US_ALLABOUT, $thisUser->getVar('uname'))

◆ else

if ( $thisUser->isAdmin()) elseif ( $groups_thisUser_nonbasic) else
Valeur initiale :
xoops_getHandler
xoops_getHandler($name, $optional=false)
Definition: functions.php:28
$member_handler
if($uname==''|| $pass=='') $member_handler
Definition: checklogin.php:33