page.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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.4.js" integrity="sha512-BqVQ8GgWfMCcdsDuP6Ggm1BV7+mmoWH3PC4UqcYpEKSdEq1rthy6NUsa6gu5sydewbi/ilI3E3ohdCxlPPF9ww==" crossorigin="anonymous"></script>
  25. <?php
  26. if ($ZEROBINCOMPATIBILITY):
  27. ?>
  28. <script type="text/javascript" src="js/base64-1.7.js" integrity="sha512-JdwsSP3GyHR+jaCkns9CL9NTt4JUJqm/BsODGmYhBcj5EAPKcHYh+OiMfyHbcDLECe17TL0hjXADFkusAqiYgA==" crossorigin="anonymous"></script>
  29. <?php
  30. else:
  31. ?>
  32. <script type="text/javascript" src="js/base64-2.1.9.js" integrity="sha512-rbqAby7hObftbEoGQzkhUbEh5YkUn2MtekTLs4btvo2oly4CZ3DxhJzEh0u/rNzS54tcJdqi5Ug1ruugEd2U1g==" crossorigin="anonymous"></script>
  33. <?php
  34. endif;
  35. ?>
  36. <script type="text/javascript" src="js/rawdeflate-0.5.js" integrity="sha512-tTdZ7qMr7tt5VQy4iCHu6/aGB12eRwbUy+AEI5rXntfsjcRfBeeqJloMsBU9FrGk1bIYLiuND/FhU42LO1bi0g==" crossorigin="anonymous"></script>
  37. <script type="text/javascript" src="js/rawinflate-0.3.js" integrity="sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==" crossorigin="anonymous"></script>
  38. <?php
  39. if ($SYNTAXHIGHLIGHTING):
  40. ?>
  41. <script type="text/javascript" src="js/prettify.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-m8iHxoN+Fe12xxFwWNdY/TS4KoFntHp29qY0xUzBnPd0bkKMOR/dFhEdTWydpt0b/fIXyhB+znGYUvgjfJ2RzQ==" crossorigin="anonymous"></script>
  42. <?php
  43. endif;
  44. if ($MARKDOWN):
  45. ?>
  46. <script type="text/javascript" src="js/showdown-1.4.1.js" integrity="sha512-Kbz1FIlDnqUJu/3yW8H8USzURA3JuUqSKRwz13lM4kWt6C0n6s4tjl81PCfnWtE4gBIzyj5uGePcfUyotk/icw==" crossorigin="anonymous"></script>
  47. <?php
  48. endif;
  49. ?>
  50. <script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-eiKDhuH9ab6eBlJbn0nggiYIvCJd82nnzfmr94+NMaSqImQe3V61FKaOwfiBg6AHQCn0GE9OX4xLN5ATfJPGkg==" crossorigin="anonymous"></script>
  51. <!--[if lt IE 10]>
  52. <style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
  53. <![endif]-->
  54. <link rel="apple-touch-icon" href="img/apple-touch-icon.png?<?php echo rawurlencode($VERSION); ?>" sizes="180x180" />
  55. <link rel="icon" type="image/png" href="img/favicon-32x32.png?<?php echo rawurlencode($VERSION); ?>" sizes="32x32" />
  56. <link rel="icon" type="image/png" href="img/favicon-16x16.png?<?php echo rawurlencode($VERSION); ?>" sizes="16x16" />
  57. <link rel="manifest" href="manifest.json?<?php echo rawurlencode($VERSION); ?>" />
  58. <link rel="mask-icon" href="img/safari-pinned-tab.svg?<?php echo rawurlencode($VERSION); ?>" color="#ffcc00" />
  59. <link rel="shortcut icon" href="img/favicon.ico">
  60. <meta name="msapplication-config" content="browserconfig.xml">
  61. <meta name="theme-color" content="#ffe57e" />
  62. </head>
  63. <body>
  64. <header>
  65. <div id="aboutbox">
  66. <?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 />
  67. <?php
  68. if (strlen($NOTICE)):
  69. ?>
  70. <span class="blink">▶</span> <?php echo htmlspecialchars($NOTICE);
  71. endif;
  72. ?>
  73. </div>
  74. <h1 class="title reloadlink"><?php echo I18n::_($NAME); ?></h1><br />
  75. <h2 class="title"><?php echo I18n::_('Because ignorance is bliss'); ?></h2><br />
  76. <h3 class="title"><?php echo $VERSION; ?></h3>
  77. <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>
  78. <div id="oldienotice" class="nonworking"><?php echo I18n::_('%s requires a modern browser to work.', I18n::_($NAME)); ?></div>
  79. <div id="ienotice"><?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'), PHP_EOL; ?>
  80. <a href="https://www.mozilla.org/firefox/">Firefox</a>,
  81. <a href="https://www.opera.com/">Opera</a>,
  82. <a href="https://www.google.com/chrome">Chrome</a>,
  83. <a href="https://www.apple.com/safari">Safari</a>...
  84. </div>
  85. </header>
  86. <section>
  87. <article>
  88. <div id="status"><?php echo htmlspecialchars($STATUS); ?></div>
  89. <div id="errormessage" class="hidden"><?php echo htmlspecialchars($ERROR); ?></div>
  90. <div id="toolbar">
  91. <button id="newbutton" class="reloadlink hidden"><img src="img/icon_new.png" width="11" height="15" alt="" /><?php echo I18n::_('New'); ?></button>
  92. <button id="sendbutton" class="hidden"><img src="img/icon_send.png" width="18" height="15" alt="" /><?php echo I18n::_('Send'); ?></button>
  93. <?php
  94. if ($EXPIRECLONE):
  95. ?>
  96. <button id="clonebutton" class="hidden"><img src="img/icon_clone.png" width="15" height="17" alt="" /><?php echo I18n::_('Clone'); ?></button>
  97. <?php
  98. endif;
  99. ?>
  100. <button id="rawtextbutton" class="hidden"><img src="img/icon_raw.png" width="15" height="15" alt="" /><?php echo I18n::_('Raw text'); ?></button>
  101. <div id="expiration" class="hidden button"><?php echo I18n::_('Expires'); ?>:
  102. <select id="pasteExpiration" name="pasteExpiration">
  103. <?php
  104. foreach ($EXPIRE as $key => $value):
  105. ?>
  106. <option value="<?php echo $key; ?>"<?php
  107. if ($key == $EXPIREDEFAULT):
  108. ?> selected="selected"<?php
  109. endif;
  110. ?>><?php echo $value; ?></option>
  111. <?php
  112. endforeach;
  113. ?>
  114. </select>
  115. </div>
  116. <div id="remainingtime" class="hidden"></div>
  117. <div id="burnafterreadingoption" class="button hidden">
  118. <input type="checkbox" id="burnafterreading" name="burnafterreading"<?php
  119. if ($BURNAFTERREADINGSELECTED):
  120. ?> checked="checked"<?php
  121. endif;
  122. ?> />
  123. <label for="burnafterreading"><?php echo I18n::_('Burn after reading'); ?></label>
  124. </div>
  125. <?php
  126. if ($DISCUSSION):
  127. ?>
  128. <div id="opendisc" class="button hidden">
  129. <input type="checkbox" id="opendiscussion" name="opendiscussion"<?php
  130. if ($OPENDISCUSSION):
  131. ?> checked="checked"<?php
  132. endif;
  133. ?> />
  134. <label for="opendiscussion" <?php
  135. if (!$OPENDISCUSSION):
  136. ?> style="color: #BBBBBB;"<?php
  137. endif;
  138. ?>><?php echo I18n::_('Open discussion'); ?></label>
  139. </div>
  140. <?php
  141. endif;
  142. if ($PASSWORD):
  143. ?>
  144. <div id="password" class="hidden">
  145. <input type="password" id="passwordinput" placeholder="<?php echo I18n::_('Password (recommended)'); ?>" size="32" />
  146. </div>
  147. <?php
  148. endif;
  149. ?>
  150. <div id="formatter" class="button hidden"><?php echo I18n::_('Format'); ?>:
  151. <select id="pasteFormatter" name="pasteFormatter">
  152. <?php
  153. foreach ($FORMATTER as $key => $value):
  154. ?>
  155. <option value="<?php echo $key; ?>"<?php
  156. if ($key == $FORMATTERDEFAULT):
  157. ?> selected="selected"<?php
  158. endif;
  159. ?>><?php echo $value; ?></option>
  160. <?php
  161. endforeach;
  162. ?>
  163. </select>
  164. </div>
  165. <?php
  166. if (strlen($LANGUAGESELECTION)):
  167. ?>
  168. <div id="language" class="button">
  169. <select name="lang">
  170. <?php
  171. foreach ($LANGUAGES as $key => $value):
  172. ?>
  173. <option data-lang="<?php echo $key; ?>" value="<?php echo $key; ?>"<?php
  174. if ($key == $LANGUAGESELECTION):
  175. ?> selected="selected"<?php
  176. endif;
  177. ?>><?php echo $value[0]; ?> (<?php echo $value[1]; ?>)</option>
  178. <?php
  179. endforeach;
  180. ?>
  181. </select>
  182. </div>
  183. <?php
  184. endif;
  185. ?>
  186. </div>
  187. <div id="pasteresult" class="hidden">
  188. <div id="deletelink"></div>
  189. <div id="pastelink">
  190. <?php
  191. if (strlen($URLSHORTENER)):
  192. ?>
  193. <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>
  194. <?php
  195. endif;
  196. ?>
  197. </div>
  198. </div>
  199. <?php
  200. if ($FILEUPLOAD):
  201. ?>
  202. <div id="attachment" class="hidden"><a><?php echo I18n::_('Download attachment'); ?></a></div>
  203. <div id="attach" class="hidden">
  204. <span id="clonedfile" class="hidden"><?php echo I18n::_('Cloned file attached.'); ?></span>
  205. <span id="filewrap"><?php echo I18n::_('Attach a file'); ?>: <input type="file" id="file" name="file" /></span>
  206. <button id="fileremovebutton"><?php echo I18n::_('Remove attachment'); ?></button>
  207. </div>
  208. <?php
  209. endif;
  210. ?>
  211. <div id="preview" class="hidden">
  212. <button id="messageedit"><?php echo I18n::_('Editor'); ?></button>
  213. <button id="messagepreview"><?php echo I18n::_('Preview'); ?></button>
  214. </div>
  215. <div id="image" class="hidden"></div>
  216. <div id="prettymessage" class="hidden">
  217. <pre id="prettyprint" class="prettyprint linenums:1"></pre>
  218. </div>
  219. <div id="cleartext" class="hidden"></div>
  220. <textarea id="message" name="message" cols="80" rows="25" class="hidden"></textarea>
  221. </article>
  222. </section>
  223. <section>
  224. <div id="discussion" class="hidden">
  225. <h4 class="title"><?php echo I18n::_('Discussion'); ?></h4>
  226. <div id="comments"></div>
  227. </div>
  228. </section>
  229. <div id="cipherdata" class="hidden"><?php echo htmlspecialchars($CIPHERDATA, ENT_NOQUOTES); ?></div>
  230. <section class="container">
  231. <div id="noscript" role="alert" class="nonworking alert alert-info noscript-hide"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true">
  232. <span> <?php echo I18n::_('Loading…'); ?></span><br>
  233. <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>
  234. </div>
  235. </section>
  236. </body>
  237. </html>