summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Config
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Config')
-rw-r--r--Bugzilla/Config/Auth.pm13
-rw-r--r--Bugzilla/Config/BugChange.pm3
-rw-r--r--Bugzilla/Config/Common.pm47
3 files changed, 45 insertions, 18 deletions
diff --git a/Bugzilla/Config/Auth.pm b/Bugzilla/Config/Auth.pm
index 219e834ee..326c4cd3f 100644
--- a/Bugzilla/Config/Auth.pm
+++ b/Bugzilla/Config/Auth.pm
@@ -75,12 +75,6 @@ sub get_param_list {
},
{
- name => 'webservice_email_filter',
- type => 'b',
- default => 0
- },
-
- {
name => 'emailregexp',
type => 't',
default => q:^[\\w\\.\\+\\-=']+@[\\w\\.\\-]+\\.[\\w\\-]+$:,
@@ -95,9 +89,10 @@ sub get_param_list {
},
{
- name => 'emailsuffix',
- type => 't',
- default => ''
+ name => 'use_email_as_login',
+ type => 'b',
+ default => '1',
+ onchange => \&change_use_email_as_login
},
{
diff --git a/Bugzilla/Config/BugChange.pm b/Bugzilla/Config/BugChange.pm
index b8a80dd94..b6cd7ae43 100644
--- a/Bugzilla/Config/BugChange.pm
+++ b/Bugzilla/Config/BugChange.pm
@@ -38,7 +38,8 @@ sub get_param_list {
type => 's',
choices => \@closed_bug_statuses,
default => $closed_bug_statuses[0],
- checker => \&check_bug_status
+ checker => \&check_bug_status,
+ onchange => \&change_duplicate_or_move_bug_status
},
{
diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm
index 6e89fdcae..e6e0d4a23 100644
--- a/Bugzilla/Config/Common.pm
+++ b/Bugzilla/Config/Common.pm
@@ -29,6 +29,8 @@ use parent qw(Exporter);
check_bug_status check_smtp_auth check_theschwartz_available
check_maxattachmentsize check_email check_smtp_ssl
check_comment_taggers_group check_smtp_server check_resolution
+
+ change_use_email_as_login change_duplicate_or_move_bug_status
);
# Checking functions for the various values
@@ -362,18 +364,36 @@ sub check_comment_taggers_group {
return check_group($group_name);
}
+# Change handler functions for various parameters
+
+# If use_email_as_login is turned on, update all login names to be email
+# addresses.
+sub change_use_email_as_login {
+ my $newvalue = shift;
+ if ($newvalue) {
+ Bugzilla->dbh->do('UPDATE profiles SET login_name = email');
+ }
+}
+
+sub change_duplicate_or_move_bug_status {
+ my $newvalue = shift;
+ Bugzilla::Status::add_missing_bug_status_transitions($newvalue);
+}
+
# OK, here are the parameter definitions themselves.
#
# Each definition is a hash with keys:
#
-# name - name of the param
-# desc - description of the param (for editparams.cgi)
-# type - see below
-# choices - (optional) see below
-# default - default value for the param
-# checker - (optional) checking function for validating parameter entry
-# It is called with the value of the param as the first arg and a
-# reference to the param's hash as the second argument
+# name - name of the param
+# desc - description of the param (for editparams.cgi)
+# type - see below
+# choices - (optional) see below
+# default - default value for the param
+# checker - (optional) checking function for validating parameter entry.
+# It is called with the value of the param as the first arg
+# and a reference to the param's hash as the second argument.
+# onchange - (optional) handling function for parameter changes.
+# The argument is the new value of the param.
#
# The type value can be one of the following:
#
@@ -467,6 +487,17 @@ Checks that the value is a valid regexp
Checks that the required modules for comment tagging are installed, and that a
valid group is provided.
+=item C<change_use_email_as_login>
+
+Change handler for "use_email_as_login" parameter - if param is changed to
+true, updates login_name field to be the value of the email field for all
+users.
+
+=item C<change_duplicate_or_move_bug_status>
+
+Change handler for "duplicate_or_move_bug_status" parameter - if param is
+changed, insert all missing transitions to the new bug status.
+
=back
=head1 B<Methods in need of POD>