浏览代码

Merge pull request #50 from QTSdev/master

Read ini file when parse_ini_file is disabled
Mark 11 年之前
父节点
当前提交
2c8d35bc89
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      Controller/Component/Auth/TinyAuthorize.php

+ 7 - 2
Controller/Component/Auth/TinyAuthorize.php

@@ -193,8 +193,13 @@ class TinyAuthorize extends BaseAuthorize {
 		if (!file_exists($path . ACL_FILE)) {
 			touch($path . ACL_FILE);
 		}
-		$iniArray = parse_ini_file($path . ACL_FILE, true);
-
+		
+		if (function_exists('parse_ini_file')) {
+			$iniArray = parse_ini_file($path . ACL_FILE, true);
+		} else {
+			$iniArray = parse_ini_string(file_get_contents($path . ACL_FILE), true);
+		}
+		
 		$availableRoles = Configure::read($this->settings['aclModel']);
 		if (!is_array($availableRoles)) {
 			$Model = $this->getModel();