removed unnecesary functions
This commit is contained in:
@@ -240,130 +240,6 @@ class InstallerModule extends Controller
|
||||
return G::is_writable_r($path);
|
||||
}
|
||||
|
||||
public function getPermissionInfo()
|
||||
{
|
||||
$this->setResponseType('json');
|
||||
$info = new StdClass();
|
||||
$info->success = true;
|
||||
$noWritableFiles = [];
|
||||
$noWritable = G::LoadTranslation('ID_INDEX_NOT_WRITEABLE');
|
||||
$writable = G::LoadTranslation('ID_WRITEABLE');
|
||||
|
||||
// pathConfig
|
||||
$info->pathConfig = new stdclass();
|
||||
$info->pathConfig->message = $noWritable;
|
||||
$info->pathConfig->result = G::is_writable_r($_REQUEST['pathConfig'], $noWritableFiles);
|
||||
if ($info->pathConfig->result) {
|
||||
$info->pathConfig->message = $writable;
|
||||
} else {
|
||||
$info->success = false;
|
||||
}
|
||||
|
||||
$info->pathLanguages = new stdclass();
|
||||
$info->pathLanguages->message = $noWritable;
|
||||
$info->pathLanguages->result = G::is_writable_r($_REQUEST['pathLanguages'], $noWritableFiles);
|
||||
if ($info->pathLanguages->result) {
|
||||
$info->pathLanguages->message = $writable;
|
||||
} else {
|
||||
$info->success = false;
|
||||
}
|
||||
|
||||
$info->pathPlugins = new stdclass();
|
||||
$info->pathPlugins->message = $noWritable;
|
||||
$info->pathPlugins->result = G::is_writable_r($_REQUEST['pathPlugins'], $noWritableFiles);
|
||||
if ($info->pathPlugins->result) {
|
||||
$info->pathPlugins->message = $writable;
|
||||
} else {
|
||||
$info->success = false;
|
||||
}
|
||||
|
||||
$info->pathXmlforms = new stdclass();
|
||||
$info->pathXmlforms->message = $noWritable;
|
||||
$info->pathXmlforms->result = G::is_writable_r($_REQUEST['pathXmlforms'], $noWritableFiles);
|
||||
if ($info->pathXmlforms->result) {
|
||||
$info->pathXmlforms->message = $writable;
|
||||
} else {
|
||||
$info->success = false;
|
||||
}
|
||||
|
||||
$info->pathTranslations = new stdclass();
|
||||
G::verifyPath($_REQUEST['pathTranslations'], true);
|
||||
$info->pathTranslations->message = G::LoadTranslation('ID_TRANSLATION_NOT_WRITEABLE');
|
||||
$info->pathTranslations->result = G::is_writable_r($_REQUEST['pathTranslations'], $noWritableFiles);
|
||||
if ($info->pathTranslations->result) {
|
||||
$info->pathTranslations->message = $writable;
|
||||
} else {
|
||||
$info->success = false;
|
||||
}
|
||||
|
||||
$info->pathTranslationsMafe = new stdclass();
|
||||
G::verifyPath($_REQUEST['pathTranslationsMafe'], true);
|
||||
|
||||
$info->pathTranslationsMafe->message = G::LoadTranslation('ID_MAFE_TRANSLATION_NOT_WRITEABLE');
|
||||
$info->pathTranslationsMafe->result = G::is_writable_r($_REQUEST['pathTranslationsMafe'], $noWritableFiles);
|
||||
|
||||
if ($info->pathTranslationsMafe->result) {
|
||||
$info->pathTranslationsMafe->message = $writable;
|
||||
} else {
|
||||
$info->success = false;
|
||||
}
|
||||
|
||||
$info->pathPublic = new stdclass();
|
||||
|
||||
$info->pathPublic->message = $noWritable;
|
||||
$info->pathPublic->result = G::is_writable_r($_REQUEST['pathPublic'], $noWritableFiles);
|
||||
if ($info->pathPublic->result) {
|
||||
$info->pathPublic->message = $writable;
|
||||
} else {
|
||||
$info->success = false;
|
||||
}
|
||||
|
||||
$info->pathShared = new stdclass();
|
||||
$info->pathShared->message = $noWritable;
|
||||
$info->pathShared->result = G::is_writable_r($_REQUEST['pathShared'], $noWritableFiles);
|
||||
if ($info->pathShared->result) {
|
||||
$info->pathShared->message = $writable;
|
||||
} else {
|
||||
//Verify and create the shared path
|
||||
G::verifyPath($_REQUEST['pathShared'], true);
|
||||
$info->pathShared->result = G::is_writable_r($_REQUEST['pathShared'], $noWritableFiles);
|
||||
if ($info->pathShared->result) {
|
||||
$info->pathShared->message = $writable;
|
||||
} else {
|
||||
$info->success = false;
|
||||
}
|
||||
}
|
||||
$info->pathShared->result = $this->verifySharedFrameworkPaths($_REQUEST['pathShared']);
|
||||
|
||||
$filter = new InputFilter();
|
||||
$pathShared = $filter->validateInput($_REQUEST['pathShared'], 'path');
|
||||
|
||||
if ($info->pathShared->result) {
|
||||
$aux = pathinfo($_REQUEST['pathLogFile']);
|
||||
G::verifyPath($aux['dirname'], true);
|
||||
if (is_dir($aux['dirname'])) {
|
||||
if (!file_exists($_REQUEST['pathLogFile'])) {
|
||||
@file_put_contents($_REQUEST['pathLogFile'], '');
|
||||
@chmod($pathShared, 0770);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$info->pathLogFile = new stdclass();
|
||||
$info->pathLogFile->message = G::LoadTranslation('ID_CREATE_LOG_INSTALLATION');
|
||||
$info->pathLogFile->result = file_exists($_REQUEST['pathLogFile']);
|
||||
|
||||
if ($info->pathLogFile->result) {
|
||||
$info->pathLogFile->message = G::LoadTranslation('ID_INSTALLATION_FILE_LOG');
|
||||
}
|
||||
|
||||
$info->notify = $info->success ? G::LoadTranslation('ID_SUCCESS_DIRECTORIES_WRITABLE') : G::LoadTranslation('ID_DIRECTORIES_NOT_WRITABLE');
|
||||
|
||||
$info->noWritableFiles = $noWritableFiles;
|
||||
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test db connection
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user