This repository has been archived by the owner on Dec 2, 2022. It is now read-only.
forked from jankul/studip-marketplace
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuser_edit_form.php
83 lines (82 loc) · 4.1 KB
/
user_edit_form.php
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<script type="text/javascript">
var checkUsername = function() {
$j.ajax({
url: '<?=$GLOBALS['BASE_URI']?>ajax_dispatcher.php?ajaxcmd=check_username&username='+$('username').value,
cache: false,
async: false,
dataType: 'text',
success: function(data) {
$('check_username').value = data;
}
});
}
var checkInput = function() {
checkUsername();
if ($('check_username').value != 'OK' && $('old_username').value != $('username').value) {
alert('Der Username existiert bereits, bitte wählen Sie einen anderen!');
return false;
}
if ($('username').value == '' || $('vorname').value == '' || $('nachname').value == '' || $('email').value == '' || $('passwort').value != $('passwort2').value) {
alert('Bitte füllen Sie alle Pflichtfelder aus!');
return false;
} else {
return true;
}
}
</script>
<FORM NAME="user_edit" METHOD="POST" ACTION="?dispatch=save_user" onSubmit="return checkInput();">
<INPUT TYPE="hidden" NAME="user_id" VALUE="<?=$u->getUserId()?>">
<INPUT TYPE="hidden" ID="check_username" VALUE="ERROR">
<INPUT TYPE="hidden" ID="old_username" VALUE="<?=htmlReady($u->getUsername())?>">
<TABLE BORDER=0>
<TR>
<TD STYLE="font-size:12px; font-weight:bold;">Letzer Login: </TD><TD><SPAN STYLE="font-size:12px;"><? $s = Session::getSessionParams($u->getUserId()); echo ($s[0]['lastlogin'] ? date('d.m.Y H:i',$s[0]['lastlogin']) : 'nie'); ?></SPAN></TD>
</TR>
<TR>
<TD STYLE="font-size:12px; font-weight:bold;">Username: </TD><TD><INPUT TYPE="text" ID="username" NAME="username" SIZE="30" VALUE="<?=htmlReady($u->getUsername())?>"> <SPAN STYLE="color:red; font-weight:bold;">*</SPAN></TD>
</TR>
<TR>
<TD STYLE="font-size:12px; font-weight:bold;">Anrede: </TD><TD>
<SELECT NAME="salutation" SIZE=1>
<? foreach (array('Herr','Frau') as $p) : ?>
<OPTION VALUE="<?=$p?>" <?=($u->getSalutation() == $p ? 'SELECTED' : '')?>><?=$p?></OPTION>
<? endforeach ?>
</SELECT>
</TD>
</TR>
<TR>
<TD STYLE="font-size:12px; font-weight:bold;">Vorname: </TD><TD><INPUT TYPE="text" ID="vorname" NAME="vorname" SIZE="30" VALUE="<?=htmlReady($u->getVorname())?>"> <SPAN STYLE="color:red; font-weight:bold;">*</SPAN></TD>
</TR>
<TR>
<TD STYLE="font-size:12px; font-weight:bold;">Nachname: </TD><TD><INPUT TYPE="text" ID="nachname" NAME="nachname" SIZE="30" VALUE="<?=htmlReady($u->getNachname())?>"> <SPAN STYLE="color:red; font-weight:bold;">*</SPAN></TD>
</TR>
<TR>
<TD STYLE="font-size:12px; font-weight:bold;">E-Mail: </TD><TD><INPUT TYPE="text" ID="email" NAME="email" SIZE="30" VALUE="<?=htmlReady($u->getEmail())?>"> <SPAN STYLE="color:red; font-weight:bold;">*</SPAN></TD>
</TR>
<TR>
<TD STYLE="font-size:12px; font-weight:bold;">Passwort: </TD><TD><INPUT TYPE="password" ID="passwort" NAME="passwort" SIZE="30" VALUE=""></TD>
</TR>
<TR>
<TD STYLE="font-size:12px; font-weight:bold;">Passwort (wiederholen): </TD><TD><INPUT TYPE="password" ID="passwort2" NAME="passwort2" SIZE="30" VALUE=""></TD>
</TR>
<TR>
<TD STYLE="font-size:12px; font-weight:bold;">Perm: </TD><TD>
<SELECT NAME="perm" SIZE=1>
<? foreach (array('user','author','admin') as $p) : ?>
<OPTION VALUE="<?=$p?>" <?=($u->getPerm() == $p ? 'SELECTED' : '')?>><?=$p?></OPTION>
<? endforeach ?>
</SELECT>
</TD>
</TR>
<TR>
<TD STYLE="font-size:12px; font-weight:bold;">Locked: </TD><TD><INPUT TYPE="checkbox" NAME="locked" VALUE="yes" <?=($u->getLocked() ? 'CHECKED' : '')?>></TD>
</TR>
<TR>
<TD STYLE="font-size:12px; font-weight:bold; vertical-align:top;">Profilbild: </TD><TD><?=Avatar::getAvatar($u->getUserId())->getImageTag(Avatar::MEDIUM)?></TD>
</TR>
<TR>
<TD COLSPAN="2" STYLE=text-align:center;"><INPUT TYPE="image" <?=makeButton('speichern','src')?>> <IMG <?=makeButton('abbrechen','src')?> onClick="location.href='?dispatch=user_management';"></TD>
</TR>
</TABLE>
</FORM>
<SPAN STYLE="color:red; font-weight:bold;">*</SPAN> = Pflichtfeld