function treatPost()
 {
     $members = isset($_POST["lmembers"]) ? unserialize(base64_decode($_POST["lmembers"])) : null;
     $nonmemb = isset($_POST["lnonmemb"]) ? unserialize(base64_decode($_POST["lnonmemb"])) : null;
     $this->list = isset($_POST["list"]) ? unserialize(base64_decode($_POST["list"])) : null;
     if (!is_array($this->list)) {
         $this->loadList();
     }
     if (isset($_POST["bdeluser_x"])) {
         if (isset($_POST["members"])) {
             foreach ($_POST["members"] as $member) {
                 unset($members[$member]);
             }
         }
     } elseif (isset($_POST["badduser_x"])) {
         if (isset($_POST["nonmemb"])) {
             foreach ($_POST["nonmemb"] as $nm) {
                 $members[$nm] = $this->list[$nm];
             }
         }
     } elseif (isset($_POST["bconfirm"])) {
         header("Location: " . urlStrRedirect($this->set_order_uri, array('list' => base64_encode(serialize($this->list)))));
         exit;
     } else {
         $members = array();
         $nonmemb = $this->list;
     }
     ksort($members);
     reset($members);
     ksort($nonmemb);
     $this->diff = array_diff_assoc($nonmemb, $members);
     natcasesort($this->diff);
     $this->members = $members;
     $this->nonmemb = $nonmemb;
 }
Exemple #2
0
function _mail_baseGroupEdit($ldapArr, $postArr)
{
    if (!isset($ldapArr["cn"][0])) {
        return;
    }
    print "<div class=\"formblock\" style=\"background-color: #FFD;\">";
    print "<h3>" . _T("Mail plugin", "mail") . "</h3>\n";
    $mail = "";
    $maildomain = "";
    if (hasGroupMailObjectClass($ldapArr['cn'][0])) {
        $hasMail = "checked";
        if (isset($ldapArr["mail"])) {
            $mail = $ldapArr["mail"][0];
        }
        if (hasVDomainSupport()) {
            $tmparr = explode("@", $mail);
            $mail = $tmparr[0];
            $maildomain = $tmparr[1];
        }
    } else {
        $mail = computeMailGroupAlias($ldapArr['cn'][0]);
        $hasMail = "";
        if (hasVDomainSupport()) {
            $vdomains = getVDomains("");
            if (count($vdomains) == 1) {
                $maildomain = $vdomains[0][1]["virtualdomain"][0];
            }
        }
    }
    if ($hasMail == "" && $mail == "") {
        print _T("No mail alias can be set for this group", "mail");
    } else {
        print '<table cellspacing="0">';
        if (hasZarafaSupport()) {
            $trz = new TrFormElement(_T("Zarafa group", "mail"), new CheckboxTpl("zarafaGroup"));
            $trz->display(array("value" => isZarafaGroup($ldapArr['cn'][0]) ? "checked" : ""));
        }
        $test = new TrFormElement(_T("Enable mail alias for users of this group ", "mail"), new CheckboxTpl("mailgroupaccess"));
        $param = array("value" => $hasMail, "extraArg" => 'onclick="toggleVisibility(\'maildiv\');"');
        $test->display($param);
        print "</table>";
        if (!$hasMail) {
            $style = 'style =" display: none;"';
        }
        print '<div id="maildiv" ' . $style . '>';
        print '<table cellspacing="0">';
        if (!hasVDomainSupport()) {
            $m = new TrFormElement(_T("Mail alias", "mail"), new InputTpl("mailgroupalias"));
            $m->displayRo(array("value" => $mail));
        } else {
            print '<tr><td width="40%" style="text-align: right;">' . _T("Mail alias", "mail") . '</td><td>' . $mail . '<input  type="hidden" value="' . $mail . '" name="mailgroupalias">&nbsp;@&nbsp;';
            print '<input type="text" id="autocomplete" name="maildomain" value="' . $maildomain . '" /><div id="autocomplete_choices" class="autocomplete"></div>';
            print '<script type="text/javascript">new Ajax.Autocompleter("autocomplete", "autocomplete_choices", "' . urlStrRedirect('mail/domains/ajaxMailDomainFilter') . '", {paramName: "value"});</script>';
            print '</td></tr>';
        }
        print "</table>";
        print "</div>";
    }
    print "</div>";
}
Exemple #3
0
    function display_links($module, $submod, $pages)
    {
        $MMCApp =& MMCApp::getInstance();
        $moduleObj = $MMCApp->getModule($module);
        if ($moduleObj) {
            $submodObj = $moduleObj->getSubmod($submod);
            if ($submodObj) {
                $submodPages = $submodObj->getPages();
                $hasPages = false;
                $links = "<ul>";
                foreach ($pages as $page) {
                    if (isset($submodPages[$page])) {
                        $pageObj = $submodPages[$page];
                        if ($pageObj->hasAccess($moduleObj, $submodObj)) {
                            $links .= '<li><a href="' . urlStrRedirect("{$module}/{$submod}/{$page}") . '">' . $pageObj->getDescription() . '</a></li>';
                            $hasPages = true;
                        }
                    }
                }
                $links .= "</ul>";
                if ($hasPages) {
                    echo <<<SUBPANEL
                    <div class="subpanel">
                        <h4>{$submodObj->getDescription()}</h4>
                        {$links}
                    </div>
SUBPANEL;
                }
            }
        }
    }
 function display_content()
 {
     /*
     * Disable reverse SSH support as reverse SSH server is shutted down
     *
     	    if (established())
     	    {
                     echo '<p><div style="text-align: center"><font color="green">Your server is now connected to:</font></div></p>
      <div style="text-align: center"><font color="green"><b>rssh.mandriva.com</b></font></div>
      <p><div style="text-align: center"><font color="green">(remote port: <b>'. get_port() . '</b>)</font></div></p>
                     <div style="text-align: center"><a class="btn btn-info btn-small" href="' . urlStrRedirect("support/support/disconnect") . '">' . _('Disconnect') . '</a></div>';
     	    }	    
     	    else {
                     echo '<div style="text-align: center"><a class="btn btn-info btn-small" href="' . urlStrRedirect("support/support/connect") . '">' . _('Connect to support') . '</a></div>';
     	    }
     */
     if (collector_in_progress()) {
         echo '<p><div style="text-align: center"><img src="modules/msc/graph/images/status/inprogress.gif" alt=""/></div></p>';
     } else {
         if (info_collected()) {
             echo '<p><div style="text-align: center"><a class="btn btn-info btn-small" href="' . urlStrRedirect("support/support/get_file", array('path' => get_archive_link())) . '">' . _('Download archive') . '</a></div></p>';
         } else {
             echo '<p><div style="text-align: center"><a class="btn btn-info btn-small" href="' . urlStrRedirect("support/support/collect") . '">' . _('Extract log and config files') . '</a></div></p>';
         }
     }
 }
Exemple #5
0
 function display_content()
 {
     echo '<p><a href="' . urlStrRedirect('samba/config/sambastatus') . '">';
     printf(dngettext("samba", "%d open session", "%d open sessions", $this->data['sessions']), $this->data['sessions']);
     echo '</a><br/>';
     echo '<a href="' . urlStrRedirect('samba/config/sambastatus') . '">';
     printf(dngettext("samba", "%d share connection", "%d share connections", $this->data['shares']), $this->data['shares']);
     echo '</a></p>';
 }
Exemple #6
0
 function service_add($type, $target_uuid)
 {
     $params = getParams();
     $item_uuid = $_GET['itemid'];
     $label = urldecode($_GET['itemlabel']);
     $ret = xmlrpc_addServiceToTarget($item_uuid, $target_uuid, $type);
     // goto images list
     if ($ret[0]) {
         /* insert notification code here if needed */
         header("Location: " . urlStrRedirect("base/computers/imgtabs/" . $type . "tabservices", $params));
         exit;
     } else {
         new NotifyWidgetFailure($ret[1]);
     }
 }
Exemple #7
0
 function display_content()
 {
     $MMCApp =& MMCApp::getInstance();
     $errors = '';
     foreach ($this->data as $module => $services_infos) {
         $moduleObj = $MMCApp->getModule($module);
         if ($errors) {
             $errors .= "<br/>";
         }
         $errors .= '<strong>' . $moduleObj->getDescription() . ' : <a class="error" href="' . urlStrRedirect('services/control/index') . '">' . sprintf(dngettext("services", "%d inactive service", "%d inactive services", count($services_infos)), count($services_infos)) . '</a></strong>';
     }
     if ($errors) {
         echo '<p class="alert alert-error">' . $errors . '</p>';
     } else {
         echo '<p class="alert alert-success"><img src="img/common/icn_yes.gif" style="vertical-align: bottom" /> ' . _T("All services are up", "services") . '</p>';
     }
 }
Exemple #8
0
 function display_content()
 {
     echo '<p style="text-align: center">
             <script type="text/javascript">
                 reboot = function() {
                     var message = "<strong>' . _T("The server will reboot. Are you sure ?", "services") . '</strong>";
                     var url = "' . urlStrRedirect('services/control/reboot') . '";
                     displayConfirmationPopup(message, url);
                 }
                 poweroff = function() {
                     var message = "<strong>' . _T("The server will be poweroff. Are you sure ?", "services") . '</strong>";
                     var url = "' . urlStrRedirect('services/control/reboot') . '";
                     displayConfirmationPopup(message, url);
                 }
             </script>
             <button class="btn btn-small" onclick="reboot(); return false">' . _T("Reboot", "services") . '</button>
             <button class="btn btn-small" onclick="poweroff(); return false">' . _T("Poweroff", "services") . '</button>
         </p>';
 }
 * 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, see <http://www.gnu.org/licenses/>.
 */
/* common ajax includes */
require "../includes/ajaxcommon.inc.php";
$t = new TitleElement(_T("Imaging server configuration", "imaging"), 3);
$t->display();
$config = xmlrpc_getImagingServerConfig($location);
$imaging_server = $config[0];
$default_menu = $config[1];
$f = new ValidatingForm(array("action" => urlStrRedirect("imaging/manage/save_configuration")));
$f->add(new HiddenTpl("is_uuid"), array("value" => $imaging_server['imaging_uuid'], "hide" => True));
$lang = xmlrpc_getAllKnownLanguages();
$lang_choices = array();
$lang_values = array();
$lang_id2uuid = array();
foreach ($lang as $l) {
    $lang_choices[$l['imaging_uuid']] = $l['label'];
    $lang_values[$l['imaging_uuid']] = $l['imaging_uuid'];
    $lang_id2uuid[$l['id']] = $l['imaging_uuid'];
}
$language = new SelectItem("language");
$language->setElements($lang_choices);
$language->setElementsVal($lang_values);
if ($imaging_server['fk_language']) {
    $language->setSelected($lang_id2uuid[$imaging_server['fk_language']]);
Exemple #10
0
 *
 * 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";
require "modules/samba/includes/samba.inc.php";
require "modules/samba/mainSidebar.php";
require "graph/navbar.inc.php";
if (isset($_POST["baddmach"])) {
    $machine = $_POST["machine"];
    $comment = stripslashes($_POST["comment"]);
    add_machine($machine, $comment);
    if (!isXMLRPCError()) {
        new NotifyWidgetSuccess(sprintf(_T("Computer %s successfully added"), $machine));
        header("Location: " . urlStrRedirect("samba/machines/index"));
        exit;
    }
}
$p = new PageGenerator(_T("Add a computer"));
$p->setSideMenu($sidemenu);
$p->display();
$f = new ValidatingForm();
$f->addSummary(_T("The computer name can only contains letters lowercase and numbers, and must begin with a letter."));
$f->push(new Table());
$f->add(new TrFormElement(_T("Computer name"), new NetbiosInputTpl("machine")), array("value" => $machine, "required" => True));
$f->add(new TrFormElement(_T("Comment"), new InputTpl("comment")), array("value" => $comment));
$f->pop();
$f->pop();
$f->addValidateButton("baddmach");
$f->display();
Exemple #11
0
<?php

/**
 * (c) 2004-2007 Linbox / Free&ALter Soft, http://linbox.com
 * (c) 2007-2008 Mandriva, http://www.mandriva.com/
 *
 * $Id$
 *
 * This file is part of Mandriva Management Console (MMC).
 *
 * MMC is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * 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
 */
xmlCall("samba.restartSamba");
new NotifyWidgetSuccess(_T("The SAMBA service has been asked to restart."));
redirectTo(urlStrRedirect("samba/config/index"));
 * 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_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));
Exemple #13
0
$params['tab'] = $prefix . 'tablaunch';
$halt_to = array();
foreach ($_POST as $p => $v) {
    if (preg_match('/^issue_halt_to_/', $p)) {
        $p = preg_replace('/^issue_halt_to_/', '', $p);
        if ($v == 'on') {
            $halt_to[] = $p;
        }
    }
}
$params['issue_halt_to'] = $halt_to;
$mode = web_def_mode();
$prefix = '';
if (strlen($gid)) {
    $prefix = 'group';
}
$cible = array($uuid);
// TODO: activate this  : msc_command_set_pause($cmd_id);
$id_command = add_command_api($pid, $cible, $params, $p_api, $mode, $gid);
if (!isXMLRPCError()) {
    scheduler_start_these_commands('', array($id_command));
    header("Location: " . urlStrRedirect("msc/logs/viewLogs", array('tab' => $prefix . $tab, 'uuid' => $uuid, 'hostname' => $hostname, 'gid' => $gid, 'cmd_id' => $id_command)));
    exit;
} else {
    ## Return to the launch tab, the backtrace will be displayed
    header("Location: " . urlStrRedirect("msc/logs/viewLogs", array('tab' => $prefix . 'tablaunch', 'uuid' => $uuid, 'hostname' => $hostname, 'gid' => $gid, 'cmd_id' => $id_command)));
    exit;
}
?>

Exemple #14
0
    $item_uuid = $_POST['itemid'];
    $label = urldecode($_POST['itemlabel']);
    $ret = xmlrpc_delServiceToLocation($item_uuid, $location, $params);
    // goto images list
    if ($ret[0] and !isXMLRPCError()) {
        $str = sprintf(_T("Service <strong>%s</strong> removed from default boot menu", "imaging"), $label);
        new NotifyWidgetSuccess($str);
        // Synchronize boot menu
        $ret = xmlrpc_synchroLocation($location);
        if (isXMLRPCError()) {
            new NotifyWidgetFailure(sprintf(_T("Boot menu generation failed for package server: %s", "imaging"), implode(', ', $ret[1])));
        }
        header("Location: " . urlStrRedirect("imaging/manage/service", $params));
        exit;
    } elseif ($ret[0]) {
        header("Location: " . urlStrRedirect("imaging/manage/service", $params));
        exit;
    } else {
        new NotifyWidgetFailure($ret[1]);
    }
}
$params = getParams();
$item_uuid = $_GET['itemid'];
$label = urldecode($_GET['itemlabel']);
$f = new PopupForm(sprintf(_T("Remove the boot service <b>%s</b> from 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));
Exemple #15
0
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

require_once("modules/inventory/includes/xmlrpc.php");
require_once("modules/inventory/includes/html.php");
require_once("modules/base/includes/AjaxFilterLog.inc.php");


$params = array("from" => 'base%2computers%2Finvtabs');

foreach (array('uuid', 'hostname', 'gid', 'groupname', 'filter', 'tab', 'part') as $get) {
    if (isset($_GET[$get])) {
        $value = $_GET[$get];
        $params[$get] = $value;
    }
}
$ajax = new AjaxFilterInventory(urlStrRedirect("inventory/inventory/ajaxViewPart"), "container", $params);

/*$url = 'modules/inventory/inventory/ajaxViewPart.php?from=base%2Fcomputers%2Finvtabs';
foreach (array('uuid', 'hostname', 'gid', 'groupname', 'filter', 'tab', 'part') as $get) {
    $url .= "&$get=".$_GET[$get];
}
$ajax = new AjaxFilter($url);*/

$ajax->display();
print "<br/><br/><br/>";
$ajax->displayDivToUpdate();
?>


Exemple #16
0
    function display($arrParam = array())
    {
        print '<div id="' . $this->name . '">';
        if (isset($arrParam['value']) && $arrParam['value']) {
            for ($i = 0; $i < count($arrParam['value']); $i++) {
                $range = new RangeInputTpl('subnetpool_' . $i);
                $range->display(array("value" => $arrParam['value'][$i]));
            }
        } else {
            $range = new RangeInputTpl('subnetpool_0');
            $range->display();
            $i = 0;
        }
        $nbRanges = $i;
        $url = urlStrRedirect('network/network/ajaxRange');
        print '</div>';
        print <<<EOF
        <script>
            var nbRanges = {$nbRanges};
            addRange = function() {
                var ranges = jQuery(jQuery.find('#{$this->name}'));
                jQuery.get("{$url}", {
                    name: 'subnetpool_' + (nbRanges + 1)
                }).
                success(function(result) {
                    ranges.append(result);
                    nbRanges++;
                });
            }
            delRange = function(elem) {
                jQuery(elem).parent().remove();
            }
            updateRange = function(elem) {
                var range = jQuery(elem).parent().parent();
                var rangeValue = jQuery(range.find('> input')[0]);
                rangeValue.val("");
                range.find('span > input').each(function() {
                    var str = rangeValue.val() + "  " + jQuery(this).val();
                    rangeValue.val(str.trim());
                });
            }
        </script>
EOF;
        print '<button type="button" class="btn btn-small" onclick="addRange(); return false;">' . _('Add') . '</button>';
    }
Exemple #17
0
$ajax->display();
$p = new PageGenerator(_T("NAT Rules", "shorewall"));
$p->setSideMenu($sidemenu);
$p->display();
echo '<p>' . _T("Provide internet access to internal network(s).") . '</p>';
$ajax->displayDivToUpdate();
// Handle form return
if (isset($_POST['badd'])) {
    addMasqueradeRule($_POST['external_if'], $_POST['internal_if']);
    enableIpFoward();
    $n = new NotifyWidgetSuccess(_T("NAT rule added."));
    handleServicesModule($n, array("shorewall" => _T("Firewall")));
    redirectTo(urlStrRedirect("shorewall/shorewall/masquerade"));
}
if (isset($_POST['brestart'])) {
    redirectTo(urlStrRedirect("shorewall/shorewall/restart_service", array("page" => "masquerade")));
}
// Add NAT rule form
$t = new TitleElement(_T("Add NAT rule"), 2);
$t->display();
$f = new ValidatingForm();
$f->push(new Table());
$zones_types = getZonesTypes();
$external = array();
$externalVals = array();
foreach (getZonesInterfaces($zones_types["external"]) as $zone) {
    $external[] = sprintf("%s (%s)", $zone[0], $zone[1]);
    $externalVals[] = $zone[1];
}
$externalTpl = new SelectItem("external_if");
$externalTpl->setElements($external);
Exemple #18
0
 * This file is part of Mandriva Management Console (MMC).
 *
 * MMC is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * 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_once 'modules/imaging/includes/includes.php';
require_once 'modules/imaging/includes/xmlrpc.inc.php';
$params = getParams();
$location = getCurrentLocation();
$item_uuid = $_GET['itemid'];
$label = urldecode($_GET['itemlabel']);
$ret = xmlrpc_moveItemUpInMenu4Location($location, $item_uuid);
if ($ret) {
    /* insert notification code here if needed */
} else {
    $str = sprintf(_T("Failed to move <strong>%s</strong> in the default boot menu", "imaging"), $label);
    new NotifyWidgetFailure($str);
}
header("Location: " . urlStrRedirect("imaging/manage/bootmenu", $params));
exit;
Exemple #19
0
 * (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_once "graph/navbar.inc.php";
require_once "includes/ajaxTools.php";
require "localSidebar.php";
// ajax tools search filter/type, date etc ...
displayInputLiveSearch(urlStrRedirect('base/logging/setsearch'));
$p = new PageGenerator(_("Logged actions"));
$p->setSideMenu($sidemenu);
$p->display();
?>

<div id="container">
</div>

<h2><?php 
echo _("Search action");
?>
</h2>

<div class="fixheight"></div>
<div style="height: 400px; overflow: auto;" id="logupdater"></div>
Exemple #20
0
/**
 * add a user
 * @param $login user's login
 * @param $pass user's pass
 * @param $firstname user's firstname
 * @param $name user's name
 * @param $homedir user home directory
 */
function add_user($login, $pass, $firstname, $name, $homedir, $createhomedir, $ownHomeDir, $primaryGroup = "")
{
    $param = array($login, prepare_string($pass), $firstname, $name, $homedir, $createhomedir, $ownHomeDir, $primaryGroup);
    $ret = xmlCall("base.createUser", $param);
    if ($ret == 5) {
        $msg = sprintf(_("User %s created but password is not valid regarding your password policies.<br/><strong>You must change the user password.</strong>"), $login) . "<br />";
        return array("code" => $ret, "info" => $msg);
    } else {
        if ($ret == 10) {
            $msg = _("You cannot add more users.") . "<br />";
            new NotifyWidgetFailure($msg);
            header('Location: ' . urlStrRedirect("base/users/index"));
            exit;
        } else {
            $msg = sprintf(_("User %s successfully created"), $login) . "<br />";
            return array("code" => $ret, "info" => $msg);
        }
    }
}
Exemple #21
0
    exit;
} else {
    $alias = urldecode($_GET["alias"]);
}
?>

<p><?php 
echo _T("You will delete the virtual mail alias ", "mail");
?>
 <strong><?php 
echo $alias;
?>
</strong>.</p>

<form action="<?php 
echo urlStrRedirect('mail/aliases/delete');
?>
" method="post">
    <input type="hidden" name="alias" value="<?php 
echo $alias;
?>
" />
    <input type="submit" name="bconfirm" class="btnPrimary" value="<?php 
echo _('Delete');
?>
" />
    <input type="submit" name="bback" class="btnSecondary" value="<?php 
echo _('Cancel');
?>
" onclick="new Effect.Fade('popup'); return false;" />
</form>
Exemple #22
0
 * This file is part of Mandriva Management Console (MMC).
 *
 * MMC is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * 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/mail/mainSidebar.php");
require("graph/navbar.inc.php");

$ajax = new AjaxFilter(urlStrRedirect("mail/domains/ajaxDomainFilter"));
$ajax->display();

$p = new PageGenerator(_T("Mail domains list", "mail"));
$p->setSideMenu($sidemenu);
$p->display();

$ajax->displayDivToUpdate();

?>
Exemple #23
0
    }
    setSubnetAuthoritative($subnet, isset($_POST["authoritative"]));
    /* Create or update the DHCP pools */
    $poolsRanges = isset($_POST["hassubnetpools"]) ? $poolsRanges : array();
    setPoolsRanges($subnet, $poolsRanges);
    if (!isXMLRPCError()) {
        if (isset($_POST["badd"])) {
            $n = new NotifyWidgetSuccess(_T("Subnet successfully added. You must restart the DHCP service."));
        } else {
            if (isset($_POST["bedit"])) {
                $n = new NotifyWidgetSuccess(_T("Subnet successfully modified. You must restart the DHCP service."));
            }
        }
        $services = getServicesNames();
        handleServicesModule($n, array($services[1] => "DHCP"));
        redirectTo(urlStrRedirect("network/network/subnetindex"));
    }
}
if (isset($error)) {
    new NotifyWidgetFailure($error);
    $subnet = $_POST["subnet"];
    $netmask = $_POST["netmask"];
    $hasSubnetPools = count($poolsRanges) ? "checked" : "";
}
if ($_GET["action"] == "subnetedit" && !isset($error)) {
    $subnetInfos = getSubnet($_GET["subnet"]);
    $subnet = $subnetInfos[0][1]["cn"][0];
    $netmask = $subnetInfos[0][1]["dhcpNetMask"][0];
    $description = $subnetInfos[0][1]["dhcpComments"][0];
    $options = getSubnetOptions($subnetInfos);
    $statements = getSubnetStatements($subnetInfos);
Exemple #24
0
 $ret_add = $group->addMembers($newmem);
 $res = $group->delMembers($delmem) && $ret_add[0];
 if ($res) {
     if ($already_exists) {
         if ($type == 0) {
             new NotifyWidgetSuccess(_T("Group successfully modified", "dyngroup"));
         } else {
             new NotifyWidgetSuccess(_T("Profile successfully modified", "dyngroup"));
         }
     } else {
         if ($type == 0) {
             new NotifyWidgetSuccess(_T("Group successfully created", "dyngroup"));
         } else {
             new NotifyWidgetSuccess(_T("Profile successfully created", "dyngroup"));
         }
         header("Location: " . urlStrRedirect("base/computers/display", array('gid' => $group->id)));
         exit;
     }
     $list = $group->members();
     $members = array();
     foreach ($list as $member) {
         $listOfMembers[$member['uuid']] = $member;
         $members[$member['hostname'] . "##" . $member['uuid']] = $member['hostname'];
     }
     #if ($visibility == 'show') {
     #    if ($type == 0) {
     #        //header("Location: " . urlStrRedirect("base/computers/computersgroupcreator", array('tab'=>'tabsta', 'id'=>$group->id)));
     #    } else {
     #        //header("Location: " . urlStrRedirect("base/computers/computersprofilecreator", array('tab'=>'tabsta', 'id'=>$group->id)));
     #    }
     #}
Exemple #25
0
 * MMC is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * 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 "localSidebar.php";
require "graph/navbar.inc.php";
$ajax = new AjaxFilter(urlStrRedirect("base/users/ajaxFilter"));
$ajax->display();
$p = new PageGenerator(_("User list"));
$p->setSideMenu($sidemenu);
$p->display();
$ajax->displayDivToUpdate();
?>

<script type="text/javascript">
jQuery(function(){
 var $ = jQuery;
 $('#container').addClass('user_container');
});
</script>
Exemple #26
0
         addVDomain($domainname);
         setVDomainDescription($domainname, $description);
         if (strlen($domainquota) == 0) {
             $domainquota = "0";
         }
         setVDomainQuota($domainname, $domainquota);
         $result = _T("The mail domain has been added.", "mail");
     }
     // Display error message
     if ($error) {
         new NotifyWidgetFailure($error);
     }
     // Display result message
     if ($result && !isXMLRPCError()) {
         new NotifyWidgetSuccess($result);
         header("Location: " . urlStrRedirect("mail/domains/index"));
         exit;
     }
 } else {
     if (isset($_POST["bedit"]) || isset($_POST["breset"])) {
         setVDomainDescription($domainname, $description);
         if (strlen($domainquota)) {
             setVDomainQuota($domainname, $domainquota);
         }
         $result = _T("The mail domain has been modified.", "mail") . "<br />";
         if (isset($_POST["breset"])) {
             resetUsersVDomainQuota($domainname);
             $result .= _T(" The quota of all users of this mail domain have been reset.") . "<br />";
         }
         // Display result message
         if ($result && !isXMLRPCError()) {
Exemple #27
0
    if (isset($_GET['mod'])) {
        $mod = $_GET['mod'];
    } else {
        $mod = "none";
    }
    switch ($mod) {
        case 'details':
            log_details();
            break;
        default:
            log_list();
            break;
    }
} else {
    # register the target (computer or profile)
    $params = array('target_uuid' => $target_uuid, 'type' => $type, 'from' => "services", "target_name" => $target_name);
    header("Location: " . urlStrRedirect("base/computers/" . $type . "register_target", $params));
    exit;
}
function log_details()
{
    echo 'details';
}
function log_list()
{
    $ajax = new AjaxFilter("modules/imaging/imaging/ajaxLogs.php", "container", getParams());
    //$ajax->setRefresh(10000);
    $ajax->display();
    echo '<br/><br/><br/>';
    $ajax->displayDivToUpdate();
}
Exemple #28
0
 * $Id$
 *
 * This file is part of Management Console.
 *
 * MMC is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * 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 "localSidebar.php";
require "graph/navbar.inc.php";
$zone = $_GET["zone"];
$ajax = new AjaxFilter(urlStrRedirect("network/network/ajaxZoneMembersFilter", array("zone" => $zone)));
$ajax->display();
$p = new PageGenerator(sprintf(_T("Members of zone %s"), $zone));
$sidemenu->forceActiveItem("index");
$p->setSideMenu($sidemenu);
$p->display();
$ajax->displayDivToUpdate();
$f = new Form();
$f->addOnClickButton(_T("Add a host"), urlStr("network/network/addhost", array("zone" => $zone)));
$f->display();
Exemple #29
0
foreach (getPolicies() as $policy) {
    if (startsWith($policy[0], $src) && startsWith($policy[1], $dst)) {
        $label = sprintf("%s (%s) → %s (%s)", getZoneType($policy[0]), $policy[0], getZoneType($policy[1]), $policy[1]);
        $decisionTpl = new SelectItem($policy[0] . "_" . $policy[1] . "_policy");
        $decisionTpl->setElements(array(_T("Accept"), _T("Drop")));
        $decisionTpl->setElementsVal(array("ACCEPT", "DROP"));
        $decisionTpl->setSelected($policy[2]);
        $f->add(new TrFormElement($label, $decisionTpl));
    }
}
$f->pop();
$f->addButton("bpolicy", _T("Save"));
$f->display();
print '<br />';
// Rules list display
$ajax = new AjaxFilter(urlStrRedirect("shorewall/shorewall/ajax_" . $page));
$ajax->display();
$t = new TitleElement(_T("Port forwarding rules"), 2);
$t->display();
$ajax->displayDivToUpdate();
// Add rule form
print '<script type="text/javascript" src="modules/shorewall/includes/functions.js"></script><br />';
$t = new TitleElement(_T("Add port forwarding rule"), 2);
$t->display();
$f = new ValidatingForm(array("id" => "rule"));
$f->push(new Table());
$macros = getServices();
$services = array("", _T("Custom...")) + $macros;
$servicesVals = array("", "custom") + $macros;
$serviceTpl = new SelectItem("service", "toggleCustom");
$serviceTpl->setElements($services);
Exemple #30
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();
}