Warning: Cannot modify header information - headers already sent by (output started at /var/www/bluehorn/wordpress/wp-content/themes/lightword/functions.php:858) in /var/www/bluehorn/wordpress/wp-includes/feed-rss2.php on line 8
Blue Horn http://bluehorn.co.nz New Zealand Web Design & Development (PHP 5, MySQL, Symfony Framework, Apache, Linux) Tue, 29 Nov 2011 22:23:14 +0000 en hourly 1 http://wordpress.org/?v=3.2.1 Symfony 2 is released http://bluehorn.co.nz/2011/07/29/symfony-2-is-released/ http://bluehorn.co.nz/2011/07/29/symfony-2-is-released/#comments Fri, 29 Jul 2011 00:47:21 +0000 Sid http://bluehorn.co.nz/?p=604 Yet Another Related Posts Plugin.]]> The wait is over, Symfony 2 is released.

Symfony2 is currently the most popular PHP project on Github (most forked and most watched overall) and the 12th most forked project for the whole Github platform. That's just astonishing!

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://bluehorn.co.nz/2011/07/29/symfony-2-is-released/feed/ 0
Trying out Weebly http://bluehorn.co.nz/2011/02/22/trying-out-weebly/ http://bluehorn.co.nz/2011/02/22/trying-out-weebly/#comments Mon, 21 Feb 2011 12:48:28 +0000 Sid http://bluehorn.co.nz/?p=601 Yet Another Related Posts Plugin.]]> Weebly is an online website builder. Out of curiosity I tried it out. Check out my weebly: Christchurch Food - Online Takeaway Delivery in Christchurch New Zealand.

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://bluehorn.co.nz/2011/02/22/trying-out-weebly/feed/ 0
Dine In – Food at your fingertips http://bluehorn.co.nz/2011/01/25/dine-in-food-at-your-fingertips/ http://bluehorn.co.nz/2011/01/25/dine-in-food-at-your-fingertips/#comments Tue, 25 Jan 2011 03:45:10 +0000 Sid http://bluehorn.co.nz/?p=583 Yet Another Related Posts Plugin.]]> Dine In is a website for the food and drink industry in New Zealand. Dine In website features: online ordering, online payment (credit card processing), user review/rating, online menus, and much more. Dine In website enables people to order their lunch/dinner online via the Internet.

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://bluehorn.co.nz/2011/01/25/dine-in-food-at-your-fingertips/feed/ 0
Whale Like Me – a website for whales http://bluehorn.co.nz/2011/01/25/whale-like-me-a-website-for-whales/ http://bluehorn.co.nz/2011/01/25/whale-like-me-a-website-for-whales/#comments Tue, 25 Jan 2011 03:39:59 +0000 Sid http://bluehorn.co.nz/?p=579 Yet Another Related Posts Plugin.]]> Whale Like Me is a website about whaling. The website is packed with features: documentary movie preview, donation (Paypal), mail subscription, competition, CMS, Facebook integration, invite friends, MailChimp integration, and more.

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://bluehorn.co.nz/2011/01/25/whale-like-me-a-website-for-whales/feed/ 0
Rempah – Authentic Malaysian Cuisine in Miramar, Wellington http://bluehorn.co.nz/2010/10/25/rempah-authentic-malaysian-cuisine-in-miramar-wellington/ http://bluehorn.co.nz/2010/10/25/rempah-authentic-malaysian-cuisine-in-miramar-wellington/#comments Mon, 25 Oct 2010 04:09:07 +0000 Sid http://bluehorn.co.nz/?p=595 Yet Another Related Posts Plugin.]]> Rempah is a website for authentic Malaysian cuisine takeaway in Miramar, Wellington. Rempah website features slide show, online menus, inquiry form, online ordering and more. Rempah is powered by Dine In.

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://bluehorn.co.nz/2010/10/25/rempah-authentic-malaysian-cuisine-in-miramar-wellington/feed/ 0
Tulsi – Contemporary Indian Cuisine http://bluehorn.co.nz/2010/09/25/tulsi-contemporary-indian-cuisine/ http://bluehorn.co.nz/2010/09/25/tulsi-contemporary-indian-cuisine/#comments Sat, 25 Sep 2010 04:08:04 +0000 Sid http://bluehorn.co.nz/?p=591 Yet Another Related Posts Plugin.]]> Tulsi is an iconic award winning Indian restaurant (takeaway and bar) in Wellington with branches in Christchurch, Petone, Johnsonville and Miramar. Tulsi website features inquiry, booking, online ordering, online menus (as well as PDF downloads), CMS, and more. Tulsi website is powered by Dine In.

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://bluehorn.co.nz/2010/09/25/tulsi-contemporary-indian-cuisine/feed/ 0
Bubadub – The Original Baby Shower Guessing Game http://bluehorn.co.nz/2010/08/25/bubadub-the-original-baby-shower-guessing-game/ http://bluehorn.co.nz/2010/08/25/bubadub-the-original-baby-shower-guessing-game/#comments Wed, 25 Aug 2010 03:58:36 +0000 Sid http://bluehorn.co.nz/?p=586 Yet Another Related Posts Plugin.]]> Bubadub is the original online baby shower guessing game. Bubadub features: Paypal integration, multi currency conversion, interactive game, social network elements, and much more.

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://bluehorn.co.nz/2010/08/25/bubadub-the-original-baby-shower-guessing-game/feed/ 0
How to change CSRF attack message in Symfony 1.2 http://bluehorn.co.nz/2010/07/15/how-to-change-csrf-attack-message-in-symfony-1-2/ http://bluehorn.co.nz/2010/07/15/how-to-change-csrf-attack-message-in-symfony-1-2/#comments Wed, 14 Jul 2010 23:48:05 +0000 Sid http://bluehorn.co.nz/?p=398 Yet Another Related Posts Plugin.]]> I wanted to change the symfony 1.2 CSRF attack message from "CSRF attack detected." to "This session has expired. Please return to the home page and try again.".

The default scary error message is hard coded in sfValidatorCSRFToken.class.php like this:

$this->addMessage('csrf_attack', 'CSRF attack detected.');

There aren't that many clues out there about how to change it without modifying the core class either. Kris Wallsmith (Symfony Release Manager) suggested I look at using event dispatcher. Then I found his article on the net which gave me more clues.

So here's the solution that I ended up with. First let's create a listener class and save it in the project lib folder as myTemplateFilterParametersListener.php

class myTemplateFilterParametersListener
{
  public function connect(sfEventDispatcher $dispatcher)
  {
    $dispatcher->connect('template.filter_parameters',
      array($this, 'filterParameters'));
  }
 
  public function filterParameters(sfEvent $event, $parameters)
  {
    foreach ($parameters as $name => $param)
    {
      if ($param instanceof sfForm)
      {
        $form = $param; /* @var $form sfForm */
 
        self::changeCSRFErrorMessage($form);
      }
    }
 
    return $parameters;
  }
 
  public static function changeCSRFErrorMessage(sfForm $form)
  {
    $errors = $form->getErrorSchema()->getNamedErrors();
    if ($errors)
    {
      foreach ($errors as $i => $error)
      { /* @var $error sfValidatorError */
 
        if ($i == '_csrf_token')
        {
          $validator = $error->getValidator();
          /* @var $validator sfValidatorCSRFToken */
          $validator->setMessage('csrf_attack', 'This session has expired. Please return to the home page and try again.');
        }
      }
    }
  }
}

Then hook it to the event dispatcher in apps/frontend/config/frontendConfiguration.class.php

 
class frontendConfiguration extends sfApplicationConfiguration
{
  public function  initialize() {
    $listener = new myTemplateFilterParametersListener($this->getConfigCache());
    $listener->connect($this->dispatcher);
  }
 
  public function configure()
  {
  }
}

./symfony cc

That's it :)

Use Firebug to test it. Open your webpage containing the form, use Firebug to change the _csrf_token value to trigger CSRF attack error, and you should see "This session has expired. Please return to the home page and try again." error message.

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://bluehorn.co.nz/2010/07/15/how-to-change-csrf-attack-message-in-symfony-1-2/feed/ 4
Can Symfony programmer flip like a ninja? http://bluehorn.co.nz/2010/07/05/can-symfony-programmer-flip-like-a-ninja/ http://bluehorn.co.nz/2010/07/05/can-symfony-programmer-flip-like-a-ninja/#comments Mon, 05 Jul 2010 04:54:34 +0000 Sid http://bluehorn.co.nz/?p=396 Yet Another Related Posts Plugin.]]> Yes...

A Symfony programmer, rekarnar, was doing a butterfly twist move

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://bluehorn.co.nz/2010/07/05/can-symfony-programmer-flip-like-a-ninja/feed/ 0
sfSimpleGoogleSitemapPlugin http://bluehorn.co.nz/2010/06/07/sfsimplegooglesitemapplugin/ http://bluehorn.co.nz/2010/06/07/sfsimplegooglesitemapplugin/#comments Sun, 06 Jun 2010 16:18:55 +0000 Sid http://bluehorn.co.nz/?p=394 Yet Another Related Posts Plugin.]]> Just a thread where people can leave comments/discuss about sfSimpleGoogleSitemapPlugin, a Symfony plugin that I originally wrote more than a year ago.

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://bluehorn.co.nz/2010/06/07/sfsimplegooglesitemapplugin/feed/ 17