try to clean up user-without-profile errors
darcs-hash:20080926145008-5ed1f-8a60ed3c5adbfe75aa044732e8d10dbdb9b93089.gz
This commit is contained in:
parent
cb265a2d8d
commit
7ff02bb7d4
|
@ -68,6 +68,9 @@ class AllrssAction extends Rss10Action {
|
|||
function get_image() {
|
||||
$user = $this->user;
|
||||
$profile = $user->getProfile();
|
||||
if (!$profile) {
|
||||
return NULL;
|
||||
}
|
||||
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
|
||||
return ($avatar) ? $avatar->url : NULL;
|
||||
}
|
||||
|
|
|
@ -92,6 +92,7 @@ class NoticesearchAction extends SearchAction {
|
|||
$profile = $notice->getProfile();
|
||||
if (!$profile) {
|
||||
common_log_db_error($notice, 'SELECT', __FILE__);
|
||||
$this->server_error(_('Notice without matching profile'));
|
||||
return;
|
||||
}
|
||||
# XXX: RDFa
|
||||
|
|
|
@ -110,6 +110,12 @@ class ProfilesettingsAction extends SettingsAction {
|
|||
$user = common_current_user();
|
||||
$profile = $user->getProfile();
|
||||
|
||||
if (!$profile) {
|
||||
common_log_db_error($user, 'SELECT', __FILE__);
|
||||
$this->server_error(_('User without matching profile'));
|
||||
return;
|
||||
}
|
||||
|
||||
$original = $profile->getOriginalAvatar();
|
||||
|
||||
|
||||
|
|
|
@ -313,7 +313,14 @@ class RemotesubscribeAction extends Action {
|
|||
$req->set_parameter('omb_listenee_profile', common_profile_url($user->nickname));
|
||||
$req->set_parameter('omb_listenee_nickname', $user->nickname);
|
||||
$req->set_parameter('omb_listenee_license', $config['license']['url']);
|
||||
|
||||
$profile = $user->getProfile();
|
||||
if (!$profile) {
|
||||
common_log_db_error($user, 'SELECT', __FILE__);
|
||||
$this->server_error(_('User without matching profile'));
|
||||
return;
|
||||
}
|
||||
|
||||
if ($profile->fullname) {
|
||||
$req->set_parameter('omb_listenee_fullname', $profile->fullname);
|
||||
}
|
||||
|
|
|
@ -84,6 +84,9 @@ class RepliesrssAction extends Rss10Action {
|
|||
function get_image() {
|
||||
$user = $this->user;
|
||||
$profile = $user->getProfile();
|
||||
if (!$profile) {
|
||||
return NULL;
|
||||
}
|
||||
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
|
||||
return ($avatar) ? $avatar->url : NULL;
|
||||
}
|
||||
|
|
|
@ -252,6 +252,11 @@ class ShowstreamAction extends StreamAction {
|
|||
|
||||
$other = Profile::staticGet($subs->subscribed);
|
||||
|
||||
if (!$other) {
|
||||
common_log_db_error($subs, 'SELECT', __FILE__);
|
||||
continue;
|
||||
}
|
||||
|
||||
common_element_start('li');
|
||||
common_element_start('a', array('title' => ($other->fullname) ?
|
||||
$other->fullname :
|
||||
|
|
|
@ -154,6 +154,11 @@ class UserauthorizationAction extends Action {
|
|||
$params['omb_version'] = OMB_VERSION_01;
|
||||
$user = User::staticGet('uri', $req->get_parameter('omb_listener'));
|
||||
$profile = $user->getProfile();
|
||||
if (!$profile) {
|
||||
common_log_db_error($user, 'SELECT', __FILE__);
|
||||
$this->server_error(_('User without matching profile'));
|
||||
return;
|
||||
}
|
||||
$params['omb_listener_nickname'] = $user->nickname;
|
||||
$params['omb_listener_profile'] = common_local_url('showstream',
|
||||
array('nickname' => $user->nickname));
|
||||
|
|
|
@ -74,6 +74,11 @@ class UserrssAction extends Rss10Action {
|
|||
function get_image() {
|
||||
$user = $this->user;
|
||||
$profile = $user->getProfile();
|
||||
if (!$profile) {
|
||||
common_log_db_error($user, 'SELECT', __FILE__);
|
||||
$this->server_error(_('User without matching profile'));
|
||||
return NULL;
|
||||
}
|
||||
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
|
||||
return ($avatar) ? $avatar->url : NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user