aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2012-09-19 19:00:35 +0200
committerChristian Weiske <cweiske@cweiske.de>2012-09-19 19:00:35 +0200
commit1797cbc2b010552b54e9d070820fa9cbc9ce3af9 (patch)
treef4ac239f23e5cdccd75e4ec514abedbd582f4333 /data
parent63575a005e8e2386abb24e97791e18d61e6350fe (diff)
parent149e039741f94f9e22bd2c8d7dcf33158a110e79 (diff)
downloadphorkie-1797cbc2b010552b54e9d070820fa9cbc9ce3af9.tar.gz
phorkie-1797cbc2b010552b54e9d070820fa9cbc9ce3af9.zip
Merge branch 'master' into remotefork
Diffstat (limited to 'data')
-rw-r--r--data/config.default.php14
-rw-r--r--data/config.php.dist7
-rw-r--r--data/templates/base.htm26
-rw-r--r--data/templates/display-sidebar-history.htm2
-rw-r--r--data/templates/exception.htm2
-rw-r--r--data/templates/forbidden.htm24
-rw-r--r--data/templates/login.htm27
-rw-r--r--data/templates/pager.htm2
-rw-r--r--data/templates/revision-head.htm2
-rw-r--r--data/templates/user.htm16
10 files changed, 111 insertions, 11 deletions
diff --git a/data/config.default.php b/data/config.default.php
index 88c9ae5..abcb43e 100644
--- a/data/config.default.php
+++ b/data/config.default.php
@@ -12,6 +12,15 @@ $GLOBALS['phorkie']['cfg'] = array(
'geshi' => 'MediaWiki/geshi/geshi/geshi.php',
'index' => 'new'//"new" or "list"
);
+$GLOBALS['phorkie']['auth'] = array(
+ // 0 = public, no authentication, 1 = protect adds/edits/deletes,
+ // 2 = require authentication
+ 'securityLevel' => 0,
+ 'listedUsersOnly' => false,
+ 'users' => array(), // Array of OpenIDs that may login
+ 'anonymousName' => 'Anonymous', // Email for non-authenticated commits
+ 'anonymousEmail' => 'anonymous@phorkie', // Email for non-authenticated commits
+);
$GLOBALS['phorkie']['tools'] = array(
'\\phorkie\\Tool_Xmllint' => true,
'\\phorkie\\Tool_PHPlint' => true,
@@ -57,6 +66,11 @@ $GLOBALS['phorkie']['languages'] = array(
'mime' => 'application/javascript',
'geshi' => 'javascript'
),
+ 'md' => array(
+ 'title' => 'Markdown',
+ 'mime' => 'text/x-markdown',
+ 'renderer' => '\\phorkie\\Renderer_Markdown'
+ ),
'pl' => array(
'title' => 'Perl',
'mime' => 'application/x-perl',
diff --git a/data/config.php.dist b/data/config.php.dist
index 1e814bd..ced993f 100644
--- a/data/config.php.dist
+++ b/data/config.php.dist
@@ -5,4 +5,11 @@
//$GLOBALS['phorkie']['cfg']['git']['private'] = 'ssh://git@bogo:paste/';
//$GLOBALS['phorkie']['cfg']['elasticsearch'] = 'http://localhost:9200/phorkie/';
//$GLOBALS['phorkie']['cfg']['setupcheck'] = false;
+
+//$GLOBALS['phorkie']['auth']['securityLevel'] = 0;
+//$GLOBALS['phorkie']['auth']['listedUsersOnly'] = false;
+//$GLOBALS['phorkie']['auth']['users'] = array(
+// 'https://www.google.com/accounts/o8/id?id=ABCDEFGHIJKLMNOPQRSTUVWXYZ',
+// 'http://anonymous.phorkie.openid'
+//);
?>
diff --git a/data/templates/base.htm b/data/templates/base.htm
index b9c9608..dc06566 100644
--- a/data/templates/base.htm
+++ b/data/templates/base.htm
@@ -4,10 +4,10 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="{{css}}"/>
- <link rel="stylesheet" href="/phorkie.css" />
+ <link rel="stylesheet" href="/css/phorkie.css" />
<title>{% block title %}{% endblock %} - {{title}}</title>
- <script src="/jquery-1.7.2.min.js"></script>
- <script src="/phorkie.js"></script>
+ <script src="/js/jquery-1.7.2.min.js"></script>
+ <script src="/js/phorkie.js"></script>
{% block meta %}{% endblock %}
</head>
<body>
@@ -27,12 +27,26 @@
</li>
{% if db.adapter %}
<li>
- <form class="navbar-search pull-left" action="/search" method="get">
+ <form class="navbar-search" action="/search" method="get">
<input type="text" class="search-query" name="q" placeholder="Search" value="{{query}}"/>
</form>
</li>
{% endif %}
</ul>
+ <ul class="nav pull-right">
+ {% if identity %}
+ <li>
+ <a href="/user">{{name}} ({{email}})</a>
+ </li>
+ <li>
+ <a href="/login?logout">Logout</a>
+ </li>
+ {% else %}
+ <li>
+ <a href="/login">Login</a>
+ </li>
+ {% endif %}
+ </ul>
</div>
</div>
</div>
@@ -53,8 +67,8 @@
<a href="//sf.net/p/phorkie/">phorkie</a>,
the self-hosted, git-based pastebin software is available under the
<a href="https://sf.net/p/phorkie/">
- <acronym title="GNU Affero General Public License">AGPL</acronym></a>.
+ <abbr title="GNU Affero General Public License">AGPL</abbr></a>.
</div>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/data/templates/display-sidebar-history.htm b/data/templates/display-sidebar-history.htm
index b3ef9df..bf38884 100644
--- a/data/templates/display-sidebar-history.htm
+++ b/data/templates/display-sidebar-history.htm
@@ -15,4 +15,4 @@
{% else %}
<p>No commits yet</p>
{% endfor %}
-</ul> \ No newline at end of file
+</ul>
diff --git a/data/templates/exception.htm b/data/templates/exception.htm
index dc07fc5..7a96da0 100644
--- a/data/templates/exception.htm
+++ b/data/templates/exception.htm
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
- <link rel="stylesheet" href="phorkie.css" />
+ <link rel="stylesheet" href="/css/phorkie.css" />
<title>Error - phorkie</title>
</head>
<body>
diff --git a/data/templates/forbidden.htm b/data/templates/forbidden.htm
new file mode 100644
index 0000000..a39bcf7
--- /dev/null
+++ b/data/templates/forbidden.htm
@@ -0,0 +1,24 @@
+{% extends "base.htm" %}
+{% block title %}Access Denied{% endblock %}
+
+{% block content %}
+
+<h2>Access Denied</h2>
+{% if identity %}
+<p>
+ You are logged in with the following OpenID:
+</p>
+<p>
+ <code>{{identity}}</code>
+</p>
+<p>
+ Unfortunately, your OpenID is not unlocked.
+ Contact the site administrator to get access.
+</p>
+{% else %}
+<p>
+ We're sorry; but you have to <a href="/login">log in</a> to access this page.
+</p>
+{% endif %}
+{% endblock %}
+
diff --git a/data/templates/login.htm b/data/templates/login.htm
new file mode 100644
index 0000000..084b438
--- /dev/null
+++ b/data/templates/login.htm
@@ -0,0 +1,27 @@
+{% extends "base.htm" %}
+{% block title %}Login{% endblock %}
+
+{% block content %}
+
+<link rel="stylesheet" href="css/openid.css" />
+
+<form method="post" action="/login" id="openid_form">
+
+<fieldset>
+ <legend>Sign-in</legend>
+ <div id="openid_choice" style="display: block; ">
+ <p>Please choose your account provider</p>
+ <div id="openid_btns">
+ <a title="Google" href="/login?openid_url=https://www.google.com/accounts/o8/id" class="google openid_large_btn"></a>
+ <a title="Yahoo" href="/login?openid_url=http://yahoo.com/" class="yahoo openid_large_btn"></a>
+ </div>
+ <div id="openid_input_area">
+ <p>or enter your OpenID URL.</p>
+ <input id="openid_url" type="text" name="openid_url" value="http://" />
+ <input class="btn" id="openid_submit" type="submit" value="Sign in" />
+ </div>
+ </div>
+</fieldset>
+
+</form>
+{% endblock %}
diff --git a/data/templates/pager.htm b/data/templates/pager.htm
index 085a281..9be2b9f 100644
--- a/data/templates/pager.htm
+++ b/data/templates/pager.htm
@@ -45,4 +45,4 @@
{% endif %}
</ul>
</div>
-{% endif %} \ No newline at end of file
+{% endif %}
diff --git a/data/templates/revision-head.htm b/data/templates/revision-head.htm
index 132a68f..9a60b05 100644
--- a/data/templates/revision-head.htm
+++ b/data/templates/revision-head.htm
@@ -9,8 +9,6 @@
<p>
revision <strong>{{repo.hash}}</strong>
</p>
- <p>
- </p>
</div>
<div class="span2">
</div>
diff --git a/data/templates/user.htm b/data/templates/user.htm
new file mode 100644
index 0000000..eb032bd
--- /dev/null
+++ b/data/templates/user.htm
@@ -0,0 +1,16 @@
+{% extends "base.htm" %}
+{% block title %}User Preferences{% endblock %}
+
+{% block content %}
+
+<form method="post" action="/user" id="user_form">
+<fieldset>
+ <legend>User Profile</legend>
+ <p>Please update your git preferences.</p>
+ <p><label>OpenID:</label><code>{{ identity }}</code></p>
+ <label for='name'>Name:</label><input class="" id="name" type="text" name="name" width="35" value="{{ name }}"><br/>
+ <label for='email'>Email:</label><input class="" id="email" type="text" name="email" width="35" value="{{ email }}"><br/>
+ <input class="btn" id="submit" type="submit" value="Update">
+</fieldset>
+</form>
+{% endblock %}