New function to see if someone wants to receive email

This commit is contained in:
Jonathan Ernst
2005-02-02 02:42:28 +00:00
committed by WineHQ
parent 863467667d
commit 039fba9a6a

View File

@@ -265,6 +265,7 @@ class User {
return $hRresult; return $hRresult;
} }
/** /**
* Checks if the current user is valid. * Checks if the current user is valid.
*/ */
@@ -276,12 +277,20 @@ class User {
/** /**
* Checks if user should see debugging infos. * Checks if user should see debugging infos.
*
*/ */
function showDebuggingInfos() function showDebuggingInfos()
{ {
return (($this->isLoggedIn() && $this->getPref("debug") == "yes") || APPDB_DEBUG == 1); return (($this->isLoggedIn() && $this->getPref("debug") == "yes") || APPDB_DEBUG == 1);
} }
/**
* Checks if user wants to get e-mails.
*/
function wantsEmail()
{
return ($this->isLoggedIn() && $this->getPref("send_email","yes")=="yes");
}
} }
@@ -347,7 +356,7 @@ function get_notify_email_address_list($appId, $versionId = 0)
while(list($index, list($userIdValue)) = each($aUserId)) while(list($index, list($userIdValue)) = each($aUserId))
{ {
$oUser = new User($userIdValue); $oUser = new User($userIdValue);
if ($oUser->getPref("send_email")=="yes") if ($oUser->wantsEmail())
$retval .= $oUser->sEmail." "; $retval .= $oUser->sEmail." ";
} }
} }