You are here

README.txt in Domain Access 7.3

README file for Domain Access.

File

README.txt
View source
  1. /**
  2. * @file
  3. * README file for Domain Access.
  4. */
  5. Domain Access
  6. A domain-based access control system.
  7. ===============================================================================
  8. This document is out of date. Current documentation is online at:
  9. http://drupal.org/documentation/modules/domain
  10. If you find errors or omissions, please help fix them. Anyone can create
  11. documentation pages.
  12. ===============================================================================
  13. CONTENTS
  14. --------
  15. 1. Introduction
  16. 1.1 Use-Case
  17. 1.2 Examples
  18. 1.3 Using Multiple Node Access Modules
  19. 1.4 Known Issues
  20. 1.4.1 Logging In To Multiple Domains
  21. 1.4.2 Cron Handling
  22. 1.4.3 Updating Your Site
  23. 2. Installation
  24. 2.1 Edits to settings.php
  25. 2.2 Server Configuration
  26. 2.3 Creating Domain Records
  27. 2.4 Setting DOMAIN_INSTALL_RULE
  28. 2.5 Setting DOMAIN_SITE_GRANT
  29. 2.6 Setting DOMAIN_ASSIGN_USERS
  30. 3. Permissions
  31. 3.1 Module Permissions
  32. 3.2 Normal Usage
  33. 3.3 Advanced Usage
  34. 3.4 Limitations
  35. 4. Module Configuration
  36. 4.1 Default Domain Settings
  37. 4.1.1 Primary Domain Name
  38. 4.1.2 Site Name
  39. 4.1.3 Domain URL Scheme
  40. 4.2 Creating Domain Records
  41. 4.2.1 Restricted Characters in Domains
  42. 4.2.2 Altering Domain Name Validation
  43. 4.3 Domain Module Behaviors
  44. 4.3.1 New Content Settings
  45. 4.3.1.1 Send to All Affiliates
  46. 4.3.2 Debugging Status
  47. 4.3.3 Enforce Rules on Administrators
  48. 4.3.4 Domain List Size
  49. 4.3.5 Display in Vertical Tabs
  50. 4.3.6 Domain Selection Format
  51. 4.4 Advanced Settings
  52. 4.4.1 Search Settings
  53. 4.4.2 Search Engine Optimization
  54. 4.4.3 Default Source Domain
  55. 4.4.4 WWW Prefix Handling
  56. 4.5 Special Page Requests
  57. 4.5.1 Cron Handling
  58. 4.5.2 XMLRPC Handling
  59. 4.6 Node Link Patterns
  60. 4.7 The Domain List
  61. 4.8 Batch Updating
  62. 4.9 Assigning Users to Domains
  63. 4.10 Batch Assignment of Users to Domains
  64. 4.10.1 Form Behavior
  65. 5. Blocks
  66. 5.1 Block -- Domain Switcher
  67. 5.2 Block -- Domain Access Information
  68. 6. Node Access
  69. 6.1 Assigning Domain Access
  70. 6.2. Editor Access
  71. 6.3 Realms
  72. 6.4 Grants
  73. 6.5 Warnings
  74. 7. Developer Notes
  75. 7.1 Extension Modules
  76. 7.2 The $_domain Global
  77. 7.3 Database Schema
  78. 7.4 API
  79. 7.5 Domain Tokens
  80. 8. Drush commands
  81. ----
  82. 1. Introduction
  83. Before using the module, you should read the installation instructions found
  84. in INSTALL_QUICKSTART.txt.
  85. The Domain Access module group is designed to run an affiliated network of sites
  86. from a single Drupal installation. The module allows you to share users,
  87. content, and configurations across a group of sites such as:
  88. - example.com
  89. - one.example.com
  90. - two.example.com
  91. - my.example.com
  92. - thisexample.com
  93. - anothersite.com
  94. - example.com:3000 <-- non-standard ports are treated as unique domains.
  95. By default, these sites share all tables in your Drupal installation.
  96. The module uses Drupal's node_access() system to determine what content is
  97. available on each site in the network. Unlike other multi-domain modules for
  98. Drupal, the Domain Access module determines user access based on the active
  99. domain that the user is viewing, rather than which group or site the user
  100. belongs to.
  101. Additionally, when a user creates content, that content will automatically be
  102. assigned to the currently active domain unless the user has specific
  103. privileges to be able to assign domain access. Under advanced setups, the
  104. ability to edit content for a specific domain can be segregated from the
  105. typical Drupal privilege to 'Bypass content access control.'
  106. For more information about Domain Access privileges, see section 3.
  107. For more information about node_access(), see
  108. http://api.drupal.org/api/group/node_access/6
  109. ----
  110. 1.1 Use-Case
  111. The module was initially developed for a web site that sold franchises of a
  112. monthly magazine. The publishing rules were as follows:
  113. - Content may belong to the national site, one or more affiliates, or to
  114. all affiliates.
  115. - National editors may select to promote affiliate content to other
  116. affiliates, the national site, or to all affiliates.
  117. - Local editors may only create and edit content for their own affiliate
  118. sites.
  119. These rules are enforced programmatically by the Domain Access module. There
  120. was concern that, if given a choice to make, local editors would not assign the
  121. content correctly. Therefore, the module handles this automatically, and local
  122. editors have no control over which domains their content is published to.
  123. This video from DrupalCon Paris explains the module in detail:
  124. http://www.archive.org/details/SharingcontentacrossmultiplesiteswithDomainAccess
  125. ----
  126. 1.2 Examples
  127. For the original example of the module in use, see http://skirt.com/.
  128. For case-studies, see:
  129. http://drupal.org/node/369398
  130. http://www.trellon.com/content/blog/sharing-content-domain-access
  131. Sites using Domain Access include:
  132. * www.barnard.edu (Drupal 7)
  133. * www.interlochen.org
  134. * www.skirt.com
  135. * www.dzone.com
  136. * www.itgjamaica.com
  137. * www.rowelevenwines.com
  138. * www.weecology.org
  139. * www.komonews.com/communities
  140. ----
  141. 1.3 Using Multiple Node Access Modules
  142. Node Access is a complex issue in Drupal. Typically, sites will only use
  143. one node access module at a time. In some cases, you may require
  144. more advances access control rules.
  145. Two important issues to understand are:
  146. 1. User 1 and users with the 'Bypass node access' permission are not
  147. subject to node access rules. See section 4.3.3 for more details.
  148. 2. Node Access is a permissive API. If you use more than one Node Access
  149. module (such as Organic Groups), if either module grants access, users will
  150. be given access.
  151. Changes to these core behaviors require custom code solutions.
  152. ----
  153. 1.4 Known Issues
  154. There are some issues that occur when Domain Access is used outside
  155. of its original use case. These are probably fixable, but may not work
  156. as you expect. You should pay careful attention to your site behavior.
  157. ----
  158. 1.4.1 Logging In To Multiple Domains
  159. The Domain Access module allows the creation of domains with different
  160. hosts. However, security standards dictate that cookies can only be
  161. read from the issuing domain.
  162. As a result, you may configure your site as follows, but when you do so,
  163. users cannot be logged through a single sign in.
  164. example.com
  165. one.example.com
  166. myexample.com
  167. thisexample.com
  168. While example.com and one.example.com can share a login cookie, the
  169. other two domains cannot read that cookie. This is an Internet standard,
  170. not a bug.
  171. Note: See the INSTALL.txt for instructions regarding Drupal's default
  172. cookie handling.
  173. ----
  174. 1.4.2 Cron Handling
  175. When Drupal's cron function runs, it operates on the domain from which
  176. the cron.php script is invoked. That is, if you setup cron to run from:
  177. http://one.example.com/cron.php
  178. In this case, Domain Access will check the access settings for that domain.
  179. This behavior has been known to cause issues with other contributed modules.
  180. As a solution, we normally disable Domain Access rules when cron runs.
  181. For more information, see section 4.5.1 Cron Handling.
  182. If you encounter any cron-related issues, please report them at:
  183. http://drupal.org/project/issues/domain
  184. ----
  185. 1.4.3 Updating Your Site
  186. For upgrade instructions, see the provided UPGRADE.txt.
  187. ----
  188. 2. Installation
  189. WARNING: The Domain Access module assumes that you have already installed
  190. and configured your Drupal site. Please do so before continuing.
  191. Installing the module requires that you share a single copy of settings.php
  192. for all domains that will be registered with Domain Access.
  193. You must also add code to that settings.php file in order to load the domain
  194. handling code. See INSTALL_QUICKSTART.txt for instructions.
  195. For detailed instructions, see INSTALL.txt.
  196. After you have completed the steps outlined by the installer, you may enable
  197. the module normally. When you enable the module, it will create a {domain} table
  198. in your Drupal database.
  199. All existing nodes and users on your site will be assigned to the default domain
  200. for your web site. Existing content will be set to be visible on all new
  201. domains. If you wish to alter this behavior, see sections 2.4 through 2.6.
  202. ----
  203. 2.1 Edits to settings.php
  204. Please see the documentation in INSTALL.txt or INSTALL_QUICKSTART.txt
  205. ----
  206. 2.2 Server Configuration
  207. For the module to work correctly, the DNS record of your server must accept
  208. multiple DNS entries pointing at a single IP address that hosts your Drupal
  209. installation.
  210. The two basic methods for doing this are either to:
  211. - Setup WildCard DNS, so that *.example.com resolves to your Drupal site.
  212. - Setup VirtualHosts so that one.example.com, two.example.com, etc. all
  213. resolve to your Drupal site.
  214. For example, on my local testing machine, I have VirtualHosts to the following
  215. sites setup in httpd.conf:
  216. - example.com => 127.0.0.1
  217. - one.example.com => 127.0.0.1
  218. - two.example.com => 127.0.0.1
  219. - three.example.com => 127.0.0.1
  220. It is beyond the scope of this document to explain how to configure your DNS
  221. server. For more information, see:
  222. - http://en.wikipedia.org/wiki/Wildcard_DNS_record
  223. - http://en.wikipedia.org/wiki/Virtual_hosting
  224. After you have enabled multiple DNS entries to resolve to your Drupal
  225. installation, you may activate the module and configure its settings.
  226. No matter how many domains resolve to the same IP, you only need one instance
  227. of Drupal's settings.php file. The sites folder should be named 'default' or
  228. named for your root domain.
  229. NOTE: If you choose the WildCard DNS option, any subdomain not controlled
  230. by the Domain module, including misspelled subdomains, will go to the default
  231. domain without a redirect. To properly redirect invalid subdomains, use the
  232. Domain Alias module and set *.example.com as an alias of your primary domain
  233. with the 'redirect' setting checked. More information can be found in the
  234. README.txt in the domain_alias directory.
  235. ----
  236. 2.3 Creating Domain Records
  237. After you enable the module, you will have a user interface for registering new
  238. domains with your site. For these to work correctly, they must also be
  239. configured by your DNS server.
  240. To be clear: creating a new domain record through this module will not alter
  241. the DNS server of your web server.
  242. ----
  243. 2.4 Setting DOMAIN_INSTALL_RULE
  244. This is an advanced instruction, and may be ignored.
  245. At the top of the domain.module file, you will find this line:
  246. define('DOMAIN_INSTALL_RULE', TRUE);
  247. This setting controls the default behavior of the module when installing over
  248. an existing installation. If set to TRUE, the Domain Access module will assign
  249. all existing nodes to be viewable by your primary domain.
  250. If you set this value to FALSE, existing content will not be visible on your
  251. primary domain unless DOMAIN_SITE_GRANT is set to TRUE.
  252. For more details, see section 6.
  253. ----
  254. 2.5 Setting DOMAIN_SITE_GRANT
  255. At the top of the domain.module file, you will find this line:
  256. define('DOMAIN_SITE_GRANT', TRUE);
  257. This setting controls the default behavior for viewing affiliate content.
  258. By design, the Domain Access module allows site administrators to assign
  259. content to 'all affiliates.' If this value is set to TRUE, then content
  260. assigned to all affiliates can be seen by all users on all current domains.
  261. On install, setting this value to TRUE will assign all current content to
  262. be viewable on all domains.
  263. Normally, you will not need to edit this value.
  264. ----
  265. 2.6 Setting DOMAIN_ASSIGN_USERS
  266. At the top of the domain.module file, you will find this line:
  267. define('DOMAIN_ASSIGN_USERS', TRUE);
  268. After you install the Domain Access module, all new users who
  269. register will automatically be assign to the domain from which
  270. their account was created. This value is used to determine
  271. advanced editing access and can be used by modules such as
  272. Domain Strict.
  273. On install, setting this value to TRUE will assign all current users
  274. to be members of the default domain. Set the value to FALSE
  275. and the module will not assign users to any domains.
  276. Normally, you will not need to edit this value.
  277. After installation and configuration, users with the appropriate
  278. permissions may batch assign users to domains from
  279. Administer > User Management > Users.
  280. ----
  281. 3. Permissions
  282. After enabling the module, go to Access Control to configure the module's
  283. permissions.
  284. ----
  285. 3.1 Module Permissions
  286. The Domain Access module has the following permissions:
  287. - 'Administer domain records and settings'
  288. This permission allows users to create and manage domain records
  289. and settings.
  290. - 'Access inactive domains'
  291. This permission allows users to navigate to domains which are marked
  292. as inactive. Users with this permission may also assign content to an
  293. inactive domain.
  294. 'assign domain editors'
  295. This permission allows users to assign themselves and other users as
  296. affiliate editors. For those users to act as editors, their role(s) must also
  297. have the 'Edit any content on assigned domains' permission.
  298. - 'Edit any content on assigned domains'
  299. This permission is for advanced use and substitutes for the normal
  300. 'Bypass content access control' permission for sites that give restricted
  301. administrative privileges. See section 3.3 for more information.
  302. - 'Delete any content on assigned domains'
  303. This permission is for advanced use and substitutes for the normal
  304. 'Bypass content access control' permission for sites that give restricted
  305. administrative privileges. See section 3.3 for more information.
  306. - 'View unpublished content on assigned domains'
  307. This permission allows editors to view unpublished content assigned to
  308. their domain(s). This permission only applies to viewing a single content
  309. page; it does not affect list views.
  310. - 'Set domain access status for all content'
  311. This permission is key. Users with this permission will be given a user
  312. interface for assigning users and nodes to specific domains. Users without
  313. this permission cannot assign domain access; their nodes will automatically
  314. be assigned to the currently active domain.
  315. For example, if a user has this permission and creates a book page on
  316. one.example.com, the user will be given a series of options to assign that
  317. book page to any or all of the registered domains on the site.
  318. If the user does not have this permission, the book page will only be shown
  319. to users who are on http://one.example.com.
  320. - 'Publish content only from the default domain'
  321. - 'Publish content only from assigned domain'
  322. - 'Publish content to any assigned domain'
  323. This group of permission provides a limited set of options for users to create
  324. and edit content on your site. Users who have this permission will have their
  325. node editing forms processed according to the following rules:
  326. -- 'Publish content only from the default domain'
  327. Before being presented the editing form, users will be taken to the root
  328. domain. If the node is not visible on the root domain, the user may not be
  329. able to edit the node.
  330. -- 'Publish content only from assigned domain'
  331. Before being presented the editing form, users will be taken to the
  332. first domain assigned to their user account. This function is most useful
  333. when you users are only allowed to enter content from a single domain.
  334. Note that for users who have more than one assigned domain, this option
  335. will take them to the first match and the user will not be allowed to
  336. change the domain affiliation.
  337. The advantage of this option is the user cannot modify the URL of a
  338. content edit form to match the URL of other domains, forcing all of her
  339. posts to be made to a single domain. Users trying to enter content
  340. from another domain will always be transferred to their assigned domain.
  341. In effect, a user assigned to 'one.example.com' will only be able to post
  342. to that domain, even if she clicks Create Content from two.example.com.
  343. -- 'Publish content to any assigned domain'
  344. The node editing form is shown normally, and the user is presented a
  345. list of checkboxes or a multiple select list. These options represent the
  346. affiliate domains that the user is allowed to publish content to, according
  347. to the domains assigned to their user account.
  348. Note that if this option is selected, users will also be shown a list of
  349. affiliates to which the node is assigned. This list shows only the
  350. affiliates that the user cannot edit.
  351. Warning: If this option is selected and the user has no domain publishing
  352. options, the user will not be allowed to post or edit!
  353. NOTE: Users who are assigned _none_ of these permissions and cannot
  354. 'Set domain access status for all content' will have the default form values
  355. passed as hidden fields. This setting is the default option. It will assign
  356. all content to the domain from which the form is entered.
  357. Note also that the user is not given the ability to promote content to
  358. 'all affiliates'. Users who need this ability should be given the 'set domain
  359. access' permission instead.
  360. This feature was added in response to http://drupal.org/node/188275.
  361. ----
  362. 3.2 Normal Usage
  363. Under a normal Drupal site, a single administrator (or a handful of equally
  364. trusted administrators) typically have the 'Bypass content access control'
  365. permission and individual 'TYPE: edit all content' permissions.
  366. The only choices for permissions would be who gets to administer the module
  367. settings and who gets to assign nodes to specific domains. Generally, only
  368. users who you trust to 'administer site configuration' should be given the
  369. 'Administer domain records and settings' permission. As for 'set domain
  370. access,' that can be given to any user you trust to use the UI properly.
  371. ----
  372. 3.3 Advanced Usage
  373. In the event that you wish to segregate which content certain editors can
  374. control, you should not use the normal 'edit any TYPE nodes' and 'delete any
  375. TYPE nodes' permissions provided by Drupal's core Node module.
  376. These permissions grant the ability for a user to edit and delete all nodes of a
  377. given type.
  378. In the Domain Access model, these permissions are not used in favor of the
  379. provided 'Edit any content on assigned domains' and 'Delete any content on
  380. assigned domains' permissions. These permissions allow editors only to edit
  381. (and delete) nodes that belong to their domain.
  382. To enable this feature, you should grant the 'Edit any content on assigned
  383. domains' and (optionally) the 'Delete any content on assigned domains'
  384. permission to some roles. Then assign individual users accounts to specific
  385. domains to assign them as Domain Editors.
  386. NOTE: Users with the 'Delete any content on assigned domains' permission must
  387. also be given the 'Edit any content on assigned domains' permission in order to
  388. delete content due to the location of the delete form in Drupal.
  389. ----
  390. 3.4 Limitations
  391. Due to the way node_access() works, the following limitations should be noted.
  392. - Any node that is assigned to more than one domain can be edited
  393. by any editor who belongs to one of the domains.
  394. - Users who look at the sites and have the 'Bypass content access control'
  395. permission can always see all content on all sites, which can be confusing.
  396. To enforce Domain Access rules on these users, you may enable the
  397. 'Enforce rules on administrators' setting described in 4.3.3.
  398. - Users who have the 'edit any TYPE nodes' permission will be able to edit
  399. nodes that do not belong to their domain.
  400. These limitations are due to the permissive nature of node_access(). If any
  401. access rule grants you permission, it cannot be taken away.
  402. ----
  403. 4. Module Configuration
  404. The settings for Domain Access are listed under Structure. The path is
  405. 'admin/structure/domain'.
  406. ----
  407. 4.1 Default Domain Settings
  408. These elements define the 'primary' domain for your site. In the event that a
  409. user tries to access an invalid domain, this domain will be used.
  410. ----
  411. 4.1.1 Primary Domain Name
  412. The primary domain for your site. Typically example.com or www.example.com.
  413. Do not use http or slashes. This domain will be used as the default URL for your
  414. site. If an invalid domain is requested, users will be sent to the primary
  415. domain.
  416. Enter the primary domain for your site here. Typically, you will also enter
  417. this value into settings.php for cookie handling. Do not use http:// or a
  418. trailing slash when entering this value.
  419. NOTE: If you have installed Drupal in a subfolder, such as
  420. http://example.com/drupal you should not include the folder path
  421. as part of the primary domain. Simply use example.com -- Drupal
  422. will automatically detect the presence of the subfolder.
  423. NOTE: As of 5.x.1.5 and higher, you may use a port protocol as part
  424. of any domain. So you could set example.com:8080 as the primary
  425. domain name. Note that port protocols will not be stripped, so that
  426. example.com and example.com:8080 are two separate domains.
  427. ----
  428. 4.1.2 Site Name
  429. This value is taken from your system settings and need not be changed. It is
  430. provided to allow readability in the domain list.
  431. ----
  432. 4.1.3 Domain URL Scheme
  433. Allows the site to use 'http' or 'https' as the URL scheme. Default is
  434. 'http'. All links and redirects to root site will use the selected scheme.
  435. ----
  436. 4.2 Creating domain records
  437. As noted above, this screen does not register DNS records with Apache.
  438. Use this screen to register new allowed domains with your site. This
  439. process is especially important for sites using Wildcard DNS, as it prevents
  440. non-registered sites from resolving.
  441. The first domain will use the HTTP_HOST value of the request made
  442. when installing the module. This value may be edited by going to
  443. Admin > Structure > Domains and editing the Primary Domain value.
  444. The second domain will be given the value test.example.com, where
  445. example.com is the Primary Domain value. This domain is set to be
  446. 'inactive' initially. You will need to edit this domain record in order to
  447. use it.
  448. When you create a new domain record, simply fill in the form:
  449. - Domain
  450. This is the full path.example.com, without http:// or a trailing slash.
  451. - Site name
  452. This is the name of the site that will be shown when users access this site.
  453. -- Domain URL scheme
  454. Allows the domain to use 'http' or 'https' as the URL scheme. Default is
  455. 'http'. All links and redirects to the domain will use the selected scheme.
  456. -- Domain status
  457. By default, all domains are Active and anyone can navigate to them. Setting
  458. a domain to Inactive restricts access to users with the 'access inactive
  459. domains' permission. This feature is useful for staging content and testing
  460. new domain configurations.
  461. NOTE: Users who try to access an inactive domain will have the attempt
  462. reported in the site logs. When this occurs, the module will try to redirect
  463. the user to the appropriate content on an active domain. If no match is
  464. found, the user is send to the default home page.
  465. Both the Domain and the Site name are required to be unique values.
  466. After you create a record, you may edit or delete it as you see fit.
  467. NOTE: As a result of module installation, you will never have a Domain with
  468. the domain_id of 1 if you did not use Domain Access prior to 6.x.2.0. This
  469. is by design and will not affect the module.
  470. NOTE: When editing a domain record, Domain Access runs an http request
  471. to see if the domain is responding properly. This test checks for the presence
  472. of the file '200.png' inside the module's 'test' directory.
  473. If a 200 "found" reply is not returned, you will see an message warning you
  474. that your DNS may not be configured properly. This message is intended
  475. to help you debug your DNS configuration and may be safely ignored.
  476. NOTE: Users who attempt to access an unregistered domain will be
  477. redirected to the primary domain automatically.
  478. ----
  479. 4.2.1 Restricted Characters in Domains
  480. When creating a domain record, you are restricted to the valid character set
  481. for Internet domain names. By design, this includes only the ASCII
  482. alphanumeric character set (a-z 0-9) plus the special characters dot (.)
  483. dash (-) and colon (:). A colon may only be followed by a port number.
  484. Domains must be lowercase. Domain matching with HTTP_HOST is not
  485. case-sensitive.
  486. With the advent of Internationalized Domain Names (IDNs), domain servers
  487. are beginning to recognize non-ASCII domain names. To enable support for
  488. non-ASCII domain names, you must add the following lines to the bottom
  489. of your settings.php file:
  490. // Allow registration of non-ASCII domain strings.
  491. $conf['domain_allow_non_ascii'] = TRUE;
  492. For background, see the following:
  493. http://tools.ietf.org/html/rfc819
  494. http://tools.ietf.org/html/rfc1035
  495. http://en.wikipedia.org/wiki/Internationalized_domain_name
  496. http://blog.icann.org/2010/05/idn-cctlds/
  497. ----
  498. 4.2.2 Altering Domain Name Validation
  499. If you wish to enforce special business rules for domain name validation,
  500. you may implement hook_domain_validate_alter() in your module.
  501. This hook will allow your module to intercept and alter any errors found
  502. by the normal domain validation process. See domain.api.php for details.
  503. ----
  504. 4.3 Domain Module Behaviors
  505. These options affect the basic options for how the module behaves.
  506. ----
  507. 4.3.1 New Content Settings
  508. Defines the default behavior for content added to your site. By design, the
  509. module automatically assigns all content to the currently active domain.
  510. If this value is set to 'Show on all sites,' then all new content will be
  511. assigned to all sites _in addition to_ the active domain.
  512. If you set this value to 'Only show on selected sites,' you will be shown
  513. configuration options per node type, as described in 4.3.1.1.
  514. ----
  515. 4.3.1.1 Send to All Affiliates
  516. This setting presents a list of all active node types on your site. By
  517. checking the box, nodes for that given type will automatically be assigned to
  518. 'all affiliate sites' during node creation and editing.
  519. This setting is only used if the New Content Settings are set to "Only
  520. show on selected sites."
  521. ----
  522. 4.3.2 Debugging Status
  523. If enabled, this will append node access information to the bottom of each
  524. node. This data is only viewable by uses with the 'Set domain access status for
  525. all content' privilege. It is provided for debugging, since 'administer nodes'
  526. will make all nodes viewable to some users.
  527. ----
  528. 4.3.3 Enforce Rules on Administrators
  529. When using Node Access modules, user 1 (the super-admin) and users with
  530. the 'Bypass content access control' permission are not subject to node access
  531. rules. This is a design feature of Drupal, and it can lead to confusion when
  532. viewing your site as an administrator.
  533. To help with this confusion, the 'Enforce rules on administrators' setting can
  534. be enabled. This setting forces Domain Access rules to be applied _even to
  535. users who can Bypass content access control_.
  536. The default setting is OFF, but if you regularly login as user 1 or a user with
  537. the 'Bypass content access control' permission, you may want to enable this
  538. feature.
  539. NOTE: This feature _only_ applies Domain Access rules. if you are using
  540. multiple node access modules, not all rules will be applied.
  541. ----
  542. 4.3.4 Domain List Size
  543. Sets a break point for the size of domain lists shown to users. If you have a
  544. large number of domains (e.g. more than 20), you may set this value to
  545. allow for pagination and truncation of domain lists.
  546. ----
  547. 4.3.5 Display in Vertical Tabs
  548. When set to 'Yes', places the Domain options in a vertical tab on the node
  549. editing form.
  550. ----
  551. 4.3.6 Domain Selection Format
  552. Controls the form element display when choosing a list of domains. By
  553. default, Domain Access shows checkboxes, but if your site has a large
  554. number of domains, checkboxes hinder usability. You may use this setting
  555. to force domain lists to be displayed as multiple select lists instead.
  556. By default, if you have more than 25 domains, a select list will be used
  557. for your forms, but you may use this setting to alter that behavior.
  558. ----
  559. 4.4 Advanced Settings
  560. These settings control advanced features for the module. Some of these
  561. features require patches to Drupal core. Please read the documentation
  562. carefully before implementing these features.
  563. NOTE: Some of these options may be disabled in the event that patches
  564. have not been applied.
  565. By default, these features are all disabled.
  566. ----
  567. 4.4.1 Search Settings
  568. Allows the admin to decide if content searches should be run across all
  569. affiliates or just the currently active domain. By design, Drupal will only
  570. find matches for the current domain.
  571. ----
  572. 4.4.2 Search Engine Optimization
  573. There is a risk with these modules that your site could be penalized by search
  574. engines such as Google for having duplicate content. This setting controls the
  575. behavior of URLs written for nodes on your affiliated sites.
  576. - If SEO settings are turned on, all node links are rewritten as absolute
  577. URLs.
  578. - If assigned to 'all affiliates' the node link goes to the 'default source
  579. domain' defined in 4.4.3. Normally. this is your primary domain.
  580. - If assigned to a single affiliate, the node link goes to that affiliate.
  581. - If assigned to multiple affiliates, the node link goes to the first
  582. matching domain.
  583. (Determined by the order in which domains were created, with your primary
  584. domain matched first.)
  585. The optional Domain Source module (included in the download) allows you to
  586. assign the link to specific domains.
  587. ----
  588. 4.4.3 Default Source Domain
  589. This setting allows you to control the domain to use when rewriting links that
  590. are sent to 'all affiliates.' Simply select the domain that you wish to use as
  591. the primary domain for URL rewrites.
  592. NOTE: This option only fires if you enable SEO rewrites or use the provided
  593. Domain Source module.
  594. By default this value is your primary domain.
  595. ----
  596. 4.4.4 WWW Prefix Handling
  597. This setting controls how requests to www.example.com are treated with
  598. respect to example.com. The default behavior is to process all host names
  599. against the registered domain list.
  600. If you set this value to 'Treat www.*.example.com as an
  601. alias of *.example.com' then all host requests will have the 'www.' string
  602. stripped before the domain lookup is processed.
  603. Users going to a www.one.example.com in this case will not automatically
  604. be sent to one.example.com, but your Drupal site will behave as if they
  605. had requested one.example.com.
  606. This feature was requested by Rick and Matt at DZone.com
  607. ----
  608. 4.5 Special Page Requests
  609. For this feature to work, you must follow the instructions in INSTALL.txt
  610. regarding custom_url_rewrite_outbound(). If you have not followed the
  611. instructions, you should see a warning at the top of the Admin > Structure >
  612. Domains page.
  613. In normal uses, such as the default home page, you want to restrict access
  614. to content based on the active domain. However, in certain cases, this
  615. behavior is not desired.
  616. Take the Track page for each user, for example. The Track page is at
  617. 'user/UID/track' and shows a list of all posts by that user. By design, this
  618. page may show different results if seen from different domains:
  619. -- one.example.com/user/1/track
  620. Shows all posts by user 1 assigned to the domain one.example.com
  621. -- two.example.com/user/1/track
  622. Shows all posts by user 1 assigned to the domain two.example.com
  623. The behavior we really want is to show ALL posts by the user regardless of
  624. the active domain.
  625. The Special Page Requests setting lets you specify Drupal paths for which
  626. this behavior is active. These paths are entered in the same way as block
  627. settings for page visibility.
  628. Some sample pages that might require this setting. Note, some of these
  629. are contributed modules:
  630. -- user/*/track
  631. -- blog/* -- the user blog page
  632. -- mysite/* -- the MySite module
  633. -- popular/alltime -- a View page
  634. -- popular/latest -- a View page
  635. -- taxonomy/term/* -- to show all taxonomy terms at all times
  636. -- taxonomy/term/10 -- to show only term 10 at all times
  637. -- taxonomy/term/*/feed/* -- all taxonomy term feeds
  638. Default and custom Views are often good candidates here as well.
  639. By default, 'user/*/track' is in this list.
  640. The logic for how these links are written is documented in 4.4.2 Search Engine
  641. Optimization.
  642. Note that the 'search' path is handled separately and need not be added here.
  643. ----
  644. 4.5.1 Cron Handling
  645. When Drupal's cron function runs, it runs on a specific domain. This forces
  646. Domain Access to invoke its access control rules, which may not be desired.
  647. In most use cases, you will want Domain Access to allow access to all nodes
  648. during cron runs. For modules such as Subscriptions, this behavior is
  649. required unless all your content is assigned to "all affiliates."
  650. To reflect this, Domain Access provides a configuration option labeled:
  651. [x] Treat cron.php as a special page request
  652. This option is turned on by default. In almost all cases, you should leave
  653. this option checked. Doing so allows Domain Access to ignore access checks
  654. for nodes when cron runs.
  655. Note that this does not affect node access permissions set by other modules.
  656. ----
  657. 4.5.2 XMLRPC Handling
  658. Similar to the above, you may check this option to disable Domain Access
  659. rules when Drupal is invoked using XMLRPC.
  660. ----
  661. 4.6 Node Link Patterns
  662. When using this module, there are times when Domain Access will need to
  663. rewrite a node link using custom_url_rewrite_outbound().
  664. Since Drupal is an extensible system, we cannot account for all possible
  665. links to specific nodes. Node Link Patterns are designed to allow you to
  666. extend the module as you add new contributed modules.
  667. By default, the following core link paths will be rewritten as needed.
  668. -- node/%n
  669. -- comment/reply/%n
  670. -- node/add/book/parent/%n
  671. -- book/export/html/%n
  672. -- node/%n/outline
  673. Where %n is a placeholder for the node id.
  674. If you install additional modules such as Forward
  675. (http://drupal.org/project/forward)
  676. or Print
  677. (http://drupal.org/project/print)
  678. you will want to add their paths to this list:
  679. -- forward/%n
  680. -- print/%n
  681. This is an advanced, but necessary feature. Please report any core node path
  682. omissions at http://drupal.org/project/issues/domain.
  683. ----
  684. 4.7 Domain List
  685. This screen shows all active domains registered for use with the site.
  686. From this screen, you may set the default domain, activate or inactivate
  687. domains or view to the settings for individual domains.
  688. ----
  689. 4.8 Batch Updating
  690. The module provides for batch actions for common tasks. These actions are
  691. useful for making rapid changes across all domains. The following actions
  692. are available by default.
  693. - Edit all domain values
  694. - Edit all site names
  695. - Edit all URL schemes
  696. - Edit all domain status flags
  697. Additional batch actions are made available for the Domain Configuration
  698. module. Other modules may implement hook_domain_batch() to provide
  699. additional batch actions.
  700. It may be necessary to enter the batch form from the primary domain.
  701. For some settings, you may see an 'Update value for all domains' section
  702. of the form. You may use this value to reset all domains to the same
  703. setting. This option is not available for settings that must be unique
  704. per domain, such as the domain string.
  705. For global settings to apply, you must check the 'Apply to all domains'
  706. box before submitting the form.
  707. ----
  708. 4.9 Assigning Users to Domains
  709. New in 6.x.2 is the concept of 'user defaults.' These settings are used to
  710. assign users to domains based on the user's site roles.
  711. Click on the 'User defaults' tab to see the settings available.
  712. By design, these settings are always added to a user's domains when a page
  713. is requested. That is, if you assign all 'authenticated users' to your first
  714. domain, one.example.com, then all authenticated users will be assigned to that
  715. domain.
  716. This setting is most useful under the following conditions:
  717. -- If you let anonymous users post content on your site. In this case, you
  718. should assign at least one domain to the anonymous user role, so that
  719. the module will assign anonymous posts to the appropriate domain(s).
  720. -- If you use Domain Strict, you can use this setting to assign default
  721. access to specific roles.
  722. Note that there are two options for how this setting behaves:
  723. -- Add default roles dynamically [default]
  724. This setting is the normal use and does not write individual records to the
  725. {domain_editor} table. Use this setting if you want to change options for
  726. each role quickly, as these are global settings, so taking away a domain
  727. will instantly apply to all users.
  728. -- Add default roles to the user account
  729. Use this setting if you want to automatically register users to specific
  730. domains or to save changes to a batch of users. When this setting is
  731. active, domain assignments are saved permanently to the {domain_editor}
  732. table and can only be removed by editing the user account.
  733. You may also assign default domains for all new users of your site. To do
  734. so, simply select the domains that new users should be assigned to. If you
  735. make no selection, new users will automatically be assigned to the domain
  736. from which they enter the registration form.
  737. Settings for the 'new user' are permanently saved to the user account.
  738. See http://drupal.org/node/313629 for some background about this feature.
  739. ----
  740. 4.10 Batch Assignment of Users to Domains
  741. In 6.x.2 and higher, users with the 'administer users' and 'assign domain
  742. editors' permissions may use the User administration page to batch assign
  743. users to domains.
  744. This feature is useful if you need to convert a group of editorial users to
  745. become domain editors.
  746. To use this feature, navigate to Administer > User management > Users.
  747. Look for the 'Assign users to domains' option in the 'Update options' select
  748. form. Choose this operation and then use the 'Affiliate editor options'
  749. fieldset to select the domains you wish to assign users to.
  750. Select the desired users and hit the Update button.
  751. Note that this form also shows you a list of domains that a user is
  752. currently assigned to.
  753. If these elements do not appear, you do not have the proper permissions.
  754. ----
  755. 4.10.1 Form Behavior
  756. In 6.x.2.5 and higher, you may select one of two options when updating domains.
  757. Under the 'Update behavior' form element, you may choose:
  758. [] Replace old values with new settings
  759. [] Add new settings to existing values
  760. [] Remove selected domains from existing values
  761. Choosing 'replace' will erase any current domain affiliation for the selected
  762. users and replace them with those entered into the form. Choosing 'add' will
  763. merge the new values with the existing values. Choosing 'remove' will remove the
  764. new values from the existing ones.
  765. This new feature is helpful when you want to alter domain settings, but do not
  766. want all users to be assigned to the same domains.
  767. ----
  768. 5. Blocks
  769. The Domain Access module provides two blocks, which can be used to help you
  770. debug your use of the module.
  771. ----
  772. 5.1 Block -- Domain Switcher
  773. The Domain Switcher block presents a list of all active domains. Clicking
  774. on one of the links will take you from your current URL to the same URL on
  775. the selected domain.
  776. For example, if you are looking at example.com/?q=node and click on another
  777. domain, the link will take you to one.example.com/?q=node.
  778. In the Domain Switcher block, domains are listed using their human-readable
  779. sitename variables.
  780. NOTE: This block is for debugging purposes. The included Domain Navigation
  781. module provides block and menu items intended for end users.
  782. ----
  783. 5.2 Block -- Domain Access Information
  784. The Domain Access Information block lets you view node access rules for any
  785. node when you are viewing that node. This block can help you debug the
  786. module for user accounts that do not have the 'Set domain access status for all content' permission.
  787. NOTE: By design, this block is viewable by all users. However, its content
  788. should only be shown to site developers or during debugging. You should use
  789. the normal block visibility settings as appropriate to your site.
  790. ----
  791. 6. Node Access
  792. The Domain Access module is a node_access() module. For additional developer
  793. information, see http://api.drupal.org/api/group/node_access/5.
  794. By design, the module sets access to content based on the current domain that
  795. a user is viewing. If a user is at one.example.com, they can see content that
  796. is assigned to that domain or to all domains.
  797. ----
  798. 6.1 Assigning Domain Access
  799. Users who have the 'Set domain access status for all content' permission can
  800. assign any node to any or all registered sites. During node editing, a series
  801. of options will be displayed as checkboxes or a multiple select list under the
  802. heading "Domain access options":
  803. Publishing options:
  804. [] Send to all affiliates
  805. Select if this content can be shown to all affiliates. This setting will
  806. override the options below.
  807. Publish to: * (required)
  808. [] Drupal
  809. [] One site
  810. [] Two site
  811. Select which affiliates can access this content.
  812. If you select 'Send to all affiliates,' the node will be viewable on all domains
  813. for your site. Even if you select this option, you must select at least one
  814. domain for the node.
  815. If you do not select at least one option, the module will automatically
  816. assign the node to your default domain.
  817. When creating new content, the currently active domain will be selected for you.
  818. For users who do not have the 'Set domain access status for all content'
  819. permission, the assignment will be done through a hidden form element. The node
  820. will be assigned to the currently active domain or, if configured, to all
  821. domains.
  822. ----
  823. 6.2. Editor Access
  824. Whenever a user account is created and the Domain Access module is active, user
  825. accounts will automatically be tagged with the name of the active domain from
  826. which they registered their account. Users with the 'Set domain access status
  827. for all content' permission may assign individual users to specific domains in
  828. the same way that nodes can be defined.
  829. These user settings are used to determine what domains an editor belongs to.
  830. Users with the 'Edit any content on assigned domains' permission can edit any
  831. node that belongs to the same domain that the user does. (Remember that users
  832. and nodes can both belong to multiple domains.) However, nodes that are
  833. assigned to 'all affiliates' do not grant editing privileges to all editors.
  834. ----
  835. 6.3 Realms
  836. This section contains technical details about Drupal's node access system.
  837. In Domain Access, the following realms are defined:
  838. - domain_all
  839. Indicates whether the view grant should be passed for all nodes on
  840. a given page request. Used in cases such as Search and MySite to
  841. enable aggregation of content across affiliates. The only valid nid
  842. and gid for this grant are zero (0).
  843. - domain_site
  844. Indicates whether a node is assigned to all affiliates. The only valid
  845. grant id for this realm is zero (0).
  846. - domain_id
  847. Indicates that a node belongs to one or more registered domains. The
  848. domain_id key is taken from the {domain} table and is unique.
  849. ----
  850. 6.4 Grants
  851. In each of the realms, there are specific rules for node access grants, as
  852. follows.
  853. - domain_all
  854. In some specific cases, like Search or the user's Tracker page we want people
  855. to be able to see content across all affiliates. Only the domain_all grant is
  856. assigned in these cases. This grants only 'grant_view'.
  857. - domain_site
  858. By design, all site users, including anonymous users, are granted access to
  859. the gid '0' for realm 'domain_site'. This grant allows all users to see
  860. content assigned to 'all affiliates'. This grants 'grant_view' to all users.
  861. Users who belong to the current domain and are assigned the
  862. 'Edit any content on assigned domains' or 'Delete any content on assigned
  863. domains' permissions will be given 'update' and 'delete' grants, respectively.
  864. - domain_id
  865. When a user, including anonymous users, views a page, the active domain is
  866. identified by the registered domain_id. For that page view, the user is
  867. granted gid of the active domain_id for the realm 'domain_id'. This allows
  868. content to be partitioned to one or many affiliates. This grants only
  869. 'grant_view', since 'grant_edit' would allow content to appear to some users
  870. regardless of the active domain.
  871. ----
  872. 6.5 Warnings
  873. Node access in Drupal is a permissive system. Once a grant has been issued, it
  874. cannot be revoked. As a result, it is possible for multiple editors to be able
  875. to edit or delete a single node. Here's the use case:
  876. - Node 10 (a book page) is assigned to one.example.com and three.example.com
  877. - User A is an editor for one.example.com.
  878. - User B is an editor for two.example.com
  879. - User C is an editor for three.example.com
  880. Under this scenario, User A and User C will be able to edit node 10.
  881. To be more clear about Drupal permissions:
  882. - User D has 'Bypass content access control' permission for the site.
  883. - User E has the 'Book page: edit all content' permission for the site.
  884. In this case, User D and User E can also edit or delete node 10. This is why
  885. only super-admins are given 'Bypass content access control' and 'TYPE: edit all
  886. content' permissions with the Domain Access module. If you want your affiliate
  887. editors to have limited permissions, only grant them 'Edit any content on
  888. assigned domains'.
  889. However, you still need to give users the 'TYPE: Create new content' permission
  890. normally. Domain Access does not affect node creation.
  891. Since Domain Access implements node_access() fully, if you uninstall the module
  892. -- using Drupal's uninstall sequence -- all node_access entries should be reset
  893. to grant 'grant_view' to realm 'all' with gid '0'.
  894. ----
  895. 7. Developer Notes
  896. The Domain Access module is meant to be the core module for a system of small
  897. modules which add functionality.
  898. ----
  899. 7.1 Extension Modules
  900. Currently, the following modules are included in the download. They are not
  901. required, but each adds functionality to the core module.
  902. - Domain Alias -- Allows advanced handling of domain name matching. Use
  903. this module to treat multiple domains as though they were identical.
  904. - Domain Configuration -- Allows you to change select system variables for
  905. each domain, such as offline status, footer message and default home
  906. page.
  907. - Domain Content -- Provides a content administration page for each domain,
  908. so that affiliate editors can administer content for their section of the
  909. site.
  910. - Domain Navigation -- Supplies a navigation block with three themes. Creates
  911. menu items for each domain, suitable for using as primary or secondary
  912. links.
  913. - Domain Prefix -- A powerful module that allows for selective table prefixing
  914. for each domain in your installation.
  915. - Domain Source -- Allows editors to specify a primary "source" domain to be
  916. used when linking to content from another domain.
  917. - Domain Strict -- Forces users to be assigned to a domain in order to view
  918. content on that domain. Note that anonymous users may only see content
  919. assigned to "all affiliates" if this module is enabled.
  920. - Domain Theme -- Allows separate themes for each domain.
  921. - Domain User -- Allows the creation of specific subdomains for each active
  922. site user.
  923. - Domain Views -- Provides a Views filter for the Domain Access module.
  924. ----
  925. 7.2 The $_domain Global
  926. NOTE: In Drupal 7, this value is deprecated. You should use domain_get_domain()
  927. to return the active domain.
  928. During hook_init(), the Domain Access module creates a new global variable,
  929. $_domain, which can be used by other Drupal elements (themes, blocks, modules).
  930. The $_domain global is an array of data taken from the {domain} table for the
  931. currently active domain. If no active domain is found, default values are used.
  932. The default domain is marked in the {domain} table 'is_default' column.
  933. Some uses for this global variable might include:
  934. - Block placement based on active domain (using PHP for block visibility).
  935. - Ad tags inserted based on active domain.
  936. - Theme switching based on domain.
  937. The 'error' element is new in 6.x.2 and is used to signal installation problems.
  938. Normally the 'error' element should not be set. See the API documentation of
  939. hook_domain_bootstrap_full() for details.
  940. ----
  941. 7.3 Database Schema
  942. The Domain Access module creates two tables in a Drupal installation. {domain}
  943. contains the following structure:
  944. - domain_id
  945. Integer, unique, auto-incrementing.
  946. The primary key for all domain records.
  947. - subdomain
  948. Varchar, 80, unique (enforced by code)
  949. 'Domain' is a sql-reserved word, so subdomain is used. This value must match
  950. the url 'host' string derived from parse_url() on the current page request.
  951. - sitename
  952. Varchar, 80, unique (enforced by code)
  953. The name for this affiliate, used for readability.
  954. - scheme
  955. Varchar, 8 default 'http'
  956. Indicates the URL scheme to use when accessing this domain. Allowed values,
  957. are currently 'http' and 'https'.
  958. - valid
  959. Char, 1 default 1
  960. Indicates that this domain is active and can be accessed by site users.
  961. - weight
  962. Integer, default 0
  963. The sort value for the domain. Signed integer, with lower being higher in a
  964. list.
  965. - is_default
  966. Char, 1 default 0
  967. Indicates that this domain is the default.
  968. The {domain_access} table is a partial mirror of the {node_access} table and
  969. stores information specific to Domain Access. Its structure is:
  970. - nid
  971. Integer, unsigned NOT NULL default '0,
  972. - gid
  973. Integer, unsigned NOT NULL default '0'
  974. - realm
  975. Varchar, 255 NOT NULL default ''
  976. The {domain_editor} table stores information about which users can edit and
  977. delete content on specific domains. Its structure is:
  978. - uid
  979. Integer, unsigned NOT NULL default '0,
  980. A foreign key to the {users} table.
  981. - domain_id
  982. Integer, unsigned NOT NULL default '0'
  983. A foreign key to the {domain} table.
  984. ----
  985. 7.4 API
  986. The Domain Access module has an API for internal module hooks. Documentation is
  987. included in the download as domain.api.php and can be viewed online at:
  988. http://therickards.com/api
  989. The most important developer functions are the internal module hooks:
  990. http://therickards.com/api/group/hooks/Domain
  991. ----
  992. 7.5 Domain Tokens
  993. The module provides the following replacement tokens.
  994. 'current-domain:id'
  995. The current domain ID.
  996. 'current-domain:name'
  997. The current domain name, lower-cased and with only alphanumeric characters.
  998. 'current-domain:url'
  999. The current domain's URL, lower-cased and with only alphanumeric characters.
  1000. 'current-domain:subdomain'
  1001. The current subdomain, lower-cased and with only alphanumeric characters.
  1002. Only works with *.example.com formats
  1003. 'default-domain:id'
  1004. The default domain ID.
  1005. 'default-domain:name'
  1006. The default domain name, lower-cased and with only alphanumeric characters.
  1007. 'default-domain:url'
  1008. The default domain\'s URL, lower-cased and with only alphanumeric characters.
  1009. 'default-domain:subdomain'
  1010. The default subdomain, lower-cased and with only alphanumeric characters.
  1011. Only works with *.example.com formats
  1012. ----
  1013. 8. Drush commands
  1014. Domain Access supports Drush version 3.x. The following commands are available.
  1015. Type 'drush help' for more information.
  1016. 'drush domain-list'
  1017. Shows a table of the domains registered for your site. You may use 'drush
  1018. domains' as a shortcut command.
  1019. 'drush domain-add DOMAIN SITENAME --options'
  1020. Add a new domain to your site. The DOMAIN parameter is required and must be
  1021. unique and validly formed (e.g. example.com). Possible options are:
  1022. --inactive=1/0
  1023. Set the domain to inactive by passing 1. Default is 0.
  1024. --https=1/0
  1025. Set the domain to use https instead of http by passing 1. Default is 0.
  1026. --weight=X
  1027. Set the weight of the domain to an integer value. Default is 0.
  1028. --is_default=1/0
  1029. Set the domain as the default domain.
  1030. Sample command:
  1031. drush domain-add example.com 'My New Site' --https=1
  1032. Will create the domain:
  1033. sitename: My New Site
  1034. subdomain: example.com
  1035. valid: yes
  1036. scheme: https://
  1037. weight: 0
  1038. is_default: 0
  1039. 'drush generate-domains BASE_DOMAIN --count=15'
  1040. Auto-generate a set of domains for testing. Aliased to 'drush gend'. Will use
  1041. the provided BASE_DOMAIN as the primary domain, defaulting to 'example.com'.
  1042. This command creates domains in the format *.BASE_DOMAIN. The BASE_DOMAIN
  1043. must be properly formed. By default, the command will create 15 new domains,
  1044. but you may specify the number using --count=X.
  1045. The domains created are the words one through ten (1-10), foo, bar, baz, and
  1046. the non-matching domain 'myBASE_DOMAIN', which is used for cookie testing.
  1047. Site names are simple uppercase versions of the 3rd-level domain element.
  1048. All domains are set to use http:// and are set as valid. Weighting is
  1049. auto-incremented by creation order.
  1050. Creating more than 15 domains will begin incrementing domains with numeric
  1051. 3rd-level elements, such as 20.BASE_DOMAIN.
  1052. The purpose of this command is to help me in UX testing, since many aspects
  1053. of the user interface must change to accommodate large numbers of domains.
  1054. The defaults are optimized for my development environment, and will not be
  1055. altered.
  1056. Sample command:
  1057. drush gend example.com --count=20
  1058. 'drush domain-delete DOMAIN|DOMAIN_ID'
  1059. Deletes a domain record, unless it is set as the primary domain.
  1060. You may pass either the domain string (e.g. example.com) or the domain_id
  1061. as an argument.
  1062. Sample command:
  1063. drush domain-delete 3
  1064. drush domain-delete three.example.com
  1065. 'drush domain-test DOMAIN|DOMAIN_ID'
  1066. Checks for a valid HTTP response from the specified domain. This test is
  1067. used when trying to set default domains, since the default domain must
  1068. always resolve.
  1069. If you do not pass a domain string or domain_id, all domains will be
  1070. tested. Note that if you run Drupal in a subdirectory, you must pass a
  1071. --uri value with this command.
  1072. Sample command:
  1073. drush domain-test 3
  1074. drush domain-test three.example.com
  1075. drush domain-test three.example.com --uri=http://example.com/subdir/
  1076. 'drush domain-default DOMAIN|DOMAIN_ID'
  1077. Sets the specified domain as the default domain. By design, this command
  1078. will test the requested domain for a valid HTTP response. You may disable
  1079. this check by passing --skip_check=1 to the command.
  1080. Note that if you run Drupal in a subdirectory, you must pass a
  1081. --uri value with this command in order to test the HTTP response.
  1082. Sample command:
  1083. drush domain-default 3
  1084. drush domain-default three.example.com
  1085. drush domain-default three.example.com --uri=http://example.com/subdir/