[Koha-cvs] CVS: koha/C4 Auth.pm,1.36,1.37

doXulting doxulting at users.sourceforge.net
Wed Mar 23 10:25:23 CET 2005


Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11283/C4

Modified Files:
	Auth.pm 
Log Message:
New param for the template in order to show only allowed links to user (In parameters screen only right now)

Index: Auth.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Auth.pm,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -r1.36 -r1.37
*** Auth.pm	5 Nov 2004 10:12:27 -0000	1.36
--- Auth.pm	23 Mar 2005 09:25:20 -0000	1.37
***************
*** 122,130 ****
  
  		$borrowernumber = getborrowernumber($user);
! 		my ($borr, $flags) = getpatroninformation(undef, $borrowernumber);
  		my @bordat;
  		$bordat[0] = $borr;
  		$template->param(USER_INFO => \@bordat,
  		);
  	}
  	$template->param(
--- 122,192 ----
  
  		$borrowernumber = getborrowernumber($user);
! 		my ($borr, $alternativeflags) = getpatroninformation(undef, $borrowernumber);
  		my @bordat;
  		$bordat[0] = $borr;
  		$template->param(USER_INFO => \@bordat,
  		);
+ 		
+ 		# We are going to use the $flags returned by checkauth
+ 		# to create the template's parameters that will indicate
+ 		# which menus the user can access.
+ 		if ($flags->{superlibrarian} == 1)
+ 		{
+ 			$template->param(CAN_user_circulate => 1);
+ 			$template->param(CAN_user_catalogue => 1);
+ 			$template->param(CAN_user_parameters => 1);
+ 			$template->param(CAN_user_borrowers => 1);
+ 			$template->param(CAN_user_permission => 1);
+ 			$template->param(CAN_user_reserveforothers => 1);
+ 			$template->param(CAN_user_borrow => 1);
+ 			$template->param(CAN_user_reserveforself => 1);
+ 			$template->param(CAN_user_editcatalogue => 1);
+ 			$template->param(CAN_user_updatecharge => 1);
+ 			$template->param(CAN_user_acquisition => 1);
+ 			$template->param(CAN_user_management => 1);
+ 			$template->param(CAN_user_tools => 1); }
+ 		
+ 		if ($flags->{circulate} == 1) {
+ 			$template->param(CAN_user_circulate => 1); }
+ 
+ 		if ($flags->{catalogue} == 1) {
+ 			$template->param(CAN_user_catalogue => 1); }
+ 		

+ 		if ($flags->{parameters} == 1) {
+ 			$template->param(CAN_user_parameters => 1);	
+ 			$template->param(CAN_user_management => 1);
+ 			$template->param(CAN_user_tools => 1); }
+ 		

+ 		if ($flags->{borrowers} == 1) {
+ 			$template->param(CAN_user_borrowers => 1); }
+ 		

+ 		if ($flags->{permissions} == 1) {
+ 			$template->param(CAN_user_permission => 1); }
+ 		
+ 		if ($flags->{reserveforothers} == 1) {
+ 			$template->param(CAN_user_reserveforothers => 1); }
+ 		

+ 		if ($flags->{borrow} == 1) {
+ 			$template->param(CAN_user_borrow => 1); }
+ 		

+ 		if ($flags->{reserveforself} == 1) {
+ 			$template->param(CAN_user_reserveforself => 1); }
+ 		

+ 		if ($flags->{editcatalogue} == 1) {
+ 			$template->param(CAN_user_editcatalogue => 1); }
+ 		

+ 		if ($flags->{updatecharges} == 1) {
+ 			$template->param(CAN_user_updatecharge => 1); }
+ 		
+ 		if ($flags->{acquisition} == 1) {
+ 			$template->param(CAN_user_acquisition => 1); }
+ 		
+ 		if ($flags->{management} == 1) {
+ 			$template->param(CAN_user_management => 1);
+ 			$template->param(CAN_user_tools => 1); }
+ 		
+ 		if ($flags->{tools} == 1) {
+ 			$template->param(CAN_user_tools => 1); }
+ 		
  	}
  	$template->param(





More information about the Koha-cvs mailing list