Bug: Signature's with RT2

If you change your signature to something it works fine.
Now try to make your signature empty and submit the page. It returns with
the signature set to what it was before. There appears to be no way to
remove the signature once you have set it.

Using (I think) RT 2.0.4…

That appears to be an oversight, it works in Configuration->Users.

Here’s a patch which gives a checkbox option to clear the signature.

-Feargal.

— src/rt-2-0-4/webrt/User/Prefs.html Mon May 14 02:15:27 2001
+++ /usr/local/rt2/WebRT/html/User/Prefs.html Mon Jul 30 09:18:44 2001
@@ -13,6 +13,7 @@

<% $session{‘CurrentUser’}->UserObj->Signature %>


+Clear Signature


<& /Elements/TitleBoxEnd &>
<& /Elements/Submit &>
@@ -31,13 +32,18 @@
push (@results, "Password: ".$msg);
}
}
-if ($Signature) {

  • $Signature =~ s/(\r\n|\r)/\n/g;
  • if ($Signature ne $session{‘CurrentUser’}->UserObj->Signature) {
    +if ($ClearSignature == 1) {
  • my ($val, $msg)=$session{‘CurrentUser’}->UserObj->SetSignature(’’);
  • push (@results, "Signature: ".$msg);
    +}
    +elsif ($Signature) {
  •   $Signature =~ s/(\r\n|\r)/\n/g;
    
  •   if ($Signature ne $session{'CurrentUser'}->UserObj->Signature) {
    
    my ($val, $msg)=$session{‘CurrentUser’}->UserObj->SetSignature($Signature);
    push (@results, "Signature: ".$msg);
    }
    }
    +push (@results, "Clear: ".$ClearSignature);
    #A hack to make sure that session gets rewritten.

$session{‘i’}++;
@@ -47,4 +53,5 @@
$Signature => undef
$NewPass1 => undef
$NewPass2 => undef
+$ClearSignature => undef
</%ARGS>On Sat, 28 Jul 2001 21:40:57 -0500 (CDT) Sanity sanity@fretzel.net wrote:

If you change your signature to something it works fine.
Now try to make your signature empty and submit the page. It returns with
the signature set to what it was before. There appears to be no way to
remove the signature once you have set it.

Using (I think) RT 2.0.4…


Rt-devel mailing list
Rt-devel@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-devel

Feargal Reilly,
Systems Administrator,
The CIA.

prefs.diff (1.2 KB)

Ahem.

I sent the wrong patch for this earlier - there’s a line which reads
push (@results, "Clear: ".$ClearSignature);
which isn’t required, it was there for debugging purposes.

The patch below is correct.

— src/rt-2-0-4/webrt/User/Prefs.html Mon May 14 02:15:27 2001
+++ /usr/local/rt2/WebRT/html/User/Prefs.html Mon Jul 30 14:04:39 2001
@@ -13,6 +13,7 @@

<% $session{‘CurrentUser’}->UserObj->Signature %>


+Clear Signature


<& /Elements/TitleBoxEnd &>
<& /Elements/Submit &>
@@ -31,9 +32,13 @@
push (@results, "Password: ".$msg);
}
}
-if ($Signature) {

  • $Signature =~ s/(\r\n|\r)/\n/g;
  • if ($Signature ne $session{‘CurrentUser’}->UserObj->Signature) {
    +if ($ClearSignature == 1) {
  • my ($val, $msg)=$session{‘CurrentUser’}->UserObj->SetSignature(’’);
  • push (@results, "Signature: ".$msg);
    +}
    +elsif ($Signature) {
  •   $Signature =~ s/(\r\n|\r)/\n/g;
    
  •   if ($Signature ne $session{'CurrentUser'}->UserObj->Signature) {
    
    my ($val, $msg)=$session{‘CurrentUser’}->UserObj->SetSignature($Signature);
    push (@results, "Signature: ".$msg);
    }
    @@ -47,4 +52,5 @@
    $Signature => undef
    $NewPass1 => undef
    $NewPass2 => undef
    +$ClearSignature => undef
    </%ARGS>

Feargal Reilly,
Systems Administrator,
The CIA.

prefs.diff (1.08 KB)

Thanks that fixed it!On Mon, 30 Jul 2001, Feargal Reilly wrote:

Ahem.

I sent the wrong patch for this earlier - there’s a line which reads
push (@results, "Clear: ".$ClearSignature);
which isn’t required, it was there for debugging purposes.

Here’s my patch for the same. The reason I prefer this implementation is
that it results in cleaner UI for the end-user…

Index: Prefs.html
RCS file: /raid/cvsroot/rt/webrt/User/Attic/Prefs.html,v
retrieving revision 1.1.2.8
diff -u -r1.1.2.8 Prefs.html
— Prefs.html 2001/05/14 02:15:27 1.1.2.8
+++ Prefs.html 2001/08/02 07:56:14
@@ -10,7 +10,7 @@
<& /Elements/TitleBoxEnd &>


<& /Elements/TitleBoxStart, title => ‘Signature’ &>
+
<% $session{‘CurrentUser’}->UserObj->Signature %>




@@ -31,7 +31,7 @@
push (@results, "Password: ".$msg);
}
}
-if ($Signature) {
+if ($Signature || $SignatureMagic) {
$Signature =~ s/(\r\n|\r)/\n/g;
if ($Signature ne $session{‘CurrentUser’}->UserObj->Signature) {
my ($val, $msg)=$session{‘CurrentUser’}->UserObj->SetSignature($Signature);
@@ -45,6 +45,7 @@

<%ARGS>
$Signature => undef
+$SignatureMagic => undef
$NewPass1 => undef
$NewPass2 => undef
</%ARGS>On Mon, Jul 30, 2001 at 03:15:54PM +0100, Feargal Reilly wrote:

Ahem.

I sent the wrong patch for this earlier - there’s a line which reads
push (@results, "Clear: ".$ClearSignature);
which isn’t required, it was there for debugging purposes.

The patch below is correct.

— src/rt-2-0-4/webrt/User/Prefs.html Mon May 14 02:15:27 2001
+++ /usr/local/rt2/WebRT/html/User/Prefs.html Mon Jul 30 14:04:39 2001
@@ -13,6 +13,7 @@

<% $session{‘CurrentUser’}->UserObj->Signature %>


+Clear Signature


<& /Elements/TitleBoxEnd &>
<& /Elements/Submit &>
@@ -31,9 +32,13 @@
push (@results, "Password: ".$msg);
}
}
-if ($Signature) {

  • $Signature =~ s/(\r\n|\r)/\n/g;
  • if ($Signature ne $session{‘CurrentUser’}->UserObj->Signature) {
    +if ($ClearSignature == 1) {
  • my ($val, $msg)=$session{‘CurrentUser’}->UserObj->SetSignature(’’);
  • push (@results, "Signature: ".$msg);
    +}
    +elsif ($Signature) {
  • $Signature =~ s/(\r\n|\r)/\n/g;
    
  • if ($Signature ne $session{'CurrentUser'}->UserObj->Signature) {
    
    my ($val, $msg)=$session{‘CurrentUser’}->UserObj->SetSignature($Signature);
    push (@results, "Signature: ".$msg);
    }
    @@ -47,4 +52,5 @@
    $Signature => undef
    $NewPass1 => undef
    $NewPass2 => undef
    +$ClearSignature => undef
    </%ARGS>


Feargal Reilly,
Systems Administrator,
The CIA.

jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

Pelcgb-serrqbz abj!

Da. I’d actually started doing that, but I did something silly along the way, and ended up with the first solution.
I’d noticed that Admin/Users/Modify.html did it properly, but it did other funny things too.
I figured you’d get around to cleaning it up for the next commit… :)On Thu, 2 Aug 2001 03:57:39 -0400 Jesse jesse@fsck.com wrote:

Here’s my patch for the same. The reason I prefer this implementation is
that it results in cleaner UI for the end-user…

Index: Prefs.html

RCS file: /raid/cvsroot/rt/webrt/User/Attic/Prefs.html,v
retrieving revision 1.1.2.8
diff -u -r1.1.2.8 Prefs.html
— Prefs.html 2001/05/14 02:15:27 1.1.2.8
+++ Prefs.html 2001/08/02 07:56:14
@@ -10,7 +10,7 @@
<& /Elements/TitleBoxEnd &>


<& /Elements/TitleBoxStart, title => ‘Signature’ &>

+
<% $session{‘CurrentUser’}->UserObj->Signature %>




@@ -31,7 +31,7 @@
push (@results, "Password: ".$msg);
}
}
-if ($Signature) {
+if ($Signature || $SignatureMagic) {
$Signature =~ s/(\r\n|\r)/\n/g;
if ($Signature ne $session{‘CurrentUser’}->UserObj->Signature) {
my ($val, $msg)=$session{‘CurrentUser’}->UserObj->SetSignature($Signature);
@@ -45,6 +45,7 @@

<%ARGS>
$Signature => undef
+$SignatureMagic => undef
$NewPass1 => undef
$NewPass2 => undef
</%ARGS>

On Mon, Jul 30, 2001 at 03:15:54PM +0100, Feargal Reilly wrote:

Ahem.

I sent the wrong patch for this earlier - there’s a line which reads
push (@results, "Clear: ".$ClearSignature);
which isn’t required, it was there for debugging purposes.

The patch below is correct.

— src/rt-2-0-4/webrt/User/Prefs.html Mon May 14 02:15:27 2001
+++ /usr/local/rt2/WebRT/html/User/Prefs.html Mon Jul 30 14:04:39 2001
@@ -13,6 +13,7 @@

<% $session{‘CurrentUser’}->UserObj->Signature %>


+Clear Signature


<& /Elements/TitleBoxEnd &>
<& /Elements/Submit &>
@@ -31,9 +32,13 @@
push (@results, "Password: ".$msg);
}
}
-if ($Signature) {

  • $Signature =~ s/(\r\n|\r)/\n/g;
  • if ($Signature ne $session{‘CurrentUser’}->UserObj->Signature) {
    +if ($ClearSignature == 1) {
  • my ($val, $msg)=$session{‘CurrentUser’}->UserObj->SetSignature(’’);
  • push (@results, "Signature: ".$msg);
    +}
    +elsif ($Signature) {
  • $Signature =~ s/(\r\n|\r)/\n/g;
    
  • if ($Signature ne $session{'CurrentUser'}->UserObj->Signature) {
    
    my ($val, $msg)=$session{‘CurrentUser’}->UserObj->SetSignature($Signature);
    push (@results, "Signature: ".$msg);
    }
    @@ -47,4 +52,5 @@
    $Signature => undef
    $NewPass1 => undef
    $NewPass2 => undef
    +$ClearSignature => undef
    </%ARGS>


Feargal Reilly,
Systems Administrator,
The CIA.


jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

Pelcgb-serrqbz abj!

Feargal Reilly,
Systems Administrator,
The CIA.