mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-12 23:17:02 +02:00
added search capabilities to admin sections
This commit is contained in:
@ -34,6 +34,12 @@ class ControllerCustomerList extends Controller {
|
||||
|
||||
if(isset($this->request->get['id'])) { $this->data['id'] = $this->request->get['id']; }
|
||||
|
||||
$this->data['search'] = '';
|
||||
|
||||
if(isset($this->request->post['search'])) { $this->data['search'] = $this->request->post['search']; }
|
||||
else if(isset($this->request->get['search'])) { $this->data['search'] = $this->request->get['search']; }
|
||||
|
||||
|
||||
/* check if we are admin */
|
||||
|
||||
if(Registry::get('admin_user') == 1) {
|
||||
@ -72,7 +78,7 @@ class ControllerCustomerList extends Controller {
|
||||
$this->data['a'] = $this->model_saas_customer->get($this->data['id']);
|
||||
}
|
||||
else {
|
||||
$this->data['entries'] = $this->model_saas_customer->get();
|
||||
$this->data['entries'] = $this->model_saas_customer->search($this->data['search']);
|
||||
}
|
||||
|
||||
if ( isset($this->data['errorstring']) ) {
|
||||
|
@ -42,12 +42,11 @@ class ControllerDomainDomain extends Controller {
|
||||
|
||||
/* get search term if there's any */
|
||||
|
||||
if($this->request->server['REQUEST_METHOD'] == 'POST'){
|
||||
$this->data['search'] = @$this->request->post['search'];
|
||||
}
|
||||
else {
|
||||
$this->data['search'] = @$this->request->get['search'];
|
||||
}
|
||||
$this->data['search'] = '';
|
||||
|
||||
if(isset($this->request->post['search'])) { $this->data['search'] = $this->request->post['search']; }
|
||||
else if(isset($this->request->get['search'])) { $this->data['search'] = $this->request->get['search']; }
|
||||
|
||||
|
||||
|
||||
/* get page */
|
||||
@ -64,7 +63,6 @@ class ControllerDomainDomain extends Controller {
|
||||
|
||||
if($this->request->server['REQUEST_METHOD'] == 'POST') {
|
||||
if($this->validate() == true) {
|
||||
|
||||
if($this->model_domain_domain->addDomain($this->request->post['domain'], $this->request->post['mapped'], $ldap_id) == 1) {
|
||||
$this->data['x'] = $this->data['text_successfully_added'];
|
||||
} else {
|
||||
@ -75,11 +73,11 @@ class ControllerDomainDomain extends Controller {
|
||||
$this->data['errorstring'] = $this->data['text_error_message'];
|
||||
$this->data['errors'] = $this->error;
|
||||
$this->data['post'] = $this->request->post;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* get list of domains */
|
||||
$this->data['domains'] = $this->model_domain_domain->getDomains();
|
||||
$this->data['domains'] = $this->model_domain_domain->getDomains($this->data['search']);
|
||||
|
||||
}
|
||||
else {
|
||||
|
@ -35,6 +35,12 @@ class ControllerLdapList extends Controller {
|
||||
|
||||
if(isset($this->request->get['id'])) { $this->data['id'] = $this->request->get['id']; }
|
||||
|
||||
$this->data['search'] = '';
|
||||
|
||||
if(isset($this->request->post['search'])) { $this->data['search'] = $this->request->post['search']; }
|
||||
else if(isset($this->request->get['search'])) { $this->data['search'] = $this->request->get['search']; }
|
||||
|
||||
|
||||
/* check if we are admin */
|
||||
|
||||
if(Registry::get('admin_user') == 1) {
|
||||
@ -68,11 +74,10 @@ class ControllerLdapList extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($this->request->get['id'])) {
|
||||
if($this->data['id'] != -1) {
|
||||
$this->data['a'] = $this->model_saas_ldap->get($this->data['id']);
|
||||
}
|
||||
else {
|
||||
$this->data['entries'] = $this->model_saas_ldap->get();
|
||||
} else {
|
||||
$this->data['entries'] = $this->model_saas_ldap->search($this->data['search']);
|
||||
}
|
||||
|
||||
if ( isset($this->data['errorstring']) ) {
|
||||
|
@ -24,6 +24,11 @@ class ControllerPolicyArchiving extends Controller {
|
||||
|
||||
$this->data['error'] = '';
|
||||
|
||||
$this->data['search'] = '';
|
||||
|
||||
if(isset($this->request->post['search'])) { $this->data['search'] = $this->request->post['search']; }
|
||||
else if(isset($this->request->get['search'])) { $this->data['search'] = $this->request->get['search']; }
|
||||
|
||||
if(Registry::get('admin_user') == 0) {
|
||||
die("go away");
|
||||
}
|
||||
@ -36,7 +41,7 @@ class ControllerPolicyArchiving extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
$this->data['rules'] = $this->model_policy_archiving->get_rules();
|
||||
$this->data['rules'] = $this->model_policy_archiving->get_rules($this->data['search']);
|
||||
|
||||
|
||||
$this->render();
|
||||
|
@ -22,6 +22,11 @@ class ControllerPolicyRetention extends Controller {
|
||||
$this->data['rules'] = array();
|
||||
$this->data['error'] = '';
|
||||
|
||||
$this->data['search'] = '';
|
||||
|
||||
if(isset($this->request->post['search'])) { $this->data['search'] = $this->request->post['search']; }
|
||||
else if(isset($this->request->get['search'])) { $this->data['search'] = $this->request->get['search']; }
|
||||
|
||||
if(Registry::get('admin_user') == 0) {
|
||||
die("go away");
|
||||
}
|
||||
@ -37,7 +42,7 @@ class ControllerPolicyRetention extends Controller {
|
||||
|
||||
}
|
||||
|
||||
$this->data['rules'] = $this->model_policy_retention->get_rules();
|
||||
$this->data['rules'] = $this->model_policy_retention->get_rules($this->data['search']);
|
||||
|
||||
|
||||
$this->render();
|
||||
|
Reference in New Issue
Block a user