-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpull.php
51 lines (49 loc) · 1.48 KB
/
pull.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
$conf = include( dirname(__FILE__)."/conf.php" );
include( dirname(dirname(__FILE__))."/Teinte/Build.php" );
?>
<html>
<head>
<meta charset="UTF-8" />
<title>Administration, <?= $conf['title'] ?></title>
<link rel="stylesheet" type="text/css" href="../Teinte/tei2html.css" />
</head>
<body>
<div id="center">
<h1><a href="pull.php">Administration</a>, <a href="." target="_blank"><?= $conf['title'] ?>, OBVIL</a></h1>
<form method="POST">
<label>Mot de passe
<input name="pass" type="password"/>
</label>
<button name="up" type="submit">Mettre à jour</button>
<label>Forcer
<input name="force" type="checkbox"/>
</label>
</form>
<section>
<?php
if ( !isset( $_POST['pass'] ));
else if ( isset( $conf['pass'] ) && $conf['pass'] && $_POST['pass'] != $conf['pass'] ) {
echo "Mauvais mot de passe";
}
else {
$getcwd = getcwd();
chdir( $conf['srcdir'] );
echo 'Mise à jour distante <pre>'."\n";
// $last = exec( $conf['cmdup'], $output, $ret);
// echo implode( "\n", $output);
passthru( $conf['cmdup'] );
chdir( $getcwd );
echo '</pre>'."\n";
// envoyer le csv au build
echo 'Transformations <pre style="white-space: pre-wrap;">'."\n";
$build = new Teinte_Build( $conf );
if ( isset($_POST['force']) && $_POST['force'] ) $build->clean();
$build->glob( );
echo '</pre>'."\n";
}
?>
</section>
</div>
</body>
</html>