Commit 3bad412f authored by Antonio.Suerte's avatar Antonio.Suerte

Admin Account Whitelisting

parent f2c51c09
...@@ -42,6 +42,7 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -42,6 +42,7 @@ class WithdrawModelClass extends ModelClassEx {
private $province = null; //province (SDPay) private $province = null; //province (SDPay)
private $city = null; //city (SDPay) private $city = null; //city (SDPay)
private $withdrawTool = null; //withdrawal tool class (SDPay) private $withdrawTool = null; //withdrawal tool class (SDPay)
private $administrativeExceptions = null; //user account whitelisting settings
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* @function_name: コントロールパネルシステムindexモデルクラスコンストラクタ * @function_name: コントロールパネルシステムindexモデルクラスコンストラクタ
...@@ -122,6 +123,8 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -122,6 +123,8 @@ class WithdrawModelClass extends ModelClassEx {
//get account data //get account data
$this -> account = $this -> getRowData($this -> getAccountCommon($this -> getUserData(PARAM_USER_ACCOUNT))); $this -> account = $this -> getRowData($this -> getAccountCommon($this -> getUserData(PARAM_USER_ACCOUNT)));
$this -> administrativeExceptions = $this -> getSettingConfiguration("administrative_exception");
//if moneyout solution is not null save it to session //if moneyout solution is not null save it to session
if($this -> moneyoutSolution != NO_STRING && in_array($this -> moneyoutSolution, VAL_ARR_MONEYOUT_SOLUTIONS)){ if($this -> moneyoutSolution != NO_STRING && in_array($this -> moneyoutSolution, VAL_ARR_MONEYOUT_SOLUTIONS)){
$_SESSION['moneyoutSolution'] = $this -> moneyoutSolution; $_SESSION['moneyoutSolution'] = $this -> moneyoutSolution;
...@@ -2138,22 +2141,16 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -2138,22 +2141,16 @@ class WithdrawModelClass extends ModelClassEx {
// //
// } // }
} }
public function getOutStatus() public function getOutStatus()
{ {
$account = $this->getUserData(PARAM_USER_ACCOUNT);
$rs = $this -> getAccountCommon($account);
$row = $this -> getRowData($rs);
$accountType = $this -> getColumnData($row, COLUMN_ACCOUNT_TYPE);
$rtn = array(); $rtn = array();
$array_list_IBT = array( $userAccounts = array_map(function($element){
'81691034',//Restine return $element -> user_account;
'42156169'// New iWallet 会計用 Corporate }, $this -> administrativeExceptions);
);
if(in_array($this->getUserData(PARAM_USER_ACCOUNT), $array_list_IBT)){ if(in_array($this -> getUserData(PARAM_USER_ACCOUNT), $userAccounts)){
$method = getOutMoney(); $method = getOutMoney();
} else { } else {
$method = getOouMoney(); $method = getOouMoney();
...@@ -2214,11 +2211,17 @@ class WithdrawModelClass extends ModelClassEx { ...@@ -2214,11 +2211,17 @@ class WithdrawModelClass extends ModelClassEx {
$this -> popUpSessionMessage(ERROR, 'E_ERROR_REGULAR_NUMBER', array(VAL_STR_AMOUNT)); $this -> popUpSessionMessage(ERROR, 'E_ERROR_REGULAR_NUMBER', array(VAL_STR_AMOUNT));
$rtn = false; $rtn = false;
} elseif(!$this->CheckWithdrawMinimum($this -> currency, $this -> amount)) { //check withdrawal minimum } elseif(!$this->CheckWithdrawMinimum($this -> currency, $this -> amount)) { //check withdrawal minimum
$userAccounts = array_map(function($element){
return $element -> user_account;
}, $this -> administrativeExceptions);
if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $userAccounts)){
$exchange = $this -> getExchangeCommon(VAL_INT_MINIMUM_WITHDRAW_AMOUNT, 'USD', $this -> currency, $exchange = $this -> getExchangeCommon(VAL_INT_MINIMUM_WITHDRAW_AMOUNT, 'USD', $this -> currency,
false, false, NO_STRING, $this -> getUserData(PARAM_USER_ACCOUNT)); // anton false, false, NO_STRING, $this -> getUserData(PARAM_USER_ACCOUNT)); // anton
$this -> popUpSessionMessage(ERROR, 'E_ERROR_WITHDRAW_MINIMUM', array($this -> currency, $exchange[PARAM_ORIGINAL_AMOUNT])); $this -> popUpSessionMessage(ERROR, 'E_ERROR_WITHDRAW_MINIMUM', array($this -> currency, $exchange[PARAM_ORIGINAL_AMOUNT]));
$rtn = false; $rtn = false;
} }
}
// check currency if in list of allowed currenicies // check currency if in list of allowed currenicies
if(!$this -> checkWithdrawCurrency($this -> currency, $_SESSION['moneyoutSolution'])){ if(!$this -> checkWithdrawCurrency($this -> currency, $_SESSION['moneyoutSolution'])){
......
...@@ -86,21 +86,36 @@ class HtmlBuilder extends DBAccess { ...@@ -86,21 +86,36 @@ class HtmlBuilder extends DBAccess {
// 国一覧の取得 // 国一覧の取得
$countries = $this -> getCountyList(); $countries = $this -> getCountyList();
$account_nums = [
"42156169" $exceptions = $this -> getSettingConfiguration("administrative_exception");
];
$account_nums = array_map(function($element){
return $element -> user_account;
}, $exceptions);
if(in_array($this -> getUserData(PARAM_USER_ACCOUNT), $account_nums)){ if(in_array($this -> getUserData(PARAM_USER_ACCOUNT), $account_nums)){
$countries = array_merge($countries, [ $additionalCountryPairs = [];
[
PARAM_DATA_KEY => "US", foreach($exceptions as $exception){
PARAM_DATA_VALUE => "United States of America" if($exception -> user_account == $this -> getUserData(PARAM_USER_ACCOUNT)){
], $additionals = (Array) $exception -> add_countries;
[
PARAM_DATA_KEY => "HK", foreach($additionals as $additional){
PARAM_DATA_VALUE => "Hong Kong" $additional = (Array) $additional;
],
]); foreach($additional as $key => $value){
$additionalCountryPairs[] = [
PARAM_DATA_KEY => $key,
PARAM_DATA_VALUE => $value
];
}
}
break;
}
}
$countries = array_merge($countries, $additionalCountryPairs);
uasort($countries, function($a, $b) { uasort($countries, function($a, $b) {
return strcmp($a[PARAM_DATA_VALUE], $b[PARAM_DATA_VALUE]); return strcmp($a[PARAM_DATA_VALUE], $b[PARAM_DATA_VALUE]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment