CSRF protection revisited

Tags:

Yesterday, I was talking on IRC with Tom Graham. He was looking for a way to protect GET requests against CSRF. I showed him my CSRF protection plugin, as it would be suitable for protecting GETs too with minor modifications.

This got me thinking what would be the best way to allow you to easily protect certain URLs with it, and here’s the solution…

Read More

How to get your saved passwords from almost any browser

Tags:

Someone on ##opera in freenode was asking how to recover their saved password from Wand, Opera’s password manager.

While there is apparently no “official” way of getting to them, I thought that maybe you could simply hook into the form, and read the password when it’s being submitted by Wand!

Easy enough, add an event handler to onsubmit, collect passwords and display them. And here’s the result:

Click here for the script, as it wouldn’t show up nicely in the post.

Just copypaste it into the urlbar on any page you want to run it on. I think it might also be possible to store it as a bookmarklet, by making a new bookmark with that as the URL.

I did some quick checking and turns out I’m not the first guy to think of this, but the scripts I found none worked universally in more than just FF or IE. I tested my script in IE7, Opera 9 and Firefox 3, and it appears to work in all of them, and quite likely works in every other browser that can run it.

I’m now on Twitter

Tags:

After pimping from various sources, I have decided to try Twitter. You can find me here. Not sure if I’m going to keep updating it, but I am for now =)

Creating a Dojo dijit.Tree with checkboxes

Tags:

Dojo provides a useful component called dijit.Tree, which is basically a quite typical tree component. However, it doesn’t do much out of the box, and I needed it to make some tree nodes selectable with checkboxes for my Zend Framework based packageizer script. While Zend Framework has a Zend_Dojo component, it doesn’t quite do trees the way I want yet.

Let’s see how I made the tree play nice with checkboxes and some ajax tricks.

Read More

Base classes in OOP programming languages

Tags:

David Otton posted a short but thought-provoking post about stdClass, which many think is the “base class” all PHP classes automatically inherit from. I have to admit that I had this misconception as well.

On the other hand, “true” OOP languages such as C# and Java both have a base class which all other classes inherit, even if you don’t explicitly define it. They also tend to have somewhat deeper inheritance chains, as James Titcumb points out, in reply to David’s post.

This presents some room for analysis in how things are handled in dynamic and static languages, and how those differences affect things…

Read More

Developing for smaller screens

Tags:

As of late, I’ve been working on developing a widget that runs on both PCs and mobile phones, for Opera’s X-Widgets Challenge.

The widgets for the challenge must work on a QVGA (320×240) screen, and that presents certain challenges. For example, as the size of the widget is so constrained, you need to think what is absolutely necessary – does the user have to see this piece of information on this screen, could it be shown elsewhere, or is it actually relevant at all?

Yesterday I finished the development of my widget. Let’s look at some things I had to consider to make it work on a small screen, and what could’ve been done even better.

Read More

Improved Zend Framework package maker

Tags:

Last month, I introduced the packageizer, which allowed you to choose a class from the Zend Framework and get it as a zip with its dependencies.

Now, based on some feedback from users, I’ve improved the user interface of the tool: You can now select multiple items for inclusion in the package, and I’ve made it possible to get the packages in .phar format. It also has initial support for different libraries, ie. Zend Framework 1.6 and Zend Framework SVN trunk, but currently only 1.6 stable is available.

Check out the improved packageizer! Let me know what you think.

I also used this chance to familiarize myself with Dojo. The improved packageizer uses Dojo’s Dijit widgets to provide a better way to choose classes and display their dependencies. Despite the fancy new dijit.Tree and all, it also works without JavaScript, in case someone needs that.

Dojo Toolkit – difficult to learn, is it worth it?

Tags:

I’ve usually dismissed the Dojo Toolkit as a difficult, poorly documented JavaScript library.

However, Zend Framework recently decided to choose it as the default JS library to bundle with the framework. It can’t be all bad if that happens, right?

This sparked my curiosity towards Dojo again – Maybe it was time to actually try it for real, armed with patience…

Read More

Favorite blogs

Tags:

I often have problems finding blogs that post content that interests me. It could be that I’m really picky, or it’s just really difficult to find quality programming blogs.

So, today I’ll introduce you to some of the blogs I read. Perhaps you’ll find a new blog to read as well?

Read More