This repository has been archived by the owner on Nov 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathindex.php
64 lines (52 loc) · 2.05 KB
/
index.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
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
require_once('includes/config.php');
require_once('includes/access.php');
require_once('includes/todo.php');
if(isset($_GET['logout'])) { $_GET['logout'] == 'true' ? logout() : '';}
$cmd = get_cmd($_POST);
$cmd2 = get_cmd($_POST, 'cmd2');
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">
<html>
<head>
<meta http-equiv="Content-type" value="text/html; charset=utf-8">
<title>todo.txt</title>
<meta name="viewport" content="initial-scale=1.0,maximum-scale=1,user-scalable=0" />
<?php if($iphoneWebApp == 'yes'){ ?>
<meta name="apple-mobile-web-app-capable" content="yes" />
<?php } ?>
<link rel="apple-touch-icon" href="todotxt_logo.png"/>
<link media="screen" href="stylesheet.css" rel="stylesheet" type="text/css">
<link media="handheld" href="handheld.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="todo.js">
</script>
</head>
<body>
<div id="container">
<div id="top">
<h1><a href="<?php echo $todoUrl; ?>">todo.txt</a></h1>
<form id="todo" name="todo" action="<?php echo $todoUrl; ?>" method="POST">
<input autocapitalize="off" autocorrect="off"
type="text" id="cmd" name="cmd"
value="<?php if(isset($cmd)){echo $cmd." ";} ?>" /><br />
<input type="hidden" id="cmd2" name="cmd2"
value="<?php echo get_cmd2($cmd,$cmd2); ?>" />
<input type="submit" id="sub" value="Submit" />
</form>
</div>
<div id="output">
<?php
// run todo.sh and print list
run_todo($cmd);
// rerun the previous list command if current command is not a list
if(isset($cmd2) && !ls_check($cmd)){
run_todo($cmd2);
}
?>
</div>
<div id="footer">
<a href="<?php echo $todoUrl; ?>?logout=true">Logout</a>
</div>
</div>
</body>
</html>