Page 1 of 1

Lead loader templates not locked to usergroup

PostPosted: Fri Mar 23, 2018 8:13 am
by dspaan
When you use a lead loader template to load leads, an admin user can see all created templates in the system by all admin users, is this something that has been overlooked or is it something that is yet to be developed?

Also i can't find a way to edit an existing lead loader template or tie it to a usergroup.

Re: Lead loader templates not locked to usergroup

PostPosted: Fri Mar 23, 2018 8:42 am
by williamconley
1) Not yet implemented (at least not in your Vicidial Version: If you're curious about "latest", install in a sandbox and compare, but I don't think that's implemented even in the latest).

2) You must always post your Vicidial Version with Build. It's necessary. Especially when asking "has this feature been added yet?"

3) Editing existing lead loaders is also not yet implemented.

Re: Lead loader templates not locked to usergroup

PostPosted: Fri Mar 23, 2018 10:11 am
by dspaan
Hey Bill :-)

I didn't add my version because i'm pretty sure i'm on a recent svn release but here it is:

Versie: 2.14b0.5
SVN Version: 2942
DB Schema Version: 1540

Re: Lead loader templates not locked to usergroup

PostPosted: Fri Mar 23, 2018 10:42 am
by williamconley
dspaan wrote:Hey Bill :-)

I didn't add my version because i'm pretty sure i'm on a recent svn release but here it is:


These posts will live on in this board forever. Your question (and all of them) will still be here when "recent version" has a completely different meaning.

Re: Lead loader templates not locked to usergroup

PostPosted: Fri Mar 23, 2018 7:57 pm
by blackbird2306
The custom template table in database has no user group column. But I can help you just with the restriction now as a temporary solution and it's very simple. Make changes in "AST_admin_template_maker.php" and "admin_listloader_fourth_gen.php".
Change this line (both files have the same line in it):
Code: Select all
$template_stmt="select template_id, template_name from vicidial_custom_leadloader_templates order by template_id asc";

to:
Code: Select all
$template_stmt="SELECT template_id, template_name FROM vicidial_custom_leadloader_templates WHERE list_id IN (SELECT list_id FROM vicidial_lists $whereLOGallowed_campaignsSQL) ORDER BY template_id asc";

This change leads to following behaviour:
When creating a template you have to define a list id, which the template will load into. When this list is assigned to an allowed campaign in user group then also the template is selectable/viewable. Make sure the list will not be deleted and is assigned to a campaign! My goal was to help you the easiest way as possible!

Re: Lead loader templates not locked to usergroup

PostPosted: Fri Mar 23, 2018 11:48 pm
by williamconley
blackbird2306 wrote:The custom template table in database has no user group column. But I can help you just with the restriction now as a temporary solution and it's very simple. Make changes in "AST_admin_template_maker.php" and "admin_listloader_fourth_gen.php".
Change this line (both files have the same line in it):
Code: Select all
$template_stmt="select template_id, template_name from vicidial_custom_leadloader_templates order by template_id asc";

to:
Code: Select all
$template_stmt="SELECT template_id, template_name FROM vicidial_custom_leadloader_templates WHERE list_id IN (SELECT list_id FROM vicidial_lists $whereLOGallowed_campaignsSQL) ORDER BY template_id asc";

This change leads to following behaviour:
When creating a template you have to define a list id, which the template will load into. When this list is assigned to an allowed campaign in user group then also the template is selectable/viewable. Make sure the list will not be deleted and is assigned to a campaign! My goal was to help you the easiest way as possible!


Pretty slick. 8-)

Re: Lead loader templates not locked to usergroup

PostPosted: Sat Mar 24, 2018 8:49 am
by mflorell
These changes have been committed to svn/trunk. Thanks!

Re: Lead loader templates not locked to usergroup

PostPosted: Sat Mar 24, 2018 11:30 am
by williamconley
mflorell wrote:These changes have been committed to svn/trunk. Thanks!


I hope we added a help to the template selector indicating the "group lock". 8-)

Re: Lead loader templates not locked to usergroup

PostPosted: Sat Mar 24, 2018 10:07 pm
by mflorell
When we fix a User Group permissions issue like this, we don't document the change in the help because it really is closing a security hole, not just changing how a feature works. We've actually fixed a few other User Group permissions issue earlier this month, which most people will probably never even notice, but they were also considered bug fixes.

Re: Lead loader templates not locked to usergroup

PostPosted: Sat Mar 24, 2018 11:03 pm
by williamconley
That's cool, don't get me wrong, but I can already hear the callers that have no idea why they can't see the template they know was there last week. Worst yet, my tech will scratch his head because *he* can see it. And then there's that moment ... which is easily resolved with a slight addition:

Template ID -If the user has selected Custom layout from the File layout options, then this the template the lead loader will use. It will also override the selected list ID with the list ID that was assigned to the selected template when it was created. Note: You must have permission to view the list to which a Template is assigned to use a Template.

8-)