当前位置: 首页>>代码示例>>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;未经允许,请勿转载。