Corrections diverses (fish)

This commit is contained in:
Michel Roux 2013-10-16 23:10:51 +02:00
parent 2f97f00fd5
commit b723127bdd
3 changed files with 7 additions and 7 deletions

View File

@ -19,12 +19,12 @@ if (!empty($_POST['action'])) {
$session = new Net_SSH2($config['host'], $config['port']);
if ($session->login($config['user'], $config['pass'])) {
if ($_POST['action'] == 'status') {
echo ansi2html($session->exec('cd ' . $config['path'] . ' && ' . $gitstatus));
echo ansi2html($session->exec('bash -c \'cd ' . $config['path'] . ' && ' . $gitstatus . "'"));
} else if ($_POST['action'] == 'push') {
$message = empty($_POST['message']) ? 'FTP' : $_POST['message'];
echo ansi2html($session->exec('cd ' . $config['path'] . ' && git add -A && git commit -m "' . $message . '" && git push && ' . $gitstatus));
echo ansi2html($session->exec('bash -c \'cd ' . $config['path'] . ' && git add -A && git commit -m "' . addslashes($message) . '" && git push && ' . $gitstatus . "'"));
} else if ($_POST['action'] == 'pull') {
echo ansi2html($session->exec('cd ' . $config['path'] . ' && git pull && ' . $gitstatus));
echo ansi2html($session->exec('bash -c \'cd ' . $config['path'] . ' && git pull && ' . $gitstatus . "'"));
}
}
}

View File

@ -1,3 +1,5 @@
"use strict";
window.addEventListener('load', function() {
var sections = document.querySelectorAll('section');
for (var i = 0; i < sections.length; i++) {

View File

@ -3,10 +3,8 @@
session_start();
if (defined('ONGITLAB') && ONGITLAB) {
if (!isset($_SESSION['remember_user_token'])) {
if (dirname(__FILE__) != '/') {
header('Location: /');
}
if (!isset($_COOKIE['remember_user_token'])) {
header('Location: /');
exit;
}
}