當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OutboundEmail::doesUserOverrideAccountRequireCredentials方法代碼示例

本文整理匯總了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.");
 }
開發者ID:netconstructor,項目名稱:sugarcrm_dev,代碼行數:33,代碼來源:Bug23140Test.php

示例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']);
開發者ID:jgera,項目名稱:sugarcrm_dev,代碼行數:31,代碼來源:EmailUIAjax.php


注:本文中的OutboundEmail::doesUserOverrideAccountRequireCredentials方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。