Code clean-up: remove unused code reported by #scrutinizer

ofaj
Yannick Warnier 9 years ago
parent 2ae35c92f2
commit b32f63432f
  1. 1
      main/admin/access_url_check_user_session.php
  2. 6
      main/admin/add_courses_to_usergroup.php
  3. 10
      main/admin/add_sessions_to_usergroup.php
  4. 4
      main/admin/add_users_to_usergroup.php
  5. 7
      main/admin/course_import.php
  6. 6
      main/admin/user_list.php
  7. 5
      main/auth/external_login/ldap.inc.php

@ -107,7 +107,6 @@ foreach($session_list as $session_item) {
</tr>';
}
$html .= '</table>';
} else {
}
}
echo $html;

@ -147,12 +147,10 @@ function search($needle,$type)
$xajax_response = new xajaxResponse();
$return = '';
if (!empty($needle) && !empty($type)) {
if ($type == 'single') {
} else {
if ($type != 'single') {
$list = CourseManager::get_courses_list(0, 0, 2, 'ASC', -1, $needle);
}
if ($type=='single') {
} else {
if ($type != 'single') {
$return .= '<select id="elements_not_in" name="elements_not_in_name[]" multiple="multiple" size="15" style="width:360px;">';
foreach ($list as $row) {

@ -125,13 +125,6 @@ function search_sessions($needle,$type) {
$return = '';
if (!empty($needle) && !empty($type)) {
if ($type == 'single') {
// search users where username or firstname or lastname begins likes $needle
/* $sql = 'SELECT user.user_id, username, lastname, firstname FROM '.$tbl_user.' user
WHERE (username LIKE "'.$needle.'%"
OR firstname LIKE "'.$needle.'%"
OR lastname LIKE "'.$needle.'%") AND user.user_id<>"'.$user_anonymous.'" AND user.status<>'.DRH.''.
$order_clause.
' LIMIT 11';*/
} else if ($type == 'searchbox') {
$session_list = SessionManager::get_sessions_list(
array('s.name' => array('operator' => 'LIKE', 'value' => "%$needle%"))
@ -142,8 +135,7 @@ function search_sessions($needle,$type) {
);
}
$i=0;
if ($type=='single') {
} else {
if ($type != 'single') {
$return .= '<select id="elements_not_in" name="elements_not_in_name[]" multiple="multiple" size="15" style="width:360px;">';
foreach ($session_list as $row ) {

@ -318,9 +318,7 @@ if (!empty($user_list)) {
).' ('.$item['username'].') ';
}
if (in_array($item['user_id'], $list_in)) {
//$elements_in[$item['user_id']] = $person_name;
} else {
if (!in_array($item['user_id'], $list_in)) {
$elements_not_in[$item['user_id']] = $person_name;
}
}

@ -55,16 +55,11 @@ function validate_data($courses)
if (empty($teacherInfo)) {
$course['error'] = get_lang('UnknownTeacher').' ('.$teacher.')';
$errors[] = $course;
} else {
/*if ($teacherInfo['status'] != COURSEMANAGER) {
$course['error'] = get_lang('UserIsNotATeacher').' ('.$teacher.')';
$errors[] = $course;
}*/
}
}
}
if(!empty($course['CourseCategory'])) {
if (!empty($course['CourseCategory'])) {
$categoryInfo = CourseCategory::getCategory($course['CourseCategory']);
if (empty($categoryInfo)) {
CourseCategory::addNode($course['CourseCategory'], $course['CourseCategoryName'] ? $course['CourseCategoryName'] : $course['CourseCategory'], 'TRUE', null);

@ -558,11 +558,7 @@ function modify_filter($user_id, $url_params, $row) {
}
// actions for assigning sessions, courses or users
if (api_is_session_admin()) {
/*if ($row[0] == api_get_user_id()) {
$result .= '<a href="dashboard_add_sessions_to_user.php?user='.$user_id.'">'.Display::return_icon('view_more_stats.gif', get_lang('AssignSessions')).'</a>&nbsp;&nbsp;';
}*/
} else {
if (!api_is_session_admin()) {
if ($current_user_status_label == $statusname[SESSIONADMIN]) {
$result .= Display::url(
Display::return_icon('view_more_stats.gif', get_lang('AssignSessions')),

@ -278,11 +278,6 @@ function extldap_import_all_users()
for ($key = 0; $key < $users['count']; $key++) {
$user_id = extldap_add_user_by_array($users[$key], true);
$count++;
if ($user_id) {
// echo "User #$user_id created or updated\n";
} else {
// echo "User was not created\n";
}
}
}
}

Loading…
Cancel
Save