[eGroupWare-svn] r56147 - in /trunk/usage: inc/class.usage_bo.inc.php sitemgr/class.module_usage.inc.php

[email protected] Thu, 04 Aug 2016 08:00:14 -0000
Newsgroups gmane.comp.web.egroupware.cvs
Message-ID <[email protected]>
Author: ralfbecker
Date: Thu Aug  4 10:00:14 2016
New Revision: 56147

URL: http://svn.stylite.de/viewvc/egroupware?rev=56147&view=rev
Log:
changes for 16.1

Modified:
    trunk/usage/inc/class.usage_bo.inc.php
    trunk/usage/sitemgr/class.module_usage.inc.php

Modified: trunk/usage/inc/class.usage_bo.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/usage/inc/class.usage_bo.inc.php?rev=56147&r1=56146&r2=56147&view=diff
==============================================================================
--- trunk/usage/inc/class.usage_bo.inc.php (original)
+++ trunk/usage/inc/class.usage_bo.inc.php Thu Aug  4 10:00:14 2016
@@ -55,7 +55,7 @@
 	 */
 	public function receive()
 	{
-		$submitted = $_POST['exec'];
+		$submitted = isset($_POST['exec']) ? $_POST['exec'] : $_POST;
 		unset($submitted['postpone']);
 		unset($submitted['submit']);
 
@@ -107,8 +107,31 @@
 	 */
 	public function acknowledge()
 	{
-		return '<p>'.lang('Thank you for contributing to EGroupware usage statistic.')."</p>\n".
+		$html = '<p><b>'.lang('Thank you for contributing to EGroupware usage statistic.')."</b></p>\n".
 			'<p>'.lang('Your submission is number %1.',$this->data['usage_id'])."</p>\n";
+
+		// check if user is eligible to free groups app
+		if ($this->data['usage_submit_id'] && substr($this->data['usage_version'], 0, 3) != 'EPL' &&
+			($data = $this->db->query('SELECT * FROM community_user WHERE user='.
+				$this->db->quote($this->data['usage_submit_id']), __LINE__, __FILE__)->fetch()))
+		{
+			$html .= '<pre>'.lang('As (former) user of EGroupware 1.8 community edition your are eligible to use our free group adminstration app.')."\n\n";
+			$html .= lang('To do so, you need to follow %1this instructions%2 and note following credentials',
+				'<a href="https://github.com/EGroupware/egroupware/wiki/Group-administration-for-long-time-CE-users" target="_blank">', '</a>')."\n".
+				'<ul><li>'.lang('Username').': '.htmlspecialchars($data['user'])."</li>".
+				'<li>'.lang('Password').': '.htmlspecialchars($data['passwd'])."</li></ul>";
+			$html .= "</pre>\n";
+
+			// check and if not add user to downlaod server user list
+			if (!$this->db->query('SELECT COUNT(*) FROM download_users WHERE user='.
+				$this->db->quote($data['user']), __LINE__, __FILE__)->fetchColumn())
+			{
+				$this->db->query('INSERT INTO download_users (user,passwd,expire,group_name) VALUES ('.
+					$this->db->quote($data['user']).',ENCRYPT('.
+						$this->db->quote($data['passwd'])."),NULL,'community')", __LINE__, __FILE__);
+			}
+		}
+		return $html;
 	}
 
 	/**
@@ -165,6 +188,7 @@
 		$sel_options['usage_install_type'] = array(
 			'archive' => lang('Archive: zip or tar'),
 			'package' => lang('RPM or Debian package'),
+			'git'     => lang('Git clone'),
 			'svn'     => lang('Subversion checkout'),
 			'other'   => lang('Other'),
 		);

Modified: trunk/usage/sitemgr/class.module_usage.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/usage/sitemgr/class.module_usage.inc.php?rev=56147&r1=56146&r2=56147&view=diff
==============================================================================
--- trunk/usage/sitemgr/class.module_usage.inc.php (original)
+++ trunk/usage/sitemgr/class.module_usage.inc.php Thu Aug  4 10:00:14 2016
@@ -41,7 +41,7 @@
 		try
 		{
 			$usage = new usage_bo();
-			if (isset($_POST['exec']))
+			if (isset($_POST['exec']) || isset($_POST['usage_type']))
 			{
 				$content = $usage->receive();
 			}


------------------------------------------------------------------------------