summaryrefslogtreecommitdiffstats
path: root/application/views/file
diff options
context:
space:
mode:
Diffstat (limited to 'application/views/file')
-rw-r--r--application/views/file/client.php19
-rw-r--r--application/views/file/deleted.php14
-rw-r--r--application/views/file/file_info.php30
-rw-r--r--application/views/file/footer.php3
-rw-r--r--application/views/file/header.php28
-rw-r--r--application/views/file/html_footer.php5
-rw-r--r--application/views/file/html_header.php54
-rw-r--r--application/views/file/non_existent.php3
-rw-r--r--application/views/file/show_url.php6
-rw-r--r--application/views/file/too_big.php3
-rw-r--r--application/views/file/upload_error.php6
-rw-r--r--application/views/file/upload_form.php67
-rw-r--r--application/views/file/upload_history.php28
13 files changed, 266 insertions, 0 deletions
diff --git a/application/views/file/client.php b/application/views/file/client.php
new file mode 100644
index 000000000..b507c5f1e
--- /dev/null
+++ b/application/views/file/client.php
@@ -0,0 +1,19 @@
+<p><b>Shell:</b></p>
+<pre>
+curl -n -F "file=@/home/user/foo" <?php echo site_url(); ?> (binary safe)
+cat file | curl -n -F "file=@-;filename=stdin" <?php echo site_url(); ?> (binary safe)
+</pre>
+<p><b>Client:</b></p>
+<p>Development (git): <a href="http://git.server-speed.net/users/flo/fb/">http://git.server-speed.net/users/flo/fb/</a><br />
+<?php if($client_link) {?>Latest release: <a href="<?php echo $client_link; ?>"><?php echo $client_link; ?></a>.<br /><?php }; ?>
+GPG sigs, older versions: <a href="<?php echo $client_link_dir; ?>"><?php echo $client_link_dir; ?></a>
+</p>
+<p>To authenticate add the following to your ~/.netrc:</p>
+<pre>
+machine paste.xinu.at login my_username password my_secret_password
+</pre>
+<p><b>Packages:</b><br />
+Arch Linux: pacman -S fb-client<br />
+Debian: <a href="<?php echo $client_link_deb; ?>"><?php echo $client_link_deb; ?></a><br />
+Slackware: <a href="<?php echo $client_link_slackware; ?>"><?php echo $client_link_slackware; ?></a></p>
+
diff --git a/application/views/file/deleted.php b/application/views/file/deleted.php
new file mode 100644
index 000000000..ef02398d9
--- /dev/null
+++ b/application/views/file/deleted.php
@@ -0,0 +1,14 @@
+<div class="center">
+ <?php if (!empty($errors)) {
+ echo "<p>";
+ echo implode("<br />\n", $errors);
+ echo "</p>";
+ } ?>
+ <?php if (!empty($msgs)) {
+ echo "<p>";
+ echo implode("<br />\n", $msgs);
+ echo "</p>";
+ } ?>
+
+ <p><?php echo $deleted_count; ?> of <?php echo $total_count; ?> deleted.</p>
+</div>
diff --git a/application/views/file/file_info.php b/application/views/file/file_info.php
new file mode 100644
index 000000000..779ece854
--- /dev/null
+++ b/application/views/file/file_info.php
@@ -0,0 +1,30 @@
+<div class="center">
+ <?php if($filedata): ?>
+ <table style="margin: auto">
+ <tr>
+ <td class="title">ID</td>
+ <td class="text"><a href="<?php echo site_url($id); ?>/"><?php echo $id; ?></a></td>
+ </tr>
+ <tr>
+ <td class="title">Filename</td>
+ <td class="text"><?php echo $filedata["filename"]; ?></td>
+ </tr>
+ <tr>
+ <td class="title">Date of upload</td>
+ <td class="text"><?php echo date("r", $filedata["date"]); ?></td>
+ </tr>
+ <tr>
+ <td class="title">Date of removal</td>
+ <td class="text"><?php echo $timeout; ?></td>
+ </tr>
+ <tr>
+ <td class="title">Size</td>
+ <td class="text"><?php echo format_bytes($filedata["filesize"]); ?></td>
+ </tr>
+ <tr>
+ <td class="title">Mimetype</td>
+ <td class="text"><?php echo $filedata["mimetype"]; ?></td>
+ </tr>
+ </table>
+ <?php endif; ?>
+</div>
diff --git a/application/views/file/footer.php b/application/views/file/footer.php
new file mode 100644
index 000000000..eda863585
--- /dev/null
+++ b/application/views/file/footer.php
@@ -0,0 +1,3 @@
+ </div>
+</body>
+</html>
diff --git a/application/views/file/header.php b/application/views/file/header.php
new file mode 100644
index 000000000..3029e4579
--- /dev/null
+++ b/application/views/file/header.php
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+ <title><?php echo isset($title) ? $title : ''; ?></title>
+ <link rel="stylesheet" type="text/css" href="<?php echo link_with_mtime("/data/default.css"); ?>" media="screen" />
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <meta name="robots" content="noindex,nofollow" />
+</head>
+
+<body>
+ <div class="top">
+ <?php echo anchor('file/index', 'New'); ?> |
+ <?php echo anchor('file/upload_history', 'History'); ?> |
+ <?php echo anchor('user/invite', 'Invite'); ?>
+
+ <?php if(!isset($is_error_page)) { ?>
+ <div class="right">
+ <?php if(isset($username) && $username) { ?>
+ <?=anchor("user/logout", "Logout"); ?>
+ <?php } else { ?>
+ <?=anchor("user/login", "Login"); ?>
+ <?php } ?>
+ </div>
+ <?php } ?>
+ </div>
+
+ <div class="content">
diff --git a/application/views/file/html_footer.php b/application/views/file/html_footer.php
new file mode 100644
index 000000000..ddc460a39
--- /dev/null
+++ b/application/views/file/html_footer.php
@@ -0,0 +1,5 @@
+ </td>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/application/views/file/html_header.php b/application/views/file/html_header.php
new file mode 100644
index 000000000..cd2116ada
--- /dev/null
+++ b/application/views/file/html_header.php
@@ -0,0 +1,54 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title><?php echo $title; ?></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link rel="stylesheet" type="text/css" href="<?php echo link_with_mtime("/data/paste.css"); ?>" />
+<?php if (file_exists(FCPATH."/data/paste-$current_highlight.css")) {?>
+ <link rel="stylesheet" type="text/css" href="<?php echo link_with_mtime("/data/paste-$current_highlight.css"); ?>" />
+<?php } ?>
+ </head>
+ <body>
+ <div class="top_bar">
+ <a class="raw_link no" href="<?php echo site_url(); ?>">New</a> |
+ <a class="raw_link no" href="<?php echo site_url($id); ?>">Raw</a> |
+ <a class="raw_link no" href="<?php echo site_url($id."/plain"); ?>">Plain</a> |
+ <a class="raw_link no" href="<?php echo site_url($id."/info"); ?>">Info</a> |
+ Currently: <?php echo $current_highlight; ?> |
+ Timeout: <?php echo $timeout; ?>
+ <div style="float:right;">
+ <a class="raw_link no" href="<?php echo site_url($id)."/"; ?>">Code</a> |
+ <a class="raw_link no" href="<?php echo site_url($id."/rmd"); ?>">Render Markdown</a>
+ </div>
+ </div>
+<script type="text/javascript">
+/* <![CDATA[ */
+function update_anchor_highlight() {
+ var anchor = window.location.hash.substr(1);
+ var element = document.getElementById("highlight_line");
+ if (element) {
+ element.parentNode.removeChild(element);
+ }
+
+ anchor = document.getElementById(anchor);
+ if (!anchor) {
+ return;
+ }
+ var newElement = document.createElement("div");
+ newElement.setAttribute("id", "highlight_line");
+ newElement.textContent=" ";
+ anchor.parentNode.insertBefore(newElement, anchor.nextSibling);
+}
+
+if ("onhashchange" in window) {
+ window.onload = function () {
+ update_anchor_highlight();
+ }
+ window.onhashchange = function () {
+ update_anchor_highlight();
+ }
+}
+/* ]]> */
+</script>
+ <table class="content">
+ <tr>
diff --git a/application/views/file/non_existent.php b/application/views/file/non_existent.php
new file mode 100644
index 000000000..13d8c6950
--- /dev/null
+++ b/application/views/file/non_existent.php
@@ -0,0 +1,3 @@
+<div class="center">
+ <p>I'm sorry, but the requested file doesn't exist.</p>
+</div>
diff --git a/application/views/file/show_url.php b/application/views/file/show_url.php
new file mode 100644
index 000000000..3c08ed952
--- /dev/null
+++ b/application/views/file/show_url.php
@@ -0,0 +1,6 @@
+<div class="center">
+ <p>
+ You can get your file here:<br />
+ <a href="<?php echo $url; ?>"><?php echo $url; ?></a><br />
+ </p>
+</div>
diff --git a/application/views/file/too_big.php b/application/views/file/too_big.php
new file mode 100644
index 000000000..5b970a4c8
--- /dev/null
+++ b/application/views/file/too_big.php
@@ -0,0 +1,3 @@
+<div class="center">
+ <p>Sorry, the file you uploaded is too big.</p>
+</div>
diff --git a/application/views/file/upload_error.php b/application/views/file/upload_error.php
new file mode 100644
index 000000000..83968eec2
--- /dev/null
+++ b/application/views/file/upload_error.php
@@ -0,0 +1,6 @@
+<div class="center">
+ <p>
+ An error occurred while uploading.<br />
+ <?php echo $msg; ?>
+ </p>
+</div>
diff --git a/application/views/file/upload_form.php b/application/views/file/upload_form.php
new file mode 100644
index 000000000..20fb1a3d8
--- /dev/null
+++ b/application/views/file/upload_form.php
@@ -0,0 +1,67 @@
+<? if ($username) { ?>
+<div class="center">
+ <?php echo form_open_multipart('file/do_upload'); ?>
+ <p>
+ File: <input type="file" id="file" name="file" size="30" />
+ <input type="submit" value="Upload" id="upload_button" name="process" />
+ </p>
+ </form>
+ <p><b>OR</b></p>
+ <?php echo form_open_multipart('file/do_paste'); ?>
+ <p>
+ <textarea id="textarea" name="content" cols="80" rows="20"></textarea><br />
+ <input type="submit" value="Paste" name="process" />
+ </p>
+ </form>
+ <script type="text/javascript">
+ /* <![CDATA[ */
+ var max_upload_size = "<?php echo $max_upload_size; ?>";
+ /* ]]> */
+ </script>
+ <script type="text/javascript" src="<?php echo link_with_mtime("/data/js/upload_form.js"); ?>"></script>
+</div>
+<? } else { ?>
+You have to <?=anchor("user/login", "log in"); ?> to be able to upload/paste.
+<div id="login-form">
+ <?=form_open("user/login"); ?>
+ <input type="text" name="username" />
+ <input type="password" name="password" />
+ <input type="submit" value="Login" name="process" />
+ </form>
+</div>
+<? } ?>
+<br />
+<p>Uploads/pastes are deleted after <?php echo $upload_max_age; ?> days<?php if($small_upload_size > 0): ?>
+ unless they are smaller than <?php echo format_bytes($small_upload_size); ?>
+ <?php endif; ?>. Maximum upload size is <?php echo format_bytes($max_upload_size); ?></p>
+<h2>Features</h2>
+<p>For shell uploading/pasting and download information for the client go to <a href="<?php echo site_url("file/client"); ?>"><?php echo site_url("file/client"); ?></a></p>
+<p>You can use the <?php echo anchor("file/upload_history", "history"); ?> to find old uploads.</p>
+<p>How to link your pastes:</p>
+<ul>
+ <li><span class="example">/&lt;ID&gt;/</span> automatically highlight the paste</li>
+ <li><span class="example">/&lt;ID&gt;</span> set the detected MIME type and let the browser do the rest</li>
+ <li><span class="example">/&lt;ID&gt;/plain</span> force the MIME type to be text/plain</li>
+ <li><span class="example">/&lt;ID&gt;/&lt;file extension&gt;</span> override auto detection and use the supplied file extension or language name for highlighting</li>
+ <li><span class="example">/&lt;ID&gt;/qr</span> display a qr code containing a link to <span class="example">/&lt;ID&gt;/</span></li>
+ <li><span class="example">/&lt;ID&gt;/rmd</span> convert markdown to HTML</li>
+ <li><span class="example">/&lt;ID&gt;/ascii</span> convert text with ANSI (shell) escape codes to HTML</li>
+ <li><span class="example">/&lt;ID&gt;/info</span> display some information about the ID</li>
+</ul>
+<p>If your upload is not detected as text, only
+<span class="example">/&lt;ID&gt;/qr</span>,
+<span class="example">/&lt;ID&gt;/plain</span> and
+<span class="example">/&lt;ID&gt;/info</span>
+will work as above and all others will simply return the file with the detected MIME type.</p>
+
+<h2>Information</h2>
+<p>This website's primary goal is aiding developers, power users, students and alike in solving problems, debugging software, sharing their configuration, etc. It is not intended to distribute confidential or harmful information, scripts or software.</p>
+
+<p>If you believe you deserve an account, ask someone who is already using this service to <?=anchor("user/invite", "invite"); ?> you.</p>
+
+<?php if($contact_me_url) {?><p>If you experience any problems feel free to <a href="<?php echo $contact_me_url; ?>">contact me</a>.</p>
+<br /><?php }; ?>
+<div class="small">
+ <p>Icons by <a href="http://p.yusukekamiyamane.com/">Yusuke Kamiyamane</a></p>
+ <p>This service is provided without warranty of any kind and may not be used to distribute copyrighted content.</p>
+</div>
diff --git a/application/views/file/upload_history.php b/application/views/file/upload_history.php
new file mode 100644
index 000000000..41b055792
--- /dev/null
+++ b/application/views/file/upload_history.php
@@ -0,0 +1,28 @@
+<?php echo form_open("file/do_delete"); ?>
+ <table class="results">
+ <tr>
+ <th></th>
+ <th>ID</th>
+ <th>Filename</th>
+ <th>Mimetype
+ <th>Date</th>
+ <th>Hash</th>
+ <th>Size</th>
+ </tr>
+
+ <?php foreach($query as $key => $item): ?>
+ <tr class="<?php echo even_odd(); ?>">
+ <td><input type="checkbox" name="ids[<?php echo $item["id"]; ?>]" value="<?php echo $item["id"]; ?>" /></td>
+ <td><a href="<?php echo site_url("/".$item["id"]); ?>/"><?php echo $item["id"]; ?></a></td>
+ <td><?php echo htmlspecialchars($item["filename"]); ?></td>
+ <td><?php echo $item["mimetype"]; ?></td>
+ <td><?php echo $item["date"]; ?></td>
+ <td><?php echo $item["hash"]; ?></td>
+ <td><?php echo $item["filesize"]; ?></td>
+ </tr>
+ <?php endforeach; ?>
+ </table>
+ <input type="submit" value="Delete checked" name="process" />
+</form>
+
+<p>Total sum of your distinct uploads: <?php echo $total_size; ?>.</p>