Jorge Albaladejo

Hard & Soft design…

Managing a web development project

without comments

There are many types of websites, as well as sizes and complexity. At the beginning, most of my creations were constructed ‘on the fly’, without much planning – in the end, a ‘news’ module is not scary enough to need a project.

But recently I’ve started working on more ambitious jobs (like http://climaps.com), and feeling the need of a strongly defined method to apply to web applications design. Some tools are almost mandatory, like Use Case Diagrams which become really helpful in order to translate what every user can do into ACL‘s, methods, controllers, etc; or like modeling tools to graphically represent the application’s database.

But the best way – according to my experience – to successfully manage a web project is following a detailed planning. Determining what the steps are and what order should they be executed in, is a good starting point to know were exactly we are on each development stage.

Read the rest of this entry »

Written by Jorge Albaladejo

May 7th, 2009 at 1:02 pm

Access Control List (ACL) with Code Igniter

with 5 comments

In the last project I’ve worked on, I needed to install any kind of ACL to allow certain methods to be accessed only by some user roles, like website administration, etc. I’m building this website on Code Igniter, so I missed some related features that are available in other PHP frameworks like CakePHP or Zend.

After googling a bit, I found our several methods to get an ACL. Zend framework can be integrated into Code Igniter to use its library, but doesn’t seem really natural to me. I prefer having an previously constructed list, than building it ‘on the fly’ inside my code.

Then I fell into phpGACL, a free software project which allows to solve this problem on an easy way. It uses an API to connect to a database, where tuples of ‘controller’ – ‘method’ – ‘user’ can be stored (actually, AXO – ACO – ARO, acronyms of Access eXtended Object, Access Control Object, Access Request Object). And I developed my first version over this tool, on the most transparent way I was able to find:

Read the rest of this entry »

Written by Jorge Albaladejo

April 24th, 2009 at 2:24 pm

Creating Triggers in MySQL from PHP

without comments

On my last project, I needed to create tables periodically on a database, to partition data in several identical tables, named according to the year quarter. Instead of using MySQL 5.1 automatic partition, I preferred doing it in a more manual way, to allow accessing individual partitions if suitable to speed up queries.

So I wrote a php script that would run with a cron job and every three months, create a new table, add it some triggers, and remap a MyISAM merged table on another database. Clear and easy, at the beginning. Everything went right until I went for the triggers creation…

Read the rest of this entry »

Written by Jorge Albaladejo

February 25th, 2009 at 2:01 pm

Avoid deletions with triggers and MySQL

with 2 comments

Some times, we store valuable data that we would never want to lose. This is a particular fact when working with data for scientific, statistical purposes, like environmental analysis.

In such a situation, we can rely on our software, but… what happens if any error is introduced on the application layer? Some valuable registers could be lost and hard to identify and recover later. To avoid this effect, we’d rather prefer to implement some constraints in our database. I wouldn’t think that all the applications that connect to our database are going to be free of bugs, and our data is so valuable!

Read the rest of this entry »

Written by Jorge Albaladejo

February 9th, 2009 at 1:22 pm

Posted in MySQL

Tagged with , ,

Installing Trac on a Ubuntu server

without comments

Despite I’ve worked before with Trac (a well-known bug tracking system), this is the first time I’ve been in the need for installing it. This post covers in a few steps what I’ve done. Maybe in your particular case it would be helpful, maybe not. So, these are the steps…

Read the rest of this entry »

Written by Jorge Albaladejo

January 30th, 2009 at 9:11 pm

Mis tres pequeñas

without comments


Beaucarnea

Beaucarnea

Hace ya un año, recién llegado a Friburgo, que me dio por la botánica; y no, no me refiero a esa clase de plantas de las islas que dan mucha risa, sino a otras: las que adornan la casa y además sirven de entretenimiento. Comencé con una beaucarnea o ‘pie de elefante’, de la familia de los cactus, que requiere bastante luz pero a ser posible indirecta; un clima cálido y al mismo tiempo húmedo, que recree su hábitat natural (Centro-América). Esta planta ha sido bastante sencillo mantenerla saludable, ya que dentro de la casa hay bastante iluminación, puedo controlar la exposición directa al sol, y el ambiente es cálido. Humedad no parece haber pedido mucha, un año después de comprarla ha crecido un poquito y ha echado un nuevo tallo.

 

Read the rest of this entry »

Written by Jorge Albaladejo

December 8th, 2008 at 10:38 pm

Eurocopter EC 145 REGA, Switzerland

without comments

Modelo del EC-145 REGA sin las pegatinas

Helicóptero de salvamento suizo EC-145 REGA

Cuando me regalaron esta maqueta en Navidad de 2007, no sabía si alegrarme o echarme a llorar. No es la primera obra de modelismo a la que me enfrento, pero de la última vez habían pasado casi 10 años… y el resultado fue un F-14 Tomcat bastante pobre… Así que decidí que esta vez me esmeraría mucho más.

Ha pasado ya casi un año, y después de hacer un considerable esfuerzo por juntar ratos muertos, he conseguido juntar las cerca de 150 piezas que componen este fantástico modelo del helicóptero de salvamento suizo. No sé si fue elegido a conciencia, o es simple casualidad :)

 

Read the rest of this entry »

Written by Jorge Albaladejo

November 24th, 2008 at 5:02 pm

Working with Web Robots (Crawlers)

without comments

Some useful information to start with when attempting to work with web spiders. Just to learn the basis, these links could be useful for those to begin dealing with this subject:

Written by Jorge Albaladejo

November 6th, 2007 at 12:43 pm

Protecting your application from exploits related to include()

without comments

Como hemos visto en capítulos anteriores sobre problemas de seguridad y sql injection, hay una serie de aspectos relacionados con la seguridad a tener en cuenta a la hora de diseñar una aplicación web. Uno de los más explotados es la falla abierta por un uso indebido de la función de php include().

Veamos un ejemplo:

1
2
3
4
5
6
7
8
<a href="?page=home.php">Home</a> | <a href="?page=contact.php">Contact</a>
< ?php
  $page = $_GET['page'];
  if ($page)
    include $page;
  else
    echo "404, page not found!";
?>

En el ejemplo anterior, pasamos como variable ‘$page’ el nombre del archivo (php en este caso, podrí­a ser html u otra extensión), que será cargado en la lí­nea correspondiente mediante ‘include()’. La ausencia de filtrado de esta variable puede dejar nuestra aplicación a merced de cualquier intruso poco experimentado, veamos por qué.
Read the rest of this entry »

Written by Jorge Albaladejo

June 5th, 2007 at 11:17 am

Loading data in Flash from an external XML

without comments

Notice: Article only available in Spanish!

Cuando trabajamos con aplicaciones en flash y queremos que conecten con bases de datos para mostrar catálogos de productos, noticias, etc., la mejor forma de hacerlo es mediante el paso de mensajes en formato XML. Leemos de servicios web correctamente formateados en XML, y después mostraremos los datos según nos convenga en la aplicación flash.

Partimos de un archivo XML correctamente formateado, bien estático y alojado en cualquier carpeta del servidor, bien una url a una pasarela php que previamente lea los datos de una base de datos y después los muestre en XML. Vamos a necesitar tres cosas: un objeto LoadVars, un objeto XML y conocer la estructura de los nodos XMLpara poderlos recorrer correctamente.

Read the rest of this entry »

Written by Jorge Albaladejo

May 28th, 2007 at 11:55 am

This site is protected with Urban Giraffe's plugin 'HTML Purified' and Edward Z. Yang's Powered by HTML Purifier. 7051 items have been purified.