Monthly Archives: February 2011

Forcing SSL in Kohana

If you ever need to force certain controllers to use SSL in Kohana, it’s actually quite easy:

In Kohana’s controller class (/system/classes/controller.php) add a variable and before function like this:

public $require_ssl = FALSE;

	public function before()
	{
		parent::before();

		if ($this->force_ssl && Request::$protocol == 'http')
		{
			Request::Instance()->redirect(URL::site(Request::Instance()->uri, 'https'));
		}
	}

And then set “force_ssl” to be true at the top of each controller that you want SSL to be required for:

Class Controller_mycontrollername extends Controller_Template
{
     public $force_ssl = TRUE;

My take on Usage-Based Billing

It’s been quite the week in telecom news in Canada. In case you’ve been under a rock all week,  Bell and the CRTC have taken a huge pounding for the CRTC’s recent decision to allow telecoms to charge home users fees based on bandwidth usage instead of a flat rate.  The flurry of outrage worked its way up from the home users of which hundreds of thousands signed a petition,  all the way into parliment where the Industry Minister and even the Prime Minister promised to look ito (and then block) The CRTC’s decision in current form.  While I disagree with the present solution as proposed by the CRTC, I don’t necessarily disagree with some sort of billing structure based on (reasonable) usage.  Here’s why:

I’ve worked in offices where everyone was streaming local radio stations while my FTP client was struggling to upload files to a client’s FTP server.  I’ve worked from Coffee shops where everyone around me has been yakking hours on end over Skype while my emails could barely make it out of my inbox. In this day and age,  without ‘rules’ telling people exactly how to act, we sometimes forget how to act with common sense and think of others.  I do feel that there should be some sort of REASONABLE scale system in order to have a usable and fair system for everyone. It’s ridiculous that the internet resellers such as TekSavvy were forced to drop their limits to 1/10 of what they had been offering their customers previously.   I can’t imagine if Terasen Gas called me and told me to decrease my usage by 9/10s or face increase costs.

So , how do we decide what is ‘fair’?  The number Bell came up with was 25GB  which would have been huge years ago but is a pretty small number these days.  I’m not a big fan of leaving it up to the Telecoms because they’ve beeen so good at ripping us off in the past.  I think the CRTC has a role here in deciding a fair base amount, and then a fair rate on top of that.  Government utility boards have done it for years with our Water, Gas and Hydro. I can only imagine how our natural resources would skyrocket if we had to pay only a monthly flat rate for gas or power (or maybe the utilities would charge something insane like a $400/month fee). The CRTC has an opportunity here to make this right and ensure fair and reasonable access for eveeryone.  Will they step up to the plate?  We shall see.

Footnote:   While looking into usage-bases billing this week, I came across the Water Smart system in Kelowna.  It has a scaling system where the base block is a certain price and then the more water you use, the more expensive it gets per unit.  What a great idea (for water conservation, not for internet billing).  With a dwindling supply of fresh water and more and more users, its important that we understand the true cost and scarcity of this resource and manage it effectively.

 Scroll to top