From e601f848718b576d4f2aabfb8e14e4b9ca35e5a0 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 12 Jun 2010 12:41:54 +0200 Subject: add support for client update warnings Signed-off-by: Florian Pritz --- system/application/controllers/file.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'system/application/controllers') diff --git a/system/application/controllers/file.php b/system/application/controllers/file.php index 09dcace68..d772a3478 100644 --- a/system/application/controllers/file.php +++ b/system/application/controllers/file.php @@ -15,6 +15,19 @@ class File extends Controller { parent::Controller(); $this->load->helper('form'); $this->load->model('file_mod'); + $this->var->cli_client = false; + $this->file_mod->var->cli_client =& $this->var->cli_client; + + if (strpos($_SERVER['HTTP_USER_AGENT'], 'fb-client') !== false) { + $latest_client = trim(file_get_contents(FCPATH.'data/client/latest')); + $client_version = substr($_SERVER['HTTP_USER_AGENT'], 10); + if ($latest_client != $client_version) { + echo "Your are using an old client version. Latest is $latest_client.\n"; + } + $this->var->cli_client = "fb-client"; + } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'libcurl') !== false) { + $this->var->cli_client = "curl"; + } } function index() -- cgit v1.2.3-24-g4f1b