Menu

[r8]: / users / updateclientuser.php  Maximize  Restore  History

Download this file

186 lines (159 with data), 8.1 kB

  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
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<?php
/*
** Application name: phpCollab
** Last Edit page: 02/08/2007
** Path by root: ../includes/calendar.php
** Authors: Ceam / Fullo
**
** =============================================================================
**
** phpCollab - Project Managment
**
** -----------------------------------------------------------------------------
** Please refer to license, copyright, and credits in README.TXT
**
** -----------------------------------------------------------------------------
** FILE: updateclientuser.php
**
** DESC: Screen: displays the details of a client user
**
** HISTORY:
** 02/08/2007 - added Last Viewed Page code - Mindblender
**
** -----------------------------------------------------------------------------
** TO-DO:
**
**
** =============================================================================
*/
$checkSession = "true";
include_once('../includes/library.php');
$tmpquery = "WHERE org.id = '$organization'";
$detailClient = new request();
$detailClient->openOrganizations($tmpquery);
$comptDetailClient = count($detailClient->org_id);
$tmpquery = "WHERE mem.id = '$id'";
$userDetail = new request();
$userDetail->openMembers($tmpquery);
$comptUserDetail = count($userDetail->mem_id);
//case update client user
if ($action == "update") {
if (!ereg("^[A-Za-z0-9]+$", $un)) {
$error = $strings["alpha_only"];
} else {
//test if login already exists
$tmpquery = "WHERE mem.login = '$un' AND mem.login != '$unOld'";
$existsUser = new request();
$existsUser->openMembers($tmpquery);
$comptExistsUser = count($existsUser->mem_id);
if ($comptExistsUser != "0") {
$error = $strings["user_already_exists"];
} else {
//replace quotes by html code in name
$fn = convertData($fn);
$tit = convertData($tit);
$c = convertData($c);
$em = convertData($em);
$wp = convertData($wp);
$hp = convertData($hp);
$mp = convertData($mp);
$fax = convertData($fax);
$last_page = convertData($last_page);
$tmpquery = "UPDATE ".$tableCollab["members"]." SET login='$un',name='$fn',title='$tit',organization='$clod',email_work='$em',phone_work='$wp',phone_home='$hp',mobile='$mp',fax='$fax',last_page='$last_page',comments='$c' WHERE id = '$id'";
connectSql("$tmpquery");
//test if new password set
if ($pw != "") {
//test if 2 passwords match
if ($pw != $pwa || $pwa == "") {
$error = $strings["new_password_error"];
} else {
$pw = get_password($pw);
$tmpquery = "UPDATE ".$tableCollab["members"]." SET password='$pw' WHERE id = '$id'";
connectSql("$tmpquery");
headerFunction("../clients/viewclient.php?msg=update&id=$clod&".session_name()."=".session_id());
exit;
}
} else {
//if mantis bug tracker enabled
if ($enableMantis == "true") {
// Call mantis function for user changes..!!!
$f_access_level = $client_user_level; // reporter
include ("../mantis/user_update.php");
}
headerFunction("../clients/viewclient.php?msg=update&id=$clod&".session_name()."=".session_id());
exit;
}
}
}
}
//set values in form
$un = $userDetail->mem_login[0];
$fn = $userDetail->mem_name[0];
$clod = $userDetail->mem_organization[0];
$tit = $userDetail->mem_title[0];
$em = $userDetail->mem_email_work[0];
$wp = $userDetail->mem_phone_work[0];
$hp = $userDetail->mem_phone_home[0];
$mp = $userDetail->mem_mobile[0];
$fax = $userDetail->mem_fax[0];
$last_page = $userDetail->mem_last_page[0];
$c = $userDetail->mem_comments[0];
$bodyCommand = "onLoad=\"document.client_user_editForm.un.focus();\"";
include('../themes/'.THEME.'/header.php');
$blockPage = new block();
$blockPage->openBreadcrumbs();
$blockPage->itemBreadcrumbs($blockPage->buildLink("../clients/listclients.php?",$strings["organizations"],in));
$blockPage->itemBreadcrumbs($blockPage->buildLink("../clients/viewclient.php?id=$organization",$detailClient->org_name[0],in));
$blockPage->itemBreadcrumbs($blockPage->buildLink("../users/viewclientuser.php?organization=$organization&id=".$userDetail->mem_id[0],$userDetail->mem_login[0],in));
$blockPage->itemBreadcrumbs($strings["edit_client_user"]);
$blockPage->closeBreadcrumbs();
if ($msg != "") {
include('../includes/messages.php');
$blockPage->messagebox($msgLabel);
}
$block1 = new block();
$block1->form = "client_user_edit";
$block1->openForm("../users/updateclientuser.php?action=update&organization=$organization&".session_name()."=".session_id());
if ($error != "") {
$block1->headingError($strings["errors"]);
$block1->contentError($error);
}
$block1->heading($strings["edit_client_user"]." : $un");
$block1->openContent();
$block1->contentTitle($strings["edit_user_details"]);
echo "<tr class='odd'><td valign='top' class='leftvalue'>".$strings["user_name"]." :</td><td><input type='hidden' name='id' value='$id'><input size='24' style='width: 250px;' maxlength='16' type='text' name='un' value='$un'><input type='hidden' name='unOld' value='$un'></td></tr>
<tr class='odd'><td valign='top' class='leftvalue'>".$strings["full_name"]." :</td><td><input size='24' style='width: 250px;' maxlength='64' type='text' name='fn' value='$fn'></td></tr>
<tr class='odd'><td valign='top' class='leftvalue'>".$strings["title"]." :</td><td><input size='24' style='width: 250px;' maxlength='64' type='text' name='tit' value='$tit'></td></tr>
<tr class='odd'><td valign='top' class='leftvalue'>".$strings["organization"]." :</td><td><select name='clod'>";
$tmpquery = "WHERE org.id != '1' ORDER BY org.name";
$selectClient = new request();
$selectClient->openOrganizations($tmpquery);
$comptSelectClient = count($selectClient->org_id);
for ($i=0;$i<$comptSelectClient;$i++) {
if ($userDetail->mem_organization[0] == $selectClient->org_id[$i]) {
echo "<option value='".$selectClient->org_id[$i]."' selected>".$selectClient->org_name[$i]."</option>";
} else {
echo "<option value='".$selectClient->org_id[$i]."'>".$selectClient->org_name[$i]."</option>";
}
}
echo "</select></td></tr>
<tr class='odd'><td valign='top' class='leftvalue'>".$strings["email"]." :</td><td><input size='24' style='width: 250px;' maxlength='128' type='text' name='em' value='$em'></td></tr>
<tr class='odd'><td valign='top' class='leftvalue'>".$strings["work_phone"]." :</td><td><input size='14' style='width: 150px;' maxlength='32' type='text' name='wp' value='$wp'></td></tr>
<tr class='odd'><td valign='top' class='leftvalue'>".$strings["home_phone"]." :</td><td><input size='14' style='width: 150px;' maxlength='32' type='text' name='hp' value='$hp'></td></tr>
<tr class='odd'><td valign='top' class='leftvalue'>".$strings["mobile_phone"]." :</td><td><input size='14' style='width: 150px;' maxlength='32' type='text' name='mp' value='$mp'></td></tr>
<tr class='odd'><td valign='top' class='leftvalue'>".$strings["fax"]." :</td><td class='infoValueField' width='634'><input size='14' style='width: 150px;' maxlength='32' type='text' name='fax' value='$fax'></td></tr>";
if ($lastvisitedpage == true) {
echo "<tr class='odd'>
<td valign='top' class='leftvalue'>".$strings["last_page"]." :</td>
<td class='infoValueField' width='634'><input size='14' style='width: 150px;' maxlength='32' type='text' name='last_page' value='$last_page'></td>
</tr>";
}
echo "<tr class='odd'><td valign='top' class='leftvalue'>".$strings["comments"]." :</td><td><textarea style='width: 400px; height: 50px;' name='c' cols='35' rows='2'>$c</textarea></td></tr>";
$block1->contentTitle($strings["change_password_user"]);
echo "<tr class='odd'><td valign='top' class='leftvalue'>".$strings["password"]." :</td><td><input size='24' style='width: 250px;' maxlength='16' type='password' name='pw' value=''></td></tr>
<tr class='odd'><td valign='top' class='leftvalue'>".$strings["confirm_password"]." :</td><td><input size='24' style='width: 250px;' maxlength='16' type='password' name='pwa' value=''></td></tr>
<tr class='odd'><td valign='top' class='leftvalue'>&nbsp;</td><td><input type='submit' name='Save' value='".$strings["save"]."'></td></tr>";
$block1->closeContent();
$block1->closeForm();
include('../themes/'.THEME.'/footer.php');
?>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.