diff --git a/admin/inc/class.admin_statistics.inc.php b/admin/inc/class.admin_statistics.inc.php index 11d8654115..edd3457559 100644 --- a/admin/inc/class.admin_statistics.inc.php +++ b/admin/inc/class.admin_statistics.inc.php @@ -5,7 +5,7 @@ * @link http://www.egroupware.org * @author Ralf Becker * @package admin - * @copyright (c) 2009 by Ralf Becker + * @copyright (c) 2009-11 by Ralf Becker * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @version $Id$ */ @@ -23,8 +23,8 @@ class admin_statistics const CONFIG_USAGE_TYPE = 'usage_type_submit'; const CONFIG_INSTALL_TYPE = 'install_type_submit'; - const SUBMIT_URL = 'http://www.egroupware-server.org/usage-statistic'; - const STATISTIC_URL = 'http://www.egroupware-server.org/usage-statistic'; + const SUBMIT_URL = 'https://www.egroupware.org/usage-statistic'; + const STATISTIC_URL = 'http://www.egroupware.org/usage-statistic'; const SUBMISION_RATE = 2592000; // 30 days @@ -52,7 +52,7 @@ class admin_statistics config::save_value(self::CONFIG_POSTPONE_SUBMIT,time()+$content['postpone'],self::CONFIG_APP); $what = 'postpone'; } - elseif($content['submit']) + elseif(!$content['canceled']) { config::save_value(self::CONFIG_LAST_SUBMIT,time(),self::CONFIG_APP); config::save_value(self::CONFIG_SUBMIT_ID,empty($content['submit_id']) ? '***none***' : $content['submit_id'],self::CONFIG_APP); @@ -128,18 +128,45 @@ class admin_statistics if (!isset($config[self::CONFIG_LAST_SUBMIT]) || $config[self::CONFIG_LAST_SUBMIT ] <= time()-self::SUBMISION_RATE) { // clear etemplate_exec_id and replace form.action, before submitting the form - $content['onclick'] = " -var action=this.form.action; -var exec_id=this.form['etemplate_exec_id'].value; -this.form.action='$content[submit_url]'; -this.form['etemplate_exec_id'].value=''; -this.form.target='_blank'; -if (!confirm('".addslashes(lang('Submit displayed information?'))."')) return false; -this.form.submit(); -this.form.action = action; -this.form['etemplate_exec_id'].value = exec_id; -this.form.target = ''; -return true;"; + $content['onclick'] = "return submit_statistic(this.form,'$content[submit_url]','".addslashes(lang('Submit displayed information?'))."');"; + + // Webkit browsers (Chrome, Safari, ...) do NOT allow to call form.submit() from within onclick of a submit button. + // Therefor we first store our own form action, replace it with egroupware.org submit url and set a timeout calling + // submit_statistic again with just the form, to do the second submit to our own webserver + $GLOBALS['egw_info']['flags']['java_script'] = " +"; } else // we are not due --> tell it the user {