php * \author Rob Schalken, Core|Vision * \version 1.0 * \date 17-10-2008 * */ require_once("utilities.php"); // Store cookie if (isset($_POST['write_cookie'])) { $value = explode(",", $_POST['write_cookie']); WriteCookie($value[0], $value[1]); } // Store geocode if (isset($_POST['store_geocode'])) { require_once("db.php"); db_store_cust_location((int)$_POST['customer_id'], floatval($_POST['lon']), floatval($_POST['lat'])); } // Set cancel flag (status/selftest/ect) if (isset($_POST['cancel_status'])) { require_once("session.php"); // Extra login check if (db_ver_right_user($_SESSION[$_PAGE_INFO['id']]['login']['user']['id'], "login")) { $_SESSION[$_PAGE_INFO['id']]['sts']['cancel'] = 1; } else { // Display logout message $_SESSION[$_PAGE_INFO['id']]['login_info']['errormsg'] = _("No valid rights"); // Redirect page back to login page echo "\n"; } } // Store debug info if (isset($_POST['store_debug'])) { require_once("session.php"); // Extra login check if (db_ver_right_user($_SESSION[$_PAGE_INFO['id']]['login']['user']['id'], "login")) { DBG("JAVA DBG: " . $_POST['store_debug']); } else { // Display logout message $_SESSION[$_PAGE_INFO['id']]['login_info']['errormsg'] = _("No valid rights"); // Redirect page back to login page echo "\n"; } } // Send email if (isset($_POST['newsletter'])) { require_once("session.php"); // Extra login check, excecption is the newsletter if ((!$_SESSION[$_PAGE_INFO['id']]['logged_on']) || (db_ver_right_user($_SESSION[$_PAGE_INFO['id']]['login']['user']['id'], "login"))) { require_once("mail.php"); // Valid email? if ((isset($_POST['email'])) && (valid_email($_POST['email'], FALSE))) { // Define subject which also contains the new mail adres $subject = "Aanmelding nieuwsbrief (language: " . $_SESSION[$_PAGE_INFO['id']]['i18n'] . ", user: " . ((db_ver_right_user($_SESSION[$_PAGE_INFO['id']]['login']['user']['id'], "login")) ? getUser($_SESSION[$_PAGE_INFO['id']]['login']['user']['id']) : "-") . "): " . $_POST['email']; // Retrieve ini file skin $ini_file = get_all_files("../" . SKIN_DIR . $_SESSION[$_PAGE_INFO['id']]['skin'] . "/", array("ini")); $_PAGE_INFO['ini'] = parse_ini_file($ini_file[0], true); // Default block name $to = ""; $block = $_PAGE_INFO['ini']["footer" . $_POST['footerblock']]; // Check for i18n block name if (isset($_PAGE_INFO['ini']["footer" . $_POST['footerblock'] . "_" . $_SESSION[$_PAGE_INFO['id']]['i18n']])) { $block = $_PAGE_INFO['ini']["footer" . $_POST['footerblock'] . "_" . $_SESSION[$_PAGE_INFO['id']]['i18n']]; } if (isset($block)) { $found = TRUE; $count = 0; do { // Check if line exists $found = (isset($block["line" . $count])) ? $found : FALSE; // Check if line exists if ($found) { // Search for extra actions (hyperlinks/images/etc.)? $footer_value = explode(";", $block["line" . $count]); if (isset($footer_value[1])) { switch(trim(strtolower($footer_value[1]))) { case "newsletter": $to = $footer_value[2]; break; default: break; } } // Increment line counter $count++; } } while ($found); } if (strlen($to)) { // Send email send_mail($to, "", "", $_PAGE_INFO['ini']['report']['no-reply'], $subject, ""); } } } } // "Clear" reload parameter if (isset($_REQUEST['clear_reload'])) { require_once("session.php"); // Set to -1 because $_SESSION[$_PAGE_INFO['id']]['href_history'] is the same as the current href => Increment recall counter $_SESSION[$_PAGE_INFO['id']]['recall_counter'] = -1; } // SMS server telephone updater if (isset($_REQUEST['update_phonenr'])) { // SMS server with required params? if (is_dev("SMSSERVER")) { // Valid parameters if ((isset($_REQUEST['imei'])) && (isset($_REQUEST['sim'])) && (isset($_REQUEST['imsi'])) && (isset($_REQUEST['phonenr']))) { // Get original data equipment $equip = db_fetch_imei($_REQUEST['imei']); // Does this device exist? if (is_array($equip)) { // Extra verification on sim and imsi if (!strcmp($equip[0]['imsi'],$_REQUEST['imsi']) && !strcmp($equip[0]['sim'], $_REQUEST['sim'])) { // Valid phone number? if (valid_fax_tel($_REQUEST['phonenr'], FALSE)) { // phone number changed? if (strcmp($equip[0]['telefoonnr'], $_REQUEST['phonenr'])) { // Store new phone number $equip[0]['telefoonnr'] = $_REQUEST['phonenr']; // Update device if( !db_update_lance($equip[0]) ) { DBG("PHONE UPDATE: " . $equip[0]['idcode'] . " FAILED to set to " . $_REQUEST['phonenr'] . ": database error"); } else { // Debug info DBG("PHONE UPDATE: " . $equip[0]['idcode'] . " SUCCESS: updated to " . $_REQUEST['phonenr']); } } else { // Debug info DBG("PHONE UPDATE: " . $equip[0]['idcode'] . " SKIPPED: already set to " . $_REQUEST['phonenr']); } } else { // Debug info DBG("PHONE UPDATE: " . $equip[0]['idcode'] . "FAILED: invalid phone number (" . $_REQUEST['phonenr'] . ")"); } } else { // Debug info DBG("PHONE UPDATE: " . $equip[0]['idcode'] . ": FAILED to set to " . $_REQUEST['phonenr'] . ": imsi or sim does not match"); } } else { // Debug info DBG("PHONE UPDATE: imei " . $_REQUEST['imei'] . ": no such device"); } } else { // Debug info DBG("PHONE UPDATE: No valid parameters"); } } else { // Debug info DBG("PHONE UPDATE: No valid sms server"); } } ?>