-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpull.php
More file actions
59 lines (58 loc) · 1.55 KB
/
pull.php
File metadata and controls
59 lines (58 loc) · 1.55 KB
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
52
53
54
55
56
57
58
59
<?php
$conf = include( dirname(__FILE__)."/conf.php" );
include( dirname(dirname(__FILE__))."/Teinte/Build.php" );
if (php_sapi_name() == "cli") {
work($conf);
exit();
}
?>
<html>
<head>
<meta charset="UTF-8" />
<title>Administration, haine du théâtre</title>
<link rel="stylesheet" type="text/css" href="../Teinte/tei2html.css" />
</head>
<body>
<div id="center" style="padding: 1em; ">
<h1><a href="pull.php">Administration</a>, <a href="." target="_blank">haine du théâtre</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 ( $_POST['pass'] != $conf['pass'] ) {
echo "Mauvais mot de passe";
}
else {
work($conf, isset($_POST['force']));
}
?>
</section>
</div>
</body>
</html>
<?php
function work($conf, $force=null) {
$getcwd = getcwd();
chdir($conf['srcdir']);
echo 'Mise à jour distante <pre style="white-space: pre-wrap;">'."\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 ($force) $build->clean();
$build->glob();
echo '</pre>'."\n";
}
?>