<?php /* * Created on 26 mai 2009 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ require_once 'require/function_files.php'; $Directory = PLUGINS_DIR . 'language/'; $ms_cfg_file = $Directory . "/lang_config.txt"; //show only true sections if (file_exists($ms_cfg_file)) { $search = array('ORDER' => 'MULTI2', 'LBL' => 'MULTI'); $language_data = read_configuration($ms_cfg_file, $search); $list_plugins = $language_data['ORDER']; $list_lbl = $language_data['LBL']; } $i = 0; while (isset($list_plugins[$i])) { if (file_exists($Directory . $list_plugins[$i] . "/" . $list_plugins[$i] . ".png")) { $show_lang .= "<img src='plugins/language/" . $list_plugins[$i] . "/" . $list_plugins[$i] . ".png' width=\"20\" height=\"15\" OnClick='pag(\"" . $list_plugins[$i] . "\",\"LANG\",\"ACTION_CLIC\");'> "; } else { $show_lang .= "<a href=# OnClick='pag(\"" . $list_plugins[$i] . "\",\"LANG\",\"ACTION_CLIC\");'>" . $list_lbl[$list_plugins[$i]] . "</a> "; } $i++; } echo $show_lang;
// select the main database mysql_select_db($db_ocs, $link_ocs); // Execute the query to insert/update the user record mysql2_query_secure($reqInsert, $link_ocs, $arg_insert); // repeat the query and define the needed OCS variables // note: original OCS code below connexion_local_read(); // select the main database mysql_select_db($db_ocs, $link_ocs); $resOp = mysql2_query_secure($reqOp, $link_ocs, $argOp); $rowOp = mysql_fetch_object($resOp); if (isset($rowOp->accesslvl)) { $lvluser = $rowOp->accesslvl; $ms_cfg_file = $_SESSION['OCS']['CONF_PROFILS_DIR'] . $lvluser . "_config.txt"; $search = array('RESTRICTION' => 'MULTI'); $res = read_configuration($ms_cfg_file, $search); $restriction = $res['RESTRICTION']['GUI']; //if this user has RESTRICTION //search all tag for this user if ($restriction == 'YES') { $sql = "select tag from tags where login='******'"; $arg = array($_SESSION['OCS']["loggeduser"]); $res = mysql2_query_secure($sql, $link_ocs, $arg); while ($row = mysql_fetch_object($res)) { $list_tag[$row->tag] = $row->tag; } if (!isset($list_tag)) { $ERROR = $l->g(893); } } elseif ($restriction != 'NO') { $ERROR = $restriction;
$first_tab = bandeau($info, $lbl_affich); unset($item['data']['snmp']); $second_tab = bandeau($item['data'], $lbl_affich, $item['lbl'], 'mvt_bordure'); if ($first_tab) { echo $first_tab; } if ($second_tab) { echo $second_tab; } //get plugins when exist $Directory = PLUGINS_DIR . "snmp_detail/"; $ms_cfg_file = $Directory . "snmp_config.txt"; if (!isset($_SESSION['OCS']['DETAIL_SNMP'])) { if (file_exists($ms_cfg_file)) { $search = array('ORDER' => 'MULTI2', 'LBL' => 'MULTI', 'ISAVAIL' => 'MULTI'); $plugins_data = read_configuration($ms_cfg_file, $search); $_SESSION['OCS']['DETAIL_SNMP']['LIST_PLUGINS'] = $plugins_data['ORDER']; $_SESSION['OCS']['DETAIL_SNMP']['LIST_LBL'] = $plugins_data['LBL']; $_SESSION['OCS']['DETAIL_SNMP']['LIST_AVAIL'] = $plugins_data['ISAVAIL']; } } $list_plugins = $_SESSION['OCS']['DETAIL_SNMP']['LIST_PLUGINS']; $list_lbl = $_SESSION['OCS']['DETAIL_SNMP']['LIST_LBL']; $list_avail = $_SESSION['OCS']['DETAIL_SNMP']['LIST_AVAIL']; foreach ($list_avail as $key => $value) { $sql = "select count(*) c from %s where SNMP_ID=%s"; $arg = array($value, $systemid); $result = mysql2_query_secure($sql, $_SESSION['OCS']["readServer"], $arg); $valavail = mysqli_fetch_array($result); if ($valavail['c'] == 0) { unset($list_lbl[$key]);
function safeterms_update() { // First getting the configuration $safeterms_control["API_KEY"] = read_configuration("SAFETERMS_APIKEY"); $safeterms_control["API_LASTVALID_RESULT"] = read_configuration("SAFETERMS_APIKEY_LASTVALIDRESULT"); $safeterms_control["API_LASTVALID_TIME"] = read_configuration("SAFETERMS_APIKEY_LASTVALIDTIME"); $safeterms_control["API_VERSION"] = read_configuration("SAFETERMS_RECHTSTEXT_VERSION"); $safeterms_control["LANGS"] = read_mconfiguration("SAFETERMS_LANGUAGE_"); // NOW WE RUN THROUGHT ALL PROVIDED LANGUAGES foreach ($safeterms_control["LANGS"] as $language_code => $language_id) { $update_error = 0; $update_log = "<p>" . date("d.m.Y - H:i:s") . " Starte Update...</p>\n"; // AGB // Create The Request $request = array(); $request["TYPE"] = "get_agb"; $request["APIKEY"] = $safeterms_control["API_KEY"]; $request["LANG"] = $language_code; // SEND REQUEST & GETTING RESPONSE $response = talkto($request); if ($response["STATUS"] == "SUCCESS" && $response["VALID"] == "TRUE") { // The Response was Fine ... Import it; $agb = str_replace("'", "\\'", $response["CONTENT"]); $module_query = xtc_db_query("UPDATE content_manager SET content_text='" . $agb . "' WHERE content_group='3' AND languages_id='" . $language_id . "'"); $update_log .= "<p>" . date("d.m.Y - H:i:s") . " Update AGB [ERFOLGREICH]</p>\n"; } else { $update_error = 1; $update_log .= "<p>" . date("d.m.Y - H:i:s") . " Update AGB [FEHLGESCHLAGEN]</p>\n"; } // IMPRESSUM // Create The Request $request = array(); $request["TYPE"] = "get_impressum"; $request["APIKEY"] = $safeterms_control["API_KEY"]; $request["LANG"] = $language_code; // SEND REQUEST & GETTING RESPONSE $response = talkto($request); if ($response["STATUS"] == "SUCCESS" && $response["VALID"] == "TRUE") { // The Response was Fine ... Import it; $impressum = str_replace("'", "\\'", $response["CONTENT"]); $module_query = xtc_db_query("UPDATE " . TABLE_CONTENT_MANAGER . " SET content_text='" . $impressum . "' WHERE content_group='4' AND languages_id='" . $language_id . "'"); $update_log .= "<p>" . date("d.m.Y - H:i:s") . " Update IMPRESSUM [ERFOLGREICH]</p>\n"; } else { $update_error = 1; $update_log .= "<p>" . date("d.m.Y - H:i:s") . " Update IMPRESSUM [FEHLGESCHLAGEN]</p>\n"; } // Datenschutz // Create The Request $request = array(); $request["TYPE"] = "get_datenschutz"; $request["APIKEY"] = $safeterms_control["API_KEY"]; $request["LANG"] = $language_code; // SEND REQUEST & GETTING RESPONSE $response = talkto($request); if ($response["STATUS"] == "SUCCESS" && $response["VALID"] == "TRUE") { // The Response was Fine ... Import it; $datenschutz = str_replace("'", "\\'", $response["CONTENT"]); $module_query = xtc_db_query("UPDATE " . TABLE_CONTENT_MANAGER . " SET content_text='" . $datenschutz . "' WHERE content_group='2' AND languages_id='" . $language_id . "'"); $update_log .= "<p>" . date("d.m.Y - H:i:s") . " Update DATENSCHUTZ [ERFOLGREICH]</p>\n"; } else { $update_error = 1; $update_log .= "<p>" . date("d.m.Y - H:i:s") . " Update DATENSCHUTZ [FEHLGESCHLAGEN]</p>\n"; } // Widerrufsrecht // Create The Request $request = array(); $request["TYPE"] = "get_widerruf"; $request["APIKEY"] = $safeterms_control["API_KEY"]; $request["LANG"] = $language_code; // SEND REQUEST & GETTING RESPONSE $response = talkto($request); if ($response["STATUS"] == "SUCCESS" && $response["VALID"] == "TRUE") { // The Response was Fine ... Import it; $widerruf = str_replace("'", "\\'", $response["CONTENT"]); $module_query = xtc_db_query("UPDATE " . TABLE_CONTENT_MANAGER . " SET content_text='" . $widerruf . "' WHERE content_group='9' AND languages_id='" . $language_id . "'"); $update_log .= "<p>" . date("d.m.Y - H:i:s") . " Update WIDERRUFSBELEHRUNG [ERFOLGREICH]</p>\n"; } else { $update_error = 1; $update_log .= "<p>" . date("d.m.Y - H:i:s") . " Update WIDERRUFSBELEHRUNG [FEHLGESCHLAGEN]</p>\n"; } // Batterieverordnung // Create The Request $request = array(); $request["TYPE"] = "get_batterie"; $request["APIKEY"] = $safeterms_control["API_KEY"]; $request["LANG"] = $language_code; // SEND REQUEST & GETTING RESPONSE $response = talkto($request); if ($response["STATUS"] == "SUCCESS" && $response["VALID"] == "TRUE") { // Prüfen ob eine Batterieverordnung bereits existiert $batterie = str_replace("'", "\\'", $response["CONTENT"]); $module_query = xtc_db_query("SELECT content_id as batid FROM " . TABLE_CONTENT_MANAGER . " WHERE content_group='999' AND languages_id='" . $language_id . "'"); if (xtc_db_num_rows($module_query) < 1) { // INSERT $module_query = xtc_db_query("INSERT INTO " . TABLE_CONTENT_MANAGER . " VALUES ('','0','0','','" . $language_id . "','Hinweis Batterieverordnung','Hinweis Batterieverordnung','" . $batterie . "','0','1','','1','999','0','','','')"); } else { // UPDATE $batid = xtc_db_fetch_array($module_query); $module_query = xtc_db_query("UPDATE " . TABLE_CONTENT_MANAGER . " SET content_text='" . $batterie . "' WHERE content_id='" . $batid["batid"] . "' LIMIT 1"); } $update_log .= "<p>" . date("d.m.Y - H:i:s") . " Update BATTERIEVERORDNUNG [ERFOLGREICH]</p>\n"; } else { $update_error = 1; $update_log .= "<p>" . date("d.m.Y - H:i:s") . " Update BATTERIEVERORDNUNG [FEHLGESCHLAGEN]</p>\n"; } } // Version anpassen wenn kein Fehler aufgetreten ist $request["TYPE"] = "get_version"; $request["APIKEY"] = $safeterms_control["API_KEY"]; // SEND REQUEST & GETTING RESPONSE $response = talkto($request); if ($response["STATUS"] == "SUCCESS" && $response["VALID"] == "TRUE") { set_module_configuration("SAFETERMS_RECHTSTEXT_VERSION", $response["CONTENT"]); } return array($update_error, $update_log); }
function read_files($search, $ms_cfg_file, $writable = '') { global $l; if (!is_writable($ms_cfg_file) and $writable != '') { msg_error($ms_cfg_file . " " . $l->g(1006) . ". " . $l->g(1147)); return FALSE; } if (file_exists($ms_cfg_file)) { $profil_data = read_configuration($ms_cfg_file, $search); return $profil_data; } else { return FALSE; } }
$Id: overview.php The Overview GUI for the installed Module XT-Commerce - community made shopping http://www.xt-commerce.com Copyright (c) 2003 XT-Commerce -------------------------------------------------------------- based on: (c) 2000-2001 The Exchange Project (earlier name of osCommerce) (c) 2002-2003 osCommercecoding standards (a typical file) www.oscommerce.com Released under the GNU General Public License --------------------------------------------------------------*/ $safeterms_control["VERSION"] = read_configuration("SAFETERMS_RECHTSTEXT_VERSION"); // GETTING THE SERVER-SIDE VERSION OF TEXTES if ($safeterms_control["API_LASTVALID_RESULT"] == "TRUE") { $request = array(); $request["TYPE"] = "get_version"; $request["APIKEY"] = $safeterms_control["API_KEY"]; // SEND REQUEST & GETTING RESPONSE $response = talkto($request); // IF Request SUCCESS if ($response["STATUS"] == "SUCCESS" && $response["VALID"] == "TRUE") { $safeterms_control["SERVER_VERSION"] = $response["CONTENT"]; } $shop_status = '<p style="text-align: center; margin-top:20px;">Letzter Stand der Rechtstexte im Online Shop:</p>'; if ($safeterms_control["VERSION"] == 0) { $shop_status .= '<p style="text-align: center; margin:10px; font-size:20px; line-height:30px; background-color:ff0000;">bisher NOCH NIE</p>'; $shop_update = '<p style="text-align: justify; margin:10px; margin-top:20px;">Es wird empfohlen jetzt ein Update durchzuführen. Dazu klicken Sie einfach auf den Button "Update Starten".</p>';
$sql="select count(*) from hardware h right join %s a on a.hardware_id=h.ID WHERE h.id is null "; $arg=$table_name; $res_column=mysql2_query_secure($sql,$_SESSION['OCS']["readServer"],$arg); $item_column = mysql_fetch_row($res_column); if ($item_column[0]>0) echo $table_name."<br>"; }*/ /*****************************************************GESTION DU NOM DES PAGES****************************************/ //Config for all user if (!isset($_SESSION['OCS']['URL'])) { require_once 'require/function_files.php'; $ms_cfg_file = $_SESSION['OCS']['CONF_PROFILS_DIR'] . "4all_config.txt"; //show only true sections if (file_exists($ms_cfg_file)) { $search = array('URL' => 'MULTI'); $profil_data = read_configuration($ms_cfg_file, $search); $pages_refs = $profil_data['URL']; $_SESSION['OCS']['URL'] = $pages_refs; } else { die("ERROR: CAN'T READ CONFIG FILE " . $_SESSION['OCS']['CONF_PROFILS_DIR'] . "4all_config.txt"); } } else { $pages_refs = $_SESSION['OCS']['URL']; } /**********************************************************GESTION DES COLONNES DES TABLEAUX PAR COOKIES***********************************/ require_once 'require/function_cookies.php'; //Delete all cookies if GUI_VER change if (!isset($_COOKIE["VERS"]) or $_COOKIE["VERS"] != GUI_VER) { if (isset($_COOKIE)) { foreach ($_COOKIE as $key => $val) { cookies_reset($key);