Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions popup.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
<title>Import Contacts - Popup</title>
</head>
<body>
<?php
<?php
require_once 'csimport.php';

$verbose = array_key_exists('verbose', $_GET);
if ($verbose) {
echo "Verbose output is enabled!<br/>";
}

if (array_key_exists('service', $_GET)) {
// Step 1
$username = NULL;
Expand All @@ -14,9 +19,13 @@
$username = $_GET['username'];
if (array_key_exists('password', $_GET))
$password = $_GET['password'];

// Call to the CloudSponge.com for the import_id and redirect url (if applicable)
$output = CSImport::begin_import($_GET['service'], $username, $password, NULL, NULL, array('include' => "name,email,mailing_address"));
if ($verbose) {
print_r($output);
}

if (isset($output['import_id']))
{
$import_id = $output['import_id'];
Expand All @@ -30,7 +39,7 @@
} else {
echo "trouble...";
}
}
}
?>
<p>Contacts are being imported. Please do not close this popup window. </p>
<script type="text/javascript">
Expand Down
7 changes: 7 additions & 0 deletions step_1_start.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<?php
$verbose = array_key_exists('verbose', $_GET);
if ($verbose) {
echo "Verbose output is enabled!<br/>";
}
?>
<html>
<head>
<title>Import Contacts - Step 1</title>
Expand Down Expand Up @@ -33,6 +39,7 @@ function open_popup(service, focus, username, password, url) {
if (username != null) {
url = url + '&username=' + username + '&password=' + password;
}
<?php if ($verbose) { echo "url = url + \"&verbose=1\";"; } ?>

popup_height = '300';
popup_width = '500';
Expand Down