[vhffs-dev] [2278] Add ACL help link.

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 2278
Author:   gradator
Date:     2015-02-23 23:31:46 +0100 (Mon, 23 Feb 2015)
Log Message:
-----------
Add ACL help link. Fixed #280.

New configuration option: <acl> url_doc =

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Conf.pm
    trunk/vhffs-api/src/Vhffs/Panel/Bazaar.pm
    trunk/vhffs-api/src/Vhffs/Panel/Cron.pm
    trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm
    trunk/vhffs-api/src/Vhffs/Panel/DNS.pm
    trunk/vhffs-api/src/Vhffs/Panel/Git.pm
    trunk/vhffs-api/src/Vhffs/Panel/Group.pm
    trunk/vhffs-api/src/Vhffs/Panel/Mail.pm
    trunk/vhffs-api/src/Vhffs/Panel/MailingList.pm
    trunk/vhffs-api/src/Vhffs/Panel/Mercurial.pm
    trunk/vhffs-api/src/Vhffs/Panel/Mysql.pm
    trunk/vhffs-api/src/Vhffs/Panel/Pgsql.pm
    trunk/vhffs-api/src/Vhffs/Panel/Repository.pm
    trunk/vhffs-api/src/Vhffs/Panel/Svn.pm
    trunk/vhffs-api/src/Vhffs/Panel/Web.pm
    trunk/vhffs-backend/conf/vhffs.conf.dist.in
    trunk/vhffs-panel/templates/acl/form.tt

Modified: trunk/vhffs-api/src/Vhffs/Conf.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Conf.pm	2015-02-23 20:03:21 UTC (rev 2277)
+++ trunk/vhffs-api/src/Vhffs/Conf.pm	2015-02-23 22:31:46 UTC (rev 2278)
@@ -72,6 +72,8 @@
 			'users' => {
 				'available_shells' => '/bin/false',
 				'default_shell' => '/bin/false'
+			},
+			'acl' => {
 			}
 		},
 		-MergeDuplicateBlocks => 1,
@@ -207,6 +209,20 @@
 
 =pod
 
+=head2 get_acl
+
+my $aclconf = $conf->get_acl;
+
+Returns ACL configuration.
+
+=cut
+sub get_acl {
+	my $self = shift;
+	return $self->{'acl'};
+}
+
+=pod
+
 =head2 get_service
 
 my $serviceconf = $conf->get_service( $servicename );

Modified: trunk/vhffs-api/src/Vhffs/Panel/Bazaar.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Bazaar.pm	2015-02-23 20:03:21 UTC (rev 2277)
+++ trunk/vhffs-api/src/Vhffs/Panel/Bazaar.pm	2015-02-23 22:31:46 UTC (rev 2278)
@@ -196,6 +196,7 @@
 	$vars->{repository} = $bazaar;
 	$vars->{notify_from} = 'Please finish bazaar implementation'; # $bazaar->get_config->{notify_from};
 	$vars->{type} = 'bazaar';
+	$vars->{acl_help_url} = $vhffs->get_config->get_acl->{'url_doc'};
 	$panel->render( 'scm/prefs.tt', $vars );
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Panel/Cron.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Cron.pm	2015-02-23 20:03:21 UTC (rev 2277)
+++ trunk/vhffs-api/src/Vhffs/Panel/Cron.pm	2015-02-23 22:31:46 UTC (rev 2278)
@@ -190,7 +190,10 @@
 
 	save_prefs($panel, $cron) if defined $cgi->param('save_prefs_submit');
 
-	my $vars = { cron => $cron };
+	my $vars = {
+		cron => $cron,
+		acl_help_url => $vhffs->get_config->get_acl->{'url_doc'}
+	};
 
 	$panel->set_title( gettext("Cron job Administration") );
 	$panel->render('cron/prefs.tt', $vars);

Modified: trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm	2015-02-23 20:03:21 UTC (rev 2277)
+++ trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm	2015-02-23 22:31:46 UTC (rev 2278)
@@ -222,6 +222,7 @@
 	my $vars = {};
 	$vars->{repository} = $cvs;
 	$vars->{type} = 'cvs';
+	$vars->{acl_help_url} = $vhffs->get_config->get_acl->{'url_doc'};
 	$panel->render( 'scm/prefs.tt', $vars );
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Panel/DNS.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/DNS.pm	2015-02-23 20:03:21 UTC (rev 2277)
+++ trunk/vhffs-api/src/Vhffs/Panel/DNS.pm	2015-02-23 22:31:46 UTC (rev 2278)
@@ -570,6 +570,8 @@
 	$vars->{sorted_srv} = \@sorted_srv;
 	$vars->{sorted_txt} = \@sorted_txt;
 
+	$vars->{acl_help_url} = $vhffs->get_config->get_acl->{'url_doc'};
+
 	$panel->set_title(sprintf(gettext("DNS Administration - %s"), $domain_name));
 	$panel->render('dns/prefs.tt', $vars);
 }

Modified: trunk/vhffs-api/src/Vhffs/Panel/Git.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Git.pm	2015-02-23 20:03:21 UTC (rev 2277)
+++ trunk/vhffs-api/src/Vhffs/Panel/Git.pm	2015-02-23 22:31:46 UTC (rev 2278)
@@ -198,6 +198,7 @@
 	$vars->{repository} = $git;
 	$vars->{notify_from} = $git->get_config->{notify_from};
 	$vars->{type} = 'git';
+	$vars->{acl_help_url} = $vhffs->get_config->get_acl->{'url_doc'};
 	$panel->render( 'scm/prefs.tt', $vars );
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Panel/Group.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Group.pm	2015-02-23 20:03:21 UTC (rev 2277)
+++ trunk/vhffs-api/src/Vhffs/Panel/Group.pm	2015-02-23 22:31:46 UTC (rev 2278)
@@ -554,6 +554,7 @@
 	$vars->{mailgroup} = new Vhffs::Services::MailGroup( $vhffs , $group );
 	$vars->{use_avatars} = $panel->use_groups_avatars;
 	$vars->{group_users} = Vhffs::Panel::Group::getall_users( $vhffs , $group->get_gid );
+	$vars->{acl_help_url} = $vhffs->get_config->get_acl->{'url_doc'};
 
 	fill_tags( $panel, $group, $vars );
 	$panel->render('group/prefs.tt', $vars);

Modified: trunk/vhffs-api/src/Vhffs/Panel/Mail.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Mail.pm	2015-02-23 20:03:21 UTC (rev 2277)
+++ trunk/vhffs-api/src/Vhffs/Panel/Mail.pm	2015-02-23 22:31:46 UTC (rev 2278)
@@ -192,7 +192,8 @@
 			open => Vhffs::Services::Mail::CATCHALL_ALLOW_OPEN,
 		},
 		novirus => $mail_config->{use_novirus},
-		nospam => $mail_config->{use_nospam}
+		nospam => $mail_config->{use_nospam},
+		acl_help_url => $vhffs->get_config->get_acl->{'url_doc'}
 	};
 
 	my @sorted_localparts = sort { $a->{localpart} cmp $b->{localpart} } (values %{$mail->get_localparts});

Modified: trunk/vhffs-api/src/Vhffs/Panel/MailingList.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/MailingList.pm	2015-02-23 20:03:21 UTC (rev 2277)
+++ trunk/vhffs-api/src/Vhffs/Panel/MailingList.pm	2015-02-23 22:31:46 UTC (rev 2278)
@@ -234,6 +234,7 @@
 	my $vars = { list => $list };
 
 	$vars->{group_emails} = join("\n", map { $_->{mail} } @{$group->get_users});
+	$vars->{acl_help_url} = $vhffs->get_config->get_acl->{'url_doc'};
 
 	$panel->set_title( sprintf(gettext('Administration for list %s'), $list->get_localpart.'@'.$list->get_domain) );
 	$panel->render('mailinglist/prefs.tt', $vars);

Modified: trunk/vhffs-api/src/Vhffs/Panel/Mercurial.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Mercurial.pm	2015-02-23 20:03:21 UTC (rev 2277)
+++ trunk/vhffs-api/src/Vhffs/Panel/Mercurial.pm	2015-02-23 22:31:46 UTC (rev 2278)
@@ -200,6 +200,7 @@
 	$vars->{repository} = $mercurial;
 	$vars->{notify_from} = $mercurial->get_config->{notify_from};
 	$vars->{type} = 'mercurial';
+	$vars->{acl_help_url} = $vhffs->get_config->get_acl->{'url_doc'};
 	$panel->render( 'scm/prefs.tt', $vars );
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Panel/Mysql.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Mysql.pm	2015-02-23 20:03:21 UTC (rev 2277)
+++ trunk/vhffs-api/src/Vhffs/Panel/Mysql.pm	2015-02-23 22:31:46 UTC (rev 2278)
@@ -197,7 +197,11 @@
 		return if save_prefs($panel, $mysql);
 	}
 
-	my $vars = { db => $mysql, type => 'mysql' };
+	my $vars = {
+		db => $mysql,
+		type => 'mysql',
+		acl_help_url => $vhffs->get_config->get_acl->{'url_doc'}
+	};
 
 	$panel->set_title( gettext('MySQL Administration') );
 	$panel->render('database/prefs.tt', $vars);

Modified: trunk/vhffs-api/src/Vhffs/Panel/Pgsql.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Pgsql.pm	2015-02-23 20:03:21 UTC (rev 2277)
+++ trunk/vhffs-api/src/Vhffs/Panel/Pgsql.pm	2015-02-23 22:31:46 UTC (rev 2278)
@@ -187,7 +187,11 @@
 		return if save_prefs($panel, $pgsql);
 	}
 
-	my $vars = { db => $pgsql, type => 'pgsql' };
+	my $vars = {
+		db => $pgsql,
+		type => 'pgsql',
+		acl_help_url => $vhffs->get_config->get_acl->{'url_doc'}
+	};
 
 	$panel->set_title( gettext('PostgreSQL Administration') );
 	$panel->render('database/prefs.tt', $vars);

Modified: trunk/vhffs-api/src/Vhffs/Panel/Repository.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Repository.pm	2015-02-23 20:03:21 UTC (rev 2277)
+++ trunk/vhffs-api/src/Vhffs/Panel/Repository.pm	2015-02-23 22:31:46 UTC (rev 2278)
@@ -178,7 +178,10 @@
 
 	update_quota($panel, $repo) if defined $cgi->param('update_quota_submit');
 
-	my $vars = { repository => $repo };
+	my $vars = {
+		repository => $repo,
+		acl_help_url => $vhffs->get_config->get_acl->{'url_doc'}
+	};
 	$panel->set_title( gettext('Admin Download repository') );
 	$panel->render('repository/prefs.tt', $vars);
 }

Modified: trunk/vhffs-api/src/Vhffs/Panel/Svn.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Svn.pm	2015-02-23 20:03:21 UTC (rev 2277)
+++ trunk/vhffs-api/src/Vhffs/Panel/Svn.pm	2015-02-23 22:31:46 UTC (rev 2278)
@@ -197,6 +197,7 @@
 	$vars->{repository} = $svn;
 	$vars->{notify_from} = $svn->get_config->{notify_from};
 	$vars->{type} = 'svn';
+	$vars->{acl_help_url} = $vhffs->get_config->get_acl->{'url_doc'};
 	$panel->render( 'scm/prefs.tt', $vars );
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Panel/Web.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Web.pm	2015-02-23 20:03:21 UTC (rev 2277)
+++ trunk/vhffs-api/src/Vhffs/Panel/Web.pm	2015-02-23 22:31:46 UTC (rev 2278)
@@ -263,7 +263,10 @@
 		save_prefs($panel, $web);
 	}
 
-	my $vars = { web => $web };
+	my $vars = {
+		web => $web,
+		acl_help_url => $vhffs->get_config->get_acl->{'url_doc'}
+	};
 
 	$panel->set_title( gettext("Modify webarea") );
 	$panel->render('web/prefs.tt', $vars);

Modified: trunk/vhffs-backend/conf/vhffs.conf.dist.in
===================================================================
--- trunk/vhffs-backend/conf/vhffs.conf.dist.in	2015-02-23 20:03:21 UTC (rev 2277)
+++ trunk/vhffs-backend/conf/vhffs.conf.dist.in	2015-02-23 22:31:46 UTC (rev 2278)
@@ -157,7 +157,7 @@
 
 
 ######
-# USERS AND GROUPS
+# USERS, GROUPS AND ACL
 ################################################
 
 # Configuration for users
@@ -195,6 +195,11 @@
 	url_doc			=	http://help.myhoster.net/group
 </groups>
 
+# Configuration for ACL
+<acl>
+	# URL to the documentation (optional)
+	url_doc			=	http://help.myhoster.net/acl
+</acl>
 
 ######
 # SERVICES

Modified: trunk/vhffs-panel/templates/acl/form.tt
===================================================================
--- trunk/vhffs-panel/templates/acl/form.tt	2015-02-23 20:03:21 UTC (rev 2277)
+++ trunk/vhffs-panel/templates/acl/form.tt	2015-02-23 22:31:46 UTC (rev 2278)
@@ -1,7 +1,11 @@
 <h2>[% 'Access rights management for this object' | i18n | html %]</h2>
 
 <form method="post" action="?do=acl;oid=[% object.get_oid %]" accept-charset="utf-8">
-	<p>[% 'You can adjust rights on this group for each user in the VHFFS database. Please read help before manage it.' | i18n | html %]</p>
+	<p>[% 'You can adjust rights on this group for each user in the VHFFS database.' | i18n | html %]
+[% IF acl_help_url.defined %]
+	[% 'Please <a href="%s">read help</a> before managing.' | i18n | pretty_print(acl_help_url) %]
+[% END %]
+	</p>
 	<input type="hidden" name="oid" value="[% object.get_oid %]" />
 	<p class="button" id="buttonAclAdmin">
 		<input type="submit" value="[% 'OK, go to ACL management' | i18n | html %]" />


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/