Odyssey
Public Attributes | Protected Member Functions | List of all members
CreditUnionGate Class Reference
Inheritance diagram for CreditUnionGate:
FeatureGate

Public Attributes

const LOG_PASSTHROUGH_TICKET_FEATURE = 'logPssTckt'
 
const LOG_TICKET_CHECK_FEATURE = 'logTcktChk'
 
const LOGIN_PROCESS = 'LOGIN'
 
const MIR_HANDLER = 'mirHandler'
 

Protected Member Functions

 DeterminePass (String $creditUnion, array $params=null)
 
- Protected Member Functions inherited from FeatureGate
 DetermineCreditUnionPass (String $creditUnion)
 
 GetFeatureParams (String $creditUnion)
 
 DeterminePass (String $creditUnion, array $params=null)
 

Additional Inherited Members

- Public Member Functions inherited from FeatureGate
 __construct (String $feature, FeatureGateConfig $config)
 
 WillPass (String $creditUnion, array $params=null)
 
- Protected Attributes inherited from FeatureGate
 $featureGateConfig
 
 $feature = ''
 

Detailed Description

Class to apply the credit union code to a feature gate

Definition at line 9 of file CreditUnionGate.i.

Member Function Documentation

◆ DeterminePass()

CreditUnionGate::DeterminePass ( String  $creditUnion,
array  $params = null 
)
protected

Check the credit union code to allow through gate.

$params can be "username" (the username to test)

Parameters
String$creditUnionCredit union to check the gate for
array$paramsExtra params for the gate check
Returns
bool

Definition at line 25 of file CreditUnionGate.i.

25  :bool {
26  $featurePass = $this->DetermineCreditUnionPass($creditUnion);
27 
28  if ( $featurePass ) {
29  // see what params we are checking
30  if ( is_array($params) && array_key_exists("username", $params) ) {
31  // check if this user is allowed
32  $featureParams = $this->GetFeatureParams( $creditUnion );
33 
34  // use must exist if usernames are listed (no username or empty list means all users are allowed)
35  if ( is_array($featureParams) && array_key_exists("usernames", $featureParams) ) {
36  if ( count( $featureParams["usernames"] ) > 0 ) {
37  // there are names, so ours must exist; assume doesn't pass
38  $featurePass = false;
39 
40  // case insensitive check
41  for ( $i = 0; $i < count( $featureParams["usernames"] ); $i++ ) {
42  if ( strcasecmp($params["username"], $featureParams["usernames"][$i]) == 0 ) {
43  // found it
44  $featurePass = true;
45  break;
46  }
47  }
48  }
49  }
50  }
51  }
52 
53  return $featurePass;
54  }
GetFeatureParams(String $creditUnion)
Definition: FeatureGate.i:79
DetermineCreditUnionPass(String $creditUnion)
Definition: FeatureGate.i:48

The documentation for this class was generated from the following file: