You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2014/09/22 12:27:50 UTC

[09/31] git commit: [#7657] ticket:650 Remove old audit log page

[#7657] ticket:650 Remove old audit log page


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/c577d99c
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/c577d99c
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/c577d99c

Branch: refs/heads/je/42cc_7657b
Commit: c577d99c90fe777a7fd28c16ceed475a47541321
Parents: 8fb1610
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Sep 12 15:11:21 2014 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Mon Sep 22 11:13:58 2014 +0300

----------------------------------------------------------------------
 Allura/allura/controllers/site_admin.py         | 43 ----------------
 .../templates/site_admin_users_audit.html       | 53 --------------------
 2 files changed, 96 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/c577d99c/Allura/allura/controllers/site_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/site_admin.py b/Allura/allura/controllers/site_admin.py
index 4a034d7..4d0ca2d 100644
--- a/Allura/allura/controllers/site_admin.py
+++ b/Allura/allura/controllers/site_admin.py
@@ -86,7 +86,6 @@ class SiteAdminController(object):
             SitemapEntry('New Projects', base_url + 'new_projects', ui_icon=g.icons['admin']),
             SitemapEntry('Reclone Repo', base_url + 'reclone_repo', ui_icon=g.icons['admin']),
             SitemapEntry('Task Manager', base_url + 'task_manager?state=busy', ui_icon=g.icons['stats']),
-            SitemapEntry('Users Audit Log', base_url + 'users', ui_icon=g.icons['admin']),
             SitemapEntry('Search Projects', base_url + 'search_projects', ui_icon=g.icons['search']),
             SitemapEntry('Search Users', base_url + 'search_users', ui_icon=g.icons['search']),
         ]
@@ -249,48 +248,6 @@ class SiteAdminController(object):
             mount_point = ''
         return dict(prefix=prefix, shortname=shortname, mount_point=mount_point)
 
-    @expose('jinja:allura:templates/site_admin_users_audit.html')
-    def users(self, username=None, limit=25, page=0, **kwargs):
-        user = M.User.by_username(username)
-        limit = int(limit)
-        page = int(page)
-        if user is None or user.is_anonymous():
-            return dict(
-                entries=[],
-                limit=limit,
-                page=page,
-                count=0,
-                username=username)
-        count = M.AuditLog.for_user(user).count()
-        q = M.AuditLog.for_user(user)
-        q = q.sort('timestamp', -1)
-        q = q.skip(page * limit)
-        if count > limit:
-            q = q.limit(limit)
-        else:
-            limit = count
-        c.widget = W.audit
-        return dict(
-            entries=q.all(),
-            limit=limit,
-            page=page,
-            count=count,
-            audit_user=user,
-            username=username)
-
-    @expose()
-    @require_post()
-    def add_audit_trail_entry(self, **kw):
-        username = kw.get('username')
-        comment = kw.get('comment')
-        user = M.User.by_username(username)
-        if user and not user.is_anonymous() and comment:
-            M.AuditLog.comment_user(c.user, comment, user=user)
-            flash('Comment added', 'ok')
-        else:
-            flash('Can not add comment "%s" for user %s' % (comment, user))
-        redirect(request.referer)
-
     def _search(self, model, fields, add_fields, q=None, f=None, page=0, limit=None, **kw):
         all_fields = fields + [(fld, fld) for fld in add_fields]
         c.search_form = W.admin_search_form(all_fields)

http://git-wip-us.apache.org/repos/asf/allura/blob/c577d99c/Allura/allura/templates/site_admin_users_audit.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/site_admin_users_audit.html b/Allura/allura/templates/site_admin_users_audit.html
deleted file mode 100644
index 7a6859b..0000000
--- a/Allura/allura/templates/site_admin_users_audit.html
+++ /dev/null
@@ -1,53 +0,0 @@
-{#-
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
--#}
-
-{% extends 'allura:templates/site_admin.html' %}
-{% import 'allura:templates/jinja_master/lib.html' as lib with context %}
-
-{% block content %}
-<div class='grid-19'>
-  <form action='' method='GET'>
-    <div class='grid-7'>
-      <label for='username'>Username:</label>
-      <input name='username' value='{{ username if username else ''}}'>
-    </div>
-    <div class='grid-5'>
-      <input type='submit' value='Show'>
-    </div>
-  </form>
-  {% if audit_user and not audit_user.is_anonymous() %}
-    <form action='/nf/admin/add_audit_trail_entry' method='POST'>
-      <div class='grid-19'>
-        <label for='comment'>Comment:</label>
-      </div>
-      <div class='grid-19'>
-        <textarea name="comment" cols="38" rows="5"></textarea>
-      </div>
-      <div class='grid-5'>
-        <input type='hidden' name='username' value='{{ audit_user.username }}'>
-        <input type='submit' value='Add comment'>
-        {{lib.csrf_token()}}
-      </div>
-    </form>
-  {% endif %}
-  {% if entries %}
-    {{ c.widget.display(entries=entries, limit=limit, page=page, count=count) }}
-  {% endif %}
-</div>
-{% endblock %}