Ejemplo n.º 1
0
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
/* $Id$ */
require "modules/samba/includes/shares.inc.php";
if (isset($_POST["bdelshare"])) {
    $share = $_POST["share"];
    del_share($share, $_POST["delFiles"]);
    if (!isXMLRPCError()) {
        $str = sprintf(_T("Share %s deleted"), $share);
        new NotifyWidgetSuccess($str);
    } else {
        $str = sprintf(_T("An error has occured during delete process on %s", $share));
        new NotifyWidgetFailure($str);
    }
    header("location: " . urlStrRedirect('samba/shares/index'));
} else {
    $share = urldecode($_GET["share"]);
    $f = new PopupForm(_T("Delete a share"));
    $f->addText(sprintf(_T("You will delete the share <b>%s</b>"), $share));
    $cb = new CheckboxTpl("delFiles", _T("Delete all data"));
    $f->add($cb, array("value" => ""));
    $hidden = new HiddenTpl("share");
    $f->add($hidden, array("value" => $share, "hide" => True));
    $f->addValidateButton("bdelshare");
    $f->addCancelButton("bback");
    $f->display();
}
Ejemplo n.º 2
0
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require_once "modules/pkgs/includes/xmlrpc.php";
if (isset($_POST["bconfirm"])) {
    activateAppstreamFlow($_POST['id'], $_POST['package_name'], $_POST['package_label'], $_POST['duration']);
    if (!isXMLRPCError() and $ret != -1) {
        new NotifyWidgetSuccess(_T("The stream has been added successfully. You will receive the latest updates of this stream directly in your package list.", "pkgs"));
    }
    if ($ret == -1) {
        new NotifyWidgetFailure(_T("Unable to add stream.", "pkgs"));
    }
    header("Location: " . urlStrRedirect("pkgs/pkgs/appstreamSettings", array()));
    exit;
} else {
    $id = $_GET['id'];
    $package_name = $_GET['package_name'];
    $package_label = $_GET['package_label'];
    $duration = $_GET['duration'];
    $f = new PopupForm(_T("Activate this Appstream stream?"));
    $hidden = new HiddenTpl("id");
    $f->add($hidden, array("value" => $id, "hide" => True));
    $hidden = new HiddenTpl("package_name");
    $f->add($hidden, array("value" => $package_name, "hide" => True));
    $hidden = new HiddenTpl("package_label");
    $f->add($hidden, array("value" => $package_label, "hide" => True));
    $hidden = new HiddenTpl("duration");
    $f->add($hidden, array("value" => $duration, "hide" => True));
    $f->addValidateButton("bconfirm");
    $f->addCancelButton("bback");
    $f->display();
}
Ejemplo n.º 3
0
        $str = "<h2>" . _T("Share backup") . "</h2>";
        $str .= '<p>';
        $str .= sprintf(_T("Backup of share <b>%s</b> has been launched in background."), $share);
        $str .= "</p><p>";
        $str .= sprintf(_("The files will be stored in the directory %s of the server at the end of the backup."), $backuppath);
        $str .= "</p><p>";
        $str .= _T("Please go to the status page to check the backup status.");
        $str .= "</p><p>";
        $str .= _T("This operation will last according to the amount of data to backup.");
        $str .= "</p>";
        new NotifyWidgetSuccess($str);
    } else {
        new NotifyWidgetFailure(_T("Can't launch backup"));
    }
    header("Location: " . urlStrRedirect("samba/shares/index"));
    exit;
} else {
    $share = urldecode($_GET["share"]);
    $f = new PopupForm(_T("Share backup"));
    $f->addText(sprintf(_T("The share %s will be archived."), $share));
    $f->addText(_T("Please select media size. If your data exceed volume size, several files with your media size will be created."));
    $select = new SelectItem("media");
    $select->setElements(array("CD (650 Mo)", "DVD (4.7 Go)"));
    $select->setElementsVal(array(600, 4200));
    $f->add($select);
    $hidden = new HiddenTpl("share");
    $f->add($hidden, array("value" => $share, "hide" => True));
    $f->addValidateButton("bgo");
    $f->addCancelButton("bback");
    $f->display();
}
Ejemplo n.º 4
0
function image_add($type, $target_uuid)
{
    $params = getParams();
    $item_uuid = $_GET['itemid'];
    $label = urldecode($_GET['itemlabel']);
    $f = new PopupForm(sprintf(_T("Add the image <b>%s</b> to <b>%s</b>", "imaging"), $label, $params['hostname']));
    # Need to get the name of the target
    $f->push(new Table());
    // form preseeding
    $f->add(new HiddenTpl("itemid"), array("value" => $item_uuid, "hide" => True));
    $f->add(new HiddenTpl("itemlabel"), array("value" => $label, "hide" => True));
    $f->add(new HiddenTpl("gid"), array("value" => $_GET['gid'], "hide" => True));
    $f->add(new HiddenTpl("uuid"), array("value" => $_GET['uuid'], "hide" => True));
    /*$input = new TrFormElement(_T('Default menu item label', 'imaging'),        new InputTpl("default_mi_label"));
      $f->add($input,                                         array("value" => ''));
       */
    $check = new TrFormElement(_T('Selected by default', 'imaging'), new CheckboxTpl("do_default"));
    $f->add($check, array("value" => web_def_image_default() ? "checked" : ""));
    $check = new TrFormElement(_T('Displayed', 'imaging'), new CheckboxTpl("do_display"));
    $f->add($check, array("value" => web_def_image_hidden() ? "checked" : ""));
    $check = new TrFormElement(_T('Selected by default on WOL', 'imaging'), new CheckboxTpl("do_default_WOL"));
    $f->add($check, array("value" => web_def_image_default_WOL() ? "checked" : ""));
    $check = new TrFormElement(_T('Displayed on WOL', 'imaging'), new CheckboxTpl("do_display_WOL"));
    $f->add($check, array("value" => web_def_image_hidden_WOL() ? "checked" : ""));
    $f->addValidateButton("bconfirm");
    $f->addCancelButton("bback");
    $f->display();
}
Ejemplo n.º 5
0
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require "modules/base/includes/users.inc.php";
if (isset($_GET["user"])) {
    $user = urldecode($_GET["user"]);
}
if (isset($_POST["user"])) {
    $user = $_POST["user"];
}
if (isset($_POST["bdeluser"])) {
    del_user($user, $_POST["delfiles"]);
    if (!isXMLRPCError()) {
        new NotifyWidgetSuccess(sprintf(_("User %s has been successfully deleted"), $user));
    }
    header("Location: " . urlStrRedirect("base/users/index"));
    exit;
} else {
    $f = new PopupForm(_("Delete user"));
    $f->addText(sprintf(_("You will delete user <b>%s</b>."), $user));
    $cb = new CheckboxTpl("delfiles", _("Delete all user's files"));
    $f->add($cb, array("value" => ""));
    $hidden = new HiddenTpl("user");
    $f->add($hidden, array("value" => $user, "hide" => True));
    $f->addValidateButton("bdeluser");
    $f->addCancelButton("bback");
    $f->display();
}
Ejemplo n.º 6
0
function service_add($location)
{
    $params = getParams();
    $item_uuid = $_GET['itemid'];
    $label = urldecode($_GET['itemlabel']);
    $f = new PopupForm(sprintf(_T("Add the boot service <b>%s</b> to the default boot menu", "imaging"), $label));
    $f->push(new Table());
    // form preseeding
    $f->add(new HiddenTpl("location"), array("value" => $location, "hide" => True));
    $f->add(new HiddenTpl("itemlabel"), array("value" => $label, "hide" => True));
    $f->add(new HiddenTpl("itemid"), array("value" => $item_uuid, "hide" => True));
    $f->add(new HiddenTpl("default_mi_label"), array("value" => $label, "hide" => True));
    #    $input = new TrFormElement(_T('Default menu item label', 'imaging'),        new InputTpl("default_mi_label"));
    #$f->add($input,                                         array("value" => ''));
    $check = new TrFormElement(_T('Selected by default', 'imaging'), new CheckboxTpl("do_default"));
    $f->add($check, array("value" => web_def_service_default() ? "checked" : ""));
    $check = new TrFormElement(_T('Displayed', 'imaging'), new CheckboxTpl("do_display"));
    $f->add($check, array("value" => web_def_service_hidden() ? "checked" : ""));
    $check = new TrFormElement(_T('Selected by default on WOL', 'imaging'), new CheckboxTpl("do_default_WOL"));
    $f->add($check, array("value" => web_def_service_default_WOL() ? "checked" : ""));
    $check = new TrFormElement(_T('Displayed on WOL', 'imaging'), new CheckboxTpl("do_display_WOL"));
    $f->add($check, array("value" => web_def_service_hidden_WOL() ? "checked" : ""));
    $f->addValidateButton("bconfirm");
    $f->addCancelButton("bback");
    $f->display();
}
Ejemplo n.º 7
0
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require "modules/samba4/includes/machines-xmlrpc.inc.php";
if (isset($_GET["machine"])) {
    $machine = urldecode($_GET["machine"]);
}
if (isset($_POST["machine"])) {
    $machine = $_POST["machine"];
}
if (isset($_POST["bdeleletemachine"])) {
    $deleteActionSuccess = deleteMachine($machine);
    if (!isXMLRPCError() and $deleteActionSuccess) {
        $computerDeletedMessage = sprintf(_T("Computer <strong>%s</strong> deleted.", "samba4"), $machine);
        new NotifyWidgetSuccess($computerDeletedMessage);
    } else {
        $computerDeletedMessage = sprintf(_T("There has been a problem while deleting <strong>%s</strong> computer.", "samba4"), $machine);
        new NotifyWidgetFailure($computerDeletedMessage);
    }
    header("location: " . urlStrRedirect('samba4/machines/index'));
    exit;
} else {
    $form = new PopupForm(_T("Delete a computer", "samba4"));
    $form->addText(sprintf(_T("You will delete the %s computer", "samba4"), "<strong>{$machine}</strong>"));
    $form->addValidateButton("bdeleletemachine");
    $form->addCancelButton("bback");
    $form->display();
}
Ejemplo n.º 8
0
 * 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();
}
Ejemplo n.º 9
0
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * MMC is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require "modules/samba/includes/machines.inc.php";
if (isset($_GET["machine"])) {
    $machine = urldecode($_GET["machine"]);
}
if (isset($_POST["machine"])) {
    $machine = $_POST["machine"];
}
if (isset($_POST["bdelmach"])) {
    del_machine($machine);
    $str = sprintf(_T("Computer <strong>%s</strong> deleted."), $machine);
    new NotifyWidgetSuccess($str);
    header("location: " . urlStrRedirect('samba/machines/index'));
} else {
    $f = new PopupForm(_T("Delete a computer"));
    $f->addText(sprintf(_T("You will delete the %s computer"), "<strong>{$machine}</strong>"));
    $f->addValidateButton("bdelmach");
    $f->addCancelButton("bback");
    $f->display();
}