diff options
author | Florian Pritz <bluewind@xinu.at> | 2012-04-09 00:27:17 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2012-04-09 20:48:04 +0200 |
commit | 40970e2cb0480cd0016a0a4f88b69d33b9c95c22 (patch) | |
tree | deeb775f5fbf6cb4b6709fbb55605cce4d66740f /application/models/file_mod.php | |
parent | ccf2d88f9e17bc2884d31cee9ce4ae2ab563b8c1 (diff) |
muser: fix handling of cli clients without account
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/models/file_mod.php')
-rw-r--r-- | application/models/file_mod.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/application/models/file_mod.php b/application/models/file_mod.php index 2b4142890..f804ede9b 100644 --- a/application/models/file_mod.php +++ b/application/models/file_mod.php @@ -175,6 +175,18 @@ class File_mod extends CI_Model { return true; } + function is_cli_client() + { + // official client uses "fb-client/$version" as useragent + $clients = array("fb-client", "libcurl", "pyfb"); + foreach ($clients as $client) { + if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], $client) !== false) { + return true; + } + } + return false; + } + // download a given ID // TODO: make smaller function download() |