コード例 #1
0
ファイル: nodes.php プロジェクト: BillTheBest/1.6.x
if (!$usersmenus->AsAnAdministratorGeneric) {
    $tpl = new templates();
    $alert = $tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}');
    echo "alert('{$alert}');";
    die;
}
if (isset($_GET["tabs"])) {
    tabs();
    exit;
}
if (isset($_GET["status"])) {
    status();
    exit;
}
if (isset($_GET["network"])) {
    network();
    exit;
}
if (isset($_GET["softwares"])) {
    softwares();
    exit;
}
if (isset($_GET["delete-node-js"])) {
    delete_node_js();
    exit;
}
if (isset($_GET["reboot-node-js"])) {
    reboot_node_js();
    exit;
}
if (isset($_GET["hostname-node-js"])) {
コード例 #2
0
	include_once('ressources/class.ldap.inc');
	include_once('ressources/class.users.menus.inc');
	
	
	
	if(posix_getuid()==0){die();}
	
	$user=new usersMenus();
	if($user->AsVirtualBoxManager==false){
		$tpl=new templates();
		echo "alert('". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');";
		die();exit();
	}
	
	if(isset($_GET["popup"])){popup();exit;}
	if(isset($_GET["network"])){network();exit;}
	if(isset($_GET["usb"])){usb_drivers();exit;}
	if(isset($_GET["sound"])){sound_drivers();exit;}
	if(isset($_GET["storage"])){storage_module();exit;}
	if(isset($_GET["module"])){save_module();exit;}
	if(isset($_GET["package"])){save_package();exit;}
	if(isset($_GET["keyboard"])){keyboard_drivers();exit;}
	if(isset($_GET["video"])){video_drivers();exit;}
	if(isset($_GET["filesystem"])){filesystem_drivers();exit;}
	if(isset($_GET["rebuild-default-warn"])){buildDefault();exit;}
	
	
	
js();

function js(){
コード例 #3
0
ファイル: index.php プロジェクト: hardikk/HNH
function endpointConfiguratedSet($smarty, $module_name, $local_templates_dir, $dsnAsterisk, $dsnSqlite, $arrConf)
{
    $paloEndPoint = new paloSantoEndPoint($dsnAsterisk, $dsnSqlite);
    $paloFileEndPoint = new PaloSantoFileEndPoint($arrConf["tftpboot_path"], $_SESSION["endpoint_mask"]);
    $arrFindVendor = array();
    //variable de ayuda, para llamar solo una vez la funcion createFilesGlobal de cada vendor
    $valid = validateParameterEndpoint($_POST, $module_name, $dsnAsterisk, $dsnSqlite);
    $count = 0;
    $error = "";
    if ($valid != false) {
        $smarty->assign("mb_title", _tr('ERROR') . ":");
        $smarty->assign("mb_message", $valid);
        $endpoint_mask = isset($_POST['endpoint_mask']) ? $_POST['endpoint_mask'] : network();
        return buildReport($_SESSION['elastix_endpoints'], $smarty, $module_name, $endpoint_mask);
    }
    foreach ($_POST as $key => $values) {
        if (substr($key, 0, 6) == "epmac_") {
            //encontre una mac seleccionada entoces por forma empirica con ayuda del mac_adress obtego los parametros q se relacionan con esa mac.
            $tmpMac = substr($key, 6);
            $count++;
            $tech = $paloEndPoint->getTech($_POST["id_device_{$tmpMac}"]);
            $freePBXParameters = $paloEndPoint->getDeviceFreePBXParameters($_POST["id_device_{$tmpMac}"], $tech);
            $tmpEndpoint['id_device'] = $freePBXParameters['id_device'];
            $tmpEndpoint['desc_device'] = $freePBXParameters['desc_device'];
            $tmpEndpoint['account'] = $freePBXParameters['account_device'];
            $tmpEndpoint['secret'] = $freePBXParameters['secret_device'];
            $tmpEndpoint['id_model'] = $_POST["id_model_device_{$tmpMac}"];
            $tmpEndpoint['mac_adress'] = $tmpMac;
            $tmpEndpoint['id_vendor'] = $_POST["id_vendor_device_{$tmpMac}"];
            $tmpEndpoint['name_vendor'] = $_POST["name_vendor_device_{$tmpMac}"];
            $tmpEndpoint['ip_adress'] = $_POST["ip_adress_endpoint_{$tmpMac}"];
            $tmpEndpoint['comment'] = "Nada";
            //Variables usadas para parametros extras
            $name_model = $paloEndPoint->getModelById($tmpEndpoint['id_model']);
            $arrParametersOld = $paloEndPoint->getParameters($tmpEndpoint['mac_adress']);
            $arrParameters = $paloFileEndPoint->updateArrParameters($tmpEndpoint['name_vendor'], $name_model, $arrParametersOld);
            $tmpEndpoint['arrParameters'] = $arrParameters;
            if ($paloEndPoint->createEndpointDB($tmpEndpoint)) {
                //verifico si la funcion createFilesGlobal del vendor ya fue ejecutado
                if (!in_array($tmpEndpoint['name_vendor'], $arrFindVendor)) {
                    if ($paloFileEndPoint->createFilesGlobal($tmpEndpoint['name_vendor'])) {
                        $arrFindVendor[] = $tmpEndpoint['name_vendor'];
                    }
                }
                //escribir archivos
                $ArrayData['vendor'] = $tmpEndpoint['name_vendor'];
                $ArrayData['data'] = array("filename" => strtolower(str_replace(":", "", $tmpMac)), "DisplayName" => $tmpEndpoint['desc_device'], "id_device" => $tmpEndpoint['id_device'], "secret" => $tmpEndpoint['secret'], "model" => $name_model, "ip_endpoint" => $tmpEndpoint['ip_adress'], "arrParameters" => $tmpEndpoint['arrParameters'], "tech" => $tech);
                //Falta si hay error en la creacion de un archivo, ya esta para saber q error es, el problema es como manejar un error o los errores dentro del este lazo (foreach).
                //ejemplo: if($paloFile->createFiles($ArrayData)==false){ $paloFile->errMsg  (mostrar error con smarty)}
                if (!$paloFileEndPoint->createFiles($ArrayData)) {
                    if (isset($paloFileEndPoint->errMsg)) {
                        $error .= $paloFileEndPoint->errMsg . "<br />";
                    }
                }
            }
        }
    }
    if ($count > 0 && $error == "") {
        $smarty->assign("mb_title", _tr("MESSAGE"));
        $smarty->assign("mb_message", _tr("The Extension(s) parameters have been saved. Each checked phone will be configured with the new parameters once it has finished rebooting"));
    } elseif (isset($error) && $error != "") {
        $smarty->assign("mb_title", _tr("MESSAGE"));
        $message = _tr("The following errors ocurred") . ":<br />" . $error;
        $smarty->assign("mb_message", $message);
    }
    unset($_SESSION['elastix_endpoints']);
    return endpointConfiguratedShow($smarty, $module_name, $local_templates_dir, $dsnAsterisk, $dsnSqlite, $arrConf);
}
コード例 #4
0
ファイル: scan_net.php プロジェクト: madnerdTRASH/webmanage
include 'func/class.login.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
    $ips = script_wmi(ipaddress);
    $masks = script_wmi(netmask);
    $ip = trim($ips[1]);
    $mask = trim($masks[1]);
    $cidr = mask2cidr($mask);
    $network = network($ip, $mask);
    $network_scan = $network . "/" . $cidr;
    $result = scan_netbios($network_scan, $cidr);
    $result = str_replace("MACAddress", "", $result);
    $result = str_replace("ComputerName", "", $result);
    $result = str_replace("Sharing", "", $result);
    $result = str_replace("'", "", $result);
    $result = str_replace(",", "", $result);
    $j = 0;
    $result = explode('=>', $result);
    for ($i = 6; $i < sizeof($result); $i++) {
        $ip_save[$j] = $result[$i];
        $i = $i + 2;
        $groupe_save[$j] = $result[$i];
        $i = $i + 1;
        $nom_save[$j] = $result[$i];
コード例 #5
0
ファイル: index.php プロジェクト: hardikk/HNH
function viewFormBatchofEndpoint($smarty, $module_name, $local_templates_dir, $arrConf)
{
    $arrFormBatchofEndpoint = createFieldForm();
    $oForm = new paloForm($smarty, $arrFormBatchofEndpoint);
    //begin, Form data persistence to errors and other events.
    $_DATA = $_POST;
    $action = getParameter("action");
    $id = getParameter("id");
    $smarty->assign("ID", $id);
    //persistence id with input hidden in tpl
    if ($action == "view") {
        $oForm->setViewMode();
    } else {
        if ($action == "view_edit" || getParameter("save_edit")) {
            $oForm->setEditMode();
        }
    }
    //end, Form data persistence to errors and other events.
    if ($action == "view" || $action == "view_edit") {
        // the action is to view or view_edit.
        $dataBatchofEndpoint = $pBatchofEndpoint->getBatchofEndpointById($id);
        if (is_array($dataBatchofEndpoint) & count($dataBatchofEndpoint) > 0) {
            $_DATA = $dataBatchofEndpoint;
        } else {
            $smarty->assign("mb_title", _tr("Error get Data"));
            $smarty->assign("mb_message", $pBatchofEndpoint->errMsg);
        }
    }
    if (empty($_DATA['endpoint_mask'])) {
        $_DATA['endpoint_mask'] = network();
    }
    $smarty->assign("SAVE", _tr("Save"));
    $smarty->assign("EDIT", _tr("Edit"));
    $smarty->assign("CANCEL", _tr("Cancel"));
    $smarty->assign("REQUIRED_FIELD", _tr("Required field"));
    $smarty->assign("icon", "images/list.png");
    $htmlForm = $oForm->fetchForm("{$local_templates_dir}/form.tpl", _tr("Batch of Endpoint"), $_DATA);
    $content = "<form  method='POST' enctype='multipart/form-data' style='margin-bottom:0;' action='?menu={$module_name}'>" . $htmlForm . "</form>";
    return $content;
}
コード例 #6
0
ファイル: amidala.php プロジェクト: buganini/amidala
function en($method, $s)
{
    switch ($method) {
        case 'snd':
            $s = soundex($s);
            break;
        case 'bin':
            $s = bin_en($s);
            break;
        case 'dec':
            $s = dec_en($s);
            break;
        case 'oct':
            $s = oct_en($s);
            break;
        case 'hex':
            $s = hex_en($s);
            break;
        case 'bsd':
            $s = bsdconv(bsdconv_create($_POST['bsdconv']), $s) or addmsg(ERR, bsdconv_error());
            break;
        case 'rot':
            $s = rotate($s, $_POST['rot'], $_POST['nrot']);
            break;
        case 'url':
            $s = $_POST['url_raw'] == 'on' ? rawurlencode($s) : urlencode($s);
            break;
        case 'raw':
            break;
        case 'stmwth':
            $s = strimwidth($s);
            break;
        case 'rpt':
            $s = str_repeat($s, $_POST['rpt']);
            break;
        case 'rev':
            $s = str_rev($s);
            break;
        case 'crv':
            $s = case_rev($s);
            break;
        case 'nbase':
            $s = base_conv($s, 0);
            break;
        case 'base':
            $s = base_en($s);
            break;
        case 'rep':
            $s = gen_rep($s);
            break;
        case 'pcr':
            $s = pcre_rep($s);
            break;
        case 'pcm':
            $s = pcre_mat($s);
            break;
        case 'spe':
            $s = htmlspecialchars($s);
            break;
        case 'hen':
            $s = mbs() ? mb_convert_encoding($s, 'HTML-ENTITIES') : htmlentities($s);
            break;
        case 'md5':
            $s = md5($s);
            break;
        case 'crypt':
            $s = crypt($s, $_POST['crypt_salt']);
            break;
        case 'sha1':
            $s = sha1($s);
            break;
        case 'crc16':
            $s = sprintf("%x", crc32($s));
            break;
        case 'crc32':
            $s = sprintf("%x", crc32($s));
            break;
        case 'srt':
            $s = mysort($s, 0);
            break;
        case 'stu':
            $s = mbs() ? mb_strtoupper($s) : strtoupper($s);
            break;
        case 'bbs':
            $s = bbs2html($s);
            break;
        case 'unq':
            $s = uniq($s, 0);
            break;
        case 'mut':
            $s = str_mutate($s);
            break;
        case 'ttb':
            $s = totable($s);
            break;
        case 'acc':
            $s = accumulation($s, 0);
            break;
        case 'stl':
            $s = mbs() ? mb_strtolower($s) : strtolower($s);
            break;
        case 'ucw':
            $s = ucwords($s);
            break;
        case 'ctr':
            $s = counter($s);
            break;
        case 'swd':
            $s = strwidth($s);
            break;
        case 'cor':
            $s = correct($s);
            break;
        case 'det':
            $s = determinant($s);
            break;
        case 'uue':
            $s = convert_uuencode($s);
            break;
        case 'msk':
            $s = network($s);
            break;
        case 'ref':
            $s = sqr_reflect($s);
            break;
        case 'che':
            $s = chewing($s);
            break;
        case 'rf':
            $s = sqr($s, 0);
            break;
        case 'cac':
            $s = cac_pre($s);
            break;
        case 'mmtp':
            $s = matrix_multiply($s);
            break;
        case 'mro':
            $s = matrix_rotate($s, 0);
            break;
        case 'miv':
            $s = matrix_inverse($s);
            break;
        case 'mtr':
            $s = matrix_transpose($s);
            break;
        case 'ascii':
            $s = ASCIIFilter($s);
            break;
        case 'key':
            $s = key_xor($_POST['key'], $s);
            break;
        case 'bre':
            $s = bit_rev($s);
            break;
        case 'bod':
            $s = bitorder_en($_POST['order'], $s);
            break;
        case 'tra':
            $s = tran($_POST['transpose'], $s, 2);
            break;
        case 'sta':
            $s = statistics($s);
            break;
        case 'quot':
            $s = quoted_printable_decode($s);
            break;
        default:
            addmsg(WARN, 'Undefined Method: ' . $method);
    }
    return $s;
}