當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Core_BAO_CMSUser::checkUserNameEmailExists方法代碼示例

本文整理匯總了PHP中CRM_Core_BAO_CMSUser::checkUserNameEmailExists方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Core_BAO_CMSUser::checkUserNameEmailExists方法的具體用法?PHP CRM_Core_BAO_CMSUser::checkUserNameEmailExists怎麽用?PHP CRM_Core_BAO_CMSUser::checkUserNameEmailExists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRM_Core_BAO_CMSUser的用法示例。


在下文中一共展示了CRM_Core_BAO_CMSUser::checkUserNameEmailExists方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: checkUserName

 public static function checkUserName()
 {
     $config =& CRM_Core_Config::singleton();
     $username = trim(htmlentities($_POST['cms_name']));
     $isDrupal = ucfirst($config->userFramework) == 'Drupal' ? TRUE : FALSE;
     $isJoomla = ucfirst($config->userFramework) == 'Joomla' ? TRUE : FALSE;
     $params = array('name' => $username);
     $errors = array();
     require_once 'CRM/Core/BAO/CMSUser.php';
     CRM_Core_BAO_CMSUser::checkUserNameEmailExists($params, $errors);
     if ($isDrupal) {
         //unset the drupal errors, related to email field is required.
         unset($errors['email']);
         unset($errors['mail']);
     }
     if (!empty($errors)) {
         //user name is not availble
         $user = array('name' => 'no');
         echo json_encode($user);
     } else {
         //user name is available
         $user = array('name' => 'yes');
         echo json_encode($user);
     }
     exit;
 }
開發者ID:ksecor,項目名稱:civicrm,代碼行數:26,代碼來源:AJAX.php

示例2: checkUserName

 public static function checkUserName()
 {
     $config = CRM_Core_Config::singleton();
     $username = trim(htmlentities($_POST['cms_name']));
     $isDrupal = ucfirst($config->userFramework) == 'Drupal' ? TRUE : FALSE;
     $isJoomla = ucfirst($config->userFramework) == 'Joomla' ? TRUE : FALSE;
     $params = array('name' => $username);
     $errors = array();
     require_once 'CRM/Core/BAO/CMSUser.php';
     CRM_Core_BAO_CMSUser::checkUserNameEmailExists($params, $errors);
     if (isset($errors['cms_name']) || isset($errors['name'])) {
         //user name is not availble
         $user = array('name' => 'no');
         echo json_encode($user);
     } else {
         //user name is available
         $user = array('name' => 'yes');
         echo json_encode($user);
     }
     CRM_Utils_System::civiExit();
 }
開發者ID:hampelm,項目名稱:Ginsberg-CiviDemo,代碼行數:21,代碼來源:AJAX.php


注:本文中的CRM_Core_BAO_CMSUser::checkUserNameEmailExists方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。