Exemplo n.º 1
0
function tools()
{
    // does a second check to ensure you still are an admin and got to this page some how.
    if (checkadmin()) {
        //add admin
        if (isset($_POST['addAdmin'])) {
            // if the add admin button is selected do the add admin function
            addAdmin();
        }
        //add location
        if (isset($_POST['addLocation'])) {
            // same thing as the add admin but for locations
            addLocation();
        }
        //add professor
        if (isset($_POST['addProfessor'])) {
            // now for professors
            addProfessor();
        }
        //add class
        if (isset($_POST['addClass'])) {
            // finally for classes
            addClass();
        }
    } else {
        header("Location:../index.php");
        // if you fail the check go back to index.php and does give the user an error.
    }
}
Exemplo n.º 2
0
    //si on a cliqué sur ajout/supp admin
    if ($action == 'ajouteAdmin') {
        $res = addAdmin($_GET['dn_user'], "CN=Maintenance_administrateur,CN=Users,DC=CODIF,DC=FR");
    }
    if ($action == 'retireAdmin') {
        $res = suppAdmin($_GET['dn_user'], "CN=Maintenance_administrateur,CN=Users,DC=CODIF,DC=FR");
    }
    $liste_services = listeService();
    $groupes = array();
    for ($i = 0; $i < count($liste_services) - 1; $i++) {
        $nom_groupe = $liste_services[$i]["cn"][0];
        $groupes[] = $nom_groupe;
    }
    //si on a cliqué sur ajout/supp admin_contrat
    if ($action == 'ajouteAdminContrat') {
        $res = addAdmin($_GET['dn_user'], "CN=Maintenance_contrat,CN=Users,DC=CODIF,DC=FR");
    }
    if ($action == 'retireAdminContrat') {
        $res = suppAdmin($_GET['dn_user'], "CN=Maintenance_contrat,CN=Users,DC=CODIF,DC=FR");
    }
    $liste_services = listeService();
    $groupes = array();
    for ($i = 0; $i < count($liste_services) - 1; $i++) {
        $nom_groupe = $liste_services[$i]["cn"][0];
        $groupes[] = $nom_groupe;
    }
    echo "<div id=ligne></div>";
} else {
    ?>
            <div align=center>
                <h2> Connexion non valide</h2>
Exemplo n.º 3
0
<?php

/**
 * Created by PhpStorm.
 * User: ning-pc
 * Date: 15/8/16
 * Time: 下午3:18
 */
require_once '../include.php';
$act = $_REQUEST['act'];
$id = $_REQUEST['id'];
if ($act == 'logout') {
    logout();
} elseif ($act == 'addAdmin') {
    $msg = addAdmin();
} elseif ($act == 'editAdmin') {
    $msg = editAdmin($id);
} elseif ($act == 'delAdmin') {
    $msg = delAdmin($id);
}
?>
<h1><?php 
echo $msg;
?>
</h1>
Exemplo n.º 4
0
<?php

require_once '../include.php';
$act = $_REQUEST['act'];
@($id = $_REQUEST['id']);
if ($act == "logout") {
    $mes = logout();
} elseif ($act == "addAdmin") {
    $mes = addAdmin();
} elseif ($act == "editAdmin") {
    $mes = editAdmin($id);
} elseif ($act == "delAdmin") {
    $mes = delAdmin($id);
} elseif ($act == "addCate") {
    $mes = addCate();
} elseif ($act == "delCate") {
    $mes = delCate($id);
} elseif ($act == "editCate") {
    $mes = editCate($id);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

<?php 
if ($mes) {
Exemplo n.º 5
0
                break;
            case "addDrinkTrait":
                addDrink();
                break;
            case "removeDrink":
                removeDrink();
                break;
            case "removeDrinkTrait":
                removeDrinkTrait();
                break;
            case "removeUser":
                removeUser();
                break;
            case "getUsers":
                getUsers();
                break;
            case "AddAdmin":
                AddDrink();
                break;
            case "getDrinks":
                getDrinks();
                break;
            case "addAdmin":
                addAdmin();
                break;
            case "getDrinkNamesAndTraits":
                getDrinkNamesAndTraits();
                break;
        }
    }
}
Exemplo n.º 6
0
        break;
    case 5:
        //Logmode
        # code...
        break;
    case 6:
        //Save
        # code...
        break;
    case 7:
        //Set
        # code...
        break;
    case 8:
        //Status
        $status = getStatus($_GET['serverid']);
        echo $status['string'];
        break;
    case 9:
        // addAdmin
        addAdmin($_GET['admin_id'], $_GET['serverid'], $_SESSION['userid']);
        break;
    case 10:
        // kickAdmin
        echo kickAdmin($_GET['admin_id'], $_GET['serverid'], $_SESSION['userid']);
        break;
    default:
        echo "no action";
        break;
}
echo $_SESSION['userid'];