allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [06/27] git commit: [#7657] ticket:650 Remove old audit log page
Date Mon, 29 Sep 2014 16:17:37 GMT
[#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/65f055f8
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/65f055f8
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/65f055f8

Branch: refs/heads/db/7657
Commit: 65f055f85e14902836d4c5899f1d50ad350781b5
Parents: fd8dec2
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Sep 12 15:11:21 2014 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Fri Sep 26 16:39:44 2014 +0000

----------------------------------------------------------------------
 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/65f055f8/Allura/allura/controllers/site_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/site_admin.py b/Allura/allura/controllers/site_admin.py
index ad224f4..13bbb6e 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']),
         ]
@@ -252,48 +251,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/65f055f8/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 %}


Mime
View raw message