fp-content file/folder permissions recursively during setup

- Update chmod info in the administration area
- fp-content gets the necessary permissions recursively during setup
This commit is contained in:
Fraenkiman 2023-10-19 00:07:54 +02:00
parent 43dcd8bc33
commit 687482c76e
12 changed files with 42 additions and 13 deletions

View File

@ -15,7 +15,7 @@
'opt5' => 'Zjistit aktualizace',
'chmod_info' => "Následující oprávnění <strong>nemůžou být</strong>
resetované na 0777; pravděpodobně vlastník souborů není stejná osoba jako vlastník webu. Případně můžete ignorovat toto oznámení.",
resetované na 0775; pravděpodobně vlastník souborů není stejná osoba jako vlastník webu. Případně můžete ignorovat toto oznámení.",
);

View File

@ -12,7 +12,7 @@ $lang ['admin'] ['maintain'] ['default'] = array(
'opt5' => 'Prüfe auf neue Versionen',
'chmod_info' => "Die Dateizugriffsrechte <strong>konnten nicht</strong>
auf die Default Werte von 0777 zurückgesetzt werden.
auf die Default Werte von 0775 zurückgesetzt werden.
Normalerweise kann man diesen Hinweis ignorieren."
);

View File

@ -15,7 +15,7 @@
'opt5' => 'Έλεγχος για αναβαθμίσεις',
'chmod_info' => "Τα ακόλουθα δικαιώματα αρχείων <strong>δεν μπόρεσαν</strong>
να επανέλθουν σε 0777; πιθανότατα ο ιδιοκτήτης των αρχείων δεν είναι ο ίδιος με τον ιδιοκτήτη του διακομιστή. Συνήθως αυτή η ειδοποίηση μπορεί να αγνοηθεί.",
να επανέλθουν σε 0775; πιθανότατα ο ιδιοκτήτης των αρχείων δεν είναι ο ίδιος με τον ιδιοκτήτη του διακομιστή. Συνήθως αυτή η ειδοποίηση μπορεί να αγνοηθεί.",
);

View File

@ -15,7 +15,7 @@
'opt5' => 'Check for updates',
'chmod_info' => "The following file permissions <strong>could not</strong>
be reset to 0777; probably file owner is not the same as the
be reset to 0775; probably file owner is not the same as the
webserver's. Usually you can ignore this notice.",
);

View File

@ -15,7 +15,7 @@
'opt5' => 'Buscar actualizaciones',
'chmod_info' => "Los siguientes permisos de archivo <strong>no pudieron</strong>
ser reiniciados a 0777; probablemente el propietario del archivo no sea el mismo que el
ser reiniciados a 0775; probablemente el propietario del archivo no sea el mismo que el
del servidor web. Por lo general, puede ignorar este aviso.",
);

View File

@ -13,7 +13,7 @@
'opt5' => 'V&eacute;rifier les mises &agrave; jour',
'chmod_info' => "Les permissions de fichiers (chmod) <strong>ne sont peut-&ecirc;tre pas</strong>
&agrave; 0777; propri&eacute;taire du fichier peut-&ecirc;tre diff&eacute;rent du serveur web.",
&agrave; 0775; propri&eacute;taire du fichier peut-&ecirc;tre diff&eacute;rent du serveur web.",
);

View File

@ -15,7 +15,7 @@
'opt5' => 'Controllo aggiornamenti',
'chmod_info' => "I seguenti permessi dei file <strong>non possono</strong>
essere ripristinati a 0777; probabilmente il proprietario non è lo stesso del
essere ripristinati a 0775; probabilmente il proprietario non è lo stesso del
server web. Di solito puoi ignorare questo avviso.",
);

View File

@ -14,7 +14,7 @@
'opt4' => 'PHP情報を表示します',
'opt5' => 'アップデートをチェックします',
'chmod_info' => "次のファイルのパーミッションを 0777 にリセット<strong>できません</strong>
'chmod_info' => "次のファイルのパーミッションを 0775 にリセット<strong>できません</strong>
; おそらく、ファイルの所有権者とウェブサーバの権限が異なるのでしょう。
でも通常、この通知を無視することができます。",

View File

@ -15,7 +15,7 @@
'opt5' => 'Controleren op updates',
'chmod_info' => "De volgende bestandsmachtigingen <strong>kan niet</strong>
worden teruggezet naar 0777; waarschijnlijk is de bestandseigenaar niet hetzelfde als de
worden teruggezet naar 0775; waarschijnlijk is de bestandseigenaar niet hetzelfde als de
webserver's. Meestal kunt u deze kennisgeving negeren.",
);

View File

@ -13,7 +13,7 @@
'opt4' => 'Mostre as informações sobre o PHP',
'opt5' => 'Procure atualizações',
'chmod_info' => "As seguintes permissões de arquivo <strong>não puderam</strong> ser redefinidas para 0777; provavelmente o proprietário do arquivo não é o mesmo do servidor da web. Geralmente você pode ignorar este aviso.",
'chmod_info' => "As seguintes permissões de arquivo <strong>não puderam</strong> ser redefinidas para 0775; provavelmente o proprietário do arquivo não é o mesmo do servidor da web. Geralmente você pode ignorar este aviso.",
);

View File

@ -14,7 +14,7 @@
'opt5' => 'Preveri posodobitve',
'chmod_info' => "Naslednja dovoljenja za datoteke <strong>ni mogoče</strong>
povrniti na 0777; verjetno lastnik datoteke ni isti kot
povrniti na 0775; verjetno lastnik datoteke ni isti kot
spletne strežnik. Običajno lahko to obvestilo prezrete.",
);

View File

@ -1,8 +1,37 @@
<?php
error_reporting($_SERVER ["SERVER_NAME"] == "localhost" ? E_ALL : 0);
chmod("./fp-content/", 0775);
$language = @$_POST ['language']? $_POST ['language'] : $browserLang;
// Changing file/directory permissions recursively
$start_dir = FP_CONTENT; // Starting directory
$perms ['file'] = FILE_PERMISSIONS; // chmod value for files
$perms ['folder'] = DIR_PERMISSIONS; // chmod value for folders
function chmod_file_folder($dir) {
global $perms;
$dh = @opendir($dir);
if ($dh) {
while (false !== ($file = readdir($dh))) {
if ($file != "." && $file != "..") {
$fullpath = $dir . '/' . $file;
if (!is_dir($fullpath)) {
chmod($fullpath, $perms ['file']);
} else {
chmod($fullpath, $perms ['folder']);
chmod_file_folder($fullpath);
}
}
}
closedir($dh);
}
}
$language = @$_POST ['language'] ?$_POST ['language'] : $browserLang;
$lf = "lang.$language.php";
if (!preg_match('|^lang\.[a-z]{2}-[a-z]{2}\.php$|', $lf))