} } } if (!$src_acct || !$src_list || !$dest_acct || !$dest_list) { echo "{$prog}: Must provide all source and destination account/list information\n"; exit(1); } // Must convert account names to account IDs if (!$use_ids) { $login_result = bronto_agency_login(); if (!$login_result) { echo "Error: Unable to log in to agency account\n"; exit(1); } $binding = $login_result['binding']; $accounts = get_accounts_using_names($binding, array($src_acct, $dest_acct)); if (count($accounts) != 2) { echo "Error: Unable to map both account names to account IDs\n"; exit(1); } $src_acct = $accounts[0]->id; $dest_acct = $accounts[1]->id; } echo "Logging in to account id={$src_acct}\n"; $login_result = bronto_agency_login($src_acct); if (!$login_result) { echo "Error: Unable to login to source account id={$src_acct}\n"; exit(1); } $binding = $login_result['binding']; if (!$use_ids) {
} $addrs = file($addr_file, FILE_IGNORE_NEW_LINES); if ($addrs === false) { echo "Error: {$addr_file}: Unable to read file\n"; exit(1); } // Convert all e-mail addresses to lower-case for easier searching later. $addrs = array_map('strtolower', $addrs); $login_result = bronto_agency_login(); if (!$login_result) { echo "Unable to log in to agency account"; exit(1); } $binding = $login_result['binding']; if ($acct_name) { $accounts = get_accounts_using_names($binding, $acct_name); } else { $accounts = get_all_accounts($binding); } if ($accounts == null) { echo "Unable to retrieve any matching accounts\n"; exit(1); } foreach ($accounts as $acct) { // Now login to the subaccount using the agency account, but specifying the subaccount ID in the login. echo "===\nChecking account: {$acct->name} [id={$acct->id}]\n===\n"; $login_result = bronto_agency_login($acct->id); if (!$login_result) { echo "Error: Account id=" . $acct->id . " [" . $acct->name . "] is not a valid subaccount.\n"; } else { $orphan_count = 0;