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

Changeset 12309


Ignore:
Timestamp:
Jul 19, 2009, 8:52:41 PM (10 years ago)
Author:
ebihara
Message:

#4088:added small improved to member/deleteImage of the mobile_frontend application for adding support for configuration of a community's image

Location:
OpenPNE3/trunk/apps
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/mobile_frontend/modules/member/actions/actions.class.php

    r12299 r12309  
    159159    return sfView::SUCCESS;
    160160  }
     161
     162  public function executeDeleteImage($request)
     163  {
     164    $this->image = Doctrine::getTable('MemberImage')->find($request->getParameter('member_image_id'));
     165    $this->forward404Unless($this->image);
     166    $this->forward404Unless($this->image->getMemberId() == $this->getUser()->getMemberId());
     167
     168    $this->form = new sfForm();
     169    if ($request->isMethod(sfWebRequest::POST))
     170    {
     171      $request->checkCSRFProtection();
     172
     173      $this->image->delete();
     174      $this->redirect('member/configImage');
     175    }
     176  }
    161177}
  • OpenPNE3/trunk/apps/mobile_frontend/modules/member/templates/configImageSuccess.php

    r11786 r12309  
    2727
    2828<?php if (3 > $images->count()): ?>
     29<hr color="<?php echo $op_color["core_color_12"] ?>">
    2930<?php echo __('Send E-mail that has a photo to use as your image.') ?><br>
    3031<?php echo op_maiL_to('member_add_image', array(), __('Send E-mail')) ?>
  • OpenPNE3/trunk/apps/mobile_mail_frontend/modules/member/actions/actions.class.php

    r11880 r12309  
    2626    }
    2727
    28     foreach ($request->getMailMessage() as $part)
     28    $message = $request->getMailMessage();
     29    $images = $message->getImages();
     30    foreach ($images as $image)
    2931    {
    3032      $count = $member->getMemberImage()->count();
     
    3436      }
    3537
    36       $tok = strtok($part->contentType, ';');
    37       if ('text/plain' === $tok)
    38       {
    39         continue;
    40       }
    41 
    42       $tmppath = tempnam(sys_get_temp_dir(), 'IMG');
    43 
    44       $fh = fopen($tmppath, 'w');
    45       fwrite($fh, base64_decode($part->getContent(), true));
    46       fclose($fh);
    47 
    4838      $validator = new opValidatorImageFile();
    49       $validFile = $validator->clean(array(
    50         'tmp_name' => $tmppath,
    51         'type'     => $tok,
    52       ));
     39      $validFile = $validator->clean($image);
    5340
    5441      $file = new File();
Note: See TracChangeset for help on using the changeset viewer.