Fix minor issues
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
459c9e0454
commit
47b01c6639
|
|
@ -131,7 +131,11 @@ class RegisterController extends Controller {
|
|||
);
|
||||
}
|
||||
|
||||
return new TemplateResponse('registration', 'form', ['email' => $registration->getEmail(), 'token' => $registration->getToken()], 'guest');
|
||||
return new TemplateResponse('registration', 'form', [
|
||||
'email' => $registration->getEmail(),
|
||||
'email_is_login' => $this->config->getAppValue('registration', 'email_is_login', '0') === '1',
|
||||
'token' => $registration->getToken(),
|
||||
], 'guest');
|
||||
} catch (RegistrationException $exception) {
|
||||
return $this->renderError($exception->getMessage(), $exception->getHint());
|
||||
}
|
||||
|
|
@ -147,7 +151,7 @@ class RegisterController extends Controller {
|
|||
public function createAccount($token) {
|
||||
$registration = $this->registrationService->getRegistrationForToken($token);
|
||||
if ($this->config->getAppValue('registration', 'email_is_login', '0') === '1') {
|
||||
$username = $registration->email;
|
||||
$username = $registration->getEmail();
|
||||
} else {
|
||||
$username = $this->request->getParam('username');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ use OCP\AppFramework\Db\Entity;
|
|||
*/
|
||||
class Registration extends Entity {
|
||||
public $id;
|
||||
public $email;
|
||||
protected $email;
|
||||
protected $username;
|
||||
protected $displayname;
|
||||
protected $password;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ script('registration', 'form');
|
|||
<img id="email-icon" class="svg" src="<?php print_unescaped(image_path('', 'actions/mail.svg')); ?>" alt=""/>
|
||||
</p>
|
||||
|
||||
<?php if ( \OC::$server->getConfig()->getAppValue('registration', 'email_is_login', '0') !== '1' ) { ?>
|
||||
<?php if ($_['email_is_login']) { ?>
|
||||
<p class="groupmiddle">
|
||||
<input type="text" name="username" id="username" value="<?php if (!empty($_['entered_data']['user'])) {
|
||||
p($_['entered_data']['user']);
|
||||
|
|
@ -31,7 +31,7 @@ script('registration', 'form');
|
|||
<label for="username" class="infield"><?php p($l->t('Username')); ?></label>
|
||||
<img id="username-icon" class="svg" src="<?php print_unescaped(image_path('', 'actions/user.svg')); ?>" alt=""/>
|
||||
</p>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<p class="groupbottom">
|
||||
<input type="password" name="password" id="password" placeholder="<?php p($l->t('Password')); ?>"/>
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ class RegisterControllerTest extends TestCase {
|
|||
$this->request,
|
||||
$this->l10n,
|
||||
$this->urlGenerator,
|
||||
$this->config,
|
||||
$this->registrationService,
|
||||
$this->mailService
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue