Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter Fork with Authentication and Authorization
#1

[eluser]Andy Rusu[/eluser]
I forked the CI Reactor so I can add some functionality, like A/A, change the way views work, and other things.
The rules for the Authorization system are set in a function for each controller, it can be a simple static array of rules or a dynamic array. This way the developer can create his own rules based on different application states. It looks for anonymous, logged in or users with specific roles. The roles can be set by the developer without the need of any DB table (e.g. 'roles').
For the authentication library all you need is a form (it's given by the system) and a model with a function called logData() that returns an array that the library inserts in the session->set_userdata() function (the model must only be specified in the auth.php config file, and autoloaded, the library calls the model automatically).
There are many more features, download the application, it can be used instantly without configuration, I made a prototype application with a guide and demo.
#2

[eluser]Vheissu[/eluser]
Interesting. I just started building an auth library myself, you should take a look at the code of that and feel free to borrow ideas, etc.

** Update **

Looked through your auth class and noticed you were getting an instance of the Codeigniter superobject inside of every class function. You can create a class variable and then assign the superobject once inside of your class constructor and then reference using that supervariable defined in your class.
#3

[eluser]Andy Rusu[/eluser]
Thanks for the advice, I'll optimize it and look at your auth lib to. I have an exam tomorrow so I'll look into it after that.
Hope you can find something useful as well.
#4

[eluser]Vheissu[/eluser]
No problem. I'm not the worlds greatest Codeigniterer, but I know a few things. I'm trying to get WolfAuth to have some community input / contributors but nobody seems to have stepped up yet. One thing you'll notice is that everything is in a model instead of a library now as per Wiredesignz feedback.
#5

[eluser]Andy Rusu[/eluser]
In my changes, the extended controller controls the authorization and in a model (set in the config) that has a function logData(), so the developer controls almost all aspects of the authentication.
#6

[eluser]Vheissu[/eluser]
That's a clever idea actually. I'm planing on using Codeigniter Drivers to do something similar. However, I am slightly concerned Codeigniter drivers aren't true drivers in that I create an abstract driver class that child drivers must implement. I could be wrong, I need to look into it. Have you read much about Codeigniter drivers?
#7

[eluser]Andy Rusu[/eluser]
Initially my View class was a driver, but the child class had just 2 functions so I changed it to a simple library. The only fear I had was the use of __get or __set (I love these functions!).




Theme © iAndrew 2016 - Forum software by © MyBB