private function getCaptcha($sessID, $type, $retry = true)
	{
		try
		{
			if ($type == 'image')
			{
				$info = Mollom::getImageCaptcha($sessID);
			}
			else
			{
				$info = Mollom::getAudioCaptcha($sessID);
			}
			return $info;
		}
		catch (KeyNotSetException $e)
		{
			return null;
		}
		catch (InternalException $e)
		{
			return null;
		}
		catch (OutdatedServerListException $e)
		{
			CoOrg::config()->set('mollom/serverlist', Mollom::getServerList());
			CoOrg::config()->save();
			return $retry ? self::getCaptcha($sessID, $type, false) : null;
		}
		catch (NoServerListException $e)
		{
			CoOrg::config()->set('mollom/serverlist', Mollom::getServerList());
			CoOrg::config()->save();
			return $retry ? self::getCaptcha($sessID, $type, false) : null;
		}
	}
Beispiel #2
0
 /**
  * @todo use formui
  */
 private function send_captcha($comment = null)
 {
     Session::add_to_set('mollom', $comment, 'comment');
     $theme = Themes::create();
     $theme->comment = $comment;
     try {
         $theme->captcha = Mollom::getImageCaptcha($comment->info->mollom_session_id);
         $theme->audio_captcha = Mollom::getAudioCaptcha($comment->info->mollom_session_id);
     } catch (Exception $e) {
     }
     $theme->display('mollom_fallback_captcha');
 }