ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Ignore:
Timestamp:
Mar 18, 2009, 7:59:30 PM (13 years ago)
Author:
ShogoKawahara
Message:

#3329:added ability to edit member's photo on the mobile_frontend

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/lib/action/sfOpenPNEMemberAction.class.php

    r11013 r11056  
    334334  }
    335335
     336  public function executeConfigImage($request)
     337  {
     338    return sfView::SUCCESS;
     339  }
     340
     341  public function executeDeleteImage($request)
     342  {
     343    $image = MemberImagePeer::retrieveByPk($request->getParameter('member_image_id'));
     344    $this->forward404Unless($image);
     345    $this->forward404Unless($image->getMemberId() == $this->getUser()->getMemberId());
     346
     347    $image->delete();
     348
     349    $this->redirect('member/configImage');
     350  }
     351
     352  public function executeChangeMainImage($request)
     353  {
     354    $image = MemberImagePeer::retrieveByPk($request->getParameter('member_image_id'));
     355    $this->forward404Unless($image);
     356    $this->forward404Unless($image->getMemberId() == $this->getUser()->getMemberId());
     357
     358    $currentImage = $this->getUser()->getMember()->getImage();
     359    $currentImage->setIsPrimary(false);
     360    $currentImage->save();
     361    $image->setIsPrimary(true);
     362    $image->save();
     363
     364    $this->redirect('member/configImage');
     365  }
     366
     367
    336368  protected function sendDeleteAccountMail($member)
    337369  {
Note: See TracChangeset for help on using the changeset viewer.