$profile = AnonymousFavePlugin::getAnonProfile();
if (empty($profile) || $_SERVER['REQUEST_METHOD'] != 'POST') {
$profile = AnonymousFavePlugin::getAnonProfile();
if (empty($profile) || $_SERVER['REQUEST_METHOD'] != 'POST') {
$token = $this->trimmed('token-' . $notice->id);
if (empty($token) || $token != common_session_token()) {
$token = $this->trimmed('token-' . $notice->id);
if (empty($token) || $token != common_session_token()) {
$this->clientError(_m('There was a problem with your session token. Try again, please.'));
return;
}
if ($profile->hasFave($notice)) {
$this->clientError(_m('There was a problem with your session token. Try again, please.'));
return;
}
if ($profile->hasFave($notice)) {
$this->clientError(_m('This notice is already a favorite!'));
return;
}
$fave = Fave::addNew($profile, $notice);
if (!$fave) {
$this->clientError(_m('This notice is already a favorite!'));
return;
}
$fave = Fave::addNew($profile, $notice);
if (!$fave) {
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
$this->element('title', null, _m('Disfavor favorite'));
$this->elementEnd('head');
$this->elementStart('body');
$this->element('title', null, _m('Disfavor favorite'));
$this->elementEnd('head');
$this->elementStart('body');