<commit_before><?php
/*
	PufferPanel - A Minecraft Server Management Panel
	Copyright (c) 2013 <NAME>

	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 for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see http://www.gnu.org/licenses/.
 */
if(file_exists('install.lock'))
	exit('Installer is Locked.');
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<link rel="stylesheet" href="../../assets/css/bootstrap.css">
	<title>PufferPanel Installer</title>
</head>
<body>
	<div class="container">
		<div class="alert alert-danger">
			<strong>WARNING:</strong> Do not run this version on a live environment! There are known security holes that we are working on getting patched. This is extremely beta software and this version is to get the features in place while we work on security enhancements.
		</div>
		<div class="navbar navbar-default">
			<div class="navbar-header">
				<a class="navbar-brand" href="#">Install PufferPanel</a>
			</div>
		</div>
		<div class="col-12">
			<div class="row">
				<div class="col-2"></div>
				<div class="col-8">
					<div class="panel panel-info">
						<div class="panel-heading">
							<h3 class="panel-title">Installer Information</h3>
						</div>
						<div class="panel-body">
							<p>When this installer finishes please manually change the permissions back to <code>0755</code> for the <code>/src/framework</code> folder, and delete this installer. Please set the permissions on the <code>configuration.php</code> file to <code>0444</code>.</p>
							<p>You are installing version <code>git-<?php echo trim(file_get_contents('../../../.git/refs/heads/master')); ?></code>. Please keep track of this information as we may request it when you report bugs.</p>
						</div>
					</div>
					<?php

						/* Permissions Checking */
						$successList = null; $failedList = null;
						$continue = true;

						/*
						 * Check to make sure PHP is at least 5.5.0
						 */
						if(version_compare(PHP_VERSION, "5.5.0") < 0){

							echo '<div class="panel panel-danger">
								<div class="panel-heading">
									<h3 class="panel-title">PHP version is not compatible</h3>
								</div>
								<div class="panel-body">
									<p class="text-danger">Minimum Required Version: <code>5.5.0</code><br />
									Currently Installed: <code>'.PHP_VERSION.'</code></p>
								</div>
							</div>';
							$continue = false;

						}

						/*
						 * Check Configuration File
						 */
						if(substr(sprintf('%o', fileperms('../../../src/framework/configuration.php.dist')), -4) == "0666")
							$successList .= '<p class="text-success"><code>/src/framework/configuration.php.dist</code> is correctly CHMOD\'d.</p>';
						else
							$failedList .= '<p class="text-danger"><code>/src/framework/configuration.php.dist</code> is improperly CHMOD\'d. It should be 0666.</p>';


						/*
						 * Check Framework Folder
						 */
						if(substr(sprintf('%o', fileperms('../../../src/framework')), -4) == "0777")
							$successList .= '<p class="text-success"><code>/src/framework</code> is correctly CHMOD\'d.</p>';
						else
							$failedList .= '<p class="text-danger"><code>/src/framework</code> is improperly CHMOD\'d. It should be 0777.</p>';

						/*
						 * Check Installer Folder
						 */
						if(substr(sprintf('%o', fileperms('../install')), -4) == "0777")
							$successList .= '<p class="text-success"><code>/panel/admin/install</code> is correctly CHMOD\'d.</p>';
						else
							$failedList .= '<p class="text-danger"><code>/panel/admin/install</code> is improperly CHMOD\'d. It should be 0777.</p>';

						/*
						 * Check Installer Process Folder
						 */
						if(substr(sprintf('%o', fileperms('do')), -4) == "0777")
							$successList .= '<p class="text-success"><code>/panel/admin/install/do</code> is correctly CHMOD\'d.</p><br />';
						else
							$failedList .= '<p class="text-danger"><code>/panel/admin/install/do</code> is improperly CHMOD\'d. It should be 0777.</p>';

						/*
						 * Output
						 */
						if(!is_null($failedList)){

							echo '<div class="panel panel-danger">
								<div class="panel-heading">
									<h3 class="panel-title">Failed CHMOD Checks</h3>
								</div>
								<div class="panel-body">
									'.$failedList.'
								</div>
							</div>';

						}

						if(!is_null($successList)){

							echo '<div class="panel panel-success">
								<div class="panel-heading">
									<h3 class="panel-title">Passed CHMOD Checks</h3>
								</div>
								<div class="panel-body">
									'.$successList.'
								</div>
							</div>';

						}<commit_msg>Require panel to be installed using git<commit_after><?php
/*
	PufferPanel - A Minecraft Server Management Panel
	Copyright (c) 2013 <NAME>

	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 for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see http://www.gnu.org/licenses/.
 */
if(file_exists('install.lock'))
	exit('Installer is Locked.');
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<link rel="stylesheet" href="../../assets/css/bootstrap.css">
	<title>PufferPanel Installer</title>
</head>
<body>
	<div class="container">
		<div class="alert alert-danger">
			<strong>WARNING:</strong> Do not run this version on a live environment! There are known security holes that we are working on getting patched. This is extremely beta software and this version is to get the features in place while we work on security enhancements.
		</div>
		<div class="navbar navbar-default">
			<div class="navbar-header">
				<a class="navbar-brand" href="#">Install PufferPanel</a>
			</div>
		</div>
		<div class="col-12">
			<div class="row">
				<div class="col-2"></div>
				<div class="col-8">
					<div class="panel panel-info">
						<div class="panel-heading">
							<h3 class="panel-title">Installer Information</h3>
						</div>
						<div class="panel-body">
							<p>When this installer finishes please manually change the permissions back to <code>0755</code> for the <code>/src/framework</code> folder, and delete this installer. Please set the permissions on the <code>configuration.php</code> file to <code>0444</code>.</p>
							<p>You are installing version <code>git-<?php echo trim(file_get_contents('../../../.git/refs/heads/master')); ?></code>. Please keep track of this information as we may request it when you report bugs.</p>
						</div>
					</div>
					<?php

						/* Permissions Checking */
						$successList = null; $failedList = null;
						$continue = true;

						/*
						 * Fail if not installed with git
						 */
						if(!@file_get_contents('../../../src/versions/current')){

							echo '<div class="panel panel-danger">
								<div class="panel-heading">
									<h3 class="panel-title">Incompatable Install Method</h3>
								</div>
								<div class="panel-body">
									<p class="text-danger">This panel <strong>must</strong> be installed using `git clone` on your server. Please re-read the wiki and follow the directions correctly.</p>
								</div>
							</div><hr />';
							$continue = false;

						}

						/*
						 * Check to make sure PHP is at least 5.5.0
						 */
						if(version_compare(PHP_VERSION, "5.5.0") < 0){

							echo '<div class="panel panel-danger">
								<div class="panel-heading">
									<h3 class="panel-title">PHP version is not compatible</h3>
								</div>
								<div class="panel-body">
									<p class="text-danger">Minimum Required Version: <code>5.5.0</code><br />
									Currently Installed: <code>'.PHP_VERSION.'</code></p>
								</div>
							</div><hr />';
							$continue = false;

						}

						/*
						 * Check Configuration File
						 */
						if(substr(sprintf('%o', fileperms('../../../src/framework/configuration.php.dist')), -4) == "0666")
							$successList .= '<p class="text-success"><code>/src/framework/configuration.php.dist</code> is correctly CHMOD\'d.</p>';
						else
							$failedList .= '<p class="text-danger"><code>/src/framework/configuration.php.dist</code> is improperly CHMOD\'d. It should be 0666.</p>';


						/*
						 * Check Framework Folder
						 */
						if(substr(sprintf('%o', fileperms('../../../src/framework')), -4) == "0777")
							$successList .= '<p class="text-success"><code>/src/framework</code> is correctly CHMOD\'d.</p>';
						else
							$failedList .= '<p class="text-danger"><code>/src/framework</code> is improperly CHMOD\'d. It should be 0777.</p>';

						/*
						 * Check Installer Folder
						 */
						if(substr(sprintf('%o', fileperms('../install')), -4) == "0777")
							$successList .= '<p class="text-success"><code>/panel/admin/install</code> is correctly CHMOD\'d.</p>';
						else
							$failedList .= '<p class="text-danger"><code>/panel/admin/install</code> is improperly CHMOD\'d. It should be 0777.</p>';

						/*
						 * Check Installer Process Folder
						 */
						if(substr(sprintf('%o', fileperms('do')), -4) == "0777")
							$successList .= '<p class="text-success"><code>/panel/admin/install/do</code> is correctly CHMOD\'d.</p><br />';
						else
							$failedList .= '<p class="text-danger"><code>/panel/admin/install/do</code> is improperly CHMOD\'d. It should be 0777.</p>';

						/*
						 * Output
						 */
						if(!is_null($failedList)){

							echo '<div class="panel panel-danger">
								<div class="panel-heading">
									<h3 class="panel-title">Failed CHMOD Checks</h3>
								</div>
								<div class="panel-body">
									'.$failedList.'
								</div>
							</div><hr />';

						}

						if(!is_null($successList)){

							echo '<div class="panel panel-success">
								<div class="panel-heading">
									<h3 class="panel-title">Passed CHMOD Checks</h3>
								</div>
								<div class="panel-body">
									'.$successList.'
								</div>
							</div>';

						}
{'fraction_non_alphanumeric': 0.16356531447711203, 'fraction_numerical': 0.01339784145887607, 'mean_word_length': 2.719377162629758, 'pattern_counts': {'":': 0, '<': 248, '<?xml version=': 0, '>': 244, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2949134', 'n_tokens_mistral': 4363, 'n_tokens_neox': 3170, 'n_words': 931}