|
Lines 33-46
Link Here
|
| 33 |
|
33 |
|
| 34 |
import notifier |
34 |
import notifier |
| 35 |
import notifier.threads |
35 |
import notifier.threads |
| 36 |
from fnmatch import fnmatch |
|
|
| 37 |
|
36 |
|
| 38 |
import univention.management.console as umc |
37 |
import univention.management.console as umc |
| 39 |
from univention.lib import fstab |
38 |
from univention.lib import fstab |
| 40 |
from univention.management.console.log import MODULE |
39 |
from univention.management.console.log import MODULE |
| 41 |
from univention.management.console.protocol.definitions import MODULE_ERR, SUCCESS |
40 |
from univention.management.console.protocol.definitions import MODULE_ERR, SUCCESS |
| 42 |
from univention.management.console.modules.decorators import sanitize |
41 |
from univention.management.console.modules.decorators import sanitize |
| 43 |
from univention.management.console.modules.sanitizers import StringSanitizer, IntegerSanitizer |
42 |
from univention.management.console.modules.sanitizers import StringSanitizer, IntegerSanitizer, PatternSanitizer |
| 44 |
|
43 |
|
| 45 |
import mtab |
44 |
import mtab |
| 46 |
import tools |
45 |
import tools |
|
Lines 50-56
Link Here
|
| 50 |
class Commands(object): |
49 |
class Commands(object): |
| 51 |
|
50 |
|
| 52 |
@sanitize( |
51 |
@sanitize( |
| 53 |
partitionDevice=StringSanitizer(required=True) |
52 |
partitionDevice=StringSanitizer(required=True), |
|
|
53 |
filter=PatternSanitizer(default='.*')), |
| 54 |
) |
54 |
) |
| 55 |
def users_query(self, request): |
55 |
def users_query(self, request): |
| 56 |
partitionDevice = request.options['partitionDevice'] |
56 |
partitionDevice = request.options['partitionDevice'] |
|
Lines 78-88
def _users_query(self, pid, status, callbackResult, id, partition, request):
Link Here
|
| 78 |
except: |
78 |
except: |
| 79 |
pass |
79 |
pass |
| 80 |
quotas = tools.repquota_parse(partition, callbackResult[header + 1 :]) |
80 |
quotas = tools.repquota_parse(partition, callbackResult[header + 1 :]) |
| 81 |
result = [] |
81 |
result = [q for q in quotas if request.options['filter'].match(q['user'])] |
| 82 |
for list_entry in quotas: |
|
|
| 83 |
if fnmatch(list_entry['user'], request.options['filter']): |
| 84 |
result.append(list_entry) |
| 85 |
request.status = SUCCESS |
| 86 |
self.finished(request.id, result) |
82 |
self.finished(request.id, result) |
| 87 |
|
83 |
|
| 88 |
@sanitize( |
84 |
@sanitize( |