-
-
Notifications
You must be signed in to change notification settings - Fork 129
Add hooks for feature plugins to inject users into the users listing #1183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1127,6 +1127,16 @@ sub list_domain_users | |
| push(@users, &list_extra_web_users($d)); | ||
| } | ||
|
|
||
| # Include users from feature plugins that define list_plugin_users | ||
| if ($includeextra) { | ||
| foreach my $f (&list_feature_plugins()) { | ||
| if ($d->{$f} && &plugin_defined($f, "list_plugin_users")) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since it comes from a plugin, shouldn’t the function name be
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 to that |
||
| my @pu = &plugin_call($f, "list_plugin_users", $d); | ||
| push(@users, @pu) if @pu; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| # Add any secondary groups in the template | ||
| local @sgroups = &allowed_secondary_groups($d); | ||
| if (@sgroups) { | ||
|
|
@@ -5723,11 +5733,18 @@ sub users_table | |
| $u->{'webowner'} && $u->{'pass'} =~ /^(\!|\*)/ ? $pop3_dis : | ||
| $u->{'webowner'} ? $pop3 : | ||
| $u->{'pass'} =~ /^(\!|\*)/ ? $pop3_dis : $pop3); | ||
| my $col_val = "<a href='edit_user.cgi?dom=$did$filetype&". | ||
| "user=".&urlize($u->{'user'})."'>$col_text</a>"; | ||
| if (!$virtualmin_pro && $u->{'extra'}) { | ||
| my $col_val; | ||
| if ($u->{'edit_url'}) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A better way to make the PR with fewer changes is to leave the existing code as is and just add your new check |
||
| $col_val = "<a href='".&html_escape($u->{'edit_url'}). | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you sure that links need to be HTML-escaped? 🙂 |
||
| "'>$col_text</a>"; | ||
| } | ||
| elsif (!$virtualmin_pro && $u->{'extra'}) { | ||
| $col_val = $col_text; | ||
| } | ||
| else { | ||
| $col_val = "<a href='edit_user.cgi?dom=$did$filetype&". | ||
| "user=".&urlize($u->{'user'})."'>$col_text</a>"; | ||
| } | ||
| push(@cols, "$col_val\n"); | ||
| push(@cols, &html_escape($u->{'user'})); | ||
| push(@cols, &html_escape($u->{'real'})); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's technically no need for
if @plinkshere