canAcceptBanAppeal() public method

Can the specified user accept ban appeal?
public canAcceptBanAppeal ( $user_id = null )
Example #1
0
                 }
             } else {
                 Session::flash('mod_staff_app', '<div class="alert alert-danger">' . $banappeal_language['comment_error'] . '</div>');
             }
         } else {
             // Invalid token
             Session::flash('mod_staff_app', '<div class="alert alert-danger">' . $admin_language['invalid_token'] . '</div>');
         }
     }
     // Decode the questions/answers
     $answers = json_decode($application->content, true);
     // Get questions
     $questions = $queries->getWhere('banappeal_questions', array('id', '<>', 0));
 } else {
     // Can the user actually accept an application?
     if ($banappeal->canAcceptBanAppeal($user->data()->id)) {
         // Who posted the app?
         $user_posted = $application->uid;
         if ($_GET['action'] == 'accept') {
             $queries->update('banappeal_replies', $application->id, array('status' => 1));
             // Add alert to tell user that it's been accepted
             $queries->create('alerts', array('user_id' => $user_posted, 'type' => $banappeal_language['ban_appeal'], 'url' => '#', 'content' => str_replace('{x}', htmlspecialchars($user->data()->username), $banappeal_language['ban_appeal_accepted']), 'created' => date('U')));
         } else {
             if ($_GET['action'] == 'reject') {
                 $queries->update('banappeal_replies', $application->id, array('status' => 2));
                 // Add alert to tell user that it's been rejected
                 $queries->create('alerts', array('user_id' => $user_posted, 'type' => $banappeal_language['ban_appeal'], 'url' => '#', 'content' => str_replace('{x}', htmlspecialchars($user->data()->username), $banappeal_language['ban_appeal_rejected']), 'created' => date('U')));
             }
         }
     }
     Redirect::to('/mod/banappeal/?app=' . $application->id);