Browse Source

php - ensure doaddrmgt() has an email target

master
kanoi 9 years ago
parent
commit
056bc79b11
  1. 22
      pool/page_addrmgt.php

22
pool/page_addrmgt.php

@ -143,15 +143,16 @@ function addrmgtuser($data, $user, $err)
function doaddrmgt($data, $user) function doaddrmgt($data, $user)
{ {
$err = ''; $err = '';
$ans = null;
$OK = getparam('OK', false); $OK = getparam('OK', false);
$count = getparam('rows', false); $count = getparam('rows', false);
$pass = getparam('pass', false); $pass = getparam('pass', false);
$twofa = getparam('2fa', false); $twofa = getparam('2fa', false);
$mfail = false;
if ($OK == 'Save' && !nuem($count) && !nuem($pass)) if ($OK == 'Save' && !nuem($count) && !nuem($pass))
{ {
if ($count > 0 && $count < 1000) if ($count > 0 && $count < 1000)
{ {
$mfail = true;
$addrarr = array(); $addrarr = array();
for ($i = 0; $i < $count; $i++) for ($i = 0; $i < $count; $i++)
{ {
@ -168,23 +169,30 @@ function doaddrmgt($data, $user)
$err = $ans['ERROR']; $err = $ans['ERROR'];
else else
{ {
$ans = userSettings($user);
if ($ans['STATUS'] != 'ok')
goto meh;
if (isset($ans['email'])) if (isset($ans['email']))
$email = $ans['email']; $email = $ans['email'];
else else
$email = ''; goto meh;
$emailinfo = getOpts($user, emailOptList()); $emailinfo = getOpts($user, emailOptList());
if ($emailinfo['STATUS'] != 'ok') if ($emailinfo['STATUS'] != 'ok')
{ goto meh;
if ($err != '')
$err .= '<br>';
$err .= 'An error occurred, check your details below';
}
else else
payoutAddressChanged($email, zeip(), $emailinfo); payoutAddressChanged($email, zeip(), $emailinfo);
} }
$mfail = false;
} }
} }
meh:
if ($mfail == true)
{
if ($err != '')
$err .= '<br>';
$err .= 'An error occurred, check your details below';
}
$pg = addrmgtuser($data, $user, $err); $pg = addrmgtuser($data, $user, $err);

Loading…
Cancel
Save