Commit ed8ede3f authored by Maurits van Rees's avatar Maurits van Rees

Merged r119486 from trunk:

Report success or failure (when known) of creating a new user with
the addzope2user script.
parent a1443e80
......@@ -49,6 +49,9 @@ Bugs Fixed
Features Added
++++++++++++++
- Report success or failure (when known) of creating a new user with
the addzope2user script.
- Moved subset id calculation in `OFS.OrderSupport.moveObjectsByDelta` to a
new helper method, patch by Tom Gross.
......
......@@ -17,7 +17,7 @@ We also need to create a stub user account and login; otherwise we
wouldn't have all the rights to do traversal etc.:
>>> uf = self.folder.acl_users
>>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
>>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
>>> self.login('manager')
Now for some actual testing...
......
......@@ -55,8 +55,8 @@ Browser pages need to be protected with a permission. Let's test
those; we start by adding two users:
>>> uf = self.folder.acl_users
>>> uf._doAddUser('viewer', 'secret', [], [])
>>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
>>> _ignored = uf._doAddUser('viewer', 'secret', [], [])
>>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
>>> protected_view_names = [
... 'eagle.txt', 'falcon.html', 'owl.html', 'flamingo.html',
......
......@@ -20,7 +20,7 @@ Set up the test fixtures:
... glob.glob('%s/*.css' % _prefix))]
>>> uf = self.folder.acl_users
>>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
>>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
Image resource
......
......@@ -39,7 +39,7 @@ def test_default_view():
As a last act of preparation, we create a manager login:
>>> uf = self.folder.acl_users
>>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
>>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
We can specify another default view with browser:defaultView:
......
......@@ -87,7 +87,7 @@ def test_menu():
Let's create a manager user account and log in.
>>> uf = self.folder.acl_users
>>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
>>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
>>> self.login('manager')
>>> newInteraction()
......
......@@ -74,7 +74,7 @@ def test_resource_restricted_code():
Now let's create a manager user account and log in:
>>> uf = self.folder.acl_users
>>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
>>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
>>> self.login('manager')
We can now view them all:
......@@ -122,7 +122,7 @@ def test_view_restricted_code():
wouldn't have all the rights to do traversal etc.:
>>> uf = self.folder.acl_users
>>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
>>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
>>> self.login('manager')
>>> protected_view_names = [
......
......@@ -26,7 +26,7 @@ Making a site
-------------
>>> uf = app.acl_users
>>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
>>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
Create the test browser we'll be using:
......
......@@ -18,7 +18,7 @@ def test_standard_macros():
"""Test standard macros
>>> uf = self.folder.acl_users
>>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
>>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
>>> self.login('manager')
>>> from Products.Five.tests.testing import manage_addFiveTraversableFolder
......
......@@ -379,7 +379,7 @@ Before we can begin, we need to set up a few things. We need a
manager account:
>>> uf = self.folder.acl_users
>>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
>>> _ignored = uf._doAddUser('manager', 'r00t', ['Manager'], [])
Finally, we need to setup a traversable folder. Otherwise, Five won't
get do its view lookup magic:
......
......@@ -420,9 +420,10 @@ class ZopeCmd(ZDCmd):
self.options.python ,
'import Zope2; '
'app = Zope2.app(); '
'app.acl_users._doAddUser(\'%s\', \'%s\', [\'Manager\'], []); '
'result = app.acl_users._doAddUser(\'%s\', \'%s\', [\'Manager\'], []); '
'import transaction; '
'transaction.commit(); '
'print \'Created user:\', result'
) % (name, password)
os.system(cmdline)
......
......@@ -33,7 +33,13 @@ def main(argv=sys.argv):
finder = ZopeFinder(argv)
finder.filter_warnings()
app = finder.get_app()
adduser(app, user, pwd)
result = adduser(app, user, pwd)
if result:
print "User %s created." % user
else:
print "Got no result back. User creation may have failed."
print "Maybe the user already exists and nothing is done then."
print "Or the implementation does not give info when it succeeds."
if __name__ == '__main__':
main()
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