本文整理汇总了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);
}
}
示例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);