• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FreakAuth light 1.1 released

[eluser]rhand_ci[/eluser]
I hope FreakAuth will be upgraded in the near future as well. Maybe NeedCod3 can work together with Danfreak on Github where Danfreak has the code: http://github.com/danfreak/freakauth . I am afraid I still have much to learn before I can contribute. I was Googling Authentication for CI and found this thread..

[eluser]atno[/eluser]
[quote author="rhand_ci" date="1266243613"]I was Googling Authentication for CI and found this thread..[/quote]

hey rhand_ci,

next time check wiki/ and forums/ before you start googling. Everything you might need is in here. Community is our best friend Smile

atno

[eluser]rhand_ci[/eluser]
@ atno I will the next time ;-) Looked into the CI wiki just now and found Tank Auth. Looks interesting and more up-to-date. Going to give it a shot as soon as possible.

[eluser]Unknown[/eluser]
[quote author="aadhunik" date="1252257997"]Thanks a lot - boony.

I was having the same problem until I reach your post.

But why the FreakAuth Team still not fixed this in download archive.

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

[quote author="boony" date="1238308656"]Ooooops, muddled headed wombat here...... Tongue

I no sooner posted that stupid request when I looked a couple of pages back to see the very problem solved by fixing this line in the usermodel.

$this->db->where("role='admin' OR role='superadmin'", '', FALSE); :cheese:

So, now I'm trying to customise my views to use login pages etc in my site. Any help in how to quickly do this would be greatly appreciated. ;-)[/quote][/quote]

Another approach to this fix:

Change:
Code:
$this->db->where("role='admin' OR role='superadmin'");

To:
Code:
$this->db->where('role','admin');
$this->db->or_where('role','superadmin');

[eluser]srpurdy[/eluser]
I been using freakauth on and off for a few years now, and never really paid much attention to the activation link feature. I noticed that if you click the link more than once it will keep inserting new users with the same username and information. Is there a way to fix this? Id rather not turn that feature off. The biggest problem with this is my site I am developing is relying on the user database quite a lot. Folders are being created via the FTP library. I'm not sure how 4 or 5 users with the same information would effect my system. It may not be an issue at all, but it's rather annoying that someone can spam the activation link even after the account is already been activated.

Actually typing this got me thinking this could be a cache issue? I am using the database caching? Any idea's? Would explain why I haven't seen this bug before LOL Smile

Edit: Never mind that's what it was. lol Smile

Shawn

[eluser]RaZoR LeGaCy[/eluser]
PHPBB Style Who is Online

Model
Code:
function online_users() {
  // we will store all our currently logged in users' names and IDs in this array.
  $online_users_full = array();

  $online_users = array();

  $total = 0;
  $total_users = 0;
  $total_visitors = 0;


  // This query requires php5. See the user guide re: database library, making queries.
  // 'ci_sessions' is the default session table name, replace with yours.
  $query = $this->db->select('session_data')->get('ci_sessions');

  // let's get all the logged in users' names and id numbers.
  if ( $query->num_rows() > 0) {

   foreach ( $query->result() as $serial_data){

    $session_data = unserialize($serial_data->session_data);

    // ignore all session data that are NULL or otherwise not an array
    // and we only want session data that has an user name and user id.
    if (is_array($session_data)) {
     if ( isset($session_data['id']) && isset($session_data['user_name']) ) {

      $online_users[] = array (
        'id' => $session_data['id'],
        'user_name' => ucwords($session_data['user_name']),
        'role' => ucwords($session_data['role']),
        );

       ++$total;
       ++$total_users;
     }

    } else {
     ++$total;
     ++$total_visitors;
    }


   }
   $query->free_result();
  }

  // we can send this array off to the view along with other data...
  //$view_data['online_users'] = $online_users;
  //$this->load->view('online_user_list' ,$view_data);
  $online_users_full = array(
     'users'            =>        $online_users,
     'total'            =>        $total,
     'total_users'        =>        $total_users,
     'total_visitors'    =>        $total_visitors,
   );

  return $online_users_full;

} // End function


View
Code:
<h2>Who is online</h2>

<p>In total there are <strong>&lt;?=$online_users['total']?&gt;</strong> users online :: <strong>&lt;?=$online_users['total_users']?&gt;</strong> registered and <strong>&lt;?=$online_users['total_visitors']?&gt;</strong> guests (based on users active over the past 30 minutes)</p>

<p>Registered users: &lt;?php
$i=1;
$total = count($online_users['users']);
foreach ($online_users['users'] as $user):
echo $user['user_name'];
if($i < $total) echo ', ';
++$i;
endforeach;
?&gt;</p>

You can create a legend where the users are of a specific role and are color coded just like phpBB as well.

Have fun!


[quote author="Natebot" date="1228835990"]To get a list of the current logged in users we can make use of the sessions database table.

The following code is just proof of concept, although technically it will run in a CI controller. You would be better served converting it into a custom library, or perhaps in MyFAL.

Code:
// we will store all our currently logged in users' names and IDs in this array.
        $online_users = array();

        // This query requires php5. See the user guide re: database library, making queries.
        // 'ci_sessions' is the default session table name, replace with yours.
        $query = $this->db->select('session_data')->get('ci_sessions');


        // let's get all the logged in users' names and id numbers.
        if ( $query->num_rows() > 0) {
          
            foreach ( $query->result() as $serial_data){
                
                $session_data = unserialize($serial_data->session_data);

               // ignore all session data that are NULL or otherwise not an array
               // and we only want session data that has an user name and user id.

               if (is_array($session_data)) {
                     if ( isset($session_data['id']) && isset($session_data['user_name']) )
                    
                         $online_users[] = array (
                                                  'id' => $session_data['id'],
                                                  'user_name' => $session_data['user_name'],
                                             );
                                                                
               }
            }  
        }

       // we can send this array off to the view along with other data...
       $view_data['online_users'] = $online_users;
       $this->load->view('online_user_list' ,$view_data)

and in the online_user_list view file (if you are ok with stepping through an array in your view):

Code:
&lt;!-- an unordered list of links to profiles of users currently online --&gt;
&lt;!-- assuming you have got a controller "profile" whose index method accepts a user id number --&gt;

&lt;?php if ( isset ($online_users) ) : ?&gt;
    <ul>
    &lt;?php foreach ( $online_users as $user ) : ?&gt;
      <li>
           <a href="/profile/&lt;?php echo $user['id']; ?&gt;" title="visit user profile">
               &lt;?php echo $user['user_name'] ?&gt;
           </a>
      </li>
    &lt;?php endforeach; ?&gt;
    </ul>
&lt;?php endif; ?&gt;
[/quote]

[eluser]nottRobin[/eluser]
Having tried many other Authentication libraries in CodeIgniter and encountered many errors, I'm actually considering changing to CakePHP just to have an authentication system that works - even if it repeating the 30+ hours of work I've done on this app so far.

Then I discovered FreakAuth, which seemed really good - professional looking website, it's obviously currently being maintained, and it even has documentation!

So anyway, I got as far as the installation page. I can see the installation page and everything looks fine - Except it says "DB_session OFF". Now I can definitely see "Db_session.php" in my libraries directory (copied directly from the FreakAuth download) and I have included "db_session" in my autoload.php.

It *might* be because I'm using PHP 5.3 - I already had to fix the code in freakauth_lite_helper.php to remove a warning.

Has anyone else encountered this problem? Is there a fix?

Cheers.
Robin.

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

EDIT: Fixed myself

I hadn't turned turned on "sess_use_database" in system/application/config/config.php:

Code:
$config['sess_use_database']    = TRUE;

[eluser]Kaosland[/eluser]
Hello.

I have some question.

* The next version when is out?
* Somebody have idee to integrate a " remember me"

thanks.

PS :
FreakAuth is a great auth mod

[eluser]RaZoR LeGaCy[/eluser]
I saw it on the net and somewhere in the forums here.
search for "freakauth recoded remember me"

[eluser]Kaosland[/eluser]
Thanks


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.