From: Mr D. <tl...@co...> - 2005-12-08 22:53:09
|
All, I am a perl programmer, and am making some modifications to the mailboxes/Read User Mail module, which I use to keep an eye on virus and SPAM activity for the company for which I work. Anyway, I've already implemented a few changes including configuration options for these changes, but there is one more than I want to add, and am not sure how to add the proper/correct config options to make it happen. Basically, I want to provide a listing of usernames that will _not_ be listed in the Read User Mail user list. For example, there is no reason to show the uucp user or the games user or the users for the different daemons that this server runs. So, I want to include them in a list that will be checked when showing the users. What I would like in the config is to have a text box and then a [ ... ] button that I can click which will pop up the user selection popup window, which will populate the textbox. I know how to add the textbox item to the config settings, and I know how to program the mailboxes_lib.pl file to ignore users in the list, but I don't know how to implement the system userlist popup button. Is this clear? Is there a way to do this from within a config option? Please ask questions if more information is needed. One other thing to ask: The things I'm adding basically allow the admin to change how many columns the usernames get listed in, if the admin wants the size of the mailbox to be listed below the username instead, and then the ignore list for users not to show. What is the likelihood that Jamie would be willing to (or want to) incorporate these changes into the module? Thanks a bunch for your time and help! Mr Duck |
From: Jamie C. <jca...@we...> - 2005-12-09 00:07:58
|
On Fri, 2005-12-09 at 09:52, Mr Duck wrote: > All, > > I am a perl programmer, and am making some modifications > to the mailboxes/Read User Mail module, which I use to keep > an eye on virus and SPAM activity for the company for which > I work. > > Anyway, I've already implemented a few changes including > configuration options for these changes, but there is one > more than I want to add, and am not sure how to add the > proper/correct config options to make it happen. > > Basically, I want to provide a listing of usernames that > will _not_ be listed in the Read User Mail user list. For example, > there is no reason to show the uucp user or the games user > or the users for the different daemons that this server runs. > So, I want to include them in a list that will be checked > when showing the users. That's a good idea for a feature.. > What I would like in the config is to have a text box and > then a [ ... ] button that I can click which will pop up the > user selection popup window, which will populate the textbox. > > I know how to add the textbox item to the config settings, > and I know how to program the mailboxes_lib.pl file to ignore > users in the list, but I don't know how to implement the > system userlist popup button. It would be good if the config.info format supported a multi-user popup option type, but unfortunately it only supports a single-user selection field at the moment. The only way to do this is to implement your own custom config field type, which is documented at http://www.webmin.com/modules-config.html in the section on config type 15. > Is this clear? Is there a way to do this from within a > config option? > > Please ask questions if more information is needed. > > One other thing to ask: > > The things I'm adding basically allow the admin to change how > many columns the usernames get listed in, if the admin wants the > size of the mailbox to be listed below the username instead, > and then the ignore list for users not to show. > > What is the likelihood that Jamie would be willing to > (or want to) incorporate these changes into the module? As long as your changes are well written, don't break any existing functionality, and are optional, I would be glad to include them in the module. - Jamie |
From: Mr D. <tl...@co...> - 2005-12-09 20:21:01
|
Jamie Cameron wrote: >> Basically, I want to provide a listing of usernames that >>will _not_ be listed in the Read User Mail user list. For example, > That's a good idea for a feature.. Thanks! I wasn't expecting a reply from you directly... (= I use this module (mailboxes) more than anything else, and so the types of changes that I mentioned are very beneficial to me. I would think that others might find them as useful, too. > The only way to do this is to implement your own custom config field > type, which is documented at http://www.webmin.com/modules-config.html > in the section on config type 15. Ok, I've been experimenting, and have a pretty good understanding of what is needed. I've already added the config.info entries to implement the three items, including the type 15 for the userlist. I've written a working config_info.pl sub that handles the actual user selection, which all was easy to implement, thanks to the flexibility of the webmin layout. The only part that is giving me troubles is when it comes to the save part. I don't quite follow what this means: ----------------------- When saving, a function with parse_ is called instead. It can make use of the %in hash to find out what the user entered, and must return a new value for this module configuration setting. ----------------------- The part that specifically confuses me is the "new value" stuff that is returned. From what I can tell, the parse_ function simply needs to return the new value of the config item. So, I wrote the sub as: ---CODE---- sub parse_userIgnoreList { return $in{'ignore_users'}; } ---END----- But nothing was saved. I see where in config_save.cgi the config_info.pl is checked, but when it comes to the foreign_call, I don't really follow what is happening with the data that the parse_ function returns. > As long as your changes are well written, don't break any existing > functionality, and are optional, I would be glad to include them in the > module. I really appreciate your encouragement and openness. Once I get the saving thing figured out, how should I go about getting the changes to you for examination? Should I tgz the files involved or provide patches or what? Thanks again! Mr Duck |
From: Jamie C. <jca...@we...> - 2005-12-09 21:50:23
|
On 10/Dec/2005 07:20 Mr Duck wrote .. > Jamie Cameron wrote: > >> Basically, I want to provide a listing of usernames that > >>will _not_ be listed in the Read User Mail user list. For example, > > That's a good idea for a feature.. > > Thanks! I wasn't expecting a reply from you directly... (= > I use this module (mailboxes) more than anything else, and so > the types of changes that I mentioned are very beneficial to me. > I would think that others might find them as useful, too. I agree .. there are heaps of system users like bin, uucp, etc.. that will never have mail. > > The only way to do this is to implement your own custom config field > > type, which is documented at http://www.webmin.com/modules-config.html > > in the section on config type 15. > > Ok, I've been experimenting, and have a pretty good understanding > of what is needed. I've already added the config.info entries to > implement the three items, including the type 15 for the userlist. > I've written a working config_info.pl sub that handles the actual > user selection, which all was easy to implement, thanks to the > flexibility of the webmin layout. > > The only part that is giving me troubles is when it comes to the > save part. I don't quite follow what this means: > ----------------------- > When saving, a function with parse_ is called instead. It can make use > of the %in hash to find out what the user entered, and must return a new > value for this module configuration setting. > ----------------------- > > The part that specifically confuses me is the "new value" stuff > that is returned. From what I can tell, the parse_ function simply > needs to return the new value of the config item. So, I wrote the > sub as: > > ---CODE---- > > sub parse_userIgnoreList > { > return $in{'ignore_users'}; > } > > ---END----- > > But nothing was saved. I see where in config_save.cgi the > config_info.pl is checked, but when it comes to the foreign_call, > I don't really follow what is happening with the data that the > parse_ function returns. That looks OK to me. What does the show__userIgnoreList function contain though? > > As long as your changes are well written, don't break any existing > > functionality, and are optional, I would be glad to include them in the > > module. > > I really appreciate your encouragement and openness. Once I get > the saving thing figured out, how should I go about getting the > changes to you for examination? Should I tgz the files involved > or provide patches or what? A patch is best, as it is easier to merge.. - Jamie |
From: Mr D. <tl...@co...> - 2005-12-09 22:05:53
|
Jamie Cameron wrote: > That looks OK to me. What does the show__userIgnoreList function contain > though? It's pretty straight-forward. ----CODE---- sub show_userIgnoreList { my($preta) = '<TEXTAREA NAME="ignore_users" COLS="35" ROWS="4">'; my($postta) = '</TEXTAREA>'; return $preta . $config{'ignore_users'} . $postta . ' ' . &user_chooser_button("ignore_users", 1); } ----END----- I have noticed in the interim that the webmin/conf/mailboxes/config file does get updated when I save changes using the previously given parse_ function. However, the webmin/mailboxes/config file does not. As of this point, I don't know the different between the two. Mr Duck |
From: Jamie C. <jca...@we...> - 2005-12-10 08:21:13
|
On 10/Dec/2005 09:05 Mr Duck wrote .. > Jamie Cameron wrote: > > That looks OK to me. What does the show__userIgnoreList function contain > > though? > > It's pretty straight-forward. > > ----CODE---- > > sub show_userIgnoreList > { > my($preta) = '<TEXTAREA NAME="ignore_users" COLS="35" ROWS="4">'; > my($postta) = '</TEXTAREA>'; > > return > $preta . > $config{'ignore_users'} . > $postta . > ' ' . > &user_chooser_button("ignore_users", 1); > } > > ----END----- I have one suggestion here - change the $config{'ignore_users'} to $_[0] > I have noticed in the interim that the webmin/conf/mailboxes/config > file does get updated when I save changes using the previously given > parse_ function. However, the webmin/mailboxes/config file does not. > > As of this point, I don't know the different between the two. The file /etc/webmin/mailboxes/config is the currently active config, while /usr/libexec/webmin/mailboxes/config is the initial default config (which is never changed). - Jamie |
From: Mr D. <tl...@co...> - 2005-12-13 15:40:52
|
Jamie Cameron wrote: >> return >> $preta . >> $config{'ignore_users'} . >> $postta . >> ' ' . >> &user_chooser_button("ignore_users", 1); > I have one suggestion here - change the $config{'ignore_users'} to $_[0] OK. I did so, and it works now. (= When I originally implemented the function, I had it displaying all values to @_ to see if anything was passed in, but since I didn't have a value yet, nothing was shown, and I mistakenly assumed that nothing was passed in. Slap my hand! (= Anyway, it works now, and splendidly I must say. AFAIK, these changes satisfy your given requirements of "well written, don't break anything, and optional". The only thing that I _don't_ have, however, is multi-language config.info files. (= Is there anything else that you suggest I do/check/examine/etc before I pass the patches and stuff on to you? Thanks! Mr Duck |
From: Jamie C. <jca...@we...> - 2005-12-13 22:47:31
|
On 14/Dec/2005 02:40 Mr Duck wrote .. > Jamie Cameron wrote: > >> return > >> $preta . > >> $config{'ignore_users'} . > >> $postta . > >> ' ' . > >> &user_chooser_button("ignore_users", 1); > > I have one suggestion here - change the $config{'ignore_users'} to $_[0] > > OK. I did so, and it works now. (= When I originally implemented Excellent! > the function, I had it displaying all values to @_ to see if anything > was passed in, but since I didn't have a value yet, nothing was shown, > and I mistakenly assumed that nothing was passed in. Slap my hand! > (= > > Anyway, it works now, and splendidly I must say. AFAIK, these changes > satisfy your given requirements of "well written, don't break anything, > and optional". > > The only thing that I _don't_ have, however, is multi-language > config.info files. (= I wouldn't worry too much .. Webmin will just display the english text if no translation exists in the user's language. > Is there anything else that you suggest I do/check/examine/etc > before I pass the patches and stuff on to you? I can't really think of any.. but send me the patch, and I will tell you if anything is missing or needs changing. - Jamie |