예제 #1
0
$action = !empty($_POST['edit']) ? 'edit' : (!empty($_GET['del']) ? 'del' : FALSE);
if (!empty($id) && $action) {
    if ($action == 'edit' && @$_POST['name']) {
        Admin::checkAccess(AdminAccess::ACCESS_EDIT);
        $stb_groups->set(array('name' => $_POST['name']), $_GET['id']);
    } elseif ($action == 'del') {
        Admin::checkAccess(AdminAccess::ACCESS_DELETE);
        $stb_groups->del($id);
    }
    header("Location: stbgroups.php");
    exit;
}
if (@$_GET['edit'] && !empty($id)) {
    $action_name = 'edit';
    $action_value = _('Save');
    $edit_group = $stb_groups->getById($id);
}
$groups = $stb_groups->getAll();
$debug = '<!--' . ob_get_contents() . '-->';
ob_clean();
echo $debug;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">

body {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
}
예제 #2
0
<?php

session_start();
ob_start();
include "./common.php";
$error = '';
$action_name = 'add';
$action_value = _('Add');
Admin::checkAuth();
Admin::checkAccess(AdminAccess::ACCESS_VIEW);
foreach (@$_POST as $key => $value) {
    $_POST[$key] = trim($value);
}
$id = @intval($_GET['id']);
$stb_groups = new StbGroup();
$group = $stb_groups->getById($_GET['group_id']);
if (empty($group)) {
    echo 'wtf?';
    exit;
}
if (@$_POST['add']) {
    Admin::checkAccess(AdminAccess::ACCESS_CREATE);
    $stb_groups->addMember(array('mac' => Middleware::normalizeMac($_POST['mac']), 'uid' => Middleware::getUidByMac($_POST['mac']), 'stb_group_id' => $_GET['group_id']));
    header("Location: stbgroup_members.php?group_id=" . @$_GET['group_id']);
    exit;
}
$action = !empty($_POST['edit']) ? 'edit' : (!empty($_GET['del']) ? 'del' : FALSE);
if (!empty($id) && $action) {
    if ($action == 'edit') {
        Admin::checkAccess(AdminAccess::ACCESS_EDIT);
        $stb_groups->setMember(array('mac' => Middleware::normalizeMac($_POST['mac']), 'uid' => Middleware::getUidByMac($_POST['mac'])), $id);