Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Usage reporting management

  • Loading branch information...
commit 728867ff520ff9fd40e5dedbb6e3a46ea2feda21 1 parent ef067f3
@ginatrapani ginatrapani authored
View
44 docs/source/core.rst
@@ -0,0 +1,44 @@
+Core Development Team
+======================
+
+ThinkUp development is funded by Expert Labs, a non-profit startup that helps government be more effective by tapping
+in to the power of social networks.
+
+Expert Labs
+-----------
+
+**Gina Trapani** started building ThinkUp in the summer of 2009 as a personal weekend project. Today, she is a
+Project Director at Expert Labs, leading application development.
+
+* `ginatrapani on GitHub <https://github.com/ginatrapani>`_
+* `@ginatrapani on Twitter <https://twitter.com/ginatrapani>`_
+* `+Gina Trapani on Google+ <https://plus.google.com/113612142759476883204>`_
+
+**Mark Wilkie** joined Expert Labs in May of 2010 as a lead developer and application architect. `See Mark's ThinkUp
+contributions <https://github.com/ginatrapani/ThinkUp/commits/master?author=mwilkie>`_.
+
+* `mwilkie on GitHub <https://github.com/mwilkie>`_
+* `@mwilkie on Twitter <https://twitter.com/mwilkie>`_
+
+**Anil Dash** founded Expert Labs in January of 2010, and is responsible for ThinkUp's look and feel. `See Anil's ThinkUp
+contributions <https://github.com/ginatrapani/ThinkUp/commits/master?author=anildash>`_.
+
+* `anildash on GitHub <https://github.com/anildash>`_
+* `@anildash on Twitter <https://twitter.com/anildash>`_
+* `+Anil Dash on Google+ <https://plus.google.com/103012564142649561853/>`_
+* `Anil Dash on Facebook <https://www.facebook.com/anil.dash>`_
+
+**Andy Baio** joined Expert Labs in November of 2010, and is responsible for data analysis and visualization.
+`See Andy's ThinkUp contributions <https://github.com/ginatrapani/ThinkUp/commits/master?author=waxpancake>`_.
+
+* `waxpancake on GitHub <https://github.com/waxpancake>`_
+* `@waxpancake on Twitter <https://twitter.com/waxpancake>`_
+* `+Andy Baio on Google+ <https://plus.google.com/103765655241162838230/>`_
+
+Community
+---------
+
+The core development team works with a growing community of volunteer and third-party contributors, some of whom are
+paid by their employer or through open source programs.
+
+`See ThinkUp's full list of contributors <https://github.com/ginatrapani/ThinkUp/contributors>`_.
View
1  docs/source/index.rst
@@ -28,3 +28,4 @@ engine.
contact
contribute/index
changelog
+ core
View
34 docs/source/userguide/settings/application.rst
@@ -36,13 +36,6 @@ Check this box if you don't want to allow users to
:doc:`embed ThinkUp threads on third-party web sites </userguide/listings/all/post_listings>` using a JavaScript
embed code. When this box is checked, the code will not be available for use.
-Developer Log
--------------
-
-Check this box if you want to see the :doc:`verbose, unformatted developer
-log </troubleshoot/common/advanced/crawlerlog>` on the "Update Now" screen, instead of the quieter, formatted user log.
-Once you change this setting, go back to the Dashboard and click on "Update Now" to see the change in action.
-
Default service user
--------------------
@@ -53,6 +46,33 @@ successfully.
If you set this to a public service user which becomes private, this setting will fall back to its default, the last
updated service user.
+Developer Log
+-------------
+
+Check this box if you want to see the :doc:`verbose, unformatted developer
+log </troubleshoot/common/advanced/crawlerlog>` on the "Update Now" screen, instead of the quieter, formatted user log.
+Once you change this setting, go back to the Dashboard and click on "Update Now" to see the change in action.
+
+
+Disable Usage Reporting
+-----------------------
+
+ThinkUp sends usage information to `thinkupapp.com <http://thinkupapp.com>`_ when it checks if there's
+a new version available. Collecting this usage information enables ThinkUp's :doc:`core development team </core>` to
+gain insight into what features are in use, and make data-informed decisions about how to improve the application.
+
+The information collected about individual ThinkUp installations is not public; it is only available to ThinkUp's
+:doc:`core development team </core>`. From time to time, the team may publish usage statistics in aggregate.
+
+The usage information includes:
+
+* The location and version of the ThinkUp installation
+* How many and which service users have been added to the installation
+* The last time an administrator logged into the ThinkUp installation
+
+Check this box to disable usage reporting on your ThinkUp installation.
+
+
Back Up and Export Data
------------------------
View
39 tests/TestOfAppConfigController.php
@@ -84,10 +84,13 @@ public function testLoadConfigViewData() {
'option_value' => 'abc123public');
$bvalue4 = array('namespace' => OptionDAO::APP_OPTIONS, 'option_name' => 'default_instance',
'option_value' => '123');
+ $bvalue5 = array('namespace' => OptionDAO::APP_OPTIONS, 'option_name' => 'is_opted_out_usage_stats',
+ 'option_value' => 'true');
$bdata = FixtureBuilder::build('options', $bvalue);
$bdata2 = FixtureBuilder::build('options', $bvalue2);
$bdata3 = FixtureBuilder::build('options', $bvalue3);
$bdata4 = FixtureBuilder::build('options', $bvalue4);
+ $bdata5 = FixtureBuilder::build('options', $bvalue5);
$results = $controller->control();
$json_obj = json_decode($results);
@@ -96,6 +99,7 @@ public function testLoadConfigViewData() {
$this->assertEqual($json_obj->values->recaptcha_private_key->option_value, 'abc123');
$this->assertEqual($json_obj->values->recaptcha_public_key->option_value, 'abc123public');
$this->assertEqual($json_obj->values->default_instance->option_value, '123');
+ $this->assertTrue($json_obj->values->is_opted_out_usage_stats->option_value);
}
public function testSaveConfigViewDataNoCSRFTokenPassed() {
@@ -129,6 +133,15 @@ public function testSaveConfigViewData() {
$this->assertEqual($json_obj->deleted, 0);
// bad arg for is_registration_open
+ $_POST['is_opted_out_usage_stats'] = 'falsify';
+ $controller = new AppConfigController(true);
+ $results = $controller->control();
+ $json_obj = json_decode($results);
+ $this->assertEqual($json_obj->status, 'failed');
+ $this->assertNotNull($json_obj->required->is_opted_out_usage_stats);
+ $_POST['is_opted_out_usage_stats'] = 'false';
+
+ // bad arg for is_registration_open
$_POST['is_registration_open'] = 'falsey';
//$_POST['recaptcha_enable'] = 'false';
$controller = new AppConfigController(true);
@@ -168,7 +181,7 @@ public function testSaveConfigViewData() {
$results = $controller->control();
$json_obj = json_decode($results);
$this->assertEqual($json_obj->status, 'success');
- $this->assertEqual($json_obj->saved, 4);
+ $this->assertEqual($json_obj->saved, 5);
// bad arg, not numeric
$_POST['default_instance'] = 'notanumber';
@@ -194,7 +207,7 @@ public function testSaveConfigViewData() {
$results = $controller->control();
$json_obj = json_decode($results);
$this->assertEqual($json_obj->status, 'success');
- $this->assertEqual($json_obj->saved, 5);
+ $this->assertEqual($json_obj->saved, 6);
// good double digit arg for default_instance
$_POST['default_instance'] = '57';
@@ -202,7 +215,7 @@ public function testSaveConfigViewData() {
$results = $controller->control();
$json_obj = json_decode($results);
$this->assertEqual($json_obj->status, 'success');
- $this->assertEqual($json_obj->saved, 5);
+ $this->assertEqual($json_obj->saved, 6);
// good triple digit arg for default_instance
$_POST['default_instance'] = '105';
@@ -210,7 +223,7 @@ public function testSaveConfigViewData() {
$results = $controller->control();
$json_obj = json_decode($results);
$this->assertEqual($json_obj->status, 'success');
- $this->assertEqual($json_obj->saved, 5);
+ $this->assertEqual($json_obj->saved, 6);
//assert Session info re: selected instance has been cleared
$session_instance_network = SessionCache::get('selected_instance_network');
@@ -227,7 +240,7 @@ public function testSaveConfigViewData() {
}
$stmt->closeCursor();
array_shift($data); //shift off database version record
- $this->assertEqual(count($data), 5);
+ $this->assertEqual(count($data), 6);
$this->assertEqual($data[0]['namespace'], OptionDAO::APP_OPTIONS);
$this->assertEqual($data[0]['option_name'], 'is_registration_open');
$this->assertEqual($data[0]['option_value'], 'false');
@@ -245,8 +258,10 @@ public function testSaveConfigViewData() {
$this->assertEqual($data[3]['option_name'], 'recaptcha_private_key');
$this->assertEqual($data[3]['option_value'], '1234abc');
$this->assertEqual($data[4]['namespace'], OptionDAO::APP_OPTIONS);
- $this->assertEqual($data[4]['option_name'], 'default_instance');
- $this->assertEqual($data[4]['option_value'], '105');
+ $this->assertEqual($data[4]['option_name'], 'is_opted_out_usage_stats');
+ $this->assertEqual($data[4]['option_value'], 'false');
+ $this->assertEqual($data[5]['option_name'], 'default_instance');
+ $this->assertEqual($data[5]['option_value'], '105');
// update records...
$_POST['is_registration_open'] = 'true';
@@ -262,7 +277,7 @@ public function testSaveConfigViewData() {
$results = $controller->control();
$json_obj = json_decode($results);
$this->assertEqual($json_obj->status, 'success');
- $this->assertEqual($json_obj->saved, 5);
+ $this->assertEqual($json_obj->saved, 6);
$this->assertEqual($json_obj->deleted, 0);
$sql = "select * from " . $this->table_prefix . 'options where namespace = \'' . OptionDAO::APP_OPTIONS
. '\' order by option_id';
@@ -273,7 +288,7 @@ public function testSaveConfigViewData() {
}
$stmt->closeCursor();
array_shift($data); //shift off database version record
- $this->assertEqual(count($data), 5);
+ $this->assertEqual(count($data), 6);
$this->assertEqual($data[0]['namespace'], OptionDAO::APP_OPTIONS);
$this->assertEqual($data[0]['option_name'], 'is_registration_open');
$this->assertEqual($data[0]['option_value'], 'true');
@@ -290,7 +305,8 @@ public function testSaveConfigViewData() {
$this->assertEqual($data[3]['namespace'], OptionDAO::APP_OPTIONS);
$this->assertEqual($data[3]['option_name'], 'recaptcha_private_key');
$this->assertEqual($data[3]['option_value'], '12345abc');
- $this->assertEqual($data[4]['option_value'], '12345');
+ $this->assertEqual($data[4]['option_value'], 'false');
+ $this->assertEqual($data[5]['option_value'], '12345');
// delete records...
$_POST['is_registration_open'] = 'true';
@@ -298,12 +314,13 @@ public function testSaveConfigViewData() {
$_POST['recaptcha_public_key'] = '';
$_POST['recaptcha_private_key'] = '';
$_POST['default_instance'] = '';
+ $_POST['is_opted_out_usage_stats'] = '';
$controller = new AppConfigController(true);
$results = $controller->control();
$json_obj = json_decode($results);
$this->assertEqual($json_obj->status, 'success');
$this->assertEqual($json_obj->saved, 1);
- $this->assertEqual($json_obj->deleted, 4);
+ $this->assertEqual($json_obj->deleted, 5);
$sql = "select * from " . $this->table_prefix . 'options where namespace = \'' . OptionDAO::APP_OPTIONS
. '\' order by option_id';
$stmt = PluginOptionMysqlDAO::$PDO->query($sql);
View
86 tests/TestOfCheckVersionController.php
@@ -0,0 +1,86 @@
+<?php
+/**
+ *
+ * ThinkUp/tests/TestOfCheckVersionController.php
+ *
+ * Copyright (c) 2011 Gina Trapani
+ *
+ * LICENSE:
+ *
+ * This file is part of ThinkUp (http://thinkupapp.com).
+ *
+ * ThinkUp is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any
+ * later version.
+ *
+ * ThinkUp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with ThinkUp. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Test of CheckCrawlerController
+ *
+ * @license http://www.gnu.org/licenses/gpl.html
+ * @copyright 2011 Gina Trapani
+ * @author Gina Trapani <ginatrapani[at]gmail[dot]com>
+ */
+require_once dirname(__FILE__).'/init.tests.php';
+require_once THINKUP_ROOT_PATH.'webapp/_lib/extlib/simpletest/autorun.php';
+require_once THINKUP_ROOT_PATH.'webapp/config.inc.php';
+
+class TestOfCheckVersionController extends ThinkUpUnitTestCase {
+
+ public function setUp(){
+ parent::setUp();
+ }
+
+ public function tearDown(){
+ parent::tearDown();
+ }
+
+ public function testConstructor() {
+ $controller = new CheckVersionController(true);
+ $this->assertTrue(isset($controller));
+ }
+
+ public function testNotLoggedIn() {
+ $controller = new CheckVersionController(true);
+
+ $results = $controller->go();
+ $this->assertPattern('/You must <a href="\/session\/login.php">log in<\/a> to do this/', $results);
+ }
+
+ public function testLoggedin() {
+ $this->simulateLogin('me@example.com');
+ $controller = new CheckVersionController(true);
+
+ $results = $controller->go();
+ $this->assertNoPattern('/You must <a href="\/session\/login.php">log in<\/a> to do this/', $results);
+ $this->assertPattern('/var ROOT = \'thinkup_version\'/', $results);
+ }
+
+ public function testOptedOut() {
+ $bvalues = array('namespace' => OptionDAO::APP_OPTIONS, 'option_name' => 'is_opted_out_usage_stats',
+ 'option_value' => 'true');
+ $bdata = FixtureBuilder::build('options', $bvalues);
+
+ $this->simulateLogin('me@example.com');
+ $controller = new CheckVersionController(true);
+
+ $results = $controller->go();
+ $this->assertNoPattern('/You must <a href="\/session\/login.php">log in<\/a> to do this/', $results);
+ $this->assertPattern('/var ROOT = \'thinkup_version\'/', $results);
+ $this->assertPattern('/var CONTENT_URL = \'http:\/\/thinkupapp.com\/version.php\?v=0.16\&usage=n/', $results);
+ }
+
+ public function testNotOptedOut() {
+ $this->simulateLogin('me@example.com');
+ $controller = new CheckVersionController(true);
+
+ $results = $controller->go();
+ $this->assertPattern('/var CONTENT_URL = \'http:\/\/thinkupapp.com\/version.php\?v=0.16/', $results);
+ $this->assertNoPattern('/var CONTENT_URL = \'http:\/\/thinkupapp.com\/version.php?v=0.16q\&usage=n/', $results);
+ }
+}
View
1  tests/all_controller_tests.php
@@ -37,6 +37,7 @@
$controller_test->add(new TestOfAppConfigController());
$controller_test->add(new TestOfBackupController());
$controller_test->add(new TestOfCheckCrawlerController());
+$controller_test->add(new TestOfCheckVersionController());
$controller_test->add(new TestOfCrawlerAuthController());
$controller_test->add(new TestOfDashboardController());
$controller_test->add(new TestOfThinkUpEmbedController());
View
3  webapp/_lib/controller/class.CheckVersionController.php
@@ -31,7 +31,10 @@
*/
class CheckVersionController extends ThinkUpAuthController {
public function authControl() {
+ $this->setContentType('text/javascript');
$this->setViewTemplate('install.checkversion.tpl');
+ $config = Config::getInstance();
+ $this->addToView('is_opted_out_usage_stats', $config->getValue('is_opted_out_usage_stats'));
return $this->generateView();
}
}
View
10 webapp/_lib/model/class.AppConfig.php
@@ -69,7 +69,7 @@ class AppConfig {
'match_message' => '',
'default' => '',
),
-
+
/**
* Currently there's a bug with checkboxes which have a default value of true. When you uncheck the box,
* and save the form, no value gets submitted for the checkbox, so the false value doesn't get saved.
@@ -101,6 +101,14 @@ class AppConfig {
'match' => '/^(true|false)$/',
'match_message' => 'Must be true or false'
),
+ 'is_opted_out_usage_stats' => array(
+ 'type' => 'checkbox',
+ 'title' => 'Usage reporting helps us improve ThinkUp',
+ 'required' => false,
+ 'default' => 'false',
+ 'match' => '/^(true|false)$/',
+ 'match_message' => 'Must be true or false'
+ ),
'default_instance' => array(
'type' => 'text',
'title' => 'The service user to display by default',
View
24 webapp/_lib/view/account.appconfig.tpl
@@ -1,5 +1,5 @@
<div class="prepend_20">
- <div class="help-container">{insert name="help_link" id='application_settings'}</div>
+ {insert name="help_link" id='application_settings'}
<h1>Application Settings</h1>
</div>
<div class="clearfix prepend_20">
@@ -44,7 +44,8 @@
<div style="float: left;">
<label for="recaptcha_enable">
- Enable reCAPTCHA:
+ Enable reCAPTCHA:
+ <br>
</label>
</div>
<div style="float: left;">
@@ -52,7 +53,7 @@
</div>
<div style="clear:both;"></div>
<div style="font-size: 12px; color : #555; margin: 0px 0px 10px 0px;">
- Select to enable reCAPTCHA, and <a href="https://www.google.com/recaptcha">get your reCAPTCHA keys here</a>.
+ Add reCAPTCHA to ThinkUp's registration form. <a href="https://www.google.com/recaptcha">Get your reCAPTCHA keys here</a>.
</div>
<div id="recaptcha_enable_deps" style="display: none; width: 470px; margin: 10px 0px 60px 20px;">
@@ -83,12 +84,11 @@
</label>
</div>
<div style="float: left;">
- {insert name="help_link" id="api"}
<input type="checkbox" name="is_api_disabled" id="is_api_disabled" value="true">
</div>
<div style="clear:both;"></div>
<div style="font-size: 12px; color : #555; margin: 0px 0px 10px 0px;">
- Set whether or not your site's data is available via ThinkUp's JSON API.
+ Set whether or not your site's data is available via ThinkUp's JSON API. <a href="http://thinkupapp.com/docs/userguide/api/posts/index.html">Learn more...</a>
</div>
<div style="float: left;">
@@ -139,6 +139,20 @@
</div>
</div>
+ <div style="float: left;">
+ <label for="is_opted_out_usage_stats">
+ Disable usage reporting:
+ <br />
+ </label>
+ </div>
+ <div style="float: left;">
+ <input type="checkbox" name="is_opted_out_usage_stats" id="is_opted_out_usage_stats" value="true">
+ </div>
+ <div style="clear:both;"></div>
+ <div style="font-size: 12px; color : #555; margin: 0px 0px 10px 0px;">
+ Usage reporting helps us improve ThinkUp. <a href="http://thinkupapp.com/docs/userguide/settings/application.html#disable-usage-reporting">Learn more...</a>
+ </div>
+
<div style="text-align: center" id="save_setting_image">
<img id="save_setting_image" src="{$site_root_path}assets/img/loading.gif" width="31" height="31"
style="display: none; margin: 10px;"/>
View
2  webapp/_lib/view/install.checkversion.tpl
@@ -1,5 +1,5 @@
{literal}ThinkUpAppVersion = new function() {
- var CONTENT_URL = 'http://thinkupapp.com/version.php?v={/literal}{$thinkup_version}{literal}';
+ var CONTENT_URL = 'http://thinkupapp.com/version.php?v={/literal}{$thinkup_version}{if $is_opted_out_usage_stats}&usage=n{/if}{literal}';
var ROOT = 'thinkup_version';
function requestContent( local ) {
Please sign in to comment.
Something went wrong with that request. Please try again.