diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-11-06 09:00:31 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-11-06 09:00:31 +0000 |
commit | 5f09149caaff7f073101f01ec0ae8f3d251d4b56 (patch) | |
tree | d3ec6b0b777010bd2d9955768dde7ae2bb1d32ca | |
parent | 235621a072caff6e05ccf36e4990e084009f7c49 (diff) | |
download | brdo-5f09149caaff7f073101f01ec0ae8f3d251d4b56.tar.gz brdo-5f09149caaff7f073101f01ec0ae8f3d251d4b56.tar.bz2 |
#178581 by lot of contributors: opt-in for update module on install and update to avoid any privacy concerns
-rw-r--r-- | install.php | 21 | ||||
-rw-r--r-- | modules/system/system.install | 53 | ||||
-rw-r--r-- | modules/update/update.module | 7 | ||||
-rw-r--r-- | profiles/default/default.profile | 2 |
4 files changed, 47 insertions, 36 deletions
diff --git a/install.php b/install.php index d425d7618..673b7e44c 100644 --- a/install.php +++ b/install.php @@ -654,11 +654,8 @@ function install_tasks($profile, $task) { $form['#build_id'] = $form_build_id; drupal_prepare_form('install_configure_form', $form, $form_state); - // In order to find out if the form was successfully submitted or not, - // we do a little song and dance to set the form to 'programmed' and check - // to make sure this is really the form being submitted. It'd better be. + // Is the form submitted? if (!empty($_POST) && $_POST['form_id'] == 'install_configure_form') { - $form['#programmed'] = TRUE; $form['#post'] = $_POST; } else { @@ -945,11 +942,22 @@ if (Drupal.jsEnabled) { '#weight' => 10, ); + $form['server_settings']['update_status_module'] = array( + '#type' => 'checkboxes', + '#title' => st('Update notifications'), + '#options' => array(1 => st('Check for updates automatically')), + '#default_value' => array(1), + '#description' => st('Drupal can check periodically for important bug fixes and security releases. To do this, your site will send anonymous information on its installed components to drupal.org. It is <strong>highly recommended</strong> that you enable this option for your site\'s security. For more information please read the <a href="@update">update notification information</a>.', array('@update' => 'http://drupal.org/handbook/modules/update')), + '#weight' => 15, + ); + $form['submit'] = array( '#type' => 'submit', '#value' => st('Save'), '#weight' => 15, ); + $form['#redirect'] = FALSE; + $hook_form_alter = $_GET['profile'] .'_form_alter'; if (function_exists($hook_form_alter)) { $hook_form_alter($form, 'install_configure'); @@ -976,6 +984,11 @@ function install_configure_form_submit($form, &$form_state) { variable_set('site_mail', $form_state['values']['site_mail']); variable_set('date_default_timezone', $form_state['values']['date_default_timezone']); + // Enable update.module if this option was selected. + if ($form_state['values']['update_status_module'][1]) { + drupal_install_modules(array('update')); + } + // Turn this off temporarily so that we can pass a password through. variable_set('user_email_verification', FALSE); $form_state['old_values'] = $form_state['values']; diff --git a/modules/system/system.install b/modules/system/system.install index 028a0bdb6..2d7ef8be3 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -187,6 +187,23 @@ function system_requirements($phase) { include_once './includes/unicode.inc'; $requirements = array_merge($requirements, unicode_requirements()); + // Check for update status module. + if ($phase == 'runtime') { + if (!module_exists('update')) { + $requirements['update status'] = array( + 'value' => $t('Not enabled'), + 'severity' => REQUIREMENT_ERROR, + 'description' => $t('Update notifications are not enabled. It is <strong>highly recommended</strong> that you enable the update status module from the <a href="@module">module administration page</a> in order to stay up-to-date on new releases. For more information please read the <a href="@update">Update status handbook page</a>.', array('@update' => 'http://drupal.org/handbook/modules/update', '@module' => url('admin/build/modules'))), + ); + } + else { + $requirements['update status'] = array( + 'value' => $t('Enabled'), + ); + } + $requirements['update status']['title'] = $t('Update notifications'); + } + return $requirements; } @@ -4269,43 +4286,17 @@ function system_update_6025() { } /** - * Enable the update.module by default on sites that upgrade. - * - * This cannot just rely on update.install to install the schema. If, - * in the future, someone decides to change the schema for the - * {cache_update} table, this update would cause uncertainty in the - * state of the DB, since the effect of running this update would - * change. For example, if the schema is changed in update #6101, and - * a site upgrades direct from 5.x to 6.1, update #6026 would create - * the table with the new schema, and then update #6101 would fail, - * since it's trying to alter the old schema into the new - * schema. Therefore, we must hard-code the particular version of the - * schema we mean during update #6026, and then future upgrades that - * might attempt to modify the schema of this table will be starting - * from a known state. See http://drupal.org/node/150220 for more. + * Display warning about new Update status module. */ function system_update_6026() { $ret = array(); - $schema['cache_update'] = array( - 'fields' => array( - 'cid' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'data' => array('type' => 'blob', 'not null' => FALSE, 'size' => 'big'), - 'expire' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'headers' => array('type' => 'text', 'not null' => FALSE), - 'serialized' => array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0) - ), - 'indexes' => array('expire' => array('expire')), - 'primary key' => array('cid'), - ); - db_create_table($ret, 'cache_update', $schema['cache_update']); - drupal_set_installed_schema_version('update', 0); - module_enable(array('update')); - menu_rebuild(); + + // Notify user that new update module exists. + drupal_set_message(t('Drupal can check periodically for important bug fixes and security releases using the new update status module. This module can be turned on from the <a href="@modules">modules administration page</a>. For more information please read the <a href="@update">Update status handbook page</a>.', array('@modules' => url('admin/build/modules'), '@update' => 'http://drupal.org/handbook/modules/update'))); + return $ret; } - /** * Add block cache. */ diff --git a/modules/update/update.module b/modules/update/update.module index bf006230c..2a5305470 100644 --- a/modules/update/update.module +++ b/modules/update/update.module @@ -71,6 +71,13 @@ function update_help($path, $arg) { // These two pages don't need additional nagging. break; + case 'admin/help#update': + $output = '<p>'. t("The Update status module periodically checks for new versions of your site's software (including contributed modules and themes), and alerts you to available updates.") .'</p>'; + $output .= '<p>'. t('The <a href="@update-report">report of available updates</a> will alert you when new releases are available for download. You may configure options for update checking frequency and notifications at the <a href="@update-settings">Update status module settings page</a>.', array('@update-report' => url('admin/logs/updates'), '@update-settings' => url('admin/logs/updates/settings'))) .'</p>'; + $output .= '<p>'. t('Please note that in order to provide this information, anonymous usage statistics are sent to drupal.org. If desired, you may disable the Update status module from the <a href="@modules">module administration page</a>.', array('@modules' => url('admin/build/modules'))) .'</p>'; + $output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="@update">Update status page</a>.', array('@update' => 'http://drupal.org/handbook/modules/update')) .'</p>'; + return $output; + default: // Otherwise, if we're on *any* admin page and there's a security // update missing, print an error message about it. diff --git a/profiles/default/default.profile b/profiles/default/default.profile index 7f33cf5ba..c6dacdfd3 100644 --- a/profiles/default/default.profile +++ b/profiles/default/default.profile @@ -8,7 +8,7 @@ * An array of modules to be enabled. */ function default_profile_modules() { - return array('color', 'comment', 'help', 'menu', 'taxonomy', 'dblog', 'update'); + return array('color', 'comment', 'help', 'menu', 'taxonomy', 'dblog'); } /** |