issue #49: set custom user agent so requests can be identified in access

logs
This commit is contained in:
Pepijn Over 2014-04-06 16:16:10 +02:00
parent e1dded258e
commit 3ee8b9406b
2 changed files with 6 additions and 5 deletions

View File

@ -2,22 +2,23 @@
## Changelog ## Changelog
### v2.2.0 (not yet released, 2014) ### v3.0.0 (released April 6, 2014)
* New module structure (not backwards compatible). * New module structure (not backwards compatible).
* Template directory restructured to correspond with module structure.
* Added user login system with 2 user levels (administrator and regular user). * Added user login system with 2 user levels (administrator and regular user).
* Added warning threshold option (set number of failed checks before server goes offline). * Added warning threshold option (set number of failed checks before server goes offline).
* Added SMTP support. * Added SMTP support.
* Adding Bulgarian language file (thanks to Plamen Vasilev). * Adding Bulgarian language file (thanks to Plamen Vasilev).
* Added user profile page.
* Added history tracking of server uptime. * Added history tracking of server uptime.
* Added history graphs of server uptime and latency (thanks to Jérôme Cabanis). * Added history graphs of server uptime and latency (thanks to Jérôme Cabanis).
* Added user profile page.
* Status page is now default homepage. * Status page is now default homepage.
* Updated French translation. * Updated translations.
* Date and time formats are taken from language file and localized per language (thanks to Jérôme Cabanis). * Date and time formats are taken from language file and localized per language (thanks to Jérôme Cabanis).
* When checking a website, the updater will now follow 302 Location headers. * When checking a website, the updater will now follow 302 Location headers.
* String/pattern search on websites did not work for websites with compression turned on. * String/pattern search on websites did not work for websites with compression turned on.
* The monitor now uses a custom user agent so it can be identified in access logs (Mozilla/5.0 (compatible; phpservermon/version; +http://www.phpservermonitor.org)).
* Template directory restructured to correspond with module structure.
* Switched from mysql_* to PDO. * Switched from mysql_* to PDO.
* Updated PHPMailer package to v5.2.6. * Updated PHPMailer package to v5.2.6.
* Fixed several XSS vulnerabilities. * Fixed several XSS vulnerabilities.

View File

@ -263,7 +263,7 @@ function psm_curl_get($href, $header = false, $body = true, $timeout = 10, $add_
curl_setopt($ch, CURLOPT_ENCODING, ''); curl_setopt($ch, CURLOPT_ENCODING, '');
curl_setopt($ch, CURLOPT_URL, $href); curl_setopt($ch, CURLOPT_URL, $href);
if($add_agent) { if($add_agent) {
curl_setopt ($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11'); curl_setopt ($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; phpservermon/'.PSM_VERSION.'; +http://www.phpservermonitor.org)');
} }
$result = curl_exec($ch); $result = curl_exec($ch);