$backup = $_POST["backup"] ? True : False; if (in_array("imaging", $_SESSION["modulesList"])) { //$dede = xmlrpc_imagingClearMenuFromUuid($uuid); $dede = xmlrpc_imagingClearMenuFromUuidAllLocation($uuid); } delComputer($uuid, $backup); if (!isXMLRPCError()) { new NotifyWidgetSuccess(_("The computer has been deleted.")); } header("Location: " . urlStrRedirect("base/computers/index")); exit; } } else { $uuid = urldecode($_GET["objectUUID"]); $f = new PopupForm(_("Delete this computer")); $f->push(new Table()); $tr = new TrFormElement(_("Do you want a backup to be done ?"), new CheckBoxTpl("backup"), array("value" => '')); // Set first column to 100%, because without this setting, checkbox width is too large $tr->setFirstColWidth('100%'); $f->add($tr); // this checkbox has to be checked to delete a computer $tr = new TrFormElement(_("I am aware that <b>all related images (non-master)</b> will be <b>DELETED</b>.<br />Check this box if it is what you want."), new CheckBoxTpl("imageWarning"), array("value" => '')); $tr->setFirstColWidth('100%'); $f->add($tr); $hidden = new HiddenTpl("objectUUID"); $f->add($hidden, array("value" => $uuid, "hide" => True)); $f->pop(); $f->addValidateButton("bconfirm"); $f->addCancelButton("bback"); $f->display(); }
* Author(s): * Miguel Julián <*****@*****.**> */ require "modules/samba4/includes/shares-xmlrpc.inc.php"; if (isset($_POST["bdeleteshare"])) { $share = $_POST["share"]; $deleteFiles = isset($_POST["deleteFiles"]) ? True : False; $deletionSuccess = deleteShare($share, $deleteFiles); if (!isXMLRPCError() and $deletionSuccess) { $successMessage = sprintf(_T("Share %s deleted", "samba4"), $share); new NotifyWidgetSuccess($successMessage); } else { $failureMessage = sprintf(_T("An error has occured during delete process on %s", "samba4"), $share); new NotifyWidgetFailure($failureMessage); } redirectTo(urlStrRedirect('samba4/shares/index')); exit; } else { $share = urldecode($_GET["share"]); $form = new PopupForm(_T("Delete a share", "samba4")); $form->addText(sprintf(_T("You will delete the share <b>%s</b>", "samba4"), $share)); $form->push(new Table()); $tr = new TrFormElement(_T("Delete data", "samba4"), new CheckboxTpl("deleteFiles")); $form->add($tr, array("value" => "")); $form->pop(); $hidden = new HiddenTpl("share"); $form->add($hidden, array("value" => $share, "hide" => True)); $form->addValidateButton("bdeleteshare"); $form->addCancelButton("bback"); $form->display(); }