/** * getUsers * Get details about a given user. * Takes no parameter. * Not supported. */ public static function getusers($input) { self::check_version($input, "1.7.0"); if ($GLOBALS['user']->access >= 100) { $r = Subsonic_XML_Data::createSuccessResponse(); $users = User::get_valid_users(); Subsonic_XML_Data::addUsers($r, $users); } else { $r = Subsonic_XML_Data::createError(Subsonic_XML_Data::SSERROR_UNAUTHORIZED, $GLOBALS['user']->username . ' is not authorized to get details for other users.'); } self::apiOutput($input, $r); }
protected function get_user_all_pts($fct, pData $MyData, $user = 0, $object_type = null, $object_id = 0, $start_date = null, $end_date = null, $zoom = 'day') { $values = $this->get_all_pts($fct, $MyData, $user, $object_type, $object_id, $start_date, $end_date, $zoom); $ustats = User::count(); // Only display other users if the graph is not for a specific user and user count is small if (!$user && $ustats['users'] < 10) { $user_ids = User::get_valid_users(); foreach ($user_ids as $user_id) { $u = new User($user_id); $user_values = $this->get_all_type_pts($fct, $user_id, $object_type, $object_id, $start_date, $end_date, $zoom); foreach ($values as $date => $value) { if (array_key_exists($date, $user_values)) { $value = $user_values[$date]; } else { $value = 0; } $MyData->addPoints($value, $u->username); } } } }