Skip to content

Commit

Permalink
Code review fixes for Auth Plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
vboctor committed Apr 16, 2017
1 parent 1850aae commit 2d5ab94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions core/authentication_api.php
Expand Up @@ -76,8 +76,9 @@

/**
* Gets set of flags for authentication for the specified user.
* @param int|null|bool The user id or null for logged in user or NO_USER/false for user that doesn't exist
* @param int|null|bool $p_user_id The user id or null for logged in user or NO_USER/false for user that doesn't exist
* in the system, that may be auto-provisioned.
* @param string $p_username The username or email
* @return AuthFlags The auth flags object to use.
*/
function auth_flags( $p_user_id = null, $p_username = '' ) {
Expand All @@ -89,7 +90,7 @@ function auth_flags( $p_user_id = null, $p_username = '' ) {

if( !$t_user_id && is_blank( $p_username ) ) {
# If user is not in db, must supply the name.
trigger_error( GENERIC_ERROR );
trigger_error( ERROR_GENERIC, ERROR );
}

if( $t_user_id ) {
Expand Down
5 changes: 3 additions & 2 deletions core/classes/AuthFlags.class.php
Expand Up @@ -150,8 +150,10 @@ function setPasswordManagedExternallyMessage( $p_message ) {
*/
function getPasswordManagedExternallyMessage() {
if( empty( $this->password_managed_elsewhere_message ) ) {
return lang_get( 'password_managed_elsewhere_message' );
return lang_get( 'no_password_change' );
}

return $this->password_managed_elsewhere_message;
}

/**
Expand Down Expand Up @@ -385,7 +387,6 @@ function setReauthenticationLifetime( $p_seconds ) {
/**
* Gets the number of seconds to re-authenticate the user after.
*
* @param int $p_seconds The number of seconds to prompt for re-authentication after.
* @return int seconds after which the user should be re-authenticated.
* @see setReauthenticationLifetime()
*/
Expand Down

0 comments on commit 2d5ab94

Please sign in to comment.