don't hide users page if liberty support is not set up; but show a message
pointing it must be before creating users.
This commit is contained in:
parent
6e6ac2594d
commit
e72cae0777
|
@ -110,6 +110,19 @@ Cache des règles à IE5-Mac \*/
|
|||
border-bottom: 1px solid #eceade;
|
||||
}
|
||||
|
||||
/*
|
||||
#header li.inactive,
|
||||
#header li.inactive:hover {
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
#header li.inactive a,
|
||||
#header li.inactive:hover a {
|
||||
background-position: 100% 0;
|
||||
color: gray;
|
||||
}
|
||||
*/
|
||||
|
||||
div#footer {
|
||||
max-width: 700px;
|
||||
margin: 0 8em;
|
||||
|
|
|
@ -13,14 +13,9 @@ items = [
|
|||
def header_menu [html] (selected = None):
|
||||
s = ["""<ul id="menu">\n"""]
|
||||
base_url = quixote.get_request().environ['SCRIPT_NAME'] + '/admin'
|
||||
users = True
|
||||
if len(wcs.misc.cfg.get('idp', {}).items()) == 0:
|
||||
users = False
|
||||
for k, v in items:
|
||||
if k == '/':
|
||||
continue # skip root
|
||||
if k == 'users' and users is False:
|
||||
continue
|
||||
if k == selected:
|
||||
s.append('<li class="active">')
|
||||
else:
|
||||
|
|
|
@ -8,7 +8,7 @@ from quixote import errors
|
|||
from quixote.html import htmltext
|
||||
from quixote.util import dump_request
|
||||
|
||||
from menu import html_top, html_foot
|
||||
from menu import html_top, html_foot, error_page
|
||||
|
||||
import wcs.emails
|
||||
import wcs.misc
|
||||
|
@ -165,9 +165,13 @@ class UsersDirectory(Directory):
|
|||
def _q_index [html] (self):
|
||||
wcs.misc.reload_cfg()
|
||||
html_top('users', title = 'Users')
|
||||
"""<ul id="nav-users-admin">
|
||||
<li><a href="new">%s</a></li>
|
||||
</ul>""" % _('New')
|
||||
|
||||
if len(wcs.misc.cfg.get('idp', {}).items()) == 0:
|
||||
'<p>%s</p>' % _('Liberty support must be setup before creating users.')
|
||||
else:
|
||||
"""<ul id="nav-users-admin">
|
||||
<li><a href="new">%s</a></li>
|
||||
</ul>""" % _('New User')
|
||||
|
||||
users = storage.get_storage().values('users')
|
||||
users.sort(lambda x,y: cmp(x.name, y.name))
|
||||
|
@ -184,6 +188,9 @@ class UsersDirectory(Directory):
|
|||
html_foot()
|
||||
|
||||
def new [html] (self):
|
||||
if len(wcs.misc.cfg.get('idp', {}).items()) == 0:
|
||||
return error_page('users',
|
||||
_('Liberty support must be setup before creating users.'))
|
||||
user = User()
|
||||
user_ui = UserUI(user)
|
||||
form = user_ui.form_new()
|
||||
|
|
Loading…
Reference in New Issue