Part of the EllisLab Network
   
25 of 27
25
UserAuth Mini-App
Posted: 09 October 2007 04:03 AM   [ Ignore ]   [ # 361 ]  
Research Assistant
RankRankRank
Total Posts:  514
Joined  08-26-2006

Hi musa,

Strange.

What is the exact address shown in the adress bar ?

Did You set the base url in config ?

Did You install in the web root ? ( Your .htaccess might not work if You did install in a subdirectory)

/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your Code Igniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|    http://www.your-site.com/
|
*/
$config['base_url']    = ""; // <- here goes Your local address


This error message should mean:
The CI (the front controller ) is trying to load the view file ‘pages/user.php’.
The front controller has been called with page/user as params. The method page uses the
the second URI segment as name for the view to load.
But this does not make sense, since there is neither a view file call user nor a call to page/user in the application.

Thomas

Profile
 
 
Posted: 09 October 2007 04:11 AM   [ Ignore ]   [ # 362 ]  
Grad Student
Avatar
Rank
Total Posts:  64
Joined  06-18-2007

Thomas,
Thanks, its my mistake, i didnt put the baseurl on config.php
no it works fine. Thanks Again

Another, i just start to built using CI, if possible, please
give me some good references.

Musa

 Signature 

==================================
Kodegeek
http://kodegeek.wordpress.com/
==================================

Profile
 
 
Posted: 09 October 2007 05:07 AM   [ Ignore ]   [ # 363 ]  
Research Assistant
RankRankRank
Total Posts:  514
Joined  08-26-2006

Musa,

Glad I could help.


For the references:
0. read the user guide, which is exceptionally well done, a pleasure to read.
1. rebuild the blog application video.
2. search the forum, some guys offer manuals and tutorials.
3. have a look at the Wiki.

I started like that. The closer look at the code of the userauth application did help me uderstanding CI.

My biggest problem was to get rid of my PHP3/PHP4 spaghetti code practices (a horror to maintain). I now build my applications using object oriented techniques.
I also sepearate data (models), application logic (controllers), functionality (libraries), and output (views).

Thomas

Profile
 
 
Posted: 09 October 2007 06:41 AM   [ Ignore ]   [ # 364 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  424
Joined  04-03-2006

Thanks Tomcode for your continuing support of UserAuth.
I am currently these next few days re-embracing it…

Rethinking the mini-app looking to move it forward a notch

Would welcome any suggestions…

  It typically has been developed of my own needs
      while responding to feedback.

Sorry I’ve been away from this project these months

  George Dunlop

 Signature 

George Dunlop - This-Page.com

Profile
 
 
Posted: 09 October 2007 07:34 AM   [ Ignore ]   [ # 365 ]  
Research Assistant
RankRankRank
Total Posts:  514
Joined  08-26-2006

Hi Peccavio,

I am using mainly the libraries only. My applications are often Flash based, the client-server communication is in XML. For HTML sites/ HTML version of a Flash site I develop my pages myself.

I guess I’ve got some suggestions (haven’t been into it quite a while), but I’m taken the next few days. I’ll prepare something for the next week.

I’d be glad to have this project continue.

Thomas

...now some come to my mind: avatars, readable passwords (yes, I know, a big security hole), class documentation
...at least that’s what I have in my adapted version.

Profile
 
 
Posted: 05 November 2007 01:02 PM   [ Ignore ]   [ # 366 ]  
Research Assistant
RankRankRank
Total Posts:  514
Joined  08-26-2006

Hi Peccavio,

I have started a new project. In a few days I need to decide on the user administration. I’d like to stick to userAuth, but since You didn’t answer my mail (maybe You didn’t get it) I want to know whether You continue this project.

I’m not yet fixed on my needs (read suggestions), I haven’t looked on the code, but what I surely like:
a. a Forgotten Password feature
b. DB-based sessions in case cookies are disabled
c. an enabled / disabled feature for users, the field exists already and I use and adaption where it is activated
e. good separation between the logic, the data and the output (output as HTML, XML)

I’ve started to work on an adaption of Mini-App, better I rebuild from scratch.

1. Controllers can share common functions

2. I wrote an independant class, which allows:
a. to load static pages from inside the view folder. Can be configured to serve international content.
b. Can scan folders and serve file lists by including / excluding filetypes.

3. The HTML templates contain only variables, formating and all loops and switches are done before.

Thomas

Profile
 
 
Posted: 10 November 2007 02:21 PM   [ Ignore ]   [ # 367 ]  
Summer Student
Total Posts:  3
Joined  11-10-2007

Sorry if this is overly stupid, I’ve search around on here but have not found a solution to my problem. Can somebody help as to why I’m getting this error:

A PHP Error was encountered
Severity: Notice
Message: Undefined property: Front::$authorize
Filename: controllers/front.php
Line Number: 44
Fatal error: Call to a member function roleCheck() on a non-object in /var/www/ci/system/application/controllers/front.php on line 44

Profile
 
 
Posted: 10 November 2007 04:17 PM   [ Ignore ]   [ # 368 ]  
Research Assistant
RankRankRank
Total Posts:  514
Joined  08-26-2006

Hi ackack,

Looks like Your authorize library is not loaded.

Thomas

Profile
 
 
Posted: 10 November 2007 06:55 PM   [ Ignore ]   [ # 369 ]  
Summer Student
Total Posts:  3
Joined  11-10-2007

Thanks Thomas,

Below is from my log. Is the “User Authentication Class” the library? If not can you tell me where/how I should load it? I see this in the userauth contructor, not sure where else to put it or what to change it to so it’s happy: $this->obj->load->library(‘ua_authorize’);

Thanks.

Log:
DEBUG - 2007-07-20 04:40:18—> User Authentication Class Initialised via Front
DEBUG - 2007-07-20 04:40:18—> Lang_detect Class Initialized
DEBUG - 2007-07-20 04:40:18—> Controller Class Initialized
ERROR - 2007-07-20 04:40:18—> Severity: Notice —> Undefined property:  Front::$session /var/www/ci/system/application/controllers/front.php 50

Profile
 
 
Posted: 10 November 2007 07:34 PM   [ Ignore ]   [ # 370 ]  
Research Assistant
RankRankRank
Total Posts:  514
Joined  08-26-2006
$this->obj->load->library(’ua_authorize’);

This line of code is from one of the older versions. In the latest version userauth_0.9.2t52 I have changed some class names to adapt userauth for CI 1.5. You’ll find the complete change log and the complete info on the demo app.

If You continue to have problems, tell me the CI version, the userauth version and Your PHP/Apache version. Tomorrow I’ll be on my workstation again and can check.

Profile
 
 
Posted: 10 November 2007 09:00 PM   [ Ignore ]   [ # 371 ]  
Summer Student
Total Posts:  3
Joined  11-10-2007

That version worked. Thanks for you time!

Profile
 
 
Posted: 28 November 2007 03:23 PM   [ Ignore ]   [ # 372 ]  
Summer Student
Total Posts:  28
Joined  09-27-2006

Hi,
First off thanks for an awesome library.

For some reason I can’t get the remember me function to work.
For testing purposes I’ve set the login expiration to 1 minute.
The remember me life is 12 weeks.

When I check the remember me box during log in, I can see the userhash and random_string cookies set and recorded to db.

I then don’t do anything for 2 minutes while I’m logged in. When I try to go to a page that requires log in I get logged out, and the remember me cookie gets deleted.

It seems like the remember me feature should keep me logged in, right?

When I look at this code:

// Expire an inactive login
if ( $this->obj->session->userdata('loggedin') ) {
            $expire_time
= time() - $this->obj->config->item('login_expiration');
            if (
$this->obj->session->userdata('last_activity') <=  $expire_time) {
                log_message
('debug', "Userauth: check: inactive login, expired");
                
$this->logout();
            
}
        }
        $this
->obj->session->set_userdata('last_activity', time());

        
// make sure we have a language

        
if ($this->obj->config->item('ua_multi_language')) {
            $language
= $this->obj->session->userdata('ua_language');
            if (empty(
$language)) {
                $language
= $this->obj->lang_detect->language();
            
}
        }
else { $language = $this->obj->config->item('language'); }
        $this
->obj->session->set_userdata('ua_language',$language);

        
// check if "Remember Me" option is enabled and needed
        
if ( ! $this->obj->session->userdata('loggedin') ) {
            $username
= $this->obj->remember_me->checkRememberMe();
            if (
$username != FALSE ) {
                $this
->obj->user_group_model->dateStampLogin($username);
                
log_message('debug', "Userauth: check: Remember Me, login");
                
$sessdata = array('username' => $username, 'loggedin' => TRUE);
                
$this->obj->session->set_userdata($sessdata);
                
$this->obj->remember_me->addRememberMe($username);
            
}
        }

It appears that as soon as the login expires I get logged out and the remember me cookie gets deleted thus when the time comes to check the remember me cookie, there’s nothing there.

Could someone explain to me how this is supposed to work, please. What am I missing?

Thanks in advance,
Ray


P.S. the logout function from Userauth.php for easy reference is:

function logout()
    
{
        log_message
('debug','Userauth: Logout: '.$this->obj->session->userdata('username'));

        
//remember_me used to figure if to expire inactive login
        
$sessdata = array('username'=>'', 'loggedin' => FALSE );
        
$this->obj->session->set_userdata($sessdata);
        
$this->obj->remember_me->removeRememberMe();
    
}
Profile
 
 
Posted: 28 November 2007 04:11 PM   [ Ignore ]   [ # 373 ]  
Research Assistant
RankRankRank
Total Posts:  514
Joined  08-26-2006

Hi AofC,

I’ve never used the Remember Me. I’m not on my dev machine, but I’ve set my demo installation  to 2 min.

Remeber Me caused already before problems. On Apache 2 with PHP 5 the Native Session does not work anymore (on my machine).

Tomorrow (from now on in twelve hours) I’ll can do some testing.

EDIT:

I’ve tried on my demo with Firefox under Windows XP and it works, but only if I change the page after been logged. If I close the browser directly after having logged, it does not work.

Also: when testing make sure You always start with deleting the cookies, otherwise You may have false results.

What version of CI / Userauth /s erver / PHP You’re working with ?

Profile
 
 
Posted: 28 November 2007 06:26 PM   [ Ignore ]   [ # 374 ]  
Summer Student
Total Posts:  28
Joined  09-27-2006

Thanks for a quick reply, tomcode!

I’m using CI 1.5.3, Userauth: 0.9.2t52, server Apache 1.3, PHP 5.2
Testing with WinXP and Firefox.

I tried your demo. Even after changing to a different page after login, and waiting for more than 2 minutes, then refreshing I get logged out. Same happens on my site.

I think the persistent cookies may need a P3P compact privacy policy to be there when you close/open the browser.
Will play around tonite, and let you know what I find.

Profile
 
 
Posted: 28 November 2007 07:12 PM   [ Ignore ]   [ # 375 ]  
Research Assistant
RankRankRank
Total Posts:  514
Joined  08-26-2006

Yeah, I have the same effect. Refreshing after two minutes logs out. Without further testing I suspect the Native session class, since I have a similair problem with it, even it odes not seem to be logic.

You could use CI’s session class and extend it with the needed functions for the Flash var functionality. This is what I will try first, tomorrow.

extending native libraries

Profile
 
 
   
25 of 27
25
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 120025 Total Logged-in Users: 38
Total Topics: 126159 Total Anonymous Users: 4
Total Replies: 663605 Total Guests: 359
Total Posts: 789764    
Members ( View Memberlist )