Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
ffdc26b8
Commit
ffdc26b8
authored
4 years ago
by
eileen
Browse files
Options
Downloads
Patches
Plain Diff
#2017
Remove unused function OpenID::isAllowedToLogin
parent
fd364ea9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CRM/Core/BAO/OpenID.php
+0
-17
0 additions, 17 deletions
CRM/Core/BAO/OpenID.php
tests/phpunit/CRM/Core/BAO/OpenIDTest.php
+0
-45
0 additions, 45 deletions
tests/phpunit/CRM/Core/BAO/OpenIDTest.php
with
0 additions
and
62 deletions
CRM/Core/BAO/OpenID.php
+
0
−
17
View file @
ffdc26b8
...
...
@@ -43,23 +43,6 @@ class CRM_Core_BAO_OpenID extends CRM_Core_DAO_OpenID {
return
CRM_Core_BAO_Block
::
getValues
(
'openid'
,
$entityBlock
);
}
/**
* Returns whether or not this OpenID is allowed to login.
*
* @param string $identity_url
* The OpenID to check.
*
* @return bool
*/
public
static
function
isAllowedToLogin
(
$identity_url
)
{
$openId
=
new
CRM_Core_DAO_OpenID
();
$openId
->
openid
=
$identity_url
;
if
(
$openId
->
find
(
TRUE
))
{
return
$openId
->
allowed_to_login
==
1
;
}
return
FALSE
;
}
/**
* Get all the openids for a specified contact_id, with the primary openid being first
*
...
...
This diff is collapsed.
Click to expand it.
tests/phpunit/CRM/Core/BAO/OpenIDTest.php
+
0
−
45
View file @
ffdc26b8
...
...
@@ -62,51 +62,6 @@ class CRM_Core_BAO_OpenIDTest extends CiviUnitTestCase {
$this
->
assertDBRowNotExist
(
'CRM_Contact_DAO_Contact'
,
$contactId
);
}
/**
* IfAllowedToLogin() method (set and reset allowed_to_login)
*/
public
function
testIfAllowedToLogin
()
{
$contactId
=
$this
->
individualCreate
();
$this
->
assertDBRowExist
(
'CRM_Contact_DAO_Contact'
,
$contactId
);
$openIdURL
=
"http://test-username.civicrm.org/"
;
$params
=
[
'contact_id'
=>
$contactId
,
'location_type_id'
=>
1
,
'openid'
=>
$openIdURL
,
'is_primary'
=>
1
,
];
$openObject
=
CRM_Core_BAO_OpenID
::
add
(
$params
);
$openId
=
$openObject
->
id
;
$this
->
assertDBNotNull
(
'CRM_Core_DAO_OpenID'
,
$openIdURL
,
'id'
,
'openid'
,
'Database check for created OpenID.'
);
$allowedToLogin
=
CRM_Core_BAO_OpenID
::
isAllowedToLogin
(
$openIdURL
);
$this
->
assertEquals
(
$allowedToLogin
,
FALSE
,
'Verify allowed_to_login value is 0.'
);
// Now call add() to modify an existing open-id record
$params
=
[
'id'
=>
$openId
,
'contact_id'
=>
$contactId
,
'openid'
=>
$openIdURL
,
'is_bulkmail'
=>
1
,
'allowed_to_login'
=>
1
,
];
CRM_Core_BAO_OpenID
::
add
(
$params
);
$allowedToLogin
=
CRM_Core_BAO_OpenID
::
isAllowedToLogin
(
$openIdURL
);
$this
->
assertEquals
(
$allowedToLogin
,
TRUE
,
'Verify allowed_to_login value is 1.'
);
$this
->
contactDelete
(
$contactId
);
//domain contact doesn't really get deleted //
$this
->
assertDBRowNotExist
(
'CRM_Contact_DAO_Contact'
,
$contactId
);
}
/**
* AllOpenIDs() method - get all OpenIDs for the given contact
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment