| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
- Pages:
- 1
- 2
| Flexible Form Script Extension: Restrict Groups | |
|---|---|
| Tweet Topic Started: Jul 7 2012, 05:46 PM (1,872 Views) | |
| Cory | Jul 7 2012, 05:46 PM Post #1 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Code Name: Flexible Form Script Extension: Restrict Groups What the code does: This code works with Reid's Flexible Form Script and will allow you to restrict user groups from sending in applications. How to use the code: Change Group ID as necessary. The Group ID can be retrieved via the page source (look for 'gid'), or via the member list by selecting a group from the 'Displaying' drop down menu, the &group= number found in the address bar is the Group ID. How to install the code: Below the Flexible Form Script code:
Edited by Cory, Dec 13 2013, 12:02 AM.
|
![]() |
|
| Nicolas-ZNR | Jul 7 2012, 06:49 PM Post #2 |
![]()
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Useful, but I do wonder why you did the AJAX request to find the name of the group and didn't just check $.zb.stat.gid (I know it requires admin to find the group IDs, but it's not that difficult and makes the code smoother). |
![]() |
|
| Geoffrey | Jul 7 2012, 08:49 PM Post #3 |
|
bury hatchets, keep maps
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
And we put in the group ID of the groups we want to exclude or include? |
![]() |
|
| Cory | Jul 7 2012, 09:06 PM Post #4 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
When you insert a Group ID it will disable the form from being used for that group. |
![]() |
|
| Ferby | Jul 11 2012, 12:22 PM Post #5 |
![]()
Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Kinda annoying because the restrict groups and required fields are compatible with each other |
![]() |
|
| Cory | Jul 12 2012, 06:47 AM Post #6 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I'm not sure why that would be a bad thing, you can restrict groups only, require fields only, or restrict groups and require fields by using both codes. |
![]() |
|
| Geoffrey | Jul 12 2012, 10:16 AM Post #7 |
|
bury hatchets, keep maps
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Ferby may have made a typo and meant to say they are not compatible. |
![]() |
|
| Ferby | Jul 12 2012, 10:25 AM Post #8 |
![]()
Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
yeah sorry. I tried both codes together and they didnt work |
![]() |
|
| Cory | Jul 12 2012, 10:47 AM Post #9 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I just tested both codes together and they seemed to work for me. Mind posting your Flexible Form Script webpage content with the two codes added so I can see what the issue is? |
![]() |
|
| Ferby | Jul 12 2012, 06:48 PM Post #10 |
![]()
Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I thought the group you put in would be the only group able to submit a form. Read it wrong, sorry for being an idiot xDDCould the OP edit the code so only certain groups can submit a application instead of restricting groups? Would be appreciated Edited by Ferby, Jul 12 2012, 06:51 PM.
|
![]() |
|
| Cory | Jul 13 2012, 07:16 AM Post #11 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Change === (in the first code) or == (in the second code) to != to make it so if the group name or group ID matches they can submit forms, instead of being restricted; basically doing the opposite of what it does now. |
![]() |
|
| Ferby | Jul 13 2012, 01:10 PM Post #12 |
![]()
Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
works perfectly |
![]() |
|
| mawarm | Dec 3 2016, 02:53 PM Post #13 |
|
Member
![]() ![]() ![]() ![]()
|
I changed the "==" to "!=", in order to define what groups are allowed to access the form, rather than what groups cannot access it, which seems to be working. However I can only get it working for one group; I'm not sure what the layout should be like when adding more groups, could you help me with this? Also, I was wondering if it could be possible to have a separate error message for guests. |
![]() |
|
| Cory | Dec 4 2016, 12:35 PM Post #14 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
You can repeat this line as many times as you like for additional user groups:Use this for guests:
|
![]() |
|
| mawarm | Dec 5 2016, 04:11 PM Post #15 |
|
Member
![]() ![]() ![]() ![]()
|
I'm still not sure about the layout and can only get it working for one group at a time...when I try to add more groups it doesn't work for any group at all. Please check out my code below and tell me what I'm doing wrong. It doesn't have anything to do with the separate error message for guests because I tried removing that part but it makes no difference.
|
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| Go to Next Page | |
| « Previous Topic · ZetaBoards Codes & Modifications · Next Topic » |
- Pages:
- 1
- 2
| Track Topic · E-mail Topic |
4:29 AM Jul 11
|



![]](http://b1.ifrm.com/0/1/0/p601690/pipright.png)





I thought the group you put in would be the only group able to submit a form. Read it wrong, sorry for being an idiot xDD
4:29 AM Jul 11