The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
![]() |
Client Username Permissions - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: Client Username Permissions (/showthread.php?tid=71) |
Client Username Permissions - FoundByDesign - Mar 18th, 2009 Ben, Thank you for an awesome program and so far the 2.0 looks great! I have not yet upgraded but am about to do so... however, I have a couple questions... 1. Client Username permission. I would prefer that the client NOT be able to modify the Username at all. I want to allow the remainder of the information, just not that one. So my question is this... is there a way to turn this off without having to hack files and remove the <input> altogether? If not, what pages should I make the changes on to prevent them from making changes? 2. Related to #1... Additional fields for Client data. One of the reasons I am looking to avoid the Client from changing their Username is I plan to filter the forms they can use by this field. At the same time, I want to include more Client data, such as phone, address, ect. Is there a simple way to add these additional fields (globally) or is this something else I would need to hack at? And if hacking is the way, what files need the updating? I ask about the files so I know I don't miss anything... I am no stranger to PHP coding, but you have broken the files in to multiple files (no doubt for security purposes) which makes it difficult to go through EVERY page and make sure nothing is missed. Thanks again! Ed RE: Client Username Permissions - Ben - Mar 19th, 2009 Heya, Quote:1. Client Username permission. I would prefer that the client NOT be able to modify the Username at all. I want to allow the remainder of the information, just not that one. So my question is this... is there a way to turn this off without having to hack files and remove the <input> altogether? If not, what pages should I make the changes on to prevent them from making changes? Unfortunately not. This seems like a very reasonable addition, though, so I'll add it to the feature request list. If you're going to edit the pages, I'd suggest just removing the field and adding it as a hidden field. This won't be hacker proof, but it'll be by far the simplest from a coding standpoint. Also (and I apologize for speaking in general terms), I'd suggest making a new theme for it, then override this page only. This will make it as upgrade-friendly as possible. Themes work by using the theme's file IF it exists, if it doesn't, it uses the appropriate file in the default theme. There's loads more info on theme development here: http://docs.formtools.org/theme_development/ Quote:Is there a simple way to add these additional fields (globally) or is this something else I would need to hack at? And if hacking is the way, what files need the updating? Hacking IS the way, unfortunately. I may well add a custom module for this at a later stage, but right now I'm focusing on the essentials. Frankly it's a pretty sizable job: you'll need to first create new fields in the database for your info (or use the account_settings table - which would probably be a better approach), second you'll need to first edit the template files (I'd suggest a new theme for this, as mentioned above), to include your new fields for both the admin and client pages. Then you'd need to update the actual PHP code to store the new values. The problem is modifications of this nature will almost certainly cause problems if you plan on upgrading any time in the future. So on that note, you might want to wait a month or so until most of the more substantial bugs are weeded out of the Core code - just so your own version will be based on a more stable foundation. Sorry for the rather general nature of my remarks... it's certainly very do-able to make these mods, but it WILL take a little work. - Ben RE: Client Username Permissions - FoundByDesign - Mar 19th, 2009 I have actually hacked the files a bit, and for the username I removed the Input box and used a simple php echo to show the username but not allow editing. I also changed the First Name label to Name and the Last Name label to Phone, and just use the current code you have and remember that last_name is being used for Phone. Simple mods, but they do work and are easy enough to replicate should I upgrade later. It would be nice to have a bit more flexibility built in to future builds. Thanks for the reply (and the program.) Ed RE: Client Username Permissions - Ben - Mar 20th, 2009 Hey Ed, I've given this some more thought and I think I *will* write a module for this. There's one big thing lacking in the Core - the option for module developers to insert their own HTML in the admin & client pages. I've known this for a while, but I've had so much else to do I put in on the back burners. I'm going to work on adding "template hooks", which will allow for this. Once that's in place all the tools are in place for an "Extended Client Fields Manager" module - or something. Pop by the forums from time to time and I'll let you know how progress on all this goes. - Ben RE: Client Username Permissions - FoundByDesign - Mar 20th, 2009 Ben, That sounds like a great addition when its ready. I know you are working hard on the program, so no pressure on my end. I can work around what I have for the time being! Thanks again for the great tool! Ed |