| 103 |
- |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/***************************************************************************
|
|
|
4 |
* Copyright (C) 2009-2011 by Geo Varghese(www.seopanel.in) *
|
|
|
5 |
* sendtogeo@gmail.com *
|
|
|
6 |
* *
|
|
|
7 |
* This program is free software; you can redistribute it and/or modify *
|
|
|
8 |
* it under the terms of the GNU General Public License as published by *
|
|
|
9 |
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
10 |
* (at your option) any later version. *
|
|
|
11 |
* *
|
|
|
12 |
* This program is distributed in the hope that it will be useful, *
|
|
|
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
15 |
* GNU General Public License for more details. *
|
|
|
16 |
* *
|
|
|
17 |
* You should have received a copy of the GNU General Public License *
|
|
|
18 |
* along with this program; if not, write to the *
|
|
|
19 |
* Free Software Foundation, Inc., *
|
|
|
20 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
|
21 |
***************************************************************************/
|
|
|
22 |
|
|
|
23 |
include_once("includes/sp-load.php");
|
|
|
24 |
|
|
|
25 |
if( $_GET['sec'] == 'aboutus'){
|
|
|
26 |
isLoggedIn();
|
|
|
27 |
}else{
|
|
|
28 |
checkAdminLoggedIn();
|
|
|
29 |
}
|
|
|
30 |
|
|
|
31 |
include_once(SP_CTRLPATH."/settings.ctrl.php");
|
|
|
32 |
include_once(SP_CTRLPATH."/moz.ctrl.php");
|
|
|
33 |
$controller = New SettingsController();
|
|
|
34 |
$controller->set('spTextPanel', $controller->getLanguageTexts('panel', $_SESSION['lang_code']));
|
|
|
35 |
$controller->spTextSettings = $controller->getLanguageTexts('settings', $_SESSION['lang_code']);
|
|
|
36 |
$controller->set('spTextSettings', $controller->spTextSettings);
|
|
|
37 |
$controller->spTextSubscription = $controller->getLanguageTexts('subscription', $_SESSION['lang_code']);
|
|
|
38 |
$controller->set('spTextSubscription', $controller->spTextSubscription);
|
|
|
39 |
|
|
|
40 |
if($_SERVER['REQUEST_METHOD'] == 'POST'){
|
|
|
41 |
|
|
|
42 |
switch($_POST['sec']){
|
|
|
43 |
|
|
|
44 |
case "update":
|
|
|
45 |
$controller->updateSystemSettings($_POST);
|
|
|
46 |
break;
|
|
|
47 |
|
|
|
48 |
case "send_test_email":
|
|
|
49 |
if (!SP_DEMO) {
|
|
|
50 |
$controller->sendTestEmail($_POST);
|
|
|
51 |
}
|
|
|
52 |
break;
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
}else{
|
|
|
56 |
switch($_GET['sec']){
|
|
|
57 |
|
|
|
58 |
case "reportsettings":
|
|
|
59 |
$controller->showSystemSettings('report');
|
|
|
60 |
break;
|
|
|
61 |
|
|
|
62 |
case "apisettings":
|
|
|
63 |
$controller->showSystemSettings('api');
|
|
|
64 |
break;
|
|
|
65 |
|
|
|
66 |
case "proxysettings":
|
|
|
67 |
$controller->showSystemSettings('proxy');
|
|
|
68 |
break;
|
|
|
69 |
|
|
|
70 |
case "aboutus":
|
|
|
71 |
$controller->showAboutUs($_GET);
|
|
|
72 |
break;
|
|
|
73 |
|
|
|
74 |
case "version":
|
|
|
75 |
$controller->showVersion();
|
|
|
76 |
break;
|
|
|
77 |
|
|
|
78 |
case "checkversion":
|
|
|
79 |
$controller->checkVersion();
|
|
|
80 |
break;
|
|
|
81 |
|
|
|
82 |
case "test_email":
|
|
|
83 |
$controller->showTestEmailSettings();
|
|
|
84 |
break;
|
|
|
85 |
|
|
|
86 |
case "checkMozCon":
|
|
|
87 |
|
|
|
88 |
if (empty($_GET['access_id']) || empty($_GET['secret_key'])) {
|
|
|
89 |
print "<span class='error'>{$_SESSION['text']['label']['Fail']}</span>";
|
|
|
90 |
} else {
|
|
|
91 |
|
|
|
92 |
include_once(SP_CTRLPATH."/rank.ctrl.php");
|
|
|
93 |
$urlList = array("http://moz.com");
|
|
|
94 |
$mozCtrler = new MozController();
|
|
|
95 |
list($rankInfo, $logInfo) = $mozCtrler->__getMozRankInfo($urlList, $_GET['access_id'], $_GET['secret_key'], true);
|
|
|
96 |
|
|
|
97 |
// if error occured
|
|
|
98 |
if (isset($logInfo['crawl_status']) && ($logInfo['crawl_status'] == 0)) {
|
|
|
99 |
print "<span class='error'>{$logInfo['log_message']}</span>";
|
|
|
100 |
} else {
|
|
|
101 |
print "<span class='success'>{$_SESSION['text']['label']['Success']}</span>";
|
|
|
102 |
}
|
|
|
103 |
}
|
|
|
104 |
|
|
|
105 |
break;
|
|
|
106 |
|
|
|
107 |
case "checkGoogleAPI":
|
|
|
108 |
|
|
|
109 |
|
|
|
110 |
if (empty($_GET['api_key'])) {
|
|
|
111 |
print "<span class='error'>{$_SESSION['text']['label']['Fail']}</span>";
|
|
|
112 |
} else {
|
|
|
113 |
|
|
|
114 |
include_once(SP_CTRLPATH."/pagespeed.ctrl.php");
|
|
|
115 |
$pageSpeedCtrl = new PageSpeedController();
|
|
|
116 |
$url = "http://moz.com";
|
|
|
117 |
list($rankInfo, $logInfo) = $pageSpeedCtrl->__getPageSpeedInfo($url, array(), $_GET['api_key'], true);
|
|
|
118 |
|
|
|
119 |
// if error occured
|
|
|
120 |
if (isset($logInfo['crawl_status']) && ($logInfo['crawl_status'] == 0)) {
|
|
|
121 |
print "<span class='error'>{$logInfo['log_message']}</span>";
|
|
|
122 |
} else {
|
|
|
123 |
print "<span class='success'>{$_SESSION['text']['label']['Success']}</span>";
|
|
|
124 |
}
|
|
|
125 |
|
|
|
126 |
}
|
|
|
127 |
|
|
|
128 |
break;
|
|
|
129 |
|
|
|
130 |
default:
|
|
|
131 |
$category = empty($_GET['category']) ? 'system' : $_GET['category'];
|
|
|
132 |
$controller->showSystemSettings($category);
|
|
|
133 |
break;
|
|
|
134 |
}
|
|
|
135 |
}
|
|
|
136 |
|
|
|
137 |
?>
|