In short, Cotonti Auth is the system in which Groups are granted or denied access to certain features of the Core system, and or Plugins.
Auth just stands for Authentication.
Cotonti itself (mostly)uses only 3 levels of access.
Read, Write, and Admin
Here is what typically Each level gives.
Thats basiclly, all there is to know about Cotonti Auth for general use.
It will allow you to set specific access to certain areas or certain features for only people given that access. Once you learn how to use this this feature of Cotonti. You will find out how simple, and wonderful it really is.
Well, the Level feature of Cotonti is really outdated and obsolete. The reason why group level is not a good method is because, different people who use your plugin may have different levels set or extra groups, and do not allow for precisely giving acess without either requiring the user to hardcode the levels of which group should have access to what, or by making them configure it. And using something like if level is greaterthan or lessthan whatever is bad, because that may include people they don't want.
Really its the same as stated before. As far as how the levels work and to set them. Read access is still required to view(run) the plugin or hook. As for the others, they will be determined by you what they do.
The first thing to know is that cot_auth function returns TRUE(1), FALSE(0), or an array(read below).
The Syntax of the function is like this.
cot_auth('plug', 'code', 'auth level');
$auth = cot_auth('plug', 'code', 'auth level');
list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = cot_auth('plug', 'code');
cot_block(cot_auth('plug', 'code', 'auth level')); //This is a way of checking access without storing the information in a variable (typically used if you don't need to use that value check more than once, if you do store it in a variable) cot_block($variable); //This is a variable containing TRUE or FALSE which you obtained from above
cot_blockguests();
$auth = cot_auth('plug', 'code', 'auth level'); ///if you do it with one of the following first 3 ways, this should come before the check. if($auth == FALSE) { then do this } //or do TRUE for false check //or you could do it like this if($auth == 0) { then do this } //or do 1 for TRUE check //or you could do it like this if(!$auth) { then do this } //or do $auth for TRUE check // //or you could do it like this, if you only need to check the auth once you can directly call it(if you need to use this value anywhere else more than once, do the above method and store it in a variable) // if(cot_auth('plug', 'code', 'auth level' == FALSE)) { then do this } //or do TRUE for false check //or you could do it like this if(cot_auth('plug', 'code', 'auth level' == 0)) { then do this } //or do 1 for TRUE check //or you could do it like this if(!cot_auth('plug', 'code', 'auth level')) { then do this } //or do cot_auth('plug', 'code', 'auth level') for TRUE check
Thanked: 16 times