/[drupal]/contributions/modules/nf_registration_mod/README.txt
ViewVC logotype

Contents of /contributions/modules/nf_registration_mod/README.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (show annotations) (download)
Mon Dec 3 21:00:00 2007 UTC (23 months, 3 weeks ago) by rconstantine
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +3 -0 lines
File MIME type: text/plain
#183295 where admin users with user admin permission couldn't create users
#196909 added note to input field so that membership title won't contain spaces
#173603 pageroute wants single word paths defined - added note to README
1 /**
2 * $Id:$
3 * @package Registration_Mod
4 * @category NeighborForge
5 */
6 This module adds the ability to have several different membership types, each collecting different
7 data from the user for registration by using custom content types and the combination of nodeprofile
8 and pageroute modules. The accounttypes module is recommended but not required.
9
10 --CONTENTS--
11 REQUIREMENTS
12 SETUP/INSTALL
13 FEATURES
14 USAGE (Example)
15 UNINSTALL
16 CREDITS
17
18 --REQUIREMENTS--
19 DO NOT USE THE PROFILES MODULE. Strictly speaking, it shouldn't get in the way of anything, but any
20 data you collect on it will not be a part of the pageroute(s) you setup.
21
22 This module requires the use of the pageroute and nodeprofile modules. Read their respective
23 documentation before trying to use this module or you'll get confused. The section on USAGE will
24 explain how to use them in the context of this module's needs. The usernode module should not be
25 used. Any other requirements of either the nodeprofile or pageroute modules will also naturally be
26 required. See their respective documentation for more information. This module was created using the
27 versions of the required modules as noted in the USAGE section. Those modules may have changed, so
28 something may be broken. This module will be updated as time allows, but to ensure everything works
29 as described, you can always pull older files from the CVS of Drupal.org.
30
31 The auto_nodetitle module is not required, but highly suggested so your users don't have to enter in
32 titles for their node profile pages. Once you enable the module, when you edit a content type, there
33 is a collapsed fieldset at the top of the page called 'Automatic title generation'. Open it, click on
34 'Automatically generate the node title and hide the node title field.', then open 'Replacement
35 patterns'. Choose a pattern (you can string several together) and place it in the textbox labeled
36 'Replacement patterns'. Save. The title field will disappear from those types.
37
38 The accounttypes module is not required, but is recommended. One would normally think of account
39 types and membership types to be the same thing. In this case, they can be, but don't have to be.
40 Account types limit the roles available to a user and can be automatically assigned via this
41 module based on memebership type. See the accounttypes documentation for more information on what
42 it does, along with the USAGE example below for how I use it.
43
44 See FEATURES for a new feature where you can auto-assign one role at membership creation/registration.
45 This will only show up if you don't use the accounttypes module. Otherwise, they'd fight each other.
46
47 Also, although this module allows you to auto-assign one role per membership type, the accounttypes
48 module allows you to set as many as you wish.
49
50 --SETUP/INSTALL--
51 Before you activate this module you should probably do these things:
52 1) Install the nodeprofile module.
53 2) Install the pageroute module.
54 3) Outline the membership types you would like to have and the data you would like to collect
55 from each group of users. Identify which fields are in common and which are not.
56 4) Identify which fields you would like to require, and which you don't.
57 5) Create the content types based on your observations in steps 3 & 4 such that you minimize
58 the number of pages, but separate required/non-required, and common/non-common items. This
59 may result in one or more content types with only one field, depending on your situation.
60 That's okay!!! With the pageroute wizard system, it really isn't important to jam a page full
61 of fields, and in my opinion, looks cleaner anyway.
62
63 NOTE: You must UNCHECK the publish box or these nodes will show up in such pages as 'recent posts'
64 and all info will be viewable!!! Since this module, along with pageroutes, handles presentation
65 of these content types when they are filled out, normal users will not be able to change the
66 default publishing option. So as long as your admins don't mark any of these nodes as published,
67 you shouldn't be leaking personal info.
68
69 NOTE: If you use the auto_nodetitle module, then when you create a content type, there is a collapsed
70 fieldset at the top of the page called 'Automatic title generation'. Open it, click on
71 'Automatically generate the node title and hide the node title field.', then open 'Replacement
72 patterns'. Choose a pattern (you can string several together) and place it in the textbox labeled
73 'Replacement patterns'. Save. The title field will disappear from those types.
74
75 6) Make sure you've setup your roles and permissions how you want them. If you use the accounttypes
76 module, you will keep in mind to make roles more granular than you might otherwise. If you'd
77 like to use the accounttypes module, enable and set it up at this point (or earlier).
78 6a) In setting up the accounttypes module, you can either create an account type for each
79 membership type (as I have) or not. It may be in your case that you would like to allow two or
80 more different account types for one membership type. You may, for example have an administrator
81 membership type and wish to have both a junior and senior administrator account type that could
82 be assigned to that membership type. Be careful to note that this module assigns a default
83 account type (if you've set that up) at both account creation, and by changing membership type
84 at the mass-user edit screen. More on that below.
85 7) Copy the module's files into your site's module folder per standard Drupal practices.
86 8) Enable it at the module administration screen.
87 9) There is no install file as no database table needs creation. The standard variables table is
88 used for global settings and user data is stored in the user's 'data' field.
89
90 NOTE: This conversation may be of use to some of you: http://drupal.org/node/165230
91
92 --FEATURES--
93 Now follows an overview of each setting, where to find it, and what it does.
94 1) At registration, users will first be presented with a membership type selector. After selecting
95 the membership type, they will fill out the standard registration form. After that, as noted
96 below in B->III, the user will travel a pageroute to fill out more information.
97 2) admin/user/nf_registration_mod
98 This is the primary location for the settings of this module. You should see an added menu item
99 in the 'User management' section called 'Registration Membership Types'. Clicking that gets you here.
100 A) On the main or 'Overview' page, you will see three (or four) tabs across the top, a blank text
101 field with a button, and a blank text area and another button. The tabs are explained below.
102 I) The text field is in a table and, above, it has the label of 'Membership title'. This is where
103 you type in the name of each membership type in turn. Clicking on the button 'Add membership
104 type' will add the name to a global setting. You can add as many membership types as you wish
105 before proceeding with the form described in the next section (II), or you can alternate
106 between I and II.
107 II) Once you've added a membership type, there will be an empty drop down list in the 'pageroute'
108 column of that new type, along with a new button 'Add pageroute tie'. You should have already
109 created your pageroutes and if you did, you can choose one here. I'm using the term 'tie' to
110 indicate that a relationship has been made, usually with something from another module, that
111 this module does not directly control nor infulence, but uses in some other way.
112 III) The delete link in each row will of course present you with a choice to really delete that
113 particular membership type or not. There's a note that says your pageroute will not be
114 destroyed via this module, but that you can use the pageroute module if you intend to get rid
115 of that as well.
116 IV) The edit link takes you to an edit page where you can change both the name and pageroute for
117 a given membership type. There is currently no method to edit multiple membership types and
118 there are no plans to do such since I can't think of a use-case where more than a dozen
119 membership types would be used and anything less should be easily managed as-is.
120 V) The 'User instructions' text area is a place where you can enter the instructions required for
121 a user to correctly choose between the membership types you are providing. This can be changed
122 here directly whenever you need to. Click the 'Save message' button to save it.
123 NOTE: in both III & IV above, updates to the account type ties are maintained.
124 B) The next tab is 'Content type adjustments' (admin/user/nf_registration_mod/ct_adjustments).
125 Because the content types you created for node profiles should not be treated as regular content
126 types, this area both shows you some default changes this module makes and allows you to make
127 others. The page is organized by content type. The path of each is shown, as is which pageroutes
128 use it and what the pages are called in each pageroute.
129 I) Actually, in looking at the screen again, I see that I didn't give you an indicator that the
130 pageroute menu items are disabled, but that's what happens by default.
131 II) There is a note that advises you to disable all content type links for those types related
132 to the pageroutes you've setup. You check the items you want to disable and click on 'Disable
133 menu items' to affect that change. This does not delete the menu item. If you were to go to
134 the regular menu admin, you would see them, but they'd be disabled. This removes the 'Create
135 content' menu items as well as those on the content type page when you have clicked 'Create
136 content' and haven't selected a type yet. This module is aware of my 'Content type
137 Administration by Organic Groups' module and removes these types from the relevant admin
138 pages. It also adds these types to the OG omiited content type list which prevents groups
139 from using them.
140 III) If you wish to prevent users from using your site until they've completed some or all of
141 a given pageroute, you can specify which content types are required. For this reason, I made
142 the suggestion in the SETUP section above for how to segregate the content fields as you
143 create your content types. For example, you may require a full name and an address for all
144 users. Place that on one content type and require it on this page. You might have another
145 content type just for corporate accounts that have other required info. Put that on another
146 content type. Presumably, you'd have at least two pageroutes. One would have that first
147 required type, the other would have both required types. You could then add other content
148 types for non-required info. Check the boxes for the types you want to require and then click
149 'Require for login'.
150
151 WHAT THIS ACTUALLY DOES is reroute users who have not made nodes of the required types to the
152 next required type that they need to make. This happens both at login and any time the user
153 tries to browse away using any link on the page except the logout link.
154
155 Some of how this works depends on the settings you made for registration. If you require that
156 a user be validated by an admin, then the user will not be able to fill these nodes out until
157 they are unblocked. If you have required email verification, the user will be logged out right
158 after selecting a membership type and filling out the standard registration form. They will
159 be able to fill out the required nodes once they've verified their email address and come back
160 to the site. If you have neither required email verification, nor admin approval, then the
161 user will be able to fill out the nodes right away.
162
163 If a user quits their session/logs out before completing all required content types, they will
164 be presented with the next content type they need to complete and a total listing of pages to
165 submit. If you use the pageroute settings as outlined in the USAGE example, this will keep your
166 users from getting confused as to what is required of them.
167 NOTE: Because this screen has two buttons which use the same checkboxes, rather than check the
168 boxes of previously disabled/required types for you, all checkboxes default to unchecked. This
169 means that you must re-check previously affected types if you are making ANY changes or else they
170 will be undone. For this reason, I've provided the 'Status' column so you can see what state each
171 type is in.
172 CAUTION: Hmm, I thought of one two paragraphs ago, but now can't remember.
173 C) The next tab is 'Set access' (admin/user/nf_registration_mod/set_access) and is a placeholder
174 for now. What I would like to do is show a slice of the permissions page so that you can assign
175 only those permissions to roles that pertain directly to the content types we are dealing with
176 on these particular pageroutes. A first look leads me to believe that I need to work on the full
177 array of permissions. So even though I would only show a slice, I would have to keep track of
178 all permissions for all roles. This would require duplicating a lot of code from the standard
179 user module. I'm hoping there's a better way, so I've put this on the back burner. So instead,
180 I've provided some little bit of instruction as to how to set your content type permissions
181 as well as a link to the regular permissions page.
182
183 To summarize how you may want to set permissions, you first need to determine which types you
184 want users to edit after creation. Keep in mind that without additional access modules, that
185 if a user cannot edit their own node, then they cannot view it either. In my case, I am allowing
186 both 'create' and 'edit own' permissions for all content types, then restricting the individual
187 fields with another access control module. You could do the same, or you could disallow 'edit
188 own', then use a module like TAC to somehow give the 'view' grant only. This is a complicated
189 issue, so any variations from the USAGE example below are up to the user to figure out. Feel
190 free to share your particular setup with us in the issue queue.
191 D) The fourth tab only shows up if you've enabled the accounttypes module. The tab is labeled
192 'Tie account type to membership' (admin/user/nf_registration_mod/account_type). On this page
193 you can set a default account type to be given to a user whenever their membership type
194 changes to that membership type.
195 I) This is a straight-forward page where each membership type is displayed and there is a
196 drop down next to each to choose which account type to associate with it. Select the one
197 you want and click 'Save assignments'.
198 II) If you don't want all of your membership types to be associated to an account type, too
199 bad. The workaround is to create an account type (or use the 'basic' one that comes with
200 the accounttypes module) and then not assign it any roles, or assign it all roles -
201 whichever makes sense for your situation.
202 E) The edit link (admin/user/nf_registration_mod/edit/<MEMBERSHIP NAME>) for each membership type
203 allows you to change the name of the membership type, associate it with a different pageroute,
204 or, if you don't have the accounttypes module activated, will allow you to select one role to
205 auto-assign at account creation. Each membership type can assign a different role. The
206 accounttypes module allows assignment of multiple roles and so supercedes this module in that
207 respect.
208
209 --USAGE--
210 This outlines not only the suthor's settings for this module, but also for the nodeprofile and
211 pageroute modules. This should more or less guarantee decent results.
212 First let me tell you the versions of the modules' files used [not module version, but file]:
213 nodeprofile.module - 1.7.2.14
214 pageroute.module - 1.39.2.26
215 pageroute_subform.inc - 1.1
216 pageroute_ui.module - 1.29.2.6
217 So figure out which releases these correspond to. I can't say for certain whether later versions
218 will work the same or not as I'm not the author of them.
219 1) After installing the nodeprofile module and the pageroute module, I decided to create three
220 membership types. I then outlined the data I needed to collect from each. I saw that some was
221 common between two or more membership types. Beginning with what was common, I further divided
222 that information into required and non-required status. I then made my first content type using
223 the common & required fields (PAGE2). I then moved to the common & non-required information.
224 This data fit on two content types nicely (PAGE3 & PAGE4). Then I had three required but not
225 common content types to create (PAGE1, PAGE1A & PAGE1B). I then determined what the flow
226 through each pageroute should be, hence the page names above. The settings for all of this
227 follow.
228 2) The first settings to manipulate are in each content type's edit page
229 (admin/content/types/YOUR_TYPE). Here, I unchecked all default options, set maximum population
230 to 1, checked the 'Use this content type as a nodeprofile for users' box, disbaled comments,
231 and unchecked or disabled everything else (from various modules I had enabled).
232 3) After saving the changes and returning to the same edit page, I then clicked in the 'Node
233 profile' tab (admin/content/types/YOUR_TYPE/nodeprofile). Here, I unchecked the 'Integrate this
234 node profile with user categories.' box. This is important because this module handles this
235 on its own. If you use nodeprofile's version (which does override mine) then your user will
236 have a tab for every nodeprofile content type, whether it is part of their membership type
237 or not. I then selected the 'Don't display this nodeprofile on the user account page' radio
238 button and set the weight depending on the order of that content type within the pageroute(s)
239 it would be in; the first was lightest.
240 3a) I'm not sure that I needed this or not, so I'll mention this in passing. I hope this wasn't
241 required since I didn't put in on the requirements list, but I did use the nodefamily module.
242 Because I have three page ones (PAGE1, PAGE1a and PAGE1b), I made them each parents and then
243 made each content type that would be in its pageroute a child. Because there are content
244 types in common, those types appear as children to more than one parent. The admin for
245 nodefamily is here: admin/content/nodefamily.
246 3b) It turns out that for the version of nodeprofile I was using (and it may still be the case),
247 the nodefamily module was required just to get the node population section mentioned above. Or
248 am I remembering that incorrectly? Check the nodeprofile docs to be sure.
249 4) Next I worked on the pageroutes at admin/build/pageroute. First thing I did there was create
250 the routes at admin/build/pageroute/add using the 'add route' tab. I named the path, then
251 deselected the workflow option, selected 'Show tab-like submit buttons above the page content.',
252 assigned the appropriate roles to it, selected one of the PAGE1's for the nodefamily head (optional),
253 set the 'Customized redirect' to user/!uid, and checked 'Preserve destination parameter during
254 this route.' I recommend that you name your pages the same as the human-readable names of your
255 content types. The reason is that this module gives a list of required pages to the user and
256 it is nice if profile category links match pageroute submit-tab links.
257
258 NOTE: It seems that perhaps pageroute wants SINGLE WORD paths for the pageroute path, so don't create
259 pageroute paths like 'my/pageroute' when you setup your pageroutes!
260
261 NOTE: Workflow may have been moved to a separate module.
262
263 NOTE: For 'Customized redirect', you might want to send each pageroute to a separate URL where you've
264 created a welcome page for your new user and describe for them the limitations/uses of their
265 membership type.
266
267 5) Then I added the pages to each route. That is done from the 'Add page' tab
268 (admin/build/pageroute/route/YOUR_ROUTE_NUMBER/add). Because each of my content types was given
269 a population maximum of one above, they are called 'lonely nodes' and so at the first screen
270 of the add wizard, I selected 'Lonely node management' type. This takes you to the same page
271 as what is later the page-edit page. When you edit the page later it will be found here:
272 admin/build/pageroute/route/YOUR_ROUTE_NUMBER/edit/YOUR_PAGE_NAME. At this point, I gave the
273 page a name, left the title blank, and checked the 'Activated' box. I skipped the 'dont show
274 a tab for this page' section, selected the content type that should be associated with the
275 step in the pageroute, left the cancel link label empty, labeled the 'Forward button label'
276 as 'Next page' because that's what this module uses for the membership page, and labeled the
277 'Back' button 'Back'. Then of the three checkboxes, I only checked 'Never display the delete
278 button' because I don't want users to delete this information; I only want the admins to do
279 that. Again, I set the weight according to the page order, the first being the lightest.
280 6) Now, unless I'm forgetting something, that should be everything to setup content types,
281 nodeprofiles, nodefamily, and pageroutes. Next is the configuration of this module.
282 7)Nearly all steps I took to setup this module are obvious, so I'll direct you to the FEATURES
283 section above. I will say that on the admin/user/nf_registration_mod/ct_adjustments page, I
284 "disabled" all content types which removes the nodeprofile content types from menus and listings
285 (since we only want them created at registration), and "required" those that I planned to be
286 required right from the start. I also set the appropriate roles to have access to both 'create'
287 and 'edit own' for each content type in the pageroutes. Last, I associated an account type with
288 a membership type. That's it!
289 If anyone has questions regarding the process above, please feel free to open a support issue.
290 But like I said, variations from this recipe will result in a varied outcome.
291
292 --UNINSTALL--
293 Because this module doesn't create or maintain its own database tables, you can disable the module
294 and don't need to visit the uninstall page. Just in case you want to disable this and then reenable
295 it later, I don't delete the entries this module makes in the variables table, nor do I delete the
296 entries to each user's data field. I figure that for the vairables, it's easy enough for most admins
297 to delete them by hand. They all start with the prefix 'nf_registration_mod'. And since I only add
298 one piece of information to the user object, I figured you all wouldn't mind keeping it around. If
299 I get enough complaints, I guess I'll look into a more formal disable routine.
300
301 --CREDITS--
302 This module was created by Ryan Constantine (drupal id rconstantine)

  ViewVC Help
Powered by ViewVC 1.1.2