$this->setError(_('ERROR: Invalid status value'));
return false;
}
+ if ($this->getStatus() != 'P' && $status == 'P') {
+ $this->setError('ERROR: You can\'t set pending status if user is suspend or active');
+ return false;
+ }
db_begin();
$res = db_query_params ('UPDATE users SET status=$1 WHERE user_id=$2',
_('Active (A)'),
_('Suspended (S)'),
_('Deleted (D)'));
-} else {
+} else if ($u->getStatus() == 'P') {
$status_letter = array('P','A','S');
$status_text = array(_('Pending (P)'),
_('Active (A)'),
_('Suspended (S)'));
+} else {
+ $status_letter = array('A','S');
+ $status_text = array(_('Active (A)'),
+ _('Suspended (S)'));
}
echo html_build_select_box_from_arrays(
$status_letter, $status_text,'status', $u->getStatus(), false);