From: Eric Bollengier Date: Fri, 16 Nov 2007 22:04:18 +0000 (+0000) Subject: ebl group cleanup + functions about security X-Git-Tag: Release-3.0.0~2241 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fa0578420febbd6fa8b3942a687ecd2ee6bb48d7;p=bacula%2Fbacula ebl group cleanup + functions about security git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5941 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/gui/bweb/ReleaseNotes b/gui/bweb/ReleaseNotes index fe08902b62..a9b3880fc3 100644 --- a/gui/bweb/ReleaseNotes +++ b/gui/bweb/ReleaseNotes @@ -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 diff --git a/gui/bweb/lang/es/tpl/display_groups.tpl b/gui/bweb/lang/es/tpl/display_groups.tpl index 592656e223..e7021b50ca 100644 --- a/gui/bweb/lang/es/tpl/display_groups.tpl +++ b/gui/bweb/lang/es/tpl/display_groups.tpl @@ -3,9 +3,9 @@

Groups

-
+
-   +     diff --git a/gui/bweb/lang/es/tpl/groups_add.tpl b/gui/bweb/lang/es/tpl/groups_add.tpl deleted file mode 100644 index f19ab68153..0000000000 --- a/gui/bweb/lang/es/tpl/groups_add.tpl +++ /dev/null @@ -1,16 +0,0 @@ -
-

Add a group

-
-
- - - - - -
Group : - -
- - -
diff --git a/gui/bweb/lang/fr/tpl/display_groups.tpl b/gui/bweb/lang/fr/tpl/display_groups.tpl index 7d74c0b7fd..910ff0dd85 100644 --- a/gui/bweb/lang/fr/tpl/display_groups.tpl +++ b/gui/bweb/lang/fr/tpl/display_groups.tpl @@ -3,9 +3,9 @@

Groupes

-
+
-   +     diff --git a/gui/bweb/lang/fr/tpl/groups_add.tpl b/gui/bweb/lang/fr/tpl/groups_add.tpl deleted file mode 100644 index 5030acd1c6..0000000000 --- a/gui/bweb/lang/fr/tpl/groups_add.tpl +++ /dev/null @@ -1,16 +0,0 @@ -
-

Ajouter un groupe

-
-
- - - - - -
Groupe : - -
- - -
diff --git a/gui/bweb/lib/Bweb.pm b/gui/bweb/lib/Bweb.pm index c1ba509ddb..dc003f487d 100644 --- a/gui/bweb/lib/Bweb.pm +++ b/gui/bweb/lib/Bweb.pm @@ -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})"); diff --git a/gui/bweb/tpl/client_list.tpl b/gui/bweb/tpl/client_list.tpl index bf06fcb90c..523436a979 100644 --- a/gui/bweb/tpl/client_list.tpl +++ b/gui/bweb/tpl/client_list.tpl @@ -3,7 +3,7 @@

Clients

-
+
Actions   diff --git a/gui/bweb/tpl/display_groups.tpl b/gui/bweb/tpl/display_groups.tpl index c0ad0e14c9..a3c1682167 100644 --- a/gui/bweb/tpl/display_groups.tpl +++ b/gui/bweb/tpl/display_groups.tpl @@ -3,9 +3,9 @@

Groups

- +
- + diff --git a/gui/bweb/tpl/groups_add.tpl b/gui/bweb/tpl/groups_add.tpl deleted file mode 100644 index ca94cfa599..0000000000 --- a/gui/bweb/tpl/groups_add.tpl +++ /dev/null @@ -1,15 +0,0 @@ -
-

Add a group

-
-
- - - - - -
Group : - -
- - -