From 945721f48f74d5cfffef7c7cf3a3d6bc2521f5dd Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 15 Jul 2003 13:16:32 +0000 Subject: import of rt 3.0.4 --- rt/html/User/Prefs.html | 218 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 rt/html/User/Prefs.html (limited to 'rt/html/User/Prefs.html') diff --git a/rt/html/User/Prefs.html b/rt/html/User/Prefs.html new file mode 100644 index 000000000..b89fc40ae --- /dev/null +++ b/rt/html/User/Prefs.html @@ -0,0 +1,218 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title=>loc("Preferences") &> +<& /User/Elements/Tabs, + current_tab => 'User/Prefs.html', + Title=>loc("Preferences") &> + +<& /Elements/ListActions, actions => \@results &> + +
+ + + + + + + + + + + + + + + + + + +
+<& /Elements/TitleBoxStart, title => loc('Identity') &> + + +<&|/l&>Email: +
+<&|/l&>Real Name: +
+<&|/l&>Nickname: +<& /Elements/TitleBoxEnd &> +
+<& /Elements/TitleBoxStart, title => loc('Phone numbers') &> +<&|/l&>Residence: +
+<&|/l&>Work: +
+<&|/l&>Mobile: +
+<&|/l&>Pager: +<& /Elements/TitleBoxEnd &> +
+% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { +<& /Elements/TitleBoxStart, title => loc('Password') &> + + + + + + + + +
+<&|/l&>New Password: + + +
+<&|/l&>Retype Password: + + +
+% } +<& /Elements/TitleBoxEnd &> +
+<& /Elements/TitleBoxStart, title => loc('Location') &> +<&|/l&>Organization: +
+<&|/l&>Address1: +
+<&|/l&>Address2: +
+<&|/l&>City: + +<&|/l&>State: + +<&|/l&>Zip: +
+<&|/l&>Country: +
+ + +<& /Elements/TitleBoxEnd &> +
+%if ($UserObj->Privileged) { +
+<& /Elements/TitleBoxStart, title => loc('Signature') &> + +<& /Elements/TitleBoxEnd &> +% } + +
+ + +<& /Elements/Submit &> +
+ + +<%INIT> + +my $UserObj = new RT::User($session{'CurrentUser'}); +my ($title, $PrivilegedChecked, $EnabledChecked, $Disabled, $result, @results); + +my ($val, $msg); + + + $UserObj->Load($id) || $UserObj->Load($Name) || Abort("Couldn't load user '$Name'"); + $val = $UserObj->Id(); + + + + + + +# If we have a user to modify, lets try. +if ($UserObj->Id) { + + my @fields = qw(Name Comments Signature EmailAddress FreeformContactInfo + Organization RealName NickName Lang EmailEncoding WebEncoding + ExternalContactInfoId ContactInfoSystem Gecos ExternalAuthId + AuthSystem HomePhone WorkPhone MobilePhone PagerPhone Address1 + Address2 City State Zip Country + ); + + my @fieldresults = UpdateRecordObject ( AttributesRef => \@fields, + Object => $UserObj, + ARGSRef => \%ARGS ); + push (@results,@fieldresults); + + +# {{{ 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)); +} + + + +#TODO: make this report errors properly +if ((defined $Pass1) and ($Pass1 ne '') and ($Pass1 eq $Pass2) and (!$UserObj->IsPassword($Pass1))) { + my ($code, $msg); + ($code, $msg) = $UserObj->SetPassword($Pass1); + push @results, loc('Password: [_1]', loc_fuzzy($msg)); +} elsif ( $Pass1 && ($Pass1 ne $Pass2)) { + push @results, loc("Passwords do not match. Your password has not been changed"); +} + +# }}} +} + + + + + +<%ARGS> +$id => $session{'CurrentUser'}->Id +$Name => undef +$Comments => undef +$Signature => undef +$EmailAddress => undef +$FreeformContactInfo => undef +$Organization => undef +$RealName => undef +$NickName => undef +$Privileged => undef +$SetPrivileged => undef +$Enabled => undef +$SetEnabled => undef +$Lang => undef +$EmailEncoding => undef +$WebEncoding => undef +$ExternalContactInfoId => undef +$ContactInfoSystem => undef +$Gecos => undef +$ExternalAuthId => undef +$AuthSystem => 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 +$Create=> undef + -- cgit v1.2.1 From 289340780927b5bac2c7604d7317c3063c6dd8cc Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 11 Mar 2004 02:05:38 +0000 Subject: import of rt 3.0.9 --- rt/html/User/Prefs.html | 106 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 72 insertions(+), 34 deletions(-) (limited to 'rt/html/User/Prefs.html') diff --git a/rt/html/User/Prefs.html b/rt/html/User/Prefs.html index b89fc40ae..c2746a38c 100644 --- a/rt/html/User/Prefs.html +++ b/rt/html/User/Prefs.html @@ -38,21 +38,44 @@ <& /Elements/TitleBoxStart, title => loc('Identity') &> -<&|/l&>Email: -
-<&|/l&>Real Name: -
-<&|/l&>Nickname: + + + + + + + + + + + + + + + + +
<&|/l&>Email:
<&|/l&>Real Name:
<&|/l&>Nickname:
<&|/l&>Language:<& /Elements/SelectLang, Name => 'Lang', Default => $UserObj->Lang &>
<& /Elements/TitleBoxEnd &>
<& /Elements/TitleBoxStart, title => loc('Phone numbers') &> -<&|/l&>Residence: -
-<&|/l&>Work: -
-<&|/l&>Mobile: -
-<&|/l&>Pager: + + + + + + + + + + + + + + + + + +
<&|/l&>Residence:
<&|/l&>Work:
<&|/l&>Mobile:
<&|/l&>Pager:
<& /Elements/TitleBoxEnd &> @@ -60,44 +83,58 @@ <& /Elements/TitleBoxStart, title => loc('Password') &> - - - -
+ <&|/l&>New Password: +
+
<&|/l&>Retype Password: +
-% } <& /Elements/TitleBoxEnd &> +% } <& /Elements/TitleBoxStart, title => loc('Location') &> -<&|/l&>Organization: -
-<&|/l&>Address1: -
-<&|/l&>Address2: -
-<&|/l&>City: - -<&|/l&>State: - -<&|/l&>Zip: -
-<&|/l&>Country: -
- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<&|/l&>Organization:
<&|/l&>Address1:
<&|/l&>Address2:
<&|/l&>City:
<&|/l&>State:
<&|/l&>Zip:
<&|/l&>Country:
<& /Elements/TitleBoxEnd &> @@ -147,12 +184,13 @@ if ($UserObj->Id) { Organization RealName NickName Lang EmailEncoding WebEncoding ExternalContactInfoId ContactInfoSystem Gecos ExternalAuthId AuthSystem HomePhone WorkPhone MobilePhone PagerPhone Address1 - Address2 City State Zip Country + Address2 City State Zip Country Lang ); my @fieldresults = UpdateRecordObject ( AttributesRef => \@fields, Object => $UserObj, ARGSRef => \%ARGS ); + $session{'CurrentUser'}->LanguageHandle($Lang) if $Lang; push (@results,@fieldresults); -- cgit v1.2.1 From c582e92888b4a5553e1b4e5214cf35217e4a0cf0 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 11 Nov 2004 12:13:50 +0000 Subject: import rt 3.0.12 --- rt/html/User/Prefs.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'rt/html/User/Prefs.html') diff --git a/rt/html/User/Prefs.html b/rt/html/User/Prefs.html index c2746a38c..68f12b81e 100644 --- a/rt/html/User/Prefs.html +++ b/rt/html/User/Prefs.html @@ -157,7 +157,7 @@ -<& /Elements/Submit &> +<& /Elements/Submit, Label => loc('Save Preferences') &> @@ -190,7 +190,10 @@ if ($UserObj->Id) { my @fieldresults = UpdateRecordObject ( AttributesRef => \@fields, Object => $UserObj, ARGSRef => \%ARGS ); - $session{'CurrentUser'}->LanguageHandle($Lang) if $Lang; + if ($Lang) { + $session{'CurrentUser'}->LanguageHandle($Lang); + $session{'CurrentUser'}= $session{'CurrentUser'}; # Force writeback + } push (@results,@fieldresults); -- cgit v1.2.1 From d39d52aac8f38ea9115628039f0df5aa3ac826de Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 3 Dec 2004 20:40:48 +0000 Subject: import rt 3.2.2 --- rt/html/User/Prefs.html | 47 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) (limited to 'rt/html/User/Prefs.html') diff --git a/rt/html/User/Prefs.html b/rt/html/User/Prefs.html index 68f12b81e..b5aa13db9 100644 --- a/rt/html/User/Prefs.html +++ b/rt/html/User/Prefs.html @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# {{{ BEGIN BPS TAGGED BLOCK %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,13 +20,29 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: %# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) %# -%# END LICENSE BLOCK +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# }}} END BPS TAGGED BLOCK <& /Elements/Header, Title=>loc("Preferences") &> <& /User/Elements/Tabs, current_tab => 'User/Prefs.html', @@ -34,7 +56,7 @@ -
+ <& /Elements/TitleBoxStart, title => loc('Identity') &> @@ -78,7 +100,7 @@
<& /Elements/TitleBoxEnd &> - + % unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { <& /Elements/TitleBoxStart, title => loc('Password') &> @@ -100,10 +122,7 @@
<& /Elements/TitleBoxEnd &> % } - - - <& /Elements/TitleBoxStart, title => loc('Location') &> @@ -142,7 +161,7 @@ -
+ %if ($UserObj->Privileged) {
<& /Elements/TitleBoxStart, title => loc('Signature') &> -- cgit v1.2.1 From d4d0590bef31071e8809ec046717444b95b3f30a Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 15 Oct 2005 09:11:20 +0000 Subject: import rt 3.4.4 --- rt/html/User/Prefs.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'rt/html/User/Prefs.html') diff --git a/rt/html/User/Prefs.html b/rt/html/User/Prefs.html index b5aa13db9..f1c755826 100644 --- a/rt/html/User/Prefs.html +++ b/rt/html/User/Prefs.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title=>loc("Preferences") &> <& /User/Elements/Tabs, current_tab => 'User/Prefs.html', @@ -165,7 +165,7 @@ %if ($UserObj->Privileged) {
<& /Elements/TitleBoxStart, title => loc('Signature') &> - <& /Elements/TitleBoxEnd &> % } @@ -210,9 +210,10 @@ if ($UserObj->Id) { Object => $UserObj, ARGSRef => \%ARGS ); if ($Lang) { - $session{'CurrentUser'}->LanguageHandle($Lang); - $session{'CurrentUser'}= $session{'CurrentUser'}; # Force writeback + $session{'CurrentUser'}->LanguageHandle($Lang); + $session{'CurrentUser'} = $session{'CurrentUser'}; # force writeback } + push (@results,@fieldresults); -- cgit v1.2.1