public function addUserPrefixUrl($url = null) {
		if (empty($url)) {
			return $url;
		}

		$userPrefix = $this->Session->read('Auth.User.prefix');
		if (empty($userPrefix)) {
			return $url;
		}

		if (!is_array($url)) {
			if (($url === '/') || (stripos($url, '/') === false)) {
				return $url;
			}
			$url = Router::parse($url);
		}

		if (isset($url['prefix']) && ($url['prefix'] === false)) {
			$url[$userPrefix] = false;
			if (isset($url['prefix'])) {
				unset($url['prefix']);
			}

			return $url;
		}

		$url[$userPrefix] = true;

		return $url;
	}
public function addUserPrefixUrl($url = null) {
		if (empty($url)) {
			return $url;
		}

		$userPrefix = $this->Session->read('Auth.User.prefix');
		if (empty($userPrefix)) {
			return $url;
		}

		if (!is_array($url)) {
			if (($url === '/') || (stripos($url, '/') === false)) {
				return $url;
			}
			$url = Router::parse($url);
		}

		if (isset($url['prefix']) && ($url['prefix'] === false)) {
			$url[$userPrefix] = false;
			if (isset($url['prefix'])) {
				unset($url['prefix']);
			}

			return $url;
		}

		$url[$userPrefix] = true;

		return $url;
	}
public function addUserPrefixUrl ( $ url = null ) { if ( empty ( $ url ) ) { return $ url ; } $ userPrefix = $ this -> Session -> read ( 'Auth.User.prefix' ) ; if ( empty ( $ userPrefix ) ) { return $ url ; } if ( ! is_array ( $ url ) ) { if ( ( $ url === '/' ) || ( stripos ( $ url , '/' ) === false ) ) { return $ url ; } $ url = Router :: parse ( $ url ) ; } if ( isset ( $ url [ 'prefix' ] ) && ( $ url [ 'prefix' ] === false ) ) { $ url [ $ userPrefix ] = false ; if ( isset ( $ url [ 'prefix' ] ) ) { unset ( $ url [ 'prefix' ] ) ; } return $ url ; } $ url [ $ userPrefix ] = true ; return $ url ; }
Return URL with user role prefix
For disable use user prefix, add to url array key
`prefix` with value `false`.

@param array|string $url URL for adding prefix
@return array|string Return URL with user role prefix
Return URL with user role prefix For disable use user prefix add to url array key prefix with value false .