Part of the EllisLab Network
   
3 of 14
3
The Authentication Library 1.0.6
Posted: 11 August 2009 11:54 AM   [ Ignore ]   [ # 21 ]  
Grad Student
Rank
Total Posts:  31
Joined  07-18-2009

I’m using PHP4 on a shared host.  Let me know if there’s anything else you need.

Profile
 
 
Posted: 06 September 2009 04:55 PM   [ Ignore ]   [ # 22 ]  
Lab Assistant
RankRank
Total Posts:  149
Joined  04-13-2009

What have I done? In the case when my controller extends Application, my variables are not passing from controller (controllers/admin/admin.php) to view (views/auth/header.php)

Please point me to the docs or a relevant post. Otherwise… what might be my problem? Here’s my Admin controller

class Admin extends Application
{
    
function Admin()
    
{
        parent
::Application();
    
}
    
    
function index()
    
{
        
if(logged_in())
        
{
            $headerdata[
'title']='Administrative Control Panel'// note that $title never makes it to the view (undefined variable error)
            
$this->auth->view('admin/dashboard'$headerdata);
        
}
        
else
        
{
            $this
->auth->login(); // how to pass variables through to this thing?
        
}
    } 

I can pass variables just fine from controllers that do not extend Application. But here there are two different use cases.  When the user is already logged in then it does not pass variables.  When the user is not logged in, also I do not know how to pass variables to the view.

something about routes?

Again, I am very familiar with doing this in controllers that do not extend Application. Where should I look next?

thanks

—Sean Loving

Profile
 
 
Posted: 06 September 2009 11:50 PM   [ Ignore ]   [ # 23 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5366
Joined  06-19-2009

Hi,

It should be:

$this->auth->view('dashboard'$headerdata); 

Also make sure you configured the root.php file for Auth.

Enjoy
InsiteFX

 Signature 

Custom Designed Icons, eBook Covers Software Boxes. CD, DVD Etc. New iPhone® Tab Bar Icons and iPhone® Applications Icons.

STOP! Before posting your questions, remember the WWW Golden rule:
What did you try? What did you get? What did you expect to get?

Input -> Controller | Processing -> Model | Output -> View

Profile
 
 
Posted: 07 September 2009 08:38 PM   [ Ignore ]   [ # 24 ]  
Lab Assistant
RankRank
Total Posts:  149
Joined  04-13-2009

Thanks InsiteFX,

I have solved part of my problem and I thought it might be useful to others who might want to pass variable data to their header view files.

My problem was that I was trying to use the variable data in my auth/header.php view file.

In my regular controllers I usually call three views - header, main, and footer like this…

$this->load->view('header'$headerdata);
$this->load->view($page$maindata);
$this->load->view('footer'$footerdata); 

This way I can send different variable data to each of my three views that generate my page.

However, in my admin controllers things are handled a bit differently. The Auth Library automatically generates three view requests based on making one single call to the libraries/auth/view function like this:

$this->auth->view($page$data); 

which actually generates three separate view requests like this:

$this->auth->view('auth/header');
$this->auth->view('auth/pages/'.$page$data);
$this->auth->view('auth/footer'); 

Notice the generated header and the footer do NOT receive $data.  That was the problem.

Basically, the $this->auth->view function in libraries/Auth.php sends the request to the index.php file in views/auth

So I modified views/auth/index.php so that I can get $data to my auth/header and my auth/footer views like I like.  Here is the new views/auth/index.php file:

<?php
if(isset($data))
{
    $this
->load->view($this->config->item('auth_views_root') . 'header'$data);
    
$this->load->view($this->config->item('auth_views_root') . 'pages/'.$page$data);
    
$this->load->view($this->config->item('auth_views_root') . 'footer'$data);
}
else
{
    $this
->load->view($this->config->item('auth_views_root') . 'header');
    
$this->load->view($this->config->item('auth_views_root') . 'pages/'.$page);
    
$this->load->view($this->config->item('auth_views_root') . 'footer');
}
?> 

—seanloving

Profile
 
 
Posted: 07 September 2009 09:51 PM   [ Ignore ]   [ # 25 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5366
Joined  06-19-2009

Hi seanloving,

Yes I am very well informed on the way Auth works, I am using it in Adams Fresh CMS which I am writing a menuing system for, the menuing system is working I am just cleaning it up etc.

 Signature 

Custom Designed Icons, eBook Covers Software Boxes. CD, DVD Etc. New iPhone® Tab Bar Icons and iPhone® Applications Icons.

STOP! Before posting your questions, remember the WWW Golden rule:
What did you try? What did you get? What did you expect to get?

Input -> Controller | Processing -> Model | Output -> View

Profile
 
 
Posted: 08 September 2009 04:35 AM   [ Ignore ]   [ # 26 ]  
Grad Student
Avatar
Rank
Total Posts:  80
Joined  08-28-2009

Hello, I have just installed Auth and did not find a forgot password function?
Thanks for your help!
Bernd

Profile
 
 
Posted: 08 September 2009 01:23 PM   [ Ignore ]   [ # 27 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5366
Joined  06-19-2009

Hi joytopia.

It’s in the Auth Library in the function register.

Enjoy
InsiteFX

 Signature 

Custom Designed Icons, eBook Covers Software Boxes. CD, DVD Etc. New iPhone® Tab Bar Icons and iPhone® Applications Icons.

STOP! Before posting your questions, remember the WWW Golden rule:
What did you try? What did you get? What did you expect to get?

Input -> Controller | Processing -> Model | Output -> View

Profile
 
 
Posted: 08 September 2009 01:48 PM   [ Ignore ]   [ # 28 ]  
Grad Student
Avatar
Rank
Total Posts:  80
Joined  08-28-2009
InsiteFX - 08 September 2009 05:23 PM

It’s in the Auth Library in the function register.

Hi InsiteFX,

thanks for your answer! Do you mean libraries/Auth.php?
Perhaps am I blind, but I read the function register several times and could not find anything like “forgot password”?

Regards, Bernd

Profile
 
 
Posted: 08 September 2009 02:57 PM   [ Ignore ]   [ # 29 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  374
Joined  05-04-2008

There currently isn’t any forgot password functionality.


Thanks,
Adam

 Signature 

[ Adam Griffiths - Freelance Web Applications Developer ]
[ Follow me on Twitter ]

Profile
 
 
Posted: 08 September 2009 05:15 PM   [ Ignore ]   [ # 30 ]  
Grad Student
Avatar
Rank
Total Posts:  80
Joined  08-28-2009

Hi Adam,

since I looked for a realy secure forgot password functionality in the web, I learned that it is not a technological but a conceptional problem. Especially with CI it is very easy to send e-mails, make random strings and so on. So I will build my own one.

Thank you for your great work, Adam!

Best regards,
Bernd

Profile
 
 
   
3 of 14
3