0, 'error' => 'Daten unvollständig' ] ) ); } require_once 'lib/ptcp_auth.class.php'; $PtcpAuth = new ParTCP_Authentications( $db ); $authId = base_convert( $_REQUEST['code'], 36, 10 ); $data = $PtcpAuth->get( $authId ); if ( empty( $data['met_by'] ) ){ die( json_encode( [ 'status' => 0, 'error' => 'Noch nicht authentifiziert' ] ) ); } $PtcpAuth->delete( $authId ); $user = $auth->get_by_name( $data['met_by'] ); if ( ! $user ){ $result = $auth->create_user( $data['met_by'], '', '', 1 ); if ( empty( $result['id'] ) ){ die( json_encode( [ 'status' => 0, 'error' => $result ] ) ); } $user = [ 'id' => $result['id'], 'username' => $data['met_by'], 'status' => 1 ]; } $_SESSION['user'] = $user; echo json_encode( [ 'status' => 1, 'error' => '' ] ); // end of file ajax/check_auth.php