You are here

README.txt in Domain Access 6.2

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