r2762 - getFileLinks(): switch from getUserInfo() to spotEntity()
[racktables] / inc / database.php
index 80139b00271285003366ebe3e8ed2c10d163e626..850613c01a12320d600c888a76e60521f630fa77 100644 (file)
@@ -3495,8 +3495,8 @@ function getFileLinks ($file_id = 0)
                        case 'user':
                                $page = 'user';
                                $id_name = 'user_id';
-                               $userinfo = getUserInfo ($row['entity_id']);
-                               $name = $userinfo['user_name'];
+                               $parent = spotEntity ($row['entity_type'], $row['entity_id']);
+                               $name = $parent['user_name'];
                                break;
                }
 
@@ -3748,17 +3748,4 @@ function getUserIDByUsername ($username)
        return NULL;
 }
 
-function getUserInfo ($user_id)
-{
-       $query = "select 'user' as realm, user_id, user_name, user_password_hash, user_realname from UserAccount where user_id = ${user_id}";
-       if (($result = useSelectBlade ($query, __FUNCTION__)) == NULL)
-       {
-               showError ('SQL query failed', __FUNCTION__);
-               die;
-       }
-       if ($row = $result->fetch (PDO::FETCH_ASSOC))
-               return $row;
-       return NULL;
-}
-
 ?>