Commit 02001d36 authored by Chris McDonough's avatar Chris McDonough

Provide a newbie-friendly message about adding users at the top of the

quickstart page if the root acl_users contains no users.  Required an
additional default user folder method, hasUsers.
parent 2841b113
......@@ -12,7 +12,7 @@
##############################################################################
"""Access control package"""
__version__='$Revision: 1.178 $'[11:-2]
__version__='$Revision: 1.179 $'[11:-2]
import Globals, socket, SpecialUsers,re
import os
......@@ -1026,6 +1026,14 @@ class UserFolder(BasicUserFolder):
"""Return the named user object or None"""
return self.data.get(name, None)
def hasUsers(self):
""" This is not a formal API method: it is used only to provide
a way for the quickstart page to determine if the default user
folder contains any users to provide instructions on how to
add a user for newbies. Using getUserNames or getUsers would have
posed a denial of service risk."""
return not not len(self.data)
def _doAddUser(self, name, password, roles, domains, **kw):
"""Create a new user"""
if password is not None and self.encrypt_passwords:
......
......@@ -24,6 +24,27 @@
form_title='Zope Quick Start',
)">
<dtml-if expr="not PARENTS[0].acl_users.hasUsers()">
<div class="system-msg">
<h3>
You have not created any users in this Zope instance. In order to
log in and manage this Zope instance, you'll need to add an adminstrative
user account.
</h3>
<p>
If you're running Zope on UNIX or Linux, you can create an administrative
user account via the "zopectl adduser" command from a shell. If you're
running Zope on Windows, you'll need to use the "zpasswd.py" utility in your
Zope installation's "bin" directory
at <i><dtml-var "Control_Panel.getZOPE_HOME()">\bin</i>
to create a file named <i>inituser</i> in your Zope instance home at
<i><dtml-var "Control_Panel.getINSTANCE_HOME()"></i> that contains the
initial administrative username and password.
</p>
</div>
</dtml-if>
<p>
Welcome to <strong>Zope</strong>, a high-performance object-oriented
platform for building dynamic Web applications. Here are some quick
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment