浏览代码

Correct TinyAuth

euromark 11 年之前
父节点
当前提交
430c8c5330
共有 1 个文件被更改,包括 8 次插入3 次删除
  1. 8 3
      Controller/Component/Auth/TinyAuthorize.php

+ 8 - 3
Controller/Component/Auth/TinyAuthorize.php

@@ -59,7 +59,7 @@ class TinyAuthorize extends BaseAuthorize {
 		parent::__construct($Collection, $config);
 
 		if (Cache::config($config['cache']) === false) {
-			throw new CakeException(__d('dev', 'TinyAuth could not find `%s` cache - expects at least a `default` cache', $settings['cache']));
+			throw new CakeException(sprintf('TinyAuth could not find `%s` cache - expects at least a `default` cache', $config['cache']));
 		}
 	}
 
@@ -88,7 +88,7 @@ class TinyAuthorize extends BaseAuthorize {
 			$roles = array($user[$this->settings['aclKey']]);
 		} else {
 			$acl = $this->settings['aclModel'] . '/' . $this->settings['aclKey'];
-			trigger_error(__d('dev', 'Missing acl information (%s) in user session', $acl));
+			trigger_error(sprintf('Missing acl information (%s) in user session', $acl));
 			$roles = array();
 		}
 		return $this->validate($roles, $request->params['plugin'], $request->params['controller'], $request->params['action']);
@@ -98,6 +98,10 @@ class TinyAuthorize extends BaseAuthorize {
 	 * Validate the url to the role(s)
 	 * allows single or multi role based authorization
 	 *
+	 * @param array $roles
+	 * @param string $plugin
+	 * @param string $controller
+	 * @param string $action
 	 * @return bool Success
 	 */
 	public function validate($roles, $plugin, $controller, $action) {
@@ -181,6 +185,7 @@ class TinyAuthorize extends BaseAuthorize {
 	 * - resolves role slugs to their primary key / identifier
 	 * - resolves wildcards to their verbose translation
 	 *
+	 * @param string $path
 	 * @return array Roles
 	 */
 	protected function _getAcl($path = null) {
@@ -215,7 +220,7 @@ class TinyAuthorize extends BaseAuthorize {
 			Configure::write($this->settings['aclModel'], $availableRoles);
 		}
 		if (!is_array($availableRoles) || !is_array($iniArray)) {
-			trigger_error(__d('dev', 'Invalid Role Setup for TinyAuthorize (no roles found)'));
+			trigger_error('Invalid Role Setup for TinyAuthorize (no roles found)');
 			return array();
 		}