Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
00378f8c
Commit
00378f8c
authored
May 10, 2007
by
Donal McMullan
Browse files
New auth_get_auth_instance function, to get user's auth method
parent
b441986d
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/auth/lib.php
View file @
00378f8c
...
...
@@ -399,6 +399,22 @@ function auth_get_auth_instances_for_institution($institution) {
return
$cache
[
$institution
];
}
/**
* Given a user, returns the authentication instance used.
*
* @param object $user User object with an authinstance member
* @return array Array of auth instance records
*/
function
auth_get_auth_instance
(
$user
)
{
static
$cache
=
array
();
if
(
!
isset
(
$cache
[
$user
->
id
]))
{
$cache
[
$user
->
id
]
=
get_record
(
'auth_instance'
,
'id'
,
$user
->
authinstance
,
null
,
null
,
null
,
null
,
'id, instancename, priority, authname'
);
}
return
$cache
[
$user
->
id
];
}
/**
* Checks whether the current user needs to change their password, and handles
* the password changing if it's required.
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment