Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
d703bd2b
Commit
d703bd2b
authored
Sep 25, 2004
by
Chris Withers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collector #1473: zpasswd.py can now accept --username without --password
parent
94dffd34
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
+17
-11
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
utilities/zpasswd.py
utilities/zpasswd.py
+14
-11
No files found.
doc/CHANGES.txt
View file @
d703bd2b
...
@@ -157,6 +157,9 @@ Zope Changes
...
@@ -157,6 +157,9 @@ Zope Changes
Bugs fixed
Bugs fixed
- Collector #1473: zpasswd.py can now accept --username
without --password
- Collector #1491: talgettext.py did not create a proper header
- Collector #1491: talgettext.py did not create a proper header
for the generated .pot file if multiple pagetemplate files
for the generated .pot file if multiple pagetemplate files
were processed.
were processed.
...
...
utilities/zpasswd.py
View file @
d703bd2b
...
@@ -99,6 +99,16 @@ def write_access(home, user='', group=''):
...
@@ -99,6 +99,16 @@ def write_access(home, user='', group=''):
import
do
;
do
.
ch
(
ac_path
,
user
,
group
)
import
do
;
do
.
ch
(
ac_path
,
user
,
group
)
def
get_password
():
while
1
:
password
=
getpass
.
getpass
(
"Password: "
)
verify
=
getpass
.
getpass
(
"Verify password: "
)
if
verify
==
password
:
return
password
else
:
password
=
verify
=
''
print
"Password mismatch, please try again..."
def
write_inituser
(
home
,
user
=
''
,
group
=
''
):
def
write_inituser
(
home
,
user
=
''
,
group
=
''
):
ac_path
=
os
.
path
.
join
(
home
,
'inituser'
)
ac_path
=
os
.
path
.
join
(
home
,
'inituser'
)
if
not
os
.
path
.
exists
(
ac_path
):
if
not
os
.
path
.
exists
(
ac_path
):
...
@@ -163,8 +173,8 @@ def main():
...
@@ -163,8 +173,8 @@ def main():
if
opts
:
if
opts
:
# There were some command line args, so verify
# There were some command line args, so verify
if
username
is
None
or
password
is
None
:
if
username
is
not
None
and
password
is
None
:
usage
(
1
,
'-u and -p are required'
)
password
=
get_password
(
)
else
:
else
:
# No command line args, so prompt
# No command line args, so prompt
while
1
:
while
1
:
...
@@ -172,14 +182,7 @@ def main():
...
@@ -172,14 +182,7 @@ def main():
if
username
!=
''
:
if
username
!=
''
:
break
break
while
1
:
password
=
get_password
()
password
=
getpass
.
getpass
(
"Password: "
)
verify
=
getpass
.
getpass
(
"Verify password: "
)
if
verify
==
password
:
break
else
:
password
=
verify
=
''
print
"Password mismatch, please try again..."
while
1
:
while
1
:
print
"""
print
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment