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
<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'>
+ <input type="image" name='action' onclick='document.form1.reset()' value='groups_edit' title='Add' src='/bweb/add.png'>
<input type="image" name='action' value='groups_del'
onclick="return confirm('Do you want to delete this group ?');"
title='Supprimer' src='/bweb/remove.png'>
+++ /dev/null
-<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>
<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'>
+ <input type="image" name='action' onclick='document.form1.reset()' value='groups_edit' title='Ajouter' src='/bweb/add.png'>
<input type="image" name='action' value='groups_del'
onclick="return confirm('Voulez vous vraiment supprimer ce groupe ?');"
title='Supprimer' src='/bweb/remove.png'>
+++ /dev/null
-<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>
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 = "
$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 = "
$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) = @_;
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})");
<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
<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>
+++ /dev/null
-<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>