Esempio n. 1
0
	/**
	 *  Validates the access to a certain reservation-script
	 *
	 *  @param  -   String  $section    The section (= script-file)
	 *  @param  -   int     $id         An id (sometimes this is required to get rights for a unique row in the database)
	 */
	function protect_script($section, $id = null) {
		$uid = api_get_user_id();
		switch ($section) {
			case 'm_item' :
				if (!api_is_platform_admin() && Rsys :: check_user_status() <> 1)
					api_protect_admin_script();
				break;
			case 'm_category' :
				api_protect_admin_script();
				break;
			case 'm_reservation' :
				if (!api_is_platform_admin() && Rsys :: check_user_status() <> 1)
					api_protect_admin_script();
				break;
		}
	}