Login loop [solved]

Support and queries relating to all previous versions of ZoneMinder
Locked
smyles
Posts: 2
Joined: Tue Jan 03, 2006 11:48 am

Login loop [solved]

Post by smyles »

I've just installed Zoneminder 1.21.4 on my Gentoo system using lazyleopard's ebuild from this thread. I've started the daemons using the zmdc.pl start command and they seem to be running well and am trying the web pages. I'm using Apache 2.0.54 with PHP 4.4.0.

I'm trying to login with admin/admin but it just returns me to the login screen. I've spotted various people around with similar problems and they all seem to be to do with the Users table not containing the right data. Using phpMyAdmin I can see that my Users table contains the following:

Code: Select all

Id - 1
Username - admin
Password - *4ACFE3202A5FF5CF467898FC58AAB1D615029441
Language - <blank>
Enabled - 1
Stream - View
Events - Edit
Control - Edit
Monitors -Edit
System - Edit
MaxBandwidth - <blank>
MonitorIds - <blank>
I've stuck a print_r($_SESSION) at the end of the userLogin() function in zm_funcs.php and it looks like the login query is retrieving the correct user data from the database as the _SESSION variable contains the following data at the end of the function:

Code: Select all

Array
(
    [format] => html
    [cookies] => 1
    [device] => 
    [username] => admin
    [remote_addr] => 192.168.7.214
    [user] => Array
        (
            [Id] => 1
            [Username] => admin
            [Password] => *4ACFE3202A5FF5CF467898FC58AAB1D615029441
            [Language] => 
            [Enabled] => 1
            [Stream] => View
            [Events] => Edit
            [Control] => Edit
            [Monitors] => Edit
            [System] => Edit
            [MaxBandwidth] => 
            [MonitorIds] => 
        )
    [password_hash] => *4ACFE3202A5FF5CF467898FC58AAB1D615029441
)
Can anyone give me any pointers about where to go from here?
Last edited by smyles on Thu Jan 05, 2006 8:08 am, edited 1 time in total.
unclerichy
Posts: 74
Joined: Wed Feb 25, 2004 5:06 pm

Post by unclerichy »

A number of other forum members have reported a similar problem. PHP 4.4.0 has a bug in it that results in this loop effect I believe that 4.4.1 may fix it. Failing that, drop back to 4.3.0 (as I did)
smyles
Posts: 2
Joined: Tue Jan 03, 2006 11:48 am

Login loop [solved]

Post by smyles »

I upgraded to 4.4.1 and it cured the problem. Thanks for your accurate help!
jemenake
Posts: 4
Joined: Wed Jun 08, 2005 9:08 pm

Post by jemenake »

Well, upgrading to the latest PHP 4.x or even to PHP 5 didn't solve this problem for me. I even completely uninstalled and re-installed ZM... purged the database and recreated it. Still no luck.

What I eventually did to get around the problem was to put:

$action="login";
$username="admin";
$password="admin";

at the beginning of zm_html.php.

using....

$action=$_POST["action"];
$username=$_POST['username'];
$password=$_POST['password'];

didn't even work. So, for some reason, the input fields from the login form aren't getting to ZM.

I'm stumped.

- Joe
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

If you add a call to

Code: Select all

phpinfo( INFO_VARIABLES );
just above where you do the assignement, do you see them listed there?
Phil
jemenake
Posts: 4
Joined: Wed Jun 08, 2005 9:08 pm

Post by jemenake »

zoneminder wrote:If you add a call to

Code: Select all

phpinfo( INFO_VARIABLES );
just above where you do the assignement, do you see them listed there?
Nope. I put the phpinfo call right at the beginning of zm_html.php and it spat out what follows. This is the result of a plain ol' login attempt as "admin". Also, for what it's worth, I've actually printed the SQL query that ZM is trying and I've tried that exact SQL query in the mysql console and it does find the user entry.

Code: Select all

PHP_SELF 	/zm/index.php
_REQUEST["bandwidth"]	high
_REQUEST["format"]	html
_REQUEST["ZMSESSID"]	aa1d1aabc28f8e62b3c0a6cdbc97029f
_COOKIE["bandwidth"]	high
_COOKIE["format"]	html
_COOKIE["ZMSESSID"]	aa1d1aabc28f8e62b3c0a6cdbc97029f
_SERVER["DOCUMENT_ROOT"]	/var/www
_SERVER["HTTP_ACCEPT"]	text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
_SERVER["HTTP_ACCEPT_CHARSET"]	ISO-8859-1,utf-8;q=0.7,*;q=0.7
_SERVER["HTTP_ACCEPT_ENCODING"]	gzip,deflate
_SERVER["HTTP_ACCEPT_LANGUAGE"]	en-us,en;q=0.5
_SERVER["HTTP_CONNECTION"]	keep-alive
_SERVER["HTTP_COOKIE"]	bandwidth=high; format=html; ZMSESSID=aa1d1aabc28f8e62b3c0a6cdbc97029f
_SERVER["HTTP_HOST"]	REMOVED
_SERVER["HTTP_KEEP_ALIVE"]	300
_SERVER["HTTP_REFERER"]	http://REMOVED/zm/index.php
_SERVER["HTTP_USER_AGENT"]	Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20060110 Debian/1.5.dfsg-4 Firefox/1.5
_SERVER["PATH"]	/bin:/usr/bin:/usr/local/bin
_SERVER["REMOTE_ADDR"]	REMOVED
_SERVER["REMOTE_HOST"]	REMOVED
_SERVER["REMOTE_PORT"]	60069
_SERVER["SCRIPT_FILENAME"]	/var/www/zm/index.php
_SERVER["SERVER_ADDR"]	REMOVED
_SERVER["SERVER_ADMIN"]	REMOVED
_SERVER["SERVER_NAME"]	REMOVED
_SERVER["SERVER_PORT"]	80
_SERVER["SERVER_SIGNATURE"]	no value
_SERVER["SERVER_SOFTWARE"]	Apache/1.3.34 (Debian) PHP/5.1.2-1 mod_jk/1.2.14 mod_ssl/2.8.25 OpenSSL/0.9.8a
_SERVER["UNIQUE_ID"]	Q9lDCoFBWwQAAFqs24g
_SERVER["GATEWAY_INTERFACE"]	CGI/1.1
_SERVER["SERVER_PROTOCOL"]	HTTP/1.1
_SERVER["REQUEST_METHOD"]	GET
_SERVER["QUERY_STRING"]	no value
_SERVER["REQUEST_URI"]	/zm/index.php
_SERVER["SCRIPT_NAME"]	/zm/index.php
_SERVER["PATH_TRANSLATED"]	/var/www/zm/index.php
_SERVER["PHP_SELF"]	/zm/index.php
_SERVER["REQUEST_TIME"]	1138311946
_SERVER["argv"]	 Array ( )
_SERVER["argc"]	0
_ENV["LANG"]	C
_ENV["PATH"]	/bin:/usr/bin:/usr/local/bin
Locked