1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-11-21 17:04:21 +01:00

properly implementing minimum lenght limit in search

This commit is contained in:
kakwa 2016-07-06 20:47:33 +02:00
parent 3b6cf61b93
commit baee15c40f
4 changed files with 5 additions and 5 deletions

View File

@ -890,7 +890,7 @@ class LdapCherry(object):
""" search user page """
self._check_auth(must_admin=False)
is_admin = self._check_admin()
if searchstring is not None:
if searchstring is not None and len(searchstring) > 2:
res = self._search(searchstring)
else:
res = None
@ -927,7 +927,7 @@ class LdapCherry(object):
""" search user page """
self._check_auth(must_admin=True)
is_admin = self._check_admin()
if searchstring is not None:
if searchstring is not None and len(searchstring) > 2:
res = self._search(searchstring)
else:
res = None

View File

@ -17,7 +17,7 @@
<a class="navbar-brand navbar-right" href='/logout'><span class="glyphicon glyphicon-off"></span> Logout</a>
<form method='GET' action='/searchuser' class="navbar-form navbar-right" role="search" data-toggle="validator">
<div class="form-group">
<input type="text" class="form-control" data-minlength="3" name="searchstring" placeholder="Search User" data-error="Too short">
<input type="text" class="form-control" data-minlength="3" name="searchstring" placeholder="Search User" data-error="Too short" required>
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>

View File

@ -6,7 +6,7 @@
<form method='get' action='/searchadmin' role="form" class="form-inline" data-toggle="validator">
<div class="form-group">
<label for="searchstring">Search user to modify/delete</label>
<input type="text" class="form-control" data-minlength="3" data-error="Too short" id="searchstring" name="searchstring" placeholder="Search User">
<input type="text" class="form-control" data-minlength="3" data-error="Too short" id="searchstring" name="searchstring" placeholder="Search User" required>
</div>
<div class="form-group">
<label for="submit">Submit</label>

View File

@ -6,7 +6,7 @@
<form method='get' action='/searchuser' role="form" class="form-inline" data-toggle="validator">
<div class="form-group">
<label for="searchstring">Search user</label>
<input type="text" id="searchstring" data-minlength="3" data-error="Too short" class="form-control" name="searchstring" placeholder="Search User">
<input type="text" id="searchstring" data-minlength="3" data-error="Too short" class="form-control" name="searchstring" placeholder="Search User" required>
</div>
<div class="form-group">
<label for="submit">Submit</label>