Welcome Guest, Not a member yet? Register   Sign In
The Authentication Library 1.0.6
#21

[eluser]Adam Griffiths[/eluser]
I do not know why the username or email address is not being added to the database. I will take a look into it but I need to know what version of PP you are running as everything works fine for me in PHP5.



Thanks,
Adam
#22

[eluser]ToddyBoy[/eluser]
I'm using PHP4 on a shared host. Let me know if there's anything else you need.
#23

[eluser]seanloving[/eluser]
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

Code:
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
#24

[eluser]InsiteFX[/eluser]
Hi,

It should be:

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

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

Enjoy
InsiteFX
#25

[eluser]seanloving[/eluser]
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...
Code:
$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:
Code:
$this->auth->view($page, $data);
which actually generates three separate view requests like this:
Code:
$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:
Code:
<?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
#26

[eluser]InsiteFX[/eluser]
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.
#27

[eluser]joytopia[/eluser]
Hello, I have just installed Auth and did not find a forgot password function?
Thanks for your help!
Bernd
#28

[eluser]InsiteFX[/eluser]
Hi joytopia.

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

Enjoy
InsiteFX
#29

[eluser]joytopia[/eluser]
[quote author="InsiteFX" date="1252448591"]
It's in the Auth Library in the function register.
[/quote]

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
#30

[eluser]Adam Griffiths[/eluser]
There currently isn't any forgot password functionality.


Thanks,
Adam




Theme © iAndrew 2016 - Forum software by © MyBB