One Event would never be called, and other stuff were redundant clauses.
if (!$this->user) {
// TRANS: Client error displayed when user not found for an action.
$this->clientError(_('No such user.'));
- return false;
+ }
+
+ if (!empty($this->tag)) {
+ $this->notices = $this->getTaggedNotices();
} else {
- if (!empty($this->tag)) {
- $this->notices = $this->getTaggedNotices();
- } else {
- $this->notices = $this->getNotices();
- }
- return true;
+ $this->notices = $this->getNotices();
}
+
+ return true;
}
function getTaggedNotices()
}
if (Event::handle('StartRegisterSuccess', array($this))) {
- common_redirect(common_local_url('doc', array('title' => 'welcome')),
- 303);
Event::handle('EndRegisterSuccess', array($this));
+ common_redirect(common_local_url('doc', array('title' => 'welcome')), 303);
+ // common_redirect exits, so we can't run the event _after_ it of course.
}
}
$graphUrl = 'https://graph.facebook.com/me?access_token=' . urlencode($this->accessToken);
$this->fbuser = json_decode(file_get_contents($graphUrl));
- if (!empty($this->fbuser)) {
- $this->fbuid = $this->fbuser->id;
- // OKAY, all is well... proceed to register
- return true;
- } else {
-
+ if (empty($this->fbuser)) {
// log badness
list($proxy, $ip) = common_client_ip();
);
}
- return false;
+ $this->fbuid = $this->fbuser->id;
+ // OKAY, all is well... proceed to register
+ return true;
}
function handle($args)
return;
}
common_redirect('/photo/' . $this->photo->id, '303');
- $this->showForm(_('Success!'), true);
-
+ // common_redirect exits
}
function deletePhoto()
}
$this->showForm(_('Success!'));
common_redirect('/' . $this->user->nickname . '/photos/' . $oldalbum, '303');
- return;
}
}