[Rt-commit] r8968 - in rt/branches/3.7-EXPERIMENTAL: . html/User t/web

sartak at bestpractical.com sartak at bestpractical.com
Fri Sep 7 15:51:07 EDT 2007


Author: sartak
Date: Fri Sep  7 15:51:07 2007
New Revision: 8968

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/html/Prefs/Other.html
   rt/branches/3.7-EXPERIMENTAL/html/User/Prefs.html
   rt/branches/3.7-EXPERIMENTAL/t/web/crypt-gnupg.t

Log:
 r42437 at onn:  sartak | 2007-09-07 15:50:55 -0400
 Remove key selection from user/prefs, make tests pass, much rejoicing, etc


Modified: rt/branches/3.7-EXPERIMENTAL/html/Prefs/Other.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Prefs/Other.html	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Prefs/Other.html	Fri Sep  7 15:51:07 2007
@@ -83,6 +83,11 @@
 my $UserObj = $session{'CurrentUser'}->UserObj;
 my $preferences = $UserObj->Preferences( $RT::System );
 
+if ((defined $PreferredKey) && $PreferredKey ne $UserObj->FirstAttribute('PreferredKey')) {
+    my ($code, $msg) = $UserObj->SetAttribute(Name => 'PreferredKey', Content => $PreferredKey);
+    push @results, loc('Preferred Key: [_1]', loc_fuzzy($msg));
+}
+
 if ( $Update ) {
     foreach my $option( RT->Config->Options ) {
         my $meta = RT->Config->Meta( $option );
@@ -115,4 +120,5 @@
 <%ARGS>
 $Update => 0,
 $User   => undef,
+$PreferredKey => undef,
 </%ARGS>

Modified: rt/branches/3.7-EXPERIMENTAL/html/User/Prefs.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/User/Prefs.html	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/User/Prefs.html	Fri Sep  7 15:51:07 2007
@@ -161,21 +161,6 @@
 </td>
 </tr>
 
-% if ( RT->Config->Get('GnuPG')->{'Enable'} ) {
- <tr>
- <td valign="top" class="boxcontainer">
- <br />
-<&| /Widgets/TitleBox, title => loc('Cryptography') &>
- <table cellspacing="0" cellpadding="0">
-   <tr>
-     <td class="label"><&|/l&>Preferred Key</&>:</td>
-     <td class="value"><& /Elements/SelectKey, EmailAddress => $UserObj->EmailAddress, Default => $UserObj->PreferredKey &></td>
-   </tr>
- </table>
-</&>
- </td>
- </tr>
-% }
 
 <tr>
 
@@ -247,7 +232,7 @@
     push (@results, at fieldresults);
 
 
-# {{{ Deal with special fields: Privileged, Enabled, Password, PreferredKey
+# {{{ Deal with special fields: Privileged, Enabled, and Password
 if  ( ($SetPrivileged) and ( $Privileged != $UserObj->Privileged) ) {
 my  ($code, $msg) = $UserObj->SetPrivileged($Privileged);
      push @results, loc('Privileged status: [_1]', loc_fuzzy($msg));
@@ -264,11 +249,6 @@
     push @results, loc("Passwords do not match. Your password has not been changed");
 }
 
-if ((defined $PreferredKey) && $PreferredKey ne $UserObj->FirstAttribute('PreferredKey')) {
-    my ($code, $msg) = $UserObj->SetAttribute(Name => 'PreferredKey', Content => $PreferredKey);
-    push @results, loc('Preferred Key: [_1]', loc_fuzzy($msg));
-}
-
 # }}}
 }
 

Modified: rt/branches/3.7-EXPERIMENTAL/t/web/crypt-gnupg.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/t/web/crypt-gnupg.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL/t/web/crypt-gnupg.t	Fri Sep  7 15:51:07 2007
@@ -391,8 +391,8 @@
 ok($user = RT::User->new($RT::SystemUser));
 ok($user->Load('root'), "Loaded user 'root'");
 is($user->PreferredKey, "9FA662C06DE22FC2", "preferred key is set correctly");
-$m->get("$baseurl/User/Prefs.html");
-like($m->content, qr/Preferred Key/, "preferred key option shows up in preference");
+$m->get("$baseurl/Prefs/Other.html");
+like($m->content, qr/Preferred key/, "preferred key option shows up in preference");
 
 # XXX: mech doesn't let us see the current value of the select, apparently
 like($m->content, qr/9FA662C06DE22FC2/, "first key shows up in preferences");
@@ -407,8 +407,8 @@
 ok($user->Load('root'), "Loaded user 'root'");
 is($user->PreferredKey, "DF651FA0632C4F50", "preferred key is set correctly to the new value");
 
-$m->get("$baseurl/User/Prefs.html");
-like($m->content, qr/Preferred Key/, "preferred key option shows up in preference");
+$m->get("$baseurl/Prefs/Other.html");
+like($m->content, qr/Preferred key/, "preferred key option shows up in preference");
 
 # XXX: mech doesn't let us see the current value of the select, apparently
 like($m->content, qr/DF651FA0632C4F50/, "second key shows up in preferences");


More information about the Rt-commit mailing list