コード例 #1
0
<?php

/****************************************************************
 * This File loads the "Groups -> Access per Page" Tab.
 * It allows to manage the groups with access to every page.
 * The information is presented from a Page Point of View. 
 ***************************************************************/
$groups = new userGroups();
$mode = $_REQUEST['mode'];
$cancel = $_REQUEST['cancel'];
switch ($cancel) {
    case 1:
        $groups->write("Page access edit canceled.");
        break;
    default:
        break;
}
if ($mode == "update") {
    $message = "Groups access rights for page <b>" . get_the_title($_REQUEST['id']) . "</b> were updated sucessfully.";
    $groups->write($message);
}
if ($_REQUEST['id'] == "" && $mode == "edit") {
    $groups->write("Error: invalid arguments.");
}
?>

<div class="wrap">
<?php 
//prints a page with its groups and then prints the same for its children
function userGroups_PrintPagesWithGroups($level = 0, $parentID = 0, $alt = true)
{
コード例 #2
0
<?php

/****************************************************
 * This File loads the Groups -> Members Tab
 * It allows to manage the groups members (users) 
 ****************************************************/
$groups = new userGroups();
$mode = $_REQUEST['mode'];
if ($mode == "update") {
    $group_temp = $groups->getGroup($_REQUEST['id']);
    $groups->write("Groups access to <b>" . $group_temp->name . "</b> updated.");
}
if ($_REQUEST['id'] == "" && ($mode == "edit" || $mode == "update")) {
    $groups->write("Invalid group.");
}
$cancel = $_REQUEST['cancel'];
switch ($cancel) {
    case 1:
        $groups->write("Group members edit canceled.");
        break;
    default:
        break;
}
?>

<div class="wrap">
<?php 
//prints a page with its groups and then prints the same for its children
function userGroups_PrintGroupMembers()
{
    $groups = new userGroups();
コード例 #3
0
<?php

/************************************************************
 * This File loads the "Groups -> Pages" Tab
 * It allows to manage the groups' access to pages.
 * The information is presented from a Group Point of View. 
 ************************************************************/
$groups = new userGroups();
$mode = $_REQUEST['mode'];
$cancel = $_REQUEST['cancel'];
if ($mode == "update") {
    $message = "Pages access rights for group <b>" . $_REQUEST['groupName'] . "</b> were updated sucessfully.";
    $groups->write($message);
}
switch ($cancel) {
    case 1:
        $groups->write("Group access edit canceled.");
        break;
    default:
        break;
}
if ($_REQUEST['id'] == "" && $mode == "edit") {
    $groups->write("Invalid page.");
}
?>

<div class="wrap">
<?php 
/**
 *  prints the page and the access values
 **/
コード例 #4
0
	<?php 
        $i++;
    }
    ?>

</table>
<?php 
} else {
    echo "<p><strong>No groups available.</strong></p>";
}
?>
</div>
<?php 
if ($errorMessage != "") {
    $groups->write($errorMessage, false, "msg");
}
if ($mode != "edit") {
    ?>
<div class="wrap" id="new">
<h2>Create Group</h2>
<form
	action="<?php 
    echo $_SERVER['PHP_SELF'];
    ?>
?page=wp-group-restriction/wp-group-restriction.php&amp;mode=add#msg"
	method="post"><?php 
    $submitName = "Create";
} else {
    $submitName = "Update";
    ?>