Author Topic: Login Failed  (Read 36765 times)

mikeyb

  • Newbie
  • *
  • Posts: 6
Login Failed
« on: December 18, 2007, 05:25:44 pm »
I just installed CalemEAM 2.0.1 on my WinXP box.  I get the "Login failed. Please check your user name/password and try again."  In my calem.log it says:

Code: [Select]

2007-12-18 14:56:18,071 DEBUG main - sid=; aid=, Post data:
2007-12-18 14:56:18,071 INFO  main - Received request to launch: client/launchpad/CalemLoginLite.php, aid=
2007-12-18 14:56:25,630 DEBUG main - sid=; aid=, Post data: username=admin&password=admin_password&lang=&loadmode=gzip&theme=calem&debug=&calemAction=LoginAction
2007-12-18 14:56:25,630 INFO  MysqlHandler - calem db connection: user=calemeam, password=***, , connection=mysql:host=localhost;dbname=calemeam, persistent connection=Array
2007-12-18 14:56:25,630 DEBUG CalemUserDbo - fetchBySqlParam: select * from users where username=?, param='admin'
2007-12-18 14:56:25,630 DEBUG CalemPDOStatement - Query time:0.0025, the query=select * from users where username=?, params=array (
  1 => 'admin',
)


It looks like the password is not being forwarded as empty.

php_pdo.dll & php_pdo_mysql.dll are enabled; no errors in either my php error log or Apache error.log.

What am I doing wrong?

calemadmin

  • Administrator
  • Calem Hero
  • *****
  • Posts: 300
    • http://www.calemeam.com
Login Failed
« Reply #1 on: December 19, 2007, 08:23:08 am »
The logs look fine. Check out if the database has 'admin' in 'users' table.
Calem Community Forum Admin

mikeyb

  • Newbie
  • *
  • Posts: 6
Admin user OK in users table
« Reply #2 on: December 19, 2007, 10:25:38 am »
'admin' exists and password = MD5('admin_password').

calemadmin

  • Administrator
  • Calem Hero
  • *****
  • Posts: 300
    • http://www.calemeam.com
Login Failed
« Reply #3 on: December 19, 2007, 11:31:15 am »
Great you compared password with its md5. You should take a look at code and add an extra log to figure out what was wrong. The login code is in file: CalemEAM\server\modules\admin\CalemSecurityBo.php

Open this file and add the following logging code right after line 62:
$ar=array(
           $user ? 1: 0,
           $user->getLoginAllowed(),
           $user->getUsername()==$username,
           $user->getPassword()==md5($password) );
$this->logger->debug('***' . var_export($ar, true));

Try login again and see why login failed thanks to the great flexibility and instant deployment of PHP.
Calem Community Forum Admin

mikeyb

  • Newbie
  • *
  • Posts: 6
Additional debug output
« Reply #4 on: December 19, 2007, 12:30:26 pm »
OK, now the calem.log output looks like:

Code: [Select]

2007-12-19 10:11:09,578 INFO  main - Received request to launch: client/launchpad/CalemLoginLite.php, aid=
2007-12-19 10:27:30,455 DEBUG main - sid=; aid=, Post data:
2007-12-19 10:27:30,455 INFO  main - Received request to launch: client/launchpad/CalemLoginLite.php, aid=
2007-12-19 10:27:38,984 DEBUG main - sid=; aid=, Post data: username=admin&password=admin_password&lang=&loadmode=gzip&theme=calem&debug=&calemAction=LoginAction
2007-12-19 10:27:39,984 INFO  MysqlHandler - calem db connection: user=calemeam, password=***, , connection=mysql:host=localhost;dbname=calemeam, persistent connection=Array
2007-12-19 10:27:39,984 DEBUG CalemUserDbo - fetchBySqlParam: select * from users where username=?, param='admin'
2007-12-19 10:27:39,984 DEBUG CalemPDOStatement - Query time:0.0017, the query=select * from users where username=?, params=array (
  1 => 'admin',
)
2007-12-19 10:27:39,984 DEBUG CalemSecurityBo - ***array (
  0 => 1,
  1 => true,
  2 => true,
  3 => true,
)
2007-12-19 10:27:39,984 INFO  main - Received request to launch: client/launchpad/CalemLoginLite.php, aid=

mikeyb

  • Newbie
  • *
  • Posts: 6
More from CalemSecurityBo.php
« Reply #5 on: December 19, 2007, 12:40:42 pm »
BTW, if I put a print after line 66 in CalemSecurityBo.php ...

[Line 61]
public function verifyLogin($username, $password) {
   $user=CalemUserDbo::findByUsername($username); //User will not be null if found.
   $succ=($user
      &&$user->getLoginAllowed()
      &&$user->getUsername()==$username
      &&$user->getPassword()==md5($password));
printf("%s, %s, %s\n", $succ, $username, $password);

I get: '1, admin, admin_password'

calemadmin

  • Administrator
  • Calem Hero
  • *****
  • Posts: 300
    • http://www.calemeam.com
Login Failed
« Reply #6 on: December 19, 2007, 03:10:43 pm »
The login problem is caused by issues with cache directories. See Mantis issue created for this incident.
http://www.calemeam.com/apps/mantis/view.php?id=82

You may try the following:
a) Execute Step 7 of the setup guide.
b) Verify that CalemEAM/server/cache/session, data and default are created and writeable.
Calem Community Forum Admin

mikeyb

  • Newbie
  • *
  • Posts: 6
Cache creation problem
« Reply #7 on: December 19, 2007, 06:16:17 pm »
I created the cache folders manually and now can log in, but I get a blank screen.  In my php error log I get:

[19-Dec-2007 14:48:20] PHP Fatal error:  Call to undefined function json_encode() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\CalemEAM\public\JsPkgCustom.php on line 71

and Firefox's Error Console shows:

aclGroup has no properties
http://localhost/CalemEAM/public/jsPkg.php?js=Calem&loadmode=gzip

I thought I saw this blank screen error elsewhere on the Forum, so I'll poke around and see if I find a reference to it.

calemadmin

  • Administrator
  • Calem Hero
  • *****
  • Posts: 300
    • http://www.calemeam.com
Login Failed
« Reply #8 on: December 20, 2007, 12:05:03 pm »
You should execute Step 7 of the Setup Guide. It looks like that step was not performed during the setup which caused directories missing and cache not initialized.
Calem Community Forum Admin

mikeyb

  • Newbie
  • *
  • Posts: 6
Missing php_json.dll
« Reply #9 on: December 22, 2007, 06:42:11 pm »
In my PHP error log I got:

PHP Fatal error:  Call to undefined function json_encode() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\CalemEAM\public\JsPkgCustom.php on line 71

PHP JSON package is an integral part of the PHP 5.2.x release, but not an integral part of my PHP 5.1.6 release.  I downloaded the php_json.dll from http://aurore.net/projects/php-json/ (the Win32 version is at http://pecl4win.php.net/ext.php/php_json.dll), installed it into my php5\ext folder, and then added 'extension=php_json.dll' to my php.ini file.

A successful login now opens the Dashboard page.

Thanks for your help!

calemadmin

  • Administrator
  • Calem Hero
  • *****
  • Posts: 300
    • http://www.calemeam.com
Login Failed
« Reply #10 on: December 27, 2007, 07:06:06 pm »
Congrats! Thanks for the tips about json_encode.
Calem Community Forum Admin