diff --git a/main/admin/user_information.php b/main/admin/user_information.php index 946e51bcc8..6295734d4d 100644 --- a/main/admin/user_information.php +++ b/main/admin/user_information.php @@ -25,9 +25,9 @@ Display::display_header($tool_name); $table_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER); $table_course = Database :: get_main_table(TABLE_MAIN_COURSE); if ( isset($_GET['action']) ) { - switch($_GET['action']) { + switch ($_GET['action']) { case 'unsubscribe': - if ( CourseManager::get_user_in_course_status($_GET['user_id'],$_GET['course_code']) == STUDENT) { + if (CourseManager::get_user_in_course_status($_GET['user_id'],$_GET['course_code']) == STUDENT) { CourseManager::unsubscribe_user($_GET['user_id'],$_GET['course_code']); Display::display_normal_message(get_lang('UserUnsubscribed')); } else { @@ -36,22 +36,29 @@ if ( isset($_GET['action']) ) { break; } } -//only allow platform admins to login_as, or session admins only for students (not teachers nor other admins) +// only allow platform admins to login_as, or session admins only for students (not teachers nor other admins) $statusname = api_get_status_langvars(); -$login_as_icon = ''; +$login_as_icon = null; +$editUser = null; if (api_is_platform_admin() || (api_is_session_admin() && $row['6'] == $statusname[STUDENT])) { - $login_as_icon = ''.Display::return_icon('login_as.gif', get_lang('LoginAs')).''; + $login_as_icon = ''.Display::return_icon('login_as.gif', get_lang('LoginAs')).''; + $editUser = Display::url(Display::return_icon('edit.png', get_lang('Edit'), array()), api_get_path(WEB_CODE_PATH).'admin/user_edit.php?user_id='.$user['user_id']); } -echo '
'. ($user['status'] == 1 ? get_lang('Teacher') : get_lang('Student')).' echo '
'.Display :: encrypted_mailto_link($user['mail'], $user['mail']).'
'; /** - * Show the sessions and the courses in wich this user is subscribed + * Show the sessions and the courses in which this user is subscribed */ echo Display::page_subheader(get_lang('SessionList')); @@ -152,35 +159,6 @@ if (Database::num_rows($res) > 0) { } else { echo ''.get_lang('NoCoursesForThisUser').'
'; } - -/** - * Show the classes in which this user is subscribed - */ -/* -$table_class_user = Database :: get_main_table(TABLE_MAIN_CLASS_USER); -$table_class = Database :: get_main_table(TABLE_MAIN_CLASS); -$sql = 'SELECT * FROM '.$table_class_user.' cu, '.$table_class.' c '. - ' WHERE cu.user_id = '.$user['user_id'].' AND cu.class_id = c.id'; -$res = Database::query($sql); -if (Database::num_rows($res) > 0) { - $header = array(); - $header[] = array (get_lang('ClassName'), true); - $header[] = array ('', false); - $data = array (); - while ($class = Database::fetch_object($res)) { - $row = array(); - $row[] = $class->name; - $row[] = ''.Display::return_icon('synthese_view.gif', get_lang('Overview')).''; - $data[] = $row; - } - echo ''.get_lang('Classes').'
'; - echo ''; - Display :: display_sortable_table($header, $data, array (), array (), array ('user_id' => intval($_GET['user_id']))); - echo ''; -} else { - echo '
'.get_lang('NoClassesForThisUser').'
'; -}*/ - /** * Show the URL in which this user is subscribed */ @@ -203,5 +181,4 @@ if ($_configuration['multiple_access_urls']) { } } -/* FOOTER */ Display::display_footer();