function cp_logout() { parse_str($_COOKIE[CP_COOKIE_NAME], $cookie_data); $filename = DIR_CP_SESSION . '/' . file_sanitize($cookie_data[CP_SESSION_FIELD]); file_delete($filename); setcookie(CP_COOKIE_NAME, false, time() - CP_SESSION_DURATION, CP_COOKIE_PATH, CP_COOKIE_DOMAIN); }
function get_trade_languages($trade, $log = 'in') { $dir = get_trade_stats_dir($trade); $trade = file_sanitize($trade); return get_trade_log_stats("{$dir}/{$trade}-{$log}", 7); }
<?php require_once 'geoip-utility.php'; // Load stats from the log file list($total, $countries) = get_trade_countries($domain, file_sanitize(strtolower($stat))); // Default to 0 for all un-represented countries foreach ($geoip_country_codes as $i => $cc) { if (!isset($countries[$i])) { $countries[$i] = 0; } } ?> <map map_file="world.swf" zoom="95%" zoom_x="20.35%" zoom_y="1.95%"> <areas> <area title="borders" mc_name="borders" color="#ffffff" balloon="false"></area> <?php foreach ($geoip_country_codes as $i => $cc) { ?> <area title="<?php echo $geoip_country_names[$i]; ?> " mc_name="<?php echo $cc; ?> "<?php if (!$countries[$i]) { ?> color="#afafaf"<?php } ?> value="<?php
function _xBlacklistSave() { $v =& Validator::Get(); $v->Register(FILE_BLACKLIST_DNS, VT_FILE_IS_WRITEABLE, 'The ' . FILE_BLACKLIST_DNS . ' file has incorrect permissions; change them to 666'); $v->Register(FILE_BLACKLIST_DOMAIN, VT_FILE_IS_WRITEABLE, 'The ' . FILE_BLACKLIST_DOMAIN . ' file has incorrect permissions; change them to 666'); $v->Register(FILE_BLACKLIST_EMAIL, VT_FILE_IS_WRITEABLE, 'The ' . FILE_BLACKLIST_EMAIL . ' file has incorrect permissions; change them to 666'); $v->Register(FILE_BLACKLIST_SERVER_IP, VT_FILE_IS_WRITEABLE, 'The ' . FILE_BLACKLIST_SERVER_IP . ' file has incorrect permissions; change them to 666'); $v->Register(FILE_BLACKLIST_USER_IP, VT_FILE_IS_WRITEABLE, 'The ' . FILE_BLACKLIST_USER_IP . ' file has incorrect permissions; change them to 666'); $v->Register(FILE_BLACKLIST_CONTENT, VT_FILE_IS_WRITEABLE, 'The ' . FILE_BLACKLIST_CONTENT . ' file has incorrect permissions; change them to 666'); $v->Register(FILE_BLACKLIST_HEADER, VT_FILE_IS_WRITEABLE, 'The ' . FILE_BLACKLIST_HEADER . ' file has incorrect permissions; change them to 666'); if (!$v->Validate()) { return JSON::Warning(array(JSON_KEY_MESSAGE => 'Blacklist could not be updated; please fix the following items', JSON_KEY_WARNINGS => $v->GetErrors())); } foreach ($_REQUEST['bl'] as $file => $items) { $file = DIR_BLACKLIST . '/' . file_sanitize($file); file_write($file, string_remove_blank_lines($items) . STRING_LF_UNIX); } JSON::Success(array(JSON_KEY_MESSAGE => 'Blacklist has been successfully updated', JSON_KEY_DIALOG => _xIncludeCapture('blacklist.php'))); }