codiad/components/system/controller.php
xevidos 6b9918acde * Added file selector functions
* Added initial archive management
* Added new Permissions system
* Added new file upload systems
* Recoded most of Filemanager componant
* Removed long IDs from database tables
* Updated commonly used settings to default
2020-03-30 17:57:38 +00:00

63 lines
No EOL
1.2 KiB
PHP

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