EllisLab text mark
Advanced Search
9 of 10
9
   
The Authentication Library 1.0.6
Posted: 18 December 2011 10:12 AM   [ Ignore ]   [ # 131 ]   [ Rating: 0 ]
Joined: 2011-12-18
1 posts

@josefo, @aere ==> have you add the redirect from /register to /admin/admin/register in the file /config/routes.php? And added the MY_Controller.php in /application/core/ ?

I have a different problem registering or logging in, when i submit the register/login form i only see a white page.. Any idea?

I’m on CI 2.0.3 + AG Auth 2.0.5

 
Posted: 12 March 2012 09:28 AM   [ Ignore ]   [ # 132 ]   [ Rating: 0 ]
Avatar
Joined: 2009-05-20
63 posts

I’m trying to understand the connection between the groups table and the auth_groups array in the config file.  It seems I should need one or the other, but not both. 

Also, how can I assign a user to multiple groups?

I’m using CI 2.1.0 and v2.0.0 of The Authentication Library

 
Posted: 12 March 2012 10:24 AM   [ Ignore ]   [ # 133 ]   [ Rating: 0 ]
Avatar
Joined: 2009-06-19
6267 posts

You would need to add a new table user_groups

-- ------------------------------------------------------------------------

--
-- 
Table structure for table 'user_groups'
--

DROP TABLE IF EXISTS `user_groups`;

CREATE TABLE `user_groups` (
  `
id`       bigint(11unsigned NOT NULL  AUTO_INCREMENT,
  `
user_id`  bigint(11unsigned NOT NULL,
  `
group_idbigint(11unsigned NOT NULL,
  
PRIMARY KEY (`id`)
ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

 

 Signature 

Ceritfied State of CT Computer Programming Teacher.
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

 
Posted: 12 March 2012 10:49 AM   [ Ignore ]   [ # 134 ]   [ Rating: 0 ]
Avatar
Joined: 2009-05-20
63 posts

Yes, of course.  I should have thought of that.  Doh! 

So, what is the relationship between the array in the config file and the table(s)?

 
Posted: 29 March 2012 01:56 AM   [ Ignore ]   [ # 135 ]   [ Rating: 0 ]
Joined: 2012-03-29
2 posts

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.

 

 

 
Posted: 29 March 2012 03:24 AM   [ Ignore ]   [ # 136 ]   [ Rating: 0 ]
Avatar
Joined: 2009-06-19
6267 posts

Open up and take a look at ./application/core/MY_Controller.php

 Signature 

Ceritfied State of CT Computer Programming Teacher.
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

 
Posted: 29 March 2012 10:08 AM   [ Ignore ]   [ # 137 ]   [ Rating: 0 ]
Joined: 2012-03-29
2 posts

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?

 
Posted: 06 October 2012 11:01 AM   [ Ignore ]   [ # 138 ]   [ Rating: 0 ]
Joined: 2012-09-07
9 posts

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

 
Posted: 18 March 2013 11:41 PM   [ Ignore ]   [ # 139 ]   [ Rating: 0 ]
Joined: 2013-01-04
3 posts

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.

 
9 of 10
9