Re: install / example 5 w/mysql question

Stacy Johnson <[email protected]> Tue, 22 Nov 2005 09:27:24 -0800
Newsgroups gmane.comp.php.pear.liveuser
Message-ID <[email protected]>
Thanks for the suggestions but I'm not getting very far.

The dsn in the conf.php file is correct as far as I can tell.  (If I 
change it to nobody@localhost, it dies on the connect and spits out an 
error.)  So I must have had it set right.  Unless of course it would die 
on a bad connect but just quietly not correct to the proper database?

Debug is already set to true in the conf array, but nothing is being output.

Any more ideas?

thanks again in advance,
-stacy

Arnaud Limbourg wrote:

>Hi,
>
>Some thoughts
>
>Is the dsn in the conf.php file correct ?
>
>Set debug to true in the conf array and see what's in there.
>
>Arnaud.
>
>
>Stacy Johnson wrote:
>  
>
>>Hi, I apologize in advance if this is a silly newcomer question.
>>
>>I am installing/using PEAR and LiveUser for the first time (on Windows,
>>mind you), and I am having trouble getting the example 5 working
>>properly with MySQL.  I have created the demo  liveuser_test_5 database
>>and am connecting successfully.
>>If I leave the example code alone, I get the following error:
>>
>>*Fatal error*: Call to a member function init() on a non-object in
>>*C:\wwwroot\reference\liveuser\example5\conf.php* on line *77
>>*
>>Which comes from this code:
>>
>>-- 
>>$usr = LiveUser::singleton($conf);
>>
>>$handle = (array_key_exists('handle', $_REQUEST)) ? $_REQUEST['handle']
>>: null;
>>$passwd = (array_key_exists('passwd', $_REQUEST)) ? $_REQUEST['passwd']
>>: null;
>>$logout = (array_key_exists('logout', $_REQUEST)) ? $_REQUEST['logout']
>>: false;
>>$remember = (array_key_exists('rememberMe', $_REQUEST)) ?
>>$_REQUEST['rememberMe'] : false;
>>
>>if (!$usr->init($handle, $passwd, $logout, $remember)) {  // LINE 77 HERE
>>   var_dump($usr->getErrors());
>>   die();
>>}
>>
>>-- 
>>
>>So I alter the singleton call to call it like the documention (in
>>LiveUser.php) says:
>>
>>//$usr = LiveUser::singleton($conf);
>>$usr =& LiveUser::singleton($conf);
>>         ^
>>
>>And I get the same error.
>>
>>So I change the singleton call to the factory call (like in the other
>>examples):
>>
>>//$usr = LiveUser::singleton($conf);
>>$usr =& LiveUser::factory($conf);
>>
>>And now I get the login page, but when I actually try to login with
>>JohnDoe JohnDoe (which is in the DB, I've checked), the processing
>>script (admin.php) tells me 'Sorry but you cannot access this page'.   
>>Further decomposition of that script indicates that $usr->isLoggedIn()
>>is failing (not a permissions problem but an actual login problem).
>>
>>So I guess I have a barrage of questions:
>>
>>1 - Has anyone else had this problem?
>>2 - Does it sound like an install/permissions problem?
>>3 - Should I be using singleton or factory there?
>>4 - Might there be a bug in $usr->isLoggedIn()?
>>
>>Thanks in advance for any help,
>>-Stacy Johnson
>>
>>
>>
>>
>>
>>    
>>
>
>
>_______________________________________________
>LiveUser mailing list
>[email protected]
>http://mailman.21st-hq.de/mailman/listinfo/liveuser
>  
>


-- 
Stacy Johnson
Ignite Analytics Corporation
[email protected]
m. 206-354-5591