From b723127bdd02a1fdc3217c17c0aff79728e10bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xe=CC=81fir=20Destiny?= Date: Wed, 16 Oct 2013 23:10:51 +0200 Subject: [PATCH] Corrections diverses (fish) --- ajax.php | 6 +++--- js/app.js | 2 ++ utils.php | 6 ++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ajax.php b/ajax.php index ee05459..961d7fb 100644 --- a/ajax.php +++ b/ajax.php @@ -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 . "'")); } } } diff --git a/js/app.js b/js/app.js index 827ca83..2eef276 100644 --- a/js/app.js +++ b/js/app.js @@ -1,3 +1,5 @@ +"use strict"; + window.addEventListener('load', function() { var sections = document.querySelectorAll('section'); for (var i = 0; i < sections.length; i++) { diff --git a/utils.php b/utils.php index f57d2e9..c117502 100644 --- a/utils.php +++ b/utils.php @@ -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; } }