This repository has been archived by the owner on Dec 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
config.php
48 lines (43 loc) · 1.48 KB
/
config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
*
* This config.php file is intended to hold you Constant Contact
* Credentials. There are two different ways to implement the
* oAuth2 authentication from with in this library.
*
* The first way is from with in session. This information is not
* stored anywhere locally, other than that of the clients browser.
* The following code breaks apart the session into the actual
* credentials. The information could also be sent to a Database
* or handled directly as you will see below.
*
*/
$Datastore = new CTCTDataStore ();
if (isset ( $_SESSION ['users'] )) {
foreach ( $_SESSION ['users'] as $user ) {
if ($user ['username'] != false) {
$DatastoreUser = $Datastore->lookupUser ( $user ['username'] );
$username = $user ['username'];
$accessToken = $user ['access_token'];
}
}
}
/**
* If you already have the credentials, you would not need to store
* them into the DataStore object. You can set them here
* locally like so:
*
* $username = "username";
* $accessToken = "access token";
*
*/
// Constant Contact API key, obtain one at http://developer.constantcontact.com
$apikey = "";
// Consumer secret is issued with an apikey
$consumersecret = "";
// Redirect URL which is set when creating your API key, this must match up
// or you will receive an error
$verificationURL = '';
// This URL will be used in the example_verification to bounce back to wherever
// you like. This would be a way to send back to where the user started
$returnURL = '';