DieGeduld
2/20/2016 - 10:04 PM

access.php

<?php 	//echo `git status 2>&1`;
// 		echo `git checkout HEAD^ wp-content/themes 2>&1`;
// 		echo `git stash 2>&1`;

	error_reporting( E_ALL );
	ini_set('display_errors', E_ALL); 

	include_once 'access.php';

	if(isset($_GET['stash']))
	{
		echo `git stash 2>&1`;
	}
	echo `git pull https://username:password@github.com/pjureisobar/aptaclub.at.git 2>&1`;

	// deployment log:
	error_log(date('Y-m-d H:i:s') . " DEPLOYMENT by $_SERVER[REMOTE_ADDR]\n", 3, "logs/deployment.log");
<?php
	//put sha1() encrypted password here - example is 'hello'
	$password = 'ced315c91e61aeb0469189f8ddc728f567ae1665';

	session_start();

	if(!isset($_SESSION['loggedIn'])) $_SESSION['loggedIn'] = false;

	if(isset($_REQUEST['password'])) 
	{
	    if (sha1($_REQUEST['password']) == $password) 
	        $_SESSION['loggedIn'] = true;
	    else 
	        die ('Incorrect password');
	} 

	if (!$_SESSION['loggedIn']): ?>
	<html><head><title>Login</title></head>
	  <body>
	    <p>You need to login</p>
	    <form method="post">
	      Password: <input type="password" name="password"> <br />
	      <input type="submit" name="submit" value="Login">
	    </form>
	  </body>
	</html>

<?php
	exit();
	endif;
?>