Ticket #15: lrs_backuppc_admin_tasks.diff
| File lrs_backuppc_admin_tasks.diff, 12.1 kB (added by adam.cecile@linbox.com, 1 year ago) |
|---|
-
lbs/admin.cgi
old new 109 109 <ul><li><a href='rename.cgi?$redir'>$text{'but_rename'}</a> 110 110 <li><a href='renamemac.cgi?$redir'>$text{'but_renamemac'}</a> 111 111 <li><a href='delete.cgi?$redir'>$text{'but_delete'}</a> 112 <li><a href='disable_backuppc.cgi?$redir'>$text{'but_disable_backuppc'}</a> 113 <li><a href='delete_backuppc.cgi?$redir'>$text{'but_delete_backuppc'}</a> 112 114 </ul> 113 115 EOF 114 116 } else { -
lbs/delete_backuppc.cgi
old new 1 #!/usr/bin/perl -w 2 # 3 # $Id: delete.cgi 4244 2007-04-16 09:10:48Z root $ 4 # 5 # Linbox Rescue Server 6 # Copyright (C) 2005 Linbox FAS 7 # 8 # This program is free software; you can redistribute it and/or 9 # modify it under the terms of the GNU General Public License 10 # as published by the Free Software Foundation; either version 2 11 # of the License, or (at your option) any later version. 12 # 13 # This program is distributed in the hope that it will be useful, 14 # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 # GNU General Public License for more details. 17 # 18 # You should have received a copy of the GNU General Public License 19 # along with this program; if not, write to the Free Software 20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 22 use strict; 23 24 # rmtree function 25 use File::Path; 26 27 # get some common functions ... 28 require "lbs.pl"; 29 # ... and vars 30 use vars qw (%access %config %in %text $VERSION); 31 32 lbs_common::init_lbs_conf() or exit(0); 33 34 my %einfo; 35 my $lbs_home = $lbs_common::lbsconf{'basedir'}; 36 my $etherfile = $lbs_home . "/etc/ether"; 37 my ($mac,$name); 38 my ($mesg, $warning); 39 my $result; 40 my @toremove; 41 42 error(text("err_dnf",$lbs_home)) if (not -d $lbs_home); 43 error(text("err_fnf",$etherfile)) if (not -f $etherfile); 44 45 ReadParse(); 46 lbs_common::InClean(); 47 48 # Is the user granted to do this action ? 49 error( $text{'acl_error'} ) if ($access{'modify'}); 50 51 etherLoad($etherfile, \%einfo) or error( lbsGetError() ); 52 53 # Invalid MAC address 54 if (not exists $in{'mac'}) { 55 error($text{'err_invalcgi_nomac'}); 56 } 57 # Seems the users clicked on cancel, redirect to index 58 elsif (exists $in{'cancel'}) { 59 redirect("index.cgi"); 60 } 61 # Yeah! Finally someone confirmed his choice, let's delete stuff 62 elsif (exists $in{'apply'}) { 63 64 $mac = $in{'mac'}; 65 $name = etherGetNameByMac(\%einfo, $mac); 66 67 if (not defined $name) { 68 error(text("err_mac_inval",$mac)); 69 } 70 71 # Drop BackupPC config plus old backups 72 # BackupPC_nightly will remove old files from cpool at its next run 73 my $BACKUPPCCONFDIR="/etc/backuppc"; # FIXME: hardcoded 74 my $BACKUPPCFILESDIR="/var/lib/backuppc/pc"; # FIXME: hardcoded 75 76 # Create an array with all we want to delete 77 push @toremove, "$BACKUPPCCONFDIR/$name.pl" if (-e "$BACKUPPCCONFDIR/$name.pl"); 78 push @toremove, "$BACKUPPCFILESDIR/$name" if (-e "$BACKUPPCFILESDIR/$name"); 79 # And remove it, then 80 foreach (@toremove) { 81 rmtree($_, 0, 1); 82 } 83 84 # We need to fix /etc/backuppc/hosts too 85 `perl -i -ne "print unless m/^$name\\s+[0-9]/i" $BACKUPPCCONFDIR/hosts`; 86 87 $mesg = text("msg_delete_ok",$name,$mac); 88 lbs_common::print_header( $text{'tit_delete'}, "index", $VERSION); 89 lbs_common::print_html_tabs(['list_of_machines', "clients_list"]); 90 91 print "<h2>$mesg</h2>\n" ; 92 93 menuEnd(); 94 footer("", $text{'index'}) ; 95 } 96 97 # No confirmation asked yet, let's bother the user 98 else { 99 100 $mac = $in{'mac'} ; 101 $name = etherGetNameByMac(\%einfo, $mac) ; 102 103 lbs_common::print_header( $text{'tit_delete'}, "index", $VERSION); 104 lbs_common::print_html_tabs(['list_of_machines', "clients_list"]); 105 106 $mesg = text("msg_delete_confirm_backuppc",$name,$mac); 107 $warning = $text{'msg_delete_warn_backuppc'} ; 108 print_confirmation_form("delete_backuppc.cgi", "<h2>$mesg<br><font color=#FF0000>$warning</font></h2>", "mac", $mac ) ; 109 110 # end of tabs 111 lbs_common::print_end_menu(); 112 lbs_common::print_end_menu(); 113 114 # end of page 115 footer( "", $text{'index'} ); 116 } -
lbs/disable_backuppc.cgi
old new 1 #!/usr/bin/perl -w 2 # 3 # $Id: delete.cgi 4244 2007-04-16 09:10:48Z root $ 4 # 5 # Linbox Rescue Server 6 # Copyright (C) 2005 Linbox FAS 7 # 8 # This program is free software; you can redistribute it and/or 9 # modify it under the terms of the GNU General Public License 10 # as published by the Free Software Foundation; either version 2 11 # of the License, or (at your option) any later version. 12 # 13 # This program is distributed in the hope that it will be useful, 14 # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 # GNU General Public License for more details. 17 # 18 # You should have received a copy of the GNU General Public License 19 # along with this program; if not, write to the Free Software 20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 22 use strict; 23 24 # get some common functions ... 25 require "lbs.pl"; 26 # ... and vars 27 use vars qw (%access %config %in %text $VERSION); 28 29 lbs_common::init_lbs_conf() or exit(0); 30 31 my %einfo; 32 my $lbs_home = $lbs_common::lbsconf{'basedir'}; 33 my $etherfile = $lbs_home . "/etc/ether"; 34 my ($mac,$name); 35 my ($mesg, $warning); 36 my $result; 37 38 error(text("err_dnf",$lbs_home)) if (not -d $lbs_home); 39 error(text("err_fnf",$etherfile)) if (not -f $etherfile); 40 41 ReadParse(); 42 lbs_common::InClean(); 43 44 # Is the user granted to do this action ? 45 error( $text{'acl_error'} ) if ($access{'modify'}); 46 47 etherLoad($etherfile, \%einfo) or error( lbsGetError() ); 48 49 # Invalid MAC address 50 if (not exists $in{'mac'}) { 51 error($text{'err_invalcgi_nomac'}); 52 } 53 # Seems the users clicked on cancel, redirect to index 54 elsif (exists $in{'cancel'}) { 55 redirect("index.cgi"); 56 } 57 # Yeah! Finally someone confirmed his choice, let's disable the host 58 elsif (exists $in{'apply'}) { 59 60 $mac = $in{'mac'}; 61 $name = etherGetNameByMac(\%einfo, $mac); 62 63 if (not defined $name) { 64 error(text("err_mac_inval",$mac)); 65 } 66 67 # Modify host's BackupPC conf file 68 my $BACKUPPCCONFDIR="/etc/backuppc"; # FIXME: hardcoded 69 my $BACKUPPCCONFFILE="$BACKUPPCCONFDIR/$name.pl"; 70 71 # Set $Conf{FullPeriod} to -1 72 `perl -pi -e 's/\\\$Conf{FullPeriod}.*\$/\\\$Conf{FullPeriod} = -1;/' $BACKUPPCCONFFILE`; 73 74 $mesg = text("msg_disable_backuppc_ok",$name,$mac); 75 lbs_common::print_header( $text{'tit_disable_backuppc'}, "index", $VERSION); 76 lbs_common::print_html_tabs(['list_of_machines', "clients_list"]); 77 78 print "<h2>$mesg</h2>\n"; 79 80 menuEnd(); 81 footer("", $text{'index'}); 82 } 83 84 # No confirmation asked yet, let's bother the user 85 else { 86 87 $mac = $in{'mac'} ; 88 $name = etherGetNameByMac(\%einfo, $mac) ; 89 90 lbs_common::print_header( $text{'tit_disable_backuppc'}, "index", $VERSION); 91 lbs_common::print_html_tabs(['list_of_machines', "clients_list"]); 92 93 $mesg = text("msg_disable_confirm_backuppc",$name,$mac); 94 $warning = $text{'msg_disable_warn_backuppc'} ; 95 print_confirmation_form("disable_backuppc.cgi", "<h2>$mesg<br><font color=#FF0000>$warning</font></h2>", "mac", $mac ) ; 96 97 # end of tabs 98 lbs_common::print_end_menu(); 99 lbs_common::print_end_menu(); 100 101 # end of page 102 footer( "", $text{'index'} ); 103 } -
lbs/lang/en
old new 20 20 but_return=Return 21 21 but_rm_machine=Remove this client 22 22 but_sync=Synchronize 23 but_disable_backuppc=Disable files backup 24 but_delete_backuppc=Delete files backup 23 25 24 26 err_adminid_mandat=The admin ID is mandatory. 25 27 err_basedirnf=LRS root directory <b>$1</b> not found. You should check <tt>basedir</tt> located into <tt>lbs.conf</tt> . … … 166 168 msg_conf_partcopy=Partition $1, disk $2 ($3) 167 169 msg_conf_ptabs=Disk $1 partition table 168 170 msg_delete_confirm=Remove host <b>$1</b> ($2) ? 171 msg_delete_confirm_backuppc=Remove host <b>$1</b> ($2) from files backups ? 169 172 msg_delete_ok=Host <b>$1</b> ($2) successfully removed. 170 173 msg_delete_warn=WARNING: All information about this host will be deleted, including backups ! 174 msg_delete_warn_backuppc=WARNING: All information about this host files backups will be deleted, including backups ! 171 175 msg_delimg_confirm=Remove image <b>$1</b> ? 172 176 msg_delimg_symlink=This image is just a link to one another. Only this link will be deleted. 173 177 msg_delimg_warn=WARNING: All data about this image will be deleted! 174 178 msg_dhcp_addofentry=Add of entry 175 179 msg_dhcp_formdesc=Add a new host entry in the LRS for system backup 176 180 msg_dhcp_nolic=Sorry, you cannot add more clients. License exhausted. 181 msg_disable_backuppc_ok=Files backups disabled sucessfully for host <b>$1</b> ($2). 182 msg_disable_confirm_backuppc=Disable files backups for host <b>$1</b> ($2) ? 183 msg_disable_warn_backuppc=WARNING: No more automatic files backups will be done. Current backups will stay available. 177 184 msg_imgbase_delconfirm=Remove image <b>$1</b> ? 178 185 msg_imgbase_delwarn=WARNING: All data about this image will be deleted! 179 186 msg_index_empty=No registered host. … … 206 213 tit_desc=LRS : Description Edition 207 214 tit_details=LRS : Details 208 215 tit_dhcp=LRS : DHCP 216 tit_disable_backuppc=LRS: Disable files backup 209 217 tit_error=LRS : Error 210 218 tit_hwinfo=LRS : Hardware Config 211 219 tit_imagesize=Compressed image size (in MB) -
lbs/lang/fr
old new 20 20 but_return=Retour 21 21 but_rm_machine=Effacer cette machine 22 22 but_sync=Synchroniser 23 but_disable_backuppc=Désactiver la sauvegarde fichiers 24 but_delete_backuppc=Supprimer de la sauvegarde fichiers 23 25 24 26 err_adminid_mandat=Le mot de passe d'identification est obligatoire. 25 27 err_basedirnf=Le répertoire racine LRS <b>$1</b> est inaccessible. Veuillez vérifier le paramètre <tt>basedir</tt> dans le fichier <tt>lbs.conf</tt> . … … 167 169 msg_conf_partcopy=Partition $1, disque $2 ($3) 168 170 msg_conf_ptabs=Table de partitions du disque $1 169 171 msg_delete_confirm=Effacer la machine <b>$1</b> ($2) ? 172 msg_delete_confirm_backuppc=Effacer la machine <b>$1</b> ($2) de la sauvegarde fichiers ? 170 173 msg_delete_ok=Effacement de la machine <b>$1</b> ($2) effectué avec succès. 171 174 msg_delete_warn=ATTENTION: cela effacera toutes les données concernant cette machine. Y compris ses sauvegardes! 175 msg_delete_warn_backuppc=ATTENTION: cela effacera toutes les données concernant la sauvegarde fichiers de cette machine. Y compris ses sauvegardes! 172 176 msg_delimg_confirm=Effacer l'image <b>$1</b> ? 173 177 msg_delimg_symlink=Cette image est juste un lien vers une autre image. Seul le lien lui-même sera effacé. 174 178 msg_delimg_warn=ATTENTION: cela effacera toutes les données concernant cette image! 175 179 msg_dhcp_addofentry=Ajout de l'entrée 176 180 msg_dhcp_formdesc=Ajout d'une nouveau client LRS pour la sauvegarde système 177 181 msg_dhcp_nolic=Désolé, vous ne pouvez plus ajouter d'autres clients. Pas assez de licences. 182 msg_disable_backuppc_ok=Sauvegarde fichiers désactivée avec succès pour la machine <b>$1</b> ($2). 183 msg_disable_confirm_backuppc=Désactiver la sauvegarde fichiers de <b>$1</b> ($2) ? 184 msg_disable_warn_backuppc=ATTENTION: Plus aucune sauvegarde ne sera effectuée automatiquement. Par contres, les sauvegardes actuelles resteront disponibles. 178 185 msg_imgbase_delconfirm=Effacer l'image <b>$1</b> ? 179 186 msg_imgbase_delwarn=ATTENTION: Cela effacera toutes les données concernant cette image ! 180 187 msg_index_empty=Aucune machine enregistrée … … 207 214 tit_desc=LRS : Edition de description 208 215 tit_details=LRS : Détails 209 216 tit_dhcp=LRS : DHCP 217 tit_disable_backuppc=LRS: Désactivation sauvegarde fichiers 210 218 tit_error=LRS : Erreur 211 219 tit_hwinfo=LRS : Config matérielle 212 220 tit_imagesize=Taille de l'image compressée (en Mo)
