mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 13:24:24 +00:00
app api fix
This commit is contained in:
@@ -31,16 +31,16 @@ module.exports = ( app ) => {
|
||||
pwHandler.checkpassword( req.body.email, req.body.password ).then( status => {
|
||||
if ( status ) {
|
||||
if ( status.status ) {
|
||||
db.getDataSimple( 'orders', 'order_name', req.body.ticketID.slice( 0, req.body.ticketID.indexOf( '_' ) ) ).then( dat => {
|
||||
db.getDataSimple( 'orders', 'order_name', req.body.ticketID.slice( 0, req.body.ticketID.lastIndexOf( '_' ) ) ).then( dat => {
|
||||
if ( dat[ 0 ] ) {
|
||||
const tickets = JSON.parse( dat[ 0 ][ 'tickets' ] );
|
||||
const event = req.body.ticketID.slice( req.body.ticketID.indexOf( '_' ) + 1, req.body.ticketID.indexOf( '-' ) );
|
||||
const ticket = req.body.ticketID.slice( req.body.ticketID.indexOf( '-' ) + 1, req.body.ticketID.length );
|
||||
const event = req.body.ticketID.slice( req.body.ticketID.lastIndexOf( '_' ) + 1, req.body.ticketID.lastIndexOf( '-' ) );
|
||||
const ticket = req.body.ticketID.slice( req.body.ticketID.lastIndexOf( '-' ) + 1, req.body.ticketID.length );
|
||||
if ( tickets[ event ] ) {
|
||||
if ( tickets[ event ][ ticket ] ) {
|
||||
if ( !tickets[ event ][ ticket ][ 'invalidated' ] ) {
|
||||
tickets[ event ][ ticket ][ 'invalidated' ] = true;
|
||||
db.writeDataSimple( 'orders', 'order_name', req.body.ticketID.slice( 0, req.body.ticketID.indexOf( '_' ) ), { 'tickets': JSON.stringify( tickets ) } );
|
||||
db.writeDataSimple( 'orders', 'order_name', req.body.ticketID.slice( 0, req.body.ticketID.lastIndexOf( '_' ) ), { 'tickets': JSON.stringify( tickets ) } );
|
||||
res.send( 'ticketValid' );
|
||||
} else {
|
||||
res.send( 'ticketInvalid' );
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"setupDone":true,
|
||||
"twoFA":"enforce",
|
||||
"twoFAMode":"enhanced",
|
||||
"db":"json",
|
||||
"db":"mysql",
|
||||
"payments":"stripe",
|
||||
"name":"libreevent",
|
||||
"yourDomain":"http://localhost:8080",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -14,6 +14,7 @@
|
||||
<div v-else-if="contentType === 'text'" class="options">
|
||||
<h3>{{ data.message }}</h3>
|
||||
<input type="text" v-model="data.selected">
|
||||
<p>{{ info }}</p>
|
||||
<div class="button-wrapper">
|
||||
<button @click="closePopup( 'ok' )" title="Save changes">Save</button>
|
||||
<button @click="closePopup( 'cancel' )" title="Cancel changes">Cancel</button>
|
||||
@@ -108,10 +109,19 @@
|
||||
return {
|
||||
contentType: 'dropdown',
|
||||
data: {},
|
||||
info: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
closePopup( message ) {
|
||||
if ( this.data.options.disallowedCharacters ) {
|
||||
for ( let letter in this.data.selected ) {
|
||||
if ( this.data.options.disallowedCharacters.includes( this.data.selected[ letter ] ) ) {
|
||||
this.info = `Illegal character "${ this.data.selected[ letter ] }"`;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
$( '#popup-backdrop' ).fadeOut( 300 );
|
||||
if ( message ) {
|
||||
this.$emit( 'data', { 'data': this.data.selected, 'status': message } );
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
},
|
||||
addEvent () {
|
||||
this.currentPopup = 'add';
|
||||
this.$refs.popup.openPopup( 'Please give the new event a name for internal use', {}, 'text' );
|
||||
this.$refs.popup.openPopup( 'Please give the new event a name for internal use', { 'disallowedCharacters': [ '_', '-' ] }, 'text' );
|
||||
},
|
||||
setActiveTicket ( id ) {
|
||||
sessionStorage.setItem( 'selectedTicket', id );
|
||||
|
||||
Reference in New Issue
Block a user