本文整理匯總了PHP中OutboundEmail::doesUserOverrideAccountRequireCredentials方法的典型用法代碼示例。如果您正苦於以下問題:PHP OutboundEmail::doesUserOverrideAccountRequireCredentials方法的具體用法?PHP OutboundEmail::doesUserOverrideAccountRequireCredentials怎麽用?PHP OutboundEmail::doesUserOverrideAccountRequireCredentials使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OutboundEmail
的用法示例。
在下文中一共展示了OutboundEmail::doesUserOverrideAccountRequireCredentials方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testIsUserAuthRequiredForOverrideAccount
function testIsUserAuthRequiredForOverrideAccount()
{
$oe = new OutboundEmail();
$GLOBALS['db']->query("DELETE FROM config WHERE category='notify' AND name='allow_default_outbound' ");
$system = $oe->getSystemMailerSettings();
//System does not require auth, no user overide account.
$system->mail_smtpauth_req = 0;
$system->save(FALSE);
$notRequired = $oe->doesUserOverrideAccountRequireCredentials($this->_user->id);
$this->assertFalse($notRequired, "Test failed for determining if user auth required.");
//System does require auth, no user overide account.
$system->mail_smtpauth_req = 1;
$system->save(FALSE);
$notRequired = $oe->doesUserOverrideAccountRequireCredentials($this->_user->id);
$this->assertTrue($notRequired, "Test failed for determining if user auth required.");
//System requires auth and users alloweed to use sys defaults.
$GLOBALS['db']->query("INSERT INTO config (category,name,value) VALUES ('notify','allow_default_outbound','2') ");
$notRequired = $oe->doesUserOverrideAccountRequireCredentials($this->_user->id);
$this->assertFalse($notRequired, "Test failed for determining if user auth required.");
//System requires auth but user details are empty and users are not alloweed to use system details..
$GLOBALS['db']->query("DELETE FROM config WHERE category='notify' AND name='allow_default_outbound' ");
$userOverideAccont = $oe->createUserSystemOverrideAccount($this->_user->id, "", "");
$this->userOverideAccont = $userOverideAccont;
$notRequired = $oe->doesUserOverrideAccountRequireCredentials($this->_user->id);
$this->assertTrue($notRequired, "Test failed for determining if user auth required.");
//User has provided all credentials.
$this->userOverideAccont->mail_smtpuser = "TEST USER NAME";
$this->userOverideAccont->mail_smtppass = "TEST PASSWORD";
$this->userOverideAccont->new_with_id = FALSE;
$this->userOverideAccont->save();
$notRequired = $oe->doesUserOverrideAccountRequireCredentials($this->_user->id);
$this->assertFalse($notRequired, "Test failed for determining if user auth required.");
}
示例2: foreach
foreach ($sigs as $k => $v) {
if ($k == "") {
$sigs[$k] = $app_strings['LBL_NONE'];
} else {
if (is_array($v) && isset($v['name'])) {
$sigs[$k] = $v['name'];
} else {
$sigs[$k] = $v;
}
}
}
$out['signatures'] = $sigs;
$out['fromAccounts'] = $email->et->getFromAccountsArray($ie);
$out['errorArray'] = array();
$oe = new OutboundEmail();
if ($oe->doesUserOverrideAccountRequireCredentials($current_user->id)) {
$overideAccount = $oe->getUsersMailerForSystemOverride($current_user->id);
//If the user override account has not been created yet, create it for the user.
if ($overideAccount == null) {
$overideAccount = $oe->createUserSystemOverrideAccount($current_user->id);
}
$out['errorArray'] = array($overideAccount->id => $app_strings['LBL_EMAIL_WARNING_MISSING_USER_CREDS']);
}
$ret = $json->encode($out);
echo $ret;
break;
case "getSignature":
$GLOBALS['log']->debug("********** EMAIL 2.0 - Asynchronous - at: getSignature");
if (isset($_REQUEST['id'])) {
$signature = $current_user->getSignature($_REQUEST['id']);
$signature['signature_html'] = from_html($signature['signature_html']);