Skip to content

Commit

Permalink
CC-6050: User management bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Albert Santoni committed Jun 5, 2015
1 parent b81069a commit b5b3d96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion airtime_mvc/application/controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public function addUserAction()
public function getHostsAction()
{
$search = $this->_getParam('term');
$res = Application_Model_User::getHosts($search);
$this->view->hosts = Application_Model_User::getHosts($search);
}

Expand Down
10 changes: 2 additions & 8 deletions airtime_mvc/application/models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ public static function getUsers(array $type, $search=null)
$con = Propel::getConnection();

$sql_gen = "SELECT login AS value, login AS label, id as index FROM cc_subjs ";
$sql = $sql_gen;

$types = array();
$params = array();
Expand All @@ -277,13 +276,8 @@ public static function getUsers(array $type, $search=null)

$sql = $sql_gen ." WHERE (". $sql_type.") ";

if (!is_null($search)) {
//need to use addslashes for 'LIKE' values
$search = addslashes($search);
$like = "login ILIKE '%{$search}%'";

$sql = $sql . " AND ".$like;
}
$sql .= " AND login ILIKE :search";
$params[":search"] = "%$search%";

$sql = $sql ." ORDER BY login";

Expand Down

0 comments on commit b5b3d96

Please sign in to comment.