/**
  * Delete Profile Avatar
  *
  * @param void
  * @return null
  */
 function delete_avatar()
 {
     if ($this->active_user->isNew()) {
         $this->httpError(HTTP_ERR_NOT_FOUND);
     }
     // if
     if (!$this->active_user->canEdit($this->logged_user)) {
         $this->httpError(HTTP_ERR_FORBIDDEN);
     }
     // if
     if ($this->request->isSubmitted()) {
         unlink($this->active_user->getAvatarPath());
         unlink($this->active_user->getAvatarPath(true));
         if ($this->request->isAsyncCall()) {
             $this->serveData(array('message' => lang('Icon successfully removed'), 'icon' => $this->active_user->getAvatarUrl(true)), 'delete', null, FORMAT_JSON);
         } else {
             $this->redirectToUrl($this->active_user->getEditAvatarUrl());
         }
     } else {
         $this->httpError(HTTP_ERR_BAD_REQUEST);
     }
     // if
 }
Example #2
0
.png" alt="" />
			<a style='color: black;' href="index.php?action=profile&amp;id=<?php 
echo $COMMENT['user_id'];
?>
" title="<?php 
echo $U_PROFILE->getFirstname() . " " . $U_PROFILE->getLastname();
?>
" id="name_<?php 
echo $comment_id;
?>
"><?php 
echo $U_PROFILE->getFirstname() . " " . $U_PROFILE->getLastname();
?>
</a>
			<?php 
if ($U_PROFILE->getAvatarPath() != "") {
    ?>
            <br /><br />
            <a style='color: black;' href="index.php?action=profile&amp;id=<?php 
    echo $COMMENT['user_id'];
    ?>
" title="<?php 
    echo $U_PROFILE->getFirstname() . " " . $U_PROFILE->getLastname();
    ?>
">
			<img src="user_data/<?php 
    echo $COMMENT['user_id'] . "/thumbs_" . $U_PROFILE->getAvatarPath();
    ?>
" />
			</a>
			<?php