From fa0578420febbd6fa8b3942a687ecd2ee6bb48d7 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Fri, 16 Nov 2007 22:04:18 +0000 Subject: [PATCH] ebl group cleanup + functions about security git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5941 91ce42f0-d328-0410-95d8-f526ca767f89 --- gui/bweb/ReleaseNotes | 4 +++ gui/bweb/lang/es/tpl/display_groups.tpl | 4 +-- gui/bweb/lang/es/tpl/groups_add.tpl | 16 --------- gui/bweb/lang/fr/tpl/display_groups.tpl | 4 +-- gui/bweb/lang/fr/tpl/groups_add.tpl | 16 --------- gui/bweb/lib/Bweb.pm | 45 ++++++++++--------------- gui/bweb/tpl/client_list.tpl | 2 +- gui/bweb/tpl/display_groups.tpl | 4 +-- gui/bweb/tpl/groups_add.tpl | 15 --------- 9 files changed, 29 insertions(+), 81 deletions(-) delete mode 100644 gui/bweb/lang/es/tpl/groups_add.tpl delete mode 100644 gui/bweb/lang/fr/tpl/groups_add.tpl delete mode 100644 gui/bweb/tpl/groups_add.tpl 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 : - -
- - -
-- 2.39.5