mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 05:14:23 +00:00
add root accounts
This commit is contained in:
@@ -88,6 +88,16 @@ class GETHandler {
|
|||||||
resolve( this.settings.currency );
|
resolve( this.settings.currency );
|
||||||
} else if ( call === 'getAdminAccounts' ) {
|
} else if ( call === 'getAdminAccounts' ) {
|
||||||
db.getData( 'admin' ).then( data => {
|
db.getData( 'admin' ).then( data => {
|
||||||
|
if ( data[ 0 ] ) {
|
||||||
|
resolve( { 'data': data, 'status': 'ok' } );
|
||||||
|
} else {
|
||||||
|
resolve( { 'data': {}, 'status': 'empty' } );
|
||||||
|
}
|
||||||
|
} ).catch( err => {
|
||||||
|
reject( { 'code': 500, 'message': 'ERR_DB: ' + err } );
|
||||||
|
} );
|
||||||
|
} else if ( call === 'getRootAccountDetails' ) {
|
||||||
|
db.getJSONData( 'rootAccount' ).then( data => {
|
||||||
resolve( data );
|
resolve( data );
|
||||||
} ).catch( err => {
|
} ).catch( err => {
|
||||||
reject( { 'code': 500, 'message': 'ERR_DB: ' + err } );
|
reject( { 'code': 500, 'message': 'ERR_DB: ' + err } );
|
||||||
|
|||||||
@@ -20,6 +20,13 @@ const db = require( '../backend/db/db.js' );
|
|||||||
|
|
||||||
module.exports.checkpassword = ( username, password ) => {
|
module.exports.checkpassword = ( username, password ) => {
|
||||||
return new Promise( resolve => {
|
return new Promise( resolve => {
|
||||||
|
if ( username === 'root' ) {
|
||||||
|
db.getJSONData( 'rootAccount' ).then( account => {
|
||||||
|
bcrypt.compare( password, account.pass ).then( res => {
|
||||||
|
resolve( { 'status': res, 'twoFA': true } );
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
} else {
|
||||||
db.getDataSimple( 'admin', 'email', username ).then( data => {
|
db.getDataSimple( 'admin', 'email', username ).then( data => {
|
||||||
if ( data ) {
|
if ( data ) {
|
||||||
if ( data[ 0 ] ) {
|
if ( data[ 0 ] ) {
|
||||||
@@ -33,6 +40,7 @@ module.exports.checkpassword = ( username, password ) => {
|
|||||||
resolve( false );
|
resolve( false );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
}
|
||||||
} );
|
} );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
0
src/server/backend/db/data/rootAccount.json
Normal file
0
src/server/backend/db/data/rootAccount.json
Normal file
@@ -3,11 +3,23 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>{{ pageName }}</title>
|
<!-- <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"> -->
|
||||||
|
<script defer src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
|
||||||
|
<link rel="stylesheet" href="/supportFiles/style.css">
|
||||||
|
<link rel="stylesheet" href="/startPage/mainStyle">
|
||||||
|
<script defer src="/startPage/helperFunction"></script>
|
||||||
|
<title>{{ pageName }} :: Home</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<nav>
|
||||||
|
<a class="home">Home</a> |
|
||||||
</div>
|
<a href="/tickets">Tickets</a> |
|
||||||
|
<a href="/cart">Cart</a> |
|
||||||
|
<a href="/account">Account</a> |
|
||||||
|
<button onclick="changeTheme();" id="themeSelector">☽</button>
|
||||||
|
</nav>
|
||||||
|
<img src="/otherAssets/logo.png" alt="libreevent logo" class="logo">
|
||||||
|
<h1>Welcome to {{ pageName }}!</h1>
|
||||||
|
<p>{{ description }}</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
0
src/server/ui/home/templates/default/startPage.json
Normal file
0
src/server/ui/home/templates/default/startPage.json
Normal file
25
src/server/ui/home/templates/modern/index.html
Normal file
25
src/server/ui/home/templates/modern/index.html
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<!-- <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"> -->
|
||||||
|
<script defer src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
|
||||||
|
<link rel="stylesheet" href="/supportFiles/style.css">
|
||||||
|
<link rel="stylesheet" href="/startPage/mainStyle">
|
||||||
|
<script defer src="/startPage/helperFunction"></script>
|
||||||
|
<title>{{ pageName }} :: Home</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<nav>
|
||||||
|
<a class="home">Home</a> |
|
||||||
|
<a href="/tickets">Tickets</a> |
|
||||||
|
<a href="/cart">Cart</a> |
|
||||||
|
<a href="/account">Account</a> |
|
||||||
|
<button onclick="changeTheme();" id="themeSelector">☽</button>
|
||||||
|
</nav>
|
||||||
|
<img src="/otherAssets/logo.png" alt="libreevent logo" class="logo">
|
||||||
|
<h1>Welcome to {{ pageName }}!</h1>
|
||||||
|
<p>{{ description }}</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
25
src/server/ui/home/templates/template.html
Normal file
25
src/server/ui/home/templates/template.html
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<!-- <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"> -->
|
||||||
|
<script defer src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
|
||||||
|
<link rel="stylesheet" href="/supportFiles/style.css">
|
||||||
|
<link rel="stylesheet" href="/startPage/mainStyle">
|
||||||
|
<script defer src="/startPage/helperFunction"></script>
|
||||||
|
<title>{{ pageName }} :: Home</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<nav>
|
||||||
|
<a class="home">Home</a> |
|
||||||
|
<a href="/tickets">Tickets</a> |
|
||||||
|
<a href="/cart">Cart</a> |
|
||||||
|
<a href="/account">Account</a> |
|
||||||
|
<button onclick="changeTheme();" id="themeSelector">☽</button>
|
||||||
|
</nav>
|
||||||
|
<img src="/otherAssets/logo.png" alt="libreevent logo" class="logo">
|
||||||
|
<h1>Welcome to {{ pageName }}!</h1>
|
||||||
|
<p>{{ description }}</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user