Example #1
0
include 'func/class.login.php';
include 'func/func.php';
header_show("Accueil", "style");
// LOGIN START
$log = new logmein();
$log->encrypt = true;
//set encryption
//parameters are(SESSION, name of the table, name of the password field, name of the username field)
if ($log->logincheck($_SESSION['loggedin'], "logon", "password", "useremail") == false) {
    echo '<meta http-equiv="refresh" content="0; URL=index.php">';
} else {
    //LOGIN END
    $computername = script("getcomputername");
    $windowsver = script("windows");
    $windowsver = dosencode($windowsver);
    // INTERFACE
    echo '<form name="accform" action="confirm_computername.php" onsubmit="return validateForm()" method="post">';
    // INFORMATIONS GENERALES
    echo "<table align=center>";
    menu_img("logout", "logout", "Se déconnecter");
    echo '<td><INPUT type="text" value="' . $computername . '" name="computername"></td>';
    menu_img("shutdown", "shutdown", "Arrêter WebManage");
    echo '</table>';
    text($windowsver);
    // CONFIGURATION
    title('Configuration');
    echo '<table align=center>';
    menu("reseau", "network", "Configuration Réseau");
    menu_popup("chat", "messagerie", "Messagerie");
    menu("lan", "scan_net", "Voisinage réseau");
include 'func/func.php';
// LOGIN START
$log = new logmein();
$log->encrypt = true;
//set encryption
//parameters are(SESSION, name of the table, name of the password field, name of the username field)
if ($log->logincheck($_SESSION['loggedin'], "logon", "password", "useremail") == false) {
    echo '<meta http-equiv="refresh" content="0; URL=index.php">';
} else {
    //LOGIN END
    header_show("Confirmation", "style");
    $arg1 = $_POST['computername'];
    $arg2 = $_POST['oldcompname'];
    notify("info", "Informations", "L'administrateur réseau requiert votre attention");
    $modcn = script(computername);
    $modcn = dosencode($modcn);
    if ($modcn == "OK") {
        title("Action acceptée");
        $rep = exec('c:\\windows\\system32\\cscript.exe ./vbs/changecn.vbs ' . $arg1);
        if ($rep == 1) {
            text("Le changement de nom a échoué");
            back();
        }
        if ($rep == 0) {
            text("Le changement de nom est un succés!");
            menu("reboot", "reboot", "Rebooter");
            back();
        }
    } else {
        title("Action refusée");
        if ($modcn == "") {