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


PHP SMTP::ConvertHTMLToText方法代码示例

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


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

示例1: ConfigSave

 public function ConfigSave()
 {
     global $sso_settings;
     $info = $this->GetInfo();
     $info["email_from"] = $_REQUEST["sso_email_two_factor_email_from"];
     $info["email_subject"] = trim($_REQUEST["sso_email_two_factor_email_subject"]);
     $info["email_msg"] = $_REQUEST["sso_email_two_factor_email_msg"];
     $info["email_msg_text"] = SMTP::ConvertHTMLToText($_REQUEST["sso_email_two_factor_email_msg"]);
     $info["window"] = (int) $_REQUEST["sso_email_two_factor_window"];
     $info["clock_drift"] = (int) $_REQUEST["sso_email_two_factor_clock_drift"];
     if (stripos($info["email_msg"], "@TWOFACTOR@") === false) {
         BB_SetPageMessage("error", "The E-mail Two-Factor Authentication 'E-mail Message' field does not contain '@TWOFACTOR@'.");
     } else {
         if ($info["window"] < 30 || $info["window"] > 300) {
             BB_SetPageMessage("error", "The E-mail Two-Factor Authentication 'Window Size' field contains an invalid value.");
         } else {
             if ($info["clock_drift"] < 0 || $info["clock_drift"] > $info["window"]) {
                 BB_SetPageMessage("error", "The E-mail Two-Factor Authentication 'Window Size' field contains an invalid value.");
             }
         }
     }
     $sso_settings["sso_login"]["modules"]["sso_email_two_factor"] = $info;
 }
开发者ID:marks2016,项目名称:sso,代码行数:23,代码来源:sso_email_two_factor.php

示例2: Config

 public function Config()
 {
     global $sso_rng, $sso_db, $sso_db_users, $sso_site_admin, $sso_settings, $sso_menuopts, $sso_select_fields, $g_sso_login_modules;
     $sso_db_sso_login_users = SSO_DB_PREFIX . "p_sso_login_users";
     if ($sso_site_admin && $sso_settings["sso_login"]["enabled"] && $_REQUEST["action2"] == "config") {
         if (isset($_REQUEST["configsave"])) {
             if ($sso_settings["sso_login"]["install_type"] == "email_username" || $sso_settings["sso_login"]["install_type"] == "username") {
                 $_REQUEST["username_blacklist"] = trim($_REQUEST["username_blacklist"]);
                 $_REQUEST["username_minlen"] = (int) $_REQUEST["username_minlen"];
                 if ($_REQUEST["username_minlen"] < 1) {
                     BB_SetPageMessage("error", "The 'Minimum Username Length' field contains an invalid value.");
                 }
             }
             if ($sso_settings["sso_login"]["install_type"] == "email_username" || $sso_settings["sso_login"]["install_type"] == "email") {
                 $_REQUEST["email_verify_msg"] = trim($_REQUEST["email_verify_msg"]);
                 $_REQUEST["email_recover_msg"] = trim($_REQUEST["email_recover_msg"]);
                 if ($_REQUEST["email_verify_msg"] != "" && stripos($_REQUEST["email_verify_msg"], "@VERIFY@") === false) {
                     BB_SetPageMessage("error", "The 'Verify E-mail Message' field does not contain '@VERIFY@'.");
                 } else {
                     if ($_REQUEST["email_recover_msg"] != "" && stripos($_REQUEST["email_recover_msg"], "@VERIFY@") === false) {
                         BB_SetPageMessage("error", "The 'Recovery E-mail Message' field does not contain '@VERIFY@'.");
                     }
                 }
                 define("CS_TRANSLATE_FUNC", "BB_Translate");
                 require_once SSO_ROOT_PATH . "/" . SSO_SUPPORT_PATH . "/smtp.php";
                 if ($_REQUEST["email_verify_from"] != "") {
                     $email = SMTP::MakeValidEmailAddress($_REQUEST["email_verify_from"]);
                     if (!$email["success"]) {
                         BB_SetPageMessage("error", BB_Translate("The e-mail address '%s' is invalid.  %s", $_REQUEST["email_verify_from"], $email["error"]));
                     } else {
                         if ($email["email"] != trim($_REQUEST["email_verify_from"])) {
                             BB_SetPageMessage("info", BB_Translate("Invalid e-mail address.  Perhaps you meant '%s' instead?", $email["email"]));
                         }
                         $_REQUEST["email_verify_from"] = $email["email"];
                     }
                 }
                 if ($_REQUEST["email_recover_from"] != "") {
                     $email = SMTP::MakeValidEmailAddress($_REQUEST["email_recover_from"]);
                     if (!$email["success"]) {
                         BB_SetPageMessage("error", BB_Translate("The e-mail address '%s' is invalid.  %s", $_REQUEST["email_recover_from"], $email["error"]));
                     } else {
                         if ($email["email"] != trim($_REQUEST["email_recover_from"])) {
                             BB_SetPageMessage("info", BB_Translate("Invalid e-mail address.  Perhaps you meant '%s' instead?", $email["email"]));
                         }
                         $_REQUEST["email_recover_from"] = $email["email"];
                     }
                 }
             }
             $_REQUEST["two_factor_order"] = (int) $_REQUEST["two_factor_order"];
             $_REQUEST["password_minlen"] = (int) $_REQUEST["password_minlen"];
             $_REQUEST["password_mintime"] = (int) $_REQUEST["password_mintime"];
             if ($_REQUEST["two_factor_order"] < 0) {
                 BB_SetPageMessage("error", "The 'Two-Factor Authentication Display Order' field contains an invalid value.");
             } else {
                 if ($_REQUEST["password_minlen"] < 0) {
                     BB_SetPageMessage("error", "The 'Minimum Password Length' field contains an invalid value.");
                 } else {
                     if ($_REQUEST["password_mintime"] < 50) {
                         BB_SetPageMessage("error", "The 'Minimum Password Time' field contains an invalid value.  Must be at least 50 milliseconds.");
                     } else {
                         if ($_REQUEST["password_mintime"] > 5000) {
                             BB_SetPageMessage("error", "The 'Minimum Password Time' field contains an invalid value.  Must be less than 5000 milliseconds (5 seconds).");
                         }
                     }
                 }
             }
             foreach ($g_sso_login_modules as $key => $info) {
                 if ($_REQUEST[$key . "__a"] < 1) {
                     $sso_settings["sso_login"]["modules"][$key]["_a"] = false;
                 }
                 if ($sso_settings["sso_login"]["modules"][$key]["_a"]) {
                     $module = "sso_login_module_" . $key;
                     $instance = new $module();
                     if ($instance->DefaultOrder() !== false) {
                         if ((int) $_REQUEST[$key . "__s"] < 0) {
                             BB_SetPageMessage("error", BB_Translate("The '%s Module Display Order' field contains an invalid value.", $info["name"]));
                         } else {
                             $sso_settings["sso_login"]["modules"][$key]["_s"] = $_REQUEST[$key . "__s"];
                         }
                     }
                     $instance->ConfigSave();
                 }
                 $sso_settings["sso_login"]["modules"][$key]["_a"] = $_REQUEST[$key . "__a"] > 0;
             }
             $sso_settings["sso_login"]["iprestrict"] = SSO_ProcessIPFields();
             if (BB_GetPageMessageType() != "error") {
                 if ($sso_settings["sso_login"]["install_type"] == "email_username" || $sso_settings["sso_login"]["install_type"] == "username") {
                     $sso_settings["sso_login"]["map_username"] = SSO_IsField($_REQUEST["map_username"]) ? $_REQUEST["map_username"] : "";
                     $sso_settings["sso_login"]["username_minlen"] = $_REQUEST["username_minlen"];
                     $sso_settings["sso_login"]["username_blacklist"] = $_REQUEST["username_blacklist"];
                     $sso_settings["sso_login"]["change_username"] = $_REQUEST["change_username"] > 0;
                 }
                 if ($sso_settings["sso_login"]["install_type"] == "email_username" || $sso_settings["sso_login"]["install_type"] == "email") {
                     $sso_settings["sso_login"]["map_email"] = SSO_IsField($_REQUEST["map_email"]) ? $_REQUEST["map_email"] : "";
                     $sso_settings["sso_login"]["email_verify_from"] = $_REQUEST["email_verify_from"];
                     $sso_settings["sso_login"]["email_verify_subject"] = trim($_REQUEST["email_verify_subject"]);
                     $sso_settings["sso_login"]["email_verify_msg"] = $_REQUEST["email_verify_msg"];
                     $sso_settings["sso_login"]["email_verify_msg_text"] = SMTP::ConvertHTMLToText($_REQUEST["email_verify_msg"]);
                     $sso_settings["sso_login"]["email_recover_from"] = $_REQUEST["email_recover_from"];
                     $sso_settings["sso_login"]["email_recover_subject"] = trim($_REQUEST["email_recover_subject"]);
//.........这里部分代码省略.........
开发者ID:marks2016,项目名称:sso,代码行数:101,代码来源:index.php


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