| Line 81... |
Line 81... |
| 81 |
$F->{timeformat} = WebDB::trim param ('timeformat') // '24hr';
|
81 |
$F->{timeformat} = WebDB::trim param ('timeformat') // '24hr';
|
| 82 |
# $F->{level} = param ('level') // '';
|
82 |
# $F->{level} = param ('level') // '';
|
| 83 |
# $F->{type} = param ('type') // '';
|
83 |
# $F->{type} = param ('type') // '';
|
| 84 |
$F->{RCid} = param ('RCid') // '';
|
84 |
$F->{RCid} = param ('RCid') // '';
|
| 85 |
$F->{access} = param ('access') // 0;
|
85 |
$F->{access} = param ('access') // 0;
|
| 86 |
$F->{mvp_pass} = defined param ('mvp_pass') ? 1 : 0;
|
86 |
# $F->{mvp_pass} = defined param ('mvp_pass') ? 1 : 0;
|
| 87 |
$F->{department} = join ":", map { "$_-".param ("DEPT-".$_) } map { s/^DEPT-//; $_ } grep { param ($_) ne "" } grep { /^DEPT-/ } param ;
|
87 |
$F->{department} = join ":", map { "$_-".param ("DEPT-".$_) } map { s/^DEPT-//; $_ } grep { param ($_) ne "" } grep { /^DEPT-/ } param ;
|
| 88 |
my @AUTODEPTS = map { $_->[0] } $dbh->selectall_array ("select TLA from department where autoapprove = true");
|
88 |
my @AUTODEPTS = map { $_->[0] } $dbh->selectall_array ("select TLA from department where autoapprove = true");
|
| Line 89... |
Line 89... |
| 89 |
|
89 |
|
| 90 |
if ($F->{RCid} eq "New") {
|
90 |
if ($F->{RCid} eq "New") {
|
| 91 |
# Saving a new User...
|
91 |
# Saving a new User...
|
| 92 |
# But first let's do some error checking...0
|
92 |
# But first let's do some error checking...0
|
| 93 |
if (!$F->{password}) { push @ERRORS, "Blank Password!"; }
|
93 |
if (!$F->{password}) { push @ERRORS, "Blank Password!"; }
|
| 94 |
if (!$F->{real_name}) { push @ERRORS, "Blank Real Name!"; }
|
94 |
if (!$F->{real_name}) { push @ERRORS, "Blank Full Name!"; }
|
| 95 |
if (!$F->{derby_name}) { $F->{derby_name} = $F->{real_name}; } # If they leave derby_name blank, use their real_name
|
95 |
if (!$F->{derby_name}) { $F->{derby_name} = $F->{real_name}; } # If they leave derby_name blank, use their real_name
|
| 96 |
if (checkDupes ('derby_name', $F->{derby_name})) { push @ERRORS, "Derby Name already in use. Pick a different one."; $F->{derby_name} = ""; }
|
96 |
if (checkDupes ('derby_name', $F->{derby_name})) { push @ERRORS, "Derby Name already in use. Pick a different one."; $F->{derby_name} = ""; }
|
| 97 |
# if (!$F->{level}) { $F->{level} = "B"; } # People keep leaving level blank. Default 'em if they do.
|
97 |
# if (!$F->{level}) { $F->{level} = "B"; } # People keep leaving level blank. Default 'em if they do.
|
| 98 |
# if (!$F->{type}) { $F->{type} = "official"; } # and now they left the other drop-down blank!!!
|
98 |
# if (!$F->{type}) { $F->{type} = "official"; } # and now they left the other drop-down blank!!!
|
| Line 134... |
Line 134... |
| 134 |
$cookie_string = authenticate (1);
|
134 |
$cookie_string = authenticate (1);
|
| 135 |
my ($EM, $PWD, $AL) = split /&/, $cookie_string;
|
135 |
my ($EM, $PWD, $AL) = split /&/, $cookie_string;
|
| 136 |
if (lc $EM eq lc $F->{email} and $AL < 5) { # They're editing their own record (and not a sysadmin).
|
136 |
if (lc $EM eq lc $F->{email} and $AL < 5) { # They're editing their own record (and not a sysadmin).
|
| Line 137... |
Line 137... |
| 137 |
|
137 |
|
| 138 |
# Don't let users change their own mvp_pass setting...
|
138 |
# Don't let users change their own mvp_pass setting...
|
| 139 |
$F->{mvp_pass} = getUser($EM)->{mvp_pass};
|
139 |
# $F->{mvp_pass} = getUser($EM)->{mvp_pass};
|
| 140 |
my $DBDepts = getUser($EM)->{department};
|
140 |
my $DBDepts = getUser($EM)->{department};
|
| 141 |
if ($F->{department} ne $DBDepts) {
|
141 |
if ($F->{department} ne $DBDepts) {
|
| 142 |
# They're trying to change one of their own departments.
|
142 |
# They're trying to change one of their own departments.
|
| 143 |
my $FORMDepts = convertDepartments $F->{department};
|
143 |
my $FORMDepts = convertDepartments $F->{department};
|
| Line 153... |
Line 153... |
| 153 |
}
|
153 |
}
|
| Line 154... |
Line 154... |
| 154 |
|
154 |
|
| 155 |
if ($F->{password}) { # They've possibly included an updated password.
|
155 |
if ($F->{password}) { # They've possibly included an updated password.
|
| 156 |
# my $sth = $dbh->prepare("replace into official (RCid, email, password, derby_name, real_name, phone, level, type, access, department, clinic_pass) values (?, ?, password(?), ?, ?, ?, ?, ?, ?, ?, ?)");
|
156 |
# my $sth = $dbh->prepare("replace into official (RCid, email, password, derby_name, real_name, phone, level, type, access, department, clinic_pass) values (?, ?, password(?), ?, ?, ?, ?, ?, ?, ?, ?)");
|
| 157 |
# $sth->execute ($F->{RCid}, $EM, $F->{password}, $F->{derby_name}, $F->{real_name}, $F->{phone}, $F->{level}, $F->{type}, $F->{access}, $F->{department}, $F->{clinic_pass})
|
157 |
# $sth->execute ($F->{RCid}, $EM, $F->{password}, $F->{derby_name}, $F->{real_name}, $F->{phone}, $F->{level}, $F->{type}, $F->{access}, $F->{department}, $F->{clinic_pass})
|
| 158 |
my $sth = $dbh->prepare("replace into official (RCid, email, password, derby_name, real_name, pronouns, tshirt, phone, activation, timeformat, access, mvp_pass, department, added, last_login) values (?, ?, password(?), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
158 |
my $sth = $dbh->prepare("replace into official (RCid, email, password, derby_name, real_name, pronouns, tshirt, phone, activation, timeformat, access, department, added, last_login) values (?, ?, password(?), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
| 159 |
$sth->execute ($F->{RCid}, lc $EM, $F->{password}, $F->{derby_name}, $F->{real_name}, $F->{pronouns}, $F->{tshirt}, $F->{phone}, getUser($EM)->{activation}, $F->{timeformat}, $F->{access}, $F->{mvp_pass}, $F->{department}, getUser($EM)->{added}, getUser($EM)->{last_login})
|
159 |
$sth->execute ($F->{RCid}, lc $EM, $F->{password}, $F->{derby_name}, $F->{real_name}, $F->{pronouns}, $F->{tshirt}, $F->{phone}, getUser($EM)->{activation}, $F->{timeformat}, $F->{access}, $F->{department}, getUser($EM)->{added}, getUser($EM)->{last_login})
|
| 160 |
or $ERRMSG = "ERROR: Can't execute SQL statement: ".$sth->errstr()."\n";
|
160 |
or $ERRMSG = "ERROR: Can't execute SQL statement: ".$sth->errstr()."\n";
|
| 161 |
} else { # No password was included, just keep the existing one.
|
161 |
} else { # No password was included, just keep the existing one.
|
| 162 |
# my $sth = $dbh->prepare("replace into official (RCid, email, password, derby_name, real_name, phone, level, type, access, department, clinic_pass) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
162 |
# my $sth = $dbh->prepare("replace into official (RCid, email, password, derby_name, real_name, phone, level, type, access, department, clinic_pass) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
| 163 |
# $sth->execute($F->{RCid}, $EM, $PWD, $F->{derby_name}, $F->{real_name}, $F->{phone}, $F->{level}, $F->{type}, $F->{access}, $F->{department}, $F->{clinic_pass})
|
163 |
# $sth->execute($F->{RCid}, $EM, $PWD, $F->{derby_name}, $F->{real_name}, $F->{phone}, $F->{level}, $F->{type}, $F->{access}, $F->{department}, $F->{clinic_pass})
|
| 164 |
my $sth = $dbh->prepare("replace into official (RCid, email, password, derby_name, real_name, pronouns, tshirt, phone, activation, timeformat, access, mvp_pass, department, added, last_login) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
164 |
my $sth = $dbh->prepare("replace into official (RCid, email, password, derby_name, real_name, pronouns, tshirt, phone, activation, timeformat, access, department, added, last_login) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
| 165 |
$sth->execute($F->{RCid}, lc $EM, $PWD, $F->{derby_name}, $F->{real_name}, $F->{pronouns}, $F->{tshirt}, $F->{phone}, getUser($EM)->{activation}, $F->{timeformat}, $F->{access}, $F->{mvp_pass}, $F->{department}, getUser($EM)->{added}, getUser($EM)->{last_login})
|
165 |
$sth->execute($F->{RCid}, lc $EM, $PWD, $F->{derby_name}, $F->{real_name}, $F->{pronouns}, $F->{tshirt}, $F->{phone}, getUser($EM)->{activation}, $F->{timeformat}, $F->{access}, $F->{department}, getUser($EM)->{added}, getUser($EM)->{last_login})
|
| 166 |
or $ERRMSG = "ERROR: Can't execute SQL statement: ".$sth->errstr()."\n";
|
166 |
or $ERRMSG = "ERROR: Can't execute SQL statement: ".$sth->errstr()."\n";
|
| Line 167... |
Line 167... |
| 167 |
}
|
167 |
}
|
| 168 |
|
168 |
|
| Line 182... |
Line 182... |
| 182 |
}
|
182 |
}
|
| Line 183... |
Line 183... |
| 183 |
|
183 |
|
| 184 |
if ($FORM->{password}) {
|
184 |
if ($FORM->{password}) {
|
| 185 |
# my $sth = $dbh->prepare ("replace into official (RCid, email, password, derby_name, real_name, phone, level, type, access, department, clinic_pass) values (?, ?, password(?), ?, ?, ?, ?, ?, ?, ?, ?)");
|
185 |
# my $sth = $dbh->prepare ("replace into official (RCid, email, password, derby_name, real_name, phone, level, type, access, department, clinic_pass) values (?, ?, password(?), ?, ?, ?, ?, ?, ?, ?, ?)");
|
| 186 |
# $sth->execute ($F->{RCid}, $F->{email}, $F->{password}, $F->{derby_name}, $F->{real_name}, $F->{phone}, $F->{level}, $F->{type}, $F->{access}, $F->{department}, $F->{clinic_pass})
|
186 |
# $sth->execute ($F->{RCid}, $F->{email}, $F->{password}, $F->{derby_name}, $F->{real_name}, $F->{phone}, $F->{level}, $F->{type}, $F->{access}, $F->{department}, $F->{clinic_pass})
|
| 187 |
my $sth = $dbh->prepare ("replace into official (RCid, email, password, derby_name, real_name, pronouns, tshirt, phone, activation, timeformat, access, mvp_pass, department, added, last_login) values (?, ?, password(?), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
187 |
my $sth = $dbh->prepare ("replace into official (RCid, email, password, derby_name, real_name, pronouns, tshirt, phone, activation, timeformat, access, department, added, last_login) values (?, ?, password(?), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
| 188 |
$sth->execute ($F->{RCid}, $F->{email}, $F->{password}, $F->{derby_name}, $F->{real_name}, $F->{pronouns}, $F->{tshirt}, $F->{phone}, getUser($F->{email})->{activation}, $F->{timeformat}, $F->{access}, $F->{mvp_pass}, $F->{department}, getUser($F->{email})->{added}, getUser($F->{email})->{last_login})
|
188 |
$sth->execute ($F->{RCid}, $F->{email}, $F->{password}, $F->{derby_name}, $F->{real_name}, $F->{pronouns}, $F->{tshirt}, $F->{phone}, getUser($F->{email})->{activation}, $F->{timeformat}, $F->{access}, $F->{department}, getUser($F->{email})->{added}, getUser($F->{email})->{last_login})
|
| 189 |
or $ERRMSG = "ERROR: Can't execute SQL statement: ".$sth->errstr()."\n";
|
189 |
or $ERRMSG = "ERROR: Can't execute SQL statement: ".$sth->errstr()."\n";
|
| 190 |
} else {
|
190 |
} else {
|
| 191 |
# my $sth = $dbh->prepare ("update official set email = ?, derby_name = ?, real_name = ?, phone = ?, level = ?, type = ?, access = ?, department = ?, clinic_pass = ? where RCid = ?");
|
191 |
# my $sth = $dbh->prepare ("update official set email = ?, derby_name = ?, real_name = ?, phone = ?, level = ?, type = ?, access = ?, department = ?, clinic_pass = ? where RCid = ?");
|
| 192 |
# $sth->execute ($F->{email}, $F->{derby_name}, $F->{real_name}, $F->{phone}, $F->{level}, $F->{type}, $F->{access}, $F->{department}, $F->{clinic_pass}, $F->{RCid})
|
192 |
# $sth->execute ($F->{email}, $F->{derby_name}, $F->{real_name}, $F->{phone}, $F->{level}, $F->{type}, $F->{access}, $F->{department}, $F->{clinic_pass}, $F->{RCid})
|
| 193 |
my $sth = $dbh->prepare ("update official set email = ?, derby_name = ?, real_name = ?, pronouns = ?, tshirt = ?, phone = ?, timeformat = ?, access = ?, mvp_pass = ?, department = ? where RCid = ?");
|
193 |
my $sth = $dbh->prepare ("update official set email = ?, derby_name = ?, real_name = ?, pronouns = ?, tshirt = ?, phone = ?, timeformat = ?, access = ?, department = ? where RCid = ?");
|
| 194 |
$sth->execute ($F->{email}, $F->{derby_name}, $F->{real_name}, $F->{pronouns}, $F->{tshirt}, $F->{phone}, $F->{timeformat}, $F->{access}, $F->{mvp_pass}, $F->{department}, $F->{RCid})
|
194 |
$sth->execute ($F->{email}, $F->{derby_name}, $F->{real_name}, $F->{pronouns}, $F->{tshirt}, $F->{phone}, $F->{timeformat}, $F->{access}, $F->{department}, $F->{RCid})
|
| 195 |
or $ERRMSG = "ERROR: Can't execute SQL statement: ".$sth->errstr()."\n";
|
195 |
or $ERRMSG = "ERROR: Can't execute SQL statement: ".$sth->errstr()."\n";
|
| 196 |
}
|
196 |
}
|
| 197 |
if ($ERRMSG) {
|
197 |
if ($ERRMSG) {
|
| 198 |
logit ($F->{RCid}, "DB ERROR: Updating Someone Else: $ERRMSG");
|
198 |
logit ($F->{RCid}, "DB ERROR: Updating Someone Else: $ERRMSG");
|
| Line 205... |
Line 205... |
| 205 |
logit ($F->{RCid}, "FAIL: ($EM) doesn't have access to update ($F->{email})'s record");
|
205 |
logit ($F->{RCid}, "FAIL: ($EM) doesn't have access to update ($F->{email})'s record");
|
| 206 |
}
|
206 |
}
|
| 207 |
}
|
207 |
}
|
| 208 |
$F->{password} = "*******";
|
208 |
$F->{password} = "*******";
|
| 209 |
$F->{buttons} = $h->input ({ type=>"hidden", name=>"RCid", value=>$F->{RCid} }).$h->input ({ type=>"submit", name=>"submit", value=>"Edit" });
|
209 |
$F->{buttons} = $h->input ({ type=>"hidden", name=>"RCid", value=>$F->{RCid} }).$h->input ({ type=>"submit", name=>"submit", value=>"Edit" });
|
| 210 |
if ($F->{mvp_pass}) {
|
210 |
# if ($F->{mvp_pass}) {
|
| 211 |
$F->{mvp_pass} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"mvp_pass", value=>1, readonly=>[], disabled=>[], checked=>[] }), $h->span ({ class=>"slider round" })]);
|
211 |
# $F->{mvp_pass} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"mvp_pass", value=>1, readonly=>[], disabled=>[], checked=>[] }), $h->span ({ class=>"slider round" })]);
|
| 212 |
} else {
|
212 |
# } else {
|
| 213 |
$F->{mvp_pass} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"mvp_pass", value=>0, readonly=>[], disabled=>[] }), $h->span ({ class=>"slider round" })]);
|
213 |
# $F->{mvp_pass} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"mvp_pass", value=>0, readonly=>[], disabled=>[] }), $h->span ({ class=>"slider round" })]);
|
| 214 |
}
|
214 |
# }
|
| 215 |
$F->{department} = convertDepartments ($F->{department});
|
215 |
$F->{department} = convertDepartments ($F->{department});
|
| - |
|
216 |
$dbh->do ("replace into RCid_ticket_link select official.RCid, v_ticket.id from official join v_ticket on official.email = v_ticket.email and official.real_name = v_ticket.full_name where official.RCid = ?", undef, $F->{RCid});
|
| Line 216... |
Line 217... |
| 216 |
|
217 |
|
| 217 |
display_form ($F->{RCid}, "View");
|
218 |
display_form ($F->{RCid}, "View");
|
| Line 218... |
Line 219... |
| 218 |
}
|
219 |
}
|
| Line 238... |
Line 239... |
| 238 |
$F->{access} = $h->input ({ type=>"hidden", name=>"access", value=>$F->{access} }).$AccessLevel->{$F->{access}};
|
239 |
$F->{access} = $h->input ({ type=>"hidden", name=>"access", value=>$F->{access} }).$AccessLevel->{$F->{access}};
|
| 239 |
} else {
|
240 |
} else {
|
| 240 |
$F->{access} = $h->select ({ name=>"access" }, [map { $F->{access} == $_ ? $h->option ({ value=>$_, selected=>[] }, $AccessLevel->{$_}) : $h->option ({ value=>$_ }, $AccessLevel->{$_}) } (-1..$currentuser->{access})]);
|
241 |
$F->{access} = $h->select ({ name=>"access" }, [map { $F->{access} == $_ ? $h->option ({ value=>$_, selected=>[] }, $AccessLevel->{$_}) : $h->option ({ value=>$_ }, $AccessLevel->{$_}) } (-1..$currentuser->{access})]);
|
| 241 |
}
|
242 |
}
|
| 242 |
if ($currentuser->{access} > 2) { #this would be the place to test for other types of managers that can update the MVP Pass setting
|
243 |
if ($currentuser->{access} > 2) { #this would be the place to test for other types of managers that can update the MVP Pass setting
|
| 243 |
if ($F->{mvp_pass}) {
|
244 |
# if ($F->{mvp_pass}) {
|
| 244 |
$F->{mvp_pass} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"mvp_pass", value=>1, checked=>[] }), $h->span ({ class=>"slider round" })]);
|
245 |
# $F->{mvp_pass} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"mvp_pass", value=>1, checked=>[] }), $h->span ({ class=>"slider round" })]);
|
| 245 |
} else {
|
246 |
# } else {
|
| 246 |
$F->{mvp_pass} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"mvp_pass", value=>0 }), $h->span ({ class=>"slider round" })]);
|
247 |
# $F->{mvp_pass} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"mvp_pass", value=>0 }), $h->span ({ class=>"slider round" })]);
|
| 247 |
}
|
248 |
# }
|
| - |
|
249 |
if ($F->{MVPid}) {
|
| - |
|
250 |
$F->{MVPid} .= "->link to change...<-";
|
| - |
|
251 |
}
|
| 248 |
} else {
|
252 |
} else {
|
| 249 |
if ($F->{mvp_pass}) {
|
253 |
# if ($F->{mvp_pass}) {
|
| 250 |
$F->{mvp_pass} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"mvp_pass", value=>1, readonly=>[], disabled=>[], checked=>[] }), $h->span ({ class=>"slider round" })]);
|
254 |
# $F->{mvp_pass} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"mvp_pass", value=>1, readonly=>[], disabled=>[], checked=>[] }), $h->span ({ class=>"slider round" })]);
|
| 251 |
} else {
|
255 |
# } else {
|
| 252 |
$F->{mvp_pass} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"mvp_pass", value=>0, readonly=>[], disabled=>[] }), $h->span ({ class=>"slider round" })]);
|
256 |
# $F->{mvp_pass} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"mvp_pass", value=>0, readonly=>[], disabled=>[] }), $h->span ({ class=>"slider round" })]);
|
| 253 |
}
|
257 |
# }
|
| 254 |
}
|
258 |
}
|
| 255 |
if ($AL == 5) {
|
259 |
if ($AL == 5) {
|
| 256 |
$F->{email} = $h->input ({ type=>"text", name=>"email", value=>$F->{email} });
|
260 |
$F->{email} = $h->input ({ type=>"text", name=>"email", value=>$F->{email} });
|
| 257 |
} else {
|
261 |
} else {
|
| 258 |
$F->{email} = $F->{email}.$h->input ({ type=>"hidden", name=>"email", value=>$F->{email} });
|
262 |
$F->{email} = $F->{email}.$h->input ({ type=>"hidden", name=>"email", value=>$F->{email} });
|
| Line 309... |
Line 313... |
| 309 |
$F->{timeformat} = $h->select ({ name=>"timeformat" }, [map { $F->{timeformat} eq $_ ? $h->option ({ selected=>[] }, $_) : $h->option ($_) } qw(24hr ampm)] );
|
313 |
$F->{timeformat} = $h->select ({ name=>"timeformat" }, [map { $F->{timeformat} eq $_ ? $h->option ({ selected=>[] }, $_) : $h->option ($_) } qw(24hr ampm)] );
|
| 310 |
# $F->{level} = "<SELECT NAME=level>".selectOptions ($F->{level}, ["", qw(AA A B C)])."</SELECT>";
|
314 |
# $F->{level} = "<SELECT NAME=level>".selectOptions ($F->{level}, ["", qw(AA A B C)])."</SELECT>";
|
| 311 |
# $F->{type} = "<SELECT NAME=type>".selectOptions ($F->{type}, ["", qw(official nso referee)])."</SELECT>";
|
315 |
# $F->{type} = "<SELECT NAME=type>".selectOptions ($F->{type}, ["", qw(official nso referee)])."</SELECT>";
|
| 312 |
$F->{RCid} = $h->input ({ type=>"hidden", name=>"RCid", value=>"New" })."TBD ";
|
316 |
$F->{RCid} = $h->input ({ type=>"hidden", name=>"RCid", value=>"New" })."TBD ";
|
| 313 |
$F->{access} = $h->input ({ type=>"hidden", name=>"access", value=>0 })."0";
|
317 |
$F->{access} = $h->input ({ type=>"hidden", name=>"access", value=>0 })."0";
|
| 314 |
$F->{mvp_pass} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"mvp_pass", value=>0, readonly=>[], disabled=>[] }), $h->span ({ class=>"slider round" })]);
|
318 |
# $F->{mvp_pass} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"mvp_pass", value=>0, readonly=>[], disabled=>[] }), $h->span ({ class=>"slider round" })]);
|
| Line 315... |
Line 319... |
| 315 |
|
319 |
|
| 316 |
$F->{department} = convertDepartments ($F->{department});
|
320 |
$F->{department} = convertDepartments ($F->{department});
|
| 317 |
foreach (sort keys %{$depts}) {
|
321 |
foreach (sort keys %{$depts}) {
|
| 318 |
next if $_ eq "CMP";
|
322 |
next if $_ eq "CMP";
|
| Line 340... |
Line 344... |
| 340 |
$F = $targetuser;
|
344 |
$F = $targetuser;
|
| 341 |
$F->{department} = convertDepartments ($F->{department});
|
345 |
$F->{department} = convertDepartments ($F->{department});
|
| 342 |
$F->{access} = $AccessLevel->{$F->{access}};
|
346 |
$F->{access} = $AccessLevel->{$F->{access}};
|
| 343 |
$F->{'password'} = "*******";
|
347 |
$F->{'password'} = "*******";
|
| 344 |
$F->{buttons} = $h->input ({ type=>"hidden", name=>"RCid", value=>$F->{'RCid'} }).$h->input ({ type=>"submit", name=>"submit", value=>"Edit" });
|
348 |
$F->{buttons} = $h->input ({ type=>"hidden", name=>"RCid", value=>$F->{'RCid'} }).$h->input ({ type=>"submit", name=>"submit", value=>"Edit" });
|
| 345 |
if ($F->{mvp_pass}) {
|
349 |
# if ($F->{mvp_pass}) {
|
| 346 |
$F->{mvp_pass} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"mvp_pass", value=>1, readonly=>[], disabled=>[], checked=>[] }), $h->span ({ class=>"slider round" })]);
|
350 |
# $F->{mvp_pass} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"mvp_pass", value=>1, readonly=>[], disabled=>[], checked=>[] }), $h->span ({ class=>"slider round" })]);
|
| 347 |
} else {
|
351 |
# } else {
|
| 348 |
$F->{mvp_pass} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"mvp_pass", value=>0, readonly=>[], disabled=>[] }), $h->span ({ class=>"slider round" })]);
|
352 |
# $F->{mvp_pass} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"mvp_pass", value=>0, readonly=>[], disabled=>[] }), $h->span ({ class=>"slider round" })]);
|
| 349 |
}
|
353 |
# }
|
| - |
|
354 |
if ($currentuser->{access} > 2 or convertDepartments($currentuser->{department})->{MVP} >= 2) {
|
| - |
|
355 |
if($F->{MVPid}) {
|
| - |
|
356 |
$F->{MVPid} .= ' ' . $h->button ({ onClick=>"window.open('update_mvp_ticket.pl?change=Delete&RCid=$F->{RCid}&MVPid=$F->{MVPid}','Change MVP Ticket','resizable,height=260,width=370'); return false;" }, "Delete Match");
|
| - |
|
357 |
} else {
|
| - |
|
358 |
$F->{MVPid} .= $h->button ({ onClick=>"window.open('update_mvp_ticket.pl?change=lookup&RCid=$F->{RCid}','Change MVP Ticket','resizable,height=260,width=370'); return false;" }, "Manual Match");
|
| - |
|
359 |
my $possible_matches = $dbh->selectall_arrayref ("select id, full_name from v_ticket where isnull(RCid) = true and email = (select email from official where RCid = ?) union
|
| - |
|
360 |
select id, full_name from v_ticket where isnull(RCid) = true and full_name = (select real_name from official where RCid = ?) union
|
| - |
|
361 |
select id, full_name from v_ticket where isnull(RCid) = true and derby_name = (select derby_name from official where RCid = ?)", undef, $F->{RCid}, $F->{RCid}, $F->{RCid});
|
| - |
|
362 |
|
| - |
|
363 |
foreach my $match (@$possible_matches) {
|
| - |
|
364 |
my ($MVPid, $fullname) = @$match;
|
| - |
|
365 |
# $t->{derby_name} = "<A HREF='#' onClick=\"event.stopPropagation(); window.open('make_shift_change.pl?change=add&RCid=$RCid&id=$t->{id}','Confirm Shift Change','resizable,height=260,width=370'); return false;\">[SIGN UP]</a>";
|
| - |
|
366 |
|
| - |
|
367 |
$F->{MVPid} .= $h->div ({ class => "hint" }, ["Possible Match: @$match", ' ', $h->button ({ onClick=>"window.open('update_mvp_ticket.pl?change=add&RCid=$F->{RCid}&MVPid=$MVPid','Change MVP Ticket','resizable,height=260,width=370'); return false;" }, "Accept Match")]);
|
| - |
|
368 |
}
|
| - |
|
369 |
}
|
| - |
|
370 |
}
|
| 350 |
} else {
|
371 |
} else {
|
| 351 |
logit ($currentuser->{RCid}, "SECURITY: $currentuser->{derby_name} attempted to view another user's ($RCID) info");
|
372 |
logit ($currentuser->{RCid}, "SECURITY: $currentuser->{derby_name} attempted to view another user's ($RCID) info");
|
| 352 |
$errors = "Unauthorized attempt to view another user. This has been logged.";
|
373 |
$errors = "Unauthorized attempt to view another user. This has been logged.";
|
| 353 |
$F->{email} = " ";
|
374 |
$F->{email} = " ";
|
| 354 |
$F->{password} = " ";
|
375 |
$F->{password} = " ";
|
| Line 360... |
Line 381... |
| 360 |
$F->{timeformat} = " ";
|
381 |
$F->{timeformat} = " ";
|
| 361 |
# $F->{level} = " ";
|
382 |
# $F->{level} = " ";
|
| 362 |
# $F->{type} = " ";
|
383 |
# $F->{type} = " ";
|
| 363 |
$F->{RCid} = " ";
|
384 |
$F->{RCid} = " ";
|
| 364 |
$F->{access} = " ";
|
385 |
$F->{access} = " ";
|
| 365 |
$F->{mvp_pass} = " ";
|
386 |
$F->{MVPid} = " ";
|
| 366 |
$F->{buttons} = " ";
|
387 |
$F->{buttons} = " ";
|
| 367 |
}
|
388 |
}
|
| Line 368... |
Line 389... |
| 368 |
|
389 |
|
| 369 |
# if (lc $EM eq lc $F->{email} or $AL > 1) {
|
390 |
# if (lc $EM eq lc $F->{email} or $AL > 1) {
|
| Line 400... |
Line 421... |
| 400 |
$errors = $h->div ({ class=>"error" }, $errors);
|
421 |
$errors = $h->div ({ class=>"error" }, $errors);
|
| 401 |
} else {
|
422 |
} else {
|
| 402 |
$errors = "";
|
423 |
$errors = "";
|
| 403 |
}
|
424 |
}
|
| Line 404... |
Line 425... |
| 404 |
|
425 |
|
| 405 |
my @printDepartments = ( $h->div ({ class=>"index", style=>"display: unset;" }, $h->p ({ class=>"heading" }, "Department Access:")) );
|
426 |
my @printDepartments = ( $h->div ({ class=>"index", style=>"display: unset;" }, $h->p ({ class=>"heading" }, "Volunteer Department Access:")) );
|
| 406 |
# push @printDepartments, $h->div ({ class=>"rTableRow" }, $h->div ({ class=>"rTableCellr hint", style=>"display:block;" }, "Here is where you're signed up to volunteer at RollerCon:"));
|
427 |
# push @printDepartments, $h->div ({ class=>"rTableRow" }, $h->div ({ class=>"rTableCellr hint", style=>"display:block;" }, "Here is where you're signed up to volunteer at RollerCon:"));
|
| 407 |
push @printDepartments, $h->div ({ class=>"rTableRowSpan" },[ $h->div ({ style=>"rTableCellr" }, $h->div ({ class=>"hint" }, "Here is where you're signed up to volunteer at RollerCon:")) ]);
|
428 |
push @printDepartments, $h->div ({ class=>"rTableRowSpan" },[ $h->div ({ style=>"rTableCellr" }, $h->div ({ class=>"hint" }, "Here is where you're signed up to volunteer at RollerCon:")) ]);
|
| 408 |
# push @printDepartments, $h->div ({ class=>"hint", style=>"display: unset;" }, "Here is where you're signed up to volunteer at RollerCon:");
|
429 |
# push @printDepartments, $h->div ({ class=>"hint", style=>"display: unset;" }, "Here is where you're signed up to volunteer at RollerCon:");
|
| 409 |
foreach (sort grep { !/^PER$/ } keys %{$F->{department}}) {
|
430 |
foreach (sort grep { !/^PER$/ } keys %{$F->{department}}) {
|
| Line 422... |
Line 443... |
| 422 |
$h->div ({ class=>"index" }, [$h->p ({ class=>"heading" }, "User Details:"),
|
443 |
$h->div ({ class=>"index" }, [$h->p ({ class=>"heading" }, "User Details:"),
|
| 423 |
$h->div ({ class=>"rTable", style=>"min-width: 0%;" },[
|
444 |
$h->div ({ class=>"rTable", style=>"min-width: 0%;" },[
|
| 424 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "User-ID / Email Address: ", $F->{email}) ]),
|
445 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "User-ID / Email Address: ", $F->{email}) ]),
|
| 425 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Password: ", $F->{password}) ]),
|
446 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Password: ", $F->{password}) ]),
|
| 426 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Derby Name: ", $F->{derby_name}) ]),
|
447 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Derby Name: ", $F->{derby_name}) ]),
|
| 427 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Real Name: ", $F->{real_name}) ]),
|
448 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Full Name: ", $F->{real_name}) ]),
|
| 428 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Pronouns: ", $F->{pronouns}) ]),
|
449 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Pronouns: ", $F->{pronouns}) ]),
|
| 429 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "TShirt Size: ", $F->{tshirt}) ]),
|
450 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "TShirt Size: ", $F->{tshirt}) ]),
|
| 430 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Phone: ", $F->{phone}) ]),
|
451 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Phone: ", $F->{phone}) ]),
|
| 431 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Time Format: ", $F->{timeformat}) ]),
|
452 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Time Format: ", $F->{timeformat}) ]),
|
| 432 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Database ID: ", $F->{RCid}) ]),
|
453 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Database ID: ", $F->{RCid}) ]),
|
| 433 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "User Added: ", $F->{added}) ]),
|
454 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "User Added: ", $F->{added}) ]),
|
| 434 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Last Login: ", $F->{last_login}) ]),
|
455 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Last Login: ", $F->{last_login}) ]),
|
| 435 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "vORC Access Level: ", $F->{access}) ]),
|
456 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "vORC Access Level: ", $F->{access}) ]),
|
| 436 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "MVP Pass: ", $F->{mvp_pass}) ]),
|
457 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "MVP Pass: ", $F->{MVPid}) ]),
|
| 437 |
@printDepartments,
|
458 |
@printDepartments,
|
| 438 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCell" }, " ") ]),
|
459 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCell" }, " ") ]),
|
| 439 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr" }, $h->a ({ href=>$goback }, "[go back]"), $F->{buttons}) ])
|
460 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr" }, $h->a ({ href=>$goback }, "[go back]"), $F->{buttons}) ])
|
| 440 |
])
|
461 |
])
|
| 441 |
])
|
462 |
])
|