Domains - Delete: Fix issue deleting multiple domains at once.
This commit is contained in:
parent
0b977f044d
commit
0fe2f20375
|
|
@ -81,7 +81,6 @@ if (!class_exists('domains')) {
|
||||||
//delete multiple records
|
//delete multiple records
|
||||||
if (is_array($records) && @sizeof($records) != 0) {
|
if (is_array($records) && @sizeof($records) != 0) {
|
||||||
//build the delete array
|
//build the delete array
|
||||||
$d = 0;
|
|
||||||
foreach ($records as $record) {
|
foreach ($records as $record) {
|
||||||
//add to the array
|
//add to the array
|
||||||
if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) {
|
if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) {
|
||||||
|
|
@ -144,9 +143,9 @@ if (!class_exists('domains')) {
|
||||||
if (isset($app['db'])) foreach ($app['db'] as $row) {
|
if (isset($app['db'])) foreach ($app['db'] as $row) {
|
||||||
if (is_array($row['table']['name'])) {
|
if (is_array($row['table']['name'])) {
|
||||||
$table_name = $row['table']['name']['text'];
|
$table_name = $row['table']['name']['text'];
|
||||||
echo "<pre>";
|
if (defined('STDIN')) {
|
||||||
print_r($table_name);
|
echo "<pre>".print_r($table_name, 1)."<pre>\n";
|
||||||
echo "<pre>\n";
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$table_name = $row['table']['name'];
|
$table_name = $row['table']['name'];
|
||||||
|
|
@ -255,16 +254,11 @@ if (!class_exists('domains')) {
|
||||||
//apply settings reminder
|
//apply settings reminder
|
||||||
$_SESSION["reload_xml"] = true;
|
$_SESSION["reload_xml"] = true;
|
||||||
|
|
||||||
//clear the domains session array to update it
|
//remove the domain from domains session array
|
||||||
unset($_SESSION["domains"]);
|
unset($_SESSION["domains"][$id]);
|
||||||
unset($_SESSION['domain']);
|
|
||||||
unset($_SESSION['switch']);
|
|
||||||
|
|
||||||
//remove the domain and save to transactions
|
//add domain uuid to array for deletion below
|
||||||
$domain_array['domains'][$d]['domain_uuid'] = $id;
|
$domain_array['domains'][] = ['domain_uuid'=>$id];
|
||||||
|
|
||||||
//increment the id
|
|
||||||
$d++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -275,10 +269,12 @@ if (!class_exists('domains')) {
|
||||||
$database->app_name = $this->app_name;
|
$database->app_name = $this->app_name;
|
||||||
$database->app_uuid = $this->app_uuid;
|
$database->app_uuid = $this->app_uuid;
|
||||||
$database->delete($domain_array);
|
$database->delete($domain_array);
|
||||||
unset($array);
|
|
||||||
|
|
||||||
//set message
|
//set message
|
||||||
message::add($text['message-delete']);
|
message::add($text['message-delete']);
|
||||||
|
|
||||||
|
//reload default/domain settings
|
||||||
|
$this->set();
|
||||||
}
|
}
|
||||||
unset($records);
|
unset($records);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue