]> BookStack Code Mirror - bookstack/blobdiff - app/User.php
Updated all application urls to allow path prefix.
[bookstack] / app / User.php
index 74aec7e3a734fdf56394e98cb4451039e281ae35..32449971d7847f8e4d0dc880d3868fd8eb2c528a 100644 (file)
@@ -138,8 +138,8 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
      */
     public function getAvatar($size = 50)
     {
-        if ($this->image_id === 0 || $this->image_id === '0' || $this->image_id === null) return '/user_avatar.png';
-        return $this->avatar->getThumb($size, $size, false);
+        if ($this->image_id === 0 || $this->image_id === '0' || $this->image_id === null) return baseUrl('/user_avatar.png');
+        return baseUrl($this->avatar->getThumb($size, $size, false));
     }
 
     /**
@@ -157,7 +157,16 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
      */
     public function getEditUrl()
     {
-        return '/settings/users/' . $this->id;
+        return baseUrl('/settings/users/' . $this->id);
+    }
+
+    /**
+     * Get the url that links to this user's profile.
+     * @return mixed
+     */
+    public function getProfileUrl()
+    {
+        return baseUrl('/user/' . $this->id);
     }
 
     /**