fixing HTACCESS div bug + control on capacity to write/read htaccess and htpasswd
This commit is contained in:
parent
6c4674275b
commit
d7a2d40591
|
@ -71,18 +71,28 @@ class m_hta {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!file_exists($absolute)) {
|
if (!file_exists($absolute)) {
|
||||||
mkdir($absolute,00777);
|
@mkdir($absolute,00777);
|
||||||
}
|
}
|
||||||
if (!file_exists("$absolute/.htaccess")) {
|
if (!file_exists("$absolute/.htaccess")) {
|
||||||
touch("$absolute/.htaccess");
|
if (!@touch("$absolute/.htaccess")) {
|
||||||
$file = fopen("$absolute/.htaccess","r+");
|
$err->raise("hta",12);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$file = @fopen("$absolute/.htaccess","r+");
|
||||||
|
if (!$file) {
|
||||||
|
$err->raise("hta",12);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
fseek($file,0);
|
fseek($file,0);
|
||||||
$param="AuthUserFile $absolute/.htpasswd\nAuthName \"Zone Protégée\"\nAuthType Basic\nrequire valid-user\n";
|
$param="AuthUserFile $absolute/.htpasswd\nAuthName \"Zone Protégée\"\nAuthType Basic\nrequire valid-user\n";
|
||||||
fwrite($file, $param);
|
fwrite($file, $param);
|
||||||
fclose($file);
|
fclose($file);
|
||||||
}
|
}
|
||||||
if (!file_exists("$absolute/.htpasswd")) {
|
if (!file_exists("$absolute/.htpasswd")) {
|
||||||
touch("$absolute/.htpasswd");
|
if (!touch("$absolute/.htpasswd")) {
|
||||||
|
$err->raise("hta",12);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -376,6 +376,10 @@ msgstr "The user '%s' already exist for this folder"
|
||||||
msgid "err_hta_11"
|
msgid "err_hta_11"
|
||||||
msgstr "Please enter a valid username"
|
msgstr "Please enter a valid username"
|
||||||
|
|
||||||
|
#. Cannot write inside the requested folder. Please check your permissions
|
||||||
|
msgid "err_hta_12"
|
||||||
|
msgstr "Cannot write inside the requested folder. Please check your permissions."
|
||||||
|
|
||||||
#. Email Accounts
|
#. Email Accounts
|
||||||
msgid "quota_mail"
|
msgid "quota_mail"
|
||||||
msgstr "Email Accounts"
|
msgstr "Email Accounts"
|
||||||
|
|
|
@ -378,6 +378,10 @@ msgstr "L'utilisateur '%s' existe d
|
||||||
msgid "err_hta_11"
|
msgid "err_hta_11"
|
||||||
msgstr "Veuillez saisir un nom d'utilisateur valide"
|
msgstr "Veuillez saisir un nom d'utilisateur valide"
|
||||||
|
|
||||||
|
#. Cannot write inside the requested folder. Please check your permissions
|
||||||
|
msgid "err_hta_12"
|
||||||
|
msgstr "Impossible d'écrire dans le dossier concerné. Vérifiez vos permissions."
|
||||||
|
|
||||||
#. Email Accounts
|
#. Email Accounts
|
||||||
msgid "quota_mail"
|
msgid "quota_mail"
|
||||||
msgstr "Comptes emails"
|
msgstr "Comptes emails"
|
||||||
|
|
Loading…
Reference in New Issue