PUSHPROD settings v 0.1
This commit is contained in:
@@ -145,15 +145,16 @@ function saveSettings()
|
|||||||
|
|
||||||
// chmod($fullConfPath, 0755);
|
// chmod($fullConfPath, 0755);
|
||||||
|
|
||||||
if(file_exists( $fullConfPath) == 1)
|
if(file_exists( $fullConfPath) != 1)
|
||||||
{
|
{
|
||||||
|
echo 'File "'.$fullConfPath.'" not found or missing read permissions. Creating a new <code>pialert.conf</code> file.';
|
||||||
|
}
|
||||||
// create a backup copy
|
// create a backup copy
|
||||||
if (!copy($fullConfPath, $new_location))
|
elseif (!copy($fullConfPath, $new_location))
|
||||||
{
|
{
|
||||||
echo "Failed to copy file ".$fullConfPath." to ".$new_location." <br/> Check your permissions to allow read/write access to the /config folder.";
|
echo "Failed to copy file ".$fullConfPath." to ".$new_location." <br/> Check your permissions to allow read/write access to the /config folder.";
|
||||||
}
|
}
|
||||||
{
|
|
||||||
echo "Backup of original pialert.conf created: <code>".$new_name."</code><br/>";
|
|
||||||
|
|
||||||
// generate a clean pialert.conf file
|
// generate a clean pialert.conf file
|
||||||
$groups = [];
|
$groups = [];
|
||||||
@@ -222,10 +223,8 @@ function saveSettings()
|
|||||||
fwrite($newConfig, $txt);
|
fwrite($newConfig, $txt);
|
||||||
fclose($newConfig);
|
fclose($newConfig);
|
||||||
|
|
||||||
}
|
echo "<br/>Settings saved to the <code>pialert.conf</code> file. Backup of pialert.conf created: <code>".$new_name."</code>.
|
||||||
} else {
|
<br/><b>Restart the container for the chanegs to take effect.</b>";
|
||||||
echo 'File "'.$fullConfPath.'" not found or missing read permissions.';
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -312,7 +311,4 @@ function setCache($key, $value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ $db->close();
|
|||||||
success: function(data, textStatus) {
|
success: function(data, textStatus) {
|
||||||
// $("#result").html(data);
|
// $("#result").html(data);
|
||||||
console.log(data);
|
console.log(data);
|
||||||
showModalDefault ('Result', data + "<br/><b>Restart the container for the chanegs to take effect.</b>");
|
showModalDefault ('Result', data );
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user