page.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <?php
  2. use PrivateBin\I18n;
  3. ?><!DOCTYPE html>
  4. <html lang="en">
  5. <head>
  6. <meta charset="utf-8" />
  7. <meta name="robots" content="noindex" />
  8. <meta name="referrer" content="no-referrer">
  9. <title><?php echo I18n::_($NAME); ?></title>
  10. <link type="text/css" rel="stylesheet" href="css/privatebin.css?<?php echo rawurlencode($VERSION); ?>" />
  11. <?php
  12. if ($SYNTAXHIGHLIGHTING):
  13. ?>
  14. <link type="text/css" rel="stylesheet" href="css/prettify/prettify.css?<?php echo rawurlencode($VERSION); ?>" />
  15. <?php
  16. if (strlen($SYNTAXHIGHLIGHTINGTHEME)):
  17. ?>
  18. <link type="text/css" rel="stylesheet" href="css/prettify/<?php echo rawurlencode($SYNTAXHIGHLIGHTINGTHEME); ?>.css?<?php echo rawurlencode($VERSION); ?>" />
  19. <?php
  20. endif;
  21. endif;
  22. ?>
  23. <script type="text/javascript" src="js/jquery-3.1.1.js" integrity="sha512-U6K1YLIFUWcvuw5ucmMtT9HH4t0uz3M366qrF5y4vnyH6dgDzndlcGvH/Lz5k8NFh80SN95aJ5rqGZEdaQZ7ZQ==" crossorigin="anonymous"></script>
  24. <script type="text/javascript" src="js/sjcl-1.0.6.js" integrity="sha512-DsyxLV/uBoQlRTJmW5Gb2SxXUXB+aYeZ6zk+NuXy8LuLyi8oGti9AGn6He5fUY2DtgQ2//RjfaZog8exFuunUQ==" crossorigin="anonymous"></script>
  25. <script type="text/javascript" src="js/kjua.min.js" integrity="sha512-hmvfOhcr4J8bjQ2GuNVzfSbuulv72wgQCJpgnXc2+cCHKqvYo8pK2nc0Q4Esem2973zo1radyIMTEkt+xJlhBA==" crossorigin="anonymous"></script>
  26. <?php
  27. if ($ZEROBINCOMPATIBILITY):
  28. ?>
  29. <script type="text/javascript" src="js/base64-1.7.js" integrity="sha512-JdwsSP3GyHR+jaCkns9CL9NTt4JUJqm/BsODGmYhBcj5EAPKcHYh+OiMfyHbcDLECe17TL0hjXADFkusAqiYgA==" crossorigin="anonymous"></script>
  30. <?php
  31. else:
  32. ?>
  33. <script type="text/javascript" src="js/base64-2.1.9.js" integrity="sha512-rbqAby7hObftbEoGQzkhUbEh5YkUn2MtekTLs4btvo2oly4CZ3DxhJzEh0u/rNzS54tcJdqi5Ug1ruugEd2U1g==" crossorigin="anonymous"></script>
  34. <?php
  35. endif;
  36. ?>
  37. <script type="text/javascript" src="js/rawdeflate-0.5.js" integrity="sha512-tTdZ7qMr7tt5VQy4iCHu6/aGB12eRwbUy+AEI5rXntfsjcRfBeeqJloMsBU9FrGk1bIYLiuND/FhU42LO1bi0g==" crossorigin="anonymous"></script>
  38. <script type="text/javascript" src="js/rawinflate-0.3.js" integrity="sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==" crossorigin="anonymous"></script>
  39. <?php
  40. if ($SYNTAXHIGHLIGHTING):
  41. ?>
  42. <script type="text/javascript" src="js/prettify.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-m8iHxoN+Fe12xxFwWNdY/TS4KoFntHp29qY0xUzBnPd0bkKMOR/dFhEdTWydpt0b/fIXyhB+znGYUvgjfJ2RzQ==" crossorigin="anonymous"></script>
  43. <?php
  44. endif;
  45. if ($MARKDOWN):
  46. ?>
  47. <script type="text/javascript" src="js/showdown-1.6.1.js" integrity="sha512-e6kAsBTgFnTBnEQXrq8BV6+XFwxb3kyWHeEPOl+KhxaWt3xImE2zAW2+yP3E2CQ7F9yoJl1poVU9qxkOEtVsTQ==" crossorigin="anonymous"></script>
  48. <script type="text/javascript" src="js/purify.min.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-jJuy143F5Oy7oS3VkjzeJGBxIUuQ1H0eSjuvLGD3FiQzeu8Pwp5vI/jQ2dxlxSrzejmNMicdLHnIqH7R8Ft0lQ==" crossorigin="anonymous"></script>
  49. <?php
  50. endif;
  51. ?>
  52. <script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-HXQpEiyKGjM1QuKb+BfxjMcyrrmD3FX5nw5hwgOTONCtQqxCM5Q5bGkmsEvSKc+RcBUpGT3Mc48TddPI8kAlIg==" crossorigin="anonymous"></script>
  53. <!--[if lt IE 10]>
  54. <style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
  55. <![endif]-->
  56. <link rel="apple-touch-icon" href="img/apple-touch-icon.png?<?php echo rawurlencode($VERSION); ?>" sizes="180x180" />
  57. <link rel="icon" type="image/png" href="img/favicon-32x32.png?<?php echo rawurlencode($VERSION); ?>" sizes="32x32" />
  58. <link rel="icon" type="image/png" href="img/favicon-16x16.png?<?php echo rawurlencode($VERSION); ?>" sizes="16x16" />
  59. <link rel="manifest" href="manifest.json?<?php echo rawurlencode($VERSION); ?>" />
  60. <link rel="mask-icon" href="img/safari-pinned-tab.svg?<?php echo rawurlencode($VERSION); ?>" color="#ffcc00" />
  61. <link rel="shortcut icon" href="img/favicon.ico">
  62. <meta name="msapplication-config" content="browserconfig.xml">
  63. <meta name="theme-color" content="#ffe57e" />
  64. </head>
  65. <body>
  66. <header>
  67. <div id="aboutbox">
  68. <?php echo I18n::_('%s is a minimalist, open source online pastebin where the server has zero knowledge of pasted data. Data is encrypted/decrypted <i>in the browser</i> using 256 bits AES. More information on the <a href="https://privatebin.info/">project page</a>.', I18n::_($NAME)); ?><br />
  69. <?php
  70. if (strlen($NOTICE)):
  71. ?>
  72. <span class="blink">▶</span> <?php echo htmlspecialchars($NOTICE);
  73. endif;
  74. ?>
  75. </div>
  76. <h1 class="title reloadlink"><?php echo I18n::_($NAME); ?></h1><br />
  77. <h2 class="title"><?php echo I18n::_('Because ignorance is bliss'); ?></h2><br />
  78. <h3 class="title"><?php echo $VERSION; ?></h3>
  79. <noscript><div id="noscript" class="nonworking"><?php echo I18n::_('JavaScript is required for %s to work.<br />Sorry for the inconvenience.', I18n::_($NAME)); ?></div></noscript>
  80. <div id="oldienotice" class="nonworking"><?php echo I18n::_('%s requires a modern browser to work.', I18n::_($NAME)); ?></div>
  81. <div id="ienotice"><?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'), PHP_EOL; ?>
  82. <a href="https://www.mozilla.org/firefox/">Firefox</a>,
  83. <a href="https://www.opera.com/">Opera</a>,
  84. <a href="https://www.google.com/chrome">Chrome</a>…
  85. </div>
  86. </header>
  87. <section>
  88. <article>
  89. <div id="loadingindicator" class="hidden"><?php echo I18n::_('Loading…'); ?></div>
  90. <div id="status"><?php echo htmlspecialchars($STATUS); ?></div>
  91. <div id="errormessage" class="hidden"><?php echo htmlspecialchars($ERROR); ?></div>
  92. <div id="toolbar">
  93. <button id="newbutton" class="reloadlink hidden"><img src="img/icon_new.png" width="11" height="15" alt="" /><?php echo I18n::_('New'); ?></button>
  94. <button id="sendbutton" class="hidden"><img src="img/icon_send.png" width="18" height="15" alt="" /><?php echo I18n::_('Send'); ?></button>
  95. <?php
  96. if ($EXPIRECLONE):
  97. ?>
  98. <button id="clonebutton" class="hidden"><img src="img/icon_clone.png" width="15" height="17" alt="" /><?php echo I18n::_('Clone'); ?></button>
  99. <?php
  100. endif;
  101. ?>
  102. <button id="rawtextbutton" class="hidden"><img src="img/icon_raw.png" width="15" height="15" alt="" /><?php echo I18n::_('Raw text'); ?></button>
  103. <div id="expiration" class="hidden button"><?php echo I18n::_('Expires'); ?>:
  104. <select id="pasteExpiration" name="pasteExpiration">
  105. <?php
  106. foreach ($EXPIRE as $key => $value):
  107. ?>
  108. <option value="<?php echo $key; ?>"<?php
  109. if ($key == $EXPIREDEFAULT):
  110. ?> selected="selected"<?php
  111. endif;
  112. ?>><?php echo $value; ?></option>
  113. <?php
  114. endforeach;
  115. ?>
  116. </select>
  117. </div>
  118. <div id="remainingtime" class="hidden"></div>
  119. <div id="burnafterreadingoption" class="button hidden">
  120. <input type="checkbox" id="burnafterreading" name="burnafterreading"<?php
  121. if ($BURNAFTERREADINGSELECTED):
  122. ?> checked="checked"<?php
  123. endif;
  124. ?> />
  125. <label for="burnafterreading"><?php echo I18n::_('Burn after reading'); ?></label>
  126. </div>
  127. <?php
  128. if ($DISCUSSION):
  129. ?>
  130. <div id="opendiscussionoption" class="button hidden">
  131. <input type="checkbox" id="opendiscussion" name="opendiscussion"<?php
  132. if ($OPENDISCUSSION):
  133. ?> checked="checked"<?php
  134. endif;
  135. ?> />
  136. <label for="opendiscussion" <?php
  137. if (!$OPENDISCUSSION):
  138. ?> style="color: #BBBBBB;"<?php
  139. endif;
  140. ?>><?php echo I18n::_('Open discussion'); ?></label>
  141. </div>
  142. <?php
  143. endif;
  144. if ($PASSWORD):
  145. ?>
  146. <div id="password" class="hidden">
  147. <input type="password" id="passwordinput" placeholder="<?php echo I18n::_('Password (recommended)'); ?>" size="32" />
  148. </div>
  149. <?php
  150. endif;
  151. ?>
  152. <div id="formatter" class="button hidden"><?php echo I18n::_('Format'); ?>:
  153. <select id="pasteFormatter" name="pasteFormatter">
  154. <?php
  155. foreach ($FORMATTER as $key => $value):
  156. ?>
  157. <option value="<?php echo $key; ?>"<?php
  158. if ($key == $FORMATTERDEFAULT):
  159. ?> selected="selected"<?php
  160. endif;
  161. ?>><?php echo $value; ?></option>
  162. <?php
  163. endforeach;
  164. ?>
  165. </select>
  166. </div>
  167. <?php
  168. if (strlen($LANGUAGESELECTION)):
  169. ?>
  170. <div id="language" class="button">
  171. <select name="lang">
  172. <?php
  173. foreach ($LANGUAGES as $key => $value):
  174. ?>
  175. <option data-lang="<?php echo $key; ?>" value="<?php echo $key; ?>"<?php
  176. if ($key == $LANGUAGESELECTION):
  177. ?> selected="selected"<?php
  178. endif;
  179. ?>><?php echo $value[0]; ?> (<?php echo $value[1]; ?>)</option>
  180. <?php
  181. endforeach;
  182. ?>
  183. </select>
  184. </div>
  185. <?php
  186. endif;
  187. ?>
  188. </div>
  189. <div id="pastesuccess" class="hidden">
  190. <div id="deletelink"></div>
  191. <div id="pastelink">
  192. <?php
  193. if (strlen($URLSHORTENER)):
  194. ?>
  195. <button id="shortenbutton" data-shortener="<?php echo htmlspecialchars($URLSHORTENER); ?>"><img src="img/icon_shorten.png" width="13" height="15" /><?php echo I18n::_('Shorten URL'); ?></button>
  196. <?php
  197. endif;
  198. ?>
  199. </div>
  200. </div>
  201. <?php
  202. if ($FILEUPLOAD):
  203. ?>
  204. <div id="attachment" class="hidden"><a><?php echo I18n::_('Download attachment'); ?></a></div>
  205. <div id="attach" class="hidden">
  206. <span id="clonedfile" class="hidden"><?php echo I18n::_('Cloned file attached.'); ?></span>
  207. <span id="filewrap"><?php echo I18n::_('Attach a file'); ?>: <input type="file" id="file" name="file" /></span>
  208. <button id="fileremovebutton"><?php echo I18n::_('Remove attachment'); ?></button>
  209. </div>
  210. <?php
  211. endif;
  212. ?>
  213. <div id="preview" class="hidden">
  214. <button id="messageedit"><?php echo I18n::_('Editor'); ?></button>
  215. <button id="messagepreview"><?php echo I18n::_('Preview'); ?></button>
  216. </div>
  217. <div id="image" class="hidden"></div>
  218. <div id="prettymessage" class="hidden">
  219. <pre id="prettyprint" class="prettyprint linenums:1"></pre>
  220. </div>
  221. <div id="plaintext" class="hidden"></div>
  222. <textarea id="message" name="message" cols="80" rows="25" class="hidden"></textarea>
  223. </article>
  224. </section>
  225. <section>
  226. <div id="discussion" class="hidden">
  227. <h4 class="title"><?php echo I18n::_('Discussion'); ?></h4>
  228. <div id="commentcontainer"></div>
  229. </div>
  230. </section>
  231. <div id="serverdata" class="hidden" aria-hidden="true">
  232. <div id="cipherdata" class="hidden"><?php echo htmlspecialchars($CIPHERDATA, ENT_NOQUOTES); ?></div>
  233. <?php
  234. if ($DISCUSSION):
  235. ?>
  236. <div id="templates">
  237. <!-- @TODO: when I intend/structure this corrrectly Firefox adds whitespaces everywhere which completly destroy the layout. (same possible when you remove the template data below and show this area in the browser) -->
  238. <article id="commenttemplate" class="comment"><div class="commentmeta"><span class="nickname">name</span><span class="commentdate">0000-00-00</span></div><div class="commentdata">c</div><button class="btn btn-default btn-sm"><?php echo I18n::_('Reply'); ?></button></article>
  239. <div id="commenttailtemplate" class="comment"><button class="btn btn-default btn-sm"><?php echo I18n::_('Add comment'); ?></button></div>
  240. <div id="replytemplate" class="reply hidden"><input type="text" id="nickname" class="form-control" title="<?php echo I18n::_('Optional nickname…'); ?>" placeholder="<?php echo I18n::_('Optional nickname…'); ?>" /><textarea id="replymessage" class="replymessage form-control" cols="80" rows="7"></textarea><br /><div id="replystatus" role="alert" class="statusmessage hidden alert"><span class="glyphicon" aria-hidden="true"></span> </div><button id="replybutton" class="btn btn-default btn-sm"><?php echo I18n::_('Post comment'); ?></button></div>
  241. </div>
  242. <?php
  243. endif;
  244. ?>
  245. </div>
  246. <section class="container">
  247. <div id="noscript" role="alert" class="nonworking alert alert-info noscript-hide"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true">
  248. <span> <?php echo I18n::_('Loading…'); ?></span><br>
  249. <span class="small"><?php echo I18n::_('In case this message never disappears please have a look at <a href="https://github.com/PrivateBin/PrivateBin/wiki/FAQ#why-does-not-the-loading-message-go-away">this FAQ for information to troubleshoot</a>.'); ?></span>
  250. </div>
  251. </section>
  252. </body>
  253. </html>