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

Admin Account Whitelisting

parent f2c51c09
......@@ -42,6 +42,7 @@ class WithdrawModelClass extends ModelClassEx {
private $province = null; //province (SDPay)
private $city = null; //city (SDPay)
private $withdrawTool = null; //withdrawal tool class (SDPay)
private $administrativeExceptions = null; //user account whitelisting settings
/*-------------------------------------------------------------------------
* @function_name: コントロールパネルシステムindexモデルクラスコンストラクタ
......@@ -122,6 +123,8 @@ class WithdrawModelClass extends ModelClassEx {
//get account data
$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($this -> moneyoutSolution != NO_STRING && in_array($this -> moneyoutSolution, VAL_ARR_MONEYOUT_SOLUTIONS)){
$_SESSION['moneyoutSolution'] = $this -> moneyoutSolution;
......@@ -2138,22 +2141,16 @@ class WithdrawModelClass extends ModelClassEx {
//
// }
}
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();
$array_list_IBT = array(
'81691034',//Restine
'42156169'// New iWallet 会計用 Corporate
);
$userAccounts = array_map(function($element){
return $element -> user_account;
}, $this -> administrativeExceptions);
if(in_array($this->getUserData(PARAM_USER_ACCOUNT), $array_list_IBT)){
if(in_array($this -> getUserData(PARAM_USER_ACCOUNT), $userAccounts)){
$method = getOutMoney();
} else {
$method = getOouMoney();
......@@ -2214,11 +2211,17 @@ class WithdrawModelClass extends ModelClassEx {
$this -> popUpSessionMessage(ERROR, 'E_ERROR_REGULAR_NUMBER', array(VAL_STR_AMOUNT));
$rtn = false;
} 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,
false, false, NO_STRING, $this -> getUserData(PARAM_USER_ACCOUNT)); // anton
$this -> popUpSessionMessage(ERROR, 'E_ERROR_WITHDRAW_MINIMUM', array($this -> currency, $exchange[PARAM_ORIGINAL_AMOUNT]));
$rtn = false;
}
}
// check currency if in list of allowed currenicies
if(!$this -> checkWithdrawCurrency($this -> currency, $_SESSION['moneyoutSolution'])){
......
......@@ -86,21 +86,36 @@ class HtmlBuilder extends DBAccess {
// 国一覧の取得
$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)){
$countries = array_merge($countries, [
[
PARAM_DATA_KEY => "US",
PARAM_DATA_VALUE => "United States of America"
],
[
PARAM_DATA_KEY => "HK",
PARAM_DATA_VALUE => "Hong Kong"
],
]);
$additionalCountryPairs = [];
foreach($exceptions as $exception){
if($exception -> user_account == $this -> getUserData(PARAM_USER_ACCOUNT)){
$additionals = (Array) $exception -> add_countries;
foreach($additionals as $additional){
$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) {
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