[vhffs-dev] [1423] deleted fixperms actions in panel, renamed cvs_fixperms. pl robot to cvs_public.pl |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 1423
Author: gradator
Date: 2009-05-30 18:50:09 +0200 (Sat, 30 May 2009)
Log Message:
-----------
deleted fixperms actions in panel, renamed cvs_fixperms.pl robot to cvs_public.pl
Modified Paths:
--------------
trunk/vhffs-panel/cvs/prefs.pl
trunk/vhffs-panel/git/prefs.pl
trunk/vhffs-panel/templates/cvs/prefs.tmpl
trunk/vhffs-panel/templates/git/prefs.tmpl
trunk/vhffs-robots/Makefile.am
Added Paths:
-----------
trunk/vhffs-robots/src/cvs_public.pl
Removed Paths:
-------------
trunk/vhffs-robots/src/cvs_fixperms.pl
Modified: trunk/vhffs-panel/cvs/prefs.pl
===================================================================
--- trunk/vhffs-panel/cvs/prefs.pl 2009-05-29 23:01:46 UTC (rev 1422)
+++ trunk/vhffs-panel/cvs/prefs.pl 2009-05-30 16:50:09 UTC (rev 1423)
@@ -89,19 +89,6 @@
}
}
- elsif( defined $cgi->param('cvs_fixperms_submit')) {
- unless( $user->can_modify($cvs) ) {
- $panel->add_error( gettext( 'You\'re not allowed to do this, object is not in active state or you don\'t have enough ACL rights' ) );
- } else {
- $cvs->set_status(Vhffs::Constants::WAITING_FOR_MODIFICATION);
- if($cvs->commit > 0) {
- $panel->add_info(gettext("CVS repository updated"));
- } else {
- $panel->add_error(gettext("An error occured during CVS repository update"));
- }
- }
- }
-
$template = new HTML::Template( filename => $templatedir."/panel/cvs/prefs.tmpl" );
$panel->set_title( gettext('Admin CVS Repository') );
@@ -122,9 +109,6 @@
$template->param( TEXT_ACL_ADMIN => "Admin Rights on this object (ACL)" );
$template->param( EXPLAIN_ADMIN_ACL => "You can Manage rights on this service for each user in the VHFFS database. Please read help before manage it." );
$template->param( ADMIN_ACL => "Ok, go to ACL admin" );
- $template->param( PERM_TITLE => "Fix permissions" );
- $template->param( PERM_TEXT => "Fixing permissions on a repository solve permission access on the repository. Can be helpful if you encounter problems" );
- $template->param( PERM_BUTTON => "Fix it" );
$template->param( PUBLIC => $cvs->is_public );
Modified: trunk/vhffs-panel/git/prefs.pl
===================================================================
--- trunk/vhffs-panel/git/prefs.pl 2009-05-29 23:01:46 UTC (rev 1422)
+++ trunk/vhffs-panel/git/prefs.pl 2009-05-30 16:50:09 UTC (rev 1423)
@@ -86,10 +86,6 @@
if(save_prefs()) {
exit;
}
- } elsif(defined $cgi->param('fix_perms_submit') ) {
- if(fix_perms()) {
- exit;
- }
}
$template = new Vhffs::Panel::Template( filename => $templatedir."/panel/git/prefs.tmpl" );
@@ -113,9 +109,6 @@
$template->param( TEXT_ACL_ADMIN => gettext('Admin Rights on this object (ACL)') );
$template->param( EXPLAIN_ADMIN_ACL => gettext('You can Manage rights on this service for each user in the VHFFS database. Please read help before manage it.') );
$template->param( ADMIN_ACL => gettext('Ok, go to ACL admin') );
- $template->param( TITLE_PERM => gettext('Fix permissions in this repository') );
- $template->param( PERM_TEXT => gettext('Fixing permissions on a repository solve permission access on the repository. Can be helpful if you encounter problems') );
- $template->param( TEXT_BUTTON_PERM => gettext('Fix them !') );
$template->param( TITLE_OPT => gettext('Options') );
$template->param( TEXT_OPT_ML => gettext('Notify changes on mailing-list :'));
@@ -138,25 +131,6 @@
$panel->build( $template );
$panel->display;
-sub fix_perms {
- if(!$user->can_modify($git)) {
- $panel->add_error( gettext('You\'re not allowed to do this, object is not in active state or you don\'t have enough ACL rights') );
- return 0;
- }
-
- $git->set_status(Vhffs::Constants::WAITING_FOR_MODIFICATION);
-
- if($git->commit < 0) {
- $panel->add_error( gettext('Unable to apply modifications') );
- return 0;
- } else {
- my $url = '/group/view.pl?group='.$group->get_groupname.'&msg='.gettext('Modifications applied. Please wait while your repository is being updated');
- $panel->redirect($url);
- return 1;
- }
-
-}
-
sub save_prefs {
my $public = $cgi->param('public');
my $ml_name = $cgi->param('ml_name');
Modified: trunk/vhffs-panel/templates/cvs/prefs.tmpl
===================================================================
--- trunk/vhffs-panel/templates/cvs/prefs.tmpl 2009-05-29 23:01:46 UTC (rev 1422)
+++ trunk/vhffs-panel/templates/cvs/prefs.tmpl 2009-05-30 16:50:09 UTC (rev 1423)
@@ -19,18 +19,6 @@
</form>
-<h2><TMPL_VAR ESCAPE=1 NAME="PERM_TITLE"></h2>
-<form method="post" action="/cvs/prefs.pl" accept-charset="utf-8">
- <p>
- <TMPL_VAR ESCAPE=1 NAME="PERM_TEXT">
- </p>
- <p class="button">
- <input type="submit" value="<TMPL_VAR ESCAPE=1 NAME="PERM_BUTTON">" name="cvs_fixperms_submit"/>
- <input type="hidden" name="name" value="<TMPL_VAR ESCAPE=1 NAME="TEXT_REPONAME">" />
- </p>
-</form>
-
-
<h2><TMPL_VAR ESCAPE=1 NAME="TEXT_ACL_ADMIN"></h2>
<form method="post" action="../acl/view.pl" accept-charset="utf-8">
Modified: trunk/vhffs-panel/templates/git/prefs.tmpl
===================================================================
--- trunk/vhffs-panel/templates/git/prefs.tmpl 2009-05-29 23:01:46 UTC (rev 1422)
+++ trunk/vhffs-panel/templates/git/prefs.tmpl 2009-05-30 16:50:09 UTC (rev 1423)
@@ -25,19 +25,6 @@
</form>
-<h2><TMPL_VAR ESCAPE=1 NAME="TITLE_PERM"></h2>
-<form method="post" action="/git/prefs.pl" accept-charset="utf-8">
- <p>
- <label for="PUBLIC">
- <TMPL_VAR ESCAPE=1 NAME="PERM_TEXT">
- </label>
- </p>
- <p class="button" id="buttonModify">
- <input type="hidden" name="name" value="<TMPL_VAR ESCAPE=1 NAME="TEXT_REPONAME">" />
- <input type="submit" value="<TMPL_VAR ESCAPE=1 NAME="TEXT_BUTTON_PERM">" name="fix_perms_submit" />
- </p>
-</form>
-
<h2><TMPL_VAR ESCAPE=1 NAME="TEXT_ACL_ADMIN"></h2>
<form method="post" action="../acl/view.pl" accept-charset="utf-8">
Modified: trunk/vhffs-robots/Makefile.am
===================================================================
--- trunk/vhffs-robots/Makefile.am 2009-05-29 23:01:46 UTC (rev 1422)
+++ trunk/vhffs-robots/Makefile.am 2009-05-30 16:50:09 UTC (rev 1423)
@@ -23,7 +23,7 @@
dist_bots_SCRIPTS = \
src/cvs_create.pl \
src/cvs_delete.pl \
- src/cvs_fixperms.pl \
+ src/cvs_public.pl \
src/cvs_viewvcconf.pl \
src/dns_create.pl \
src/dns_delete.pl \
Deleted: trunk/vhffs-robots/src/cvs_fixperms.pl
===================================================================
--- trunk/vhffs-robots/src/cvs_fixperms.pl 2009-05-29 23:01:46 UTC (rev 1422)
+++ trunk/vhffs-robots/src/cvs_fixperms.pl 2009-05-30 16:50:09 UTC (rev 1423)
@@ -1,95 +0,0 @@
-#!%PERL%
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in
-# the documentation and/or other materials provided with the
-# distribution.
-#3. Neither the name of vhffs nor the names of its contributors
-# may be used to endorse or promote products derived from this
-# software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-
-# This is a part of VHFFS platform
-# Please consider the entire platform
-# See http://vhffs.org
-
-# by sod
-
-use strict;
-use utf8;
-
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Main;
-use Vhffs::Robots;
-use Vhffs::Functions;
-use Vhffs::Constants;
-use Vhffs::Services::Cvs;
-
-
-my $vhffs = init Vhffs::Main;
-
-Vhffs::Robots::lock( $vhffs , 'cvs' );
-
-my $cvss = Vhffs::Services::Cvs::getall( $vhffs , Vhffs::Constants::WAITING_FOR_MODIFICATION );
-foreach my $cvs ( @{$cvss} )
-{
- my $readers_file = $cvs->get_dir.'/CVSROOT/readers';
- my $passwd_file = $cvs->get_dir.'/CVSROOT/passwd';
-
- if( $cvs->is_public == 1 )
- {
- Vhffs::Robots::vhffs_log( sprintf( 'CVS fixperm (public) for %s', $cvs->get_cvsroot ), $vhffs);
- $cvs->add_history('CVS is now public');
- chmod 02775 , $cvs->get_dir;
-
- # fix readers file
- Vhffs::Robots::vhffs_log( sprintf('CVS, put repository %s public' , $cvs->get_cvsroot), $vhffs);
- open( FILE , '>'.$readers_file ) or die( 'cannot open '.$readers_file );
- print FILE 'anonymous'."\n";
- close( FILE );
- chown $cvs->get_owner_uid , $cvs->get_owner_gid , $readers_file;
-
- # fix passwd file
- open( FILE , '>'.$passwd_file ) or die( 'cannot open '.$passwd_file );
- print FILE 'anonymous::'.$cvs->get_user->get_username."\n";
- close( FILE );
- chown $cvs->get_owner_uid , $cvs->get_owner_gid , $passwd_file;
- }
- else
- {
- Vhffs::Robots::vhffs_log( sprintf( 'CVS fixperm (private) for %s', $cvs->get_cvsroot ), $vhffs);
- $cvs->add_history('CVS is now private');
- chmod 02770 , $cvs->get_dir;
-
- # delete reader_file if it exists
- unlink $readers_file if -f $readers_file;
- }
-
- $cvs->set_status( Vhffs::Constants::ACTIVATED );
- $cvs->commit;
-}
-
-Vhffs::Robots::unlock( $vhffs , 'cvs' );
-
-exit 0;
Copied: trunk/vhffs-robots/src/cvs_public.pl (from rev 1422, trunk/vhffs-robots/src/cvs_fixperms.pl)
===================================================================
--- trunk/vhffs-robots/src/cvs_public.pl (rev 0)
+++ trunk/vhffs-robots/src/cvs_public.pl 2009-05-30 16:50:09 UTC (rev 1423)
@@ -0,0 +1,95 @@
+#!%PERL%
+# Copyright (c) vhffs project and its contributors
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+#3. Neither the name of vhffs nor the names of its contributors
+# may be used to endorse or promote products derived from this
+# software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+
+# This is a part of VHFFS platform
+# Please consider the entire platform
+# See http://vhffs.org
+
+# by sod
+
+use strict;
+use utf8;
+
+use lib '%VHFFS_LIB_DIR%';
+use Vhffs::Main;
+use Vhffs::Robots;
+use Vhffs::Functions;
+use Vhffs::Constants;
+use Vhffs::Services::Cvs;
+
+
+my $vhffs = init Vhffs::Main;
+
+Vhffs::Robots::lock( $vhffs , 'cvs' );
+
+my $cvss = Vhffs::Services::Cvs::getall( $vhffs , Vhffs::Constants::WAITING_FOR_MODIFICATION );
+foreach my $cvs ( @{$cvss} )
+{
+ my $readers_file = $cvs->get_dir.'/CVSROOT/readers';
+ my $passwd_file = $cvs->get_dir.'/CVSROOT/passwd';
+
+ if( $cvs->is_public == 1 )
+ {
+ Vhffs::Robots::vhffs_log( sprintf( 'CVS fixperm (public) for %s', $cvs->get_cvsroot ), $vhffs);
+ $cvs->add_history('CVS is now public');
+ chmod 02775 , $cvs->get_dir;
+
+ # fix readers file
+ Vhffs::Robots::vhffs_log( sprintf('CVS, put repository %s public' , $cvs->get_cvsroot), $vhffs);
+ open( FILE , '>'.$readers_file ) or die( 'cannot open '.$readers_file );
+ print FILE 'anonymous'."\n";
+ close( FILE );
+ chown $cvs->get_owner_uid , $cvs->get_owner_gid , $readers_file;
+
+ # fix passwd file
+ open( FILE , '>'.$passwd_file ) or die( 'cannot open '.$passwd_file );
+ print FILE 'anonymous::'.$cvs->get_user->get_username."\n";
+ close( FILE );
+ chown $cvs->get_owner_uid , $cvs->get_owner_gid , $passwd_file;
+ }
+ else
+ {
+ Vhffs::Robots::vhffs_log( sprintf( 'CVS fixperm (private) for %s', $cvs->get_cvsroot ), $vhffs);
+ $cvs->add_history('CVS is now private');
+ chmod 02770 , $cvs->get_dir;
+
+ # delete reader_file if it exists
+ unlink $readers_file if -f $readers_file;
+ }
+
+ $cvs->set_status( Vhffs::Constants::ACTIVATED );
+ $cvs->commit;
+}
+
+Vhffs::Robots::unlock( $vhffs , 'cvs' );
+
+exit 0;