Advertisement
Guest User

Untitled

a guest
Feb 6th, 2019
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.41 KB | None | 0 0
  1. <?php
  2. /*
  3. UserSpice 4
  4. An Open Source PHP User Management System
  5. by the UserSpice Team at http://UserSpice.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 3 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, see <http://www.gnu.org/licenses/>.
  19. */
  20. ini_set('max_execution_time', 1356);
  21. ini_set('memory_limit','1024M');
  22. ?>
  23. <?php
  24. require_once '../users/init.php';
  25. $db = DB::getInstance();
  26. $settings = $db->query("SELECT * FROM settings")->first();
  27. ?>
  28. <?php require_once $abs_us_root.$us_url_root.'users/includes/user_spice_ver.php'; ?>
  29. <?php if (!securePage($_SERVER['PHP_SELF'])){die();} ?>
  30. <?php $view = Input::get('view');?>
  31. <?php require_once $abs_us_root.$us_url_root.'users/views/_admin_menu.php'; ?>
  32. <div id="right-panel" class="right-panel">
  33.  
  34. <div id="messages" class="sufee-alert alert with-close alert-primary alert-dismissible fade show d-none">
  35. <span id="message" >Testing123</span>
  36. <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  37. <span aria-hidden="true">&times;</span>
  38. </button>
  39. </div>
  40.  
  41. <?php require_once $abs_us_root.$us_url_root.'users/views/_admin_header.php'; ?>
  42. <?php
  43. function usView($file){
  44. global $abs_us_root;
  45. global $us_url_root;
  46. if(file_exists($abs_us_root.$us_url_root.'usersc/includes/admin/'.$file)){
  47. $path = $abs_us_root.$us_url_root.'usersc/includes/admin/'.$file;
  48. }elseif(file_exists($abs_us_root.$us_url_root.'users/views/'.$file)){
  49. $path = $abs_us_root.$us_url_root.'users/views/'.$file;
  50. }else{
  51. $path = $abs_us_root.$us_url_root.'users/views/_admin_dashboard.php';
  52. }
  53. return $path;
  54. }
  55. //$view = Input::get('view');
  56. include($abs_us_root.$us_url_root.'usersc/includes/admin_override.php');
  57. switch ($view) {
  58. case "backup":
  59. $path = usView('_admin_tools_backup.php');
  60. include($path);
  61. break;
  62. case "cron":
  63. $path = usView('_admin_cron.php');
  64. include($path);
  65. break;
  66. case "email":
  67. $path = usView('_admin_email.php');
  68. include($path);
  69. break;
  70. case "email_test":
  71. $path = usView('_admin_email_test.php');
  72. include($path);
  73. break;
  74. case "forms":
  75. $path = usView('_admin_forms.php');
  76. include($path);
  77. break;
  78. case "forms_edit":
  79. $path = usView('_admin_forms_edit.php');
  80. include($path);
  81. break;
  82. case "forms_views":
  83. $path = usView('_admin_forms_views.php');
  84. include($path);
  85. break;
  86. case "general":
  87. $path = usView('_admin_settings_general.php');
  88. include($path);
  89. break;
  90. case "ip":
  91. $path = usView('_admin_manage_ip.php');
  92. include($path);
  93. break;
  94. case "legacy":
  95. if(file_exists($abs_us_root.$us_url_root.'usersc/includes/admin_panels.php')){
  96. include($abs_us_root.$us_url_root.'usersc/includes/admin_panels.php');
  97. }else{
  98. Redirect::to('admin.php?view=stats&err=Legacy+files+not+found');
  99. }
  100. break;
  101. case "logs":
  102. $path = usView('_admin_logs.php');
  103. include($path);
  104. break;
  105. case "logsman":
  106. $path = usView('_admin_logs_manager.php');
  107. include($path);
  108. break;
  109. case "messages":
  110. $path = usView('_admin_messages.php');
  111. include($path);
  112. break;
  113. case "nav":
  114. $path = usView('_admin_nav.php');
  115. include($path);
  116. break;
  117. case "nav_item":
  118. $path = usView('_admin_nav_item.php');
  119. include($path);
  120. break;
  121. case "notifications":
  122. $path = usView('_admin_notifications.php');
  123. include($path);
  124. break;
  125. case "page":
  126. $path = usView('_admin_page.php');
  127. include($path);
  128. break;
  129. case "pages":
  130. $path = usView('_admin_pages.php');
  131. include($path);
  132. break;
  133. case "permission":
  134. $path = usView('_admin_permission.php');
  135. include($path);
  136. break;
  137. case "permissions":
  138. $path = usView('_admin_permissions.php');
  139. include($path);
  140. break;
  141. case "pin":
  142. $path = usView('_admin_pin.php');
  143. include($path);
  144. break;
  145. case "plugins":
  146. $path = usView('_admin_plugins.php');
  147. include($path);
  148. break;
  149. case "plugins_config":
  150. $plugin = Input::get('plugin');
  151. if(file_exists($abs_us_root.$us_url_root.'usersc/plugins/'.$plugin.'/configure.php')){
  152. include $abs_us_root.$us_url_root.'usersc/plugins/'.$plugin.'/configure.php';
  153. }
  154. break;
  155. case "reg":
  156. $path = usView('_admin_settings_register.php');
  157. include($path);
  158. break;
  159. case "security_logs":
  160. $path = usView('_admin_security_logs.php');
  161. include($path);
  162. break;
  163. case "sessions":
  164. $path = usView('_admin_sessions.php');
  165. include($path);
  166. break;
  167. case "social":
  168. $path = usView('_admin_settings_login.php');
  169. include($path);
  170. break;
  171. case "stats":
  172. $path = usView('_admin_statistics.php');
  173. include($path);
  174. break;
  175. case "templates":
  176. $path = usView('_admin_templates.php');
  177. include($path);
  178. break;
  179. case "updates":
  180. $path = usView('_admin_tools_check_updates.php');
  181. include($path);
  182. break;
  183. case "user":
  184. $path = usView('_admin_user.php');
  185. include($path);
  186. break;
  187. case "users":
  188. $path = usView('_admin_users.php');
  189. include($path);
  190. break;
  191. case "verify":
  192. $path = usView('_admin_verify.php');
  193. include($path);
  194. break;
  195. default:
  196. if($view == ''){
  197. include($abs_us_root.$us_url_root.'users/views/_admin_dashboard.php');
  198. }else{
  199. $path = usView($view.".php");
  200. include($path);
  201. }
  202. }
  203. ?>
  204. <p align="center">
  205. <font color='black'><br>&copy;<?=date("Y ")?><?=$settings->copyright; ?></font>
  206. </p>
  207.  
  208.  
  209. </div> <!-- .content -->
  210. </div><!-- /#right-panel -->
  211.  
  212. <!-- Right Panel -->
  213.  
  214.  
  215.  
  216. <script type="text/javascript">
  217. $(document).ready(function() {
  218.  
  219. //Transaction total in the lower right
  220. function messages(data) {
  221. $('#messages').removeClass();
  222. $('#message').text("");
  223. $('#messages').show();
  224. if(data.success == "true"){
  225. $('#messages').addClass("sufee-alert alert with-close alert-success alert-dismissible fade show");
  226. }else{
  227. $('#messages').addClass("sufee-alert alert with-close alert-success alert-dismissible fade show");
  228. }
  229. $('#message').text(data.msg);
  230. $('#messages').delay(3000).fadeOut('slow');
  231.  
  232. }
  233.  
  234. $( ".toggle" ).change(function() { //use event delegation
  235. var value = $(this).prop("checked");
  236. $(this).prop("checked",value);
  237.  
  238. var field = $(this).attr("id"); //the id in the input tells which field to update
  239. var desc = $(this).attr("data-desc"); //For messages
  240. var formData = {
  241. 'value' : value,
  242. 'field' : field,
  243. 'desc' : desc,
  244. 'type' : 'toggle',
  245. };
  246.  
  247. $.ajax({
  248. type : 'POST',
  249. url : 'parsers/admin_settings.php',
  250. data : formData,
  251. dataType : 'json',
  252. })
  253.  
  254. .done(function(data) {
  255. messages(data);
  256. })
  257. });
  258.  
  259. $("#force_user_pr").click(function(data) {
  260. console.log("clicked");
  261. var formData = {
  262. 'type' : 'resetPW'
  263. };
  264. $.ajax({
  265. type : 'POST',
  266. url : 'parsers/admin_settings.php',
  267. data : formData,
  268. dataType : 'json',
  269. encode : true
  270. })
  271. .done(function(data) {
  272. messages(data);
  273. })
  274. });
  275.  
  276. $( ".ajxnum" ).change(function() { //use event delegation
  277. var value = $(this).val();
  278. // console.log(value);
  279.  
  280. var field = $(this).attr("id"); //the id in the input tells which field to update
  281. var desc = $(this).attr("data-desc"); //For messages
  282. var formData = {
  283. 'value' : value,
  284. 'field' : field,
  285. 'desc' : desc,
  286. 'type' : 'num',
  287. };
  288.  
  289. $.ajax({
  290. type : 'POST',
  291. url : 'parsers/admin_settings.php',
  292. data : formData,
  293. dataType : 'json',
  294. })
  295.  
  296. .done(function(data) {
  297. messages(data);
  298. })
  299. });
  300.  
  301. $( ".ajxtxt" ).change(function() { //use event delegation
  302. var value = $(this).val();
  303. console.log(value);
  304.  
  305. var field = $(this).attr("id"); //the id in the input tells which field to update
  306. var desc = $(this).attr("data-desc"); //For messages
  307. var formData = {
  308. 'value' : value,
  309. 'field' : field,
  310. 'desc' : desc,
  311. 'type' : 'txt',
  312. };
  313.  
  314. $.ajax({
  315. type : 'POST',
  316. url : 'parsers/admin_settings.php',
  317. data : formData,
  318. dataType : 'json',
  319. })
  320.  
  321. .done(function(data) {
  322. messages(data);
  323. })
  324. });
  325.  
  326. // Toggle menu
  327. $('#menuToggle').on('click', function() {
  328. $('body').toggleClass('open');
  329. $(".dropdown-toggle").dropdown('toggle');
  330.  
  331. });
  332.  
  333. $('.search-trigger').on('click', function() {
  334. $('.search-trigger').parent('.header-left').addClass('open');
  335. });
  336.  
  337. $('.search-close').on('click', function() {
  338. $('.search-trigger').parent('.header-left').removeClass('open');
  339. });
  340. });
  341. </script>
  342. </body>
  343. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement