PHP Classes
elePHPant
Icontem

File: phpsecureweb/groups.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Bulent Tezcan  >  phpsecureweb  >  phpsecureweb/groups.php  >  Download  
File: phpsecureweb/groups.php
Role: Application script
Content type: text/plain
Description: deals with groups
Class: phpsecureweb
Allow users certain rights, login with password.
Author: By
Last change:
Date: 12 years ago
Size: 1,299 bytes
 

Contents

Class file image Download
<?php
   
/*
    * @author Bulent Tezcan. bulent@greenpepper.ca
    */

   
require_once "Security.class.php";

    require_once
"Groups.class.php";

   
session_start();

   
$Groups = new Groups();
   
$mySecurity = new Security( );
   
   
#
    # This should be added in every script. Ofcourse the action name
    # will be different for each script.
    #
   
if ($mySecurity-> isNotAllowedTo('Add Group') and
           
$mySecurity-> isNotAllowedTo('Delete Group') and
           
$mySecurity-> isNotAllowedTo('Modify Group') and
           
$mySecurity-> isNotAllowedTo('View Group'))
    {
        if (
$mySecurity-> isAllowedTo('Show Admin Menu'))
           
$mySecurity-> GotoThisPage( "adminmenu.php" );
        else
           
$mySecurity-> GotoThisPage( "login.php" );
    }

   
ob_start( );

    include
"header.inc.php";
   
   
$FormElements = $_POST['form_GroupsForm'];

    if (
$FormElements["B_clear"])
        unset (
$FormElements);

    if (
$mySecurity-> isAllowedTo('Add Group'))
    {
        if (
$FormElements["B_add_submit"])
            if (
$Groups->AddGroup($FormElements))
            {
                unset (
$FormElements);
               
$FormElements['__error'] = "Group has been added sucessfully.";
            }
       
        echo
$Groups->SendGroupsForm($FormElements,null);
    }

   
$Groups->ListGroups();
   
    include
"donate.inc.php";

    include
"footer.inc.php";

   
ob_end_flush( );

    return
true;
?>