Changeset 7
- Timestamp:
- 2008年07月10日 23时14分12秒 (4 years ago)
- Location:
- trunk
- Files:
-
- 10 modified
-
config (modified) (1 prop)
-
config/Makefile (modified) (2 diffs)
-
pysvnmanager/controllers/authz.py (modified) (2 diffs)
-
pysvnmanager/i18n/en/LC_MESSAGES/pysvnmanager.po (modified) (4 diffs)
-
pysvnmanager/i18n/pysvnmanager.pot (modified) (3 diffs)
-
pysvnmanager/i18n/zh/LC_MESSAGES/pysvnmanager.po (modified) (5 diffs)
-
pysvnmanager/templates/authz/index.mako (modified) (2 diffs)
-
pysvnmanager/tests/__init__.py (modified) (2 diffs)
-
pysvnmanager/tests/functional/test_authz.py (modified) (2 diffs)
-
test.ini (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/config
- Property svn:ignore
-
old new 1 1 svn.access 2 2 svn.passwd 3 svn.access.test 4 svn.passwd.test 3 5 localconfig.py
-
- Property svn:ignore
-
trunk/config/Makefile
r4 r7 1 1 2 2 SRCDIR=../pysvnmanager/config 3 CONFFILE=localconfig.py svn.access svn.passwd 3 CONFFILE=localconfig.py svn.access svn.passwd svn.access.test svn.passwd.test 4 4 5 5 all: $(CONFFILE) … … 7 7 clean: 8 8 @-rm $(CONFFILE) >/dev/null 2>&1 9 @-rm localconfig.py >/dev/null 2>&19 @-rm localconfig.pyc >/dev/null 2>&1 10 10 11 11 %: $(SRCDIR)/%.in 12 12 cp $< $@ 13 13 14 %.test: $(SRCDIR)/%.in 15 cp $< $@ 16 17 14 18 .PHONY : all clean -
trunk/pysvnmanager/controllers/authz.py
r4 r7 142 142 143 143 reposname = d.get('reposname') 144 admins = d.get('admins' )144 admins = d.get('admins', '') 145 145 path = d.get('path') 146 146 rules = d.get('rules') … … 159 159 raise Exception, _("Repository %s not exist.") % reposname 160 160 161 if mode2 == "new": 162 module = self.authz.add_module(reposname, path) 163 else: 164 module = self.authz.get_module(reposname, path) 165 if path and not module: 166 raise Exception, _("Module %s not exist.") % path 161 if path: 162 if mode2 == "new": 163 module = self.authz.add_module(reposname, path) 164 else: 165 module = self.authz.get_module(reposname, path) 166 if not module: 167 raise Exception, _("Module %s not exist.") % path 168 else: 169 module = None 167 170 168 171 repos.admins = admins 172 if not repos.is_admin(self.login_as) and \ 173 not (repos.name != '/' and self.authz.is_super_user(self.login_as)): 174 raise Exception, _("You can not delete yourself from admin list.") 175 169 176 if module: 170 177 self.authz.set_rules(reposname, path, rules); -
trunk/pysvnmanager/i18n/en/LC_MESSAGES/pysvnmanager.po
r4 r7 1 1 # English translations for pysvnmanager. 2 2 # Copyright (C) 2008 ORGANIZATION 3 # This file is distributed under the same license as the pysvnmanager project. 3 # This file is distributed under the same license as the pysvnmanager 4 # project. 4 5 # FIRST AUTHOR <EMAIL@ADDRESS>, 2008. 5 6 # … … 9 10 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" 10 11 "POT-Creation-Date: 2008-07-03 22:14+0800\n" 11 "PO-Revision-Date: 2008-07-10 2 0:03+0800\n"12 "PO-Revision-Date: 2008-07-10 22:14+0800\n" 12 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 13 14 "Language-Team: en <LL@li.org>\n" … … 77 78 msgstr "" 78 79 79 #: pysvnmanager/controllers/authz.py:175 80 #: pysvnmanager/controllers/authz.py:171 81 msgid "You can not delete yourself from admin list." 82 msgstr "" 83 84 #: pysvnmanager/controllers/authz.py:179 80 85 #, python-format 81 86 msgid "User %(user)s changed authz rules. (rev:%(rev)s,%(msg)s)" 82 87 msgstr "" 83 88 84 #: pysvnmanager/controllers/authz.py: 19989 #: pysvnmanager/controllers/authz.py:203 85 90 #, python-format 86 91 msgid "User %(user)s delete authz rules. (rev:%(rev)s,%(msg)s)" … … 320 325 msgstr "" 321 326 327 #: pysvnmanager/templates/authz/index.mako:510 328 msgid "Update ACL failed:" 329 msgstr "" 330 331 #: pysvnmanager/templates/authz/index.mako:517 332 msgid "Update ACL successfully." 333 msgstr "" 334 322 335 #: pysvnmanager/templates/authz/index.mako:539 323 336 msgid "No path selected." -
trunk/pysvnmanager/i18n/pysvnmanager.pot
r4 r7 9 9 "Project-Id-Version: pySvnManager 0.1.1\n" 10 10 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" 11 "POT-Creation-Date: 2008-07-10 2 0:03+0800\n"11 "POT-Creation-Date: 2008-07-10 22:14+0800\n" 12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 71 71 msgstr "" 72 72 73 #: pysvnmanager/controllers/authz.py:175 73 #: pysvnmanager/controllers/authz.py:171 74 msgid "You can not delete yourself from admin list." 75 msgstr "" 76 77 #: pysvnmanager/controllers/authz.py:179 74 78 #, python-format 75 79 msgid "User %(user)s changed authz rules. (rev:%(rev)s,%(msg)s)" 76 80 msgstr "" 77 81 78 #: pysvnmanager/controllers/authz.py: 19982 #: pysvnmanager/controllers/authz.py:203 79 83 #, python-format 80 84 msgid "User %(user)s delete authz rules. (rev:%(rev)s,%(msg)s)" … … 311 315 msgstr "" 312 316 317 #: pysvnmanager/templates/authz/index.mako:510 318 msgid "Update ACL failed:" 319 msgstr "" 320 321 #: pysvnmanager/templates/authz/index.mako:517 322 msgid "Update ACL successfully." 323 msgstr "" 324 313 325 #: pysvnmanager/templates/authz/index.mako:539 314 326 msgid "No path selected." -
trunk/pysvnmanager/i18n/zh/LC_MESSAGES/pysvnmanager.po
r4 r7 2 2 # Chinese (China) translations for pysvnmanager. 3 3 # Copyright (C) 2008 ORGANIZATION 4 # This file is distributed under the same license as the pysvnmanager project. 4 # This file is distributed under the same license as the pysvnmanager 5 # project. 5 6 # 6 7 # FIRST AUTHOR <EMAIL@ADDRESS>, 2008. … … 8 9 msgid "" 9 10 msgstr "" 10 "Project-Id-Version: pysvnmanager\n"11 "Project-Id-Version: pysvnmanager\n" 11 12 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" 12 13 "POT-Creation-Date: 2008-07-03 22:14+0800\n" 13 "PO-Revision-Date: 2008-07-10 2 0:03+0800\n"14 "PO-Revision-Date: 2008-07-10 22:15+0800\n" 14 15 "Last-Translator: Jiang Xin <worldhello.net@gmail.com>\n" 15 "Language-Team: <zh@li.org>\n"16 "Language-Team: <zh@li.org>\n" 16 17 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION\n" 17 18 "MIME-Version: 1.0\n" 18 "Content-Type: text/plain; charset= utf-8\n"19 "Content-Type: text/plain; charset=UTF-8\n" 19 20 "Content-Transfer-Encoding: 8bit\n" 20 21 "Generated-By: Babel 0.9.2\n" 22 "X-Generator: KBabel 1.11.4\n" 21 23 22 24 #: pysvnmanager/controllers/authz.py:22 … … 79 81 msgstr "模组 %s 不存在。" 80 82 81 #: pysvnmanager/controllers/authz.py:175 83 #: pysvnmanager/controllers/authz.py:171 84 msgid "You can not delete yourself from admin list." 85 msgstr "您不能将自己从管理员列表中删除。" 86 87 #: pysvnmanager/controllers/authz.py:179 82 88 #, python-format 83 89 msgid "User %(user)s changed authz rules. (rev:%(rev)s,%(msg)s)" 84 90 msgstr "用户 %(user)s 修改了授权策略。(rev:%(rev)s,%(msg)s)" 85 91 86 #: pysvnmanager/controllers/authz.py: 19992 #: pysvnmanager/controllers/authz.py:203 87 93 #, python-format 88 94 msgid "User %(user)s delete authz rules. (rev:%(rev)s,%(msg)s)" … … 137 143 #, python-format 138 144 msgid "Login failed for user: %s" 139 msgstr " "145 msgstr "以 %s 身份登录失败" 140 146 141 147 #: pysvnmanager/controllers/security.py:51 … … 342 348 msgstr "保存失败。" 343 349 350 #: pysvnmanager/templates/authz/index.mako:510 351 #| msgid "Save failed." 352 msgid "Update ACL failed:" 353 msgstr "更新ACL失败:" 354 355 #: pysvnmanager/templates/authz/index.mako:517 356 msgid "Update ACL successfully." 357 msgstr "成功更新ACL。" 358 344 359 #: pysvnmanager/templates/authz/index.mako:539 345 360 msgid "No path selected." -
trunk/pysvnmanager/templates/authz/index.mako
r2 r7 508 508 if (message) 509 509 { 510 message = '${ "Update ACL failed:"}' + message;510 message = '${_("Update ACL failed:")}' + message; 511 511 alert(message); 512 512 document.getElementById('result').innerHTML = message; … … 515 515 else 516 516 { 517 message = '${ "Update ACL successfully."}';517 message = '${_("Update ACL successfully.")}'; 518 518 document.getElementById('result').innerHTML = message; 519 519 alert(message); -
trunk/pysvnmanager/tests/__init__.py
r2 r7 11 11 import os 12 12 import sys 13 from shutil import copyfile 13 14 from unittest import TestCase 14 15 … … 42 43 TestCase.__init__(self, *args, **kwargs) 43 44 45 def rollback(self): 46 src = os.path.dirname(__file__) + '/../config/svn.access.in' 47 dest = os.path.dirname(__file__) + '/../../config/svn.access.test' 48 copyfile(src, dest) 49 44 50 def login(self, username, password=""): 45 51 res = self.app.get(url_for(controller='login')) -
trunk/pysvnmanager/tests/functional/test_authz.py
r4 r7 3 3 4 4 class TestAuthzController(TestController): 5 6 5 def test_index(self): 7 6 # Test redirect to login pange … … 74 73 ''' == res.body, res.body 75 74 75 def test_delete_admin(self): 76 # Login as superuser 77 self.login('root') 78 params = {'reposname':'/', 'admins':''} 79 res = self.app.get(url_for(controller='authz', action='save_authz'), params) 80 assert res.status == 200 81 assert "You can not delete yourself from admin list." == res.body, res.body 82 83 params = {'reposname':'/', 'admins':'root'} 84 res = self.app.get(url_for(controller='authz', action='save_authz'), params) 85 assert res.status == 200 86 assert "" == res.body, res.body 87 self.rollback() 88 89 self.login('root') 90 params = {'reposname':'/repos1', 'admins':'user1'} 91 res = self.app.get(url_for(controller='authz', action='save_authz'), params) 92 assert res.status == 200 93 assert "" == res.body, res.body 94 self.rollback() 95 96 self.login('root') 97 params = {'reposname':'/repos1', 'admins':'user1, root'} 98 res = self.app.get(url_for(controller='authz', action='save_authz'), params) 99 assert res.status == 200 100 assert "" == res.body, res.body 101 self.rollback() 102 103 self.login('admin1') 104 params = {'reposname':'/repos1', 'admins':'user1, root'} 105 res = self.app.get(url_for(controller='authz', action='save_authz'), params) 106 assert res.status == 200 107 assert "You can not delete yourself from admin list." == res.body, res.body 108 109 self.login('admin1') 110 params = {'reposname':'/repos1', 'admins':'admin1, admin2'} 111 res = self.app.get(url_for(controller='authz', action='save_authz'), params) 112 assert res.status == 200 113 assert "" == res.body, res.body 114 self.rollback() 115 116 76 117 def test_save_authz(self): 77 118 pass -
trunk/test.ini
r4 r7 50 50 51 51 # authn_file: a .htpasswd style password file, used for pysvnmanager authentication. 52 authn_file = %(here)s/config/svn.passwd 52 authn_file = %(here)s/config/svn.passwd.test 53 53 54 54 # authz_file: svn authz config file with administrative extension. (ossxp.com) 55 authz_file = %(here)s/config/svn.access 55 authz_file = %(here)s/config/svn.access.test 56 56 57 57 # Logging configuration
![(please configure the [header_logo] section in trac.ini)](/trac/pysvnmanager/chrome/common/trac_banner.png)