Codeigniter 3.0 security by methods -
my doubt is: there way in codeigniter
<?php defined('basepath') or exit('no direct script access allowed'); class users extends ci_controller { public function __construct() { parent::__construct(); } //this method user admin permission can access public function onlyadmin(){ } //this method user can access public function alluser(){ } }
something or more dynamic.
thanx time.
the easiest way use authentication library since you'll need authentication @ point in app. there large number available codeigniter each own merits , weaknesses in different situations.
have @ this post overview of few , see if there's 1 that'll suit needs.
you'll want 1 supports different user groups. way when user lands on page can check group (admin / user / not-logged-in) , direct them or render page accordingly. use case statement runs different function each group. these functions should render page need specific customisations each user group.
Comments
Post a Comment