[sork] passwd module and poppassd driver errors

Leena Heino Leena.Heino at uta.fi
Tue Jan 28 11:31:34 PST 2003


I'm using the RELENG version and the poppasswd driver, but the same
problem might also be with HEAD version.

It seems that the error message returned by poppassd is ignored.
in _getPromt()
...
  return PEAR::raiseError($prompt);

But in change_password()
...
if (is_a($res, 'PEAR_Error')) {
  return PEAR::raiseError(_("Error Changing Password"));

Which overwrites the previous error message and user only gets the
error message "Error Changing Password". This error message is very vague
and confusing as it does not give user any hint as to what really might
have gone wrong with the password change.

Maybe the better solution would be to return $res not the vague error
message "Error Changing Password".
if (is_a($res, 'PEAR_Error')) {
   return $res
}

The downside with solution like this is that we lose the translated
message.

-- 
  -- Leena Heino (liinu at uta.fi)


More information about the sork mailing list