Browse Source

rename method name

main
ghost 3 years ago
parent
commit
2fdd59338c
  1. 3
      src/application/controller/login.php
  2. 2
      src/application/controller/register.php
  3. 2
      src/application/model/user.php

3
src/application/controller/login.php

@ -61,7 +61,7 @@ if (isset($_POST) && $_POST) { @@ -61,7 +61,7 @@ if (isset($_POST) && $_POST) {
if (!$errorUserName && !$errorUserPrivateKey) {
// Check user exists
if ($_modelUser->userNameExists($userName)) {
if ($userId = $_modelUser->getUserId($userName)) {
if ($_twister->importWallet($userName, $userPrivateKey)) {
@ -78,6 +78,7 @@ if (isset($_POST) && $_POST) { @@ -78,6 +78,7 @@ if (isset($_POST) && $_POST) {
session_start();
$_SESSION['userName'] = $userName;
$_SESSION['userId'] = $userId;
// Redirect
header('Location: ' . PROJECT_HOST, true, 302);

2
src/application/controller/register.php

@ -57,7 +57,7 @@ if (isset($_POST) && $_POST) { @@ -57,7 +57,7 @@ if (isset($_POST) && $_POST) {
$errorUserName = _('Username required.');
}
if ($_modelUser->userNameExists($userName)) {
if ($_modelUser->getUserId($userName)) {
$errorUserName = _('Username already taken.');
}

2
src/application/model/user.php

@ -54,7 +54,7 @@ class ModelUser extends Model { @@ -54,7 +54,7 @@ class ModelUser extends Model {
}
}
public function userNameExists(string $userName) {
public function getUserId(string $userName) {
try {

Loading…
Cancel
Save