We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Access control by init | Forum

Dulitha
Dulitha Jan 15 '14

Hi, 


I have taken the following code from init.php file of the GConnect plugin. Please someone can explain this code to me. I want know how this code improve security of the system.


function gconnect_add_access_exception( BASE_CLASS_EventCollector $e ) {

$e->add(array('controller' => 'GCONNECT_CTRL_Connect', 'action' => 'login'));

$e->add(array('controller' => 'GCONNECT_CTRL_Connect', 'action' => 'oauth'));


}


OW::getEventManager()->bind('base.members_only_exceptions', 'gconnect_add_access_exception');

OW::getEventManager()->bind('base.password_protected_exceptions', 'gconnect_add_access_exception');

OW::getEventManager()->bind('base.splash_screen_exceptions', 'gconnect_add_access_exception');


Thanks.

Arash
Arash Feb 26 '14
What this does is to make and array ($e) [e seems to be auth and login] ands pass it to the controller gconnect (i'm guessing it's salting and it there and asks google if it can get user info back). 


This is a good way to not show the user where you have the actual function and seems to be the coding standard for oxwall.