@@ -35,9 +35,12 @@ from pylons.controllers.util import redi
from pylons.i18n.translation import _
import rhodecode.lib.helpers as h
from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAllDecorator
from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAllDecorator, \
NotAnonymous
from rhodecode.lib.base import BaseRepoController, render
from rhodecode.lib.utils import invalidate_cache, action_logger
from rhodecode.model.forms import RepoSettingsForm, RepoForkForm
from rhodecode.model.repo import RepoModel
from rhodecode.model.db import User
@@ -157,6 +160,7 @@ class SettingsController(BaseRepoControl
return redirect(url('home'))
@NotAnonymous()
@HasRepoPermissionAllDecorator('repository.read')
def fork(self, repo_name):
repo_model = RepoModel()
@@ -172,7 +176,7 @@ class SettingsController(BaseRepoControl
return render('settings/repo_fork.html')
def fork_create(self, repo_name):
@@ -33,6 +33,7 @@ from decorator import decorator
from pylons import config, session, url, request
from pylons.controllers.util import abort, redirect
from rhodecode.lib.exceptions import LdapPasswordError, LdapUsernameError
from rhodecode.lib.utils import get_repo_slug
@@ -384,6 +385,10 @@ class NotAnonymous(object):
p += request.environ.get('PATH_INFO')
if request.environ.get('QUERY_STRING'):
p += '?' + request.environ.get('QUERY_STRING')
h.flash(_('You need to be a registered user to perform this action'),
category='warning')
return redirect(url('login_home', came_from=p))
else:
return func(*fargs, **fkwargs)
@@ -12,7 +12,17 @@
</head>
<body>
<div id="login">
<div class="flash_msg">
<% messages = h.flash.pop_messages() %>
% if messages:
<ul id="flash-messages">
% for message in messages:
<li class="${message.category}_msg">${message}</li>
% endfor
</ul>
% endif
</div>
<!-- login -->
<div class="title top-left-rounded-corner top-right-rounded-corner">
<h5>${_('Sign In to')} ${c.rhodecode_name}</h5>
Status change: