]> source.dussan.org Git - nextcloud-server.git/commitdiff
Merge branch 'master' into rename-lostpassword-controller
authorThomas Müller <thomas.mueller@tmit.eu>
Wed, 4 Sep 2013 18:46:32 +0000 (20:46 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Wed, 4 Sep 2013 18:46:32 +0000 (20:46 +0200)
Conflicts:
core/lostpassword/controller.php

1  2 
core/lostpassword/controller.php

index 66e4de5f54c2d1396c87356d3421e9aba45e0f0d,f761e45d25f98ac894b07a6d9fa119980ba82672..3c8099591a111891c2d9a58fbfe4134207c05a59
@@@ -42,26 -41,26 +42,26 @@@ class Controller 
                        $continue = false;
                }
  
 -              if (OC_User::userExists($_POST['user']) && $continue) {
 -                      $token = hash('sha256', OC_Util::generateRandomBytes(30).OC_Config::getValue('passwordsalt', ''));
 -                      OC_Preferences::setValue($_POST['user'], 'owncloud', 'lostpassword',
 +              if (\OC_User::userExists($_POST['user']) && $continue) {
-                       $token = hash('sha256', \OC_Util::generate_random_bytes(30).\OC_Config::getValue('passwordsalt', ''));
++                      $token = hash('sha256', \OC_Util::generateRandomBytes(30).\OC_Config::getValue('passwordsalt', ''));
 +                      \OC_Preferences::setValue($_POST['user'], 'owncloud', 'lostpassword',
                                hash('sha256', $token)); // Hash the token again to prevent timing attacks
 -                      $email = OC_Preferences::getValue($_POST['user'], 'settings', 'email', '');
 +                      $email = \OC_Preferences::getValue($_POST['user'], 'settings', 'email', '');
                        if (!empty($email)) {
 -                              $link = OC_Helper::linkToRoute('core_lostpassword_reset',
 +                              $link = \OC_Helper::linkToRoute('core_lostpassword_reset',
                                        array('user' => $_POST['user'], 'token' => $token));
 -                              $link = OC_Helper::makeURLAbsolute($link);
 +                              $link = \OC_Helper::makeURLAbsolute($link);
  
 -                              $tmpl = new OC_Template('core/lostpassword', 'email');
 +                              $tmpl = new \OC_Template('core/lostpassword', 'email');
                                $tmpl->assign('link', $link, false);
                                $msg = $tmpl->fetchPage();
 -                              $l = OC_L10N::get('core');
 -                              $from = OCP\Util::getDefaultEmailAddress('lostpassword-noreply');
 +                              $l = \OC_L10N::get('core');
 +                              $from = \OCP\Util::getDefaultEmailAddress('lostpassword-noreply');
                                try {
 -                                      $defaults = new OC_Defaults();
 -                                      OC_Mail::send($email, $_POST['user'], $l->t('%s password reset', array($defaults->getName())), $msg, $from, $defaults->getName());
 +                                      $defaults = new \OC_Defaults();
 +                                      \OC_Mail::send($email, $_POST['user'], $l->t('%s password reset', array($defaults->getName())), $msg, $from, $defaults->getName());
                                } catch (Exception $e) {
 -                                      OC_Template::printErrorPage( 'A problem occurs during sending the e-mail please contact your administrator.');
 +                                      \OC_Template::printErrorPage( 'A problem occurs during sending the e-mail please contact your administrator.');
                                }
                                self::displayLostPasswordPage(false, true);
                        } else {