3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * This class generates form components for Synchronizing CMS Users
21 class CRM_Admin_Form_CMSUser
extends CRM_Core_Form
{
26 public $submitOnce = TRUE;
29 * Build the form object.
31 public function buildQuickForm() {
41 'name' => ts('Cancel'),
47 * Process the form submission.
49 public function postProcess() {
50 $result = CRM_Utils_System
::synchronizeUsers();
52 $status = ts('Checked one user record.',
54 'count' => $result['contactCount'],
55 'plural' => 'Checked %count user records.',
58 if ($result['contactMatching']) {
59 $status .= '<br />' . ts('Found one matching contact record.',
61 'count' => $result['contactMatching'],
62 'plural' => 'Found %count matching contact records.',
67 $status .= '<br />' . ts('Created one new contact record.',
69 'count' => $result['contactCreated'],
70 'plural' => 'Created %count new contact records.',
73 CRM_Core_Session
::setStatus($status, ts('Synchronize Complete'), 'success');
74 CRM_Core_Session
::singleton()->pushUserContext(CRM_Utils_System
::url('civicrm/admin', 'reset=1'));