本文整理汇总了PHP中msg_info函数的典型用法代码示例。如果您正苦于以下问题:PHP msg_info函数的具体用法?PHP msg_info怎么用?PHP msg_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了msg_info函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mysql2_query_secure
function mysql2_query_secure($sql, $link, $arg = '', $log = false)
{
global $l, $lbl_log;
$query = generate_secure_sql($sql, $arg);
if ($log) {
addLog($log, $query, $lbl_log);
}
if ($_SESSION['OCS']['DEBUG'] == 'ON') {
$_SESSION['OCS']['SQL_DEBUG'][] = html_entity_decode($query, ENT_QUOTES);
}
if (DEMO) {
$rest = mb_strtoupper(substr($query, 0, 6));
if ($rest == 'UPDATE' or $rest == 'INSERT' or $rest == 'DELETE') {
if (DEMO_MSG != 'show') {
msg_info($l->g(2103));
define('DEMO_MSG', 'show');
}
return false;
}
}
$result = mysqli_query($link, $query);
if ($_SESSION['OCS']['DEBUG'] == 'ON' and !$result) {
msg_error(mysqli_error($link));
}
return $result;
}
示例2: show_computer_summary
function show_computer_summary($computer)
{
global $l;
$urls = $_SESSION['OCS']['url_service'];
$labels = array('SYSTEM' => array('USERID' => $l->g(24), 'OSNAME' => $l->g(274), 'OSVERSION' => $l->g(275), 'OSCOMMENTS' => $l->g(286), 'DESCRIPTION' => $l->g(53), 'WINCOMPANY' => $l->g(51), 'WINOWNER' => $l->g(348), 'WINPRODID' => $l->g(111), 'WINPRODKEY' => $l->g(553), 'VMTYPE' => $l->g(1267)), 'NETWORK' => array('WORKGROUP' => $l->g(33), 'USERDOMAIN' => $l->g(557), 'IPADDR' => $l->g(34), 'NAME_RZ' => $l->g(304)), 'HARDWARE' => array('SWAP' => $l->g(50), 'MEMORY' => $l->g(26), 'UUID' => $l->g(1268), 'ARCH' => $l->g(1247)), 'AGENT' => array('USERAGENT' => $l->g(357), 'LASTDATE' => $l->g(46), 'LASTCOME' => $l->g(820)));
$cat_labels = array('SYSTEM' => $l->g(1387), 'NETWORK' => $l->g(1388), 'HARDWARE' => $l->g(1389), 'AGENT' => $l->g(1390));
foreach ($labels as $cat_key => $cat) {
foreach ($cat as $key => $lbl) {
if ($key == "MEMORY") {
$sqlMem = "SELECT SUM(capacity) AS 'capa' FROM memories WHERE hardware_id=%s";
$argMem = $computer->ID;
$resMem = mysql2_query_secure($sqlMem, $_SESSION['OCS']["readServer"], $argMem);
$valMem = mysqli_fetch_array($resMem);
if ($valMem["capa"] > 0) {
$memory = $valMem["capa"];
} else {
$memory = $computer->{$key};
}
$data[$key] = $memory;
} elseif ($key == "LASTDATE" or $key == "LASTCOME") {
$data[$key] = dateTimeFromMysql($computer->{$key});
} elseif ($key == "NAME_RZ") {
$data[$key] = "";
$data_RZ = subnet_name($computer->ID);
$nb_val = count($data_RZ);
if ($nb_val == 1) {
$data[$key] = $data_RZ[0];
} elseif (isset($data_RZ)) {
foreach ($data_RZ as $index => $value) {
$data[$key] .= $index . " => " . $value . "<br>";
}
}
} elseif ($key == "VMTYPE" and $computer->UUID != '') {
$sqlVM = "select vm.hardware_id,vm.vmtype, h.name from virtualmachines vm left join hardware h on vm.hardware_id=h.id where vm.uuid='%s' order by h.name DESC";
$argVM = $computer->UUID;
$resVM = mysql2_query_secure($sqlVM, $_SESSION['OCS']["readServer"], $argVM);
$valVM = mysqli_fetch_array($resVM);
$data[$key] = $valVM['vmtype'];
$link_vm = "<a href='index.php?" . PAG_INDEX . "=" . $urls->getUrl('ms_computer') . "&head=1&systemid=" . $valVM['hardware_id'] . "' target='_blank'><font color=red>" . $valVM['name'] . "</font></a>";
$link[$key] = true;
if ($data[$key] != '') {
msg_info($l->g(1266) . "<br>" . $l->g(1269) . ': ' . $link_vm);
}
} elseif ($key == "IPADDR" and $_SESSION['OCS']['profile']->getRestriction('WOL', 'NO') == "NO") {
$data[$key] = $computer->{$key} . " <a href=# OnClick='confirme(\"\",\"WOL\",\"bandeau\",\"WOL\",\"" . $l->g(1283) . "\");'><i>WOL</i></a>";
$link[$key] = true;
} elseif ($computer->{$key} != '') {
$data[$key] = $computer->{$key};
}
}
}
echo open_form("bandeau");
show_summary($data, $labels, $cat_labels, $link);
echo "<input type='hidden' id='WOL' name='WOL' value=''>";
echo close_form();
}
示例3: msg_warning
if ($infos_status['NIV_BIS'] == "") {
msg_warning($l->g(1089));
} else {
//define tab
$data_on[1] = $l->g(1072);
$data_on[2] = $l->g(1073);
}
if ($_SESSION['OCS']['CONFIGURATION']['TELEDIFF_WK'] == 'YES') {
$data_on[4] = $l->g(107);
}
$form_name = "admins";
echo open_form($form_name);
if (isset($data_on)) {
onglet($data_on, $form_name, "onglet", 4);
$table_name = $form_name;
echo '<div class="mlt_bordure" >';
if ($protectedPost['onglet'] == 2) {
dde_form($form_name);
} elseif ($protectedPost['onglet'] == 4) {
dde_conf($form_name);
} elseif ($protectedPost['onglet'] == 1) {
dde_show($form_name);
}
echo '</div>';
} else {
msg_info($l->g(1187));
}
echo close_form();
} else {
msg_info($l->g(1075));
}
示例4: tooltip
$tooltip = tooltip($msg_header_error_sol[$poub]);
$msg_tooltip .= "<div " . $tooltip . ">" . $values . "</div>";
}
}
msg_error("<big>" . $l->g(1263) . "</big><br>" . $msg_tooltip, "top_msg_alert");
}
//warning are detected
if ($msg_header_warning != array()) {
msg_warning(implode('<br>', $msg_header_warning), "top_msg_warning");
}
}
if (isset($_SESSION['OCS']['TRUE_USER'])) {
msg_info($_SESSION['OCS']['TRUE_USER'] . " " . $l->g(889) . " " . $_SESSION['OCS']["loggeduser"]);
}
if (isset($_SESSION['OCS']["TRUE_mesmachines"])) {
msg_info($l->g(890));
}
echo "</td></tr></table></td></tr>";
if (!isset($_SESSION['OCS']["loggeduser"])) {
echo "<tr><td colspan=20 align=right>";
require_once 'plugins/language/language.php';
echo "</td></tr>";
}
echo "</table>";
echo "<div class='fond'>";
if ($_SESSION['OCS']["mesmachines"] == "NOTAG" and !(array_search('ms_debug', $_SESSION['OCS']['TRUE_PAGES']['ms_debug']) and $protectedGet[PAG_INDEX] == $pages_refs['ms_debug'])) {
if (isset($LIST_ERROR)) {
$msg_error = $LIST_ERROR;
} else {
$msg_error = $l->g(893);
}
示例5: ScanDirectory
$version_database = $_SESSION['OCS']['SQL_BASE_VERS'];
$form_name = 'form_update';
$rep_maj = 'files/update/';
//search all sql files for update
$list_fichier = ScanDirectory($rep_maj, "sql");
echo "<form name='" . $form_name . "' id='" . $form_name . "' method='POST'>";
$msg_info[] = $l->g(2057);
if (GUI_VER < $_SESSION['OCS']['SQL_BASE_VERS']) {
msg_info(implode("<br />", $msg_info));
msg_error($l->g(2107) . "<br>" . $l->g(2108) . "<br>" . $l->g(2109) . ":" . $version_database . "=>" . $l->g(2110) . ":" . GUI_VER);
echo "</form>";
require_once 'require/footer.php';
die;
}
$msg_info[] = $l->g(2109) . ":" . $version_database . "=>" . $l->g(2110) . ":" . GUI_VER;
msg_info(implode("<br />", $msg_info));
echo "<br><input type=submit name='update' value='" . $l->g(2111) . "'>";
if (isset($_POST['update'])) {
while ($version_database < GUI_VER) {
$version_database++;
if (in_array($version_database . ".sql", $list_fichier['name'])) {
if ($_SESSION['OCS']['DEBUG'] == 'ON') {
msg_success("Mise à jour effectuée: " . $version_database . ".sql");
}
exec_fichier_sql($rep_maj . '/' . $version_database . ".sql");
$sql = "update config set tvalue='%s' where name='GUI_VERSION'";
$arg = $version_database;
$res_column = mysql2_query_secure($sql, $_SESSION['OCS']["writeServer"], $arg);
$_SESSION['OCS']['SQL_BASE_VERS'] = $version_database;
} else {
msg_error($l->g(2114) . " " . $version_database);
示例6: show_computer_title
show_computer_title($item);
if (isset($protectedGet['cat']) and $protectedGet['cat'] == 'admin') {
show_computer_summary($item);
}
//Wake On Lan function
if (isset($protectedPost["WOL"]) and $protectedPost["WOL"] == 'WOL' and $_SESSION['OCS']['profile']->getRestriction('WOL', 'NO') == "NO") {
require_once 'require/function_wol.php';
$wol = new Wol();
$sql = "select MACADDR,IPADDRESS from networks WHERE (hardware_id=%s) and status='Up'";
$arg = array($item->ID);
$resultDetails = mysql2_query_secure($sql, $_SESSION['OCS']["readServer"], $arg);
$msg = "";
while ($item = mysqli_fetch_object($resultDetails)) {
$wol->wake($item->MACADDR, $item->IPADDRESS);
if ($wol->wol_send == $l->g(1282)) {
msg_info($wol->wol_send . "=>" . $item->MACADDR . "/" . $item->IPADDRESS);
} else {
msg_error($wol->wol_send . "=>" . $item->MACADDR . "/" . $item->IPADDRESS);
}
}
}
if ($ajax) {
ob_end_clean();
}
$plugins_serializer = new XMLPluginsSerializer();
$plugins = $plugins_serializer->unserialize(file_get_contents('config/computer/plugins.xml'));
if (isset($protectedGet['cat']) and in_array($protectedGet['cat'], array('software', 'hardware', 'devices', 'admin', 'config', 'other'))) {
// If category
foreach ($plugins as $plugin) {
if ($plugin->getCategory() == $protectedGet['cat']) {
$plugin_file = PLUGINS_DIR . "computer_detail/" . $plugin->getId() . "/" . $plugin->getId() . ".php";
示例7: multi_lot
function multi_lot($form_name, $lbl_choise)
{
global $protectedPost, $protectedGet, $l;
$list_id = "";
//print_r($protectedPost);
if (!isset($protectedGet['origine'])) {
if (isset($protectedGet['idchecked']) and $protectedGet['idchecked'] != "") {
$choise_req_selection['REQ'] = $l->g(584);
$choise_req_selection['SEL'] = $l->g(585);
$select_choise = show_modif($choise_req_selection, 'CHOISE', 2, $form_name);
echo "<center>" . $lbl_choise . " " . $select_choise . "</center><br>";
}
if ($protectedPost['CHOISE'] == 'REQ' or $protectedGet['idchecked'] == '') {
msg_info($l->g(901));
if ($protectedGet['idchecked'] == '') {
echo "<input type='hidden' name='CHOISE' value='" . $protectedPost['CHOISE'] . "'>";
$protectedPost['CHOISE'] = 'REQ';
}
$list_id = $_SESSION['OCS']['ID_REQ'];
}
if ($protectedPost['CHOISE'] == 'SEL') {
msg_info($l->g(902));
$list_id = $protectedGet['idchecked'];
}
//gestion tableau
if (is_array($list_id)) {
$list_id = implode(",", $list_id);
}
} else {
$list_id = $protectedGet['idchecked'];
}
if ($list_id != "") {
return $list_id;
} else {
return false;
}
}
示例8: fwrite
fwrite($ch, "define(\"DB_NAME\", \"" . $_POST['database'] . "\");\n");
fwrite($ch, "define(\"SERVER_READ\",\"" . $_POST["host"] . "\");\n");
fwrite($ch, "define(\"SERVER_WRITE\",\"" . $_POST["host"] . "\");\n");
fwrite($ch, "define(\"COMPTE_BASE\",\"" . $_POST["name"] . "\");\n");
fwrite($ch, "define(\"PSWD_BASE\",\"" . $_POST["pass"] . "\");\n");
fwrite($ch, "?>");
fclose($ch);
msg_success("<b><a href='index.php'>" . $l->g(2051) . "</a></b>");
unset($_SESSION['OCS']['SQL_BASE_VERS']);
die;
}
}
if (!$error) {
ob_flush();
flush();
msg_info($l->g(2030));
exec_fichier_sql($db_file, $link);
$ch = @fopen(CONF_MYSQL, "w");
fwrite($ch, "<?php\n");
fwrite($ch, "define(\"DB_NAME\", \"" . $_POST['database'] . "\");\n");
fwrite($ch, "define(\"SERVER_READ\",\"" . $_POST["host"] . "\");\n");
fwrite($ch, "define(\"SERVER_WRITE\",\"" . $_POST["host"] . "\");\n");
fwrite($ch, "define(\"COMPTE_BASE\",\"" . $name_connect . "\");\n");
fwrite($ch, "define(\"PSWD_BASE\",\"" . $pass_connect . "\");\n");
fwrite($ch, "?>");
fclose($ch);
if (!mysqli_connect($_POST["host"], $name_connect, $pass_connect)) {
if (mysqli_connect_errno() == 0) {
echo "<br><center><font color=red><b>" . $l->g(2043) . " " . $l->g(2044) . "</b><br></font></center>";
die;
} else {
示例9: printEnTete
$tab_options['FILTRE']['h.ipaddr'] = $l->g(34);
}
printEnTete($title);
echo "<br><br>";
$tab_options['LBL']['MAC'] = $l->g(95);
$list_col_cant_del = array($l->g(66) => $l->g(66), 'SUP' => 'SUP', 'MODIF' => 'MODIF');
$table_name = "IPDISCOVER_" . $protectedGet['prov'];
$form_name = $table_name;
echo open_form($form_name);
$result_exist = tab_req($table_name, $list_fields, $default_fields, $list_col_cant_del, $sql, $form_name, 80, $tab_options);
$fipdisc = "ipdiscover-util.pl";
$values = look_config_default_values(array('IPDISCOVER_IPD_DIR'));
$IPD_DIR = $values['tvalue']['IPDISCOVER_IPD_DIR'] . "/ipd";
if ($scriptPresent = @stat($fipdisc)) {
$filePresent = true;
if (!is_executable($fipdisc)) {
$msg_info = $fipdisc . " " . $l->g(341);
} else {
if (!is_writable($IPD_DIR)) {
$msg_info = $l->g(342) . " " . $fipdisc . " (" . $IPD_DIR . ")";
}
}
if (!isset($msg_info)) {
echo "<br><input type='button' onclick=window.open(\"index.php?" . PAG_INDEX . "=" . $pages_refs['ms_ipdiscover_analyse'] . "&head=1&rzo=" . $protectedGet['value'] . "\",\"analyse\",\"location=0,status=0,scrollbars=1,menubar=0,resizable=0,width=800,height=650\") name='analyse' value='" . $l->g(317) . "'>";
} else {
msg_info($msg_info);
}
}
echo close_form();
}
}
示例10: verif
$protectedPost['document_root'] = $document_root;
}
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'] == "") {
示例11: media_invoke
//.........这里部分代码省略.........
$popup_form .= '</td></tr>';
}
$popup_form .= '</table>';
} else {
cn_throw_message('Select files to move', 'w');
}
} elseif ($pending == 'move') {
// ...
list($ids, $moveup) = GET('ids, moveup', 'POST');
// prevent illegal moves
$safe_dir = scan_dir($root_dir);
foreach ($safe_dir as $id => $v) {
$safe_dir[$id] = md5($v);
}
// do move all files / dirs
foreach ($ids as $id => $file) {
list($place_folder) = GET('place_folder_' . $id);
if (in_array(md5($file), $safe_dir)) {
$NF = '';
$foldername = preg_replace('/\\.\\//i', '', $place_folder);
// move this file up
if (isset($moveup[$id]) && count($pathes) > 0) {
$nwfolder = dirname($root_dir);
$foldername = 'up folder';
} else {
$nwfolder = $root_dir . ($NF = isset($rm[0]) ? $rm[0] : '') . DIRECTORY_SEPARATOR . $foldername;
if ($rm[0]) {
$NF = $rm[0] . DIRECTORY_SEPARATOR;
}
}
$moveto = $nwfolder . DIRECTORY_SEPARATOR . $file;
//check for image thumbnail
$thumb = $root_dir . '.thumb.' . $file;
// do move
if (rename($root_dir . $file, $moveto)) {
if (file_exists($thumb)) {
rename($thumb, $nwfolder . DIRECTORY_SEPARATOR . '.thumb.' . $file);
}
cn_throw_message(i18n('File [%1] moved to [%2]', cn_htmlspecialchars($file), cn_htmlspecialchars($foldername)));
} else {
cn_throw_message(i18n('File [%1] not moved', cn_htmlspecialchars($file)), 'e');
}
}
}
} elseif ($do_action == 'thumb') {
if (!empty($_POST['rm'])) {
$popup_form = get_sizes_form('Make thumbnails', $do_action);
} else {
cn_throw_message('Select files to make thumbnail', 'w');
}
} elseif ($pending == 'thumb') {
do_resize_image($root_dir);
} elseif ($do_action == 'resize') {
if (!empty($_POST['rm'])) {
$popup_form = get_sizes_form('Resize source image', $do_action);
} else {
cn_throw_message('Select files to resize', 'w');
}
} elseif ($pending == 'resize') {
do_resize_image($root_dir, false);
} elseif (!hook('media/post_action')) {
msg_info("Action error");
}
}
}
// Check dir exists
if (is_dir($root_dir)) {
$raw_files = scan_dir($root_dir);
} else {
cn_throw_message('Dir not exists', 'e');
$raw_files = array();
}
$dirs = $files = array();
foreach ($raw_files as $file) {
if (preg_match('/avatar_/', $file)) {
continue;
}
$file_location = "{$root_dir}/{$file}";
if (is_dir($file_location)) {
$dirs[] = array('url' => "{$path}/{$file}", 'name' => $file);
} elseif (filesize(cn_path_construct($udir, $path) . $file) != 0) {
list($w, $h) = getimagesize(cn_path_construct($udir, $path) . $file);
$is_thumb = preg_match('/\\.thumb\\./', $file);
$files[] = array('name' => $file, 'url' => $edir . '/' . ($path ? $path . '/' : '') . $file, 'thumb' => file_exists($root_dir . '/.thumb.' . pathinfo($file, PATHINFO_BASENAME)) ? $edir . '/' . ($path ? $path . '/' : '') . '.thumb.' . pathinfo($file, PATHINFO_BASENAME) : '', 'local' => ($path ? $path . '/' : '') . $file, 'just_uploaded' => isset($just_uploaded[$file]) ? TRUE : FALSE, 'is_thumb' => $is_thumb, 'w' => $w, 'h' => $h, 'fs' => round(filesize($file_location) / 1024, 1));
}
}
uasort($dirs, 'usort_by_name_asc');
uasort($files, 'usort_by_name_asc');
// Top level (dashboard)
cn_bc_add('Dashboard', cn_url_modify(array('reset')));
cn_bc_add('Media manager', cn_url_modify());
cn_assign("files, dirs, path, pathes, popup_form, root_dir", $files, $dirs, $path, $pathes, $popup_form, $root_dir);
if ($opt === 'inline') {
echo exec_tpl('window', 'title=Quick insert image', 'style=media/style.css', 'content=' . exec_tpl('media/general'));
} else {
echoheader('-@media/style.css', 'Media manager');
echo exec_tpl('media/general');
echofooter();
}
}
示例12: edit_news_delete
function edit_news_delete()
{
cn_dsi_check();
if (!test('Nud')) {
msg_info("Unable to delete news: no permission");
}
$FlatDB = new FlatDB();
list($id, $source) = GET('id, source', 'GET');
$ida = db_index_load($source);
$nloc = db_get_nloc($id);
$db = db_news_load($nloc);
// ------
$FlatDB->cn_remove_categories($db[$id]['c'], $db[$id]['id']);
$FlatDB->cn_update_date(0, $db[$id]['id']);
$FlatDB->cn_user_sync($db[$id]['u'], 0, $db[$id]['id']);
$FlatDB->cn_remove_tags($db[$id]['tg'], $db[$id]['id']);
// ------
unset($db[$id]);
unset($ida[$id]);
// Remove from meta-index
$_ts_id = bt_get_id($id, 'nts_id');
bt_del_id($id, 'nts_id');
bt_del_id($_ts_id, 'nid_ts');
// Remove page alias
$_ts_pg = bt_get_id($id, 'ts_pg');
bt_del_id($id, 'ts_pg');
bt_del_id($_ts_pg, 'pg_ts');
// save block
db_save_news($db, $nloc);
db_index_save($ida, $source);
db_index_update_overall($source);
cn_relocation(cn_url_modify(array('reset'), 'mod=editnews', "source={$source}"));
$FlatDB->cache_clean();
}
示例13: create_pack
function create_pack($sql_details, $info_details)
{
global $l;
if (DEMO) {
msg_info($l->g(2103));
return;
}
$info_details = xml_escape_string($info_details);
//get temp file
$fname = $sql_details['document_root'] . $sql_details['timestamp'] . "/tmp";
//cut this package
if ($size = @filesize($fname)) {
$handle = fopen($fname, "rb");
$read = 0;
for ($i = 1; $i < $sql_details['nbfrags']; $i++) {
$contents = fread($handle, $size / $sql_details['nbfrags']);
$read += strlen($contents);
$handfrag = fopen($sql_details['document_root'] . $sql_details['timestamp'] . "/" . $sql_details['timestamp'] . "-" . $i, "w+b");
fwrite($handfrag, $contents);
fclose($handfrag);
}
$contents = fread($handle, $size - $read);
$read += strlen($contents);
$handfrag = fopen($sql_details['document_root'] . $sql_details['timestamp'] . "/" . $sql_details['timestamp'] . "-" . $i, "w+b");
fwrite($handfrag, $contents);
fclose($handfrag);
fclose($handle);
unlink($sql_details['document_root'] . $sql_details['timestamp'] . "/tmp");
} else {
if (!file_exists($sql_details['document_root'] . $sql_details['timestamp'])) {
mkdir($sql_details['document_root'] . $sql_details['timestamp']);
}
}
//if $info_details['DIGEST'] is null => no file to deploy, only execute commande in info file
// so nb_frag=0
if (!isset($info_details['DIGEST']) or $info_details['DIGEST'] == "") {
$sql_details['nbfrags'] = 0;
}
//create info
$info = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
$info .= "<DOWNLOAD ID=\"" . $sql_details['timestamp'] . "\" " . "PRI=\"" . $info_details['PRI'] . "\" " . "ACT=\"" . $info_details['ACT'] . "\" " . "DIGEST=\"" . $info_details['DIGEST'] . "\" " . "PROTO=\"" . $info_details['PROTO'] . "\" " . "FRAGS=\"" . $sql_details['nbfrags'] . "\" " . "DIGEST_ALGO=\"" . $info_details['DIGEST_ALGO'] . "\" " . "DIGEST_ENCODE=\"" . $info_details['DIGEST_ENCODE'] . "\" ";
if ($info_details['ACT'] == 'STORE') {
$info .= "PATH=\"" . $info_details['PATH'] . "\" ";
}
if ($info_details['ACT'] == 'LAUNCH') {
$info .= "NAME=\"" . $info_details['NAME'] . "\" ";
}
if ($info_details['ACT'] == 'EXECUTE') {
$info .= "COMMAND=\"" . $info_details['COMMAND'] . "\" ";
}
$info .= "NOTIFY_USER=\"" . $info_details['NOTIFY_USER'] . "\" " . "NOTIFY_TEXT=\"" . $info_details['NOTIFY_TEXT'] . "\" " . "NOTIFY_COUNTDOWN=\"" . $info_details['NOTIFY_COUNTDOWN'] . "\" " . "NOTIFY_CAN_ABORT=\"" . $info_details['NOTIFY_CAN_ABORT'] . "\" " . "NOTIFY_CAN_DELAY=\"" . $info_details['NOTIFY_CAN_DELAY'] . "\" " . "NEED_DONE_ACTION=\"" . $info_details['NEED_DONE_ACTION'] . "\" " . "NEED_DONE_ACTION_TEXT=\"" . $info_details['NEED_DONE_ACTION_TEXT'] . "\" " . "GARDEFOU=\"" . $info_details['GARDEFOU'] . "\" />\n";
$handinfo = fopen($sql_details['document_root'] . $sql_details['timestamp'] . "/info", "w+");
fwrite($handinfo, utf8_decode($info));
fclose($handinfo);
//delete all package with the same id
mysql2_query_secure("DELETE FROM download_available WHERE FILEID='%s'", $_SESSION['OCS']["writeServer"], $sql_details['timestamp']);
//insert new package
$req = "INSERT INTO download_available(FILEID, NAME, PRIORITY, FRAGMENTS, SIZE, OSNAME, COMMENT,ID_WK) VALUES\n\t\t( '%s', '%s','%s', '%s','%s', '%s', '%s','%s' )";
$arg = array($sql_details['timestamp'], $sql_details['name'], $info_details['PRI'], $sql_details['nbfrags'], $sql_details['size'], $sql_details['os'], $sql_details['description'], $sql_details['id_wk']);
mysql2_query_secure($req, $_SESSION['OCS']["writeServer"], $arg);
addLog($l->g(512), $l->g(617) . " " . $sql_details['timestamp']);
//info message
msg_success($l->g(437) . " " . $sql_details['document_root'] . $sql_details['timestamp']);
//delete cache for activation
unset($_SESSION['OCS']['DATA_CACHE']['LIST_PACK']);
unset($_SESSION['OCS']['NUM_ROW']['LIST_PACK']);
}
示例14: tab_req
function tab_req($table_name, $list_fields, $default_fields, $list_col_cant_del, $queryDetails, $form_name, $width = '100', $tab_options = '')
{
global $protectedPost, $l, $pages_refs;
if (!$tab_options['AS']) {
$tab_options['AS'] = array();
}
if ($_SESSION['OCS']["tabcache"] == 0) {
$tab_options['CACHE'] = 'RESET';
}
echo "<script language='javascript'>\n\t\tfunction checkall()\n\t\t {\n\t\t\tfor(i=0; i<document." . $form_name . ".elements.length; i++)\n\t\t\t{\n\t\t\t\tif(document." . $form_name . ".elements[i].name.substring(0,5) == 'check'){\n\t\t\t if (document." . $form_name . ".elements[i].checked)\n\t\t\t\t\t\tdocument." . $form_name . ".elements[i].checked = false;\n\t\t\t\t\telse\n\t\t\t\t\t\tdocument." . $form_name . ".elements[i].checked = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t</script>";
$link = $_SESSION['OCS']["readServer"];
//show select nb page
$limit = nb_page($form_name, 100, "", "", $table_name);
//you want to filter your result
if (isset($tab_options['FILTRE'])) {
$Details = filtre($tab_options['FILTRE'], $form_name, $queryDetails, $tab_options['ARG_SQL'], $tab_options['ARG_SQL_COUNT']);
$queryDetails = $Details['SQL'];
if (is_array($Details['ARG'])) {
$tab_options['ARG_SQL'] = $Details['ARG'];
}
if (is_array($Details['ARG_COUNT'])) {
$tab_options['ARG_SQL_COUNT'] = $Details['ARG_COUNT'];
}
}
//by default, sort by column 1
if ($protectedPost['tri_' . $table_name] == "" or !in_array($protectedPost['tri_' . $table_name], $list_fields) and !in_array($protectedPost['tri_' . $table_name], $tab_options['AS'])) {
$protectedPost['tri_' . $table_name] = 1;
}
//by default, sort ASC
if ($protectedPost['sens_' . $table_name] == "") {
$protectedPost['sens_' . $table_name] = 'ASC';
}
//if data is signed and data = ip
$tab_iplike = array('H.IPADDR', 'IPADDRESS', 'IP', 'IPADDR');
if (in_array(mb_strtoupper($protectedPost['tri_' . $table_name]), $tab_iplike)) {
$queryDetails .= " order by INET_ATON(" . $protectedPost['tri_' . $table_name] . ") " . $protectedPost['sens_' . $table_name];
} elseif ($tab_options['TRI']['SIGNED'][$protectedPost['tri_' . $table_name]]) {
$queryDetails .= " order by cast(" . $protectedPost['tri_' . $table_name] . " as signed) " . $protectedPost['sens_' . $table_name];
} elseif ($tab_options['TRI']['DATE'][$protectedPost['tri_' . $table_name]]) {
if (isset($tab_options['ARG_SQL'])) {
$queryDetails .= " order by STR_TO_DATE(%s,'%s') %s";
$tab_options['ARG_SQL'][] = $protectedPost['tri_' . $table_name];
$tab_options['ARG_SQL'][] = $tab_options['TRI']['DATE'][$protectedPost['tri_' . $table_name]];
$tab_options['ARG_SQL'][] = $protectedPost['sens_' . $table_name];
} else {
$queryDetails .= " order by STR_TO_DATE(" . $protectedPost['tri_' . $table_name] . ",'" . $tab_options['TRI']['DATE'][$protectedPost['tri_' . $table_name]] . "') " . $protectedPost['sens_' . $table_name];
}
} else {
$queryDetails .= " order by " . $protectedPost['tri_' . $table_name] . " " . $protectedPost['sens_' . $table_name];
}
if (isset($protectedPost["pcparpage"]) and $protectedPost["pcparpage"] <= 200) {
$limit_result_cache = 200;
$force_no_cache = false;
} elseif (isset($protectedPost["pcparpage"])) {
$limit_result_cache = $protectedPost["pcparpage"];
$force_no_cache = true;
}
//$tab_options['CACHE']='RESET';
//suppression de la limite de cache
//si on est sur la m�me page mais pas sur le m�me onglet
if ($_SESSION['OCS']['csv']['SQL'][$table_name] != $queryDetails or isset($tab_options['ARG_SQL']) and $tab_options['ARG_SQL'] != $_SESSION['OCS']['csv']['ARG'][$table_name]) {
unset($protectedPost['page']);
$tab_options['CACHE'] = 'RESET';
}
//Delete cache
if ($tab_options['CACHE'] == 'RESET' or isset($protectedPost['SUP_PROF']) and $protectedPost['SUP_PROF'] != '' or isset($protectedPost['RESET']) and $protectedPost['RESET'] != '') {
if ($_SESSION['OCS']['DEBUG'] == 'ON') {
msg_info($l->g(5003));
}
unset($_SESSION['OCS']['DATA_CACHE'][$table_name]);
unset($_SESSION['OCS']['NUM_ROW'][$table_name]);
}
if (isset($_SESSION['OCS']['NUM_ROW'][$table_name]) and $_SESSION['OCS']['NUM_ROW'][$table_name] > $limit["BEGIN"] and $_SESSION['OCS']['NUM_ROW'][$table_name] <= $limit["END"] and !isset($_SESSION['OCS']['DATA_CACHE'][$table_name][$limit["END"]])) {
if ($_SESSION['OCS']['DEBUG'] == 'ON') {
msg_info($l->g(5004) . " " . $limit["END"] . " => " . ($_SESSION['OCS']['NUM_ROW'][$table_name] - 1));
}
$limit["END"] = $_SESSION['OCS']['NUM_ROW'][$table_name] - 1;
}
if (isset($_SESSION['OCS']['DATA_CACHE'][$table_name][$limit["END"]]) and isset($_SESSION['OCS']['NUM_ROW'][$table_name])) {
if ($_SESSION['OCS']['DEBUG'] == 'ON') {
msg_info($l->g(5005));
}
$var_limit = $limit["BEGIN"];
while ($var_limit <= $limit["END"]) {
$sql_data[$var_limit] = $_SESSION['OCS']['DATA_CACHE'][$table_name][$var_limit];
$var_limit++;
}
$num_rows_result = $_SESSION['OCS']['NUM_ROW'][$table_name];
if (isset($_SESSION['OCS']['REPLACE_VALUE_ALL_TIME'])) {
$tab_options['REPLACE_VALUE_ALL_TIME'] = $_SESSION['OCS']['REPLACE_VALUE_ALL_TIME'];
}
$result_data = gestion_donnees($sql_data, $list_fields, $tab_options, $form_name, $default_fields, $list_col_cant_del, $queryDetails, $table_name);
$data = $result_data['DATA'];
$entete = $result_data['ENTETE'];
$correct_list_col_cant_del = $result_data['correct_list_col_cant_del'];
$correct_list_fields = $result_data['correct_list_fields'];
$i = 1;
} else {
//search static values
if (isset($_SESSION['OCS']['SQL_DATA_FIXE'][$table_name])) {
//.........这里部分代码省略.........
示例15: msg_success
msg_success($nb_line_affected . " " . $l->g(1026));
}
//CAS OF WOL
if (isset($protectedPost['WOL']) and $protectedPost['WOL'] != '') {
require_once 'require/function_wol.php';
$wol = new Wol();
$sql = "select IPADDRESS,MACADDR from networks WHERE status='Up' and hardware_id in ";
$arg = array();
$tab_result = mysql2_prepare($sql, $arg, $list_id);
$resultDetails = mysql2_query_secure($tab_result['SQL'], $_SESSION['OCS']["writeServer"], $tab_result['ARG']);
$msg = "";
while ($item = mysqli_fetch_object($resultDetails)) {
$wol->wake($item->MACADDR, $item->IPADDRESS);
$msg .= "<br>" . $wol->wol_send . "=>" . $item->MACADDR . "/" . $item->IPADDRESS;
}
msg_info($msg);
}
//tab definition
if ($_SESSION['OCS']['profile']->getConfigValue('CHANGE_ACCOUNTINFO') == "YES") {
$def_onglets['TAG'] = $l->g(1022);
} else {
$protectedPost['onglet'] = 'SUP_PACK';
}
$def_onglets['SUP_PACK'] = $l->g(1021);
if ($_SESSION['OCS']['profile']->getRestriction('WOL', 'NO') == "NO") {
$def_onglets['WOL'] = $l->g(1280);
}
if ($protectedPost['onglet'] == "") {
$protectedPost['onglet'] = "TAG";
}
//show onglet