2019-04-12 18:11:27 +02:00
|
|
|
<?php
|
|
|
|
require_once('../../common.php');
|
|
|
|
|
2019-12-12 14:22:43 +01:00
|
|
|
if ( ! isset( $_POST['action'] ) && ! isset( $_GET['action'] ) ) {
|
2019-04-12 18:11:27 +02:00
|
|
|
|
|
|
|
die( formatJSEND( "error", "Missing parameter" ) );
|
2019-12-12 14:22:43 +01:00
|
|
|
} else {
|
|
|
|
|
|
|
|
if( isset( $_POST["action"] ) ) {
|
|
|
|
|
|
|
|
$action = $_POST["action"];
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$action = $_GET["action"];
|
|
|
|
}
|
2019-04-12 18:11:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
// Verify Session or Key
|
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
checkSession();
|
|
|
|
|
2019-12-12 14:22:43 +01:00
|
|
|
switch( $action ) {
|
2019-04-12 18:11:27 +02:00
|
|
|
|
2019-12-12 14:22:43 +01:00
|
|
|
case( "create_default_tables" ):
|
2019-04-12 18:11:27 +02:00
|
|
|
|
2019-12-12 14:22:43 +01:00
|
|
|
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", array( "message" => "Could not create tables.", "result" => $result ) ) );
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
|
|
|
|
exit( formatJSEND( "error", "Only admins can use this method." ) );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case( "get_ini_setting" ):
|
2019-07-02 00:22:33 +02:00
|
|
|
|
2019-12-12 14:22:43 +01:00
|
|
|
if( isset( $_POST["option"] ) ) {
|
2019-04-12 18:11:27 +02:00
|
|
|
|
2019-12-12 14:22:43 +01:00
|
|
|
$option = $_POST["option"];
|
2019-04-12 18:11:27 +02:00
|
|
|
} else {
|
|
|
|
|
2019-12-12 14:22:43 +01:00
|
|
|
$option = $_GET["option"];
|
2019-04-12 18:11:27 +02:00
|
|
|
}
|
|
|
|
|
2019-12-12 14:22:43 +01:00
|
|
|
exit( json_encode( array(
|
|
|
|
"option" => $option,
|
|
|
|
"value" => ini_get( $option ),
|
|
|
|
)));
|
|
|
|
break;
|
2019-04-12 18:11:27 +02:00
|
|
|
}
|