Planning on cleaning my code & formatting. going to spend as much time doing that next week as i can and ive had some ideas about the classes and models so ill post odd one if its of any interest to anyone else
here is my starting point for permissions class - to install make Permissions.php and include it in functions.php if you have any suggestions feel free as i go through code this will be extended
You pass curuser id or user id as first var then 2nd var is permission - this will be extended to check bigger() smaller() siteconfig() (i have session available for permissions)
lets see if curuser id is loggedin permission
here is my starting point for permissions class - to install make Permissions.php and include it in functions.php if you have any suggestions feel free as i go through code this will be extended
<?php
class Permissions
{
public static function hasPermission($id, $permission)
{
global $site_config, $CURUSER;
if ($id == $CURUSER['id'] && $permission == 1) {
return true;
} else {
return false;
}
}
}You pass curuser id or user id as first var then 2nd var is permission - this will be extended to check bigger() smaller() siteconfig() (i have session available for permissions)
lets see if curuser id is loggedin permission
if (Permissions::hasPermission($CURUSER['id'], $site_config["MEMBERSONLY"])) {
echo "<br>Success<br>";
}
