|
|
|
@ -67,34 +67,47 @@ function domain_management_hook_get_db()
|
|
|
|
|
{
|
|
|
|
|
global $domain_management_return_set;
|
|
|
|
|
|
|
|
|
|
if ( isset( $_GET['ModifyDomain'] ) && $_GET['ModifyDomain'] = '1' && isset($_POST['domain_name'])) {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
$dbs = new DBLayer( 'shard' );
|
|
|
|
|
$dbs->update("domain", Array( 'domain_name' => $_POST['domain_name'], 'patch_version' => $_POST['patch_version'],'backup_patch_url' => $_POST['backup_patch_url'],'patch_urls' => $_POST['patch_urls'],'login_address' => $_POST['login_address'],'session_manager_address' => $_POST['session_manager_address'],'ring_db_name' => $_POST['ring_db_name'],'web_host' => $_POST['web_host'],'web_host_php' => $_POST['web_host_php'],'description' => $_POST['description'],),'`domain_id` = '.$_GET['edit_domain']);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch ( Exception $e ) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
$db = new DBLayer( 'shard' );
|
|
|
|
|
|
|
|
|
|
//get all domains
|
|
|
|
|
$statement = $db->executeWithoutParams("SELECT * FROM domain");
|
|
|
|
|
$rows = $statement->fetchAll();
|
|
|
|
|
// get all domains
|
|
|
|
|
$statement = $db -> executeWithoutParams( "SELECT * FROM domain" );
|
|
|
|
|
$rows = $statement -> fetchAll();
|
|
|
|
|
$domain_management_return_set['domains'] = $rows;
|
|
|
|
|
|
|
|
|
|
if (isset($_GET['edit_domain'])){
|
|
|
|
|
//get permissions
|
|
|
|
|
$statement = $db->executeWithoutParams("SELECT * FROM `domain` WHERE `domain_id` = '".$_GET['edit_domain']."'");
|
|
|
|
|
$rows = $statement->fetchAll();
|
|
|
|
|
if ( isset( $_GET['edit_domain'] ) ) {
|
|
|
|
|
// get permissions
|
|
|
|
|
$statement = $db -> executeWithoutParams( "SELECT * FROM `domain` WHERE `domain_id` = '" . $_GET['edit_domain'] . "'" );
|
|
|
|
|
$rows = $statement -> fetchAll();
|
|
|
|
|
$domain_management_return_set['domains'] = $rows;
|
|
|
|
|
|
|
|
|
|
$statement = $db->executeWithoutParams("SELECT * FROM `permission` WHERE `DomainId` = '".$_GET['edit_domain']."'");
|
|
|
|
|
$rows = $statement->fetchAll();
|
|
|
|
|
$statement = $db -> executeWithoutParams( "SELECT * FROM `permission` WHERE `DomainId` = '" . $_GET['edit_domain'] . "'" );
|
|
|
|
|
$rows = $statement -> fetchAll();
|
|
|
|
|
$domain_management_return_set['permissions'] = $rows;
|
|
|
|
|
|
|
|
|
|
//get all users
|
|
|
|
|
$pagination = new Pagination(WebUsers::getAllUsersQuery(),"web",10,"WebUsers");
|
|
|
|
|
$domain_management_return_set['userlist'] = Gui_Elements::make_table($pagination->getElements() , Array("getUId","getUsername","getEmail"), Array("id","username","email"));
|
|
|
|
|
// get all users
|
|
|
|
|
$pagination = new Pagination( WebUsers :: getAllUsersQuery(), "web", 10, "WebUsers" );
|
|
|
|
|
$domain_management_return_set['userlist'] = Gui_Elements :: make_table( $pagination -> getElements() , Array( "getUId", "getUsername", "getEmail" ), Array( "id", "username", "email" ) );
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $rows;
|
|
|
|
|
|
|
|
|
|
} catch (Exception $e) {
|
|
|
|
|
}
|
|
|
|
|
catch ( Exception $e ) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|