Lists

If you aren't speaking german, you can ask for support or post your request here.
Antworten
mbs
Beiträge: 21
Registriert: 19. Okt 2013, 17:34

Lists

Beitrag von mbs »

Hi, is there a way to disable list configuration for users so that only admin can create them and make them available? Very useful as some information in my roles should be restricted to other role members but using list they can see everything!

thanks Mark, ideally i would like List and Own Lists to be only available when admin logged in both in the right hand menu and the Overview menu.

thanks
Benutzeravatar
Thomas-RCV
Former team member
Beiträge: 786
Registriert: 1. Aug 2011, 15:06

Re: Lists

Beitrag von Thomas-RCV »

Hi Mark,
If you feel conifident changing two php scripts it is quiet trivial to show the links only for the admin.
We provide the function hasRole() to handle actions if user is member of a role.
To change the overview find the script in adm_program/index.php
Find section in line 112

Code: Alles auswählen

$moduleMenu->addItem('lists', '/adm_program/modules/lists/lists.php',
					$gL10n->get('LST_LISTS'), '/icons/lists_big.png',
					$gL10n->get('LST_LISTS_DESC'));
$moduleMenu->addSubItem('lists', 'mylist', '/adm_program/modules/lists/mylist.php',
						$gL10n->get('LST_MY_LIST'));
$moduleMenu->addSubItem('lists', 'rolinac', '/adm_program/modules/lists/lists.php?active_role=0',
						$gL10n->get('ROL_INACTIV_ROLE'));
Change to:

Code: Alles auswählen

If hasRole("Webmaster")
{
$moduleMenu->addItem('lists', '/adm_program/modules/lists/lists.php',
					$gL10n->get('LST_LISTS'), '/icons/lists_big.png',
					$gL10n->get('LST_LISTS_DESC'));
$moduleMenu->addSubItem('lists', 'mylist', '/adm_program/modules/lists/mylist.php',
						$gL10n->get('LST_MY_LIST'));
$moduleMenu->addSubItem('lists', 'rolinac', '/adm_program/modules/lists/lists.php?active_role=0',
						$gL10n->get('ROL_INACTIV_ROLE'));
}
The same for the sidebar menue in adm_themes/modern(classic)/my_body_bottom.php
Changing this the links are only shown if the current user is admin.

Best,
Thomas
mbs
Beiträge: 21
Registriert: 19. Okt 2013, 17:34

Re: Lists

Beitrag von mbs »

Thanks Thomas, that works great, can the function be used for multiple roles so certain groups of members can see the item?

thanks Mark
Benutzeravatar
Thomas-RCV
Former team member
Beiträge: 786
Registriert: 1. Aug 2011, 15:06

Re: Lists

Beitrag von Thomas-RCV »

For sure. Just pass the roles to the function

hasRole ("Webmaster", "chairman", "member")


Best
mbs
Beiträge: 21
Registriert: 19. Okt 2013, 17:34

Re: Lists

Beitrag von mbs »

Thanks,

Had to change it to

If (hasRole('Webmaster'))

Otherwise no page loaded
also wanted Webmaster or coach rather than being member of both

thanks Mark
ayaha
Beiträge: 1
Registriert: 20. Jan 2015, 08:37

Re: Lists

Beitrag von ayaha »

Thomas-RCV hat geschrieben:Hi Mark,
If you feel conifident changing two php scripts it is quiet trivial to show the links only for the admin.
We provide the function hasRole() to handle actions if user is member of a role.
To change the overview find the script in adm_program/index.php
Find section in line 112

Code: Alles auswählen

$moduleMenu->addItem('lists', '/adm_program/modules/lists/lists.php',
					$gL10n->get('LST_LISTS'), '/icons/lists_big.png',
					$gL10n->get('LST_LISTS_DESC'));
$moduleMenu->addSubItem('lists', 'mylist', '/adm_program/modules/lists/mylist.php',
						$gL10n->get('LST_MY_LIST'));
$moduleMenu->addSubItem('lists', 'rolinac', '/adm_program/modules/lists/lists.php?active_role=0',
						$gL10n->get('ROL_INACTIV_ROLE'));
Change to:

Code: Alles auswählen

If hasRole("Webmaster")
{
$moduleMenu->addItem('lists', '/adm_program/modules/lists/lists.php',
					$gL10n->get('LST_LISTS'), '/icons/lists_big.png',
					$gL10n->get('LST_LISTS_DESC'));
$moduleMenu->addSubItem('lists', 'mylist', '/adm_program/modules/lists/mylist.php',
						$gL10n->get('LST_MY_LIST'));
$moduleMenu->addSubItem('lists', 'rolinac', '/adm_program/modules/lists/lists.php?active_role=0',
						$gL10n->get('ROL_INACTIV_ROLE'));
}
The same for the sidebar menue in adm_themes/modern(classic)/my_body_bottom.php
Changing this the links are only shown if the current user is admin.

Best,
Thomas
thanks for sharing its really helpful for me
ayaha
Antworten