Skip to content
This repository has been archived by the owner on May 28, 2020. It is now read-only.

Commit

Permalink
issue #72
Browse files Browse the repository at this point in the history
Corrected ban user function.  Now removes votes and candidates
  • Loading branch information
pbrenner committed Mar 10, 2013
1 parent 4950885 commit 4eda934
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/Controller/CandidatesController.php
Expand Up @@ -163,6 +163,8 @@ public function listByElection($id, $filter = 0, $sorting = 0) {

if (empty($blockedUsers)) :
$blockedUsers[] = 0;
else :
$conditions[] = array('Candidate.user_id NOT' => $blockedUsers);
endif;

$moderators = array();
Expand All @@ -185,12 +187,10 @@ public function listByElection($id, $filter = 0, $sorting = 0) {
$order = array('User.name');
endif;

// If the sort flag is set to 5, then have the model sort randomly.
if ($sorting == '5'):

$order = array('rand()');

endif;
// If the sort flag is set to 5, then have the model sort randomly.
if ($sorting == '5'):
$order = array('rand()');
endif;

foreach ($this->Candidate->find('all', array('conditions' => $conditions, 'order' => $order)) as $candidate) {
$votes = array('Votes' => array(
Expand Down

0 comments on commit 4eda934

Please sign in to comment.