2016-03-24 Fred Gleason <fredg@paravelsystems.com>

* Added 'web/tests/utils.js'.
	* Fixed a bug in 'web/rdxport/carts.cpp' that allowed the EditCart web
	method to set carts to non-existent groups.
This commit is contained in:
Fred Gleason
2016-03-24 12:15:04 -04:00
parent 1b3721f66c
commit 6fbb9a1206
4 changed files with 157 additions and 1 deletions

View File

@@ -229,6 +229,7 @@ void Xport::EditCart()
{
QString where="";
RDCart *cart;
RDGroup *group;
int cart_number;
int include_cuts=0;
QString group_name;
@@ -260,6 +261,19 @@ void Xport::EditCart()
if(!xport_user->groupAuthorized(group_name)) {
XmlExit("No such group",404);
}
group=new RDGroup(group_name);
if(!group->exists()) {
delete group;
XmlExit("No such group",404);
}
if(group->enforceCartRange()) {
if(((unsigned)cart_number<group->defaultLowCart())||
((unsigned)cart_number>group->defaultHighCart())) {
delete group;
XmlExit("Invalid cart number for group",409);
}
}
delete group;
}
//