if (!($createexp)
|| ($login !~ /$createexp/)) {
ThrowUserError("account_creation_disabled");
- exit;
}
# Create account
if ($classification ne $classificationold) {
unless ($classification) {
- ThrowUserError("classification_not_specified")
+ ThrowUserError("classification_not_specified");
}
if (TestClassification($classification)) {
# do we have a product?
unless ($prod) {
ThrowUserError('product_not_specified');
- exit;
}
unless (TestProduct $prod) {
ThrowUserError('product_doesnt_exist',
{'product' => $prod});
- exit;
}
}
# do we have the component?
unless ($comp) {
ThrowUserError('component_not_specified');
- exit;
}
CheckProduct($prod);
ThrowUserError('component_not_valid',
{'product' => $prod,
'name' => $comp});
- exit;
}
}
unless ($component) {
ThrowUserError('component_blank_name',
{'name' => $component});
- exit;
}
if (TestComponent($product, $component)) {
ThrowUserError('component_already_exists',
{'name' => $component});
- exit;
}
if (length($component) > 64) {
ThrowUserError('component_name_too_long',
{'name' => $component});
- exit;
}
my $description = trim($cgi->param('description') || '');
if ($description eq '') {
ThrowUserError('component_blank_description',
{'name' => $component});
- exit;
}
my $initialowner = trim($cgi->param('initialowner') || '');
if ($initialowner eq '') {
ThrowUserError('component_need_initialowner',
{'name' => $component});
- exit;
}
my $initialownerid = login_to_id ($initialowner);
if (!$initialownerid) {
ThrowUserError('component_need_valid_initialowner',
{'name' => $component});
- exit;
}
my $initialqacontact = trim($cgi->param('initialqacontact') || '');
if (!$initialqacontactid && $initialqacontact ne '') {
ThrowUserError('component_need_valid_initialqacontact',
{'name' => $component});
- exit;
}
}
if (length($component) > 64) {
ThrowUserError('component_name_too_long',
{'name' => $component});
- exit;
}
# Note that the order of this tests is important. If you change
unless ($description) {
ThrowUserError('component_blank_description',
{'name' => $componentold});
- exit;
}
SendSQL("UPDATE components
SET description=" . SqlQuote($description) . "
unless ($initialownerid) {
ThrowUserError('component_need_valid_initialowner',
{'name' => $componentold});
- exit;
}
SendSQL("UPDATE components
if (!$initialqacontactid && $initialqacontact ne '') {
ThrowUserError('component_need_valid_initialqacontact',
{'name' => $componentold});
- exit;
}
SendSQL("UPDATE components
unless ($component) {
ThrowUserError('component_must_have_a_name',
{'name' => $componentold});
- exit;
}
if (TestComponent($product, $component)) {
ThrowUserError('component_already_exists',
{'name' => $component});
- exit;
}
SendSQL("UPDATE components SET name=" . SqlQuote($component) .
my ($name, $description) = @_;
if ($name eq "") {
ThrowUserError("keyword_blank_name");
- exit;
}
if ($name =~ /[\s,]/) {
ThrowUserError("keyword_invalid_name");
- exit;
}
if ($description eq "") {
ThrowUserError("keyword_blank_description");
- exit;
}
}
if (FetchOneColumn()) {
$vars->{'name'} = $name;
ThrowUserError("keyword_already_exists");
- exit;
}
if (!$name) {
$vars->{'id'} = $id;
ThrowCodeError("invalid_keyword_id", $vars);
- exit;
}
SendSQL("SELECT count(*)
if ($tmp && $tmp != $id) {
$vars->{'name'} = $name;
ThrowUserError("keyword_already_exists", $vars);
- exit;
}
SendSQL("UPDATE keyworddefs SET name = " . SqlQuote($name) .
# do we have a product?
unless ($product) {
ThrowUserError('product_not_specified');
- exit;
}
# Does it exist in the DB?
unless (TestProduct $product) {
ThrowUserError('product_doesnt_exist',
{'product' => $product});
- exit;
}
}
# do we have the milestone and product combination?
unless ($milestone) {
ThrowUserError('milestone_not_specified');
- exit;
}
CheckProduct($product);
ThrowUserError('milestone_not_valid',
{'product' => $product,
'milestone' => $milestone});
- exit;
}
}
unless ($milestone) {
ThrowUserError('milestone_blank_name',
{'name' => $milestone});
- exit;
}
if (length($milestone) > 20) {
ThrowUserError('milestone_name_too_long',
{'name' => $milestone});
- exit;
}
# Need to store in case detaint_natural() clears the sortkey
ThrowUserError('milestone_sortkey_invalid',
{'name' => $milestone,
'sortkey' => $stored_sortkey});
- exit;
}
if (TestMilestone($product, $milestone)) {
ThrowUserError('milestone_already_exists',
{'name' => $milestone,
'product' => $product});
- exit;
}
# Add the new milestone
if (length($milestone) > 20) {
ThrowUserError('milestone_name_too_long',
{'name' => $milestone});
- exit;
}
my $dbh = Bugzilla->dbh;
ThrowUserError('milestone_sortkey_invalid',
{'name' => $milestone,
'sortkey' => $stored_sortkey});
- exit;
}
trick_taint($milestoneold);
if ($milestone ne $milestoneold) {
unless ($milestone) {
ThrowUserError('milestone_blank_name');
- exit;
}
if (TestMilestone($product, $milestone)) {
ThrowUserError('milestone_already_exists',
{'name' => $milestone,
'product' => $product});
- exit;
}
trick_taint($milestone);
# do we have a classification?
unless ($cl) {
ThrowUserError('classification_not_specified');
- exit;
}
unless (TestClassification $cl) {
ThrowUserError('classification_doesnt_exist',
{'name' => $cl});
- exit;
}
}
# do we have a product?
unless ($prod) {
ThrowUserError('product_not_specified');
- exit;
}
unless (TestProduct $prod) {
ThrowUserError('product_doesnt_exist',
{'product' => $prod});
- exit;
}
}
# do we have the version?
unless ($ver) {
ThrowUserError('version_not_specified');
- exit;
}
CheckProduct($prod);
ThrowUserError('version_not_valid',
{'product' => $prod,
'version' => $ver});
- exit;
}
}
unless ($version) {
ThrowUserError('version_blank_name',
{'name' => $version});
- exit;
}
if (TestVersion($product,$version)) {
ThrowUserError('version_already_exists',
{'name' => $version,
'product' => $product});
- exit;
}
# Add the new version
if ($version ne $versionold) {
unless ($version) {
ThrowUserError('version_blank_name');
- exit;
}
if (TestVersion($product,$version)) {
ThrowUserError('version_already_exists',
{'name' => $version,
'product' => $product});
- exit;
}
SendSQL("UPDATE bugs
SET version=" . SqlQuote($version) . "