EllisLab text mark
Advanced Search
6 of 6
6
   
Looking for people to give feedback on Community Auth
Posted: 19 October 2012 01:15 PM   [ Ignore ]   [ # 76 ]   [ Rating: 0 ]
Avatar
Joined: 2009-05-17
1415 posts
Altazar - 19 October 2012 10:52 AM

Hi! I’ve successfuly installed Community Auth before a few months but wasn’t using it. Today I’ve installed the new version (2.0.0). It’s excellent, and I’d like to integrate it with my existing CodeIgniter website which has three columns layout and only one controller (Site). I don’t know how to merge it with 12 Community Auth controllers… Thanks!

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class 
Site extends CI_Controller {

    
public function index(){
        $this
->home();
    
}

    
public function home(){
        $this
->load->model("model_get");
        
$data["results"$this->model_get->getData("home");
        
$this->load->view("site_header");
        
$this->load->view("content_home"$data); //col1, centered
        
$this->load->view("col2");
        
$this->load->view("col3");
        
$this->load->view("site_banner");
        
$this->load->view("site_footer");
    

Altazar, the main difference between your handling of views and mine is that I am nesting the views. When the third parameter of view() is set to true, it doesn’t immediately output, but instead makes that view available for use however you’d like it. You will notice that Community Auth uses a main template, located in views/templates. The content of each page is a nested view. So for instance, in the controller you will see:

$data = array(
  
'content' => $this->load->view('some_nested_view'''TRUE)
); 

Then, inside the main template:

<?php echo $content?> 

If you want to have three columns, then you will need to add the columns to the template, then insert them through nesting:

// Controller
$data = array(
  
'left_col'  => $this->load->view('left_column_content'''TRUE),
  
'content'   => $this->load->view('some_nested_view'''TRUE),
  
'right_col' => $this->load->view('right_column_content'''TRUE)
); 

Revised main template:

<?php echo $left_col?>
<?php 
echo $content?>
<?php 
echo $right_col?> 

Take a look through a few controllers and see how the content is inserted into a template. I’m sure you will quickly see how easy it is to create your own template.

 

 Signature 

Brian
Brian’s Web Design - Temecula
Community Auth - CodeIgniter Authentication Application

 
Posted: 22 October 2012 05:04 AM   [ Ignore ]   [ # 77 ]   [ Rating: 0 ]
Avatar
Joined: 2012-02-24
54 posts

Thank you, I understand it now.

I’ve installed “Ocular Template Library” before and that produced this error:

SeverityWarning

Message
pathinfo() expects parameter 1 to be stringobject given

Filename
core/Loader.php

Line Number
759 

I removed that template library and get no errors.

My main_template.php looks like:

<?php echo $header?>
<?php 
echo $left_column?>
<?php 
echo $content?>
<?php 
echo $right_column?>
<?php 
echo $footer?> 

I get no errors, but the loaded page has only content part, left and right columns, header and footer are not loaded.
I’ve copied header and footer to main_template.php and removed echo $header and echo $footer, but nothing changed…

 
Posted: 22 October 2012 01:00 PM   [ Ignore ]   [ # 78 ]   [ Rating: 0 ]
Avatar
Joined: 2009-05-17
1415 posts
Altazar - 22 October 2012 05:04 AM

Thank you, I understand it now.

I’ve installed “Ocular Template Library” before and that produced this error:

SeverityWarning

Message
pathinfo() expects parameter 1 to be stringobject given

Filename
core/Loader.php

Line Number
759 

I removed that template library and get no errors.

My main_template.php looks like:

<?php echo $header?>
<?php 
echo $left_column?>
<?php 
echo $content?>
<?php 
echo $right_column?>
<?php 
echo $footer?> 

I get no errors, but the loaded page has only content part, left and right columns, header and footer are not loaded.
I’ve copied header and footer to main_template.php and removed echo $header and echo $footer, but nothing changed…

Maybe at some point I can do a tutorial on changing up the template. If you add a variable to the main template, and want it to be “filled” with something from the controller, you either need to use $this->load->vars(), or add it to the second parameter of view(); This is basic CodeIgniter usage, so I’d recommend reading or re-reading the user guide if you can’t get it working.

I’ve never used or felt the need to use a template library. I’d think one could be integrated with Community Auth, but I’ve got a lot of other things I’d like to see go into Community Auth. Another thing would be, since there are multiple choices in template libraries, how to choose just one? I don’t want to start an argument or get off topic, but I’m not convinced that there’s anything wrong with CodeIgniter that justifies using a template library.

 Signature 

Brian
Brian’s Web Design - Temecula
Community Auth - CodeIgniter Authentication Application

 
Posted: 23 October 2012 04:48 AM   [ Ignore ]   [ # 79 ]   [ Rating: 0 ]
Avatar
Joined: 2012-02-24
54 posts

Thanks! I think the error is in routes, ‘cause my site is multilingual. When I open it with language sufix, header and footer load.

 
Posted: 24 October 2012 09:48 AM   [ Ignore ]   [ # 80 ]   [ Rating: 0 ]
Avatar
Joined: 2012-02-24
54 posts

I have one more question. What is this part in index function of static_pages controller doing:

$data = array(
   
'dynamic_extras' => '
    $("a[rel*=external]").click( function(){
     window.open(this.href);
     return false;
    });
   '
  
); 
 
Posted: 24 October 2012 07:37 PM   [ Ignore ]   [ # 81 ]   [ Rating: 0 ]
Joined: 2012-09-19
6 posts

Hi Brian,

I’ve been using CA now for a couple months and work has been going fine. Until tonight, I made a simple html change to one of my views, saved it and as what has been happening mostly it forces me to log back in to view the change. After a few typos entering my admin login information,it blocked my IP address. To rectify this I have been going into to my phpmyadmin db and delete the entry in the blocked IP address tables. The page then came up with an Chmod error saying headers already sent and pointed me to the Auth Model line 503 specifically. I can no longer replicate this error message as all I’m now getting is the below:

‘You don’t have permission to access the requested directory. There is either no index document or the directory is read-protected.’

I’m starting to freak out a bit now…

 
Posted: 24 October 2012 08:20 PM   [ Ignore ]   [ # 82 ]   [ Rating: 0 ]
Joined: 2012-09-19
6 posts
casiookid - 24 October 2012 07:37 PM

Hi Brian,

I’ve been using CA now for a couple months and work has been going fine. Until tonight, I made a simple html change to one of my views, saved it and as what has been happening mostly it forces me to log back in to view the change. After a few typos entering my admin login information,it blocked my IP address. To rectify this I have been going into to my phpmyadmin db and delete the entry in the blocked IP address tables. The page then came up with an Chmod error saying headers already sent and pointed me to the Auth Model line 503 specifically. I can no longer replicate this error message as all I’m now getting is the below:

‘You don’t have permission to access the requested directory. There is either no index document or the directory is read-protected.’

I’m starting to freak out a bit now…

Ah, problem solved. Sorry about that! Went into my htaccess file and saw it had backlisted my IP address so just deleted all the lines and the site is appearing again. Still not entirely sure why saving changes sometimes signs me out of the authentication systems though.


Cheers again!

 
Posted: 24 October 2012 09:04 PM   [ Ignore ]   [ # 83 ]   [ Rating: 0 ]
Avatar
Joined: 2009-05-17
1415 posts
casiookid - 24 October 2012 08:20 PM
casiookid - 24 October 2012 07:37 PM

Hi Brian,

I’ve been using CA now for a couple months and work has been going fine. Until tonight, I made a simple html change to one of my views, saved it and as what has been happening mostly it forces me to log back in to view the change. After a few typos entering my admin login information,it blocked my IP address. To rectify this I have been going into to my phpmyadmin db and delete the entry in the blocked IP address tables. The page then came up with an Chmod error saying headers already sent and pointed me to the Auth Model line 503 specifically. I can no longer replicate this error message as all I’m now getting is the below:

‘You don’t have permission to access the requested directory. There is either no index document or the directory is read-protected.’

I’m starting to freak out a bit now…

Ah, problem solved. Sorry about that! Went into my htaccess file and saw it had backlisted my IP address so just deleted all the lines and the site is appearing again. Still not entirely sure why saving changes sometimes signs me out of the authentication systems though.


Cheers again!

What do you mean by saving changes?

 Signature 

Brian
Brian’s Web Design - Temecula
Community Auth - CodeIgniter Authentication Application

 
Posted: 24 October 2012 09:12 PM   [ Ignore ]   [ # 84 ]   [ Rating: 0 ]
Joined: 2012-09-19
6 posts
skunkbad - 24 October 2012 09:04 PM
casiookid - 24 October 2012 08:20 PM
casiookid - 24 October 2012 07:37 PM

Hi Brian,

I’ve been using CA now for a couple months and work has been going fine. Until tonight, I made a simple html change to one of my views, saved it and as what has been happening mostly it forces me to log back in to view the change. After a few typos entering my admin login information,it blocked my IP address. To rectify this I have been going into to my phpmyadmin db and delete the entry in the blocked IP address tables. The page then came up with an Chmod error saying headers already sent and pointed me to the Auth Model line 503 specifically. I can no longer replicate this error message as all I’m now getting is the below:

‘You don’t have permission to access the requested directory. There is either no index document or the directory is read-protected.’

I’m starting to freak out a bit now…

Ah, problem solved. Sorry about that! Went into my htaccess file and saw it had backlisted my IP address so just deleted all the lines and the site is appearing again. Still not entirely sure why saving changes sometimes signs me out of the authentication systems though.


Cheers again!

What do you mean by saving changes?

If I make changes to the html in a view and save it to the localserver within a text editor, when I refresh in my browser to see changes applied to the members only page, for example, and I’m already signed in as an admin user, it signs me out and refers me to my login page. It’s most likely a quirk that’s originated from something I’ve done. Sorry that’s not much help!

 
Posted: 25 January 2013 02:31 PM   [ Ignore ]   [ # 85 ]   [ Rating: 0 ]
Joined: 2013-01-25
2 posts

 

The custom uploader is a great feature but it does’nt seem to work for me. When i try to upload an image i get an error

” Error uploading file(filename.jpg)!
  Undefined “


I want to add the images to the database so i have made changes in the file ‘application/config/uploads_manager.php’

$config[‘custom_uploader_destination’] = ‘database’;

Could you please help me get this to work.

Thanks in advance.

 
6 of 6
6