/**
  * @depends testCreate
  */
 public function testEdit()
 {
     // reset last sent email time for volunteer
     $volunteer = new Volunteer([self::$hour2->uid, self::$hour2->organization]);
     $volunteer->grantAllPermissions();
     $volunteer->set('last_email_sent_about_hours', 0);
 }
示例#2
0
 public function unjoinOrganization($req, $res)
 {
     $org = $this->getOrg($req, $res);
     if (!is_object($org)) {
         return $org;
     }
     $currentUser = $this->app['user'];
     // make sure the user is logged in
     if (!$currentUser->isLoggedIn()) {
         return $res->redirect('/login');
     }
     $volunteer = new Volunteer([$currentUser->id(), $org->id()]);
     $volunteer->grantAllPermissions();
     $volunteer->set(['role' => Volunteer::ROLE_NONE]);
     if ($req->query('redir') == 'profile') {
         return $res->redirect('/profile');
     }
 }