constant_contact.ajax.php in Constant Contact 6.3
File
constant_contact.ajax.php
View source
<?php
function constant_contact_auth($username, $password) {
require_once dirname(__FILE__) . '/class.cc.php';
$cc = new cc($username, $password);
if (is_object($cc) && $cc
->get_service_description()) {
return $cc;
}
elseif ($cc->http_response_code) {
return $cc
->http_get_response_code_error($cc->http_response_code);
}
else {
return "Please enter your username and password";
}
}
$username = $_GET['username'] ? strip_tags($_GET['username']) : '';
$password = $_GET['password'] ? strip_tags($_GET['password']) : '';
$result = constant_contact_auth($username, $password);
if (is_object($result)) {
echo '<div class="cc_auth_res" style="color:green;">Authenticated OK, please click the "Save configuration" button below</div>';
}
else {
echo "<div class='cc_auth_res' style='color:red;'>{$result}</div>";
}
Functions
Name |
Description |
constant_contact_auth |
Authenticates with the API
This is used for the admin settins page to check the details they entered |