Skip to content

Commit

Permalink
Keep anonymous access as core feature only
Browse files Browse the repository at this point in the history
Remove control for anonymous access for auth flags.
  • Loading branch information
vboctor committed Apr 16, 2017
1 parent 52f825c commit c76333a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 42 deletions.
6 changes: 2 additions & 4 deletions core/authentication_api.php
Expand Up @@ -138,17 +138,15 @@ function auth_signup_access_level() {
* @return bool true: enabled; false: otherwise.
*/
function auth_anonymous_enabled() {
$t_auth_flags = auth_flags();
return $t_auth_flags->getAnonymousEnabled();
return config_get_global( 'allow_anonymous_login' );
}

/**
* Get the anonymous account username.
* @return string Anonymous account username.
*/
function auth_anonymous_account() {
$t_auth_flags = auth_flags();
return $t_auth_flags->getAnonymousAccount();
return config_get_global( 'anonymous_account' );
}

/**
Expand Down
38 changes: 0 additions & 38 deletions core/classes/AuthFlags.class.php
Expand Up @@ -50,20 +50,6 @@ class AuthFlags {
*/
private $signup_access_level = null;

/**
* Core anonymous login functionality is enabled.
* @see $anonymous_account
* @var bool|null
*/
private $anonymous_enabled = null;

/**
* User account to designate as the anonymous / guest account.
* @see $anonymous_enabled
* @var string|null
*/
private $anonymous_account = null;

/**
* The access level or array of access levels that can leverage MantisBT native passwords.
* @var int|array|null
Expand Down Expand Up @@ -179,30 +165,6 @@ function getSignupAccessLevel() {
return $this->signup_access_level;
}

function setAnonymousEnabled( $p_enabled ) {
$this->anonymous_enabled = $p_enabled;
}

function getAnonymousEnabled() {
if( is_null( $this->anonymous_enabled ) ) {
return config_get_global( 'allow_anonymous_login' );
}

return $this->anonymous_enabled;
}

function setAnonymousAccount( $p_username ) {
$this->anonymous_account = $p_username;
}

function getAnonymousAccount() {
if( is_null( $this->anonymous_account ) ) {
return config_get_global( 'anonymous_account' );
}

return $this->anonymous_account;
}

function setSetPasswordThreshold( $p_threshold ) {
$this->access_level_set_password = $p_threshold;
}
Expand Down

0 comments on commit c76333a

Please sign in to comment.