@@ -753,7 +753,7 @@ function profile_form_validate_handler(&$form, &$form_state) {
753
753
* @see profile_attach_form()
754
754
*/
755
755
function profile_form_before_user_register_submit_handler(&$form, &$form_state) {
756
- global $conf ;
756
+ $config = config('system.core') ;
757
757
758
758
// List of available operations during the registration.
759
759
$register_ops = array('register_admin_created', 'register_no_approval_required', 'register_pending_approval');
@@ -764,12 +764,12 @@ function profile_form_before_user_register_submit_handler(&$form, &$form_state)
764
764
foreach ($register_ops as $op) {
765
765
766
766
// Save variable value.
767
- if (isset($conf[ 'user_mail_' . $op . '_notify'] )) {
768
- $changed_ops['user_mail_' . $op . '_notify'] = $conf[ 'user_mail_' . $op . '_notify'] ;
767
+ if ($config->get( 'user_mail_' . $op . '_notify')) {
768
+ $changed_ops['user_mail_' . $op . '_notify'] = $config->get( 'user_mail_' . $op . '_notify') ;
769
769
}
770
770
771
771
// Temporary disable the notification about registration.
772
- $conf[ 'user_mail_' . $op . '_notify'] = FALSE;
772
+ $config->set( 'user_mail_' . $op . '_notify', FALSE) ;
773
773
}
774
774
}
775
775
@@ -785,7 +785,7 @@ function profile_form_before_user_register_submit_handler(&$form, &$form_state)
785
785
* @see profile_attach_form()
786
786
*/
787
787
function profile_form_after_user_register_submit_handler(&$form, &$form_state) {
788
- global $conf ;
788
+ $config = config('system.core') ;
789
789
790
790
// List of registration operations that where
791
791
// notification values were changed.
@@ -798,11 +798,11 @@ function profile_form_after_user_register_submit_handler(&$form, &$form_state) {
798
798
// If we changed the notification value in
799
799
// profile_form_before_user_register_submit_handler() then change it back.
800
800
if (isset($changed_ops['user_mail_' . $op . '_notify'])) {
801
- $conf[ 'user_mail_' . $op . '_notify'] = $changed_ops['user_mail_' . $op . '_notify'];
801
+ $config->set( 'user_mail_' . $op . '_notify', $changed_ops['user_mail_' . $op . '_notify']) ;
802
802
}
803
803
// Otherwise just remove this value from a global variables array.
804
804
else {
805
- unset($conf[ 'user_mail_' . $op . '_notify'] );
805
+ $config->set( 'user_mail_' . $op . '_notify', TRUE );
806
806
}
807
807
}
808
808
0 commit comments