@ -536,9 +536,10 @@ function modify_filter($user_id, $url_params, $row)
if (api_is_platform_admin()) {
if (!$user_is_anonymous) {
$result .= '< a href = "user_information.php?user_id='.$user_id.'" > '.
Display::return_icon('info2.png', get_lang('Information')).'< / a > ';
Display::getMdiIcon('information', 'ch-tool-icon', null, 22, get_lang('Information')).
'< / a > ';
} else {
$result .= Display::return_icon('info2_na.png', get_lang('Information')).' ' ;
$result .= Display::getMdiIcon('information', 'ch-tool-icon-disabled', null, 22, get_lang('Information')) ;
}
}
@ -557,26 +558,34 @@ function modify_filter($user_id, $url_params, $row)
if (!$user_is_anonymous) {
if (api_global_admin_can_edit_admin($user_id, null, $sessionAdminCanLoginAs)) {
$result .= '< a href = "user_list.php?action=login_as&user_id='.$user_id.'&sec_token='.Security::getTokenFromSession().'" > '.
Display::return_icon('login_as.png' , get_lang('Login as')).'< / a > ';
Display::getMdiIcon('account-key', 'ch-tool-icon', null, 22 , get_lang('Login as')).'< / a > ';
} else {
$result .= Display::return_icon('login_as_na.png', get_lang('Login as')).' ' ;
$result .= Display::getMdiIcon('account-key', 'ch-tool-icon-disabled', null, 22, get_lang('Login as')) ;
}
} else {
$result .= Display::return_icon('login_as_na.png', get_lang('Login as')).' ' ;
$result .= Display::getMdiIcon('account-key', 'ch-tool-icon-disabled', null, 22, get_lang('Login as')) ;
}
} else {
$result .= Display::return_icon('login_as_na.png', get_lang('Login as')).' ' ;
$result .= Display::getMdiIcon('account-key', 'ch-tool-icon-disabled', null, 22, get_lang('Login as')) ;
}
if ($current_user_status_label != $statusname[STUDENT]) {
$result .= Display::return_icon(
'statistics_na.png',
$result .= Display::getMdiIcon(
'chart-box',
'ch-tool-icon-disabled',
null,
22,
get_lang('Reporting')
).' ';
);
} else {
$result .= '< a href = "../mySpace/myStudents.php?student='.$user_id.'" > '.
Display::return_icon('statistics.png', get_lang('Reporting')).
'< / a > ';
Display::getMdiIcon(
'chart-box',
'ch-tool-icon',
null,
22,
get_lang('Reporting')
).'< / a > ';
}
if (api_is_platform_admin(true)) {
@ -585,20 +594,22 @@ function modify_filter($user_id, $url_params, $row)
api_global_admin_can_edit_admin($user_id, null, true)
) {
$result .= '< a href = "'.$editProfileUrl.'" > '.
Display::return_icon(
'edit.png',
get_lang('Edit'),
[],
ICON_SIZE_SMALL
Display::getMdiIcon(
'pencil',
'ch-tool-icon',
null,
22,
get_lang('Edit')
).
'< / a > ';
'< / a > ';
} else {
$result .= Display::return_icon(
'edit_na.png',
get_lang('Edit'),
[],
ICON_SIZE_SMALL
).'< / a > ';
$result .= Display::getMdiIcon(
'pencil',
'ch-tool-icon-disabled',
null,
22,
get_lang('Edit')
).'< / a > ';
}
}
@ -606,36 +617,122 @@ function modify_filter($user_id, $url_params, $row)
if ($allowAssignSkill) {
$result .= Display::url(
Display::return_i con(
'skill-badges.png ',
get_lang('Assign skill') ,
Display::getMdiI con(
'shield-star ',
'ch-tool-icon' ,
null,
ICON_SIZE_SMALL
22,
get_lang('Assign skill')
),
api_get_path(WEB_CODE_PATH).'badge/assign.php?'.http_build_query(['user' => $user_id])
);
}
if ($is_admin) {
$result .= Display::return_icon(
'admin_star.png',
get_lang('Is administrator'),
['width' => ICON_SIZE_SMALL, 'heigth' => ICON_SIZE_SMALL]
$result .= Display::getMdiIcon(
'star',
'ch-tool-icon',
null,
22,
get_lang('Is administrator')
);
} else {
$result .= Display::return_icon(
'admin_star_na.png',
$result .= Display::getMdiIcon(
'star',
'ch-tool-icon-disabled',
null,
22,
get_lang('Is not administrator')
);
}
if (api_is_platform_admin()) {
/* Temporarily disabled until improved
$result .= ' < a data-title = "'.get_lang('Free/Busy calendar').'" href = "'.api_get_path(WEB_AJAX_PATH).'agenda.ajax.php?a=get_user_agenda&user_id='.$user_id.'&modal_size=lg" class = "agenda_opener ajax" > '.
Display::getMdiIcon(
'calendar-text',
'ch-tool-icon',
null,
22,
get_lang('Free/Busy calendar')
).
'< / a > ';
*/
if ($user_id != $currentUserId & &
!$user_is_anonymous & &
api_global_admin_can_edit_admin($user_id)
) {
$result .= ' < a href = "user_list.php?action=anonymize&user_id='.$user_id.'&'.$url_params.'&sec_token='.Security::getTokenFromSession().'" class = "delete-swal" title = "'.addslashes(api_htmlentities(get_lang(" Please confirm your choice " ) ) ) . ' " > '.
Display::getMdiIcon(
'incognito',
'ch-tool-icon',
null,
22,
get_lang('Anonymize')
).
'< / a > ';
}
$deleteAllowed = !api_get_configuration_value('deny_delete_users');
if ($deleteAllowed) {
if ($user_id != $currentUserId & &
!$user_is_anonymous & &
api_global_admin_can_edit_admin($user_id)
) {
// you cannot lock yourself out otherwise you could disable all the accounts
// including your own => everybody is locked out and nobody can change it anymore.
$result .= ' < a href = "user_list.php?action=delete_user&user_id='.$user_id.'&'.$url_params.'&sec_token='.Security::getTokenFromSession().'" title = "'.addslashes(api_htmlentities(get_lang(" Please confirm your choice " ) ) ) . ' " class = "delete-swal" > '.
Display::getMdiIcon(
'delete',
'ch-tool-icon',
null,
22,
get_lang('Delete')
).
'< / a > ';
} else {
$result .= Display::getMdiIcon(
'delete',
'ch-tool-icon-disabled',
null,
22,
get_lang('Delete')
);
}
}
}
$allowDelete = api_get_configuration_value('allow_delete_user_for_session_admin');
if (api_is_session_admin() & & $allowDelete) {
if ($user_id != $currentUserId & &
!$user_is_anonymous & &
api_global_admin_can_edit_admin($user_id, null, true)
) {
// you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore.
$result .= ' < a href = "user_list.php?action=delete_user&user_id='.$user_id.'&'.$url_params.'&sec_token='.Security::getTokenFromSession().'" title = "'.addslashes(api_htmlentities(get_lang('Please confirm your choice'))).'" class = "delete-swal" > '.
Display::getMdiIcon(
'delete',
'ch-tool-icon',
null,
22,
get_lang('Delete')
).
'< / a > ';
}
}
// actions for assigning sessions, courses or users
if (!api_is_session_admin()) {
if ($current_user_status_label == $statusname[SESSIONADMIN]) {
$result .= Display::url(
Display::return_icon(
'view_more_stats.gif',
get_lang('AssignCourse sessions')
Display::getMdiIcon(
'google-classroom',
'ch-tool-icon',
null,
22,
get_lang('Assign sessions')
),
"dashboard_add_sessions_to_user.php?user={$user_id}"
);
@ -645,11 +742,12 @@ function modify_filter($user_id, $url_params, $row)
$current_user_status_label == $statusname[STUDENT_BOSS]
) {
$result .= Display::url(
Display::return_icon(
'user_subscribe_course.png',
get_lang('Assign users'),
'',
ICON_SIZE_SMALL
Display::getMdiIcon(
'account-child',
'ch-tool-icon',
null,
22,
get_lang('Assign users')
),
"dashboard_add_users_to_user.php?user={$user_id}"
);
@ -657,17 +755,23 @@ function modify_filter($user_id, $url_params, $row)
if ($current_user_status_label == $statusname[DRH] || UserManager::is_admin($user_id)) {
$result .= Display::url(
Display::return_icon(
'add.png',
Display::getMdiIcon(
'book-open-page-variant',
'ch-tool-icon',
null,
22,
get_lang('Assign courses')
),
"dashboard_add_courses_to_user.php?user={$user_id}"
);
$result .= Display::url(
Display::return_icon(
'view_more_stats.gif',
get_lang('AssignCourse sessions')
Display::getMdiIcon(
'google-classroom',
'ch-tool-icon',
null,
22,
get_lang('Assign sessions')
),
"dashboard_add_sessions_to_user.php?user={$user_id}"
);
@ -675,75 +779,6 @@ function modify_filter($user_id, $url_params, $row)
}
}
$allowDelete = api_get_configuration_value('allow_delete_user_for_session_admin');
if (api_is_session_admin() & & $allowDelete) {
if ($user_id != $currentUserId & &
!$user_is_anonymous & &
api_global_admin_can_edit_admin($user_id, null, true)
) {
// you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore.
$result .= ' < a href = "user_list.php?action=delete_user&user_id='.$user_id.'&'.$url_params.'&sec_token='.Security::getTokenFromSession().'" title = "'.addslashes(api_htmlentities(get_lang('Please confirm your choice'))).'" class = "delete-swal" > '.
Display::return_icon(
'delete.png',
get_lang('Delete'),
[],
ICON_SIZE_SMALL
).
'< / a > ';
}
}
if (api_is_platform_admin()) {
$result .= ' < a data-title = "'.get_lang('Free/Busy calendar').'" href = "'.api_get_path(WEB_AJAX_PATH).'agenda.ajax.php?a=get_user_agenda&user_id='.$user_id.'&modal_size=lg" class = "agenda_opener ajax" > '.
Display::return_icon(
'calendar.png',
get_lang('Free/Busy calendar'),
[],
ICON_SIZE_SMALL
).
'< / a > ';
if ($user_id != $currentUserId & &
!$user_is_anonymous & &
api_global_admin_can_edit_admin($user_id)
) {
$result .= ' < a href = "user_list.php?action=anonymize&user_id='.$user_id.'&'.$url_params.'&sec_token='.Security::getTokenFromSession().'" class = "delete-swal" title = "'.addslashes(api_htmlentities(get_lang(" Please confirm your choice " ) ) ) . ' " > '.
Display::return_icon(
'anonymous.png',
get_lang('Anonymize'),
[],
ICON_SIZE_SMALL
).
'< / a > ';
}
$deleteAllowed = !api_get_configuration_value('deny_delete_users');
if ($deleteAllowed) {
if ($user_id != $currentUserId & &
!$user_is_anonymous & &
api_global_admin_can_edit_admin($user_id)
) {
// you cannot lock yourself out otherwise you could disable all the accounts
// including your own => everybody is locked out and nobody can change it anymore.
$result .= ' < a href = "user_list.php?action=delete_user&user_id='.$user_id.'&'.$url_params.'&sec_token='.Security::getTokenFromSession().'" title = "'.addslashes(api_htmlentities(get_lang(" Please confirm your choice " ) ) ) . ' " class = "delete-swal" > '.
Display::return_icon(
'delete.png',
get_lang('Delete'),
[],
ICON_SIZE_SMALL
).
'< / a > ';
} else {
$result .= Display::return_icon(
'delete_na.png',
get_lang('Delete'),
[],
ICON_SIZE_SMALL
);
}
}
}
return $result;
}
@ -959,7 +994,7 @@ $actionsCenter = '';
$actionsRight = '';
if (api_is_platform_admin()) {
$actionsLeft .= '< a href = "'.api_get_path(WEB_CODE_PATH).'admin/user_add.php" > '.
Display::return_icon('new_user.png', get_lang('Add a user'), '', ICON_SIZE_MEDIUM ).'< / a > ';
Display::getMdiIcon('account-plus', 'ch-tool-icon-gradient', null, 32, get_lang('Add a user') ).'< / a > ';
}
$actionsRight .= $form->returnForm();