-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathexpress.php
206 lines (197 loc) · 9.65 KB
/
express.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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<?php
if (isset($_GET['source'])) {show_source(__FILE__); exit();}
/**
* @author Stöger Florian D. M. (http://fdms.eu)
* @license EUPL 1.1 (//joinup.ec.europa.eu/sites/default/files/eupl1.1.-licence-en_0.pdf)
* @copyright © (//joinup.ec.europa.eu/sites/default/files/eupl1.1.-licence-en_0.pdf) Stöger Florian D. M. (http://fdms.eu)
*/
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Wikimedia OTRS release generator</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="//tools-static.wmflabs.org/cdnjs/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="//tools-static.wmflabs.org/static/jquery-ui/1.11.1/jquery-ui.css">
<style>
p {
background-color: white;
}
.hof {
height: 100vh;
overflow-y: auto;
}
.dropdown-menu li {
cursor: pointer;
}
</style>
<script type="text/javascript" src="//tools-static.wmflabs.org/cdnjs/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script type="text/javascript" src="//tools-static.wmflabs.org/cdnjs/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script>
$(document).ready(function(){
$("#meta").popover({
html:true,
});
$("form").on("keyup keypress", function(e) {
if (e.keyCode == 13) {
e.preventDefault();
}
});
$(".nt").on("keydown", function(e) {
if (e.keyCode == 9) {
e.preventDefault()
}
});
});
function v() {
vi = 0;
if (!$("#licensei").val().match(/\w/)) {
if (!$("#fg0").hasClass("has-error")) {
$("#fg0").addClass("has-error");
}
vi++;
} else {
if ($("#fg0").hasClass("has-error")) {
$("#fg0").removeClass("has-error");
}
}
if (!$("#namei").val().match(/\w/)) {
if (!$("#fg1").hasClass("has-error")) {
$("#fg1").addClass("has-error");
}
vi++;
} else {
if ($("#fg1").hasClass("has-error")) {
$("#fg1").removeClass("has-error");
}
}
if ($("#irep").css("display") != "none") {
if (!$("#repi").val().match(/\w/)) {
if (!$("#fg2").hasClass("has-error")) {
$("#fg2").addClass("has-error");
}
vi++;
} else {
if ($("#fg2").hasClass("has-error")) {
$("#fg2").removeClass("has-error");
}
}
if (!$("#authi").val().match(/\w/)) {
if (!$("#fg3").hasClass("has-error")) {
$("#fg3").addClass("has-error");
}
vi++;
} else {
if ($("#fg3").hasClass("has-error")) {
$("#fg3").removeClass("has-error");
}
}
}
if (vi == 0) {
$("form").submit();
}
}
</script>
</head>
<body style="background: url('bg.png') no-repeat fixed right bottom; overflow:hidden;">
<?php
date_default_timezone_set("UTC");
$starttime = date("H:i:s");
$name = $rep = $auth = $filer = $license = $s1 = $s2 = $s3 = "";
if ($_SERVER["REQUEST_METHOD"] == "GET") {
$name = test_input($_GET["name"]);
$rep = test_input($_GET["rep"]);
$auth = test_input($_GET["auth"]);
$filer = test_input($_GET["file"]);
$license = test_input($_GET["license"]);
$s1 = test_input($_GET["s1"]);
$s2 = test_input($_GET["s2"]);
$s3 = test_input($_GET["s3"]);
}
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
if ($license == "") $license = "Creative Commons Attribution-ShareAlike 4.0 International";
if ($s1 == "") $s1 = "1";
if ($s2 == "") $s2 = "1";
else if ($s2 == "2") $filer = "attached to this email";
if ($s3 == "") $s3 = "1";
switch ($s3) {
case "1":
$p2s = "the media work";
break;
case "2":
$p2s = "the work depicted in the media";
break;
case "3":
$p2s = "both the work depicted and the media";
break;
}
?>
<div class="container">
<form method="post" action="//tools.wmflabs.org/relgen/index.php">
<input type="hidden" name="trn" value="express" />
<input type="hidden" name="starttime" value="<?=$starttime?>" />
<input type="hidden" name="filer" value="<?=$filer?>" />
<input type="hidden" name="s1" value="<?=$s1?>" />
<input type="hidden" name="s2" value="<?=$s2?>" />
<input type="hidden" name="s3" value="<?=$s3?>" />
<input type="hidden" name="result" value="1" />
<div class="row hof">
<div class="col-md-11">
<h1>Wikimedia OTRS release generator <small><a id="meta" tabindex="0" data-toggle="popover" data-placement="bottom" data-trigger="focus" data-content="created and maintained by <a href='//meta.wikimedia.org/wiki/User:FDMS4' target='_blank'>FDMS</a><br />© (<a href='//joinup.ec.europa.eu/sites/default/files/eupl1.1.-licence-en_0.pdf' target='_blank'>EUPL 1.1</a>) <a href='http://fdms.eu' target='_blank'>Stöger Florian D. M.</a" style="color:#777;">express 0.3</a></small></h1>
<br /><br />
</div>
<div class="col-md-7">
<?php if ($filer != "") {
?>
<p>I agree to publish <?=$p2s?> <?php if ($s2 == "2") { ?><?=$filer?><?php } else if ($s2 == "3") { ?><a href="<?=$filer?>" target="_blank"><?=$filer?></a><?php } else { ?><a href="//commons.wikimedia.org/wiki/File:<?=$filer?>" target="_blank"><?=str_replace('_', ' ', $filer)?></a><?php } ?> under the following free license:</p>
<div id="fg0" class="form-group"><div class="input-group">
<input id="licensei" type="text" name="license" value="<?=$license?>" class="form-control" />
<div class="input-group-btn">
<a role="button" data-toggle="dropdown" class="btn btn-default"><span class="caret" /></a>
<ul class="dropdown-menu dropdown-menu-right">
<li><a onclick="$('#licensei').val('Creative Commons Attribution-ShareAlike 4.0 International'); $('#iawattr').show();">Creative Commons Attribution-ShareAlike 4.0 International</a></li>
<li><a onclick="$('#licensei').val('Creative Commons Attribution 4.0 International'); $('#iawattr').show();">Creative Commons Attribution 4.0 International</a></li>
<li><a onclick="$('#licensei').val('Creative Commons CC0 1.0 Universal'); $('#iawattr').hide();">Creative Commons CC0 1.0 Universal (public domain dedication)</a></li>
</ul>
<a role="button" href="//commons.wikimedia.org/wiki/Commons:First_steps/License_selection" target="_blank" class="btn btn-default">
<span class="glyphicon glyphicon-question-sign" />
</a>
</div>
</div></div>
<p>I acknowledge that by doing so I grant anyone the right to use the work, even in a commercial product or otherwise, and to modify it according to their needs, provided that they abide by the terms of the license and any other applicable laws.</p>
<p>I am aware that this agreement is not limited to Wikipedia or related sites.</p>
<p id="iawattr">I am aware that the copyright holder always retains ownership of the copyright as well as the right to be attributed in accordance with the license chosen. Modifications others make to the work will not be claimed to have been made by the copyright holder.</p>
<p>I acknowledge that I cannot withdraw this agreement, and that the content may or may not be kept permanently on a Wikimedia project.</p>
<br />
<button type="button" class="btn btn-default btn-block" data-toggle="button" onclick="$('#iag').toggle();">I agree</button>
<br /><br />
<?php
} else {
echo "<p class='text-danger'>Error: No content specified!</p>";
}
?>
</div>
<div class="col-md-4">
<div style="display:none;" id="iag">
my name<br /><div id="fg1" class="form-group"><input id="namei" type="text" name="name" value="<?=$name?>" placeholder="John Doe (required)" class="form-control" /></div>
<div<?php if ($s1 != "2") { ?> style="display:none;"<?php } ?> id="irep">
<br />
copyright holder<br /><div id="fg2" class="form-group"><input id="repi" type="text" name="rep" value="<?=$rep?>" placeholder="Ace Inc. / Jane Roe (required)" class="form-control" /></div>
<br />
my authority<br /><div id="fg3" class="form-group"><input id="authi" type="text" name="auth" value="<?=$auth?>" placeholder="CEO, appointed representative, … (required)" class="form-control" /></div>
</div>
<br /><br />
<a role="button" class="btn btn-primary btn-block nt" onclick="v()">proceed to the next step</a>
</div>
</div>
<br />
</div>
</form>
</div>
</body>
</html>