mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 06:30:07 +01:00
79 lines
No EOL
2.4 KiB
PHP
79 lines
No EOL
2.4 KiB
PHP
<?php
|
|
/*
|
|
* Paste <https://github.com/jordansamuel/PASTE>
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 3
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License in GPL.txt for more details.
|
|
*/
|
|
session_start();
|
|
|
|
require_once('config.php');
|
|
require_once('includes/functions.php');
|
|
|
|
// UTF-8
|
|
header('Content-Type: text/html; charset=utf-8');
|
|
|
|
$date = date('jS F Y');
|
|
$ip = $_SERVER['REMOTE_ADDR'];
|
|
$data_ip = file_get_contents('tmp/temp.tdata');
|
|
$conn = new PDO(
|
|
"mysql:host=$db_host;dbname=$db_schema;charset=utf8",
|
|
$db_user,
|
|
$db_pass,
|
|
$db_opts
|
|
);
|
|
|
|
$site_info_rows = $conn->query('SELECT * FROM site_info');
|
|
while ($row = $site_info_rows->fetch()) {
|
|
$title = Trim($row['title']);
|
|
$des = Trim($row['des']);
|
|
$baseurl = Trim($row['baseurl']);
|
|
$keyword = Trim($row['keyword']);
|
|
$site_name = Trim($row['site_name']);
|
|
$email = Trim($row['email']);
|
|
$twit = Trim($row['twit']);
|
|
$face = Trim($row['face']);
|
|
$gplus = Trim($row['gplus']);
|
|
$ga = Trim($row['ga']);
|
|
$additional_scripts = Trim($row['additional_scripts']);
|
|
}
|
|
|
|
// Set theme and language
|
|
$site_theme_rows = $conn->query('SELECT * FROM interface WHERE id="1"');
|
|
while ($row = $site_theme_rows->fetch()) {
|
|
$default_lang = Trim($row['lang']);
|
|
$default_theme = Trim($row['theme']);
|
|
}
|
|
require_once("langs/$default_lang");
|
|
|
|
|
|
$p_title = $lang['archive']; // "Pastes Archive";
|
|
|
|
// Check if IP is banned
|
|
if ( is_banned($con, $ip) ) die($lang['banned']); // "You have been banned from ".$site_name;
|
|
|
|
// Site permissions
|
|
$query = "SELECT * FROM site_permissions where id='1'";
|
|
$result = mysqli_query($con, $query);
|
|
|
|
// Logout
|
|
if (isset($_GET['logout'])) {
|
|
header('Location: ' . $_SERVER['HTTP_REFERER']);
|
|
unset($_SESSION['token']);
|
|
unset($_SESSION['oauth_uid']);
|
|
unset($_SESSION['username']);
|
|
session_destroy();
|
|
}
|
|
|
|
// Theme
|
|
require_once('theme/' . $default_theme . '/header.php');
|
|
require_once('theme/' . $default_theme . '/event.php');
|
|
require_once('theme/' . $default_theme . '/footer.php');
|
|
?>
|