Location: PHPKode > projects > Exero CMS > upload/class/core.php
<?
/*========================================*\
| Exero CMS                                |
|==========================================|
|          http://ecms.getox.net           |
|https://sourceforge.net/projects/exerocms/|
|==========================================|
|     Exero CMS is released under the      |
|     GNU General Public License (GPL)     |
| opensource.org/licenses/gpl-license.php  |
\*========================================*/
define("TABLE_PREFIX","");
class ExeroCMS {
	var $thismodule = "";
	function init() {
	global $db;
		// Get ecms Core Settings
		$getsettings = $db->query("SELECT * FROM ".TABLE_PREFIX."settings");
		while($settinginfo = $db->fetch_array($getsettings)) {
			$this->settings[$settinginfo['setting']] = $settinginfo['value'];
		}
		// Get Module Settings
		$getmodulesettings = $db->query("SELECT * FROM ".TABLE_PREFIX."modulesettings");
		while($modulesettinginfo = $db->fetch_array($getmodulesettings)) {
			$this->modulesettings[$modulesettinginfo['moduleident']][$modulesettinginfo['setting']] = $modulesettinginfo['value'];
		}
	}
	function permissions($module,$section='') {
	global $db, $user;
		$checkpermission = $db->num_rows($db->query("SELECT * FROM ".TABLE_PREFIX."permissions WHERE module='".$module."' AND section='".$section."' LIMIT 1"));
		if($checkpermission == "1") {
			$perminfo = $db->query_first("SELECT * FROM ".TABLE_PREFIX."permissions WHERE module='".$module."' AND section='".$section."' LIMIT 1");
			$groupaccess = explode(',',$perminfo['groupaccess']);
			if(in_array($user->userinfo['groupid'],$groupaccess)) {
				return 1;
			} else {
				return 0;
			}
		} else {
			return 0;
		}
	}
	function fetch_hook($hooklocation) {
	global $ecms, $db;
		if($ecms->settings['enableplugins']) {
			$code = array();
			$gethooks = $db->query("SELECT * FROM ".TABLE_PREFIX."plugins WHERE hooklocation = '".$hooklocation."' AND enabled = '1'");
			while($hook = $db->fetch_array($gethooks)) {
				$code[] = $hook['code'];
			}
			$code = implode("/* */",$code);
			return $code;
		}
	}
}
?>
Return current item: Exero CMS