|
30 | 30 | $wf_editable = $user->token->isTokenValid($_SESSION['USERDATA']['id'], $oldtoken_wf, 7); |
31 | 31 | $wf_sent = $user->token->doesTokenExist('withdraw_funds', $_SESSION['USERDATA']['id']); |
32 | 32 | } |
33 | | - |
| 33 | + |
34 | 34 | // get the status of a token if set |
35 | 35 | $message_tokensent_invalid = 'A token was sent to your e-mail that will allow you to '; |
36 | 36 | $message_tokensent_valid = 'You can currently '; |
|
61 | 61 | $_SESSION['POPUP'][] = array('CONTENT' => $popupmsg, 'TYPE' => 'alert alert-warning'); |
62 | 62 | } |
63 | 63 | } |
64 | | - |
| 64 | + |
65 | 65 | if (isset($_POST['do']) && $_POST['do'] == 'genPin') { |
66 | 66 | if (!$config['csrf']['enabled'] || $config['csrf']['enabled'] && $csrftoken->valid) { |
67 | 67 | if ($user->generatePin($_SESSION['USERDATA']['id'], $_POST['currentPassword'])) { |
|
100 | 100 | $dBalance = $aBalance['confirmed']; |
101 | 101 | if ($setting->getValue('disable_payouts') == 1 || $setting->getValue('disable_manual_payouts') == 1) { |
102 | 102 | $_SESSION['POPUP'][] = array('CONTENT' => 'Manual payouts are disabled.', 'TYPE' => 'alert alert-warning'); |
| 103 | + } else if ($config['twofactor']['enabled'] && $config['twofactor']['options']['withdraw'] && !$wf_editable) { |
| 104 | + $_SESSION['POPUP'][] = array('CONTENT' => 'You have not yet unlocked account withdrawls.', 'TYPE' => 'alert alert-danger'); |
103 | 105 | } else if ($aBalance['confirmed'] < $config['mp_threshold']) { |
104 | 106 | $_SESSION['POPUP'][] = array('CONTENT' => 'Payout must be greater or equal than ' . $config['mp_threshold'] . '.', 'TYPE' => 'info'); |
105 | 107 | } else if (!$user->getCoinAddress($_SESSION['USERDATA']['id'])) { |
|
127 | 129 | break; |
128 | 130 |
|
129 | 131 | case 'updateAccount': |
130 | | - if (!$config['csrf']['enabled'] || $config['csrf']['enabled'] && $csrftoken->valid) { |
| 132 | + if ($config['twofactor']['enabled'] && $config['twofactor']['options']['details'] && !$ea_editable) { |
| 133 | + $_SESSION['POPUP'][] = array('CONTENT' => 'You have not yet unlocked account updates.', 'TYPE' => 'alert alert-danger'); |
| 134 | + } else if (!$config['csrf']['enabled'] || $config['csrf']['enabled'] && $csrftoken->valid) { |
131 | 135 | if ($user->updateAccount($_SESSION['USERDATA']['id'], $_POST['paymentAddress'], $_POST['payoutThreshold'], $_POST['donatePercent'], $_POST['email'], $_POST['is_anonymous'], $oldtoken_ea)) { |
132 | 136 | $_SESSION['POPUP'][] = array('CONTENT' => 'Account details updated', 'TYPE' => 'alert alert-success'); |
133 | 137 | } else { |
|
139 | 143 | break; |
140 | 144 |
|
141 | 145 | case 'updatePassword': |
142 | | - if (!$config['csrf']['enabled'] || $config['csrf']['enabled'] && $csrftoken->valid) { |
| 146 | + if ($config['twofactor']['enabled'] && $config['twofactor']['options']['changepw'] && !$cp_editable) { |
| 147 | + $_SESSION['POPUP'][] = array('CONTENT' => 'You have not yet unlocked password updates.', 'TYPE' => 'alert alert-danger'); |
| 148 | + } else if (!$config['csrf']['enabled'] || $config['csrf']['enabled'] && $csrftoken->valid) { |
143 | 149 | if ($user->updatePassword($_SESSION['USERDATA']['id'], $_POST['currentPassword'], $_POST['newPassword'], $_POST['newPassword2'], $oldtoken_cp)) { |
144 | 150 | $_SESSION['POPUP'][] = array('CONTENT' => 'Password updated', 'TYPE' => 'alert alert-success'); |
145 | 151 | } else { |
|
0 commit comments