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

[eluser]joepiped[/eluser]
I have what I think is a simplw question. I have installed AG Auth, I can show the login form on any view page, but I can't actually log in. It's as if the form doesn't have any functionality unless it is in the actual auth/pages/login page. Here is my Controller.

<?php

class Pages extends Application
{
public function __construct()
{
parent::__construct();



}

public function login()
{
$this->ag_auth->login('user/dashboard');
// user/dashboard is a made up URI string
}






public function view($page = 'home')
{

if ( ! file_exists('application/views/pages/'.$page.'.php'))
{
// Whoops, we don't have a page for that!
show_404();
}

$data['title'] = ucfirst($page); // Capitalize the first letter

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

}




}

/* End of file: home.php */
/* Location: application/controllers/home.php */




then in the view I use the login form code. Any help would be great.



[eluser]InsiteFX[/eluser]
Open up and take a look at ./application/core/MY_Controller.php

[eluser]joepiped[/eluser]
I tried taking /core/MY_Controller and using the code in my own controller, but I can't get it to work. I even used basically the entire MY_Controller code in my own controller, which didn't work, but that can't be right I know there is a correct way. Sorry I'm not very good at PHP, I'm mostly a designer. What code do I use in my own controller so I can use AgAuth on any page...or am I totally missing something?

[eluser]MightyBishop[/eluser]
Hi there

I am aware of being able to use username() to get the username of the currently logged in user.

Is there an equivalent call that would return the id of the current user? I need to have a record of who did what to whatever in the database, and I'd like to record the ID of the user in my "database activity" file (for want of a better phrase!)

Thanks!

JB

[eluser]maru[/eluser]
Hi! I was taking a look to this great example! it's really cool! Smile

Now I would like to adapt it to my proyect but I am having some issues with the structure.

in controllers folder I have admin folder and in the root my controllers:
categorias
clientes
...

in views folder I haver auth folder and in the root:
categorias/categorias_v
clientes/clientes_v
...
layouts/ where I have an structure: heather, menu, footer

I would like to add permission to my proyect I mean If I try this:
http://localhost/crud/index.php/login I can access to the dashboard, but if I try this url: http://localhost/crud/index.php/categorias/categorias_v I can also access, so I would like to add that login permission.

Hope someone can helping me with that, thanks in advance.




Theme © iAndrew 2016 - Forum software by © MyBB