discuz 业务机制流程

后台 admin.php?action=misc&operation=cron  

前台 member.php

admin.php

} elseif(in_array($action, $admincp_actions_normal) || ($admincp->isfounder && in_array($action, $admincp_actions_founder))) {
	if($admincp->allow($action, $operation, $do) || $action == 'index') {
		require $admincp->admincpfile($action);
	} else {
		cpheader();
		cpmsg('action_noaccess', '', 'error');
	}
} else {

class_admincp.php

	//TRUE or false
	function allow($action, $operation, $do) {

		if($this->perms === null) {
			$this->load_admin_perms();
		}

		if(isset($this->perms['all'])) {
			return $this->perms['all'];
		}

		if(!empty($_POST) && !array_key_exists('_allowpost', $this->perms)) {
			return false;
		}

		$key = $action;
		if(isset($this->perms[$key])) {
			return $this->perms[$key];
		}
		$key = $action.'_'.$operation;
		if(isset($this->perms[$key])) {
			return $this->perms[$key];
		}
		$key = $action.'_'.$operation.'_'.$do;
		if(isset($this->perms[$key])) {
			return $this->perms[$key];
		}
		return false;
	}
//查找对应的文件进行业务操作
	function admincpfile($action) {
		return './source/admincp/admincp_'.$action.'.php';
	}

 业务操作

} elseif($operation == 'cron') {

	if(empty($_G['gp_edit']) && empty($_G['gp_run'])) {

		if(!submitcheck('cronssubmit')) {//已提交
................................
			$query = DB::query("SELECT * FROM ".DB::table('common_cron')." ORDER BY type DESC");
................................

你可能感兴趣的:(PHP)