Skip to content

Commit

Permalink
2.11.20 Adding view account profile
Browse files Browse the repository at this point in the history
  • Loading branch information
webpwnized committed Sep 30, 2024
1 parent 1bce9ea commit ffa5ee3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/set-up-database.php
Original file line number Diff line number Diff line change
Expand Up @@ -1294,17 +1294,21 @@ function format($pMessage, $pLevel) {

// XML File Writing
try {
file_put_contents($lAccountXMLFilePath, $lAccountsXML);
echo format("Wrote accounts to " . $lAccountXMLFilePath, "S");
if (is_writable(pathinfo($lAccountXMLFilePath, PATHINFO_DIRNAME))) {
file_put_contents($lAccountXMLFilePath, $lAccountsXML);
echo format("Wrote accounts to " . $lAccountXMLFilePath, "S");
}
} catch (Exception $e) {
echo format("Could not write accounts XML to " . $lAccountXMLFilePath . " - " . $e->getMessage(), "W");
echo format("Using default version of accounts.xml", "W");
}

// Text File Writing
try {
file_put_contents($lPasswordFilePath, $lAccountsText);
echo format("Wrote accounts to " . $lPasswordFilePath, "S");
if (is_writable(pathinfo($lPasswordFilePath, PATHINFO_DIRNAME))) {
file_put_contents($lPasswordFilePath, $lAccountsText);
echo format("Wrote accounts to " . $lPasswordFilePath, "S");
}
} catch (Exception $e) {
echo format("Could not write accounts text to " . $lPasswordFilePath . " - " . $e->getMessage(), "W");
echo format("Using default version of accounts.txt", "W");
Expand Down

0 comments on commit ffa5ee3

Please sign in to comment.