| 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 |
// check the sections can accessed by user
|
|
|
26 |
$userIncludeList = array("my-profile", "myprofile", "edit-profile", "renew-profile", "updatemyprofile", "update-subscription");
|
|
|
27 |
if ( in_array($_GET['sec'], $userIncludeList) || in_array($_POST['sec'], $userIncludeList) ) {
|
|
|
28 |
isLoggedIn();
|
|
|
29 |
} else {
|
|
|
30 |
checkAdminLoggedIn();
|
|
|
31 |
}
|
|
|
32 |
|
|
|
33 |
include_once(SP_CTRLPATH."/user.ctrl.php");
|
|
|
34 |
include_once(SP_CTRLPATH."/website.ctrl.php");
|
|
|
35 |
include_once(SP_CTRLPATH."/keyword.ctrl.php");
|
|
|
36 |
include_once(SP_CTRLPATH."/user-type.ctrl.php");
|
|
|
37 |
include_once(SP_CTRLPATH."/seoplugins.ctrl.php");
|
|
|
38 |
$controller = New UserController();
|
|
|
39 |
$controller->view->menu = 'users';
|
|
|
40 |
$controller->layout = 'ajax';
|
|
|
41 |
$controller->spTextPanel = $controller->getLanguageTexts('panel', $_SESSION['lang_code']);
|
|
|
42 |
$controller->set('spTextPanel', $controller->spTextPanel);
|
|
|
43 |
$controller->spTextUser = $controller->getLanguageTexts('user', $_SESSION['lang_code']);
|
|
|
44 |
$controller->set('spTextUser', $controller->spTextUser);
|
|
|
45 |
|
|
|
46 |
if($_SERVER['REQUEST_METHOD'] == 'POST'){
|
|
|
47 |
|
|
|
48 |
switch($_POST['sec']){
|
|
|
49 |
case "create":
|
|
|
50 |
$controller->createUser($_POST);
|
|
|
51 |
break;
|
|
|
52 |
|
|
|
53 |
case "update":
|
|
|
54 |
$controller->updateUser($_POST);
|
|
|
55 |
break;
|
|
|
56 |
|
|
|
57 |
case "updatemyprofile":
|
|
|
58 |
$controller->updateMyProfile($_POST);
|
|
|
59 |
break;
|
|
|
60 |
|
|
|
61 |
case "update-subscription":
|
|
|
62 |
$controller->updateSubscription($_POST);
|
|
|
63 |
break;
|
|
|
64 |
|
|
|
65 |
case "activateall":
|
|
|
66 |
if (!empty($_POST['ids'])) {
|
|
|
67 |
foreach($_POST['ids'] as $id) {
|
|
|
68 |
$controller->__changeStatus($id, 1);
|
|
|
69 |
}
|
|
|
70 |
}
|
|
|
71 |
$controller->listUsers($_POST);
|
|
|
72 |
break;
|
|
|
73 |
|
|
|
74 |
case "inactivateall":
|
|
|
75 |
if (!empty($_POST['ids'])) {
|
|
|
76 |
foreach($_POST['ids'] as $id) {
|
|
|
77 |
$controller->__changeStatus($id, 0);
|
|
|
78 |
}
|
|
|
79 |
}
|
|
|
80 |
$controller->listUsers($_POST);
|
|
|
81 |
break;
|
|
|
82 |
|
|
|
83 |
case "deleteall":
|
|
|
84 |
if (!empty($_POST['ids'])) {
|
|
|
85 |
foreach($_POST['ids'] as $id) {
|
|
|
86 |
$controller->__deleteUser($id);
|
|
|
87 |
}
|
|
|
88 |
}
|
|
|
89 |
$controller->listUsers($_POST);
|
|
|
90 |
break;
|
|
|
91 |
|
|
|
92 |
case "dowebsiteAccessManager":
|
|
|
93 |
$controller->manageWebsiteAccessManager($_POST);
|
|
|
94 |
break;
|
|
|
95 |
|
|
|
96 |
default:
|
|
|
97 |
$controller->listUsers($_POST);
|
|
|
98 |
break;
|
|
|
99 |
}
|
|
|
100 |
|
|
|
101 |
}else{
|
|
|
102 |
switch($_GET['sec']){
|
|
|
103 |
|
|
|
104 |
case "Activate":
|
|
|
105 |
$controller->__changeStatus($_GET['userId'], 1);
|
|
|
106 |
$controller->listUsers($_GET);
|
|
|
107 |
break;
|
|
|
108 |
|
|
|
109 |
case "Inactivate":
|
|
|
110 |
$controller->__changeStatus($_GET['userId'], 0);
|
|
|
111 |
$controller->listUsers($_GET);
|
|
|
112 |
break;
|
|
|
113 |
|
|
|
114 |
case "delete":
|
|
|
115 |
$controller->__deleteUser($_GET['userId']);
|
|
|
116 |
$controller->listUsers($_GET);
|
|
|
117 |
break;
|
|
|
118 |
|
|
|
119 |
case "edit":
|
|
|
120 |
$controller->editUser($_GET['userId']);
|
|
|
121 |
break;
|
|
|
122 |
|
|
|
123 |
case "new":
|
|
|
124 |
$controller->newUser();
|
|
|
125 |
break;
|
|
|
126 |
|
|
|
127 |
case "my-profile":
|
|
|
128 |
case "myprofile":
|
|
|
129 |
$controller->showMyProfile($_GET);
|
|
|
130 |
break;
|
|
|
131 |
|
|
|
132 |
case "edit-profile":
|
|
|
133 |
$controller->editMyProfile();
|
|
|
134 |
break;
|
|
|
135 |
|
|
|
136 |
case "renew-profile":
|
|
|
137 |
$controller->renewMyProfile();
|
|
|
138 |
break;
|
|
|
139 |
|
|
|
140 |
case "website-access-manager":
|
|
|
141 |
$controller->manageWebsiteAccessManager($_GET);
|
|
|
142 |
break;
|
|
|
143 |
|
|
|
144 |
default:
|
|
|
145 |
$controller->listUsers($_GET);
|
|
|
146 |
break;
|
|
|
147 |
}
|
|
|
148 |
}
|
|
|
149 |
|
|
|
150 |
?>
|