summaryrefslogtreecommitdiff
path: root/rt/webrt/User/Prefs.html
blob: d769977f94e7b426646bc25f8aeb5f61dd74c84c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<& /Elements/Header, Title=>"Preferences" &>
<& /Elements/Tabs &>

<& /Elements/ListActions, actions => \@results &>
<form method=post>

% unless ($RT::WebExternalAuth) {
<& /Elements/TitleBoxStart, title => 'Change password'  &>
New password: <input type=password name="NewPass1" size=16>
Confirm: <input type=password name="NewPass2" size=16>
<& /Elements/TitleBoxEnd &>
<BR>
% }
<& /Elements/TitleBoxStart, title => 'Signature'  &>
<INPUT TYPE=HIDDEN NAME="SignatureMagic" VALUE=1>
<TEXTAREA COLS=72 ROWS=4 WRAP=HARD NAME="Signature"><% $session{'CurrentUser'}->UserObj->Signature %></TEXTAREA>
<br>
<BR>
<& /Elements/TitleBoxEnd &>
<& /Elements/Submit &>
	  </form>


<%INIT>
my @results;

if ($NewPass1) {
    if ($NewPass1 ne $NewPass2) {
	push (@results, "Passwords did not match.");
    }	
    else {
	my ($val, $msg)=$session{'CurrentUser'}->UserObj->SetPassword($NewPass1);
	push (@results, "Password: ".$msg);
    }	
}
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);
	push (@results, "Signature: ".$msg);
    }
}
#A hack to make sure that session gets rewritten.

$session{'i'}++;
</%INIT>

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