当前位置: 首页>>代码示例>>PHP>>正文


PHP OutboundEmail::getSystemMailerSettings方法代码示例

本文整理汇总了PHP中OutboundEmail::getSystemMailerSettings方法的典型用法代码示例。如果您正苦于以下问题:PHP OutboundEmail::getSystemMailerSettings方法的具体用法?PHP OutboundEmail::getSystemMailerSettings怎么用?PHP OutboundEmail::getSystemMailerSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OutboundEmail的用法示例。


在下文中一共展示了OutboundEmail::getSystemMailerSettings方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: retrieveSettings

 function retrieveSettings($category = FALSE, $clean = false)
 {
     // declare a cache for all settings
     static $settings_cache = array();
     if ($clean) {
         $settings_cache = array();
     }
     // Check for a cache hit
     if (!empty($settings_cache)) {
         $this->settings = $settings_cache;
         return $this;
     }
     $query = "SELECT category, name, value FROM {$this->table_name}";
     $result = $this->db->query($query, true, "Unable to retrieve system settings");
     if (empty($result)) {
         return NULL;
     }
     while ($row = $this->db->fetchByAssoc($result, -1, true)) {
         $this->settings[$row['category'] . "_" . $row['name']] = $row['value'];
     }
     // outbound email settings
     $oe = new OutboundEmail();
     $oe->getSystemMailerSettings();
     foreach ($oe->field_defs as $def) {
         if (strpos($def, "mail_") !== false) {
             $this->settings[$def] = $oe->{$def};
         }
     }
     // At this point, we have built a new array that should be cached.
     $settings_cache = $this->settings;
     return $this;
 }
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:32,代码来源:Administration.php

示例2: getUsersDefaultOutboundServerId

 /**
  * Get the users default IE account id
  *
  * @param User $user
  * @return string
  */
 function getUsersDefaultOutboundServerId($user)
 {
     $id = $user->getPreference($this->keyForUsersDefaultIEAccount, 'Emails', $user);
     //If no preference has been set, grab the default system id.
     if (empty($id)) {
         $oe = new OutboundEmail();
         $system = $oe->getSystemMailerSettings();
         $id = empty($system->id) ? '' : $system->id;
     }
     return $id;
 }
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:17,代码来源:InboundEmail.php

示例3: getFromAllAccountsArray

 /**
  * This function will return all the accounts this user has access to based on the
  * match of the emailId passed in as a parameter
  *
  * @param unknown_type $ie
  * @return unknown
  */
 function getFromAllAccountsArray($ie, $ret)
 {
     global $current_user;
     global $app_strings;
     $ret['fromAccounts'] = array();
     if (!isset($ret['to']) && !empty($ret['from'])) {
         $ret['fromAccounts']['status'] = false;
         return $ret;
     }
     $ieAccountsFull = $ie->retrieveAllByGroupIdWithGroupAccounts($current_user->id);
     $foundInPersonalAccounts = false;
     $foundInGroupAccounts = false;
     $foundInSystemAccounts = false;
     //$toArray = array();
     if ($ret['type'] == "draft") {
         $toArray = explode(",", $ret['from']);
     } else {
         $toArray = $ie->email->email2ParseAddressesForAddressesOnly($ret['to']);
     }
     // else
     foreach ($ieAccountsFull as $k => $v) {
         $storedOptions = unserialize(base64_decode($v->stored_options));
         if (array_search_insensitive($storedOptions['from_addr'], $toArray)) {
             if ($v->is_personal) {
                 $foundInPersonalAccounts = true;
                 break;
             } else {
                 $foundInGroupAccounts = true;
             }
             // else
         }
         // if
     }
     // foreach
     $oe = new OutboundEmail();
     $system = $oe->getSystemMailerSettings();
     $return = $current_user->getUsersNameAndEmail();
     $return['name'] = from_html($return['name']);
     $useMyAccountString = true;
     if (empty($return['email'])) {
         $systemReturn = $current_user->getSystemDefaultNameAndEmail();
         $return['email'] = $systemReturn['email'];
         $return['name'] = from_html($systemReturn['name']);
         $useMyAccountString = false;
     }
     // if
     $myAccountString = '';
     if ($useMyAccountString) {
         $myAccountString = " - {$app_strings['LBL_MY_ACCOUNT']}";
     }
     // if
     if (!empty($system->id)) {
         $admin = new Administration();
         $admin->retrieveSettings();
         //retrieve all admin settings.
         if (in_array(trim($return['email']), $toArray)) {
             $foundInSystemAccounts = true;
         }
         // if
     }
     // if
     if (!$foundInPersonalAccounts && !$foundInGroupAccounts && !$foundInSystemAccounts) {
         $ret['fromAccounts']['status'] = false;
         return $ret;
     }
     // if
     $ieAccountsFrom = array();
     foreach ($ieAccountsFull as $k => $v) {
         $storedOptions = unserialize(base64_decode($v->stored_options));
         $storedOptionsName = from_html($storedOptions['from_name']);
         $selected = false;
         if (array_search_insensitive($storedOptions['from_addr'], $toArray)) {
             //if ($ret['to'] == $storedOptions['from_addr']) {
             $selected = true;
         }
         // if
         if ($foundInPersonalAccounts) {
             if ($v->is_personal) {
                 $ieAccountsFrom[] = array("value" => $v->id, "selected" => $selected, "text" => "{$storedOptionsName} ({$storedOptions['from_addr']})");
             }
             // if
         } else {
             $ieAccountsFrom[] = array("value" => $v->id, "selected" => $selected, "text" => "{$storedOptionsName} ({$storedOptions['from_addr']}) - {$app_strings['LBL_EMAIL_UPPER_CASE_GROUP']}");
         }
         // else
     }
     // foreach
     if (!empty($system->id)) {
         if (!$foundInPersonalAccounts && !$foundInGroupAccounts && $foundInSystemAccounts) {
             $ieAccountsFrom[] = array("value" => $system->id, "selected" => true, "text" => "{$return['name']} ({$return['email']}){$myAccountString}");
         } else {
             $ieAccountsFrom[] = array("value" => $system->id, "text" => "{$return['name']} ({$return['email']}){$myAccountString}");
         }
//.........这里部分代码省略.........
开发者ID:NALSS,项目名称:SuiteCRM,代码行数:101,代码来源:EmailUI.php

示例4: OutboundEmail

 /**
  * Determines if a user needs to set their user name/password for their system
  * override account.
  *
  * @param unknown_type $user_id
  * @return unknown
  */
 function doesUserOverrideAccountRequireCredentials($user_id)
 {
     $userCredentialsReq = FALSE;
     $sys = new OutboundEmail();
     $ob = $sys->getSystemMailerSettings();
     //Dirties '$this'
     //If auth for system account is disabled or user can use system outbound account return false.
     if ($ob->mail_smtpauth_req == 0 || $this->isAllowUserAccessToSystemDefaultOutbound() || $this->mail_sendtype == 'sendmail') {
         return $userCredentialsReq;
     }
     $userOverideAccount = $this->getUsersMailerForSystemOverride($user_id);
     if ($userOverideAccount == null || empty($userOverideAccount->mail_smtpuser) || empty($userOverideAccount->mail_smtppass)) {
         $userCredentialsReq = TRUE;
     }
     return $userCredentialsReq;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:23,代码来源:OutboundEmail.php

示例5: 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

示例6: OutboundEmail

// Email Options
$sugar_smarty->assign("EMAIL_OPTIONS", $focus->emailAddress->getEmailAddressWidgetDetailView($focus));
$email_link_type = $focus->getPreference('email_link_type');
if (!empty($email_link_type)) {
    $sugar_smarty->assign('EMAIL_LINK_TYPE', $app_list_strings['dom_email_link_type'][$focus->getPreference('email_link_type')]);
}
if ($focus->getPreference('email_link_type') == 'sugar') {
    $sugar_smarty->assign('SHOW_SMTP_SETTINGS', true);
}
//Handle outbound email templates
$oe = new OutboundEmail();
$userOverrideOE = $oe->getUsersMailerForSystemOverride($focus->id);
$mail_smtpuser = "";
$mail_smtpserver = "";
if ($userOverrideOE == null) {
    $systemOE = $oe->getSystemMailerSettings();
    $mail_smtpdisplay = $systemOE->mail_smtpdisplay;
    $mail_smtpserver = $systemOE->mail_smtpserver;
    $mail_smtptype = $systemOE->mail_smtptype;
    if ($oe->isAllowUserAccessToSystemDefaultOutbound()) {
        $mail_smtpuser = $systemOE->mail_smtpuser;
    }
} else {
    $mail_smtpdisplay = $userOverrideOE->mail_smtpdisplay;
    $mail_smtpuser = $userOverrideOE->mail_smtpuser;
    $mail_smtpserver = $userOverrideOE->mail_smtpserver;
    $mail_smtptype = $userOverrideOE->mail_smtptype;
}
$sugar_smarty->assign("MAIL_SMTPUSER", $mail_smtpuser);
$sugar_smarty->assign("MAIL_SMTPDISPLAY", $mail_smtpdisplay);
$show_roles = !($focus->is_group == '1' || $focus->portal_only == '1');
开发者ID:nartnik,项目名称:sugarcrm_test,代码行数:31,代码来源:DetailView.php

示例7: retrieveSettings

 function retrieveSettings($category = FALSE, $clean = false)
 {
     // declare a cache for all settings
     $settings_cache = sugar_cache_retrieve('admin_settings_cache');
     if ($clean) {
         $settings_cache = array();
     }
     // Check for a cache hit
     if (!empty($settings_cache)) {
         $this->settings = $settings_cache;
         if (!empty($this->settings[$category])) {
             return $this;
         }
     }
     if (!empty($category)) {
         $query = "SELECT category, name, value FROM {$this->table_name} WHERE category = '{$category}'";
     } else {
         $query = "SELECT category, name, value FROM {$this->table_name}";
     }
     $result = $this->db->query($query, true, "Unable to retrieve system settings");
     if (empty($result)) {
         return NULL;
     }
     while ($row = $this->db->fetchByAssoc($result)) {
         if ($row['category'] . "_" . $row['name'] == 'ldap_admin_password' || $row['category'] . "_" . $row['name'] == 'proxy_password') {
             $this->settings[$row['category'] . "_" . $row['name']] = $this->decrypt_after_retrieve($row['value']);
         } else {
             $this->settings[$row['category'] . "_" . $row['name']] = $row['value'];
         }
     }
     $this->settings[$category] = true;
     // outbound email settings
     $oe = new OutboundEmail();
     $oe->getSystemMailerSettings();
     foreach ($oe->field_defs as $def) {
         if (strpos($def, "mail_") !== false) {
             $this->settings[$def] = $oe->{$def};
         }
     }
     // At this point, we have built a new array that should be cached.
     sugar_cache_put('admin_settings_cache', $this->settings);
     return $this;
 }
开发者ID:NALSS,项目名称:SuiteCRM,代码行数:43,代码来源:Administration.php

示例8: savePersonalEmailAccount

 /**
  * Saves Personal Inbox settings for Users
  * @param string userId ID of user to assign all emails for this account
  * @param strings userName Name of account, for Sugar purposes
  * @param bool forceSave Default true.  Flag to save errored settings.
  * @return boolean true on success, false on fail
  */
 function savePersonalEmailAccount($userId = '', $userName = '', $forceSave = true)
 {
     if (!empty($userId)) {
         $groupId = $userId;
     } elseif (isset($_REQUEST['group_id']) && !empty($_REQUEST['group_id'])) {
         $groupId = $_REQUEST['group_id'];
     } else {
         return false;
     }
     $accountExists = false;
     if (isset($_REQUEST['ie_id']) && !empty($_REQUEST['ie_id'])) {
         $this->retrieve($_REQUEST['ie_id']);
         $accountExists = true;
     }
     $ie_name = $_REQUEST['ie_name'];
     $this->is_personal = 1;
     $this->name = $ie_name;
     $this->group_id = $groupId;
     $this->status = $_REQUEST['ie_status'];
     $this->server_url = $_REQUEST['server_url'];
     $this->email_user = $_REQUEST['email_user'];
     $this->email_password = $_REQUEST['email_password'];
     $this->port = $_REQUEST['port'];
     $this->protocol = $_REQUEST['protocol'];
     if ($this->protocol == "pop3") {
         $_REQUEST['mailbox'] = "INBOX";
     }
     $this->mailbox = $_REQUEST['mailbox'];
     $this->mailbox_type = 'pick';
     // forcing this
     if (isset($_REQUEST['ssl']) && $_REQUEST['ssl'] == 1) {
         $useSsl = true;
     } else {
         $useSsl = false;
     }
     $this->service = '::::::::::';
     if ($forceSave) {
         $id = $this->save();
         // saving here to prevent user from having to re-enter all the info in case of error
         $this->retrieve($id);
     }
     $this->protocol = $_REQUEST['protocol'];
     // need to set this again since we safe the "service" string to empty explode values
     $opts = $this->getSessionConnectionString($this->server_url, $this->email_user, $this->port, $this->protocol);
     if (empty($opts)) {
         $opts = $this->findOptimumSettings($useSsl);
     }
     $delimiter = $this->getSessionInboundDelimiterString($this->server_url, $this->email_user, $this->port, $this->protocol);
     if (isset($opts['serial']) && !empty($opts['serial'])) {
         $this->service = $opts['serial'];
         if (isset($_REQUEST['mark_read']) && $_REQUEST['mark_read'] == 1) {
             $this->delete_seen = 0;
         } else {
             $this->delete_seen = 1;
         }
         // handle stored_options serialization
         if (isset($_REQUEST['only_since']) && $_REQUEST['only_since'] == 1) {
             $onlySince = true;
         } else {
             $onlySince = false;
         }
         $focusUser = new User();
         $focusUser->retrieve($groupId);
         $mailerId = isset($_REQUEST['outbound_email']) ? $_REQUEST['outbound_email'] : "";
         $oe = new OutboundEmail();
         $oe->getSystemMailerSettings($focusUser, $mailerId);
         $stored_options = array();
         $stored_options['from_name'] = $_REQUEST['from_name'];
         $stored_options['from_addr'] = $_REQUEST['from_addr'];
         if (!$this->isPop3Protocol()) {
             $stored_options['trashFolder'] = isset($_REQUEST['trashFolder']) ? $_REQUEST['trashFolder'] : "";
             $stored_options['sentFolder'] = isset($_REQUEST['sentFolder']) ? $_REQUEST['sentFolder'] : "";
         }
         // if
         $stored_options['only_since'] = $onlySince;
         $stored_options['filter_domain'] = '';
         $storedOptions['folderDelimiter'] = $delimiter;
         $stored_options['outbound_email'] = isset($_REQUEST['outbound_email']) ? $_REQUEST['outbound_email'] : $oe->id;
         $this->stored_options = base64_encode(serialize($stored_options));
         $this->save();
         return true;
     } else {
         // could not find opts, no save
         $GLOBALS['log']->debug('-----> InboundEmail could not find optimums for User: ' . $ie_name);
         return false;
     }
 }
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:94,代码来源:InboundEmail.php

示例9: retrieveSettings

 function retrieveSettings($category = false, $clean = false)
 {
     // declare a cache for all settings
     $settings_cache = sugar_cache_retrieve('admin_settings_cache');
     if ($clean) {
         $settings_cache = array();
     }
     // Check for a cache hit
     if (!empty($settings_cache)) {
         $this->settings = $settings_cache;
         if (!empty($this->settings[$category])) {
             return $this;
         }
     }
     if (!empty($category)) {
         $query = "SELECT category, name, value, platform FROM {$this->table_name} WHERE category = '{$category}'";
     } else {
         $query = "SELECT category, name, value, platform FROM {$this->table_name}";
     }
     $result = $this->db->query($query, true, "Unable to retrieve system settings");
     if (empty($result)) {
         return null;
     }
     while ($row = $this->db->fetchByAssoc($result)) {
         $key = $row['category'] . '_' . $row['name'];
         // There can be settings that have the same `category`, the same
         // `name` but a different platform. We are going to prevent the
         // settings from non `base` platforms (ie `mobile` or `portal`) from
         // overriding `base` settings.
         // TODO: deprecate this method for a method that can select settings
         // per platform
         if (empty($row['platform'])) {
             $row['platform'] = 'base';
         }
         if (isset($this->settings[$key]) && $row['platform'] !== 'base') {
             // Don't hold this setting because it's already set
             continue;
         }
         if ($key == 'ldap_admin_password' || $key == 'proxy_password') {
             $this->settings[$key] = $this->decrypt_after_retrieve($row['value']);
         } else {
             $this->settings[$key] = $row['value'];
         }
     }
     $this->settings[$category] = true;
     // outbound email settings
     $oe = new OutboundEmail();
     $oe->getSystemMailerSettings();
     foreach ($oe->field_defs as $def) {
         if (strpos($def, "mail_") !== false) {
             $this->settings[$def] = $oe->{$def};
         }
     }
     // At this point, we have built a new array that should be cached.
     sugar_cache_put('admin_settings_cache', $this->settings);
     return $this;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:57,代码来源:Administration.php

示例10: handleMissingSmtpServerSettingsNotifications

/**
 * If `mail_smtpserver` setting is missing on system mailer settings, a
 * notification is created and assigned to system user.
 */
function handleMissingSmtpServerSettingsNotifications()
{
    require_once 'include/OutboundEmail/OutboundEmail.php';
    $oe = new OutboundEmail();
    $settings = $oe->getSystemMailerSettings();
    if (!empty($settings->mail_smtpserver)) {
        return;
    }
    $user = \BeanFactory::getBean('Users');
    $user->getSystemUser();
    if (empty($user)) {
        return;
    }
    $app_strings = return_application_language($GLOBALS['current_language']);
    $emailSettingsUrl = sprintf('<a href="#bwc/index.php?module=EmailMan&action=config">%s</a>', $app_strings['LBL_MISSING_SMPT_SERVER_SETTINGS_NOTIFICATION_LINK_TEXT']);
    $description = str_replace('{{emailSettingsUrl}}', $emailSettingsUrl, $app_strings['TPL_MISSING_SMPT_SERVER_SETTINGS_NOTIFICATION_DESCRIPTION']);
    $notification = \BeanFactory::getBean('Notifications');
    $notification->name = $app_strings['LBL_MISSING_SMPT_SERVER_SETTINGS_NOTIFICATION_SUBJECT'];
    $notification->description = $description;
    $notification->severity = 'warning';
    $notification->assigned_user_id = $user->id;
    $notification->save();
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:27,代码来源:install_utils.php


注:本文中的OutboundEmail::getSystemMailerSettings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。