本文整理汇总了PHP中look_config_default_values函数的典型用法代码示例。如果您正苦于以下问题:PHP look_config_default_values函数的具体用法?PHP look_config_default_values怎么用?PHP look_config_default_values使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了look_config_default_values函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exec_plugin_soap_client
/**
* @param unknown $name : PluginName
* @param unknown $action : Possible actions => delete (0) and install (1)
*/
function exec_plugin_soap_client($name, $action)
{
$champs = array('OCS_SERVER_ADDRESS' => 'OCS_SERVER_ADDRESS');
$values = look_config_default_values($champs);
$address = $values['tvalue']['OCS_SERVER_ADDRESS'];
ini_set("safe_mode", "0");
$command = "perl " . MAIN_SECTIONS_DIR . "ms_plugins/client.pl " . $address . " " . $name . " " . $action;
exec($command);
ini_set("safe_mode", "1");
}
示例2: plugin_soap_client
function plugin_soap_client($name, $action)
{
$champs = array('OCS_SERVER_ADDRESS' => 'OCS_SERVER_ADDRESS');
$values = look_config_default_values($champs);
$address = $values['tvalue']['OCS_SERVER_ADDRESS'];
if ($action == 1) {
$method = "InstallPlugins";
} else {
$method = "DeletePlugins";
}
$client = new SoapClient(null, array('location' => "http://{$address}/ocsplugins", 'uri' => "http://{$address}/Apache/Ocsinventory/Plugins/Modules"));
$request = "<?xml version=\"1.0\" encoding=\"utf-8\" ?> \n\t\t<soap:Envelope \n \t\tsoap:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'\n \t\txmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' \n \t\t\txmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'\n \t\txmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' \n \t\txmlns:xsd='http://www.w3.org/2001/XMLSchema'>\n \t\t<soap:Body>\n\t\t\t<{$method} xmlns='http://{$address}/Apache/Ocsinventory/Plugins/Modules'><c-gensym3 xsi:type='xsd:string'>{$name}</c-gensym3></{$method}>\n\t\t</soap:Body>\n\t\t</soap:Envelope>";
$output = $client->__doRequest($request, "http://{$address}/ocsplugins", "http://{$address}/Apache/Ocsinventory/Plugins/Modules#{$method}", "1.1");
}
示例3: pacquet
private function pacquet($Mac)
{
$packet = "";
$macAddr = '';
$addrByte = explode(':', $Mac);
foreach ($addrByte as $v) {
$macAddr .= chr(hexdec($v));
}
for ($i = 0; $i < 6; $i++) {
$packet .= chr(0xff);
}
for ($j = 0; $j < 16; $j++) {
$packet .= $macAddr;
}
//use bios password?
$wol_info = look_config_default_values('WOL_BIOS_PASSWD');
if (isset($wol_info['name']['WOL_BIOS_PASSWD'])) {
$packet .= $wol_info['tvalue']['WOL_BIOS_PASSWD'];
}
return $packet;
}
示例4: verif
echo "<input type='hidden' name='document_root' value='" . $protectedPost['document_root'] . "'>\t \n\t <input type='hidden' id='timestamp' name='timestamp' value='" . $protectedPost['timestamp'] . "'>";
echo "<script language='javascript'>\n\t\tfunction verif()\n\t\t {\n\t\t\tvar msg = '';\n\t\t\tchamps = new Array('NAME','DESCRIPTION','OS','PROTOCOLE','PRIORITY','ACTION','ACTION_INPUT','REDISTRIB_USE');\n\t\t\tchamps_OS = new Array('NOTIFY_USER','NEED_DONE_ACTION');\n\t\t\tchamps_ACTION=new Array('teledeploy_file');\n\t\t\tchamps_REDISTRIB_USE=new Array('REDISTRIB_PRIORITY');\n\t\t\tchamps_NOTIFY_USER=new Array('NOTIFY_TEXT','NOTIFY_COUNTDOWN','NOTIFY_CAN_ABORT','NOTIFY_CAN_DELAY');\n\t\t\tchamps_NEED_DONE_ACTION=new Array('NEED_DONE_ACTION_TEXT');\n\t\t\t\n\n\n\t\t\n\t\t\tfor (var n = 0; n < champs.length; n++)\n\t\t\t{\n\t\t\t\tif (document.getElementById(champs[n]).value == ''){\n\t\t\t\t document.getElementById(champs[n]).style.backgroundColor = 'RED';\n\t\t\t\t msg='NULL';\n\t\t\t\t }\n\t\t\t\telse\n\t\t\t\t document.getElementById(champs[n]).style.backgroundColor = '';\n\t\t\t}\n\n\t\t\tfor (var n = 0; n < champs_OS.length; n++)\n\t\t\t{\n\t\t\t\tif (document.getElementById('OS').value == 'WINDOWS' && document.getElementById(champs_OS[n]).value == ''){\n\t\t\t\t document.getElementById(champs_OS[n]).style.backgroundColor = 'RED';\n\t\t\t\t msg='NULL';\n\t\t\t\t }\n\t\t\t\telse\n\t\t\t\t document.getElementById(champs_OS[n]).style.backgroundColor = '';\n\t\t\t}\n\t\t\tfor (var n = 0; n < champs_ACTION.length; n++)\n\t\t\t{\n\t\t\t\tvar name_file=document.getElementById(champs_ACTION[n]).value;\n\t\t\t\tname_file=name_file.toUpperCase();\n\t\t\t\tif (document.getElementById(\"OS\").value == 'WINDOWS')\n\t\t\t\t\tvar debut=name_file.length-3;\n\t\t\t\telse\n\t\t\t\t\tvar debut=name_file.length-6;\n\t\t\t\tif (document.getElementById('ACTION').value != 'EXECUTE' && document.getElementById(champs_ACTION[n]).value == ''){\n\t\t\t\t\talert('" . $l->g(602) . "');\n\t\t\t\t \tdocument.getElementById(champs_ACTION[n]).style.backgroundColor = 'RED';\n\t\t\t\t \tmsg='NULL';\n\t\t\t\t }\n\t\t\t\telse if (document.getElementById('ACTION').value != 'EXECUTE' && name_file.substring(debut,name_file.length) != 'ZIP' && document.getElementById(\"OS\").value == 'WINDOWS'){\n\t\t\t\t\talert('" . $l->g(1231) . "');\n\t\t\t\t\tdocument.getElementById(champs_ACTION[n]).style.backgroundColor = 'RED';\n\t\t\t\t\tmsg='NULL';\n\t\t\t\t}else if (document.getElementById('ACTION').value != 'EXECUTE' && name_file.substring(debut,name_file.length) != 'TAR.GZ' && document.getElementById(\"OS\").value != 'WINDOWS'){\n\t\t\t\t\talert('" . $l->g(1232) . "');\n\t\t\t\t\tdocument.getElementById(champs_ACTION[n]).style.backgroundColor = 'RED';\n\t\t\t\t\tmsg='NULL';\n\t\t\t\t}\n\t\t\t\t document.getElementById(champs_ACTION[n]).style.backgroundColor = '';\n\n\t\t\t}\n\t\t\t\n\t\t\tfor (var n = 0; n < champs_REDISTRIB_USE.length; n++)\n\t\t\t{\n\t\t\t\tif (document.getElementById('REDISTRIB_USE').value == 1 && document.getElementById(champs_REDISTRIB_USE[n]).value == ''){\n\t\t\t\t document.getElementById(champs_REDISTRIB_USE[n]).style.backgroundColor = 'RED';\n\t\t\t\t msg='NULL';\n\t\t\t\t }\n\t\t\t\telse\n\t\t\t\t document.getElementById(champs_REDISTRIB_USE[n]).style.backgroundColor = '';\n\t\t\t}\n\n\t\t\tfor (var n = 0; n < champs_NOTIFY_USER.length; n++)\n\t\t\t{\n\t\t\t\tif (document.getElementById('NOTIFY_USER').value == 1 && document.getElementById(champs_NOTIFY_USER[n]).value == ''){\n\t\t\t\t document.getElementById(champs_NOTIFY_USER[n]).style.backgroundColor = 'RED';\n\t\t\t\t msg='NULL';\n\t\t\t\t }\n\t\t\t\telse\n\t\t\t\t document.getElementById(champs_NOTIFY_USER[n]).style.backgroundColor = '';\n\t\t\t}\n\n\t\t\tfor (var n = 0; n < champs_NEED_DONE_ACTION.length; n++)\n\t\t\t{\n\t\t\t\tif (document.getElementById('NEED_DONE_ACTION').value == 1 && document.getElementById(champs_NEED_DONE_ACTION[n]).value == ''){\n\t\t\t\t document.getElementById(champs_NEED_DONE_ACTION[n]).style.backgroundColor = 'RED';\n\t\t\t\t msg='NULL';\n\t\t\t\t }\n\t\t\t\telse\n\t\t\t\t document.getElementById(champs_NEED_DONE_ACTION[n]).style.backgroundColor = '';\n\t\t\t}\n\n\t\t\tif (msg != ''){\n\t\t\talert ('" . $l->g(1001) . "');\n\t\t\treturn false;\n\t\t\t}else\n\t\t\treturn true;\t\t\t\n\t\t}\n\t</script>";
echo "<div ";
if ($protectedPost['valid']) {
echo " style='display:none;'";
}
echo ">";
printEnTete($l->g(434));
echo "<br>";
$activate = option_conf_activate('TELEDIFF_WK');
//If workflow for teledeploy is activated
//We show only the package we can create
if ($activate) {
msg_info($l->g(1105) . "<br>" . $l->g(1106) . "<br>" . $l->g(1107));
//get all request with the status "Create a Package"
$conf_creat_Wk = look_config_default_values(array('IT_SET_NIV_CREAT'));
$info_dde_statut_creat = info_dde(find_dde_by_status($conf_creat_Wk['tvalue']['IT_SET_NIV_CREAT']));
if ($info_dde_statut_creat != '') {
$array_id_fields = find_id_field(array('NAME_TELEDEPLOY', 'PRIORITY', 'NOTIF_USER', 'REPORT_USER', 'INFO_PACK'));
//build the seach
$id_name = "fields_" . $array_id_fields['NAME_TELEDEPLOY']->id;
$id_description = "fields_" . $array_id_fields['INFO_PACK']->id;
$id_priority = "fields_" . $array_id_fields['PRIORITY']->id;
$id_notify_user = "fields_" . $array_id_fields['NOTIF_USER']->id;
foreach ($info_dde_statut_creat as $id => $tab_value) {
$list_dde_creat[$tab_value->ID] = $tab_value->{$id_name};
}
echo "<br><b>" . $l->g(1183) . ":</b>" . show_modif($list_dde_creat, 'LIST_DDE_CREAT', 2, $form_name);
if (!$protectedPost['LIST_DDE_CREAT'] or $protectedPost['LIST_DDE_CREAT'] == "") {
echo close_form();
require_once FOOTER_HTML;
示例5: add_mach
function add_mach($id_group, $list_mach)
{
$default_values = look_config_default_values(array('DOWNLOAD_SERVER_URI', 'DOWNLOAD_SERVER_DOCROOT'));
if (is_array($list_mach)) {
foreach ($list_mach as $key => $value) {
$reqCache = "INSERT IGNORE INTO download_servers(hardware_id, url, add_rep,GROUP_ID) \n\t\t\t\t\t\tVALUES (%s,'%s','%s',%s)";
$argcache = array($value, $default_values['tvalue']['DOWNLOAD_SERVER_URI'], $default_values['tvalue']['DOWNLOAD_SERVER_DOCROOT'], $id_group);
$cachedRes = mysql2_query_secure($reqCache, $_SESSION['OCS']["writeServer"], $argcache);
}
} else {
$reqCache = "INSERT IGNORE INTO download_servers(hardware_id, url, add_rep,GROUP_ID) \n\t\t\t\t\t\tselect id,'%s','%s',%s\n\t\t\t\t\t from hardware where id in ";
$argCache = array($default_values['tvalue']['DOWNLOAD_SERVER_URI'], $default_values['tvalue']['DOWNLOAD_SERVER_DOCROOT'], $id_group);
$arg = mysql2_prepare($reqCache, $argCache, $list_mach);
$cachedRes = mysql2_query_secure($arg['SQL'], $_SESSION['OCS']["writeServer"], $arg['ARG']);
}
return mysql_affected_rows($_SESSION['OCS']["writeServer"]);
}
示例6: open_form
require_once 'require/function_telediff.php';
require_once 'require/function_search.php';
require_once 'require/function_telediff_wk.php';
//p($protectedPost);
$form_name = "pack_affect";
$table_name = "LIST_PACK_SEARCH";
echo open_form($form_name);
$list_id = multi_lot($form_name, $l->g(601));
//TELEDIFF_WK
$activate = option_conf_activate('TELEDIFF_WK');
//use teledeploy workflow?
if ($activate) {
//yes
$msg_wk = $l->g(1105) . "<br>" . $l->g(1110) . "<br>";
//find all config of workflow
$conf_Wk = look_config_default_values(array('IT_SET_PERIM', 'IT_SET_NAME_TEST', 'IT_SET_NAME_LIMIT', 'IT_SET_TAG_NAME', 'IT_SET_NIV_TEST', 'IT_SET_NIV_REST', 'IT_SET_NIV_TOTAL'));
//find id field of status
$sql_status = "select ID from downloadwk_fields where FIELD='STATUS'";
$res_status = mysql2_query_secure($sql_status, $_SESSION['OCS']["readServer"]);
$val_status = mysql_fetch_array($res_status);
//find distinct id of status to affect a package
$sql_id_stat = "select NAME,ID from downloadwk_statut_request where NAME= '%s' or NAME='%s' or NAME = '%s'";
$arg_id_stat = array($conf_Wk['tvalue']['IT_SET_NIV_TEST'], $conf_Wk['tvalue']['IT_SET_NIV_REST'], $conf_Wk['tvalue']['IT_SET_NIV_TOTAL']);
$res_id_stat = mysql2_query_secure($sql_id_stat, $_SESSION['OCS']["readServer"], $arg_id_stat);
while ($val_id_stat = mysql_fetch_array($res_id_stat)) {
$id_stat[$val_id_stat['NAME']] = $val_id_stat['ID'];
}
//find all package can be affected TEST status
$sql_affect_pack = "select fileid from download_available d_a \n\t\t\t\t\t\t\t\t\t\tleft join downloadwk_pack dwk_p\ton d_a.id_wk=dwk_p.id \n\t\t\t\t\t\t\t\t\t\tleft join downloadwk_statut_request dwk_stat on dwk_stat.id=dwk_p.fields_" . $val_status['ID'] . "\n\t\t\t\t\t\t\t\t\t\twhere d_a.id_wk = 0 or dwk_stat.name = '%s'";
$res_affect_pack = mysql2_query_secure($sql_affect_pack, $_SESSION['OCS']["readServer"], $conf_Wk['tvalue']['IT_SET_NIV_TEST']);
while ($val_affect_pack = mysql_fetch_array($res_affect_pack)) {
示例7: array
if (!isset($_SESSION['OCS']["usecache"]) or !isset($_SESSION['OCS']["tabcache"])) {
$conf_gui = array('usecache' => 'INVENTORY_CACHE_ENABLED', 'tabcache' => 'TAB_CACHE', 'USE_NEW_SOFT_TABLES' => 'USE_NEW_SOFT_TABLES');
$default_value_conf = array('INVENTORY_CACHE_ENABLED' => 1, 'TAB_CACHE' => 0, 'USE_NEW_SOFT_TABLES' => 0);
$values = look_config_default_values($conf_gui);
foreach ($conf_gui as $k => $v) {
if (isset($values['ivalue'][$v])) {
$_SESSION['OCS'][$k] = $values['ivalue'][$v];
} else {
$_SESSION['OCS'][$k] = $default_value_conf[$v];
}
}
}
/********************END GESTION CACHE******************/
/********************MANAGE DOWNLOAD REDISTRIBUTION******************/
if (!isset($_SESSION['OCS']["use_redistribution"])) {
$values = look_config_default_values(array('DOWNLOAD_REDISTRIB'));
$_SESSION['OCS']['use_redistribution'] = $values['ivalue']['DOWNLOAD_REDISTRIB'];
if (!isset($_SESSION['OCS']["use_redistribution"])) {
$_SESSION['OCS']["use_redistribution"] = 1;
}
}
/********************END DOWNLOAD REDISTRIBUTION******************/
/*********************************************GESTION OF LBL_TAG*************************************/
if (!isset($_SESSION['OCS']['TAG_LBL'])) {
require_once 'require/function_admininfo.php';
$all_tag_lbl = witch_field_more('COMPUTERS');
foreach ($all_tag_lbl['LIST_NAME'] as $key => $value) {
$_SESSION['OCS']['TAG_LBL'][$value] = $all_tag_lbl['LIST_FIELDS'][$key];
$_SESSION['OCS']['TAG_ID'][$key] = $value;
}
}
示例8: print_perso
function print_perso($systemid)
{
global $l, $td1, $td2, $td3, $td4, $pages_refs, $protectedGet;
$i = 0;
$queryDetails = "SELECT * FROM devices WHERE hardware_id={$systemid}";
$resultDetails = mysql_query($queryDetails, $_SESSION['OCS']["readServer"]) or die(mysql_error($_SESSION['OCS']["readServer"]));
$form_name = 'config_group';
echo open_form($form_name);
echo "<table BORDER='0' WIDTH = '95%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
//echo "<tr><td> </td> $td1 "."Libell�"." </td> $td1 "."Valeur"." </td><td> </td></tr>";
while ($item = mysql_fetch_array($resultDetails, MYSQL_ASSOC)) {
$optPerso[$item["NAME"]]["IVALUE"] = $item["IVALUE"];
$optPerso[$item["NAME"]]["TVALUE"] = $item["TVALUE"];
}
$ii++;
$td3 = $ii % 2 == 0 ? $td2 : $td4;
//IPDISCOVER
echo "<tr><td bgcolor='white' align='center' valign='center'>" . (isset($optPerso["IPDISCOVER"]) && $optPerso["IPDISCOVER"]["IVALUE"] != 1 ? "<img width='15px' src='image/red.png'>" : " ") . "</td> </td>";
echo $td3 . $l->g(489) . "</td>";
if (isset($optPerso["IPDISCOVER"])) {
if ($optPerso["IPDISCOVER"]["IVALUE"] == 0) {
echo $td3 . $l->g(490) . "</td>";
} else {
if ($optPerso["IPDISCOVER"]["IVALUE"] == 2) {
echo $td3 . $l->g(491) . " " . $optPerso["IPDISCOVER"]["TVALUE"] . "</td>";
} else {
if ($optPerso["IPDISCOVER"]["IVALUE"] == 1) {
echo $td3 . $l->g(492) . " " . $optPerso["IPDISCOVER"]["TVALUE"] . "</td>";
}
}
}
} else {
echo $td3 . $l->g(493) . "</td>";
}
if ($_SESSION['OCS']['CONFIGURATION']['CONFIG'] == "YES") {
echo "<td align=center rowspan=8><a href=# Onclick=window.open(\"index.php?" . PAG_INDEX . "=" . $pages_refs['ms_custom_param'] . "&head=1&idchecked=" . $systemid . "&origine=group\",\"rollo\",\"location=0,status=0,scrollbars=1,menubar=0,resizable=0,width=800,height=500\");>\n\t\t<img src='image/modif_a.png' title='" . $l->g(285) . "'></a></td></tr>";
}
$ii++;
$td3 = $ii % 2 == 0 ? $td2 : $td4;
$field_name = array('DOWNLOAD', 'DOWNLOAD_CYCLE_LATENCY', 'DOWNLOAD_PERIOD_LENGTH', 'DOWNLOAD_FRAG_LATENCY', 'DOWNLOAD_PERIOD_LATENCY', 'DOWNLOAD_TIMEOUT', 'PROLOG_FREQ', 'SNMP');
$optdefault = look_config_default_values($field_name);
//FREQUENCY
echo "<tr><td bgcolor='white' align='center' valign='center'>" . (isset($optPerso["FREQUENCY"]) ? "<img width='15px' src='image/red.png'>" : " ") . "</td>";
echo $td3 . $l->g(494) . "</td>";
if (isset($optPerso["FREQUENCY"])) {
if ($optPerso["FREQUENCY"]["IVALUE"] == 0) {
echo $td3 . $l->g(485) . "</td>";
} else {
if ($optPerso["FREQUENCY"]["IVALUE"] == -1) {
echo $td3 . $l->g(486) . "</td>";
} else {
echo $td3 . $l->g(495) . " " . $optPerso["FREQUENCY"]["IVALUE"] . " " . $l->g(496) . "</td>";
}
}
} else {
echo $td3 . $l->g(497) . "</td>";
}
echo "</tr>";
//DOWNLOAD_SWITCH
echo "<tr><td bgcolor='white' align='center' valign='center'>" . (isset($optPerso["DOWNLOAD_SWITCH"]) ? "<img width='15px' src='image/red.png'>" : " ") . "</td>";
echo $td3 . $l->g(417) . " <font color=green size=1><i>DOWNLOAD</i></font> </td>";
if (isset($optPerso["DOWNLOAD_SWITCH"])) {
if ($optPerso["DOWNLOAD_SWITCH"]["IVALUE"] == 0) {
echo $td3 . $l->g(733) . "</td>";
} else {
if ($optPerso["DOWNLOAD_SWITCH"]["IVALUE"] == 1) {
echo $td3 . $l->g(205) . "</td>";
} else {
echo $td3 . "</td>";
}
}
} else {
echo $td3 . $l->g(488) . "(";
if ($optdefault['ivalue']["DOWNLOAD"] == 1) {
echo $l->g(205);
} else {
echo $l->g(733);
}
echo ")</td>";
}
echo "</tr>";
//DOWNLOAD_CYCLE_LATENCY
optperso("DOWNLOAD_CYCLE_LATENCY", $l->g(720) . " <font color=green size=1><i>DOWNLOAD_CYCLE_LATENCY</i></font>", $optPerso, 1, $optdefault['ivalue']["DOWNLOAD_CYCLE_LATENCY"], $l->g(511));
//DOWNLOAD_FRAG_LATENCY
optperso("DOWNLOAD_FRAG_LATENCY", $l->g(721) . " <font color=green size=1><i>DOWNLOAD_FRAG_LATENCY</i></font>", $optPerso, 1, $optdefault['ivalue']["DOWNLOAD_FRAG_LATENCY"], $l->g(511));
//DOWNLOAD_PERIOD_LATENCY
optperso("DOWNLOAD_PERIOD_LATENCY", $l->g(722) . " <font color=green size=1><i>DOWNLOAD_PERIOD_LATENCY</i></font>", $optPerso, 1, $optdefault['ivalue']["DOWNLOAD_PERIOD_LATENCY"], $l->g(511));
//DOWNLOAD_PERIOD_LENGTH
optperso("DOWNLOAD_PERIOD_LENGTH", $l->g(723) . " <font color=green size=1><i>DOWNLOAD_PERIOD_LENGTH</i></font>", $optPerso, 1, $optdefault['ivalue']["DOWNLOAD_PERIOD_LENGTH"]);
//PROLOG_FREQ
optperso("PROLOG_FREQ", $l->g(724) . " <font color=green size=1><i>PROLOG_FREQ</i></font>", $optPerso, 1, $optdefault['ivalue']["PROLOG_FREQ"], $l->g(730));
//SNMP_SWITCH
echo "<tr><td bgcolor='white' align='center' valign='center'>" . (isset($optPerso["SNMP_SWITCH"]) ? "<img width='15px' src='image/red.png'>" : " ") . "</td>";
echo $td3 . $l->g(1197) . " <font color=green size=1><i>SNMP_SWITCH</i></font></td>";
if (isset($optPerso["SNMP_SWITCH"])) {
if ($optPerso["SNMP_SWITCH"]["IVALUE"] == 0) {
echo $td3 . $l->g(733) . "</td>";
} else {
if ($optPerso["SNMP_SWITCH"]["IVALUE"] == 1) {
echo $td3 . $l->g(205) . "</td>";
//.........这里部分代码省略.........
示例9: show_modif
}
}
if (!$protectedPost['SHOW_SELECT']) {
$protectedPost['SHOW_SELECT'] = 'download';
$tab_options['SHOW_SELECT'] = 'download';
}
echo "<BR>" . show_modif(array('download' => $l->g(990), 'server' => $l->g(991)), 'SHOW_SELECT', 2, $form_name) . "<BR><BR>";
//only for profils who can activate packet
if (!$cant_active) {
//where packets are created?
if ($protectedPost['SHOW_SELECT'] == 'download') {
$config_document_root = "DOWNLOAD_PACK_DIR";
} else {
$config_document_root = "DOWNLOAD_REP_CREAT";
}
$info_document_root = look_config_default_values($config_document_root);
$document_root = $info_document_root["tvalue"][$config_document_root];
//if no directory in base, take $_SERVER["DOCUMENT_ROOT"]
if (!isset($document_root)) {
$document_root = VARLIB_DIR . '/download';
if ($protectedPost['SHOW_SELECT'] == "server") {
$document_root .= "server/";
}
} else {
//can we have the zip?
$document_root .= "/download";
}
if (is_readable($document_root) && is_dir($document_root)) {
$dir = @opendir($document_root);
while ($f = readdir($dir)) {
if (is_numeric($f)) {
示例10: find_limit_values
function find_limit_values()
{
$arg = look_config_default_values('GUI_REPORT_%', 1);
return $arg['ivalue'];
}
示例11: ob_start
ob_start();
$ajax = true;
} else {
$ajax = false;
}
$tab_options = $protectedPost;
require_once 'require/function_files.php';
require_once 'require/function_ipdiscover.php';
$form_name = 'ipdiscover_analyse';
$table_name = $form_name;
$tab_options['form_name'] = $form_name;
$tab_options['table_name'] = $table_name;
echo open_form($form_name);
$pas = $protectedGet['rzo'];
//$rez = $nomRez;
$values = look_config_default_values(array('IPDISCOVER_IPD_DIR'), '', array('IPDISCOVER_IPD_DIR' => array('TVALUE' => VARLIB_DIR)));
$fname = $values['tvalue']['IPDISCOVER_IPD_DIR'];
$file_name = $fname . "/ipd/" . $pas . ".ipd";
//reset cache?
if (isset($protectedPost['reset']) and $protectedPost['reset'] != '') {
unlink($file_name);
reloadform_closeme('', true);
} else {
if (!is_readable($file_name)) {
runCommand("-cache -net=" . $pas, $fname);
}
$tabBalises = array($l->g(34) => "IP", $l->g(95) => "MAC", $l->g(49) => "NAME", $l->g(232) => "DATE", $l->g(66) => "TYPE");
$ret = array();
$ret = parse_xml_file($file_name, $tabBalises, "HOST");
if ($ret != array()) {
$sql = "select ";
示例12: find_value_in_field
function find_value_in_field($tag, $value_2_find, $type = 'COMPUTERS')
{
$p = find_info_accountinfo($tag, $type);
$values = look_config_default_values('ACCOUNT_VALUE_' . $p[$tag]['name'] . "_%", true);
if (is_array($values['tvalue'])) {
foreach ($values['tvalue'] as $key => $value) {
if (stristr($value, $value_2_find)) {
$decoup = explode('_', $key);
$fr = array_pop($decoup);
$list_tag_id[] = $fr;
}
}
return $list_tag_id;
} else {
return false;
}
}
示例13: elseif
}
} elseif ($_POST["supp"] == "ALL") {
$verif[0]['sql'] = "select fileid from download_enable,devices\n\t\t\t\twhere download_enable.id=devices.ivalue\n\t\t\t\tand GROUP_ID=" . $systemid;
$verif[0]['condition'] = 'EXIST';
$verif[0]['MSG_ERROR'] = $l->g(688) . " " . $l->g(690);
$ok = verification($verif);
if (isset($ok)) {
mysqli_query($_SESSION['OCS']["writeServer"], "delete from download_enable where GROUP_ID=" . $systemid);
$sql = "delete from download_servers where GROUP_ID = " . $systemid;
mysqli_query($_SESSION['OCS']["writeServer"], $sql);
}
}
}
//Modif server's machine
if (isset($_POST['Valid_modif']) and isset($_POST['modif']) and $_POST['modif'] != "") {
$default_values = look_config_default_values(array('DOWNLOAD_SERVER_URI', 'DOWNLOAD_SERVER_DOCROOT'));
if (trim($_POST['URL']) == "") {
$_POST['URL'] = $default_values['tvalue']['DOWNLOAD_SERVER_URI'];
}
if (trim($_POST['REP_STORE']) == "") {
$_POST['REP_STORE'] = $default_values['tvalue']['DOWNLOAD_SERVER_DOCROOT'];
}
if ($_POST['modif'] != "ALL") {
$sql = "update download_servers set URL='" . $_POST['URL'] . "' ,ADD_REP='" . $_POST['REP_STORE'] . "' where hardware_id=" . $_POST['modif'];
mysqli_query($_SESSION['OCS']["writeServer"], $sql);
$sql = "update download_enable set pack_loc='" . $_POST['URL'] . "' where SERVER_ID=" . $_POST['modif'];
mysqli_query($_SESSION['OCS']["writeServer"], $sql);
} else {
$sql = "update download_servers set URL='" . $_POST['URL'] . "' ,ADD_REP='" . $_POST['REP_STORE'] . "' where GROUP_ID=" . $systemid;
mysqli_query($_SESSION['OCS']["writeServer"], $sql);
$sql = "update download_enable set pack_loc='" . $_POST['URL'] . "' where GROUP_ID=" . $systemid;
示例14: admin_user
function admin_user($id_user = null, $is_my_account = false)
{
global $protectedPost, $l, $pages_refs;
$tab_hidden = array();
$list_groups = array();
if ($id_user) {
$update = 3;
} else {
$update = 0;
}
if ($_SESSION['OCS']['profile']->getConfigValue('CHANGE_USER_GROUP') == 'YES') {
//search all profil type
$list_profil = get_profile_labels();
$list_groups_result = look_config_default_values("USER_GROUP_%", 'LIKE');
if (is_array($list_groups_result['name'])) {
foreach ($list_groups_result['name'] as $key => $value) {
$list_groups[$list_groups_result['ivalue'][$key]] = $list_groups_result['tvalue'][$key];
}
}
$name_field = array("ID", "ACCESSLVL", "USER_GROUP");
$tab_name = array($l->g(995) . " :", $l->g(66) . " :", $l->g(607) . " :");
$type_field = array($update, 2, 2);
}
$name_field[] = "FIRSTNAME";
$name_field[] = "LASTNAME";
$name_field[] = "EMAIL";
$name_field[] = "COMMENTS";
//$name_field[]="USER_GROUP";
$tab_name[] = $l->g(1366) . " :";
$tab_name[] = $l->g(996) . " :";
$tab_name[] = $l->g(1117) . " :";
$tab_name[] = $l->g(51) . " :";
//$tab_name[]="Groupe de l'utilisateur: ";
$type_field[] = 0;
$type_field[] = 0;
$type_field[] = 0;
$type_field[] = 0;
//$type_field[]= 2;
$tab_hidden['MODIF'] = $id_user;
$sql = "select ID,NEW_ACCESSLVL,USER_GROUP,FIRSTNAME,LASTNAME,EMAIL,COMMENTS from operators where id= '%s'";
$arg = $id_user;
$res = mysql2_query_secure($sql, $_SESSION['OCS']["readServer"], $arg);
$row = mysqli_fetch_object($res);
if ($_SESSION['OCS']['profile']->getConfigValue('CHANGE_USER_GROUP') == 'YES') {
$protectedPost['ACCESSLVL'] = $row->NEW_ACCESSLVL;
$protectedPost['USER_GROUP'] = $row->USER_GROUP;
$value_field = array($row->ID, $list_profil, $list_groups);
}
$value_field[] = $row->FIRSTNAME;
$value_field[] = $row->LASTNAME;
$value_field[] = $row->EMAIL;
$value_field[] = $row->COMMENTS;
if ($_SESSION['OCS']['cnx_origine'] == "LOCAL") {
$name_field[] = "PASSWORD";
$type_field[] = 0;
$tab_name[] = $l->g(217) . " :";
$value_field[] = $protectedPost['PASSWORD'];
}
$tab_typ_champ = show_field($name_field, $type_field, $value_field);
foreach ($tab_typ_champ as $id => $values) {
$tab_typ_champ[$id]['CONFIG']['SIZE'] = 40;
}
if ($_SESSION['OCS']['profile']->getConfigValue('MANAGE_USER_GROUP') == 'YES') {
$tab_typ_champ[2]["CONFIG"]['DEFAULT'] = "YES";
// $tab_typ_champ[1]['COMMENT_AFTER']="<a href=# onclick=window.open(\"index.php?".PAG_INDEX."=".$pages_refs['ms_admin_profil']."&head=1\",\"admin_profil\",\"location=0,status=0,scrollbars=0,menubar=0,resizable=0,width=550,height=450\")><img src=image/plus.png></a>";
$tab_typ_champ[2]['COMMENT_AFTER'] = "<a href=\"index.php?" . PAG_INDEX . "=" . $pages_refs['ms_adminvalues'] . "&head=1&tag=USER_GROUP\",\"admin_user_group\",\"location=0,status=0,scrollbars=0,menubar=0,resizable=0,width=550,height=450\")><img src=image/plus.png></a>";
}
if (isset($tab_typ_champ)) {
tab_modif_values($tab_name, $tab_typ_champ, $tab_hidden, array('title' => $id_user ? $is_my_account ? $l->g(1365) : $l->g(1385) : $l->g(1386), 'form_name' => 'my_account'));
}
}
示例15: look_config_default_values
$lbl_new_field = $l->g($protectedGet['new_field']);
} else {
$lbl_new_field = $l->g(80);
}
//if no tab selected
if (!isset($protectedPost['onglet']) or $protectedPost['onglet'] == '') {
$protectedPost['onglet'] = 1;
}
$tab_options = $protectedPost;
$tab_options['form_name'] = $form_name;
$tab_options['table_name'] = $table_name;
//faire la vérif sur le tag en get
//for update name
if (isset($protectedPost['MODIF']) and is_numeric($protectedPost['MODIF']) and !isset($protectedPost['Valid_modif'])) {
$protectedPost['onglet'] = 2;
$val_info = look_config_default_values(array($protectedGet['tag'] . "_" . $protectedPost['MODIF']));
$protectedPost['newfield'] = $val_info['tvalue'][$protectedGet['tag'] . "_" . $protectedPost['MODIF']];
if (isset($protectedGet['nb_field']) and is_numeric($protectedGet['nb_field'])) {
$protectedPost['2newfield'] = $val_info['comments'][$protectedGet['tag'] . "_" . $protectedPost['MODIF']];
}
$hidden = $protectedPost['MODIF'];
}
echo open_form($form_name);
onglet($data_on, $form_name, "onglet", 2);
echo '<div class="mlt_bordure" >';
if ($protectedPost['onglet'] == 1) {
$tab_options['CACHE'] = 'RESET';
//delete few fields
if (isset($protectedPost['del_check']) and $protectedPost['del_check'] != '') {
$list = $protectedPost['del_check'];
$sql_delete = "DELETE FROM config WHERE name like '%s' and ivalue in (%s)";