mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Further formatting and bug fixes
This commit is contained in:
@@ -15,7 +15,6 @@ table {
|
|||||||
}
|
}
|
||||||
|
|
||||||
table,caption {
|
table,caption {
|
||||||
margin: 0 auto;
|
|
||||||
border-right: 1px solid #CCC;
|
border-right: 1px solid #CCC;
|
||||||
border-left: 1px solid #CCC
|
border-left: 1px solid #CCC
|
||||||
}
|
}
|
||||||
@@ -25,16 +24,24 @@ caption,th,td {
|
|||||||
padding: 10px
|
padding: 10px
|
||||||
}
|
}
|
||||||
|
|
||||||
caption,thead th,tfoot th,tfoot td {
|
caption,thead th {
|
||||||
background-color: #E63C1E;
|
background-color: #858585;
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-transform: uppercase
|
text-transform: uppercase
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tfoot th,tfoot td {
|
||||||
|
background-color: #858585;
|
||||||
|
color: #FFF;
|
||||||
|
font-size: 1px;
|
||||||
|
font-weight: bold;
|
||||||
|
text-transform: uppercase
|
||||||
|
}
|
||||||
|
|
||||||
thead th {
|
thead th {
|
||||||
background-color: #C30;
|
background-color: #858585;
|
||||||
color: #FFB3A6;
|
color: white;
|
||||||
text-align: center
|
text-align: center
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,3 +84,8 @@ tbody td+td+td+td a:active,tbody td+td+td+td a:hover,tbody td+td+td+td a:focus,t
|
|||||||
color: #E63C1E
|
color: #E63C1E
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body a:active, body a:hover, body a:focus, body a:visited {
|
||||||
|
color: #E63C1E;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
# Django settings for login project.
|
# Django settings for login project.
|
||||||
LIVE = False
|
|
||||||
|
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
TEMPLATE_DEBUG = DEBUG
|
TEMPLATE_DEBUG = DEBUG
|
||||||
@@ -12,7 +11,7 @@ ADMINS = (
|
|||||||
|
|
||||||
MANAGERS = ADMINS
|
MANAGERS = ADMINS
|
||||||
|
|
||||||
if LIVE:
|
if not DEBUG:
|
||||||
DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
|
DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
|
||||||
DATABASE_NAME = 'dreddit_sso' # Or path to database file if using sqlite3.
|
DATABASE_NAME = 'dreddit_sso' # Or path to database file if using sqlite3.
|
||||||
DATABASE_USER = 'dreddit_sso' # Not used with sqlite3.
|
DATABASE_USER = 'dreddit_sso' # Not used with sqlite3.
|
||||||
@@ -51,7 +50,7 @@ MEDIA_ROOT = '/home/nikdoof/dev/corpsso/media'
|
|||||||
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
||||||
# trailing slash if there is a path component (optional in other cases).
|
# trailing slash if there is a path component (optional in other cases).
|
||||||
# Examples: "http://media.lawrence.com", "http://example.com/media/"
|
# Examples: "http://media.lawrence.com", "http://example.com/media/"
|
||||||
MEDIA_URL = '/media/'
|
MEDIA_URL = '/static/'
|
||||||
|
|
||||||
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
|
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
|
||||||
# trailing slash.
|
# trailing slash.
|
||||||
@@ -94,6 +93,8 @@ INSTALLED_APPS = (
|
|||||||
|
|
||||||
AUTH_PROFILE_MODULE = 'sso.SSOUser'
|
AUTH_PROFILE_MODULE = 'sso.SSOUser'
|
||||||
|
|
||||||
|
LOGIN_REDIRECT_URL = "/profile"
|
||||||
|
|
||||||
### EVE Corp Info
|
### EVE Corp Info
|
||||||
|
|
||||||
EVE_CORP_ID = 1018389948
|
EVE_CORP_ID = 1018389948
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ from django.conf.urls.defaults import *
|
|||||||
from sso import views
|
from sso import views
|
||||||
|
|
||||||
urlpatterns = patterns('',
|
urlpatterns = patterns('',
|
||||||
|
('^$', views.index),
|
||||||
(r'^profile/$', views.profile),
|
(r'^profile/$', views.profile),
|
||||||
(r'^profile/add/eveapi', views.eveapi_add),
|
(r'^profile/add/eveapi', views.eveapi_add),
|
||||||
(r'^profile/del/eveapi/$', views.eveapi_del),
|
(r'^profile/del/eveapi/$', views.eveapi_del),
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ from sso.forms import EveAPIForm, ServiceAccountForm
|
|||||||
import settings
|
import settings
|
||||||
|
|
||||||
def index(request):
|
def index(request):
|
||||||
pass
|
return render_to_response('sso/index.html')
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def profile(request):
|
def profile(request):
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
font-family: Verdana;
|
font-family: Verdana;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<link rel="stylesheet" href="/static/css/tables.css" type="text/css" media="screen">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
|
|||||||
@@ -13,8 +13,11 @@
|
|||||||
|
|
||||||
<h2>Service Accounts</h2>
|
<h2>Service Accounts</h2>
|
||||||
{% if srvaccounts %}
|
{% if srvaccounts %}
|
||||||
<table border=1>
|
<table>
|
||||||
|
<thead>
|
||||||
<tr><th>Service</th><th>Username</th><th>Password</th><th>Active</th><th>Actions</th></tr>
|
<tr><th>Service</th><th>Username</th><th>Password</th><th>Active</th><th>Actions</th></tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
{% for acc in srvaccounts %}
|
{% for acc in srvaccounts %}
|
||||||
<tr><td>{{ acc.service }}</td>
|
<tr><td>{{ acc.service }}</td>
|
||||||
<td>{{ acc.username }}</td>
|
<td>{{ acc.username }}</td>
|
||||||
@@ -23,19 +26,26 @@
|
|||||||
<td><a href="/profile/del/service/{{ acc.id }}/">Delete</a></td>
|
<td><a href="/profile/del/service/{{ acc.id }}/">Delete</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
<tfoot><tr><td colspan="5"> </td></tr></tfoot>
|
||||||
</table>
|
</table>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if profile.corp_user %}
|
{% if profile.corp_user %}
|
||||||
|
<p>
|
||||||
<a href="/profile/add/service">Add Service</a>
|
<a href="/profile/add/service">Add Service</a>
|
||||||
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<h2>Eve API Keys</h2>
|
<h2>Eve API Keys</h2>
|
||||||
{% if eveaccounts %}
|
{% if eveaccounts %}
|
||||||
<table border=1>
|
<table>
|
||||||
|
<thead>
|
||||||
<tr><th>User ID</th><th>API Key</th><th>Description</th><th>Active</th><th>Actions</th></tr>
|
<tr><th>User ID</th><th>API Key</th><th>Description</th><th>Active</th><th>Actions</th></tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
{% for acc in eveaccounts %}
|
{% for acc in eveaccounts %}
|
||||||
<tr><td>{{ acc.api_user_id }}</td>
|
<tr><td>{{ acc.api_user_id }}</td>
|
||||||
<td>{{ acc.api_key }}</td>
|
<td>{{ acc.api_key }}</td>
|
||||||
@@ -43,10 +53,12 @@
|
|||||||
<td>{{ acc.api_status }}</td>
|
<td>{{ acc.api_status }}</td>
|
||||||
<td><a href="/profile/del/eveapi/{{ acc.api_user_id }}/">Delete</a></td>
|
<td><a href="/profile/del/eveapi/{{ acc.api_user_id }}/">Delete</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
<tfoot><tr><td colspan="5"> </td></tr></tfoot>
|
||||||
</table>
|
</table>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<p>
|
||||||
<a href="/profile/add/eveapi">Add a Eve API key</a>
|
<a href="/profile/add/eveapi">Add a Eve API key</a>
|
||||||
|
</p>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
7
templates/sso/index.html
Normal file
7
templates/sso/index.html
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block title %}Dredd.it SSO{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<a href="/login">Login</a>
|
||||||
|
{% endblock %}
|
||||||
5
urls.py
5
urls.py
@@ -1,5 +1,6 @@
|
|||||||
from django.conf.urls.defaults import *
|
from django.conf.urls.defaults import *
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
from django.contrib.auth.views import login
|
||||||
import settings
|
import settings
|
||||||
|
|
||||||
admin.autodiscover()
|
admin.autodiscover()
|
||||||
@@ -14,7 +15,7 @@ urlpatterns = patterns('',
|
|||||||
('', include('sso.urls')),
|
('', include('sso.urls')),
|
||||||
)
|
)
|
||||||
|
|
||||||
if not settings.DEBUG:
|
if settings.DEBUG:
|
||||||
urlpatterns += patterns('',
|
urlpatterns += patterns('',
|
||||||
(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
|
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user