Exemplo n.º 1
0
 public function executeConfigUID(opWebRequest $request)
 {
     $option = array('member' => $this->getUser()->getMember());
     $this->passwordForm = new opPasswordForm(array(), $option);
     $mobileUid = Doctrine::getTable('MemberConfig')->retrieveByNameAndMemberId('mobile_uid', $this->getUser()->getMemberId());
     $this->isSetMobileUid = $mobileUid && $mobileUid->getValue();
     $this->isDeletableUid = (int) opConfig::get('retrieve_uid') < 2 && $this->isSetMobileUid;
     if ($request->isMethod('post')) {
         $this->passwordForm->bind($request->getParameter('password'));
         if ($this->passwordForm->isValid()) {
             if ($request->hasParameter('update')) {
                 $cookieUid = sfContext::getInstance()->getResponse()->generateMobileUidCookie();
                 if (!$request->getMobileUID(false) && !$cookieUid) {
                     $this->getUser()->setFlash('error', 'Your mobile UID was not registered.');
                     $this->redirect('member/configUID');
                 }
                 $member = $this->getUser()->getMember();
                 $member->setConfig('mobile_uid', $request->getMobileUID(false));
                 if ($cookieUid) {
                     $member->setConfig('mobile_cookie_uid', $cookieUid);
                 }
                 $this->getUser()->setFlash('notice', 'Your mobile UID was set successfully.');
                 $this->redirect('member/configUID');
             } elseif ($request->hasParameter('delete') && $this->isDeletableUid) {
                 $mobileUid->delete();
                 sfContext::getInstance()->getResponse()->deleteMobileUidCookie();
                 $this->getUser()->setFlash('notice', 'Your mobile UID was deleted successfully.');
                 $this->redirect('member/configUID');
             }
         }
     }
     return sfView::SUCCESS;
 }
Exemplo n.º 2
0
 public function executeSmtMemberJoinCommunityListBox(opWebRequest $request)
 {
     if ($request->hasParameter('id') && 'profile' !== sfContext::getInstance()->getActionName()) {
         $this->member = Doctrine::getTable('Member')->find($request->getParameter('id'));
     } else {
         $this->member = $this->getUser()->getMember();
     }
 }
Exemplo n.º 3
0
 public function executeFriendListBox(opWebRequest $request)
 {
     $memberId = $this->getUser()->getMemberId();
     if ($request->hasParameter('id')) {
         $memberId = $request->getParameter('id');
     }
     $this->member = Doctrine::getTable('Member')->find($memberId);
     $this->row = $this->gadget->getConfig('row');
     $this->friends = $this->member->getFriends($this->row, true);
 }
Exemplo n.º 4
0
 public function executeJoinListBox(opWebRequest $request)
 {
     $memberId = $this->getUser()->getMemberId();
     if ($request->hasParameter('id')) {
         $memberId = $request->getParameter('id');
     }
     $this->member = Doctrine::getTable('Member')->find($memberId);
     $this->row = $this->gadget->getConfig('row');
     $this->crownIds = Doctrine::getTable('CommunityMember')->getCommunityIdsOfAdminByMemberId($this->member->getId());
     $this->communities = Doctrine::getTable('Community')->retrievesByMemberId($this->member->getId(), $this->row, true);
 }
Exemplo n.º 5
0
 public function executeFriendListBox(opWebRequest $request)
 {
     if ($request->hasParameter('id') && $request->getParameter('module') == 'member' && $request->getParameter('action') == 'profile') {
         $this->member = Doctrine::getTable('Member')->find($request->getParameter('id'));
     } else {
         $this->member = $this->getUser()->getMember();
     }
     $this->row = $this->gadget->getConfig('row');
     $this->col = $this->gadget->getConfig('col');
     $this->friends = $this->member->getFriends($this->row * $this->col, true);
 }
Exemplo n.º 6
0
 public function executeJoinListBox(opWebRequest $request)
 {
     if ($request->hasParameter('id') && $request->getParameter('module') == 'member' && $request->getParameter('action') == 'profile') {
         $this->member = Doctrine::getTable('Member')->find($request->getParameter('id'));
     } else {
         $this->member = $this->getUser()->getMember();
     }
     $this->row = $this->gadget->getConfig('row');
     $this->col = $this->gadget->getConfig('col');
     $this->crownIds = Doctrine::getTable('CommunityMember')->getCommunityIdsOfAdminByMemberId($this->member->getId());
     $this->communities = Doctrine::getTable('Community')->retrievesByMemberId($this->member->getId(), $this->row * $this->col, true);
 }
 public function executeDecision(opWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->checkCategory();
     $params = array('category' => $this->category, 'id' => $request->getParameter('id'), 'is_accepted' => $request->hasParameter('accept'), 'member' => $this->getUser()->getMember());
     $event = new sfEvent($this, 'op_confirmation.decision', $params);
     $this->dispatcher->notifyUntil($event);
     if ($event->isProcessed()) {
         $message = (string) $event->getReturnValue();
         $this->getUser()->setFlash('notice', $message);
     }
     $this->redirect('@confirmation_list?category=' . $this->category);
 }
Exemplo n.º 8
0
 /**
  * Executes joinlist action
  *
  * @param opWebRequest $request A request object
  */
 public function executeJoinlist(opWebRequest $request)
 {
     $this->forwardIf($request->isSmartphone(), 'community', 'smtJoinlist');
     sfConfig::set('sf_nav_type', 'default');
     if ($request->hasParameter('id') && $request->getParameter('id') != $this->getUser()->getMemberId()) {
         sfConfig::set('sf_nav_type', 'friend');
     }
     return parent::executeJoinlist($request);
 }
Exemplo n.º 9
0
 /**
  * Executes subAdminRequest action
  *
  * @param sfRequest $request A request object
  */
 public function executeSubAdminRequest(opWebRequest $request)
 {
     $this->forward404Unless($this->isAdmin);
     $this->member = Doctrine::getTable('Member')->find($request->getParameter('member_id'));
     $this->forward404Unless($this->member);
     $this->community = Doctrine::getTable('Community')->find($this->id);
     $this->communityMember = Doctrine::getTable('CommunityMember')->retrieveByMemberIdAndCommunityId($this->member->getId(), $this->id);
     $this->forward404If($this->communityMember->getIsPre());
     $this->forward404If($this->communityMember->hasPosition(array('admin', 'admin_confirm', 'sub_admin', 'sub_admin_confirm')));
     $this->form = new opChangeCommunityAdminRequestForm();
     if ($request->hasParameter('admin_request')) {
         $this->form->bind($request->getParameter('admin_request'));
         if ($this->form->isValid()) {
             Doctrine::getTable('CommunityMember')->requestSubAdmin($this->member->getId(), $this->id);
             $this->redirect('@community_memberManage?id=' . $this->id);
         }
     }
     return sfView::INPUT;
 }
Exemplo n.º 10
0
 public function executeDeleteActivity(opWebRequest $request)
 {
     $this->forward404Unless($request->hasParameter('id'));
     $this->activity = Doctrine::getTable('ActivityData')->find($this->id);
     $this->forward404Unless($this->activity instanceof ActivityData);
     $this->forward404Unless($this->activity->getMemberId() == $this->getUser()->getMemberId());
     if ($request->isMethod(sfWebRequest::POST)) {
         $request->checkCSRFProtection();
         $this->activity->delete();
         $this->getUser()->setFlash('notice', 'An %activity% was deleted.');
         $this->redirect('friend/showActivity');
     }
     return sfView::INPUT;
 }