Availability Template Question!!!

Discuss here how to configure hoteldruid and better use its features.

Moderator: marco

Post Reply
carlos
Posts: 7
Joined: Thu Mar 09, 2006 5:27 am

Availability Template Question!!!

Post by carlos »

Hello again Marco!
I've created an availability template and I would like to open it to add a few HTML codes.

I've tryed many different ways to open it, even tryed to chmod it with different codes but, it always comes back saying... can't read, Permission denied and my permissions do not change. How can I change this???

Thank you!!!
marco
Posts: 1332
Joined: Tue Jul 05, 2005 6:00 pm
Location: Roma, Italia

Post by marco »

Hello Carlos,
this probably depends on the settings of your hosting provider, seems that the ftp user cannot read the files generated by the web server.

Php-residence chmods the file so that only the owner can read it (this is for more security on shared hostings as the file contains tha data to access the database). You can try to disable this by deleting from the file includes/templates/funzioni_mod_disp.php the lines:

if (C_CHMOD_EXEC_MODELLI == "SI") @chmod("$percorso_cartella_modello/$nome_file", 0750);
else @chmod("$percorso_cartella_modello/$nome_file", 0640);

Otherwise, if this doesn't work, install php-residence on your computer, restore a backup created from your hosting, create the template locally (with the database data of your hosting) and upload it.

Marco
carlos
Posts: 7
Joined: Thu Mar 09, 2006 5:27 am

Post by carlos »

Hi Marco!

It works!!!

First, I deleted my availability_template.php (that I had previously created).

Second, I whent to includes/templates/funzioni_mod_disp.php and changed the line...
if (C_CHMOD_EXEC_MODELLI == "SI") @chmod("$percorso_cartella_modello/$nome_file", 0750);
else @chmod("$percorso_cartella_modello/$nome_file", 0640);


to...

if (C_CHMOD_EXEC_MODELLI == "SI") @chmod("$percorso_cartella_modello/$nome_file", 0750);
else @chmod("$percorso_cartella_modello/$nome_file", 0644);

and saved it.

Third, I created a new availability_template.php

... and it works!!!
I can now read the contents of the file.

Thank you!
BandBinChina
Posts: 7
Joined: Tue May 23, 2006 10:54 pm
Location: UK

Post by BandBinChina »

I have the identical issue so this thread is very helpful.

But my question now is: What permissions should this template file have on it's directory & itself, to protect the password info contained within it (both before & after copying it) ?
marco
Posts: 1332
Joined: Tue Jul 05, 2005 6:00 pm
Location: Roma, Italia

Post by marco »

Hello,
it depends on how your shared hosting is cofigured, the php-residence default chmod should be the most secure.
Notice that you can change almost anything in the template when you create it (html before and after the form, form phrases, the directory where it's created, etc.). If you still need to modify the template php code you can change it in the file includes/templates/modello_disponibilita.php before creating it and your changes will be automatically reflected in the template, so you shouldn't need to chmod it.
The dati directory should be left with the write permissions enabled (if php-residence works ok don't change them). Anyway my advice is to make frequent backups, especially if you're on a shared hosting.

Marco
Post Reply