mirror of
https://github.com/xevidos/codiad.git
synced 2024-12-22 13:52:16 +01:00
6b9918acde
* 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
63 lines
No EOL
1.2 KiB
PHP
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;
|
|
} |