예제 #1
0
파일: members.php 프로젝트: Nakei/FoOlSlide
	function reject_application($team_id, $user_id = NULL) {
		if (!isAjax()) {
			return false;
		}

		$this->viewdata["function_title"] = _("Removing from team...");
		$member = new Membership();
		if (!$member->reject_application($team_id, $user_id)) {
			return FALSE;
		}
		flash_notice('notice', _('User removed from the team.'));
		$team = new Team($team_id);
		echo json_encode(array('href' => site_url('/admin/members/teams/' . $team->stub)));
	}
예제 #2
0
 function leave_team($team_stub)
 {
     $this->viewdata["navbar"] = "";
     $team = new Team();
     $team->where('stub', $team_stub)->get();
     if ($team->result_count() != 1) {
         show_404();
     }
     if ($this->input->post()) {
         $member = new Membership();
         if (!$member->reject_application($team->id)) {
             return show_404();
         }
         redirect('/account/teams/');
     }
     $this->viewdata["function_title"] = _("Leave team");
     $data["team_name"] = $team->name;
     $data["team_id"] = $team->id;
     $this->viewdata["main_content_view"] = $this->load->view('account/profile/leave_team', $data, TRUE);
     $this->load->view("account/default.php", $this->viewdata);
 }
예제 #3
0
 function reject_application($team_id, $user_id = NULL)
 {
     if (!isAjax()) {
         return false;
     }
     $this->viewdata["function_title"] = _("Removing from team...");
     $member = new Membership();
     if (!$member->reject_application($team_id, $user_id)) {
         return FALSE;
     }
     $user = new User($user_id);
     flash_notice('notice', sprintf(_('You have removed %s from the team.'), $user->username));
     $team = new Team($team_id);
     $this->output->set_output(json_encode(array('href' => site_url('/admin/members/teams/' . $team->stub))));
 }