Error when logging in as 2nd user

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

Moderator: marco

Post Reply
flysouth
Posts: 11
Joined: Wed Mar 15, 2006 3:08 pm
Location: South Africa

Error when logging in as 2nd user

Post by flysouth »

Hi - have installed php-residence, latest version, without any trouble and everything works great - this looks like a great piece of work and I am amazed at the features it has - congratulations Marco.

I have been logging in as admin to set up everything and test the system -and then I added a second user "agent".

When I login as 'agent', I get the following:

Warning: mex(./includes/lang//inizio.php): failed to open stream: No such file or directory in /home2/username/public_html/php-residence/includes/funzioni.php on line 70

Warning: mex(): Failed opening './includes/lang//inizio.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home2/username/public_html/php-residence/includes/funzioni.php on line 70

Warning: mex(./includes/lang//inizio.php): failed to open stream: No such file or directory in /home2/username/public_html/php-residence/includes/funzioni.php on line 70

Warning: mex(): Failed opening './includes/lang//inizio.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home2/username/public_html/php-residence/includes/funzioni.php on line 70

This never happens when logging in as admin - only with the new user login - anyone suggest a fix? I notice that there is a double slash in './includes/lang//inizio.php' - is this the problem?

I have tried changing permissions on folders and files with no luck.

Any suggestions would be appreciated.
marco
Posts: 1332
Joined: Tue Jul 05, 2005 6:00 pm
Location: Roma, Italia

Post by marco »

Hello,
Probably the variable for the language for the secon user was not created in the file dati/lingua.php (that's what's missing between the 2 slashes //). It seems like when the second user was created the permissions of the dati/ folder, or of the files contained in it, were different from when php-residence was installed and the files cannot be modified anymore.
When logging in as the second user, do the dates in the select menus appear?

Marco
flysouth
Posts: 11
Joined: Wed Mar 15, 2006 3:08 pm
Location: South Africa

Dati folder permissions

Post by flysouth »

Hi Marco - thanks for the quick reply.

The Dati folder has a number of files which were created by the script - but these appear to be locked. The file mentioned "lingua" as well as the others in the folder will not allow me to change permissions or even open them, or to download them via ftp to my machine.

They are all set at 640 permissions and even if I go into my Cpanel file manager I cannot change permsisions - this must why I am having the problem with second user - but how did these files get locked? I noticed that immediately after creating the availability template and BEFORE adding the second user, the availability template was locked, but did work.

All other folders and files seem to act normally.

After adding second user - ALL files in the dati folder are locked.

The error lines which appear when logging in fill the page and are repeated many times - but amongst all that some select menus are visible.
marco
Posts: 1332
Joined: Tue Jul 05, 2005 6:00 pm
Location: Roma, Italia

Post by marco »

It is possible, depending on your hosting settings, that you can't modify the files created by the script. What's strange is that the script can't modify them anymore. The dati folder has still all the write privileges enabled? About the select menus I was referring to these with the dates, the ones that normally are in "check availability from ... to ...", are they there? Do you get error messages when you create a new user?

Marco
flysouth
Posts: 11
Joined: Wed Mar 15, 2006 3:08 pm
Location: South Africa

Dati folder permissions

Post by flysouth »

The dati folder permissions can be changed - no problem - it's the files within the folder that seem to be locked.

When I create a new user I get this:

Warning: fopen(dati/lingua.php.lock): failed to open stream: Permission denied in /home2/stewart/public_html/php-residence/includes/funzioni.php on line 583

Warning: flock(): supplied argument is not a valid stream resource in /home2/stewart/public_html/php-residence/includes/funzioni.php on line 584

Warning: fopen(./dati/lingua.php.tmp): failed to open stream: Permission denied in /home2/stewart/public_html/php-residence/includes/funzioni.php on line 535
ERROR writing file ./dati/lingua.php.

Warning: flock(): supplied argument is not a valid stream resource in /home2/stewart/public_html/php-residence/includes/funzioni.php on line 594

Warning: fclose(): supplied argument is not a valid stream resource in /home2/stewart/public_html/php-residence/includes/funzioni.php on line 595

If I then go to the includes folder and set files to 777, the error messages disappears when refreshing the page - and the user is there!

If I then try to add a further user - I get the error page again! Weird - it is as if the files have defaulted to being locked again.

I can't believe that it is the server causing this - as I have a number of php scripts running on various website on this server (Redhat Linux) - maybe I should reinstall PHP-residence?
carlos
Posts: 7
Joined: Thu Mar 09, 2006 5:27 am

Post by carlos »

Hi Marco and Flysouth!

In regards to the dati folder and files, I had the same problem opening my availability_template.php files. I was unable to read them and this was due to the fact that my file was created with a CHMOD of 640. If you go to my topic on this matter, at... http://www.digitaldruid.net/php-residen ... c.php?t=72 , I explain how I was able to fix it after Marco replied to my question. Maybe this will help you solve part of your problem. It worked for me!!!
flysouth
Posts: 11
Joined: Wed Mar 15, 2006 3:08 pm
Location: South Africa

Dati folder permissions

Post by flysouth »

Great - glad to find a solution so quickly - thanks to Carlos and to Marco.

I will give your method a try.

One question - when a booking is made using the availability_template form, the data (name,firstname,tel #,e-mail etc) is captured to the database and visible in the "messages" section of php-residence - but when I insert this reservation, it does not insert all the details of the client - only the surname and reservation dates and room detail. I then have to insert manually the rest of the client details. Is this right?
marco
Posts: 1332
Joined: Tue Jul 05, 2005 6:00 pm
Location: Roma, Italia

Re: Dati folder permissions

Post by marco »

Hello,
the problem here shouldn't be the same as Carlos because php-residence chmods only the files that contain database connection data, so only dati_connessione.php and the templates.
flysouth wrote:Warning: fopen(./dati/lingua.php.tmp): failed to open stream: Permission denied in /home2/stewart/public_html/php-residence/includes/funzioni.php on line 535
ERROR writing file ./dati/lingua.php.
Here you see that apache doesn't have the permissions to create the file lingua.php.tmp (if this file doesn't already exist, which shouldn't). Flysouth are you sure that the "dati" directory (not the files inside it) has been set to 777? Maybe after install you changed its permissions because you couldn't read the files inside and you did not change them back to 777.
flysouth wrote:I can't believe that it is the server causing this - as I have a number of php scripts running on various website on this server (Redhat Linux) - maybe I should reinstall PHP-residence?
I'm not saying that your server doesn't work correctly, just that you don't have to worry about don't being able to read the files inside dati folder form ftp, because the server may be configured this way. You can still retrieve those files (except the templates) with the backup system. For the templates you can create them directly in the directory where they will be used, set it from "configure and customize".

For the second question the normal behaviour is what you expected, the client data should be also already filled with data from the message when inserting the reservation. This problem once happened also to me but I wasn't able to reproduce it afterwards. If the problem continues to happen send me the backup file of your database if you can.
The message from where you inserted the reservation does still allow you to insert again the reservation or points to the reservation already inserted?

Marco
flysouth
Posts: 11
Joined: Wed Mar 15, 2006 3:08 pm
Location: South Africa

Dati folder permissions etc. etc,

Post by flysouth »

Hi Marcos - I appreciate all your help.

I followed the suggestion from Carlos and changed the lines in the file includes/templates/funzioni_mod_disp.php to show chmod 644 - I did this after uploading all the files again (reinstall) but before initializing the program. When I came to create the template, I found that there was no problem to open it or to download it to my machine. So the problem appears to be solved.

BTW - I did find that while the instruction in your readme is to chmod the dati folder to 755 OR 777, I could only get things to work with 777 on that folder.

I figured that the client data should be posted to the client section after a new reservation is received and inserted from the messages section - but my installation refuses to do this.

The database is capturing the data that I have inserted in the online form
(availability_template.php) but it is not being sent to where it should be!

When I do an 'insert' from the messages section, the program presents me with a page with fields for reservation data - and the reservation data dates,room etc) is already there but only the last name of the person who placed the reservation. When I then click to insert the reservation, the next page pops up asking for client data - again only the client last name is filled in there. If I knew the client data I could then fill that in - but of course in real life the client is someone you don't know, so you have to go back to the "messages" page and copy and paste the data - or print it out and then type it in - I thought that could not be right!

I will double check again, but if I cannot find the problem, I will take a backup of the db and send that to you.
marco
Posts: 1332
Joined: Tue Jul 05, 2005 6:00 pm
Location: Roma, Italia

Post by marco »

Ok, for the client data it was my fault, I forgot to update the file clienti.php. You can find the correct one, that will be included in 0.6.1, here:

http://www.digitaldruid.net/download/clienti.php.zip

Marco
flysouth
Posts: 11
Joined: Wed Mar 15, 2006 3:08 pm
Location: South Africa

Post by flysouth »

Thanks Marcos - have downloaded and installed that file - but when I make a new reservation from the online form, then (as admin) go to "messages" to insert the reservation I get this:

(on the page) Insert a new client's data.

Warning: mysql_result(): Unable to jump to row 8 on MySQL result index 55 in /home2/stewart/public_html/php-residence/includes/funzioni_mysql.php on line 69

I can continue but it still does not insert all the client data - again only the surname.

Apart from this minor problem, everyhting else seems to work great!
marco
Posts: 1332
Joined: Tue Jul 05, 2005 6:00 pm
Location: Roma, Italia

Post by marco »

It should work correctly now, download again the file from http://www.digitaldruid.net/download/clienti.php.zip .

Marco
flysouth
Posts: 11
Joined: Wed Mar 15, 2006 3:08 pm
Location: South Africa

Post by flysouth »

Great Marco - that file works nicely!
Post Reply