You are here

README.txt in Domain Access 5

README file for Domain User.

File

domain_user/README.txt
View source
  1. /**
  2. * @file
  3. * README file for Domain User.
  4. */
  5. Domain User
  6. Creates unique subdomains for registered users.
  7. CONTENTS
  8. --------
  9. 1. Introduction
  10. 2. Installation
  11. 2.1 Dependencies
  12. 2.2 Domain User and User Registration
  13. 3. Permissions
  14. 3.1 Edit Domain Nodes
  15. 4. Configuration Options
  16. 4.1 Module Behavior
  17. 4.2 Root Domain Name
  18. 4.3 User Domain URL Scheme
  19. 4.4 User Login Behavior
  20. 4.5 Domain Table Prefixing *
  21. 4.6 Reserved Usernames
  22. 4.7 Domain Settings Page
  23. 5. Developer Notes
  24. 5.1 hook_user() Implementation
  25. 5.2 Domain API Hooks
  26. 5.3 Database Schema
  27. * Requires the Domain Prefix module.
  28. ----
  29. 1. Introduction
  30. The Domain User module is a node access module that allows for the automatic
  31. creation of subdomains for your users.
  32. By design, this module will allow user "JohnDoe" to create the following active
  33. domain:
  34. johndoe.example.com
  35. Note that all non-alphanumeric characters will be replaced with a dash, so that
  36. the user "John Doe 222" will create the subdomain:
  37. john-doe-222.example.com
  38. I recommend that you set the "Content editing forms" setting in the main Domain
  39. module to "Take user to their assigned domain." Doing so will force all content
  40. that a user creates to be assigned to his or her personal domain.
  41. Please read the documentation for the main Domain Access module carefully before
  42. you attempt to install and use this module.
  43. This module is not intended for use if you do not wish to perform node access
  44. control. It is not suitable simply for creating subdomains for your users.
  45. ----
  46. 2. Installation
  47. Domain User is included in the Domain Access download. To install,
  48. untar the domain package and place the entire folder in your modules directory.
  49. When you enable the module, it will create a {domain_user} table in your
  50. Drupal database.
  51. ----
  52. 2.1 Dependencies
  53. Domain User requires the Domain Access module be installed and active.
  54. ----
  55. 2.2 Domain User and User Registration
  56. Because Domain User tries to create subdomains for your users, the module could
  57. cause a conflict if you have previously created domains for your site.
  58. For example, you have used the Domain Access module to create the following:
  59. -- boston.example.com
  60. -- newyork.example.com
  61. -- sydney.example.com
  62. If a user tries to register for your site using the username "boston" or
  63. "sydney," the Domain User module would try to create a domain that already
  64. exists.
  65. To prevent this issue, previously created domains also create records in the
  66. Drupal {access} table. This table stores the rules for creating usernames when
  67. registering for your site.
  68. In effect, any domain that exists places a username restriction rule into your
  69. Drupal configuration. You can see the list of these "Reserved Usernames" on
  70. the Domain User settings page.
  71. ----
  72. 3. Permissions
  73. Domain User adds one permission to your Access Control page:
  74. -- 'create personal domain'
  75. Only roles that have this permission can create personal subdomains.
  76. If you want users to be able to create subdomains when they register, you must
  77. give this permission to the 'anonymous users' role and to the 'authenticated
  78. users' role.
  79. If you are assigning additional roles during account creation, you may also need
  80. to grant the 'create personal domain' permission to those roles as well.
  81. Users with this permission will have their personal domain created either:
  82. on registration or on updating their account.
  83. ----
  84. 3.1 Edit Domain Nodes
  85. By design, all users will be assigned to the Domain that they create. This
  86. grants them access to edit nodes posted to their domain. To enable this
  87. feature, a user must have the "edit domain nodes" permission granted by
  88. the core Domain Access module.
  89. ----
  90. 4. Configuration Options
  91. Domain User has its own settings page at Admin > Build > Domains > User
  92. domain settings. The following options are available.
  93. ----
  94. 4.1 Module Behavior
  95. Controls when (and if) user domains should be created. The following options
  96. are available:
  97. -- Do not create domains for users [Default]
  98. -- Automatically create domains for new users
  99. -- Ask users if they would like to create a domain
  100. Note that "do not create" is the default setting. This prevents domains from
  101. being created before you finish configuring the module.
  102. If you select "ask users," then a checkbox option will appear to users during
  103. registration (or account editing) if the following conditions are true:
  104. -- The user has permission to create a domain.
  105. -- The user has not created a personal domain.
  106. Note that currently there is no way for a user to delete their own domain. If
  107. a user account is blocked, access to the user domain is blocked. If a user
  108. account is deleted, the user domain record is also deleted.
  109. ----
  110. 4.2 Root Domain Name
  111. The root domain to use for creating user domains, typically example.com. No
  112. http or slashes.
  113. When users create domains, their username will be added to the root domain to
  114. create a custom domain. For example, user.example.com or administrator.example.com.
  115. All user domains follow the pattern:
  116. username.example.com
  117. Where example.com is the "Root domain name" configured here.
  118. In theory, you may use a multi-level domain scheme here, such as:
  119. username.personal.example.com
  120. When entering your root domain, you should not include the username
  121. string.
  122. WARNING: Your web server must be configured to recognize these domains
  123. for them to function. Wildcard DNS is the preferred solution for handling
  124. user domains.
  125. ----
  126. 4.3 User Domain URL Scheme
  127. Allows user domains to be prefixed with either http:// or https:// protocols.
  128. Note that all user domains will be created using the same scheme.
  129. Changing this setting will _not_ affect domains created prior to the change.
  130. ----
  131. 4.4 User Login Behavior
  132. Controls the behavior of the module when a user with an existing personal
  133. domain logs in to the site. Options are:
  134. -- On login, go to personal domain [Default]
  135. -- Do not go to personal domain on login
  136. Because of how Drupal login works, this feature uses a session variable to
  137. trigger the redirect.
  138. ----
  139. 4.5 Domain Table Prefixing *
  140. This setting is only available if you have the Domain Prefix module turned on.
  141. Since Domain Prefix is a powerful module that creates extra database tables,
  142. you have the option to selectively disable that module for user-created domains.
  143. Options are:
  144. -- Never create prefixed tabled for user domains [Default]
  145. -- Obey the settings in Domain Prefix
  146. Note that "obey the settings" may not create tables when the domain is created,
  147. since Domain Prefix has its own behavior settings.
  148. ----
  149. 4.6 Reserved Usernames
  150. At the bottom of the Domain User settings page is a list of all reserved
  151. usernames. This list is derived from the administrator-created list of domains.
  152. Users should not be able to register or login with any username listed here.
  153. ----
  154. 4.7 Domain List Page
  155. Note that on the main Domain list page at Admin > Build > Domains > Domain
  156. list, a new column is added to the domain table. This column shows the username
  157. of the
  158. ----
  159. 5. Developer Notes
  160. This module has been tested for base functionality. There may be edge cases
  161. that it does not properly address.
  162. Please file bug reports if you encounter any problems.
  163. ----
  164. 5.1 hook_user() Implementation
  165. Domain User implements hook_user() to perform many of its functions. The
  166. module also will add a 'Personal web site' element to the user profile of any
  167. user who has created a personal domain.
  168. ----
  169. 5.2 Domain API Hooks
  170. Domain User leverages some of the internal APIs of the Domain Access module.
  171. -- domain_user_domainload() adds the UID to the global $_domain array and
  172. to all $domain lookups.
  173. -- domain_user_domainupdate() implements the 'delete' hook in order to
  174. delete records from {domain_user} in the event that the administrator
  175. deletes a user domain record.
  176. -- domain_user_domainview() adds the additional information column to the
  177. Domain list page.
  178. For more information, see http://therickards.com/api/group/hooks/Domain
  179. ----
  180. 5.3 Database Schema
  181. Installing the module creates a {domain_user} table that contains:
  182. - domain_id
  183. Integer, unique (enforced by code)
  184. The lookup key for this record, foreign key to the {domain} table.
  185. - uid
  186. Integer, unique (enforced by code)
  187. The lookup key for this record, foreign key to the {users} table.