mirror of
https://github.com/xevidos/codiad.git
synced 2024-11-14 07:41:14 +01:00
35 lines
No EOL
739 B
PHP
35 lines
No EOL
739 B
PHP
<?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();
|
|
|
|
echo var_dump( $result );
|
|
|
|
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." ) );
|
|
}
|
|
} |