Ticket #1228 (closed defect: fixed)

Opened 2 months ago

Last modified 2 months ago

Change in edit_mail_acc.php in change set 1132

Reported by: JCD Assigned to:
Priority: major Milestone: ispCP ω 1.0.0 - RC5
Component: Backend (Engine) Version: ispCP ω 1.0.0 - RC4
Severity: Easy Keywords:
Cc:

Description

The introduced change in change set 1132 in "edit_mail_acc.php" is:

if (($mail_forward === '_no_') ||(count($mtype) > 1)) {

but I think it should be:

if (!($mail_forward === '_no_') && (count($mtype) > 1)) {

Otherwise the edit page shows the forward list with a value of "_no_" for mail accounts without forward.

Attachments

Change History

05/02/2008 09:25:00 PM changed by JCD

I didn't see, that you also consolidated the whole "if" block starting line 128. The new code is

if (($mail_forward === '_no_') || (count($mtype) > 1)) {
	$tpl->assign(
			array(
				'ACTION' => 'update_pass,update_forward',
				'FORWARD_MAIL' => '',
				'FORWARD_MAIL_CHECKED' => 'checked="checked"'
				)
			);
	$tpl->parse('NORMAL_MAIL', '.normal_mail');
} else {
	$tpl->assign(
			array(
				'ACTION' => 'update_forward',
				'NORMAL_MAIL' => ''
				)
			);
	$tpl->parse('FORWARD_MAIL', '.forward_mail');
}

whereas the old one was:

if (!($mail_forward === '_no_') && (count($mtype) > 1)) {
	$tpl->assign(
			array(
				'ACTION' => 'update_pass,update_forward',
				'FORWARD_MAIL' => '',
				'FORWARD_MAIL_CHECKED' => 'checked="checked"'
				)
			);
	$tpl->parse('NORMAL_MAIL', '.normal_mail');
} else if ($mail_forward === '_no_') {
	$tpl->assign(
			array(
				'ACTION' => 'update_pass',
				'FORWARD_MAIL' => '',
				'FORWARD_MAIL_CHECKED' => '',
				'FORWARD_LIST' => '',
				'FORWARD_LIST_ENABLED' => 'disabled="disabled"'
				)
			);
	$tpl->parse('NORMAL_MAIL', '.normal_mail');
} else {
	$tpl->assign(
			array(
				'ACTION' => 'update_forward',
				'NORMAL_MAIL' => ''
				)
			);
	$tpl->parse('FORWARD_MAIL', '.forward_mail');
}

With the old code (and my fix from above) this bug isn't there.

(follow-up: ↓ 3 ) 05/02/2008 10:01:52 PM changed by JCD

I found another bug. If you don't enter a password and also no forward, the empty password isn't recognized. This happens because after

$pass = escapeshellcmd($_POST['pass']);

$pass somehow has a value of " ". So it isn't recognized by

if ($pass === '' || $pass_rep === '' || $mail_id === '' || !is_numeric($mail_id)) {

This here seems to do the job:

if (tr($pass) === '' || tr($pass_rep) === '' || tr($mail_id) === '' || !is_numeric($mail_id)) {

(in reply to: ↑ 2 ; follow-up: ↓ 6 ) 05/02/2008 11:30:34 PM changed by rats

Replying to JCD:

{{{ tr($pass) === }}}

is allways true

05/02/2008 11:53:02 PM changed by rats

  • status changed from new to closed.
  • resolution set to fixed.

fixed in r1133 - I hope it's the last fix of this :)

05/02/2008 11:53:40 PM changed by rats

  • milestone changed from Working to ispCP ω 1.0.0 - RC5.

(in reply to: ↑ 3 ) 05/05/2008 12:26:06 PM changed by anonymous

Replying to rats:

Replying to JCD:

{{{ tr($pass) === }}}

is allways true

I'm sorry, that was pure nonsense. :-) That should be

trim($pass)

and not tr(). I don't know why I mixed that up. But tr() did also the job. ;-)

Ok, back to business. Without trim() you can enter no password without detection which causes an error like described in my message from 05/02/08 22:01:52.

I'm still working on the other issue described in ticket 1220. I suppose we leave this ticket closed and I'll attach my patches to ticket 1220.

05/15/2008 07:47:39 PM changed by tsuetf


Add/Change #1228 (Change in edit_mail_acc.php in change set 1132)




Action