[rt-users] javascript tags showing in ticket text

2012-04-23 Thread Florin Andrei

RT 4.0.5 with all dependencies installed.

Some tickets are created by users emailing us from Outlook. In some of 
these tickets, I see this stuff:


##
Company Name

Buyer

Since when
###

It's displayed verbatim in the ticket body. I'm sure this is not 
displayed like that by Outlook.


Any way to get rid of that javascript tag noise?

Thanks.

--
Florin Andrei
http://florin.myip.org/


Re: [rt-users] One more Question About LDAP Import Extension

2012-04-23 Thread Scott Pestana

Johnathan,
I used perl -d to traverse the execution of rtldapimport, and found 
that the module uses the Name field; it automatically assumes the Name 
field is one of the fields in the mapping.  It does a test on the 
LDAP->RT mapping, but only to determine if one exists, not that it 
explicitly includes the Name field.  I found code that explicitly picked 
Name as a hash key from the RT field names to query (and without 
quotes... *shudder*).


I could be completely wrong about all of this, I'd love to be 
corrected if Mr. Falcone (the author) has some free time.


-Scott


On 4/23/2012 2:25 PM, johnathan.b...@baker.edu wrote:
In our instance, it seems that the username is keyed on email address 
(even though we've got only the 'Name' field as the mapping for 
logins)… I'd check that. The main reason for this, as I understand it, 
is that even though you may specify some other field, RT still needs 
to have a way of interpreting this when you've users replying to 
tickets via email--the email address is the only thing the server has 
to go on.


Then again, I may be way off base.

- Johnathan

On Apr 23, 2012, at 12:26 PM, Scott Pestana wrote:


All,
   We are happy with LDAP Import, with the following mapping:

Set($LDAPMapping, { 'Name' => 'uid',
   'EmailAddress' => 'mail',
   'RealName' => 'cn',
   'ExternalAuthId' => 'uid',
   'Gecos' => 'gecos'
   }
);

   We're trying to figure out though; which is the key RT checks to 
see if users already exist?  When running in debug mode we get this 
output:


Processing user spestana
User spestana already exists as 494, skipping
Imported 38/48 users

   But there's no way of knowing if that's the Name, or the 
ExternalAuthId.  Can you give us some insight here? Right now, my 
inspection of the code has me feeling this defaults to the first 
field listed by the LDAPMapping.


--
N. Scott Pestana
IT Infrastructure
Linguamatics
275 Grove Street, Suite 2-400
Newton, MA 02466

Tel: +1-774-571-7135

US Tel: +1-617-674-3256
UK Tel: 011-44-1223-421360
UK Fax: 011-44-1223-421361
Web: www.linguamatics.com 



--
Johnathan Bell
Internet System Administrator, Baker College
Office Hours: 7A-4P Eastern, M-F



--
N. Scott Pestana
IT Infrastructure
Linguamatics
275 Grove Street, Suite 2-400
Newton, MA 02466

Tel: +1-774-571-7135

US Tel: +1-617-674-3256
UK Tel: 011-44-1223-421360
UK Fax: 011-44-1223-421361
Web: www.linguamatics.com



Re: [rt-users] Can't locate Plack/Handler/Apache2.pm

2012-04-23 Thread Jacobo Urdiales

Hi all,
Manually downloaded and installed Text::Wrapper version 1.02 from cpan 
and dependancies solved


make testdeps

El 23/04/12 22:22, Jacobo Urdiales escribió:

Hi Kevin,
Just build a new Centos5.
Followed the install process and came to a problem using perl 5.8.8
component HTML::TextWrapper has to be manually intalled on cpan 
because of two dependancies.

component Text::Wrapper fails because of perl version

here it is maybe to update requirements or documentation...

cpan> install Text::Wrapper
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
  Database was generated on Mon, 23 Apr 2012 13:39:03 GMT
Running install for module Text::Wrapper
Running make for C/CJ/CJM/Text-Wrapper-1.03.tar.gz
CPAN: Digest::MD5 loaded ok
CPAN: Compress::Zlib loaded ok
Checksum for 
/root/.cpan/sources/authors/id/C/CJ/CJM/Text-Wrapper-1.03.tar.gz ok

Scanning cache /root/.cpan/build for sizes
Text-Wrapper-1.03/
Text-Wrapper-1.03/README
Text-Wrapper-1.03/Changes
Text-Wrapper-1.03/LICENSE
Text-Wrapper-1.03/MANIFEST
Text-Wrapper-1.03/META.yml
Text-Wrapper-1.03/META.json
Text-Wrapper-1.03/t/
Text-Wrapper-1.03/t/00-load.t
Text-Wrapper-1.03/t/20-unicode.t
Text-Wrapper-1.03/t/10-wrapper.t
Text-Wrapper-1.03/t/00-all_prereqs.t
Text-Wrapper-1.03/t/release-pod-syntax.t
Text-Wrapper-1.03/t/release-pod-coverage.t
Text-Wrapper-1.03/Makefile.PL
Text-Wrapper-1.03/lib/
Text-Wrapper-1.03/lib/Text/
Text-Wrapper-1.03/lib/Text/Wrapper.pm
Text-Wrapper-1.03/example/
Text-Wrapper-1.03/example/gettysburg.pl
Removing previously used /root/.cpan/build/Text-Wrapper-1.03

  CPAN.pm: Going to build C/CJ/CJM/Text-Wrapper-1.03.tar.gz

*Perl v5.10.0 required--this is only v5.8.8, stopped at Makefile.PL 
line 5.*

BEGIN failed--compilation aborted at Makefile.PL line 5.
Running make test
  Make had some problems, maybe interrupted? Won't test
Running make install
  Make had some problems, maybe interrupted? Won't install

cpan>




El 23/04/12 18:03, Kevin Falcone escribió:

On Mon, Apr 23, 2012 at 04:39:17PM +0200, Jacobo Urdiales wrote:

Actually on centos5 perl 5.8.8 is installed using yum. But there is
a cpan library with is not working with versions older than 5.10 so
i had to download and compile 5.14.

RT should install just fine against 5.8.8, but obviously a newer perl
is nicer to have an easier to maintain.


So after the cpan and dependancies nightmare not sure if any package
is still pointing to the old perl...

mod_perl is compiled into apache and judging from your error messages
is clearly pointing to 5.8.8


The system is going to have just 30 requests a month or so. So I do
not think using cgi would be a problem.

fastcgi, not cgi.
You can read about the two fastcgi solutions (mod_fastcgi and
mod_fcgid) in docs/web_deployment.pod

-kevin


El 23/04/12 16:30, Kevin Falcone escribió:

On Mon, Apr 23, 2012 at 01:19:09PM +0200, Jacobo Urdiales wrote:

But upon restarting apache i get this error

Can't locate Plack/Handler/Apache2.pm in @INC (@INC contains:
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .
/etc/httpd) at /etc/httpd/conf.d/rt.conf line 11.\nBEGIN
failed--compilation aborted\t(in cleanup) Can't locate
Plack/Handler/Apache2.pm in @INC (@INC contains:
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .
/etc/httpd) at /etc/httpd/conf.d/rt.conf line 11.\nBEGIN
failed--compilation aborted at /etc/httpd/conf.d/rt.conf line 11.\n

The point is that I installed perl version 5.14 and compiled rt eith
that also installed the modules under that version. But I do not
know why seems that apache or whatever has the old path.
Tried to modify (even copy) the path contents to old locations but
more errors rise..

Did you compile apache/mod_perl with 5.14 or are you using vendor
packages that still point to the 5.8 install?

If you want to use your own perl build, fastcgi will be easier.

-kevin


Re: [rt-users] Can't locate Plack/Handler/Apache2.pm

2012-04-23 Thread Jacobo Urdiales

Hi Kevin,
Just build a new Centos5.
Followed the install process and came to a problem using perl 5.8.8
component HTML::TextWrapper has to be manually intalled on cpan because 
of two dependancies.

component Text::Wrapper fails because of perl version

here it is maybe to update requirements or documentation...

cpan> install Text::Wrapper
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
  Database was generated on Mon, 23 Apr 2012 13:39:03 GMT
Running install for module Text::Wrapper
Running make for C/CJ/CJM/Text-Wrapper-1.03.tar.gz
CPAN: Digest::MD5 loaded ok
CPAN: Compress::Zlib loaded ok
Checksum for 
/root/.cpan/sources/authors/id/C/CJ/CJM/Text-Wrapper-1.03.tar.gz ok

Scanning cache /root/.cpan/build for sizes
Text-Wrapper-1.03/
Text-Wrapper-1.03/README
Text-Wrapper-1.03/Changes
Text-Wrapper-1.03/LICENSE
Text-Wrapper-1.03/MANIFEST
Text-Wrapper-1.03/META.yml
Text-Wrapper-1.03/META.json
Text-Wrapper-1.03/t/
Text-Wrapper-1.03/t/00-load.t
Text-Wrapper-1.03/t/20-unicode.t
Text-Wrapper-1.03/t/10-wrapper.t
Text-Wrapper-1.03/t/00-all_prereqs.t
Text-Wrapper-1.03/t/release-pod-syntax.t
Text-Wrapper-1.03/t/release-pod-coverage.t
Text-Wrapper-1.03/Makefile.PL
Text-Wrapper-1.03/lib/
Text-Wrapper-1.03/lib/Text/
Text-Wrapper-1.03/lib/Text/Wrapper.pm
Text-Wrapper-1.03/example/
Text-Wrapper-1.03/example/gettysburg.pl
Removing previously used /root/.cpan/build/Text-Wrapper-1.03

  CPAN.pm: Going to build C/CJ/CJM/Text-Wrapper-1.03.tar.gz

*Perl v5.10.0 required--this is only v5.8.8, stopped at Makefile.PL line 5.*
BEGIN failed--compilation aborted at Makefile.PL line 5.
Running make test
  Make had some problems, maybe interrupted? Won't test
Running make install
  Make had some problems, maybe interrupted? Won't install

cpan>




El 23/04/12 18:03, Kevin Falcone escribió:

On Mon, Apr 23, 2012 at 04:39:17PM +0200, Jacobo Urdiales wrote:

Actually on centos5 perl 5.8.8 is installed using yum. But there is
a cpan library with is not working with versions older than 5.10 so
i had to download and compile 5.14.

RT should install just fine against 5.8.8, but obviously a newer perl
is nicer to have an easier to maintain.


So after the cpan and dependancies nightmare not sure if any package
is still pointing to the old perl...

mod_perl is compiled into apache and judging from your error messages
is clearly pointing to 5.8.8


The system is going to have just 30 requests a month or so. So I do
not think using cgi would be a problem.

fastcgi, not cgi.
You can read about the two fastcgi solutions (mod_fastcgi and
mod_fcgid) in docs/web_deployment.pod

-kevin


El 23/04/12 16:30, Kevin Falcone escribió:

On Mon, Apr 23, 2012 at 01:19:09PM +0200, Jacobo Urdiales wrote:

But upon restarting apache i get this error

Can't locate Plack/Handler/Apache2.pm in @INC (@INC contains:
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .
/etc/httpd) at /etc/httpd/conf.d/rt.conf line 11.\nBEGIN
failed--compilation aborted\t(in cleanup) Can't locate
Plack/Handler/Apache2.pm in @INC (@INC contains:
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .
/etc/httpd) at /etc/httpd/conf.d/rt.conf line 11.\nBEGIN
failed--compilation aborted at /etc/httpd/conf.d/rt.conf line 11.\n

The point is that I installed perl version 5.14 and compiled rt eith
that also installed the modules under that version. But I do not
know why seems that apache or whatever has the old path.
Tried to modify (even copy) the path contents to old locations but
more errors rise..

Did you compile apache/mod_perl with 5.14 or are you using vendor
packages that still point to the 5.8 install?

If you want to use your own perl build, fastcgi will be easier.

-kevin


[rt-users] One more Question About LDAP Import Extension

2012-04-23 Thread Scott Pestana

All,
We are happy with LDAP Import, with the following mapping:

Set($LDAPMapping, { 'Name' => 'uid',
'EmailAddress' => 'mail',
'RealName' => 'cn',
'ExternalAuthId' => 'uid',
'Gecos' => 'gecos'
}
);

We're trying to figure out though; which is the key RT checks to 
see if users already exist?  When running in debug mode we get this output:


Processing user spestana
User spestana already exists as 494, skipping
Imported 38/48 users

But there's no way of knowing if that's the Name, or the 
ExternalAuthId.  Can you give us some insight here? Right now, my 
inspection of the code has me feeling this defaults to the first field 
listed by the LDAPMapping.


--
N. Scott Pestana
IT Infrastructure
Linguamatics
275 Grove Street, Suite 2-400
Newton, MA 02466

Tel: +1-774-571-7135

US Tel: +1-617-674-3256
UK Tel: 011-44-1223-421360
UK Fax: 011-44-1223-421361
Web: www.linguamatics.com



Re: [rt-users] Can't locate Plack/Handler/Apache2.pm

2012-04-23 Thread Kevin Falcone
On Mon, Apr 23, 2012 at 04:39:17PM +0200, Jacobo Urdiales wrote:
> Actually on centos5 perl 5.8.8 is installed using yum. But there is
> a cpan library with is not working with versions older than 5.10 so
> i had to download and compile 5.14.

RT should install just fine against 5.8.8, but obviously a newer perl
is nicer to have an easier to maintain.

> So after the cpan and dependancies nightmare not sure if any package
> is still pointing to the old perl...

mod_perl is compiled into apache and judging from your error messages
is clearly pointing to 5.8.8

> The system is going to have just 30 requests a month or so. So I do
> not think using cgi would be a problem.

fastcgi, not cgi.
You can read about the two fastcgi solutions (mod_fastcgi and
mod_fcgid) in docs/web_deployment.pod

-kevin

> El 23/04/12 16:30, Kevin Falcone escribió:
> >On Mon, Apr 23, 2012 at 01:19:09PM +0200, Jacobo Urdiales wrote:
> >>But upon restarting apache i get this error
> >>
> >>Can't locate Plack/Handler/Apache2.pm in @INC (@INC contains:
> >>/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
> >>/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
> >>/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
> >>/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl
> >>/usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .
> >>/etc/httpd) at /etc/httpd/conf.d/rt.conf line 11.\nBEGIN
> >>failed--compilation aborted\t(in cleanup) Can't locate
> >>Plack/Handler/Apache2.pm in @INC (@INC contains:
> >>/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
> >>/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
> >>/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
> >>/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl
> >>/usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .
> >>/etc/httpd) at /etc/httpd/conf.d/rt.conf line 11.\nBEGIN
> >>failed--compilation aborted at /etc/httpd/conf.d/rt.conf line 11.\n
> >>
> >>The point is that I installed perl version 5.14 and compiled rt eith
> >>that also installed the modules under that version. But I do not
> >>know why seems that apache or whatever has the old path.
> >>Tried to modify (even copy) the path contents to old locations but
> >>more errors rise..
> >Did you compile apache/mod_perl with 5.14 or are you using vendor
> >packages that still point to the 5.8 install?
> >
> >If you want to use your own perl build, fastcgi will be easier.
> >
> >-kevin


pgpZzH16xD4cm.pgp
Description: PGP signature


[rt-users] Custom field questions… (Permissions, Viewing, and Hiding)

2012-04-23 Thread johnathan.bell
-1-

Maybe I'm going about it the wrong way, but I'm trying to create a custom field 
that is "internal use only". The idea is that we have one massive queue for 
everything, and then a helpdesk triages the requests, and then modifies this 
field to the appropriate department, who then picks up the ticket based on 
department and location.

However, it doesn't make sense for someone to edit this value from the 
selfservice page, as they may not know the appropriate department to route the 
request to, so how can I restrict access to this field? I tried making it so 
that only privileged users can see it (via the custom field rights), but that 
doesn't seem to have any effect. Also ticked and unticked the box from the 
queue properties, but that too seems to do nothing. Am I doing something wrong?

-2-

Is there a way that I can only show custom fields in the "The Basics" info box 
if users are privileged? In this case, I want to restrict viewing of some 
linked data displaying use directory information to be viewed only by 
privileged users. Once again, the permissions don't seem to have any effect.

-3-

Lastly, on the self-service form, is there a way to show/hide a text box based 
on the selection(s) in other select boxes? The idea is that I have several 
selection boxes that allow you to pick different topics regarding the ticket. 
However, on each selection, there's an "other" as well. To that end, I've added 
a box to allow users to explain their "other". Is there a straighforward way of 
making the form hide this "other" box until it has the context to display it.

---

I believe I could modify these changes into RT via an overlay, but I'd rather 
go for a more dynamic solution storing this information in the database, or 
configuring RT in such a way that it behaves like I want it to…

Thanks,
Johnathan

--
Johnathan Bell
Internet System Administrator, Baker College
Office Hours: 7A-4P Eastern, M-F



Re: [rt-users] OnCreate (except if reminder)

2012-04-23 Thread Tony Atkinson
On 23/04/12 16:07, Kevin Falcone wrote:
> I'm amazed that code ever worked, it's doing numerical comparison of
> strings (eq and ne vs == and !=).

Ah-ha, thanks
(damn perl, just has to do things differently to bash... ;)

-- 
Tony Atkinson

Office: 01375 398111
Mobile: 07939 997369
PGP: D9D5DA10

Datapro Services Limited
2 High Street, Grays,
Essex. RM17 6LU
www.dataproservices.co.uk
Company No: 3478926
Vat No: 714 5668 24



signature.asc
Description: OpenPGP digital signature


Re: [rt-users] OnCreate (except if reminder)

2012-04-23 Thread Kevin Falcone
On Mon, Apr 23, 2012 at 02:43:09PM +0100, Tony Atkinson wrote:
> Hello,
> I'm looking for help with a custom scrip
> 
> The scrip that notifies AdminCCs on create is also triggered by
> reminders - which I'm looking to stop
> 
> I found this, which is exactly what I'm wanting
> http://lists.bestpractical.com/pipermail/rt-users/2009-December/062565.html
> 
> > my $trans = $self->TransactionObj;
> > my $ticket = $self->TicketObj;
> > return 0 unless $trans->Type == 'Create';
> > return 0 unless $ticket->Type != 'reminder';
> > return 1;
> 
> But the custom code doesn't seem to work (completely disables AdminCC
> notifications)
> It was written in 2009, so I'm guessing something has changed in the API?
> 
> Can anyone point me to the right way of doing
> "On create, except for reminders, notify AdminCCs"

I'm amazed that code ever worked, it's doing numerical comparison of
strings (eq and ne vs == and !=).

You can read more about them in perldoc perlop, but a straight swap
should be enough, although I might phrase the second check
differently.

-kevin


pgpLfFKDJsSwo.pgp
Description: PGP signature


Re: [rt-users] Creating a ticket with attachment in PHP

2012-04-23 Thread Guillaume Hilt

I hope so because I didn't find anything.

I'm still digging and now I'm sending this kind of request to RT :

HttpRequest Object
(
[options:HttpRequest:private] =>
[postFields:HttpRequest:private] =>  Array
(
[content] =>  id: 56
Action: comment
Text: Fichier joint
Attachment: ftp_networth.jpg

--uploadfichiersupport--
[attachment_1] =>  filename: ftp_networth.jpg
Content-Type: image/jpeg

ÿØÿà  (file content)

Request Content-Type is set to "multipart/form-data; 
boundary=uploadfichiersupport".


I'm trying to find my way using the VB.net example.

  Guillaume Hilt


Le 23/04/2012 16:29, Kevin Falcone a écrit :

On Mon, Apr 23, 2012 at 12:09:20PM +0200, Guillaume Hilt wrote:

Ok, so i'm trying to comment an existing ticket with an attachment :

  "id: " . $ticket_id .
"\nAction: comment\nText: Fichier joint\nAttachment: " .
$_FILES['uploadedfile']['name'] . "\nattachment_1: " .
file_get_contents( $_FILES['uploadedfile']['tmp_name'] ) . "\n" );

//Second way : i'm adding the attachment using postfile
$post_data  = array( 'content' =>  "id: " . $ticket_id .
"\nAction: comment\nText: Fichier joint\n" );
$request->addPostFields( $post_data );

$request->addPostFile( $_FILES['uploadedfile']['name'],
file_get_contents( $_FILES['uploadedfile']['tmp_name'] ) );
$result = $request->send();

?>

Either way, it doesn't work.

First way gives me a syntax error :

HttpMessage Object
(
 [type:protected] =>   2
 [body:protected] =>   RT/3.8.10 409 Syntax Error

# Syntax error.

id: 48
Action: comment
Text: Fichier joint
Attachment: ftp_networth.jpg
attachment_1: \xFF\xD8\xFF\xE0 JFIF  ` `  \xFF\xE1\xE8Exif  MM *    ; 

#K-\xB4\xF3\xE5<\xC5d\xC90\xAA\x9D\xCA\xDF+60pGKY^!\xD1cÖ¡\xB5\xFF 
J\xB9\xB2\xBB\xB4\x9B\xED\xB7v\xDB


Second way gives me this error :
PHP Fatal error:  Uncaught exception 'HttpInvalidParamException'
with message 'Empty or too short HTTP message

What am i doing wrong ?

I searched in this list archive and google but I didn't find any
example on how to send an attachment with PHP and the API.

There are tests for this, so I know it works, I suggest using the
bin/rt command line client in debug mode to see what it sends over the
wire.  Otherwise, numerous people have used PHP/Python/Ruby/Java to
talk to the REST api so perhaps someone will volunteer some sample
code.

-kevin


Re: [rt-users] Can't locate Plack/Handler/Apache2.pm

2012-04-23 Thread Jacobo Urdiales

Hi Kevin,
Actually on centos5 perl 5.8.8 is installed using yum. But there is a 
cpan library with is not working with versions older than 5.10 so i had 
to download and compile 5.14.


So after the cpan and dependancies nightmare not sure if any package is 
still pointing to the old perl...


The system is going to have just 30 requests a month or so. So I do not 
think using cgi would be a problem.


Can you tell me what to touch or move to use it?


Regards,

Jacobo

PD: Thanks for your help!

El 23/04/12 16:30, Kevin Falcone escribió:

On Mon, Apr 23, 2012 at 01:19:09PM +0200, Jacobo Urdiales wrote:

But upon restarting apache i get this error

Can't locate Plack/Handler/Apache2.pm in @INC (@INC contains:
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .
/etc/httpd) at /etc/httpd/conf.d/rt.conf line 11.\nBEGIN
failed--compilation aborted\t(in cleanup) Can't locate
Plack/Handler/Apache2.pm in @INC (@INC contains:
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .
/etc/httpd) at /etc/httpd/conf.d/rt.conf line 11.\nBEGIN
failed--compilation aborted at /etc/httpd/conf.d/rt.conf line 11.\n

The point is that I installed perl version 5.14 and compiled rt eith
that also installed the modules under that version. But I do not
know why seems that apache or whatever has the old path.
Tried to modify (even copy) the path contents to old locations but
more errors rise..

Did you compile apache/mod_perl with 5.14 or are you using vendor
packages that still point to the 5.8 install?

If you want to use your own perl build, fastcgi will be easier.

-kevin


Re: [rt-users] Can't locate Plack/Handler/Apache2.pm

2012-04-23 Thread Kevin Falcone
On Mon, Apr 23, 2012 at 01:19:09PM +0200, Jacobo Urdiales wrote:
> But upon restarting apache i get this error
> 
> Can't locate Plack/Handler/Apache2.pm in @INC (@INC contains:
> /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
> /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
> /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
> /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl
> /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .
> /etc/httpd) at /etc/httpd/conf.d/rt.conf line 11.\nBEGIN
> failed--compilation aborted\t(in cleanup) Can't locate
> Plack/Handler/Apache2.pm in @INC (@INC contains:
> /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
> /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
> /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
> /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl
> /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .
> /etc/httpd) at /etc/httpd/conf.d/rt.conf line 11.\nBEGIN
> failed--compilation aborted at /etc/httpd/conf.d/rt.conf line 11.\n
> 
> The point is that I installed perl version 5.14 and compiled rt eith
> that also installed the modules under that version. But I do not
> know why seems that apache or whatever has the old path.
> Tried to modify (even copy) the path contents to old locations but
> more errors rise..

Did you compile apache/mod_perl with 5.14 or are you using vendor
packages that still point to the 5.8 install?

If you want to use your own perl build, fastcgi will be easier.

-kevin


pgpeDDB2U4T1o.pgp
Description: PGP signature


Re: [rt-users] Creating a ticket with attachment in PHP

2012-04-23 Thread Kevin Falcone
On Mon, Apr 23, 2012 at 12:09:20PM +0200, Guillaume Hilt wrote:
> Ok, so i'm trying to comment an existing ticket with an attachment :
> 
>  
> $request= new HttpRequest( $conf['rt']['url'] .
> '/REST/1.0/ticket/' . $ticket_id . '/comment?user=' .
> $conf['rt']['user'] . '&pass=' . $conf['rt']['password'],
> HTTP_METH_POST );
> 
> // First way : attachment is directly in the request content
> $post_data  = array( 'content' => "id: " . $ticket_id .
> "\nAction: comment\nText: Fichier joint\nAttachment: " .
> $_FILES['uploadedfile']['name'] . "\nattachment_1: " .
> file_get_contents( $_FILES['uploadedfile']['tmp_name'] ) . "\n" );
> 
> //Second way : i'm adding the attachment using postfile
> $post_data  = array( 'content' => "id: " . $ticket_id .
> "\nAction: comment\nText: Fichier joint\n" );
> $request->addPostFields( $post_data );
> 
> $request->addPostFile( $_FILES['uploadedfile']['name'],
> file_get_contents( $_FILES['uploadedfile']['tmp_name'] ) );
> $result = $request->send();
> 
> ?>
> 
> Either way, it doesn't work.
> 
> First way gives me a syntax error :
> 
> HttpMessage Object
> (
> [type:protected] =>  2
> [body:protected] =>  RT/3.8.10 409 Syntax Error
> 
> # Syntax error.
> 
> id: 48
> Action: comment
> Text: Fichier joint
> Attachment: ftp_networth.jpg
> attachment_1: \xFF\xD8\xFF\xE0 JFIF  ` `  \xFF\xE1\xE8Exif  MM *    ; 
> 
> 
> #K-\xB4\xF3\xE5<\xC5d\xC90\xAA\x9D\xCA\xDF+60pGKY^!\xD1cÖ¡\xB5\xFF 
> J\xB9\xB2\xBB\xB4\x9B\xED\xB7v\xDB
> 
> 
> Second way gives me this error :
> PHP Fatal error:  Uncaught exception 'HttpInvalidParamException'
> with message 'Empty or too short HTTP message
> 
> What am i doing wrong ?
> 
> I searched in this list archive and google but I didn't find any
> example on how to send an attachment with PHP and the API.

There are tests for this, so I know it works, I suggest using the
bin/rt command line client in debug mode to see what it sends over the
wire.  Otherwise, numerous people have used PHP/Python/Ruby/Java to
talk to the REST api so perhaps someone will volunteer some sample
code.

-kevin


pgpQBtJ32KCYj.pgp
Description: PGP signature


Re: [rt-users] schema of the mysql-database suitable to RT 4.0.5

2012-04-23 Thread Kevin Falcone
On Mon, Apr 23, 2012 at 12:46:00PM +0200, Joerg Hollandmoritz wrote:
> Hi!
> 
> I created a new database; then I imported the data from a former
> version. After that I made all the updates (schema,...) like described
> below.
> make upgrade-database
> · upgrading from 3.6.3 => 
> ___
> /usr/bin/perl -I/opt/helpdesk/local/lib -I/opt/helpdesk/lib
> sbin/rt-setup-database --action upgrade --prompt-for-dba-password
> In order to create or update your RT database, this script needs to
> connect to your mysql instance on localhost as root
> Please specify that user's database password below. If the user has no
> database
> password, just press return.
> 
> Password: 
> Working with:
> Type:   mysql
> Host:   localhost
> Name:   DV_rt
> User:   dvATmysql
> DBA:root
> Enter RT version you're upgrading from: 3.6.3
> No DB changes since 3.6.3.

This is wrong, there are a ton of changes since 3.6.3.
Where are you running the command from?  You're support to run it from
the unpacked RT tarball.

Your selects below demonstrate that the length of the password field
is still insufficient.

You also don't appear to have run any of the other upgrade steps
between 3.6 and 4.0 that I pointed out in my earlier email, this
includes a vitally important characterset change between 3.6 and 3.8.
I've called out the note from before:

> > need to read and follow all other upgrade steps in docs/UPGRADING 3.6
> > 3.8 and 4.0 as well as paying particular attention to
> > docs/UPGRADING.mysql

You may find the blog post on upgrading useful
http://blog.bestpractical.com/2011/07/upgrading-to-rt-4.html

-kevin


pgprAYeRBZn8g.pgp
Description: PGP signature


[rt-users] OnCreate (except if reminder)

2012-04-23 Thread Tony Atkinson
Hello,
I'm looking for help with a custom scrip

The scrip that notifies AdminCCs on create is also triggered by
reminders - which I'm looking to stop

I found this, which is exactly what I'm wanting
http://lists.bestpractical.com/pipermail/rt-users/2009-December/062565.html

> my $trans = $self->TransactionObj;
> my $ticket = $self->TicketObj;
> return 0 unless $trans->Type == 'Create';
> return 0 unless $ticket->Type != 'reminder';
> return 1;

But the custom code doesn't seem to work (completely disables AdminCC
notifications)
It was written in 2009, so I'm guessing something has changed in the API?

Can anyone point me to the right way of doing
"On create, except for reminders, notify AdminCCs"

-- 
Tony Atkinson

Office: 01375 398111
Mobile: 07939 997369
PGP: D9D5DA10

Datapro Services Limited
2 High Street, Grays,
Essex. RM17 6LU
www.dataproservices.co.uk
Company No: 3478926
Vat No: 714 5668 24


[rt-users] populate other custom fields from autocomplete custom field

2012-04-23 Thread jiten
I have three custom fields:
1. Employee name (automcomplete)
2. Employee id (not visible to users)
3. Business unit

The users will type in the employee name partially and get suggestions and
complete the name using the suggestions. I have this part working.

I understand that I will have to customize the code and am happy to do
that.
What I want to make happen is that the employee id and business unit of
that employee be automatically set when employee is selected. What is the
best approach for this and what files would I need to modify?


Re: [rt-users] Can't locate Plack/Handler/Apache2.pm

2012-04-23 Thread Stephen J Alexander
The following is from a perl guy perspective (I'm no expert with RT). I
don't remember what options are available during build and install, but in
the source files it looks like /usr/bin/perl is hardcoded. So unless there
is a simpler way I don't know about, you would need to change them to point
to /usr/local/bin/perl (or whatever path you've installed the new perl on).

The files that call /usr/bin/perl within my RT installation are:
./bin/rt-mailgate
./bin/importusers.pl
./bin/rt
./bin/rt-crontool
./sbin/rt-email-group-admin
./sbin/rt-server
./sbin/rt-setup-database
./sbin/rt-setup-fulltext-index
./sbin/rt-shredder
./sbin/rt-attributes-viewer
./sbin/rt-email-dashboards
./sbin/rt-session-viewer
./sbin/standalone_httpd
./sbin/rt-preferences-viewer
./sbin/rt-server.fcgi
./sbin/rt-clean-sessions
./sbin/rt-test-dependencies
./sbin/rt-dump-metadata
./sbin/rt-validator
./sbin/rt-fulltext-indexer
./sbin/rt-email-digest

As I mentioned in a previous post, it's a bad idea to mix your perl
environments, so you may want, at a minimum, to 'yum reinstall perl' so
that your distro perl doesn't cause you headaches later.

Regards,

Stephen J Alexander
MPBX, LLC
http://mpbx.com
832-713-6729


On Mon, Apr 23, 2012 at 6:19 AM, Jacobo Urdiales
wrote:

> Hi all,
> I am trying to install RT 4.0.5 con a Centos 5
> Have gone through all the install steps (even the perl cpan stuff...) and
> build the database under Mysql.
> Now I have created a file in /etc/httpd/conf.d/rt.conf with the following
> stuff
>
> 
>  # Optional apache logs for RT
>  # ErrorLog /opt/rt4/var/log/apache2.error
>  # TransferLog /opt/rt4/var/log/apache2.**access
>  # LogLevel debug
>
>  AddDefaultCharset UTF-8
>  DocumentRoot "/opt/rt4/share/html"
>
>  
>  Order allow,deny
>  Allow from all
>
>  SetHandler modperl
>  PerlResponseHandler Plack::Handler::Apache2
>  PerlSetVar psgi_app /opt/rt4/sbin/rt-server
>  
>  
>  use Plack::Handler::Apache2;
>  Plack::Handler::Apache2->**preload("/opt/rt4/sbin/rt-**
> server");
>  
> 
>
> But upon restarting apache i get this error
>
> Can't locate Plack/Handler/Apache2.pm in @INC (@INC contains:
> /usr/lib/perl5/site_perl/5.8.**8/i386-linux-thread-multi
> /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
> /usr/lib/perl5/vendor_perl/5.**8.8/i386-linux-thread-multi
> /usr/lib/perl5/vendor_perl/5.**8.8 /usr/lib/perl5/vendor_perl
> /usr/lib/perl5/5.8.8/i386-**linux-thread-multi /usr/lib/perl5/5.8.8 .
> /etc/httpd) at /etc/httpd/conf.d/rt.conf line 11.\nBEGIN
> failed--compilation aborted\t(in cleanup) Can't locate
> Plack/Handler/Apache2.pm in @INC (@INC contains:
> /usr/lib/perl5/site_perl/5.8.**8/i386-linux-thread-multi
> /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
> /usr/lib/perl5/vendor_perl/5.**8.8/i386-linux-thread-multi
> /usr/lib/perl5/vendor_perl/5.**8.8 /usr/lib/perl5/vendor_perl
> /usr/lib/perl5/5.8.8/i386-**linux-thread-multi /usr/lib/perl5/5.8.8 .
> /etc/httpd) at /etc/httpd/conf.d/rt.conf line 11.\nBEGIN
> failed--compilation aborted at /etc/httpd/conf.d/rt.conf line 11.\n
>
> The point is that I installed perl version 5.14 and compiled rt eith that
> also installed the modules under that version. But I do not know why seems
> that apache or whatever has the old path.
> Tried to modify (even copy) the path contents to old locations but more
> errors rise..
>
> Can you help me?
>
>
>


[rt-users] Can't locate Plack/Handler/Apache2.pm

2012-04-23 Thread Jacobo Urdiales

Hi all,
I am trying to install RT 4.0.5 con a Centos 5
Have gone through all the install steps (even the perl cpan stuff...) 
and build the database under Mysql.
Now I have created a file in /etc/httpd/conf.d/rt.conf with the 
following stuff



  # Optional apache logs for RT
  # ErrorLog /opt/rt4/var/log/apache2.error
  # TransferLog /opt/rt4/var/log/apache2.access
  # LogLevel debug

  AddDefaultCharset UTF-8
  DocumentRoot "/opt/rt4/share/html"

  
  Order allow,deny
  Allow from all

  SetHandler modperl
  PerlResponseHandler Plack::Handler::Apache2
  PerlSetVar psgi_app /opt/rt4/sbin/rt-server
  
  
  use Plack::Handler::Apache2;
  Plack::Handler::Apache2->preload("/opt/rt4/sbin/rt-server");
  


But upon restarting apache i get this error

Can't locate Plack/Handler/Apache2.pm in @INC (@INC contains: 
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi 
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi 
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl 
/usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 . 
/etc/httpd) at /etc/httpd/conf.d/rt.conf line 11.\nBEGIN 
failed--compilation aborted\t(in cleanup) Can't locate 
Plack/Handler/Apache2.pm in @INC (@INC contains: 
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi 
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi 
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl 
/usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 . 
/etc/httpd) at /etc/httpd/conf.d/rt.conf line 11.\nBEGIN 
failed--compilation aborted at /etc/httpd/conf.d/rt.conf line 11.\n


The point is that I installed perl version 5.14 and compiled rt eith 
that also installed the modules under that version. But I do not know 
why seems that apache or whatever has the old path.
Tried to modify (even copy) the path contents to old locations but more 
errors rise..


Can you help me?




Re: [rt-users] schema of the mysql-database suitable to RT 4.0.5

2012-04-23 Thread Joerg Hollandmoritz
Hi!

I created a new database; then I imported the data from a former
version. After that I made all the updates (schema,...) like described
below.
make upgrade-database
· upgrading from 3.6.3 => 
___
/usr/bin/perl -I/opt/helpdesk/local/lib -I/opt/helpdesk/lib
sbin/rt-setup-database --action upgrade --prompt-for-dba-password
In order to create or update your RT database, this script needs to
connect to your mysql instance on localhost as root
Please specify that user's database password below. If the user has no
database
password, just press return.

Password: 
Working with:
Type:   mysql
Host:   localhost
Name:   DV_rt
User:   dvATmysql
DBA:root
Enter RT version you're upgrading from: 3.6.3
No DB changes since 3.6.3.
Done.
___

The RT 4.0.5 seems to be working, but two problems persist:

1) The user root possesses the password
root3134336162623631346331366434373832623763613966303536646135663463 
After looging in the password changed

to  
21736861353132214952642f71666a37334a427153414a5a2149626b534f507850704669786c6b38
{it's not usable}

2) When I wanted to change the owner of a ticket I get the message:
"Ergebnisse      * Konnte Besitzer nicht ändern:"
 [Can't change owner]

The access-log says:
ip.ip.ip.ip - - [23/Apr/2012:11:53:37 +0200] "GET
/Ticket/ModifyAll.html?id=18895 HTTP/1.1" 200 7340
ip.ip.ip.ip - - [23/Apr/2012:11:53:50 +0200] "POST
/Ticket/ModifyAll.html HTTP/1.1" 200 7458 

Can you give me some hints ?

Best 

  George


Am Fr 20.04.2012 15:04 schrieb Kevin Falcone
:

> Please keep list mail on the list.
> 
> On Fri, Apr 20, 2012 at 09:36:39AM +0200, Joerg Hollandmoritz wrote:
> > As I mentioned already we have a fresh installation of RT 4.0.5.
> > with
> > only importing data from a former version. This was handled via
> > mysql-export at the old version (3.6.3) and mysql-import in the new
> > version (phpmyadmin).
> > Then I made the following:
> > " root@ultra:/opt/helpdesk.tmp# make upgrade-database
> > /usr/bin/perl -I/opt/helpdesk/local/lib -I/opt/helpdesk/lib
> > sbin/rt-setup-database --action upgrade --prompt-for-dba-password
> > In order to create or update your RT database, this script needs to
> > connect to your mysql instance on localhost as root
> > Please specify that user's database password below. If the user has
> > no
> > database
> > password, just press return.
> > 
> > Password: 
> > Working with:
> > Type:   mysql
> > Host:   localhost
> > Name:   DV_rt
> > User:   dvATmysql
> > DBA:root
> > Enter RT version you're upgrading from: 4.0.5
> > The version 4.0.5 you're upgrading to is up to date.
> > Done. "
> > 
> > How can I see the version of the schema of the mysql-database?
> > How can I get the mysql-database properly running with RT ?
> 
> The command asked what version you're upgrading from, which you say is
> 3.6.3.  You'll need to enter that at the prompt.  You'll also
> need to read and follow all other upgrade steps in docs/UPGRADING 3.6
> 3.8 and 4.0 as well as paying particular attention to
> docs/UPGRADING.mysql
> 
> -kevin



Re: [rt-users] Creating a ticket with attachment in PHP

2012-04-23 Thread Guillaume Hilt

Ok, so i'm trying to comment an existing ticket with an attachment :

$request= new HttpRequest( $conf['rt']['url'] . 
'/REST/1.0/ticket/' . $ticket_id . '/comment?user=' . 
$conf['rt']['user'] . '&pass=' . $conf['rt']['password'], HTTP_METH_POST );


// First way : attachment is directly in the request content
$post_data  = array( 'content' => "id: " . $ticket_id . "\nAction: 
comment\nText: Fichier joint\nAttachment: " . 
$_FILES['uploadedfile']['name'] . "\nattachment_1: " . 
file_get_contents( $_FILES['uploadedfile']['tmp_name'] ) . "\n" );


//Second way : i'm adding the attachment using postfile
$post_data  = array( 'content' => "id: " . $ticket_id . "\nAction: 
comment\nText: Fichier joint\n" );

$request->addPostFields( $post_data );

$request->addPostFile( $_FILES['uploadedfile']['name'], 
file_get_contents( $_FILES['uploadedfile']['tmp_name'] ) );

$result = $request->send();

?>

Either way, it doesn't work.

First way gives me a syntax error :

HttpMessage Object
(
[type:protected] =>  2
[body:protected] =>  RT/3.8.10 409 Syntax Error

# Syntax error.

id: 48
Action: comment
Text: Fichier joint
Attachment: ftp_networth.jpg
attachment_1: \xFF\xD8\xFF\xE0 JFIF  ` `  \xFF\xE1\xE8Exif  MM *    ; 

#K-\xB4\xF3\xE5<\xC5d\xC90\xAA\x9D\xCA\xDF+60pGKY^!\xD1cÖ¡\xB5\xFF 
J\xB9\xB2\xBB\xB4\x9B\xED\xB7v\xDB


Second way gives me this error :
PHP Fatal error:  Uncaught exception 'HttpInvalidParamException' with 
message 'Empty or too short HTTP message


What am i doing wrong ?

I searched in this list archive and google but I didn't find any example 
on how to send an attachment with PHP and the API.


Regards,

  Guillaume Hilt


Le 21/04/2012 10:13, Guillaume Hilt a écrit :

Thanks.
I didn't know there was a way to search into the archive. It's really 
useful.


  Guillaume Hilt


Le 19/04/2012 14:54, Kevin Falcone a écrit :

On Wed, Apr 18, 2012 at 11:57:20AM +0200, Guillaume Hilt wrote:

I'm using RT 3.8.1 and REST API in PHP.

I'm creating a ticket this way :
$request= new HttpRequest( $conf['rt']['url'] .
'/REST/1.0/ticket/new?user=' . $conf['rt']['user'] .'&pass=' .
$conf['rt']['password'], HTTP_METH_POST );
$rt_queue   =
$conf['rt']['languages'][$conf['rt']['fallback_language']];
$post_data  = array( 'content' =>  "Queue: " . $rt_queue .
"\nRequestor: " . $_SESSION['customer']['login'] . "\nCF-OS: " .
$_POST['os'] . "\nSubject: " . $_POST['subject'] . "\nOwner: " .
$_SESSION['customer']['login'] . "\nText: " . str_replace( "\n", "\n
", $_POST['message'] ) . "\n" );
$request->addPostFields( $post_data );
$request->send();

It works well.

Now i'm trying to add an attachment.

I tried to add "attachment_1: my file content" to my post data but
it doesn't work.

What's the way to attach a file to a ticket using PHP ?

If you search the mailing list archives, you'll find that you can't
create a ticket with an attachment via the REST api, only
reply/comment with an attachment.  I believe there is already a ticket
open about it.

-kevin




[rt-users] External auth: set default user options

2012-04-23 Thread Mario Giammarco
Hello,
I am successfully using external auth to autocreate and autenticate users.

I have a problem now: I need (obviously) to set some defaults like language, 
queue, some permissions.

It seems to me that there is no easy way to do it and I cannot find 
documentation.

It seems strange to me because I suppose this it a very common thing.

Can you help me?

Thanks in advance for any help,

Mario