Hallöchen,
hat sich hier in Richtung WBB 4 etwas verändert? Ich bekomme beim WCS 3 immer einen Fehler wenn ich versuche mich mit der C# Anwendung einzuloggen.
PHP
<?php
require_once('global.php');
use wcf\data\user\User;
$json = null;
$code = 0;
checkPassword($_POST['Username'], $_POST['Password']);
function checkPassword($username, $password) {
if (empty($username)) {
global $code;
$code = 2;
return null;
} elseif (empty($password)) {
global $code;
$code = 2;
return null;
}
$user = User::getUserByUsername($username);
if (!$user->checkPassword($password)) {
global $code;
$code = 32;
return null;
}
else {
global $code;
global $json;
$code = 1;
$json = ["StatusCode" => $code, "UserData" => ["userID" => $user->userID, "username" => $user->username, "banned" => (bool)$user->banned, "banReason" => $user->banReason, "activityPoints" => $user->activityPoints, "likesReceived" => $user->likesReceived]];
return null;
}
}
if($code != 1)
{
echo json_encode(["StatusCode" => $code, "UserData" => []]);
}
else
{
echo json_encode($json);
}
?>
Alles anzeigen