public static function delete($request, $match)
    {
        if (array_key_exists('userId', $match)) {
            // Check user is owner
            if ($request->user->id != $match['userId'] && !User_Precondition::isOwner($request)) {
                throw new Pluf_Exception_Forbidden('Not allowed to change others avatar');
            }
            $user = Pluf_Shortcuts_GetObjectOr404('User_Account', $match['userId']);
        } else {
            $user = $request->user;
        }
        if($user->isAnonymous()){
            throw new Pluf_Exception_BadRequest('User is not defined');
        }
        return User_Shortcuts_DeleteAvatar($user);
    }
public static function delete($request, $match)
    {
        if (array_key_exists('userId', $match)) {
            // Check user is owner
            if ($request->user->id != $match['userId'] && !User_Precondition::isOwner($request)) {
                throw new Pluf_Exception_Forbidden('Not allowed to change others avatar');
            }
            $user = Pluf_Shortcuts_GetObjectOr404('User_Account', $match['userId']);
        } else {
            $user = $request->user;
        }
        if($user->isAnonymous()){
            throw new Pluf_Exception_BadRequest('User is not defined');
        }
        return User_Shortcuts_DeleteAvatar($user);
    }
public static function delete ( $ request , $ match ) { if ( array_key_exists ( 'userId' , $ match ) ) { // Check user is owner if ( $ request -> user -> id != $ match [ 'userId' ] && ! User_Precondition :: isOwner ( $ request ) ) { throw new Pluf_Exception_Forbidden ( 'Not allowed to change others avatar' ) ; } $ user = Pluf_Shortcuts_GetObjectOr404 ( 'User_Account' , $ match [ 'userId' ] ) ; } else { $ user = $ request -> user ; } if ( $ user -> isAnonymous ( ) ) { throw new Pluf_Exception_BadRequest ( 'User is not defined' ) ; } return User_Shortcuts_DeleteAvatar ( $ user ) ; }
Deletes avatar images of user.
This action may set default avatar for user.

@param Pluf_HTTP_Request $request
@param array $match
Deletes avatar images of user . This action may set default avatar for user .