Welcome Guest, Not a member yet? Register   Sign In
Fundamental functions of auth and access libraries.
#1

[eluser]Basketcasesoftware[/eluser]
What do you think are essential functions to an authorization or access control library? Nothing that depends on a specific database structure please or specific configurations.

I'm using the functions from Ben Edmund's Ion Auth system as a starter here, plus some functions more related to access control. This is only because I have a copy of its user guide to go by.

These seem pretty fundamental:
login()
logout()
register()
update_user()
delete_user()
logged_in()
is_group()
username_check()
identity_check()
get_user() // returns a 'user object'
get_user_array()
get_user_by_identity()
get_users() // An array of 'user objects'
get_users_array()
get_active_users()
get_active_users_array()
get_groups()
get_group()
get_group_by_name()
errors()
set_error_delimiters()
encrypt() // Password encryption

less fundamental, but handy:
forgotten_password()
forgotten_password_complete()
is_admin()
email_check()
get_user_by_email() // Some systems allow shared emails. Not really a good general practice, but...
get_users_by_email()
get_newest_users() // How do you define 'newest'? Hmmm.
get_newest_users_array()
get_inactive_users()
get_inactive_users_array()

I omit these - user related, but not authorization or access related. Sometimes too closely connected to database functionality.
get_messages()
set_message_delimiter()
extra_where
extra_set

Access control:
is_allowed() // Is the user allowed on this page
allowed() // Array of allowed locations
default() // Where to send the user to if they aren't where they should or can be.

I'm trying to develop a generic library that auth and access control systems can hook to. This is a rough idea but it's because I've noticed the tight coupling of these systems to specific database calls and frameworks. Trying to build a layer of abstraction between the two.

Ideas?
#2

[eluser]n0xie[/eluser]
Let me fix that for you:

Code:
<?php

    abstract class CI_Auth
    {
        abstract function authenticate();
        abstract function is_authenticated();
    }

Have fun!
#3

[eluser]Basketcasesoftware[/eluser]
LOL. As said in a certain commercial "Thank you for your support". %-P

"Layer of abstraction" doesn't automatically mean abstract classes and functions (though it might work out that way). It just means a layer of code that removes the programmer from having to worry about implementation details. The entire CI framework qualifies as such. An excellent example would be the template library used with c++ programming.

And you missed authorization.
#4

[eluser]n0xie[/eluser]
[quote author="Basketcasesoftware" date="1297875041"]
And you missed authorization.[/quote]
No I did not. This is what your starting point should look like.
#5

[eluser]-[/eluser]
@noxie, hi guys....

Are you able to give examples of its package so you mean like scheme, where friends can download.

thx.
#6

[eluser]Basketcasesoftware[/eluser]
[quote author="n0xie" date="1297883129"][quote author="Basketcasesoftware" date="1297875041"]
And you missed authorization.[/quote]
No I did not. This is what your starting point should look like.[/quote]

Touche'

Edit: Realized what you are trying to say in your first post. Thought you were trying to make a joke there. Being up too long can do that. Apologies. Good suggestion. Now if I can field some more...

Thought about Core or Reactor for this thread, but it's too early for that yet.

I don't want to add any auth or access ability to CI, just make it easier to do so without worrying about how to access the database.

I'm thinking this is going to require a "User" class in the core. But how to have such without DB use is going to be tricky. Maybe a "Group" or "Category" class. The name isn't important, just the concept. Same issues.

Definitely a user can be of a "guest" class. Everyone starts there. But is the existence of a "administrator" or "member" class mandatory?

I want to use the resources that are automatically loaded with CI 2.0 and nothing more for this.
#7

[eluser]Basketcasesoftware[/eluser]
[quote author="panega" date="1297883662"]@noxie, hi guys....

Are you able to give examples of its package so you mean like scheme, where friends can download.

thx.[/quote]

What package? This is just a survey to see if this is even feasible.
#8

[eluser]-[/eluser]
well, I'm really sorry, just a suggestion only,!

can be exemplified...
#9

[eluser]Basketcasesoftware[/eluser]
Oh? I really could not understand your original statement. I thought you were asking for a package. Right now I'm thinking library but ideally if it can be pared down to CI goals and guidelines it would be better as a core class. I'm thinking this is going to be a 'user/group' type class or classes. Seems a fundamental part of any auth system. But it certainly could have other uses. Is this helping answer your question?
#10

[eluser]-[/eluser]
I am a beginner, I am a new player in CodeIgniter, I'm just starting early, I want to create a user login, registration, logout, but want to make your own, from where I should start, can you give a very simple example and support CodeIgniter 2.0, at various forums This, I was a little difficult to understand, most ready-made and very complex, ...

Essentially, I wanted to create a user login / logut / register .....

Can you make recommendations, or just a ready-made packages and simple, using a database as well. mysql ..

sorry I was not very good at speaking / writing english ...

I just made an example and further understand

receive love

(from google translate)




Theme © iAndrew 2016 - Forum software by © MyBB