diff --git a/account/templates/dashboard.html b/account/templates/dashboard.html index a0cf778..ff65e1c 100644 --- a/account/templates/dashboard.html +++ b/account/templates/dashboard.html @@ -4,25 +4,26 @@
-

{{ request.user.username }}

+

{{ request.user.username }}

{% for g in request.user.groups.all %} - {% if g.name == "ceymaster" %} - - - - {% elif "cey" in g.name %} - - - - {% elif g.name == "ldap_admins" %} - - - - {% else %} - - - + {% if g.name == "ceymaster" %} + + {{ g }} + + {% elif "cey" in g.name %} + + {{ g }} + + {% elif g.name == "ldap_admins" %} + + {{ g }} + + {% else %} + + {{ g }} + {% endif %} +
{% empty %} no groups... {% endfor %} diff --git a/cbapi_ldap/__init__.py b/cbapi_ldap/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/cbapi_ldap/urls.py b/cbapi_ldap/urls.py new file mode 100644 index 0000000..bb83b0b --- /dev/null +++ b/cbapi_ldap/urls.py @@ -0,0 +1,9 @@ +from django.conf.urls import patterns, url +from jsonrpc import jsonrpc_site +from cbapi_ldap import views + +urlpatterns = patterns( + '', + url(r'^ldap/browse/$', 'jsonrpc.views.browse', name='jsonrpc_browser'), + url(r'^ldap/$', jsonrpc_site.dispatch, name='jsonrpc_mountpoint'), +) diff --git a/cbapi_ldap/views.py b/cbapi_ldap/views.py new file mode 100644 index 0000000..d417c14 --- /dev/null +++ b/cbapi_ldap/views.py @@ -0,0 +1,22 @@ +from jsonrpc import jsonrpc_method + +TODO = [ + '', +] + +@jsonrpc_method("ping", authenticated=True) +def ping(request, username, password): + """Ping - Echo Request + + :returns str: echo_response + """ + echo_response = "PONG" + return echo_response + +@jsonrpc_method("todo") +def todo(request): + """Todo - List ToDo Items + + :returns list: todolist + """ + return TODO diff --git a/cbmi/settings.py b/cbmi/settings.py index 7c9609b..94a050a 100644 --- a/cbmi/settings.py +++ b/cbmi/settings.py @@ -165,8 +165,10 @@ INSTALLED_APPS = ( 'django.contrib.staticfiles', 'django.contrib.admin', 'django.contrib.admindocs', + 'jsonrpc', 'cbmi', 'account', + 'cbapi_ldap', ) # A sample logging configuration. The only tangible logging diff --git a/cbmi/urls.py b/cbmi/urls.py index 5f24716..b0f696d 100644 --- a/cbmi/urls.py +++ b/cbmi/urls.py @@ -6,6 +6,9 @@ admin.autodiscover() urlpatterns = patterns('', url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)), + + url(r'^cbapi/', include("cbapi_ldap.urls")), + url(r'account/', include('account.urls')), url(r'^groups/(?P[^/]+)/', 'cbmi.views.groups_list'), url(r'^$', 'cbmi.views.landingpage')