~ubuntu-branches/debian/squeeze/movabletype-opensource/squeeze

« back to all changes in this revision

Viewing changes to lib/MT/XMLRPCServer.pm

  • Committer: Bazaar Package Importer
  • Author(s): Dominic Hargreaves
  • Date: 2008-07-23 22:56:37 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080723225637-zsorczl9nhy0t8ap
Tags: 4.2~rc4-1
* New upstream release
* Include SendMailPath explicitly as in some cases it seems
  to be required (closes: #491618)
* Add versioned Depends on libclass-trigger-perl (>= 0.13-1)
  as the version in etch is not compatible with MT.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
# This program is distributed under the terms of the
3
3
# GNU General Public License, version 2.
4
4
#
5
 
# $Id: XMLRPCServer.pm 2264 2008-05-07 17:02:25Z bchoate $
 
5
# $Id: XMLRPCServer.pm 2737 2008-07-09 02:47:30Z takayama $
6
6
 
7
7
package MT::XMLRPCServer::Util;
8
8
use strict;
13
13
sub mt_new {
14
14
    my $cfg = $ENV{MOD_PERL} ?
15
15
        Apache->request->dir_config('MTConfig') :
16
 
        $MT::XMLRPCServer::MT_DIR . '/mt-config.cgi';
 
16
        ($ENV{MT_CONFIG} || $MT::XMLRPCServer::MT_DIR . '/mt-config.cgi');
17
17
    my $mt = MT->new( Config => $cfg )
18
18
        or die MT::XMLRPCServer::_fault(MT->errstr);
19
19
    # we need to be UTF-8 here no matter which PublishCharset
686
686
    die _fault(MT->translate("Invalid login")) unless $author;
687
687
    die _fault(MT->translate("Permission denied."))
688
688
        unless $perms && $perms->can_edit_entry($entry, $author);
 
689
 
 
690
    # Delete archive file
 
691
    my $blog = MT::Blog->load($entry->blog_id);
 
692
    my %recip = $mt->publisher->rebuild_deleted_entry(
 
693
        Entry => $entry,
 
694
        Blog  => $blog);
 
695
 
 
696
    # Rebuild archives
 
697
    $mt->rebuild_archives(
 
698
        Blog             => $blog,
 
699
        Recip            => \%recip,
 
700
    ) or die _fault($class->errstr);
 
701
 
 
702
    # Remove object
689
703
    $entry->remove;
690
704
 
691
705
    $mt->log({
695
709
        category => 'delete' 
696
710
    });
697
711
 
698
 
    if ($publish) {
699
 
        $class->_publish($mt, $entry, 1) or die _fault($class->errstr);
700
 
    }
701
712
    SOAP::Data->type(boolean => 1);
702
713
}
703
714