Part of the EllisLab Network
   
14 of 14
14
The Authentication Library 1.0.6
Posted: 18 December 2011 09:12 AM   [ Ignore ]   [ # 131 ]  
Summer Student
Total Posts:  1
Joined  12-18-2011

@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

Profile
 
 
Posted: 12 March 2012 08:28 AM   [ Ignore ]   [ # 132 ]  
Grad Student
Avatar
Rank
Total Posts:  60
Joined  05-20-2009

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

Profile
 
 
Posted: 12 March 2012 09:24 AM   [ Ignore ]   [ # 133 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5366
Joined  06-19-2009

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 

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: 12 March 2012 09:49 AM   [ Ignore ]   [ # 134 ]  
Grad Student
Avatar
Rank
Total Posts:  60
Joined  05-20-2009

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)?

Profile
 
 
Posted: 29 March 2012 12:56 AM   [ Ignore ]   [ # 135 ]  
Summer Student
Total Posts:  2
Joined  03-29-2012

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.

 

 

Profile
 
 
Posted: 29 March 2012 02:24 AM   [ Ignore ]   [ # 136 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5366
Joined  06-19-2009

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

 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: 29 March 2012 09:08 AM   [ Ignore ]   [ # 137 ]  
Summer Student
Total Posts:  2
Joined  03-29-2012

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?

Profile
 
 
   
14 of 14
14