2019-04-12 18:11:27 +02:00
|
|
|
<?php
|
|
|
|
require_once('../../common.php');
|
|
|
|
|
|
|
|
if ( ! isset( $_POST['action'] ) ) {
|
|
|
|
|
|
|
|
die( formatJSEND( "error", "Missing parameter" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
// Verify Session or Key
|
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
checkSession();
|
|
|
|
|
|
|
|
if ( $_POST['action'] == 'create_default_tables' ) {
|
|
|
|
|
|
|
|
if( is_admin() ) {
|
|
|
|
|
|
|
|
global $sql;
|
|
|
|
$result = $sql->create_default_tables();
|
|
|
|
|
2019-07-09 04:34:39 +02:00
|
|
|
//echo var_dump( $result );
|
2019-07-02 00:22:33 +02:00
|
|
|
|
2019-04-12 18:11:27 +02:00
|
|
|
if( $result === true ) {
|
|
|
|
|
|
|
|
exit( formatJSEND( "success", "Created tables." ) );
|
|
|
|
} else {
|
|
|
|
|
|
|
|
exit( formatJSEND( "error", "Could not create tables." ) );
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
|
|
|
|
exit( formatJSEND( "error", "Only admins can use this method." ) );
|
|
|
|
}
|
|
|
|
}
|