ctucx.git: tinyDAV

[php] Cal-/ CardDAV server with a simple web-GUI based on SabreDAV

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 
65 
66 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 
77 
78 
79 
80 
81 
82 
83 
84 
85 
86 
87 
88 
89 
90 
91 
92 
93 
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104 
105 
106 
107 
108 
109 
110 
111 
112 
113 
114 
115 
116 
117 
118 
119 
120 
121 
122 
123 
124 
125 
126 
127 
128 
129 
130 
131 
132 
133 
134 
135 
136 
137 
138 
139 
140 
141 
142 <!-- INCLUDE header.tpl -->

<div class="clearfix">
	<div class="float-left">
		<h4 class="title">TinyDAV</h4>
	</div>
	<div class="float-right">
		<a class="button button-small" href="/logout">logout</a>
	</div>
</div>

<!-- IF not IS_ADMIN -->

<h5>Calendars</h5>
<table>
	<thead>
		<tr>
			<th>Name</th>
			<th>URI</th>
			<th>Actions</th>
		</tr>
	</thead>

	<tbody>

		<!-- BEGIN calendars -->
		<tr>
			<td>{calendars.DISPLAYNAME}</td>
			<td>https://{PAGE_URL}/dav/addressbooks/{USERNAME}/{calendars.URI}</td>
			<td><a href="/update?type=calendar&id={calendars.ID}">edit</a> - <a href="/dav/addressbooks/{USERNAME}/{calendars.URI}?export">export</a></td>
		</tr>
		<!-- END calendars -->

	</tbody>
</table>

<h5>Addressbooks</h5>
<table>
	<thead>
		<tr>
			<th>Name</th>
			<th>URI</th>
			<th>Actions</th>
		</tr>
	</thead>

	<tbody>

		<!-- BEGIN addressbooks -->
		<tr>
			<td>{addressbooks.DISPLAYNAME}</td>
			<td>https://{PAGE_URL}/dav/addressbooks/{USERNAME}/{addressbooks.URI}</td>
			<td><a href="/update?type=addressbook&id={addressbooks.ID}">edit</a> - <a href="/dav/addressbooks/{USERNAME}/{addressbooks.URI}?export">export</a></td>
		</tr>
		<!-- END addressbooks -->

	</tbody>
</table>

<h5>New</h5>
<form method="post" action="/create">
	<fieldset>
		<label for="type">Type</label>
		<select id="type" name="type">
			<option value="calendar">Calendar</option>
			<option value="addressbook">Addressbook</option>
		</select>

		<label for="displayname">Displayname:</label>
		<input type="text" name="displayname" id="displayname">

		<label for="displayname">URI: (optional)</label>
		<input type="text" name="uri" id="uri">

		<input type="hidden" name="username" value="{USERNAME}">
		<input class="button-primary" type="submit" value="create">
	</fieldset>
</form>

<!-- ELSE --> 
	
<h5>Users</h5>
<table>
	<thead>
		<tr>
			<th>Username</th>
			<th>Actions</th>
		</tr>
	</thead>
	<tbody>

		<!-- BEGIN users -->
		<tr>
			<td>{users.USERNAME}</td>
			<!-- IF users.ID == 1 -->

			<td>admin can't be edited</td>

			<!-- ELSE -->

			<td><a href="/update?type=user&username={users.USERNAME}">edit</a>

			<!-- ENDIF -->
		</tr>
		<!-- END users -->

	</tbody>
</table>

<h5>New user</h5>
<form method="post" action="/create">
	<fieldset>
		<label for="username">Username:</label>
		<input type="text" name="username" id="username" required>

		<label for="password">Password:</label>
		<input type="password" name="password" id="password" required>

		<input type="hidden" name="type" value="user">
		<input class="button-primary" type="submit" value="create">
	</fieldset>
</form>

<!-- ENDIF -->

<h5>Change password</h5>

<form method="post" action="/update">
	<fieldset>
		<label for="password1">New password:</label>
		<input type="password" name="password1" id="password1" required>

		<label for="password1">Repeat new password:</label>
		<input type="password" name="password2" id="password2" required>

		<input type="hidden" name="type" value="password">
		<input type="hidden" name="username" value="{USERNAME}">
		<input class="button-primary" type="submit" value="update password">
	</fieldset>
</form>

<!-- INCLUDE footer.tpl -->