]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl group cleanup + functions about security
authorEric Bollengier <eric@eb.homelinux.org>
Fri, 16 Nov 2007 22:04:18 +0000 (22:04 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Fri, 16 Nov 2007 22:04:18 +0000 (22:04 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5941 91ce42f0-d328-0410-95d8-f526ca767f89

gui/bweb/ReleaseNotes
gui/bweb/lang/es/tpl/display_groups.tpl
gui/bweb/lang/es/tpl/groups_add.tpl [deleted file]
gui/bweb/lang/fr/tpl/display_groups.tpl
gui/bweb/lang/fr/tpl/groups_add.tpl [deleted file]
gui/bweb/lib/Bweb.pm
gui/bweb/tpl/client_list.tpl
gui/bweb/tpl/display_groups.tpl
gui/bweb/tpl/groups_add.tpl [deleted file]

index fe08902b62bedf6aee01adb4bb512ba29a6a9e8a..a9b3880fc33aeb714ad7426039cb22447fab2213 100644 (file)
@@ -1,4 +1,8 @@
           Release Notes for bweb 2.2
+2007/11/16
+ - Cleanup group usage
+ - Add some functions for security
+
 2007/11/08
  - Add Prev/Next on job log output
 
index 592656e22383fd76dafa43c4165ecd07482403ec..e7021b50ca433a66f0628465c38ad6885c378156 100644 (file)
@@ -3,9 +3,9 @@
   <h1 class='newstitle'>Groups</h1>
  </div>
  <div class="bodydiv">
-   <form action='?' method='get'>
+   <form name='form1' action='?' method='get'>
     <table id='id<TMPL_VAR ID>'></table>
-    <input type="image" name='action' value='groups_add' title='Add' src='/bweb/add.png'>&nbsp;
+    <input type="image" name='action' onclick='document.form1.reset()' value='groups_edit' title='Add' src='/bweb/add.png'>&nbsp;
     <input type="image" name='action' value='groups_del' 
      onclick="return confirm('Do you want to delete this group ?');" 
      title='Supprimer' src='/bweb/remove.png'>&nbsp;
diff --git a/gui/bweb/lang/es/tpl/groups_add.tpl b/gui/bweb/lang/es/tpl/groups_add.tpl
deleted file mode 100644 (file)
index f19ab68..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<div class='titlediv'>
-  <h1 class='newstitle'> Add a group </h1>
-</div>
-<div class='bodydiv'>
-   <form action="?" method='get'>
-    <table>
-     <tr><td>Group :</td>
-         <td> 
-          <input class="formulaire" type='text' value='' size='32' name='client_group'> 
-         </td>
-     </tr>
-    </table>
-    <input type="image" name='action' value='groups_add' title="Save"
-      src='/bweb/save.png'>
-   </form>
-</div>
index 7d74c0b7fdf9e43f9cf4e4874235e906d442bb9b..910ff0dd85a0aec784eae5f13a24545f16fc5dbd 100644 (file)
@@ -3,9 +3,9 @@
   <h1 class='newstitle'>Groupes</h1>
  </div>
  <div class="bodydiv">
-   <form action='?' method='get'>
+   <form name='form1' action='?' method='get'>
     <table id='id<TMPL_VAR ID>'></table>
-    <input type="image" name='action' value='groups_add' title='Ajouter' src='/bweb/add.png'>&nbsp;
+    <input type="image" name='action' onclick='document.form1.reset()' value='groups_edit' title='Ajouter' src='/bweb/add.png'>&nbsp;
     <input type="image" name='action' value='groups_del' 
      onclick="return confirm('Voulez vous vraiment supprimer ce groupe ?');" 
      title='Supprimer' src='/bweb/remove.png'>&nbsp;
diff --git a/gui/bweb/lang/fr/tpl/groups_add.tpl b/gui/bweb/lang/fr/tpl/groups_add.tpl
deleted file mode 100644 (file)
index 5030acd..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<div class='titlediv'>
-  <h1 class='newstitle'> Ajouter un groupe </h1>
-</div>
-<div class='bodydiv'>
-   <form action="?" method='get'>
-    <table>
-     <tr><td>Groupe :</td>
-         <td> 
-          <input class="formulaire" type='text' value='' size='32' name='client_group'> 
-         </td>
-     </tr>
-    </table>
-    <input type="image" name='action' value='groups_add' title="Sauvegarder"
-      src='/bweb/save.png'>
-   </form>
-</div>
index c1ba509ddbcfd3b5ada0df90090dc52b465581a6..dc003f487d16867dedaf8210da2229d3ff7d0383 100644 (file)
@@ -2540,7 +2540,11 @@ sub groups_edit
     my $grp = $self->get_form(qw/qclient_group db_clients/);
 
     unless ($grp->{qclient_group}) {
-       return $self->error("Can't get group");
+       $self->display({ ID => $cur_id++,
+                        client_group => "''",
+                        %$grp,
+                    }, "groups_edit.tpl");
+       return;
     }
 
     my $query = "
@@ -2565,10 +2569,20 @@ sub groups_save
     $self->can_do('r_group_mgnt');
 
     my $arg = $self->get_form(qw/qclient_group jclients qnewgroup/);
+
+    if (!$arg->{qclient_group} and $arg->{qnewgroup}) {
+       my $query = "
+INSERT INTO client_group (client_group_name) 
+VALUES ($arg->{qnewgroup})
+";
+       $self->dbh_do($query);
+       $arg->{qclient_group} = $arg->{qnewgroup};
+    }
+
     unless ($arg->{qclient_group}) {
        return $self->error("Can't get groups");
     }
-    
+
     $self->{dbh}->begin_work();
 
     my $query = "
@@ -2642,29 +2656,6 @@ DELETE FROM client_group
     $self->display_groups();
 }
 
-
-sub groups_add
-{
-    my ($self) = @_;
-    $self->can_do('r_group_mgnt');
-
-    my $arg = $self->get_form(qw/qclient_group/) ;
-
-    unless ($arg->{qclient_group}) {
-       $self->display({}, "groups_add.tpl");
-       return 1;
-    }
-
-    my $query = "
-INSERT INTO client_group (client_group_name) 
-VALUES ($arg->{qclient_group})
-";
-
-    $self->dbh_do($query);
-
-    $self->display_groups();
-}
-
 sub display_groups
 {
     my ($self) = @_;
@@ -2937,8 +2928,8 @@ sub users_add
      SET passwd=$arg->{qpasswd}, comment=$arg->{qcomment}, 
          use_acl=$arg->{use_acl}
    WHERE username = $u") 
-     and (! $self->dbh_is_mysql() )
-     ) or
+#     and (! $self->dbh_is_mysql() )
+     ) and
     $self->dbh_do("
   INSERT INTO bweb_user (username, passwd, use_acl, comment) 
         VALUES ($u, $arg->{qpasswd}, $arg->{use_acl}, $arg->{qcomment})");
index bf06fcb90c1d01c95f198f3ba5a0cbf1290123db..523436a9797c0e3933807d1c14de6ddc265f3fc6 100644 (file)
@@ -3,7 +3,7 @@
   <h1 class='newstitle'> Clients</h1>
  </div>
  <div class='bodydiv'>
-<form action='?' method='GET'>
+<form name="client" action='?' method='GET'>
      <table id='id<TMPL_VAR NAME=ID>'></table>
        <div class="otherboxtitle">
           Actions &nbsp;
index c0ad0e14c9c8b78991a54959a7f9e93ce842a4b5..a3c1682167ed33716e1d5af624081733ccca8c9c 100644 (file)
@@ -3,9 +3,9 @@
   <h1 class='newstitle'>Groups</h1>
  </div>
  <div class="bodydiv">
-   <form action='?' method='get'>
+   <form name='form1' action='?' method='get'>
     <table id='id<TMPL_VAR ID>'></table>
-    <button type="submit" class="bp" name='action' value='groups_add' title='Add'> <img src='/bweb/add.png' alt=''>Add</button>
+    <button type="submit" class="bp" name='action' onclick='document.form1.reset()' value='groups_edit' title='Add'> <img src='/bweb/add.png' alt=''>Add</button>
     <button type="submit" class="bp" name='action' value='groups_del' 
      onclick="return confirm('Do you want to delete this group ?');" 
      title='Supprimer'> <img src='/bweb/remove.png' alt=''>Remove</button>
diff --git a/gui/bweb/tpl/groups_add.tpl b/gui/bweb/tpl/groups_add.tpl
deleted file mode 100644 (file)
index ca94cfa..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<div class='titlediv'>
-  <h1 class='newstitle'> Add a group </h1>
-</div>
-<div class='bodydiv'>
-   <form action="?" method='get'>
-    <table>
-     <tr><td>Group :</td>
-         <td> 
-          <input class="formulaire" type='text' value='' size='32' name='client_group'> 
-         </td>
-     </tr>
-    </table>
-    <button type="submit" class="bp" name='action' value='groups_add' title="Save"> <img src='/bweb/save.png' alt=''>Save</button>
-   </form>
-</div>