summaryrefslogtreecommitdiffstats
path: root/application/views
diff options
context:
space:
mode:
Diffstat (limited to 'application/views')
-rw-r--r--application/views/file/client.php8
-rw-r--r--application/views/file/upload_form.php2
-rw-r--r--application/views/header.php4
-rw-r--r--application/views/user/apikeys.php36
-rw-r--r--application/views/user/nav.php1
5 files changed, 48 insertions, 3 deletions
diff --git a/application/views/file/client.php b/application/views/file/client.php
index 19e6a01fb..5e141f141 100644
--- a/application/views/file/client.php
+++ b/application/views/file/client.php
@@ -13,6 +13,14 @@ machine <?php echo $domain; ?> login my_username password my_secret_password
</pre>
<p>
+ If you are using fb-client &ge;1.2 you can
+ <a href="<?php echo site_url("user/apikeys"); ?>">create an API key</a>,
+ save it in <code>~/.config/fb-client/apikey</code> and remove
+ your password from <code>.netrc</code>. Please refer to <code>man
+ 1 fb</code> for further details.
+</p>
+
+<p>
If you are using fb-client &ge;1.1 you can use
<code>~/.config/fb-client/config</code> to upload to a different
pastebin URL (https or you own installation). Please refer to
diff --git a/application/views/file/upload_form.php b/application/views/file/upload_form.php
index 99c1d9e42..841ac3746 100644
--- a/application/views/file/upload_form.php
+++ b/application/views/file/upload_form.php
@@ -1,4 +1,4 @@
-<?php if (isset($username) && $username) { ?>
+<?php if (user_logged_in()) { ?>
<div class="well">
<div class="row-fluid">
<div class="span12 text-upload-form">
diff --git a/application/views/header.php b/application/views/header.php
index e85463735..ba6d6ae9d 100644
--- a/application/views/header.php
+++ b/application/views/header.php
@@ -45,7 +45,7 @@ if (is_cli_client() && !isset($force_full_html)) {
</a>
<?php if(!isset($GLOBALS["is_error_page"])) { ?>
<ul class="nav pull-right">
- <?php if(isset($username) && $username) { ?>
+ <?php if(user_logged_in()) { ?>
<li><a href="<?php echo site_url("/user/logout"); ?>">Logout</a></li>
<?php } else { ?>
<li class="dropdown">
@@ -65,7 +65,7 @@ if (is_cli_client() && !isset($force_full_html)) {
</ul>
<?php }; ?>
<ul class="nav">
- <?php if(isset($username) && $username) { ?>
+ <?php if(user_logged_in()) { ?>
<li><a href="<?php echo site_url("file/index") ?>"><i class="icon-pencil icon-white"></i> New</a></li>
<li><a href="<?php echo site_url("file/upload_history") ?>"><i class="icon-book icon-white"></i> History</a></li>
<li class="dropdown">
diff --git a/application/views/user/apikeys.php b/application/views/user/apikeys.php
new file mode 100644
index 000000000..14d829ffa
--- /dev/null
+++ b/application/views/user/apikeys.php
@@ -0,0 +1,36 @@
+<h2>API keys</h2>
+<table class="table table-striped">
+ <thead>
+ <tr>
+ <th>#</th>
+ <th>Key</th>
+ <th style="width: 30%;">Comment</th>
+ <th>Created on</th>
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php $i = 1; ?>
+ <?php foreach($query as $key => $item): ?>
+ <tr>
+ <td><?php echo $i++; ?></td>
+ <td><?php echo $item["key"]; ?></td>
+ <td><?php echo $item["comment"]; ?></td>
+ <td><?php echo date("Y/m/d H:i", $item["created"]); ?></td>
+ <td>
+ <?php echo form_open("user/delete_apikey", array("style" => "margin-bottom: 0")); ?>
+ <?php echo form_hidden("key", $item["key"]); ?>
+ <button class="btn btn-danger btn-mini" type="submit">Delete</input>
+ </form>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+</table>
+
+<p>
+ <?php echo form_open('user/create_apikey', array("class" => "form-horizontal")); ?>
+ <input type="text" name="comment" placeholder="Comment" />
+ <input class="btn btn-primary" type="submit" value="Create a new key" name="process" />
+ </form>
+</p>
diff --git a/application/views/user/nav.php b/application/views/user/nav.php
index 26898fde8..90f76e05e 100644
--- a/application/views/user/nav.php
+++ b/application/views/user/nav.php
@@ -3,6 +3,7 @@
<?php } ?>
<li><a href="<?php echo site_url("user/profile") ?>"><i class="icon-user icon-black"></i> Profile</a></li>
+<li><a href="<?php echo site_url("user/apikeys") ?>"><i class="icon-tags icon-black"></i> API keys</a></li>
<?php if(auth_driver_function_implemented("can_reset_password")) { ?>
<li><a href="<?php echo site_url("user/reset_password") ?>"><i class="icon-lock icon-black"></i> Change password</a></li>