Exemplo n.º 1
0
 function display()
 {
     $lines = array();
     $errlines = array();
     foreach ($this->logs as $line => $msg) {
         if (strpos($msg, "===") === 0) {
             $msg = "<b>" . "{$msg}" . "</b>";
         } else {
             if (strpos($msg, $this->errstr) === 0) {
                 $msg = "<span id=\"err{$line}\" class=\"LOG_ERR\">" . "{$msg}" . "</span>";
                 $errlines[] = $line;
             }
         }
         foreach ($this->colors as $pattern => $color) {
             if (strpos($msg, $pattern) > 0) {
                 $msg = "<span id=\"err{$line}\" class=\"{$color}\">" . "{$msg}" . "</span>";
                 continue;
             }
         }
         $lines[] = sprintf("<span class=\"linenumber\">%04d:</span>", $line) . " " . $msg;
     }
     foreach ($errlines as $line) {
         print "<p class =\"LOG_ERR\" onClick=\"javascript:new Element.scrollTo('err{$line}');\">Click here to scroll to error on line {$line}.</p>";
     }
     $l = new ListInfos($lines, _T("Backup log messages", "imaging"));
     $l->setCssClass("imagelogs");
     $l->setRowsPerPage(count($lines));
     $l->setNavBar(False);
     $l->display(0, 1);
 }
Exemplo n.º 2
0
 * 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";
$filter = $_GET['filter'];
$computers = search_machines($filter);
//print_r($computers);
$names = array();
$desc = array();
$active = array();
foreach ($computers as $computer) {
    $names[] = $computer[0];
    $desc[] = $computer[1];
    $active[] = $computer[2];
}
$l = new ListInfos($names, _T("Computer name", "samba"));
$l->disableFirstColumnActionLink();
$l->setCssClass("machineName");
$l->setNavBar(new AjaxNavBar(count($computers), $filter));
$l->addExtraInfo($desc, _T("Description", "samba"));
$l->addExtraInfo($active, _T("Active", "samba"));
$l->addActionItem(new ActionItem(_T("Edit"), "edit", "edit", "machine"));
$l->addActionItem(new ActionPopupItem(_T("Delete"), "delete", "delete", "machine"));
$l->setName(_("Computers"));
$l->display();
Exemplo n.º 3
0
 *
 * 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/base/includes/groups.inc.php";
$filter = $_GET["filter"];
$groups = search_groups($filter);
$groupcount = count($groups);
$arrGroup = array();
$arrComment = array();
for ($idx = 0; $idx < count($groups); $idx++) {
    $arrGroup[] = $groups[$idx][0];
    $arrComment[] = $groups[$idx][1];
    $arrNb[] = '<span style="font-weight: normal;">(' . $groups[$idx][2] . ')</span>';
}
$n = new ListInfos($arrGroup, _("Groups"));
$n->setCssClass("groupName");
$n->addExtraInfo($arrComment, _("Comments"));
$n->setAdditionalInfo($arrNb);
$n->setNavBar(new AjaxNavBar($groupcount, $filter));
$n->addActionItem(new ActionItem(_("Edit members"), "members", "display", "group"));
$n->addActionItem(new ActionItem(_("Edit group"), "edit", "edit", "group"));
$n->addActionItem(new ActionPopupItem(_("Delete"), "delete", "delete", "group"));
$n->setName(_("Groups management"));
$n->display();
Exemplo n.º 4
0
<?php

$domain = $_GET["domain"];
if (isset($_GET["filter"])) {
    $filter = $_GET["filter"];
} else {
    $filter = "";
}
$uids = array();
foreach (getVDomainUsers($domain, $filter) as $dn => $entries) {
    $mail = htmlentities($entries[1]["mail"][0]);
    $uids[$entries[1]["uid"][0]] = array($entries[1]["givenName"][0] . " " . $entries[1]["sn"][0], '<a href="' . "mailto:" . $mail . '">' . $mail . "</a>");
}
ksort($uids);
$names = array();
$mails = array();
foreach ($uids as $uid) {
    $names[] = $uid[0];
    $mails[] = $uid[1];
}
$n = new ListInfos(array_keys($uids), _("Login"), "&mail={$domain}");
$n->setNavBar(new AjaxNavBar(count($uids), $filter));
$n->setCssClass("userName");
$n->addExtraInfo($names, _("Name"));
$n->addExtraInfo($mails, _("Mail address"));
$n->addActionItem(new ActionItem(_("Edit"), "edit", "edit", "user", "base", "users"));
$n->display();
Exemplo n.º 5
0
$sharesName = array();
$sharesComment = array();
$editActions = array();
$delActions = array();
//$backupActions = array();
foreach ($shares as $share) {
    $sharesName[] = $share[0];
    if (isset($share[1])) {
        $sharesComment[] = $share[1];
    } else {
        $sharesComment[] = "";
    }
    if (!in_array($share[0], $protectedShare)) {
        $editActions[] = new ActionItem(_T("Edit"), "details", "edit", "share");
        $delActions[] = new ActionPopupItem(_T("Delete"), "delete", "delete", "share");
    } else {
        $editActions[] = new EmptyActionItem();
        $delActions[] = new EmptyActionItem();
    }
}
$p = new PageGenerator(_T("Shares"));
$p->setSideMenu($sidemenu);
$p->display();
$l = new ListInfos($sharesName, _T("Shares"));
$l->setCssClass("shareName");
$l->addExtraInfo($sharesComment, _T("Description"));
$l->addActionItemArray($editActions);
$l->addActionItemArray($delActions);
$l->addActionItem(new ActionPopupItem(_T("Archive"), "backup", "backup", "share"));
$l->disableFirstColumnActionLink();
$l->display();
Exemplo n.º 6
0
        $shareDescription = "(" . _T("Hidden", "samba4") . ") ";
    }
    $shareDescription = isset($share[$shareComponent["description"]]) ? $shareDescription . $share[$shareComponent["description"]] : "";
    $sharesDescription[] = $shareDescription;
    $sharesGuestAccess[] = isset($share[$shareComponent["guest_access"]]) ? $share[$shareComponent["guest_access"]] : "";
    if (isset($protectedShares) and !in_array($share[$shareComponent["name"]], $protectedShares)) {
        $editActions[] = new ActionItem(_T("Edit", "samba4"), "edit", "edit", "share");
        $delActions[] = new ActionPopupItem(_T("Delete", "samba4"), "delete", "delete", "share");
    } else {
        $editActions[] = new EmptyActionItem();
        $delActions[] = new EmptyActionItem();
    }
}
$page = new PageGenerator(_T("Current list of shares", "samba4"));
$page->setSideMenu($sidemenu);
$page->display();
$list = new ListInfos($sharesName, _T("Share", "samba4"));
$list->setCssClass("shareName");
$list->setCssClasses($sharesEnabled);
$list->addExtraInfo($sharesPath, _T("Path", "samba4"));
$list->addExtraInfo($sharesDescription, _T("Description", "samba4"));
$list->addActionItemArray($editActions);
$list->addActionItemArray($delActions);
$list->addActionItem(new ActionPopupItem(_T("Archive", "samba4"), "backup", "backup", "share"));
$list->disableFirstColumnActionLink();
$list->display();
/* Private functions */
function _shareIsEnabled($share)
{
    return isset($share[2]) and $share[2];
}
Exemplo n.º 7
0
 */
require "modules/samba4/includes/machines-xmlrpc.inc.php";
$filter = $_GET['filter'];
$domainMembers = listDomainMembers();
if (!isset($domainMembers) or !$domainMembers) {
    $domainMembers = array();
}
$names = array();
$descriptions = array();
$computersEnabled = array();
foreach ($domainMembers as $computer) {
    $name = $computer["name"];
    if (!$computer["enabled"]) {
        $computersEnabled[] = "disabledRow";
        $name .= " (" . _T("Disabled") . ") ";
    } else {
        $computersEnabled[] = "enabledRow";
    }
    $names[] = $name;
    $descriptions[] = $computer["description"];
}
$list = new ListInfos($names, _T("Computer name", "samba4"));
$list->disableFirstColumnActionLink();
$list->setCssClass("machineName");
$list->setCssClasses($computersEnabled);
$list->setNavBar(new AjaxNavBar(count($domainMembers), $filter));
$list->addExtraInfo($descriptions, _T("Description", "samba4"));
$list->addActionItem(new ActionItem(_T("Edit"), "edit", "edit", "machine"));
//$list->addActionItem(new ActionPopupItem(_T("Delete"),"delete","delete","machine"));
$list->setName(_("Computers"));
$list->display();
Exemplo n.º 8
0
<?php

require_once "modules/mail/includes/mail-xmlrpc.php";
if (isset($_GET["filter"])) {
    $filter = $_GET["filter"];
} else {
    $filter = "";
}
$domains = array();
$count = array();
foreach (getVDomains($filter) as $dn => $entry) {
    $domains[$entry[1]["virtualdomain"][0]] = $entry[1]["virtualdomaindescription"][0];
}
ksort($domains);
foreach ($domains as $domain => $info) {
    $count[] = '<span style="font-weight: normal;">(' . getVDomainUsersCount($domain) . ')</span>';
}
$n = new ListInfos(array_keys($domains), _T("Mail domain", "mail"));
$n->setNavBar(new AjaxNavBar(count($domains), $filter));
$n->setAdditionalInfo($count);
$n->first_elt_padding = 1;
$n->setCssClass("domainName");
$n->addExtraInfo(array_values($domains), _T("Description", "mail"));
$n->setName(_T("Mail domain", "mail"));
$n->addActionItem(new ActionItem(_T("View domain members", "mail"), "members", "display", "domain", "mail", "domains"));
$n->addActionItem(new ActionItem(_T("Edit domain", "mail"), "edit", "edit", "domain", "mail", "domains"));
$n->addActionItem(new ActionPopupItem(_T("Delete domain", "mail"), "delete", "delete", "domain", "mail", "domains"));
$n->display();
Exemplo n.º 9
0
 * 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/>.
 */
require_once "modules/mail/includes/mail.inc.php";
if (isset($_GET["filter"])) {
    $filter = $_GET["filter"];
} else {
    $filter = "";
}
$aliases = array();
$count = array();
$active = array();
foreach (getVAliases($filter) as $dn => $entry) {
    $aliases[$entry[1]["mailalias"][0]] = $entry[1]["mailalias"][0];
    $active[] = $entry[1]["mailenable"][0] == "OK" ? true : false;
    $count[] = ' (' . (count($entry[1]["mailaliasmember"]) + count($entry[1]["mail"])) . ')';
}
$n = new ListInfos(array_keys($aliases), _T("Virtual alias", "mail"));
$n->setNavBar(new AjaxNavBar(count($aliases), $filter));
$n->setAdditionalInfo($count);
$n->addExtraInfo($active, _T("Enabled", "mail"));
$n->first_elt_padding = 1;
$n->setCssClass("virtualAlias");
$n->setName(_T("Virtual alias", "mail"));
$n->addActionItem(new ActionItem(_T("Edit alias", "mail"), "edit", "edit", "alias", "mail", "aliases"));
$n->addActionItem(new ActionPopupItem(_T("Delete alias", "mail"), "delete", "delete", "alias", "mail", "aliases"));
$n->display();