Utility Profile::current() to get current user's profile
This commit is contained in:
		@@ -1304,4 +1304,15 @@ class Profile extends Memcached_DataObject
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        return true;
 | 
					        return true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    static function current()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $user = common_current_user();
 | 
				
			||||||
 | 
					        if (empty($user)) {
 | 
				
			||||||
 | 
					            $profile = null;
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            $profile = $user->getProfile();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        return $profile;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user