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


PHP CRM_Core_BAO_UFMatch::getContactIDs方法代碼示例

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


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

示例1: run

function run()
{
    $openid = getOpenIDURL();
    $consumer = getConsumer();
    // Begin the OpenID authentication process.
    $auth_request = $consumer->begin($openid);
    // No auth request means we can't begin OpenID.
    if (!$auth_request) {
        // check for new install, if no, go to index, else goto new-install page
        require_once 'CRM/Core/BAO/UFMatch.php';
        $contactIds = CRM_Core_BAO_UFMatch::getContactIDs();
        if (count($contactIds) > 0) {
            displayError("Authentication error; not a valid OpenID.");
        } else {
            $session =& CRM_Core_Session::singleton();
            $session->set('new_install', true);
            include 'new_install.html';
            exit(1);
        }
    }
    $sreg_request = Auth_OpenID_SRegRequest::build(array('nickname'), array('fullname', 'email'));
    if ($sreg_request) {
        $auth_request->addExtension($sreg_request);
    }
    $policy_uris = null;
    if (isset($_REQUEST['policies'])) {
        $policy_uris = $_REQUEST['policies'];
    }
    $pape_request = new Auth_OpenID_PAPE_Request($policy_uris);
    if ($pape_request) {
        $auth_request->addExtension($pape_request);
    }
    $redirect_url = $auth_request->redirectURL(getTrustRoot(), getReturnTo());
    // If the redirect URL can't be built, display an error
    // message.
    if (Auth_OpenID::isFailure($redirect_url)) {
        displayError("Could not redirect to server: " . $redirect_url->message);
    } else {
        // Send redirect.
        header("Location: " . $redirect_url);
        exit(2);
    }
}
開發者ID:ksecor,項目名稱:civicrm,代碼行數:43,代碼來源:try_auth.php

示例2: header

<?php

/********************************************
 * This is currently not used; ignore.
 *
 * WSM - 12/27/07
 ********************************************/
require_once 'auth_common.php';
require_once 'CRM/Core/BAO/UFMatch.php';
$ar = CRM_Core_BAO_UFMatch::getContactIDs();
if (!empty($ar[0])) {
    header("Location:login.php");
    exit(0);
}
$openid = $_POST['openid_url'];
$firstname = $_POST['first_name'];
$lastname = $_POST['last_name'];
$email = $_POST['email'];
//require_once 'CRM/Utils/System/Standalone.php';
$user = array('openid' => $openid, 'firstname' => $firstname, 'lastname' => $lastname, 'email' => $email);
$session =& CRM_Core_Session::singleton();
$session->set('user', $user);
$session->set('new_install', true);
header("Location:try_auth.php?openid_url={$openid}");
exit(0);
開發者ID:ksecor,項目名稱:civicrm,代碼行數:25,代碼來源:add_user.php


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