]> source.dussan.org Git - nextcloud-server.git/commitdiff
Don't log the user password in case something goes wrong 2306/head
authorJoas Schilling <coding@schilljs.com>
Thu, 24 Nov 2016 12:58:03 +0000 (13:58 +0100)
committerJoas Schilling <coding@schilljs.com>
Thu, 24 Nov 2016 12:58:03 +0000 (13:58 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/admin_audit/lib/actions/action.php
apps/admin_audit/lib/actions/auth.php

index 0525910f8ddcd112b41721a7fbcb57eb9b5aa900..2d0366758693fb508fba04e9c17d987346807bc8 100644 (file)
@@ -41,18 +41,28 @@ class Action {
         * @param string $text
         * @param array $params
         * @param array $elements
+        * @param bool $obfuscateParameters
         */
        public function log($text,
                                                array $params,
-                                               array $elements) {
+                                               array $elements,
+                                               $obfuscateParameters = false) {
                foreach($elements as $element) {
                        if(!isset($params[$element])) {
-                               $this->logger->critical(
-                                       sprintf(
-                                               '$params["'.$element.'"] was missing. Transferred value: %s',
-                                               print_r($params, true)
-                                       )
-                               );
+                               if ($obfuscateParameters) {
+                                       $this->logger->critical(
+                                               '$params["'.$element.'"] was missing.',
+                                               ['app' => 'admin_audit']
+                                       );
+                               } else {
+                                       $this->logger->critical(
+                                               sprintf(
+                                                       '$params["'.$element.'"] was missing. Transferred value: %s',
+                                                       print_r($params, true)
+                                               ),
+                                               ['app' => 'admin_audit']
+                                       );
+                               }
                                return;
                        }
                }
index c035cf785fe04d051a6182c299fd0a29a5f38e80..405ea5e6d22d62dbd13b58905fe1aeb08200b499 100644 (file)
@@ -34,7 +34,8 @@ class Auth extends Action {
                        $params,
                        [
                                'uid',
-                       ]
+                       ],
+                       true
                );
        }
 
@@ -44,7 +45,8 @@ class Auth extends Action {
                        $params,
                        [
                                'uid',
-                       ]
+                       ],
+                       true
                );
        }