ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Looking for people to give feedback on Community Auth

March 14, 2012 10:42pm

Subscribe [20]
  • #76 / Oct 19, 2012 10:52am

    Altazar

    52 posts

    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");
        }
  • #77 / Oct 19, 2012 1:15pm

    skunkbad

    1326 posts

    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.

     

  • #78 / Oct 22, 2012 5:04am

    Altazar

    52 posts

    Thank you, I understand it now.

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

    Severity: Warning
    
    Message: pathinfo() expects parameter 1 to be string, object 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…

  • #79 / Oct 22, 2012 1:00pm

    skunkbad

    1326 posts

    Thank you, I understand it now.

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

    Severity: Warning
    
    Message: pathinfo() expects parameter 1 to be string, object 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.

  • #80 / Oct 23, 2012 4:48am

    Altazar

    52 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.

  • #81 / Oct 24, 2012 9:48am

    Altazar

    52 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;
        });
       '
      );
  • #82 / Oct 24, 2012 7:37pm

    casiookid

    5 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…

  • #83 / Oct 24, 2012 8:20pm

    casiookid

    5 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…

    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!

  • #84 / Oct 24, 2012 9:04pm

    skunkbad

    1326 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…

    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?

  • #85 / Oct 24, 2012 9:12pm

    casiookid

    5 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…

    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!

  • #86 / Jan 25, 2013 1:31pm

    esial89

    1 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.

  • #87 / Jul 28, 2013 6:15pm

    bradmkjr

    3 posts

    I just wanted to thank you for your time and effort to create Community Auth. I’m in the final stages of developing a full fledged payment gateway portal, using CA.

    I felt I should share what I found, as it could be helpful for others who come across this post via Google.

    http://community-auth.com/documentation/login_debugging ::

    A more likely problem to see here is that the form_token doesn’t match the flash_token. If this is the case, you need to look for 404 errors in your server access logs (not the CodeIgniter log file). Your server access logs could contain a 404 for an image or some other asset that doesn’t exist. Since a 404 error “uses up” the flash token, you’ll never be able to login until you fix that.

    I came across this bug, in an unique situation. I built a controller, called autocomplete, that when passed a zip code, returns the city and state, in json format. This reduces errors and completion time for the users. But whenever the autocomplete would run, it would void the flash token.

    I believe I have resolved the issue, by modifying the autoload.php file, with the following mods:

    if(strpos( $_SERVER['REQUEST_URI'], 'autocomplete' )){
     $autoload['libraries'] = array('fb','database');
    }else{
     $autoload['libraries'] = array('fb','database','session','Authentication'); 
    }
    if(strpos( $_SERVER['REQUEST_URI'], 'autocomplete' )){
     $autoload['helper'] = array();
    }else{
     $autoload['helper'] = array('html','url','form','cookie');
    }
    if(strpos( $_SERVER['REQUEST_URI'], 'autocomplete' )){
     $autoload['config'] = array('db_tables');
    }else{
     $autoload['config'] = array('db_tables','authentication','google_analytics');
    }
    if(strpos( $_SERVER['REQUEST_URI'], 'autocomplete' )){
     $autoload['model'] = array();
    }else{
     $autoload['model'] = array('auth_model');
    }


    This may not be correct, or even 100% functional, but it worked for me, during my initial testing and wanted to share with someone else in case they had a similar issue. It just seems to me to be a design flaw that if a user loads up any other page during registration in a new tab etc, their form submission will fail, also without any visible error message.

  • #88 / Jul 08, 2014 10:04pm

    skunkbad

    1326 posts

    Community Auth was just updated to CodeIgniter 2.2.0. Current tag is v2.0.3.

    Based on an experience with my host and a client, it was brought to my attention that WordPress was vulnerable to brute force attacks because the login is usually at the same URL for every website. Community Auth previously loaded the login form or allowed login at any URL, making it especially vulnerable to brute force attacks, because any URL could be attacked.

    New changes to Community Auth use a traditional redirect to a login page, and after successful login the user is redirected back to the page they wanted. The URL to the login page can be changed at any time, so if there was a brute force attack on the login page, changing the URL could help.

    Truthfully, I don’t really know that changing the login URL really does much, but it was what the host suggested. He said the server load on all accounts went down substantially after implementation of changes where the login pages were hidden. I’ve always thought that brute force attacks were best done at the server level, but anything that helps is good.

    So with that in mind, if you’re using Community Auth, you should consider upgrading.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases