Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
More audit logs.
James Cole09c18d6d443a
diff --git a/app/Rules/IsValidAmount.php b/app/Rules/IsValidAmount.phpindex 3f0c8041b0..33ae06df42 100644--- a/app/Rules/IsValidAmount.php+++ b/app/Rules/IsValidAmount.php@@ -22,24 +22,27 @@ class IsValidAmount implements ValidationRule// must not be empty:if($this->emptyString($value)) {$fail('validation.filled')->translate();- Log::info(sprintf('IsValidAmount: "%s" cannot be empty.', $value));-+ $message = sprintf('IsValidAmount: "%s" cannot be empty.', $value);+ Log::info($message);+ Log::channel('audit')->info($message);return;}// must be a number:if(!$this->isValidNumber($value)) {$fail('validation.numeric')->translate();- Log::info(sprintf('IsValidAmount: "%s" is not a number.', $value));-+ $message = sprintf('IsValidAmount: "%s" is not a number.', $value);+ Log::info($message);+ Log::channel('audit')->info($message);return;}// must not be scientific notation:if($this->scientificNumber($value)) {$fail('validation.scientific_notation')->translate();- Log::info(sprintf('IsValidAmount: "%s" cannot be in the scientific notation.', $value));-+ $message = sprintf('IsValidAmount: "%s" cannot be in the scientific notation.', $value);+ Log::info($message);+ Log::channel('audit')->info($message);return;}@@ -47,15 +50,18 @@ class IsValidAmount implements ValidationRuleif($this->lessThanLots($value)) {$amount = bcmul('-1', self::BIG_AMOUNT);$fail('validation.gte.numeric')->translate(['value' => $amount]);- Log::info(sprintf('IsValidAmount: "%s" must be more than %s.', $value, $amount));-+ $message = sprintf('IsValidAmount: "%s" must be more than %s.', $value, $amount);+ Log::info($message);+ Log::channel('audit')->info($message);return;}// must be less than 100 million and 1709:if($this->moreThanLots($value)) {- Log::info(sprintf('IsValidPositiveAmount: "%s" must be more than %s.', $value, self::BIG_AMOUNT));$fail('validation.lte.numeric')->translate(['value' => self::BIG_AMOUNT]);+ $message = sprintf('IsValidAmount: "%s" must be more than %s.', $value, self::BIG_AMOUNT);+ Log::info($message);+ Log::channel('audit')->info($message);}Log::info(sprintf('IsValidAmount: "%s" is a valid positive amount.', $value));}diff --git a/app/Rules/IsValidPositiveAmount.php b/app/Rules/IsValidPositiveAmount.phpindex 8d25f06780..2f65a1162e 100644--- a/app/Rules/IsValidPositiveAmount.php+++ b/app/Rules/IsValidPositiveAmount.php@@ -21,37 +21,43 @@ class IsValidPositiveAmount implements ValidationRule// must not be empty:if($this->emptyString($value)) {$fail('validation.filled')->translate();- Log::info(sprintf('IsValidPositiveAmount: "%s" cannot be empty.', $value));-+ $message = sprintf('IsValidPositiveAmount: "%s" cannot be empty.', $value);+ Log::info($message);+ Log::channel('audit')->info($message);return;}// must be a number:if(!$this->isValidNumber($value)) {$fail('validation.numeric')->translate();- Log::info(sprintf('IsValidPositiveAmount: "%s" is not a number.', $value));-+ $message = sprintf('IsValidPositiveAmount: "%s" is not a number.', $value);+ Log::info($message);+ Log::channel('audit')->info($message);return;}// must not be scientific notation:if($this->scientificNumber($value)) {$fail('validation.scientific_notation')->translate();- Log::info(sprintf('IsValidPositiveAmount: "%s" cannot be in the scientific notation.', $value));-+ $message = sprintf('IsValidPositiveAmount: "%s" cannot be in the scientific notation.', $value);+ Log::info($message);+ Log::channel('audit')->info($message);return;}// must be more than zero:if($this->lessOrEqualToZero($value)) {$fail('validation.more_than_zero')->translate();- Log::info(sprintf('IsValidPositiveAmount: "%s" must be more than zero.', $value));-+ $message = sprintf('IsValidPositiveAmount: "%s" must be more than zero.', $value);+ Log::info($message);+ Log::channel('audit')->info($message);return;}// must be less than 100 million and 1709:if($this->moreThanLots($value)) {- Log::info(sprintf('IsValidPositiveAmount: "%s" must be less than %s.', $value, self::BIG_AMOUNT));$fail('validation.lte.numeric')->translate(['value' => self::BIG_AMOUNT]);+ $message = sprintf('IsValidPositiveAmount: "%s" must be less than %s.', $value, self::BIG_AMOUNT);+ Log::info($message);+ Log::channel('audit')->info($message);}- Log::info(sprintf('IsValidPositiveAmount: "%s" is a valid positive amount.', $value));+ Log::debug(sprintf('IsValidPositiveAmount: "%s" is a valid positive amount.', $value));}}