mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
error handling
This commit is contained in:
@@ -19,32 +19,51 @@ if ($_POST['database_check'] ?? false == true) {
|
||||
*/
|
||||
|
||||
// config_file()
|
||||
// if ($core->validate_post($_POST) == true) {
|
||||
|
||||
if ($_POST['run_config_file'] ?? false == true) {
|
||||
sleep(1);
|
||||
$data = json_decode($_POST['data'], true);
|
||||
$result = $core->write_configfile($data);
|
||||
echo $result ? 'success' : 'error';
|
||||
if ($core->validate_post($data)) {
|
||||
if($core->write_configfile($data)) {
|
||||
$result = 'success';
|
||||
} else {
|
||||
$result = 'error';
|
||||
}
|
||||
} else {
|
||||
$result = 'error';
|
||||
}
|
||||
echo $result;
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($_POST['run_database_file'] ?? false == true) {
|
||||
sleep(1);
|
||||
$data = json_decode($_POST['data'], true);
|
||||
$result = $core->write_config($data);
|
||||
echo $result ? 'success' : 'error';
|
||||
if ($core->validate_post($data)) {
|
||||
if($core->write_config($data)) {
|
||||
$result = 'success';
|
||||
} else {
|
||||
$result = 'error';
|
||||
}
|
||||
} else {
|
||||
$result = 'error';
|
||||
}
|
||||
echo $result;
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($_POST['run_database_tables'] ?? false == true) {
|
||||
$data = json_decode($_POST['data'], true);
|
||||
$result = $database->create_tables($data);
|
||||
if ($core->validate_post($data)) {
|
||||
$result = $database->create_tables($data);
|
||||
} else {
|
||||
$result = 'error';
|
||||
}
|
||||
echo $result ? 'success' : 'error';
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($_POST['run_installer_lock'] ?? false) {
|
||||
if ($_POST['run_installer_lock'] ?? false == true) {
|
||||
exec('touch .lock', $output, $return_var);
|
||||
if ($return_var === 0 && file_exists('.lock')) {
|
||||
echo 'success';
|
||||
@@ -53,6 +72,3 @@ if ($_POST['run_installer_lock'] ?? false) {
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
// }
|
||||
Reference in New Issue
Block a user