Code Duplication    Length = 8-11 lines in 2 locations

main/inc/lib/online.inc.php 2 locations

@@ 257-264 (lines=8) @@
254
                    user_id = '".api_get_user_id()."'
255
                  ORDER BY $column $direction
256
                  LIMIT $from, $number_of_items";
257
	} else {
258
		$query = "SELECT DISTINCT login_user_id, login_date
259
                    FROM ".$track_online_table ." e
260
		            INNER JOIN ".$table_user ." u ON (u.id = e.login_user_id)
261
                  WHERE u.status != ".ANONYMOUS." AND login_date >= '".$current_date."'
262
                  ORDER BY $column $direction
263
                  LIMIT $from, $number_of_items";
264
	}
265
266
	if (api_get_multiple_access_url()) {
267
		$access_url_id = api_get_current_access_url_id();
@@ 280-290 (lines=11) @@
277
                                    relation_type='".USER_RELATION_TYPE_FRIEND."'
278
                            ORDER BY $column $direction
279
                            LIMIT $from, $number_of_items";
280
			} else {
281
				// all users online
282
				$query = "SELECT login_user_id, login_date
283
						  FROM ".$track_online_table ." track
284
                          INNER JOIN ".$table_user ." u
285
                          ON (u.id=track.login_user_id)
286
						  WHERE u.status != ".ANONYMOUS." AND track.access_url_id =  $access_url_id AND
287
                                login_date >= '".$current_date."'
288
                          ORDER BY $column $direction
289
                          LIMIT $from, $number_of_items";
290
			}
291
		}
292
	}
293