[Rt-commit] rt branch, 4.4/selfservice-show-more-user-info, repushed

Maureen Mirville maureen at bestpractical.com
Fri Jun 8 12:43:34 EDT 2018


The branch 4.4/selfservice-show-more-user-info was deleted and repushed:
       was c08c2b8a2e33a2b6f0eb6a31ad1f40145cc7ae63
       now 303bc6d9e5b3b495470c7980725bf2cd84b9e9d1

1: c08c2b8a2 ! 1: 5b4fbb292 Allow self service users varied access to their stored RT user information
    @@ -17,8 +17,6 @@
      Set($SelfServiceRegex, qr!^(?:/+SelfService/)!x );
      
     +=item C<$SelfServiceUserPrefs>
    -+
    -+C<$SelfServiceUserPrefs>
     +
     +This option controls how the SelfService user preferences page is
     +displayed. It accepts a string from one of the three possible modes
    @@ -205,10 +203,35 @@
     -</tr>
     -
     -</table>
    -+<& Elements/EditAboutMe, UserObj => $UserObj, Page => '/Prefs/AboutMe.html' &>
    ++<& Elements/EditAboutMe, UserObj => $UserObj &>
      
      % $m->callback( %ARGS, UserObj => $UserObj, CallbackName => 'FormEnd' );
      
    +@@
    +     }
    + 
    +     my %password_cond = $UserObj->CurrentUserRequireToSetPassword;
    +-    if (defined $Pass1 && length $Pass1 ) {
    ++    if (defined $NewPass1 && length $NewPass1 ) {
    +         my ($status, $msg) = $UserObj->SafeSetPassword(
    +             Current      => $CurrentPass,
    +-            New          => $Pass1,
    +-            Confirmation => $Pass2,
    ++            New          => $NewPass1,
    ++            Confirmation => $NewPass2,
    +         );
    +         push @results, loc("Password: [_1]", $msg);
    +     }
    +@@
    + $Zip  => undef
    + $Country => undef
    + $CurrentPass => undef
    +-$Pass1 => undef
    +-$Pass2 => undef
    ++$NewPass1 => undef
    ++$NewPass2 => undef
    + $Create=> undef
    + </%ARGS>
     
     diff --git a/share/html/Prefs/Elements/EditAboutMe b/share/html/Prefs/Elements/EditAboutMe
     new file mode 100644
    @@ -263,7 +286,7 @@
     +%#
     +%# END BPS TAGGED BLOCK }}}
     +
    -+<form action="" method="post">
    ++<form name="EditAboutMe" action="" method="post">
     +<input type="hidden" class="hidden" name="id" value="<%$UserObj->Id%>" />
     +
     +<table width="100%" border="0">
    @@ -330,19 +353,18 @@
     +% if ( $UserObj->__Value('Password') ne '*NO-PASSWORD*' ) {
     +<& /Elements/EditPassword,
     +    User => $UserObj,
    -+    Name => [qw(CurrentPass Pass1 Pass2)],
    ++    Name => [qw(CurrentPass NewPass1 NewPass2)],
     +&>
     +% }
     +<& /Elements/EditCustomFields, Object => $UserObj, Grouping => 'Access control' &>
     +</&>
     +
    -+%my $path = $HTML::Mason::Commands::r->path_info;
    -+
    ++%my $AdminUser = $session{'CurrentUser'}->HasRight( Object => RT->System, Right => 'AdminUsers' );
     +<&| /Widgets/TitleBox, title => loc('Location'), id => "user-prefs-location" &>
     +<table cellspacing="0" cellpadding="0">
     +  <tr>
     +    <td class="label"><&|/l&>Organization</&>:</td>
    -+%if ( $path =~ /AboutMe/ ) {
    ++%if ( $AdminUser ) {
     +    <td class="value"><input name="Organization" value="<%$UserObj->Organization || ''%>" /></td>
     +%} else {
     +    <td class="value"><%$UserObj->Organization || ''%></td>
    @@ -379,7 +401,7 @@
     +
     +<& /Elements/Submit, Label => loc('Save Preferences') &>
     +
    -+%if ( $path =~ /AboutMe/ ) {
    ++%if ( $AdminUser ) {
     +<&| /Widgets/TitleBox, title => loc('Secret authentication token'), id => "user-prefs-feeds" &>
     +
     +<&|/l&>All iCal feeds embed a secret token which authorizes you.  If the URL for one of your iCal feeds was exposed to the outside world, you can get a new secret, <b>breaking all existing iCal feeds</b>, below.</&>
    @@ -409,7 +431,6 @@
     +
     +<%ARGS>
     +$UserObj
    -+$Page
     +</%ARGS>
     
     diff --git a/share/html/Prefs/Elements/ShowAboutMe b/share/html/Prefs/Elements/ShowAboutMe
    @@ -491,7 +512,7 @@
     +          <td class="label"><&|/l&>Timezone</&>:</td>
     +          <td class="value"><%$UserObj->Timezone%></td>
     +        </tr>
    -+      <& /Elements/EditCustomFields, Object => $UserObj, Grouping => 'Identity', InTable => 1 &>
    ++      <& /Elements/ShowCustomFields, Object => $UserObj, Grouping => 'Identity', InTable => 1 &>
     +      </table>
     +      </&>
     +      <&| /Widgets/TitleBox, title => loc('Phone numbers'), id => "user-prefs-phone" &>
    @@ -512,7 +533,7 @@
     +          <td class="label"><&|/l&>Pager</&>:</td>
     +          <td class="value"><%$UserObj->PagerPhone || ''%></td>
     +        </tr>
    -+      <& /Elements/EditCustomFields, Object => $UserObj, Grouping => 'Phones', InTable => 1 &>
    ++      <& /Elements/ShowCustomFields, Object => $UserObj, Grouping => 'Phones', InTable => 1 &>
     +      </table>
     +      </&>
     +    </td>
    @@ -547,10 +568,10 @@
     +          <td class="label"><&|/l&>Country</&>:</td>
     +          <td class="value"><%$UserObj->Country || ''%></td>
     +        </tr>
    -+      <& /Elements/EditCustomFields, Object => $UserObj, Grouping => 'Location', InTable => 1 &>
    ++      <& /Elements/ShowCustomFields, Object => $UserObj, Grouping => 'Location', InTable => 1 &>
     +      </table>
     +      </&>
    -+      <& /Elements/EditCustomFieldCustomGroupings, Object => $UserObj &>
    ++      <& /Elements/ShowCustomFieldCustomGroupings, Object => $UserObj &>
     +    </td>
     +  </tr>
     +</table>
    @@ -568,7 +589,7 @@
      <& /Elements/ListActions, actions => \@results &>
     +% my $pref = RT->Config->Get( 'SelfServiceUserPrefs' ) || '';
     +% if ( $pref eq 'full-edit' ) {
    -+<& /Prefs/Elements/EditAboutMe, UserObj => $user, Page => '/SelfService/Prefs.html' &>
    ++<& /Prefs/Elements/EditAboutMe, UserObj => $user &>
     +% } elsif ( $pref eq 'full-view' ) {
     +<& /Prefs/Elements/ShowAboutMe, UserObj => $user &>
     +% } else {
    @@ -587,15 +608,11 @@
      my $user = $session{'CurrentUser'}->UserObj;
      
     -if (defined $NewPass1 && length $NewPass1 ) {
    -+if ( (defined $NewPass1 && length $NewPass1) || (defined $Pass1 && length $Pass1)  ) {
    ++if ( defined $NewPass1 && length $NewPass1 ) {
          my ($status, $msg) = $user->SafeSetPassword(
              Current      => $CurrentPass,
    --        New          => $NewPass1,
    --        Confirmation => $NewPass2,
    -+        New          => $NewPass1 || $Pass1,
    -+        Confirmation => $NewPass2 || $Pass2,
    -     );
    -     push @results, loc("Password: [_1]", $msg);
    +         New          => $NewPass1,
    +@@
      }
      
      my @fields = qw(
    @@ -607,42 +624,23 @@
      
      $m->callback(
     @@
    +     ARGSRef => \%ARGS,
    + );
    + 
    ++push @results, ProcessObjectCustomFieldUpdates( ARGSRef => \%ARGS, Object => $user );
    ++
    + if ( $Lang ) {
    +     $session{'CurrentUser'}->LanguageHandle($Lang);
          $session{'CurrentUser'} = $session{'CurrentUser'}; # force writeback
    - }
    - 
    --if ($Signature) {
    --    $Signature =~ s/(\r\n|\r)/\n/g;
    --    if ($Signature ne $user->Signature) {
    --        my ($val, $msg) = $user->SetSignature($Signature);
    --        push (@results, "Signature: ".$msg);
    --    }
    --}
    --
    +@@
    + 
      #A hack to make sure that session gets rewritten.
      $session{'i'}++;
    ++
    ++MaybeRedirectForResults(
    ++    Actions   => \@results,
    ++);
      </%INIT>
      
      <%ARGS>
    --$Signature => undef
    -+$Name  => undef
    -+$Comments  => undef
    -+$EmailAddress  => undef
    -+$Organization  => undef
    -+$RealName  => undef
    -+$NickName  => undef
    -+$Gecos => undef
    -+$HomePhone => undef
    -+$WorkPhone  => undef
    -+$MobilePhone  => undef
    -+$PagerPhone  => undef
    -+$Address1 => undef
    -+$Address2  => undef
    -+$City  => undef
    -+$State  => undef
    -+$Zip  => undef
    -+$Country => undef
    -+$Pass1 => undef
    -+$Pass2 => undef
    - $CurrentPass => undef
    - $NewPass1 => undef
    - $NewPass2 => undef
    +
-:  ------- > 2: 08ab3b671 Clean up SelfService code that is not being used
-:  ------- > 3: 303bc6d9e Add $SelfServiceUserPrefs config tests to verify SelfService display



More information about the rt-commit mailing list