From 056bc79b1145383f3f73818e216b34a32e57afd0 Mon Sep 17 00:00:00 2001 From: kanoi Date: Mon, 18 Apr 2016 15:58:44 +1000 Subject: [PATCH] php - ensure doaddrmgt() has an email target --- pool/page_addrmgt.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/pool/page_addrmgt.php b/pool/page_addrmgt.php index 3159d969..337b078d 100644 --- a/pool/page_addrmgt.php +++ b/pool/page_addrmgt.php @@ -143,15 +143,16 @@ function addrmgtuser($data, $user, $err) function doaddrmgt($data, $user) { $err = ''; - $ans = null; $OK = getparam('OK', false); $count = getparam('rows', false); $pass = getparam('pass', false); $twofa = getparam('2fa', false); + $mfail = false; if ($OK == 'Save' && !nuem($count) && !nuem($pass)) { if ($count > 0 && $count < 1000) { + $mfail = true; $addrarr = array(); for ($i = 0; $i < $count; $i++) { @@ -168,23 +169,30 @@ function doaddrmgt($data, $user) $err = $ans['ERROR']; else { + $ans = userSettings($user); + if ($ans['STATUS'] != 'ok') + goto meh; if (isset($ans['email'])) $email = $ans['email']; else - $email = ''; + goto meh; $emailinfo = getOpts($user, emailOptList()); if ($emailinfo['STATUS'] != 'ok') - { - if ($err != '') - $err .= '
'; - $err .= 'An error occurred, check your details below'; - } + goto meh; else payoutAddressChanged($email, zeip(), $emailinfo); } + $mfail = false; } } +meh: + if ($mfail == true) + { + if ($err != '') + $err .= '
'; + $err .= 'An error occurred, check your details below'; + } $pg = addrmgtuser($data, $user, $err);