Part of the EllisLab Network
   
6 of 8
6
Sentry…
Posted: 18 November 2006 06:15 PM   [ Ignore ]   [ # 76 ]  
Summer Student
Total Posts:  16
Joined  11-05-2006

Has anyone gotten Sentry to work with 1.5.0(.1)? If so, would they be willing to either upload the code somewhere or write a quick guide on the changes made?

Is there a version of Sentry in the works for 1.5.0? I’ve been trying to get it to play nice with 1.5.0, but I keep running into new errors all the time.

Profile
 
 
Posted: 19 November 2006 11:48 AM   [ Ignore ]   [ # 77 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  472
Joined  09-26-2006

I am not sure If anyone has Sentry working with 1.5

There is a library called auth which is based on sentry and works on
CI 1.5.

At worst you could have a look and see what changes the author made.

 Signature 

Old programmers never die, they just parse away.

Profile
 
 
Posted: 01 December 2006 03:55 PM   [ Ignore ]   [ # 78 ]  
Lab Assistant
RankRank
Total Posts:  201
Joined  08-28-2006

I am wondering if Sentry is still developed ?

Profile
 
 
Posted: 01 December 2006 05:07 PM   [ Ignore ]   [ # 79 ]  
Summer Student
Total Posts:  16
Joined  11-05-2006
shocki - 01 December 2006 03:55 PM

I am wondering if Sentry is still developed ?

As Oscar Bajner pointed out, Auth is an updated version of Sentry.

Profile
 
 
Posted: 03 December 2006 10:21 AM   [ Ignore ]   [ # 80 ]  
Summer Student
Total Posts:  23
Joined  10-10-2006

I strongly reccomend not using sentry, because its very bugged.
It’s a good starting point if you want to implement your own auth system, but definitely not a good solution as it is.

 Signature 

digital design

Profile
 
 
Posted: 03 December 2006 12:28 PM   [ Ignore ]   [ # 81 ]  
Lab Assistant
RankRank
Total Posts:  201
Joined  08-28-2006

Good to know. Is there a ready to use solution for CI that already works ? Auth is also based on Sentry so I am afraid it is pretty buggy as well.

Profile
 
 
Posted: 06 December 2006 07:52 AM   [ Ignore ]   [ # 82 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  515
Joined  12-05-2006

I need to start a kinda CMS application, and I would start with some user authentication system.

Anybody as anything to suggest for CI 1.5.1?

Cheers

Dan

 Signature 

FreakAuth_light: pluggable & extendable authentication library that works on CI 1.5.X

CI SWIFT MAILER: 44% less memory than PHPMailer at double speed

Using Zend Framework components in Code Igniter

Profile
 
 
Posted: 07 December 2006 09:45 AM   [ Ignore ]   [ # 83 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  515
Joined  12-05-2006

I installed Auth,

and modified the welcome controller as follows:

<?php

class Welcome extends Controller {

    
function Welcome()
    
{
        parent
::Controller();    
    
}
    
    
function index()
    
{
        
if ($this->sentry->check())  
        
{
            
echo "logged<br />";
            
$this->load->view('welcome_message');
        
} else echo "no";
    
}
}
?>

but I get this error message:

Fatal error: Cannot redeclare class db_session in C:\www\CI\system\application\libraries\Db_session.php on line 16

PS: I also added a bit of stuff in the Auth wiki

 Signature 

FreakAuth_light: pluggable & extendable authentication library that works on CI 1.5.X

CI SWIFT MAILER: 44% less memory than PHPMailer at double speed

Using Zend Framework components in Code Igniter

Profile
 
 
Posted: 07 December 2006 03:08 PM   [ Ignore ]   [ # 84 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  515
Joined  12-05-2006

Any clue guys?!

I noticed that both libraries Db_session.php and Authlib.php use

$this->obj =& get_instance();
$this->obj->load->library('encrypt');
...
etc

intead of

$CI =& get_instance();

$CI->load->helper('url');
$CI->load->library('session');
$CI->config->item('base_url');
etc.

as suggested in the userguide “Creating Libraries

 Signature 

FreakAuth_light: pluggable & extendable authentication library that works on CI 1.5.X

CI SWIFT MAILER: 44% less memory than PHPMailer at double speed

Using Zend Framework components in Code Igniter

Profile
 
 
Posted: 07 December 2006 04:45 PM   [ Ignore ]   [ # 85 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  515
Joined  12-05-2006
danfreak - 07 December 2006 09:45 AM

I installed Auth,

but I get this error message:

Fatal error: Cannot redeclare class db_session in C:\www\CI\system\application\libraries\Db_session.php on line 16

PS: I also added a bit of stuff in the Auth wiki

I solved the problem:

In your system/application/config/autoload.php change

$autoload['libraries'] = array('database', 'db_session', 'authlib');

to

$autoload['libraries'] = array('database',  'authlib');

This unloads db_session, that get’s already loaded in system/application/libraries/Authlib.php

My test controller (welcome.php) to see it in action

class Welcome extends Controller {

    
function __construct(){
        
        parent
::Controller();
    
}
    
    
function index()
    
{
        
if ($this->authlib->isValidUser())  
        
{
            $user
=getUserName();
            
$logout_link=anchor('auth/logout', 'logout');
            echo
"welcome <b>".$user."</b> / ".$logout_link."<BR />";
            
$this->load->view('welcome_message');
        
}
        
else
        
{
            
echo "not logged";
            
redirect('/auth/login', 'refresh');
        
}
    }
}
?>

When I try to register as a new user the page http://localhost/your_CI/index.php/auth/register

returns the following error:

Fatal error: Call to undefined method CI_Loader::setdata() in C:\www\CI\system\application\controllers\auth.php on line 159

that correspondends to the following call

function register_index()
    
{
        $countries
= null;            
        if (
$this->config->item('auth_use_country'))
            
$countries = $this->Usermodel->getCountries();
        
        if (
$this->config->item('auth_use_security_code'))
            
$this->authlib->register_init();
                    
$data['countries'] = $this->Usermodel->getCountries();
        
$this->load->setdata($data);
        
$this->load->view($this->config->item('auth_register_view'));
    
}
 Signature 

FreakAuth_light: pluggable & extendable authentication library that works on CI 1.5.X

CI SWIFT MAILER: 44% less memory than PHPMailer at double speed

Using Zend Framework components in Code Igniter

Profile
 
 
Posted: 07 December 2006 08:07 PM   [ Ignore ]   [ # 86 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  515
Joined  12-05-2006

Found the solution also for this second problem:

In the function your_CI\system\application\controllers\auth.php on line 159

change

$this->load->setdata($data);
$this->load->view($this->config->item('auth_register_view'));

with

$this->load->view($this->config->item('auth_register_view'),  $data);
 Signature 

FreakAuth_light: pluggable & extendable authentication library that works on CI 1.5.X

CI SWIFT MAILER: 44% less memory than PHPMailer at double speed

Using Zend Framework components in Code Igniter

Profile
 
 
Posted: 14 December 2006 12:31 AM   [ Ignore ]   [ # 87 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  310
Joined  08-16-2006

danfreak, thanks for the fix regarding the registration.


Continuing error findings with Auth. Replace lines 28 & 29 of view\auth\login.php:

<p><?=anchor('auth/forgotten_password_index', $this->lang->line('sentry_forgotten_password_label'))?></p>
<
p><?=anchor('auth/register_index', $this->lang->line('sentry_register_label'))?></p>

with:

<p><?=anchor($this->config->item('auth_forgotten_password_view'), $this->lang->line('sentry_forgotten_password_label'))?></p>
<
p><?=anchor($this->config->item('auth_register_view'), $this->lang->line('sentry_register_label'))?></p>


This corrects an invalid function reference and also properly uses the predefined config definitions.
I realize these pages were probably hastily put together for example purposes only.
All in all the library is quite instructive.

Profile
 
 
Posted: 14 December 2006 04:53 AM   [ Ignore ]   [ # 88 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  515
Joined  12-05-2006

Hey Bacteria Man,

your welcome!

In the mainwhile I fixed several other stuff like:
- commented out all classes&menthods;- error messages
- flash messages from sessions
- captcha (security code)
- language files
- an unusefull doubled query for displaying countries select box
- ecc

+ I created an additional table (user_temp) and the relative model where to store the registered users prior than activation

I don’t have time to work on it today, but as soon as I’ll finish the bug inspection I’ll give it back to the CI community

Why don’t you start a new topic about Auth?!?

 Signature 

FreakAuth_light: pluggable & extendable authentication library that works on CI 1.5.X

CI SWIFT MAILER: 44% less memory than PHPMailer at double speed

Using Zend Framework components in Code Igniter

Profile
 
 
Posted: 14 December 2006 03:08 PM   [ Ignore ]   [ # 89 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  310
Joined  08-16-2006

Ok, I’ve started a new topic here.

I’m anxious to hear what you’ve come up with.

Profile
 
 
Posted: 14 December 2006 05:26 PM   [ Ignore ]   [ # 90 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  310
Joined  08-16-2006
danfreak - 14 December 2006 04:53 AM

+ I created an additional table (user_temp) and the relative model where to store the registered users prior than activation

BTW, I like this idea very much. I might suggest a more descriptive table name like ‘user_activation’, but this is a minor squabble.

Profile
 
 
   
6 of 8
6
 
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: 119966 Total Logged-in Users: 55
Total Topics: 126092 Total Anonymous Users: 1
Total Replies: 663283 Total Guests: 515
Total Posts: 789375    
Members ( View Memberlist )