31 'root' =>
'',
'lib' =>
'',
'data' =>
'',
38 'lib' =>
'xoops_lib',
'data' =>
'xoops_data',
46 'xoops_cache',
'smarty_cache',
'smarty_compile',
54 'root' =>
'ROOT_PATH',
'data' =>
'VAR_PATH',
'lib' =>
'PATH',
66 'root' => 0,
'data' => 0,
'lib' => 0,
78 'root' => null,
'data' => null,
90 if (isset(
$_SESSION[
'settings'][
'ROOT_PATH'])) {
91 foreach ($this->path_lookup as $req => $sess) {
92 $this->xoopsPath[$req] =
$_SESSION[
'settings'][$sess];
95 $path = str_replace(
"\\",
"/", realpath(
'../'));
96 if (substr(
$path, -1) ==
'/') {
99 if (file_exists(
"$path/mainfile.dist.php")) {
100 $this->xoopsPath[
'root'] =
$path;
103 $this->xoopsPath[
'lib'] = dirname(
$path) .
"/" . ($this->xoopsPathDefault[
'lib']);
105 if (!is_dir($this->xoopsPath[
'lib'] .
"/")) {
106 $this->xoopsPath[
'lib'] =
$path .
"/" . ($this->xoopsPathDefault[
'lib']);
109 $this->xoopsPath[
'data'] = dirname(
$path) .
"/" . ($this->xoopsPathDefault[
'data']);
111 if (!is_dir($this->xoopsPath[
'data'] .
"/")) {
112 $this->xoopsPath[
'data'] =
$path .
"/" . ($this->xoopsPathDefault[
'data']);
115 if (isset(
$_SESSION[
'settings'][
'URL'])) {
116 $this->xoopsUrl =
$_SESSION[
'settings'][
'URL'];
121 $this->xoopsUrl = substr(
$path, 0, strrpos(
$path,
'/'));
135 if (
$_SERVER[
'REQUEST_METHOD'] ==
'POST') {
136 foreach ($this->path_lookup as $req => $sess) {
137 $_SESSION[
'settings'][$sess] = $this->xoopsPath[$req];
153 if (
$_SERVER[
'REQUEST_METHOD'] ==
'POST') {
155 foreach ($this->path_lookup as $req => $sess) {
156 if (isset($request[$req])) {
157 $request[$req] = str_replace(
"\\",
"/", trim($request[$req]));
158 if (substr($request[$req], -1) ==
'/') {
159 $request[$req] = substr($request[$req], 0, -1);
161 $this->xoopsPath[$req] = $request[$req];
164 if (isset($request[
'URL'])) {
165 $request[
'URL'] = trim($request[
'URL']);
166 if (substr($request[
'URL'], -1) ==
'/') {
167 $request[
'URL'] = substr($request[
'URL'], 0, -1);
169 $this->xoopsUrl = $request[
'URL'];
176 foreach (array_keys($this->xoopsPath) as
$path) {
181 $this->validUrl = !empty($this->xoopsUrl);
182 $validPaths = (array_sum(array_values($this->validPath)) == count(array_keys($this->validPath))) ? 1 : 0;
184 foreach ($this->permErrors as $errs) {
189 if (empty($status)) {
195 return ($validPaths && $this->validUrl && $validPerms);
201 if ($PATH ==
'root' || empty($PATH)) {
203 if (is_dir($this->xoopsPath[
$path]) && is_readable($this->xoopsPath[$path])) {
204 @include_once
"{$this->xoopsPath[$path]}/include/version.php";
205 if (file_exists(
"{$this->xoopsPath[$path]}/mainfile.dist.php") && defined(
'XOOPS_VERSION')) {
206 $this->validPath[
$path] = 1;
209 $ret *= $this->validPath[
$path];
211 if ($PATH ==
'lib' || empty($PATH)) {
213 if (is_dir($this->xoopsPath[
$path]) && is_readable($this->xoopsPath[$path])) {
214 $this->validPath[
$path] = 1;
216 $ret *= $this->validPath[
$path];
218 if ($PATH ==
'data' || empty($PATH)) {
220 if (is_dir($this->xoopsPath[
$path]) && is_readable($this->xoopsPath[$path])) {
221 $this->validPath[
$path] = 1;
223 $ret *= $this->validPath[
$path];
230 if (is_array(
$path)) {
231 foreach (array_keys(
$path) as $item) {
232 if (is_string($item)) {
234 if (empty(
$path[$item])) {
237 foreach (
$path[$item] as $child) {
257 'root' => array(
'mainfile.php',
'uploads', ),
'data' => $this->dataPath
260 'root' => null,
'data' => null,
263 if (!isset($this->xoopsPath[
$path])) {
266 if (!isset($errors[$path])) {
269 $this->
setPermission($this->xoopsPath[$path], $paths[$path], $errors[$path]);
270 if (in_array(
false, $errors[$path])) {
285 $mode = intval(
'0777', 8);
286 if (!file_exists(
$path)) {
293 if (!is_writable(
$path)) {
297 if (is_writable(
$path)) {
299 if (
$info[
'mode'] & 0002) {
301 } elseif (
$info[
'mode'] & 0020) {
$_SESSION['RF']["verify"]
if(empty($settings['ROOT_PATH'])) elseif(empty($settings['DB_PARAMETERS'])) $error
makeWritable($path, $create=true)
if(isset($_POST['name'])) $info
setPermission($parent, $path, &$error)
__construct($xoopsPathDefault, $dataPath)