-
Notifications
You must be signed in to change notification settings - Fork 1
/
admin-findsite.php
51 lines (41 loc) · 1.58 KB
/
admin-findsite.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
49
50
51
<?php
try {
require_once('Sprinkles.php');
$sprink = new Sprinkles();
if($sprink->site_configured()) {
redirect('helpstart.php');
exit(0);
}
$defaults = $sprink->findsite_data();
$sprinkles_root_url = request_param('sprinkles_root_url');
if (!$sprinkles_root_url)
$sprinkles_root_url = $defaults[sprinkles_root_url];
if (!$sprinkles_root_url) {
$uri = 'http'. ($_SERVER['HTTPS'] ? 's' : null) .'://'. $_SERVER['HTTP_HOST'];
$uri .= ($_SERVER['SERVER_PORT'] == '80' ? '' : (":" . $_SERVER['SERVER_PORT']));
$uri .= $_SERVER['REQUEST_URI'];
$sprinkles_root_url = $uri;
}
$smarty->assign('sprinkles_root_url', $sprinkles_root_url);
$oauth_consumer_key = request_param('oauth_consumer_key');
if (!$oauth_consumer_key)
$oauth_consumer_key = $defaults['oauth_consumer_key'];
$oauth_consumer_secret = request_param('oauth_consumer_secret');
if (!$oauth_consumer_secret)
$oauth_consumer_secret = $defaults['oauth_consumer_secret'];
$company_sfnid = request_param('company_sfnid');
if (!$company_sfnid)
$company_sfnid = $defaults['company_sfnid'];
$smarty->assign(array('oauth_consumer_key' => $oauth_consumer_key,
'oauth_consumer_secret' => $oauth_consumer_secret,
'company_sfnid' => $company_sfnid));
$smarty->assign('msg', request_param('msg'));
$smarty->assign('background_color', '#86fff6');
$smarty->assign('no_admin_link', true);
$smarty->display('admin-findsite.t');
finish_request('admin-findsite');
} catch (Exception $e) {
error_log("Exception thrown while preparing page: " . $e->getMessage());
$smarty->display('error.t');
}
?>