rt 4.2.13 ticket#13852
[freeside.git] / rt / etc / upgrade / 3.8-ical-extension.in
index 45b14a6..f4df8ec 100644 (file)
@@ -3,7 +3,7 @@
 #
 # COPYRIGHT:
 #
-# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
 #                                          <sales@bestpractical.com>
 #
 # (Except where explicitly superseded by other copyright notices)
 # those contributions and any derivatives thereof.
 #
 # END BPS TAGGED BLOCK }}}
+use 5.10.1;
 use strict;
 use warnings;
 
 use lib "@LOCAL_LIB_PATH@";
 use lib "@RT_LIB_PATH@";
 
+use RT -init;
 
-use RT;
-RT::LoadConfig();
-RT::Init();
+$| = 1;
 
 use RT::Attributes;
-my $attrs = RT::Attributes->new( $RT::SystemUser );
+my $attrs = RT::Attributes->new( RT->SystemUser );
 $attrs->Limit(FIELD => 'ObjectType', OPERATOR=> '=', VALUE => 'RT::User');
 $attrs->Limit(FIELD => 'Name', OPERATOR=> '=', VALUE => 'ical-auth-token');
 while ( my $attr = $attrs->Next ) {
     my $uid = $attr->ObjectId;
     print "Processing auth token of user #". $uid ."...\n";
 
-    my $user = RT::User->new( $RT::SystemUser );
+    my $user = RT::User->new( RT->SystemUser );
     $user->Load( $uid );
     unless ( $user->id ) {
         print STDERR "\tERROR. Couldn't load user record\n";