/** * Log statistics on navigation (resolution, plugins, etc.) */ protected function processNavigationStats() { $id_guest = (int) Tools::getValue('id_guest'); if (sha1($id_guest . _COOKIE_KEY_) != $this->param_token) { die; } $guest = new Guest((int) substr($_POST['id_guest'], 0, 10)); $guest->javascript = true; $guest->screen_resolution_x = (int) substr($_POST['screen_resolution_x'], 0, 5); $guest->screen_resolution_y = (int) substr($_POST['screen_resolution_y'], 0, 5); $guest->screen_color = (int) substr($_POST['screen_color'], 0, 3); $guest->sun_java = (int) substr($_POST['sun_java'], 0, 1); $guest->adobe_flash = (int) substr($_POST['adobe_flash'], 0, 1); $guest->adobe_director = (int) substr($_POST['adobe_director'], 0, 1); $guest->apple_quicktime = (int) substr($_POST['apple_quicktime'], 0, 1); $guest->real_player = (int) substr($_POST['real_player'], 0, 1); $guest->windows_media = (int) substr($_POST['windows_media'], 0, 1); $guest->update(); }
if (isset($_GET['id'])) { $id = $_GET['id']; $originalOption->Id = $id; $originalOption->selectById(); } if (isset($_POST['update'])) { $updatedOption = new Guest($db); $updatedOption->Id = $_POST['id']; $updatedOption->FirstName = $_POST['firstname']; $updatedOption->LastName = $_POST['lastname']; $updatedOption->Gender = $_POST['gender']; $updatedOption->Email = $_POST['email']; $updatedOption->Address = $_POST['address']; $updatedOption->Suburb_Id = $_POST['suburb']; $updatedOption->Rating = $_POST['rating']; if ($updatedOption->update() == true) { header("location:guests.php"); } else { echo "<script>alert('There was an error updating this item');window.location = 'guests.php' </script>"; } } if (isset($_POST['delete'])) { $updatedOption = new Guest($db); $updatedOption->Id = $_POST['id']; if ($updatedOption->delete() == true) { header("location:guests.php"); } else { echo "<script>alert('There was an error deleting this item');window.location = 'guests.php' </script>"; } } ?>
/** * Checks if mobile context is possible * * @return bool * @throws PrestaShopException */ protected function checkMobileContext() { // Check mobile context if (Tools::isSubmit('no_mobile_theme')) { Context::getContext()->cookie->no_mobile = true; if (Context::getContext()->cookie->id_guest) { $guest = new Guest(Context::getContext()->cookie->id_guest); $guest->mobile_theme = false; $guest->update(); } } elseif (Tools::isSubmit('mobile_theme_ok')) { Context::getContext()->cookie->no_mobile = false; if (Context::getContext()->cookie->id_guest) { $guest = new Guest(Context::getContext()->cookie->id_guest); $guest->mobile_theme = true; $guest->update(); } } return isset($_SERVER['HTTP_USER_AGENT']) && isset(Context::getContext()->cookie) && (bool) Configuration::get('PS_ALLOW_MOBILE_DEVICE') && @filemtime(_PS_THEME_MOBILE_DIR_) && !Context::getContext()->cookie->no_mobile; }
* International Registered Trademark & Property of PrestaShop SA */ if (!isset($_POST['token']) or !isset($_POST['type'])) { die; } include dirname(__FILE__) . '/config/config.inc.php'; if ($_POST['type'] == 'navinfo') { if (sha1($_POST['id_guest'] . _COOKIE_KEY_) != $_POST['token']) { die; } $guest = new Guest((int) $_POST['id_guest']); $guest->javascript = true; $guest->screen_resolution_x = (int) $_POST['screen_resolution_x']; $guest->screen_resolution_y = (int) $_POST['screen_resolution_y']; $guest->screen_color = (int) $_POST['screen_color']; $guest->sun_java = (int) $_POST['sun_java']; $guest->adobe_flash = (int) $_POST['adobe_flash']; $guest->adobe_director = (int) $_POST['adobe_director']; $guest->apple_quicktime = (int) $_POST['apple_quicktime']; $guest->real_player = (int) $_POST['real_player']; $guest->windows_media = (int) $_POST['windows_media']; $guest->update(); } elseif ($_POST['type'] == 'pagetime') { if (sha1($_POST['id_connections'] . $_POST['id_page'] . $_POST['time_start'] . _COOKIE_KEY_) != $_POST['token']) { die; } if (!Validate::isInt($_POST['time']) or $_POST['time'] <= 0) { die; } Connection::setPageTime((int) $_POST['id_connections'], (int) $_POST['id_page'], substr($_POST['time_start'], 0, 19), intval($_POST['time'])); }