13include_once
'../mainfile.php';
15$writeok = [
'cache/',
'templates_c/',
'uploads/',
'uploads/xupdate/',
'modules/protector/configs/' ];
20foreach ( $writeok as $wok ) {
23 is_dir( XOOPS_TRUST_PATH.
'/'.$wok) || (mkdir(XOOPS_TRUST_PATH.
'/'.$wok, 0777,
true) && is_dir(XOOPS_TRUST_PATH.
'/'.$wok));
25 $permissions = fileperms(XOOPS_TRUST_PATH.
'/'.$wok);
27 if (XOOPS_TRUST_PATH.
'/'.$wok && is_writable(XOOPS_TRUST_PATH.
'/'.$wok)) {
28 $tempFile = tempnam(XOOPS_TRUST_PATH.
'/'.$wok,
'tmp');
29 if ($tempFile !==
false) {
30 $res = file_put_contents($tempFile,
'test');
31 $wokWritable = $res !==
false;
33 $fperm = substr(sprintf(
'%o', $permissions), -4);
34 $wizard->addArray(
'checks', _OKIMG .
'<code>' .$fperm.
'</code><code>'.$wok.
'</code> ' . sprintf(_INSTALL_L86,
'<p class="data">'.XOOPS_TRUST_PATH.
'/'.$wok.
'</p>') );
36 $fperm = substr(sprintf(
'%o', $permissions), -4);
37 $wizard->addArray(
'checks', _NGIMG .
'<code>' .$fperm.
'</code><code>'.$wok.
'</code> ' . sprintf(_INSTALL_L85,
'<p class="data"><code style="color:#ff6633">'.XOOPS_TRUST_PATH.
'/'.$wok.
'</p>') );
44 $wizard->assign(
'message',
'<div class="confirmOk">'. _INSTALL_L87 .
'</div>' );
46 $wizard->assign(
'message',
'<div class="confirmError">'. _INSTALL_L46 .
'</div>' );
47 $wizard->setReload(
true );
50$wizard->render(
'install_modcheck.tpl.php' );