*/
public static function synchronize(&$user, $update, $uf, $ctype, $isLogin = FALSE) {
$userSystem = CRM_Core_Config::singleton()->userSystem;
$session = CRM_Core_Session::singleton();
if (!is_object($session)) {
*/
public static function synchronize(&$user, $update, $uf, $ctype, $isLogin = FALSE) {
$userSystem = CRM_Core_Config::singleton()->userSystem;
$session = CRM_Core_Session::singleton();
if (!is_object($session)) {
$sql = "SELECT count(id) FROM civicrm_uf_match";
return CRM_Core_DAO::singleValueQuery($sql) > 0 ? FALSE : TRUE;
}
$sql = "SELECT count(id) FROM civicrm_uf_match";
return CRM_Core_DAO::singleValueQuery($sql) > 0 ? FALSE : TRUE;
}
* @return int
* contact_id on success, null otherwise
*/
public static function getContactIDs() {
* @return int
* contact_id on success, null otherwise
*/
public static function getContactIDs() {
* @param int $openId
*
* @return bool
* true if allowed to login, false otherwise
*/
public static function getAllowedToLogin($openId) {
* @param int $openId
*
* @return bool
* true if allowed to login, false otherwise
*/
public static function getAllowedToLogin($openId) {
$ufmatch = new CRM_Core_DAO_UFMatch();
$ufmatch->uf_name = $openId;
$ufmatch->allowed_to_login = 1;
$ufmatch = new CRM_Core_DAO_UFMatch();
$ufmatch->uf_name = $openId;
$ufmatch->allowed_to_login = 1;
* Get the next unused uf_id value, since the standalone UF doesn't
* have id's (it uses OpenIDs, which go in a different field)
*
* Get the next unused uf_id value, since the standalone UF doesn't
* have id's (it uses OpenIDs, which go in a different field)
*
$query = "SELECT MAX(uf_id)+1 AS next_uf_id FROM civicrm_uf_match";
$dao = CRM_Core_DAO::executeQuery($query);
if ($dao->fetch()) {
$query = "SELECT MAX(uf_id)+1 AS next_uf_id FROM civicrm_uf_match";
$dao = CRM_Core_DAO::executeQuery($query);
if ($dao->fetch()) {
$session = CRM_Core_Session::singleton();
$contactID = $session->get('userID');
if (!empty($email) && isset($contactID)) {
$session = CRM_Core_Session::singleton();
$contactID = $session->get('userID');
if (!empty($email) && isset($contactID)) {