Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.17 KB | None | 0 0
  1. <?php
  2. ob_start();
  3. /*
  4. UserSpice 4
  5. An Open Source PHP User Management System
  6. by the UserSpice Team at http://UserSpice.com
  7.  
  8. This program is free software: you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation, either version 3 of the License, or
  11. (at your option) any later version.
  12.  
  13. This program is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. GNU General Public License for more details.
  17.  
  18. You should have received a copy of the GNU General Public License
  19. along with this program.  If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. ?>
  22. <?php require_once $abs_us_root.$us_url_root.'users/helpers/helpers.php'; ?>
  23. <?php require_once $abs_us_root.$us_url_root.'users/includes/user_spice_ver.php'; ?>
  24. <?php header('X-Frame-Options: DENY'); ?>
  25. <?php
  26. //check for a custom page
  27. $currentPage = currentPage();
  28. if(isset($_GET['err'])){
  29.     $err = Input::get('err');
  30. }
  31. if(file_exists($abs_us_root.$us_url_root.'usersc/'.$currentPage)){
  32.     if(currentFolder()!= 'usersc'){
  33.         $url = $us_url_root.'usersc/'.$currentPage;
  34.     if(isset($_GET)){
  35.         $url .= '?r=1'; //add initial ?
  36.         foreach ($_GET as $key=>$value){
  37.         $url .= '&'.$key.'='.$value;
  38.         }
  39.  
  40.     }
  41. }
  42. Redirect::to($url);
  43. }
  44.  
  45. $db = DB::getInstance();
  46. $settingsQ = $db->query("Select * FROM settings");
  47. $settings = $settingsQ->first();
  48. if ($settings->site_offline==1){
  49.     die("The site is currently offline.");
  50. }
  51.  
  52. if ($settings->force_ssl==1){
  53.     if (!isset($_SERVER['HTTPS']) || !$_SERVER['HTTPS']) {
  54.         // if request is not secure, redirect to secure url
  55.         $url = 'https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
  56.         Redirect::to($url);
  57.         exit;
  58.     }
  59. }
  60.  
  61. //if track_guest enabled AND there is a user logged in
  62. if($settings->track_guest == 1 && $user->isLoggedIn()){
  63.     if ($user->isLoggedIn()){
  64.         $user_id=$user->data()->id;
  65.     }else{
  66.         $user_id=0;
  67.     }
  68.     new_user_online($user_id);
  69.  
  70. }
  71. ?>
  72. <!DOCTYPE html>
  73. <html lang="en">
  74. <head>
  75.     <meta charset="utf-8">
  76.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  77.     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  78.     <meta name="description" content="">
  79.     <meta name="author" content="">
  80.  
  81.     <?php
  82.     if(file_exists($abs_us_root.$us_url_root.'usersc/includes/head_tags.php')){
  83.         require_once $abs_us_root.$us_url_root.'usersc/includes/head_tags.php';
  84.     }
  85.     ?>
  86.  
  87.     <title><?=$settings->site_name;?></title>
  88.  
  89.     <!-- Bootstrap Core CSS -->
  90.     <!-- AKA Primary CSS -->
  91.     <link href="<?=$us_url_root?><?=str_replace('../','',$settings->us_css1);?>" rel="stylesheet">
  92.  
  93.     <!-- Template CSS -->
  94.     <!-- AKA Secondary CSS -->
  95.     <link href="<?=$us_url_root?><?=str_replace('../','',$settings->us_css2);?>" rel="stylesheet">
  96.  
  97.     <!-- Your Custom CSS Goes Here!-->
  98.     <link href="<?=$us_url_root?><?=str_replace('../','',$settings->us_css3);?>" rel="stylesheet">
  99.  
  100.     <!-- Custom Fonts -->
  101.     <link href="<?=$us_url_root?>users/fonts/css/font-awesome.min.css" rel="stylesheet" type="text/css">
  102. </head>
  103.  
  104. <body>
  105.     <?php if(isset($_GET['err'])){
  106.         bold("<br>".$err);
  107.     } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement