fixed bugs
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,10 @@
|
||||
<?php
|
||||
// WorkorderCompanyController.php
|
||||
class PwaLoginController extends mfLoginController {
|
||||
public function apiLogin($username, $password, $code2fa, $remember) {
|
||||
return $this->performLogin($username, $password, $code2fa, $remember);
|
||||
}
|
||||
}
|
||||
|
||||
class WorkorderCompanyController extends WorkorderBaseController {
|
||||
protected string $headerTitle = 'Meine Arbeitsaufträge';
|
||||
@@ -18,6 +23,40 @@ class WorkorderCompanyController extends WorkorderBaseController {
|
||||
];
|
||||
protected array $additionalJSVariables = ['COMPANY_ID' => '0'];
|
||||
|
||||
public function loginOverride() {
|
||||
if (mfLoginController::isLoggedIn()) {
|
||||
$this->needlogin = true;
|
||||
return new User();
|
||||
}
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] !== 'POST') $this->redirect("/Dashboard");
|
||||
|
||||
$username = $_POST['Username'] ?? '';
|
||||
$password = $_POST['Password'] ?? '';
|
||||
$twoFactorCode = isset($_POST['TwofactorCode']) && is_numeric($_POST['TwofactorCode']) ? (int)$_POST['TwofactorCode'] : 'unset';
|
||||
$remember = ($_POST['Remember'] ?? null) === 'true';
|
||||
|
||||
$loginController = new PwaLoginController();
|
||||
$result = $loginController->apiLogin($username, $password, $twoFactorCode, $remember);
|
||||
|
||||
switch ($result) {
|
||||
case true:
|
||||
$response = ['status' => 'success'];
|
||||
break;
|
||||
case '2fa':
|
||||
$response = ['status' => '2fa_required'];
|
||||
break;
|
||||
case 'false2fa':
|
||||
$response = ['status' => 'invalid_2fa', 'message' => 'Verifizierungscode falsch oder abgelaufen.'];
|
||||
break;
|
||||
default:
|
||||
$response = ['status' => 'error', 'message' => 'Benutzername oder Passwort ist falsch.'];
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
exit(json_encode($response));
|
||||
}
|
||||
|
||||
protected function prepareCrudConfig() {
|
||||
$preorderInfoColIdx = array_search('preorderInfo', array_column($this->columns, 'key'));
|
||||
array_splice($this->columns, $preorderInfoColIdx + 1, 0, [$this->statusColumn]);
|
||||
|
||||
BIN
public/assets/images/xinon-full-transparent.png
Normal file
BIN
public/assets/images/xinon-full-transparent.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 67 KiB |
Reference in New Issue
Block a user