Commit e11dd1b1 authored by Gábor Hojtsy's avatar Gábor Hojtsy

#178768: Removing Drupal module from Drupal to improve security and privacy....

#178768: Removing Drupal module from Drupal to improve security and privacy. Will live in contrib under a different name if people step up to maintain. Look at the issue for more information.
parent 81fc35b3
<?php
// $Id$
/**
* @file
* Admin page callbacks for the drupal module.
*/
/**
* Form builder; Configure what sites this site can authenticate with.
*
* @ingroup forms
* @see system_settings_form().
*/
function drupal_sites_registry_settings() {
// Check if all required fields are present
if ((variable_get('site_name', 'Drupal') == 'Drupal') || (variable_get('site_name', 'Drupal') == '')) {
form_set_error('drupal_directory', t('You must set the name of your site on the <a href="@url">administer &raquo; settings &raquo; site information</a> page.', array('@url' => url('admin/settings/site-information'))));
}
else if (variable_get('site_mail', ini_get('sendmail_from')) == '') {
form_set_error('drupal_directory', t('You must set an e-mail address for your site on the <a href="@url">site information settings page</a>.', array('@url' => url('admin/settings/site-information'))));
}
else if (variable_get('site_slogan', '') == '') {
form_set_error('drupal_directory', t('You must set your site slogan on the <a href="@url">site information settings page</a>.', array('@url' => url('admin/settings/site-information'))));
}
else if (variable_get('site_mission', '') == '') {
form_set_error('drupal_directory', t('You must set your site mission on the <a href="@url">site information settings page</a>.' , array('@url' => url('admin/settings/site-information'))));
}
$options = array('1' => t('Enabled'), '0' => t('Disabled'));
$form['drupal_register'] = array(
'#type' => 'radios',
'#title' => t('Register with a Drupal server'),
'#default_value' => variable_get('drupal_register', 0),
'#options' => $options,
'#description' => t("If enabled, your Drupal site will register itself with the specified Drupal XML-RPC server. For this to work properly, you must set your site's name, e-mail address, slogan and mission statement. When the Drupal XML-RPC server field is set to %drupal-xml-rpc, your website will register itself with drupal.org. Requires the cron feature to be enabled.", array("%drupal-xml-rpc" => "http://drupal.org/xmlrpc.php"))
);
$form['drupal_server'] = array(
'#type' => 'textfield',
'#title' => t('Drupal XML-RPC server'),
'#default_value' => variable_get('drupal_server', 'http://drupal.org/xmlrpc.php'),
'#description' => t('The URL of the Drupal XML-RPC server you wish to register with.')
);
$form['drupal_system'] = array(
'#type' => 'radios',
'#title' => t('Send system information'),
'#default_value' => variable_get('drupal_system', 0),
'#options' => $options,
'#description' => t("If enabled, your site will send information on its installed components (modules, themes, and theme engines). This information can help in compiling statistics on usage of Drupal projects.")
);
$form['drupal_statistics'] = array(
'#type' => 'radios',
'#title' => t('Send statistics'),
'#default_value' => variable_get('drupal_statistics', 0),
'#options' => $options,
'#description' => t("If enabled, your site will send summary statistics on the number of registered users and the total number of posts. No private information will be sent. These data help to improve the ranking statistics of Drupal projects.")
);
$form['drupal_client_service'] = array(
'#type' => 'radios',
'#title' => t('Allow other Drupal sites to register'),
'#default_value' => variable_get('drupal_client_service', 0),
'#options' => $options,
'#description' => t('If enabled, your Drupal site will allow other sites to register with your site and send information to this site. This functionality can be used to maintain a list of related sites.')
);
return system_settings_form($form);
}
/**
* Form builder; Configure how distributed authentication will work.
*
* @ingroup forms
* @see system_settings_form().
*/
function drupal_distributed_authentication_settings() {
$options = array('1' => t('Enabled'), '0' => t('Disabled'));
$form['drupal_authentication_service'] = array(
'#type' => 'radios',
'#title' => t('Authentication service'),
'#default_value' => variable_get('drupal_authentication_service', 0),
'#options' => $options,
'#description' => t('If enabled, your Drupal site will accept logins with the user names of other Drupal sites, and likewise provide authentication for users logging into other Drupal sites, based on their user accounts here.')
);
$form['drupal_default_da_server'] = array(
'#type' => 'textfield',
'#title' => t('Default authentication server'),
'#default_value' => variable_get('drupal_default_da_server', ''),
'#description' => t('The URL of the default Drupal authentication server. Omit the %http prefix (e.g. drupal.org, www.example.com, etc.). If the authentication service has been enabled, users registered at the server specified here, will not need to append the server to their user name when logging into your site. This enables users to provide a briefer, more familiar username in the login form.', array('%http' => 'http'))
);
$form['drupal_default_da_server_only'] = array(
'#type' => 'radios',
'#title' => t('Only allow authentication from default server'),
'#default_value' => variable_get('drupal_default_da_server_only', 0),
'#options' => $options,
'#description' => t("Only accept remote logins from the above specified default authentication server and not from any other server. Useful when an external system is the solitary authority on user accounts for this site. A common usage is to enable this setting and also enable an authentication module which talks to your company's directory server.")
);
return system_settings_form($form);
}
; $Id$
name = Drupal
description = Lets you register your site with a central server and improve ranking of Drupal projects by posting information on your installed modules and themes; also enables users to log in using a Drupal ID.
package = Core - optional
version = VERSION
core = 6.x
<?php
// $Id$
/**
* Implementation of hook_install().
*/
function drupal_install() {
// Create tables.
drupal_install_schema('drupal');
}
/**
* Implementation of hook_uninstall().
*/
function drupal_uninstall() {
// Remove tables.
drupal_uninstall_schema('drupal');
variable_del('drupal_authentication_service');
variable_del('drupal_directory');
variable_del('drupal_register');
variable_del('drupal_server');
variable_del('drupal_system');
variable_del('drupal_statistics');
variable_del('drupal_client_service');
variable_del('drupal_default_da_server');
variable_del('drupal_default_da_server_only');
}
/**
* Implementation of hook_schema().
*/
function drupal_schema() {
$schema['client'] = array(
'fields' => array(
'cid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
'link' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
'name' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
'mail' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
'slogan' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'),
'mission' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'),
'users' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'nodes' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'version' => array('type' => 'varchar', 'length' => 35, 'not null' => TRUE, 'default' => ''),
'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'changed' => array('type' => 'int', 'not null' => TRUE, 'default' => 0)
),
'primary key' => array('cid'),
);
$schema['client_system'] = array(
'fields' => array(
'cid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
'type' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')
),
'primary key' => array('cid', 'name'),
);
return $schema;
}
This diff is collapsed.
<?php
// $Id$
/**
* @file
* User page callbacks for the drupal module.
*/
/**
* Menu callback; print Drupal-authentication-specific information.
*/
function drupal_page_help() {
return t('<p><a href="@Drupal">Drupal</a> is the name of the software that powers %this-site. There are Drupal websites all over the world, and many of them share their registration databases so that users may freely log in to any Drupal site using a single <strong>Drupal ID</strong>.</p>
<p>So please feel free to log in to your account here at %this-site with a username from another Drupal site. The format of a Drupal ID is similar to an e-mail address: <strong>username</strong>@<em>server</em>. An example of a valid Drupal ID is <strong>mwlily</strong>@<em>drupal.org</em>.</p>', array('@Drupal' => 'http://drupal.org', '%this-site' => variable_get('site_name', 'Drupal')));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment