当前位置: 首页>>代码示例>>PHP>>正文


PHP msg_success函数代码示例

本文整理汇总了PHP中msg_success函数的典型用法代码示例。如果您正苦于以下问题:PHP msg_success函数的具体用法?PHP msg_success怎么用?PHP msg_success使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了msg_success函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add_update_key

function add_update_key($form_values, $update = false)
{
    global $l;
    foreach ($form_values as $key => $value) {
        if (trim($value) == "") {
            msg_error($l->g(988));
            return FALSE;
        }
    }
    if ($update) {
        $req = "UPDATE regconfig SET " . "NAME='%s'," . "REGTREE='%s'," . "REGKEY='%s'," . "REGVALUE='%s' " . "where ID='%s'";
        $arg_req = array($form_values["NAME"], $form_values["REGTREE"], $form_values["REGKEY"], $form_values["REGVALUE"], $update);
    } else {
        $sql_verif = "select ID from regconfig \n\t\t\t\t\t\twhere REGTREE='%s' \n\t\t\t\t\t\t\tand REGKEY='%s'\n\t\t\t\t\t\t\tand REGVALUE='%s'";
        $arg_verif = array($form_values["REGTREE"], $form_values["REGKEY"], $form_values["REGVALUE"]);
        $res = mysql2_query_secure($sql_verif, $_SESSION['OCS']["readServer"], $arg_verif);
        $row = mysql_fetch_object($res);
        if (!is_numeric($row->ID)) {
            $req = "INSERT INTO regconfig (NAME,REGTREE,REGKEY,REGVALUE)\n\t\t\t\t\tVALUES('%s','%s','%s','%s')";
            $arg_req = array($form_values["NAME"], $form_values["REGTREE"], $form_values["REGKEY"], $form_values["REGVALUE"]);
        } else {
            msg_error($l->g(987));
            return FALSE;
        }
    }
    if (isset($req)) {
        mysql2_query_secure($req, $_SESSION['OCS']["writeServer"], $arg_req);
        if ($update) {
            msg_success($l->g(1185));
        } else {
            msg_success($l->g(1184));
        }
        return TRUE;
    }
}
开发者ID:inkoss,项目名称:karoshi-server,代码行数:35,代码来源:function_regconfig.php

示例2: create_pack

function create_pack($sql_details, $info_details)
{
    global $l;
    $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']);
}
开发者ID:remicollet,项目名称:OCSInventory-ocsreports,代码行数:63,代码来源:function_telediff.php

示例3: update_config

function update_config($name, $field, $value, $msg = true)
{
    global $l;
    $sql = "update config set %s='%s' where name='%s'";
    $arg = array($field, $value, $name);
    mysql2_query_secure($sql, $_SESSION['OCS']["writeServer"], $arg);
    if ($msg) {
        msg_success($l->g(1200));
    }
}
开发者ID:inkoss,项目名称:karoshi-server,代码行数:10,代码来源:function_config_generale.php

示例4: mysql_insert_id

             $id = mysql_insert_id($_SESSION['OCS']["writeServer"]);
             if (is_numeric($id)) {
                 if ($protectedPost["newtype"] == 1) {
                     $type = "LONGTEXT";
                 } elseif ($protectedPost["newtype"] == 8) {
                     $type = "BLOB";
                 } else {
                     $type = "VARCHAR(255)";
                 }
                 $sql_add_column = "ALTER TABLE downloadwk_pack ADD COLUMN fields_" . $id . " " . $type . " default NULL";
                 mysql2_query_secure($sql_add_column, $_SESSION['OCS']["writeServer"]);
             } else {
                 msg_error("mysql_insert_id() problem");
             }
         }
         msg_success($l->g(1069));
         reloadform_closeme($protectedGet['form']);
         if ($protectedPost['Valid_modif_x'] != "") {
             unset($protectedPost['newfield'], $protectedPost['newlbl']);
         }
     } else {
         msg_error($ERROR);
     }
 }
 //NAME FIELD
 $name_field = array("newfield");
 $tab_name = array($l->g(1070) . ": ");
 $type_field = array(0);
 $value_field = array($protectedPost['newfield']);
 $config['JAVASCRIPT'][0] = $sql_field;
 if (isset($protectedGet['admin'])) {
开发者ID:inkoss,项目名称:karoshi-server,代码行数:31,代码来源:ms_admin_management.php

示例5: admin_serveur

function admin_serveur($action, $name_server, $descr, $mach)
{
    global $l;
    if ($action == "") {
        return $l->g(663);
    }
    //intern problem
    if (trim($name_server) == "") {
        return $l->g(638);
    }
    //name of server is empty
    if ($mach == "") {
        return $l->g(665);
    }
    //no mach selected. group not creat
    if (is_numeric($name_server)) {
        $idGroupServer = $name_server;
    } else {
        //verification group not have the same name
        $reqGetId = "SELECT id FROM hardware WHERE name='%s'";
        $arg = $name_server;
        $resGetId = mysql2_query_secure($reqGetId, $_SESSION['OCS']["readServer"], $arg);
        if ($valGetId = mysql_fetch_array($resGetId)) {
            $idGroupServer = $valGetId['id'];
        }
    }
    //if we are in creat new server
    if ($action == 'new_serv') {
        //if the name not exist in the base
        if (!isset($idGroupServer)) {
            $deviceid = '_DOWNLOADGROUP_';
            $sql = "INSERT INTO hardware(deviceid,name,description,lastdate) VALUES( '%s' , '%s', '%s', NOW() )";
            $arg = array($deviceid, $name_server, $descr);
            mysql2_query_secure($sql, $_SESSION['OCS']["writeServer"], $arg);
            //Getting hardware id
            $insertId = mysql_insert_id($_SESSION['OCS']["writeServer"]);
            exist_server($mach);
            $nb_mach = add_mach($insertId, $mach);
            msg_success($l->g(880) . "<br>" . $nb_mach . " " . $l->g(881));
            return '';
        } else {
            return $l->g(621);
        }
        //this name allready exist
    } elseif ($action == 'add_serv' or $action == 'replace_serv') {
        if ($action == 'replace_serv') {
            $sql = "DELETE FROM download_servers WHERE GROUP_ID=%s";
            $arg = $idGroupServer;
            mysql2_query_secure($sql, $_SESSION['OCS']["writeServer"], $arg);
        }
        exist_server($mach);
        $nb_mach = add_mach($idGroupServer, $mach);
        msg_success($l->g(879) . "<br>" . $nb_mach . " " . $l->g(881));
        return '';
    } elseif ($action == 'del_serv') {
        $nb_mach = remove_list_serv($idGroupServer, $mach);
        msg_success($nb_mach . " " . $l->g(882));
        return '';
    }
}
开发者ID:inkoss,项目名称:karoshi-server,代码行数:60,代码来源:function_server.php

示例6: creat_group

// code is always made freely available.
// Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt
//====================================================================================
/*
 * Page des groupes
 * 
 */
require_once 'require/function_groups.php';
require_once 'require/function_computers.php';
//ADD new static group
if ($protectedPost['Valid_modif_x']) {
    $result = creat_group($protectedPost['NAME'], $protectedPost['DESCR'], '', '', 'STATIC');
    if ($result['RESULT'] == "ERROR") {
        msg_error($result['LBL']);
    } elseif ($result['RESULT'] == "OK") {
        msg_success($result['LBL']);
        unset($protectedPost['add_static_group']);
    }
    $tab_options['CACHE'] = 'RESET';
}
//reset add static group
if ($protectedPost['Reset_modif_x'] or $protectedPost['onglet'] != $protectedPost['old_onglet']) {
    unset($protectedPost['add_static_group']);
}
//view only your computers
if ($_SESSION['OCS']['RESTRICTION']['GUI'] == 'YES') {
    $mycomputers = computer_list_by_tag();
    if ($mycomputers == "ERROR") {
        msg_error($l->g(893));
        require_once FOOTER_HTML;
        die;
开发者ID:inkoss,项目名称:karoshi-server,代码行数:31,代码来源:ms_groups.php

示例7: active_option

     }
     if (isset($protectedPost['DOWNLOAD_POSTCMD']) and $protectedPost['DOWNLOAD_POSTCMD'] != '') {
         active_option('DOWNLOAD_POSTCMD', $list_id, $protectedPost['SELECT'], $protectedPost['DOWNLOAD_POSTCMD']);
     }
     if ($protectedGet['origine'] == "group") {
         $form_to_reload = 'config_group';
     } elseif ($protectedGet['origine'] == "mach") {
         $form_to_reload = 'config_mach';
     }
     if ($protectedPost['onglet'] == 'MACH') {
         $nb_affect = active_option('DOWNLOAD', $list_id, $protectedPost['SELECT']);
     }
     if ($protectedPost['onglet'] == 'SERV_GROUP') {
         $nb_affect = active_serv($list_id, $protectedPost['SELECT'], $protectedPost['rule_choise']);
     }
     msg_success($nb_affect . " " . $l->g(604));
     if (isset($form_to_reload)) {
         //add this $var => not delete this package on computer detail
         $_SESSION['OCS']["justAdded"] = true;
         echo "<script language='javascript'> window.opener.document." . $form_to_reload . ".submit();</script>";
     }
 }
 if ($protectedPost['sens_' . $table_name] == "") {
     $protectedPost['sens_' . $table_name] = 'DESC';
 }
 if ($protectedPost['onglet'] == "") {
     $protectedPost['onglet'] = 'MACH';
 }
 $def_onglets['MACH'] = $l->g(980);
 $def_onglets['SERV_GROUP'] = $l->g(981);
 //show tab
开发者ID:inkoss,项目名称:karoshi-server,代码行数:31,代码来源:ms_custom_pack.php

示例8: unset

         unset($protectedPost['MODIF'], $protectedPost['ADD_COMM']);
         $msg_ok = $msg_result['SUCCESS'];
         $tab_options['CACHE'] = 'RESET';
     } else {
         $msg_error = $msg_result['ERROR'];
     }
 }
 if (isset($protectedPost['Reset_modif'])) {
     unset($protectedPost['MODIF'], $protectedPost['ADD_COMM']);
 }
 if (isset($protectedPost['SUP_PROF']) and is_numeric($protectedPost['SUP_PROF'])) {
     del_community($protectedPost['SUP_PROF']);
     $msg_ok = $l->g(1212);
 }
 if (isset($msg_ok)) {
     msg_success($msg_ok);
 }
 if (isset($msg_error)) {
     msg_error($msg_error);
 }
 if ($protectedPost['ADD_COMM'] == $l->g(116) or is_numeric($protectedPost['MODIF'])) {
     $list_version = array('-1' => '2c', '1' => '1', '2' => '2', '3' => '3');
     $title = $l->g(1207);
     if (isset($protectedPost['MODIF']) and is_numeric($protectedPost['MODIF']) and !isset($protectedPost['NAME'])) {
         $info_com = find_community_info($protectedPost['MODIF']);
         $default_values = array('ID' => $protectedPost['MODIF'], 'NAME' => $info_com->NAME, 'VERSION' => $list_version, 'USERNAME' => $info_com->USERNAME, 'AUTHKEY' => $info_com->AUTHKEY, 'AUTHPASSWD' => $info_com->AUTHPASSWD);
         if ($info_com->VERSION == "2c") {
             $protectedPost['VERSION'] = -1;
         } else {
             $protectedPost['VERSION'] = $info_com->VERSION;
         }
开发者ID:stweil,项目名称:OCSInventory-ocsreports,代码行数:31,代码来源:ms_admin_ipdiscover.php

示例9: insert_blacklist_table

function insert_blacklist_table($table, $field, $field_value)
{
    global $l;
    $i = 1;
    $sql = "insert into %s ";
    $arg = array($table);
    $sql = mysql2_prepare($sql, $arg, $field, true);
    $sql['SQL'] .= " value ";
    $sql = mysql2_prepare($sql['SQL'], $sql['ARG'], $field_value);
    //		//no error
    mysql2_query_secure($sql['SQL'], $_SESSION['OCS']["writeServer"], $sql['ARG']);
    msg_success($l->g(655));
}
开发者ID:inkoss,项目名称:karoshi-server,代码行数:13,代码来源:function_blacklist.php

示例10: update_accountinfo

    $protectedPost['default_value'] = $accountinfo_detail[$protectedPost['MODIF']]['default_value'];
    $hidden = $protectedPost['MODIF'];
}
if (isset($protectedPost['MODIF_OLD']) and is_numeric($protectedPost['MODIF_OLD']) and $protectedPost['Valid_modif'] != "") {
    //UPDATE VALUE
    $msg = update_accountinfo($protectedPost['MODIF_OLD'], array('TYPE' => $protectedPost['newtype'], 'NAME' => $protectedPost['newfield'], 'COMMENT' => $protectedPost['newlbl'], 'ID_TAB' => $protectedPost['account_tab'], 'DEFAULT_VALUE' => $protectedPost['default_value']), $protectedPost['accountinfo']);
    $hidden = $protectedPost['MODIF_OLD'];
} elseif ($protectedPost['Valid_modif'] != "") {
    //ADD NEW VALUE
    $msg = add_accountinfo($protectedPost['newfield'], $protectedPost['newtype'], $protectedPost['newlbl'], $protectedPost['account_tab'], $protectedPost['accountinfo'], $protectedPost['default_value']);
}
if (isset($msg['ERROR'])) {
    msg_error($msg['ERROR']);
}
if (isset($msg['SUCCESS'])) {
    msg_success($msg['SUCCESS']);
    $protectedPost['onglet'] = 1;
}
echo open_form($form_name);
show_tabs($data_on, $form_name, "onglet", 2);
echo '<div class="right-content mlt_bordure" >';
$table = "accountinfo";
if (isset($protectedPost['ACCOUNTINFO_CHOISE']) and $protectedPost['ACCOUNTINFO_CHOISE'] == 'SNMP' and $protectedPost['onglet'] == 1 or isset($protectedPost['accountinfo']) and $protectedPost['accountinfo'] == 'SNMP' and $protectedPost['onglet'] == 2) {
    $array_tab_account = find_all_account_tab('TAB_ACCOUNTSNMP');
    $account_field = "TAB_ACCOUNTSNMP";
} else {
    $array_tab_account = find_all_account_tab('TAB_ACCOUNTAG');
    $account_field = "TAB_ACCOUNTAG";
}
if ($protectedPost['onglet'] == 1) {
    echo $l->g(56) . ": " . show_modif($accountinfo_choise, 'ACCOUNTINFO_CHOISE', 2, $form_name, array('DEFAULT' => "NO"));
开发者ID:remicollet,项目名称:OCSInventory-ocsreports,代码行数:31,代码来源:ms_admininfo.php

示例11: admin_profil

function admin_profil($form)
{
    global $protectedPost, $l, $pages_refs;
    $yes_no = array('YES' => $l->g(455), 'NO' => $l->g(454));
    $info_field = array('NAME' => array('INFO' => array('LBL' => $l->g(1153) . ": ", 'VALUE' => '')), 'GUI' => array('RESTRICTION' => array('LBL' => $l->g(1154) . ": ", 'VALUE' => $yes_no)), 'TELEDIFF_ACTIVATE' => array('RESTRICTION' => array('LBL' => $l->g(1158) . ": ", 'VALUE' => $yes_no)), 'TELEDIFF_VISIBLE' => array('RESTRICTION' => array('LBL' => $l->g(1301) . ": ", 'VALUE' => $yes_no)), 'EXPORT_XML' => array('RESTRICTION' => array('LBL' => $l->g(1305), 'VALUE' => $yes_no)), 'WOL' => array('RESTRICTION' => array('LBL' => $l->g(1281) . ": ", 'VALUE' => $yes_no)), 'MACADD' => array('ADMIN_BLACKLIST' => array('LBL' => $l->g(1159) . ": ", 'VALUE' => $yes_no)), 'SERIAL' => array('ADMIN_BLACKLIST' => array('LBL' => $l->g(1160) . ": ", 'VALUE' => $yes_no)), 'IPDISCOVER' => array('ADMIN_BLACKLIST' => array('LBL' => $l->g(1161) . ": ", 'VALUE' => $yes_no), 'CONFIGURATION' => array('LBL' => $l->g(1172) . ": ", 'VALUE' => $yes_no)), 'TELEDIFF' => array('CONFIGURATION' => array('LBL' => $l->g(1162) . ": ", 'VALUE' => $yes_no)), 'CONFIG' => array('CONFIGURATION' => array('LBL' => $l->g(1163) . ": ", 'VALUE' => $yes_no)), 'GROUPS' => array('CONFIGURATION' => array('LBL' => $l->g(1164) . ": ", 'VALUE' => $yes_no)), 'CONSOLE' => array('CONFIGURATION' => array('LBL' => $l->g(1165) . ": ", 'VALUE' => $yes_no)), 'ALERTE_MSG' => array('CONFIGURATION' => array('LBL' => $l->g(1166) . ": ", 'VALUE' => $yes_no)), 'ACCOUNTINFO' => array('CONFIGURATION' => array('LBL' => $l->g(1167) . ": ", 'VALUE' => $yes_no)), 'CHANGE_ACCOUNTINFO' => array('CONFIGURATION' => array('LBL' => $l->g(1168) . ": ", 'VALUE' => $yes_no)), 'CHANGE_USER_GROUP' => array('CONFIGURATION' => array('LBL' => $l->g(1169) . ": ", 'VALUE' => $yes_no)), 'MANAGE_PROFIL' => array('CONFIGURATION' => array('LBL' => $l->g(1170) . ": ", 'VALUE' => $yes_no)), 'MANAGE_USER_GROUP' => array('CONFIGURATION' => array('LBL' => $l->g(1171) . ": ", 'VALUE' => $yes_no)), 'MANAGE_SMTP_COMMUNITIES' => array('CONFIGURATION' => array('LBL' => $l->g(1205) . ": ", 'VALUE' => $yes_no)), 'DELETE_COMPUTERS' => array('CONFIGURATION' => array('LBL' => $l->g(1272) . ": ", 'VALUE' => $yes_no)));
    $lbl_cat = array('INFO' => $l->g(1173), 'PAGE_PROFIL' => $l->g(1174), 'RESTRICTION' => $l->g(1175), 'ADMIN_BLACKLIST' => $l->g(1176), 'CONFIGURATION' => $l->g(1177));
    if ($protectedPost['Valid_modif_profil']) {
        //read profil file
        $forprofil = read_profil_file($protectedPost['PROFILS']);
        //read all profil value
        $forall = read_config_file();
        //build new tab with new values
        foreach ($info_field as $if_name => $if_value) {
            foreach ($if_value as $if_cat => $if_val) {
                if (isset($protectedPost[$if_name]) and $protectedPost['cat'] == $if_cat) {
                    $new_value[$if_cat][$if_name] = $protectedPost[$if_name];
                } else {
                    $new_value[$if_cat][$if_name] = $forprofil[$if_cat][$if_name];
                }
            }
        }
        foreach ($forall['URL'] as $name => $value) {
            if (isset($protectedPost[$name]) and $protectedPost['cat'] == "PAGE_PROFIL") {
                $new_value["PAGE_PROFIL"][$name] = '';
            }
        }
        if (!isset($new_value['PAGE_PROFIL'])) {
            $new_value['PAGE_PROFIL'] = $forprofil['PAGE_PROFIL'];
        }
        update_config_file($protectedPost['PROFILS'], $new_value);
        msg_success($l->g(1274));
    }
    $array_profil = get_profile_labels();
    echo $l->g(1196) . ": " . show_modif($array_profil, "PROFILS", 2, $form);
    echo "<a href=\"index.php?" . PAG_INDEX . "=" . $pages_refs['ms_new_profil'] . "&head=1&form=" . $form . "\"><img src=image/plus.png></a>";
    if (isset($protectedPost['PROFILS']) and $protectedPost['PROFILS'] != '') {
        $forall = read_config_file();
        $forprofil = read_profil_file($protectedPost['PROFILS'], 'WRITE');
        if (is_array($forprofil) and is_array($forall)) {
            foreach ($forprofil as $key => $value) {
                if (isset($lbl_cat[$key])) {
                    $data_on[$key] = $lbl_cat[$key];
                }
            }
            onglet($data_on, $form, "cat", 10);
            if (isset($forprofil[$protectedPost['cat']]) and $protectedPost['cat'] != 'PAGE_PROFIL') {
                $name_field = array();
                $type_field = array();
                $tab_name = array();
                $value_field = array();
                foreach ($info_field as $if_name => $if_value) {
                    foreach ($if_value as $if_cat => $if_val) {
                        if ($protectedPost['cat'] == $if_cat) {
                            if (isset($forprofil[$if_cat][$if_name])) {
                                $protectedPost[$if_name] = $forprofil[$if_cat][$if_name];
                            }
                            array_push($name_field, $if_name);
                            array_push($tab_name, $if_val['LBL']);
                            if (is_array($if_val['VALUE'])) {
                                array_push($type_field, 2);
                                if (!isset($protectedPost[$if_name])) {
                                    array_push($if_val['VALUE'], '');
                                }
                                array_push($value_field, $if_val['VALUE']);
                            } else {
                                array_push($type_field, 0);
                                array_push($value_field, replace_language($forprofil[$if_cat][$if_name]));
                            }
                        }
                    }
                }
                $tab_typ_champ = show_field($name_field, $type_field, $value_field);
                tab_modif_values($tab_name, $tab_typ_champ, $tab_hidden, array('button_name' => 'modif_profil'));
            } elseif ($protectedPost['cat'] == 'PAGE_PROFIL') {
                $champs = "<table align=center><tr><td align=center>";
                $i = 0;
                ksort($forall['URL']);
                foreach ($forall['URL'] as $key => $value) {
                    $champs .= "<input type='checkbox' name='" . $key . "' id='" . $key . "' ";
                    if (isset($forprofil[$protectedPost['cat']][$key])) {
                        $champs .= " checked ";
                    }
                    $champs .= " ></td><td>" . $key . "</td><td align=center>";
                    $i++;
                    if ($i == 4) {
                        $champs .= "</td></tr><tr><td align=center>";
                        $i = 0;
                    }
                }
                $champs .= "</td></tr></table>";
                tab_modif_values($champs, array(), array(), array('button_name' => 'modif_profil'));
            }
        }
    }
}
开发者ID:remicollet,项目名称:OCSInventory-ocsreports,代码行数:95,代码来源:function_users.php

示例12: substr

            $msg .= $l->g(1178) . ': <i>' . substr($tab_name[0], 0, -2) . "</i> " . $l->g(363) . " <br>";
        }
        $i = 0;
        while ($name_field[$i]) {
            if (trim($protectedPost[$name_field[$i]]) == '') {
                //					$msg .= $l->g(1178).': <i>' . $tab_name[$i] . "</i> " . $l->g(1180) . " <br>";
                $msg .= $l->g(1178) . ': <i>' . substr($tab_name[$i], 0, -2) . "</i> " . $l->g(1180) . " <br>";
            }
            $i++;
        }
        if ($msg != '') {
            msg_error($msg);
        } else {
            msg_success($l->g(1276));
            create_profil($protectedPost['new_profil'], $protectedPost['lbl_profil'], $protectedPost['ref_profil']);
            if ($protectedGet['form']) {
                reloadform_closeme($protectedGet['form'], true);
            } else {
                msg_success($l->g(1274));
            }
        }
    }
    $value_field = array($protectedPost['new_profil'], $protectedPost['lbl_profil'], search_profil());
    $config['JAVASCRIPT'][0] = $sql_field;
    $tab_typ_champ = show_field($name_field, $type_field, $value_field, $config);
    $tab_typ_champ[0]['CONFIG']['SIZE'] = 20;
    $tab_typ_champ[1]['CONFIG']['SIZE'] = 20;
    tab_modif_values($tab_name, $tab_typ_champ, $tab_hidden, $title, $comment = "", $name_button = "modif", $showbutton);
}
echo "</div>";
echo close_form();
开发者ID:inkoss,项目名称:karoshi-server,代码行数:31,代码来源:ms_new_profil.php

示例13: fopen

        $platform = "windows";
        $filename = $_FILES['file_upload']['tmp_name'];
        $fd = fopen($filename, "r");
        $contents = fread($fd, filesize($filename));
        fclose($fd);
        $binary = $contents;
        $sql = "DELETE FROM deploy where name='%s'";
        $arg = $fname;
        mysql2_query_secure($sql, $_SESSION['OCS']["writeServer"], $arg);
        $sql = "INSERT INTO deploy values ('%s','%s')";
        $arg = array($fname, $binary);
        $result = mysql2_query_secure($sql, $_SESSION['OCS']["writeServer"], $arg);
        if (!$result) {
            msg_error($l->g(2003) . mysqli_errno($_SESSION['OCS']["writeServer"]) . "<br>" . mysqli_error($_SESSION['OCS']["writeServer"]));
        } else {
            msg_success($l->g(137) . " " . $_FILES['file_upload']['name'] . " " . $l->g(234));
            $tab_options['CACHE'] = 'RESET';
        }
    } else {
        msg_error($l->g(920));
    }
}
if (isset($protectedPost['SUP_PROF']) and $protectedPost['SUP_PROF'] != '') {
    $sql = "DELETE FROM deploy where name='%s'";
    $arg = $protectedPost['SUP_PROF'];
    mysql2_query_secure($sql, $_SESSION['OCS']["writeServer"], $arg);
}
if (!isset($protectedPost['ADD_FILE'])) {
    echo open_form($form_name);
    $list_fields = array($l->g(283) => 'function', $l->g(49) => 'name', 'SUP' => 'name');
    $list_col_cant_del = $list_fields;
开发者ID:stweil,项目名称:OCSInventory-ocsreports,代码行数:31,代码来源:ms_upload_file.php

示例14: fusionne

function fusionne($afus)
{
    global $l;
    $i = 0;
    $maxStamp = 0;
    $minStamp = mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"));
    //demain
    foreach ($afus as $a) {
        $d = $a["lastcome"];
        $a["stamp"] = mktime($d[11] . $d[12], $d[14] . $d[15], $d[17] . $d[18], $d[5] . $d[6], $d[8] . $d[9], $d[0] . $d[1] . $d[2] . $d[3]);
        //echo "stamp:".$a["stamp"]."== mktime($d[11]$d[12],$d[14]$d[15],$d[17]$d[18],$d[5]$d[6],$d[8]$d[9],$d[0]$d[1]$d[2]$d[3]);<br>";
        if ($maxStamp < $a["stamp"]) {
            $maxStamp = $a["stamp"];
            $maxInd = $i;
        }
        if ($minStamp > $a["stamp"]) {
            $minStamp = $a["stamp"];
            $minInd = $i;
        }
        $i++;
    }
    if ($afus[$minInd]["deviceid"] != "") {
        $okLock = true;
        foreach ($afus as $a) {
            if (!($okLock = $okLock && lock($a["id"]))) {
                break;
            } else {
                $locked[] = $a["id"];
            }
        }
        if ($okLock) {
            //TRACE_DELETED
            if (mysqli_num_rows(mysql2_query_secure("SELECT * FROM config WHERE IVALUE>0 AND NAME='TRACE_DELETED'", $_SESSION['OCS']["readServer"]))) {
                foreach ($afus as $a) {
                    if ($afus[$maxInd]["deviceid"] == $a["deviceid"]) {
                        continue;
                    }
                    $sql = "insert into deleted_equiv(DELETED,EQUIVALENT) values('%s','%s')";
                    $arg = array($a["deviceid"], $afus[$maxInd]["deviceid"]);
                    mysql2_query_secure($sql, $_SESSION['OCS']["writeServer"], $arg);
                }
            }
            //KEEP OLD QUALITY,FIDELITY AND CHECKSUM
            $sql = "SELECT CHECKSUM,QUALITY,FIDELITY FROM hardware WHERE ID='%s'";
            $persistent_req = mysql2_query_secure($sql, $_SESSION['OCS']["readServer"], $afus[$minInd]["id"]);
            $reqDelAccount = "DELETE FROM accountinfo WHERE hardware_id='%s'";
            mysql2_query_secure($reqDelAccount, $_SESSION['OCS']["writeServer"], $afus[$maxInd]["id"]);
            msg_success($l->g(190) . " " . $afus[$maxInd]["deviceid"] . " " . $l->g(191));
            $keep = array("accountinfo", "devices", "groups_cache");
            foreach ($keep as $tableToBeKept) {
                $reqRecupAccount = "UPDATE %s SET hardware_id='%s' WHERE hardware_id='%s'";
                $argRecupAccount = array($tableToBeKept, $afus[$maxInd]["id"], $afus[$minInd]["id"]);
                mysql2_query_secure($reqRecupAccount, $_SESSION['OCS']["writeServer"], $argRecupAccount);
            }
            msg_success($l->g(190) . " " . $afus[$minInd]["deviceid"] . " " . $l->g(206) . " " . $afus[$maxInd]["deviceid"]);
            $i = 0;
            foreach ($afus as $a) {
                if ($i != $maxInd) {
                    deleteDid($a["id"], false, false, false);
                    $lesDel .= $a["deviceid"] . "/";
                }
                $i++;
            }
            //RESTORE PERSISTENT VALUES
            $persistent_values = mysqli_fetch_row($persistent_req);
            $sql = "UPDATE hardware SET QUALITY=%s,FIDELITY=%s,CHECKSUM=CHECKSUM|%s WHERE id='%s'";
            $arg = array($persistent_values[1], $persistent_values[2], $persistent_values[0], $afus[$maxInd]["id"]);
            mysql2_query_secure($sql, $_SESSION['OCS']["writeServer"], $arg);
        } else {
            errlock();
        }
        foreach ($locked as $a) {
            unlock($a);
        }
    }
    $lesDel .= " => " . $afus[$maxInd]["deviceid"];
    AddLog("FUSION", $lesDel);
}
开发者ID:stweil,项目名称:OCSInventory-ocsreports,代码行数:78,代码来源:function_computers.php

示例15: mysql_query

        $result = mysql_query($sql_up_accesslvl) or die(mysql_error());
        while ($value = mysql_fetch_array($result)) {
            unset($new_lvl);
            if ($value['accesslvl'] == 1) {
                $new_lvl = 'sadmin';
            } elseif ($value['accesslvl'] == 2) {
                $new_lvl = 'ladmin';
            } elseif ($value['accesslvl'] == 3) {
                $new_lvl = 'admin';
            }
            if (isset($new_lvl)) {
                $sql = "UPDATE operators SET new_accesslvl='" . $new_lvl . "' where ID='" . $value['id'] . "'";
                mysql_query($sql);
            }
        }
        msg_success($l->g(2055));
    }
}
//$keepuser=1;
// Provided user not MySQL Administror
// Keep the account used for migration
//echo "toto";
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);
echo "<br><center><font color=green><b>" . $l->g(2056) . " (" . $l->g(2017) . " " . $name_connect . " " . $l->g(2007) . ")</b></font></center>";
开发者ID:inkoss,项目名称:karoshi-server,代码行数:31,代码来源:install.php


注:本文中的msg_success函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。