Example #1
0
 protected static function disconnect($args)
 {
     $esId = @$_POST['esId'];
     $member = new Db\Member();
     $member->loadBy('member_id', $args['member_id']);
     if ($esId && $member->hasData()) {
         if ($member->getEsId() === $esId && $member->getStatus() == Db\Member::MEMBER_STATUS_ACTIVE) {
             $member->deactivate(array($args['member_id']));
             $op = new Db\Op();
             $op->removeMember($esId, $args['member_id']);
         }
     }
     \OCP\JSON::success();
     exit;
 }