]> source.dussan.org Git - nextcloud-server.git/commitdiff
initialize l10n instance earlier, fixes an undefined var warning followed by a php...
authorArthur Schiwon <blizzz@owncloud.com>
Thu, 17 Dec 2015 14:01:21 +0000 (15:01 +0100)
committerArthur Schiwon <blizzz@owncloud.com>
Thu, 17 Dec 2015 14:08:15 +0000 (15:08 +0100)
settings/changepassword/controller.php

index 695914683dbb85e439dd577f841c32c2fa23573b..f5b9bd58b5900252bafb48aca5b159fae83f487e 100644 (file)
@@ -55,10 +55,10 @@ class Controller {
                \OC_JSON::callCheck();
                \OC_JSON::checkLoggedIn();
 
+               $l = new \OC_L10n('settings');
                if (isset($_POST['username'])) {
                        $username = $_POST['username'];
                } else {
-                       $l = new \OC_L10n('settings');
                        \OC_JSON::error(array('data' => array('message' => $l->t('No user supplied')) ));
                        exit();
                }
@@ -78,7 +78,6 @@ class Controller {
                } elseif ($isUserAccessible) {
                        $userstatus = 'subadmin';
                } else {
-                       $l = new \OC_L10n('settings');
                        \OC_JSON::error(array('data' => array('message' => $l->t('Authentication error')) ));
                        exit();
                }
@@ -122,7 +121,6 @@ class Controller {
                                $validRecoveryPassword = $keyManager->checkRecoveryPassword($recoveryPassword);
                                $recoveryEnabledForUser = $recovery->isRecoveryEnabledForUser($username);
                        }
-                       $l = new \OC_L10n('settings');
 
                        if ($recoveryEnabledForUser && $recoveryPassword === '') {
                                \OC_JSON::error(array('data' => array(