This commit was generated by cvs2svn to compensate for changes in r2526,
[freeside.git] / rt / webrt / SelfService / Prefs.html
1 <& /SelfService/Elements/Header, title => 'Preferences' &>
2
3 <& /Elements/ListActions, actions => \@results &>
4 <form method=post>
5
6 % unless ($RT::WebExternalAuth) {
7 <& /Elements/TitleBoxStart, title => 'Change password'  &>
8 New password: <input type=password name="NewPass1" size=16>
9 Confirm: <input type=password name="NewPass2" size=16>
10 <& /Elements/TitleBoxEnd &>
11 <BR>
12 % }
13 <& /Elements/TitleBoxStart, title => 'Signature'  &>
14
15 <TEXTAREA COLS=72 ROWS=4 WRAP=HARD NAME="Signature"><% $session{'CurrentUser'}->UserObj->Signature %></TEXTAREA>
16 <br>
17 <BR>
18 <& /Elements/TitleBoxEnd &>
19 <& /Elements/Submit &>
20           </form>
21
22
23 <%INIT>
24 my @results;
25
26 if ($NewPass1) {
27     if ($NewPass1 ne $NewPass2) {
28         push (@results, "Passwords did not match.");
29     }   
30     else {
31         my ($val, $msg)=$session{'CurrentUser'}->UserObj->SetPassword($NewPass1);
32         push (@results, "Password: ".$msg);
33     }   
34 }
35 if ($Signature) {
36     $Signature =~ s/(\r\n|\r)/\n/g;
37     if ($Signature ne $session{'CurrentUser'}->UserObj->Signature) {
38         my ($val, $msg)=$session{'CurrentUser'}->UserObj->SetSignature($Signature);
39         push (@results, "Signature: ".$msg);
40     }
41 }
42 #A hack to make sure that session gets rewritten.
43
44 $session{'i'}++;
45 </%INIT>
46
47 <%ARGS>
48 $Signature => undef
49 $NewPass1 => undef
50 $NewPass2 => undef
51 </%ARGS>