Skip to content

Commit

Permalink
save new user in spite of errors
Browse files Browse the repository at this point in the history
fix netPhotoGraphics#958

After all, the admin can always delete the user and start over if that
is what he wanted.
  • Loading branch information
sbillard committed Aug 10, 2015
1 parent 0d459fc commit 48997d4
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions zp-core/admin-users.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,12 @@ function markUpdated() {
if ($updated) {
$returntab .= '&show[]=' . $user;
$msg = zp_apply_filter('save_user', $msg, $userobj, $what);
if (empty($msg)) {
if (!$notify)
$userobj->transient = false;
$userobj->save();
} else {
if (!empty($msg)) {
$notify = '?mismatch=format&error=' . urlencode($msg);
$error = true;
}
$userobj->transient = false;
$userobj->save();
}
}
}
Expand Down Expand Up @@ -588,8 +586,8 @@ function languageChange(id, lang) {
}
?>
<a id="toggle_<?php echo $id; ?>" onclick="visible = getVisible('<?php echo $id; ?>', 'user', '<?php echo $displaytitle; ?>', '<?php echo $hidetitle; ?>');
$('#show_<?php echo $id; ?>').val(visible);
toggleExtraInfo('<?php echo $id; ?>', 'user', visible);" title="<?php echo $displaytitle; ?>" >
$('#show_<?php echo $id; ?>').val(visible);
toggleExtraInfo('<?php echo $id; ?>', 'user', visible);" title="<?php echo $displaytitle; ?>" >
<?php
if (empty($userid)) {
?>
Expand All @@ -598,7 +596,7 @@ function languageChange(id, lang) {
<em><?php echo gettext("New User"); ?></em>
<input type="text" size="<?php echo TEXT_INPUT_SIZE; ?>" id="adminuser<?php echo $id; ?>" name="adminuser<?php echo $id; ?>" value=""
onclick="toggleExtraInfo('<?php echo $id; ?>', 'user', visible);
$('#adminuser<?php echo $id; ?>').focus();" />
$('#adminuser<?php echo $id; ?>').focus();" />

<?php
} else {
Expand Down Expand Up @@ -677,13 +675,13 @@ function languageChange(id, lang) {
<p>
<?php
$pad = false;
$pwd = $userobj->getPass();
if (!empty($userid) && !$clearPass) {
$x = $userobj->getPass();
if (!empty($x)) {
if (!empty($pwd)) {
$pad = true;
}
}
if (in_array('password', $no_change)) {
if (!empty($pwd) && in_array('password', $no_change)) {
$password_disable = ' disabled="disabled"';
} else {
$password_disable = '';
Expand Down

0 comments on commit 48997d4

Please sign in to comment.