applications/dashboard/controllers/class.profilecontroller.php
public function Get($UserID = FALSE) {
      if (!$UserID)
         $UserID = Gdn::Session()->UserID;

      if (($UserID != Gdn::Session()->UserID || !Gdn::Session()->UserID) && !Gdn::Session()->CheckPermission('Garden.Users.Edit')) {
         throw new Exception(T('You do not have permission to view other profiles.'), 401);
      }

      $UserModel = new UserModel();

      // Get the user.
      $User = $UserModel->GetID($UserID, DATASET_TYPE_ARRAY);
      if (!$User) {
         throw new Exception(T('User not found.'), 404);
      }

      $PhotoUrl = $User['Photo'];
      if ($PhotoUrl && strpos($PhotoUrl, '//') == FALSE) {
         $PhotoUrl = Url('/uploads/'.ChangeBasename($PhotoUrl, 'n%s'), TRUE);
      }
      $User['Photo'] = $PhotoUrl;

      // Remove unwanted fields.
      $this->Data = ArrayTranslate($User, array('UserID', 'Name', 'Email', 'Photo'));

      $this->Render();
   }
public function Get($UserID = FALSE) {
      if (!$UserID)
         $UserID = Gdn::Session()->UserID;

      if (($UserID != Gdn::Session()->UserID || !Gdn::Session()->UserID) && !Gdn::Session()->CheckPermission('Garden.Users.Edit')) {
         throw new Exception(T('You do not have permission to view other profiles.'), 401);
      }

      $UserModel = new UserModel();

      // Get the user.
      $User = $UserModel->GetID($UserID, DATASET_TYPE_ARRAY);
      if (!$User) {
         throw new Exception(T('User not found.'), 404);
      }

      $PhotoUrl = $User['Photo'];
      if ($PhotoUrl && strpos($PhotoUrl, '//') == FALSE) {
         $PhotoUrl = Url('/uploads/'.ChangeBasename($PhotoUrl, 'n%s'), TRUE);
      }
      $User['Photo'] = $PhotoUrl;

      // Remove unwanted fields.
      $this->Data = ArrayTranslate($User, array('UserID', 'Name', 'Email', 'Photo'));

      $this->Render();
   }
public function Get ( $ UserID = FALSE ) { if ( ! $ UserID ) $ UserID = Gdn :: Session ( ) -> UserID ; if ( ( $ UserID != Gdn :: Session ( ) -> UserID || ! Gdn :: Session ( ) -> UserID ) && ! Gdn :: Session ( ) -> CheckPermission ( 'Garden.Users.Edit' ) ) { throw new Exception ( T ( 'You do not have permission to view other profiles.' ) , 401 ) ; } $ UserModel = new UserModel ( ) ; // Get the user. $ User = $ UserModel -> GetID ( $ UserID , DATASET_TYPE_ARRAY ) ; if ( ! $ User ) { throw new Exception ( T ( 'User not found.' ) , 404 ) ; } $ PhotoUrl = $ User [ 'Photo' ] ; if ( $ PhotoUrl && strpos ( $ PhotoUrl , '//' ) == FALSE ) { $ PhotoUrl = Url ( '/uploads/' . ChangeBasename ( $ PhotoUrl , 'n%s' ) , TRUE ) ; } $ User [ 'Photo' ] = $ PhotoUrl ; // Remove unwanted fields. $ this -> Data = ArrayTranslate ( $ User , array ( 'UserID' , 'Name' , 'Email' , 'Photo' ) ) ; $ this -> Render ( ) ; }
Render basic data about user.

@since 2.0.?
@access public
@param int $UserID Unique ID.
Render basic data about user .