/**
 * @package: SmartCampus
 * @helper::isUserAllowwedToAccessMenu().
 * @Author: Idea Tweaker
 */
function isUserAllowwedToAccessMenu($menu)
{
    $ci = getInstance();
    $where = array('page_name' => $menu);
    if (getSession('token') != 1) {
        if ($ci->common_model->isRecordsExists($ci->common_model->_accessPagesTable, $where)) {
            $sql_pages = $ci->common_model->getRecords($ci->common_model->_accessPagesTable, $where, 's');
            return in_array(getSession('token'), getExplode(',', $sql_pages['user_groups'])) ? 1 : 0;
        } else {
            return 0;
        }
    } else {
        return 1;
    }
}
Example #2
0
/**
 * @package:SMS
 * @helper::getAdminDesignation().
 * @Author:Techno Services
 */
function isUserAllowToAcessModule($module)
{
    $ci = getInstance();
    $where = array('config_categories' => $module);
    $config = $ci->common_model->getRecords($ci->common_model->_gradebookTable, $where, 's');
    $config_permission = $config['config_permission'];
    $priority = getExplode(',', $config_permission['config_permission']);
    return in_array(getPriority(), $priority) || getPriority() == 1 ? 1 : 0;
}