From: Brian Shaughnessy Date: Wed, 5 Aug 2015 14:28:27 +0000 (-0400) Subject: CRM-16968 allow user creation on profile edit forms X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2be4a151b14c7385b3a852b9321e7a5348c91e63;p=civicrm-core.git CRM-16968 allow user creation on profile edit forms --- diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index 59a7096096..f12a95e796 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -823,7 +823,8 @@ class CRM_Profile_Form extends CRM_Core_Form { $this->setDefaultsValues(); $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, NULL); - if ($this->_mode == self::MODE_CREATE) { + + if ($this->_mode == self::MODE_CREATE || $this->_mode == self::MODE_EDIT) { CRM_Core_BAO_CMSUser::buildForm($this, $this->_gid, $emailPresent, $action); } else { @@ -1324,7 +1325,7 @@ class CRM_Profile_Form extends CRM_Core_Form { //create CMS user (if CMS user option is selected in profile) if (!empty($params['cms_create_account']) && - $this->_mode == self::MODE_CREATE + ( $this->_mode == self::MODE_CREATE || $this->_mode == self::MODE_EDIT ) ) { $params['contactID'] = $this->_id; if (!CRM_Core_BAO_CMSUser::create($params, $this->_mail)) {