Commit 339abc8a authored by iWallet Dev's avatar iWallet Dev

Added Exception to Admin Corp Account

parent 12598b57
......@@ -127,6 +127,10 @@ class WithdrawModelClass extends ModelClassEx {
$this -> administrativeExceptions = $this -> getSettingConfiguration("administrative_exception");
$this -> administrativeExceptions = array_map(function($element){
return $element -> user_account;
}, $this -> administrativeExceptions);
//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;
......@@ -313,11 +317,7 @@ class WithdrawModelClass extends ModelClassEx {
}
// 手数料なし
$accounts = array_map(function($element){
return $element -> user_account;
}, $this -> administrativeExceptions);
if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $accounts)){
if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $this -> administrativeExceptions)){
// バランスと(送金額 + 手数料)のチェック
if($this -> fromCurrency == USD)
$this -> setFeeEx($fee[USD . VAL_INT_1]);
......@@ -444,13 +444,8 @@ class WithdrawModelClass extends ModelClassEx {
, $this -> getUserData(PARAM_USER_ACCOUNT));
}
// setting exception
$accounts = array_map(function($element){
return $element -> user_account;
}, $this -> administrativeExceptions);
// バランスと(送金額 + 手数料)のチェック
if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $accounts)){
if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $this -> administrativeExceptions)){
if($this -> fromCurrency == USD)
$this -> setFeeEx($fee[USD . VAL_INT_1]);
else
......@@ -479,7 +474,8 @@ class WithdrawModelClass extends ModelClassEx {
$rtn = false;
}
if($this -> amount > 500000){
if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $this -> administrativeExceptions)
&& $this -> amount > 500000){
$this -> popUpSessionMessage(ERROR, 'E_ERROR_AMOUNT', array());
$rtn = false;
}
......@@ -518,11 +514,7 @@ class WithdrawModelClass extends ModelClassEx {
if($_SESSION['moneyoutSolution'] == 'Flat3'){
$flat3Fee = round($this -> debitAmount * VAL_FLOAT_FLAT3_WITHDRAW_FEE, 2);
$accounts = array_map(function($element){
return $element -> user_account;
}, $this -> administrativeExceptions);
if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $accounts)){
if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $this -> administrativeExceptions)){
$this -> arrangeMinimumFee();
}
}
......@@ -789,7 +781,8 @@ class WithdrawModelClass extends ModelClassEx {
//check if method is Flat3
if($_SESSION['moneyoutSolution'] == 'Flat3'){
if(count($this -> getPendingWithdrawalTransactions())){
if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $this -> administrativeExceptions)
&& count($this -> getPendingWithdrawalTransactions())){
$this -> popUpSessionMessage(ERROR, 'E_ERROR_PENDING_FLAT3_WITHDRAWAL', array());
$this -> setType();
return;
......@@ -1603,19 +1596,10 @@ class WithdrawModelClass extends ModelClassEx {
$this -> drawFee = $standardJPYFee["published_amount"];
$loggedInUserAcc = $this -> getUserData(PARAM_USER_ACCOUNT);
$adminException = $this -> getSettingConfiguration("administrative_exception");
foreach($adminException as $data){
if(isset($data -> user_account) && $data -> user_account === $loggedInUserAcc){
if(isset($data -> ignore_f3withdrawal_fee) && $data -> ignore_f3withdrawal_fee){
if(in_array($this -> getUserData(PARAM_USER_ACCOUNT), $this -> administrativeExceptions)){
$this -> setFeeEx(NO_COUNT);
$this -> drawFee = NO_COUNT;
}
break;
}
}
}
/*-------------------------------------------------------------------------
......@@ -2215,11 +2199,7 @@ class WithdrawModelClass extends ModelClassEx {
{
$rtn = array();
$userAccounts = array_map(function($element){
return $element -> user_account;
}, $this -> administrativeExceptions);
if(in_array($this -> getUserData(PARAM_USER_ACCOUNT), $userAccounts)){
if(in_array($this -> getUserData(PARAM_USER_ACCOUNT), $this -> administrativeExceptions)){
$method = getOutMoney();
} else {
$method = getOouMoney();
......@@ -2279,11 +2259,7 @@ 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)){
if(!in_array($this -> getUserData(PARAM_USER_ACCOUNT), $this -> administrativeExceptions)){
$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]));
......
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