本文整理汇总了PHP中CAdminNotify::Add方法的典型用法代码示例。如果您正苦于以下问题:PHP CAdminNotify::Add方法的具体用法?PHP CAdminNotify::Add怎么用?PHP CAdminNotify::Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAdminNotify
的用法示例。
在下文中一共展示了CAdminNotify::Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: InstallDB
function InstallDB()
{
global $DB, $APPLICATION;
$this->errors = false;
if (!$DB->Query("SELECT 'x' FROM b_im_chat", true)) {
$this->errors = $DB->RunSQLBatch($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/im/install/db/" . strtolower($DB->type) . "/install.sql");
}
if ($this->errors !== false) {
$APPLICATION->ThrowException(implode("", $this->errors));
return false;
}
RegisterModule("im");
RegisterModuleDependences('main', 'OnAddRatingVote', 'im', 'CIMEvent', 'OnAddRatingVote');
RegisterModuleDependences('main', 'OnCancelRatingVote', 'im', 'CIMEvent', 'OnCancelRatingVote');
RegisterModuleDependences('main', 'OnAfterUserUpdate', 'im', 'CIMEvent', 'OnAfterUserUpdate');
RegisterModuleDependences('main', 'OnUserDelete', 'im', 'CIMEvent', 'OnUserDelete');
RegisterModuleDependences("pull", "OnGetDependentModule", "im", "CIMEvent", "OnGetDependentModule");
RegisterModuleDependences("main", "OnProlog", "main", "", "", 3, "/modules/im/ajax_hit.php");
RegisterModuleDependences("perfmon", "OnGetTableSchema", "im", "CIMTableSchema", "OnGetTableSchema");
RegisterModuleDependences("im", "OnGetNotifySchema", "im", "CIMNotifySchema", "OnGetNotifySchema");
RegisterModuleDependences("main", "OnFileDelete", "im", "CIMEvent", "OnFileDelete");
RegisterModuleDependences("main", "OnApplicationsBuildList", "im", "DesktopApplication", "OnApplicationsBuildList");
CAgent::AddAgent("CIMMail::MailNotifyAgent();", "im", "N", 600);
CAgent::AddAgent("CIMMail::MailMessageAgent();", "im", "N", 600);
CAgent::AddAgent("CIMDisk::RemoveTmpFileAgent();", "im", "N", 43200);
CModule::IncludeModule("im");
if (CIMConvert::ConvertCount() > 0) {
Cmodule::IncludeModule("im");
CAdminNotify::Add(array("MESSAGE" => GetMessage("IM_CONVERT_MESSAGE", array("#A_TAG_START#" => '<a href="/bitrix/admin/im_convert.php?lang=' . LANGUAGE_ID . '">', "#A_TAG_END#" => "</a>")), "TAG" => "IM_CONVERT", "MODULE_ID" => "IM", "ENABLE_CLOSE" => "Y"));
CAgent::AddAgent("CIMConvert::UndeliveredMessageAgent();", "im", "N", 20, "", "Y", ConvertTimeStamp(time() + CTimeZone::GetOffset() + 20, "FULL"));
}
return true;
}
示例2: DoInstall
public function DoInstall()
{
if (IsModuleInstalled('sale')) {
global $APPLICATION;
$this->InstallFiles();
RegisterModule($this->MODULE_ID);
return true;
}
$MODULE_ID = $this->MODULE_ID;
$TAG = 'VWS';
$MESSAGE = GetMessage('LP_ERR_MODULE_NOT_FOUND', array('#MODULE#' => 'sale'));
$intID = CAdminNotify::Add(compact('MODULE_ID', 'TAG', 'MESSAGE'));
return false;
}
示例3: updateDBSchema
//.........这里部分代码省略.........
}
if ($DBType == 'oracle' && $locationExternalServiceTableExists && !$DB->query("select * from USER_OBJECTS where OBJECT_TYPE = 'SEQUENCE' and OBJECT_NAME = 'SQ_B_SALE_LOC_EXT_SRV'", true)->fetch()) {
$DB->query("CREATE SEQUENCE SQ_B_SALE_LOC_EXT_SRV INCREMENT BY 1 NOMAXVALUE NOCYCLE NOCACHE NOORDER");
// OK
$DB->query("CREATE OR REPLACE TRIGGER B_SALE_LOC_EXT_SRV_INSERT\n\t\tBEFORE INSERT\n\t\tON B_SALE_LOC_EXT_SRV\n\t\tFOR EACH ROW\n\t\tBEGIN\n\t\t\tIF :NEW.ID IS NULL THEN\n\t\t\t\tSELECT SQ_B_SALE_LOC_EXT_SRV.NEXTVAL INTO :NEW.ID FROM dual;\n\t\t\tEND IF;\n\t\tEND;");
// OK
}
if (!$locationExternalTableExists) {
$updater->query(array("MySQL" => "create table b_sale_loc_ext(\n\t\t\t\t\t\t\t\t\tID int not null auto_increment,\n\t\t\t\t\t\t\t\t\tSERVICE_ID int not null,\n\t\t\t\t\t\t\t\t\tLOCATION_ID int not null,\n\t\t\t\t\t\t\t\t\tXML_ID varchar(100) not null,\n\n\t\t\t\t\t\t\t\t\tprimary key (ID)\n\t\t\t\t\t\t\t\t)", "MSSQL" => "CREATE TABLE B_SALE_LOC_EXT(\n\t\t\t\t\t\t\t\t\tID int NOT NULL IDENTITY (1, 1),\n\t\t\t\t\t\t\t\t\tSERVICE_ID int NOT NULL,\n\t\t\t\t\t\t\t\t\tLOCATION_ID int NOT NULL,\n\t\t\t\t\t\t\t\t\tXML_ID varchar(100) NOT NULL\n\n\t\t\t\t\t\t\t\t\tCONSTRAINT PK_B_SALE_LOC_EXT PRIMARY KEY (ID)\n\t\t\t\t\t\t\t\t)", "Oracle" => "CREATE TABLE B_SALE_LOC_EXT(\n\t\t\t\t\t\t\t\t\tID NUMBER(18) NOT NULL,\n\t\t\t\t\t\t\t\t\tSERVICE_ID NUMBER(18) NOT NULL,\n\t\t\t\t\t\t\t\t\tLOCATION_ID NUMBER(18) NOT NULL,\n\t\t\t\t\t\t\t\t\tXML_ID VARCHAR2(100 CHAR) NOT NULL,\n\n\t\t\t\t\t\t\t\t\tPRIMARY KEY (ID)\n\t\t\t\t\t\t\t\t)"));
$locationExternalTableExists = true;
}
if ($DBType == 'oracle' && $locationExternalTableExists && !$DB->query("select * from USER_OBJECTS where OBJECT_TYPE = 'SEQUENCE' and OBJECT_NAME = 'SQ_B_SALE_LOC_EXT'", true)->fetch()) {
$DB->query("CREATE SEQUENCE SQ_B_SALE_LOC_EXT INCREMENT BY 1 NOMAXVALUE NOCYCLE NOCACHE NOORDER");
// OK
$DB->query("CREATE OR REPLACE TRIGGER B_SALE_LOC_EXT_INSERT\n\t\tBEFORE INSERT\n\t\tON B_SALE_LOC_EXT\n\t\tFOR EACH ROW\n\t\tBEGIN\n\t\t\tIF :NEW.ID IS NULL THEN\n\t\t\t\tSELECT SQ_B_SALE_LOC_EXT.NEXTVAL INTO :NEW.ID FROM dual;\n\t\t\tEND IF;\n\t\tEND;");
// OK
}
if ($locationExternalTableExists && !$DB->IndexExists('b_sale_loc_ext', array('LOCATION_ID', 'SERVICE_ID'))) {
$DB->query("CREATE INDEX IX_B_SALE_LOC_EXT_LID_SID ON b_sale_loc_ext (LOCATION_ID, SERVICE_ID)");
// OK: oracle, mssql
}
if (!$locationTypeTableExists) {
$updater->query(array("MySQL" => "create table b_sale_loc_type(\n\t\t\t\t\t\t\t\t\tID int not null auto_increment,\n\t\t\t\t\t\t\t\t\tCODE varchar(30) not null,\n\t\t\t\t\t\t\t\t\tSORT int default '100',\n\n\t\t\t\t\t\t\t\t\tprimary key (ID)\n\t\t\t\t\t\t\t\t)", "MSSQL" => "CREATE TABLE B_SALE_LOC_TYPE(\n\t\t\t\t\t\t\t\t\tID int NOT NULL IDENTITY (1, 1),\n\t\t\t\t\t\t\t\t\tCODE varchar(30) NOT NULL,\n\t\t\t\t\t\t\t\t\tSORT int\n\n\t\t\t\t\t\t\t\t\tCONSTRAINT PK_B_SALE_LOC_TYPE PRIMARY KEY (ID)\n\t\t\t\t\t\t\t\t)", "Oracle" => "CREATE TABLE B_SALE_LOC_TYPE(\n\t\t\t\t\t\t\t\t\tID NUMBER(18) NOT NULL,\n\t\t\t\t\t\t\t\t\tCODE VARCHAR2(30 CHAR) NOT NULL,\n\t\t\t\t\t\t\t\t\tSORT NUMBER(18) DEFAULT '100',\n\n\t\t\t\t\t\t\t\t\tPRIMARY KEY (ID)\n\t\t\t\t\t\t\t\t)"));
$updater->query(array("MSSQL" => "ALTER TABLE B_SALE_LOC_TYPE ADD CONSTRAINT DF_B_SALE_LOC_TYPE_SORT DEFAULT '100' FOR SORT"));
$locationTypeTableExists = true;
}
if ($DBType == 'oracle' && $locationTypeTableExists && !$DB->query("select * from USER_OBJECTS where OBJECT_TYPE = 'SEQUENCE' and OBJECT_NAME = 'SQ_B_SALE_LOC_TYPE'", true)->fetch()) {
$DB->query("CREATE SEQUENCE SQ_B_SALE_LOC_TYPE INCREMENT BY 1 NOMAXVALUE NOCYCLE NOCACHE NOORDER");
// OK
$DB->query("CREATE OR REPLACE TRIGGER B_SALE_LOC_TYPE_INSERT\n\t\tBEFORE INSERT\n\t\tON B_SALE_LOC_TYPE\n\t\tFOR EACH ROW\n\t\tBEGIN\n\t\t\tIF :NEW.ID IS NULL THEN\n\t\t\t\tSELECT SQ_B_SALE_LOC_TYPE.NEXTVAL INTO :NEW.ID FROM dual;\n\t\t\tEND IF;\n\t\tEND;");
// OK
}
if (!$locationTypeNameTableExists) {
$updater->query(array("MySQL" => "create table b_sale_loc_type_name(\n\t\t\t\t\t\t\t\t\tID int not null auto_increment,\n\t\t\t\t\t\t\t\t\tLANGUAGE_ID char(2) not null,\n\t\t\t\t\t\t\t\t\tNAME varchar(100) not null,\n\t\t\t\t\t\t\t\t\tTYPE_ID int not null,\n\n\t\t\t\t\t\t\t\t\tprimary key (ID)\n\t\t\t\t\t\t\t\t)", "MSSQL" => "CREATE TABLE B_SALE_LOC_TYPE_NAME(\n\t\t\t\t\t\t\t\t\tID int NOT NULL IDENTITY (1, 1),\n\t\t\t\t\t\t\t\t\tLANGUAGE_ID char(2) NOT NULL,\n\t\t\t\t\t\t\t\t\tNAME varchar(100) NOT NULL,\n\t\t\t\t\t\t\t\t\tTYPE_ID int NOT NULL\n\n\t\t\t\t\t\t\t\t\tCONSTRAINT PK_B_SALE_LOC_TYPE_NAME PRIMARY KEY (ID)\n\t\t\t\t\t\t\t\t)", "Oracle" => "CREATE TABLE B_SALE_LOC_TYPE_NAME(\n\t\t\t\t\t\t\t\t\tID NUMBER(18) NOT NULL,\n\t\t\t\t\t\t\t\t\tLANGUAGE_ID CHAR(2 CHAR) NOT NULL,\n\t\t\t\t\t\t\t\t\tNAME VARCHAR2(100 CHAR) NOT NULL,\n\t\t\t\t\t\t\t\t\tTYPE_ID NUMBER(18) NOT NULL,\n\n\t\t\t\t\t\t\t\t\tPRIMARY KEY (ID)\n\t\t\t\t\t\t\t\t)"));
$locationTypeNameTableExists = true;
}
if ($DBType == 'oracle' && $locationTypeNameTableExists && !$DB->query("select * from USER_OBJECTS where OBJECT_TYPE = 'SEQUENCE' and OBJECT_NAME = 'SQ_B_SALE_LOC_TYPE_NAME'", true)->fetch()) {
$DB->query("CREATE SEQUENCE SQ_B_SALE_LOC_TYPE_NAME INCREMENT BY 1 NOMAXVALUE NOCYCLE NOCACHE NOORDER");
// OK
$DB->query("CREATE OR REPLACE TRIGGER B_SALE_LOC_TYPE_NAME_INSERT\n\t\tBEFORE INSERT\n\t\tON B_SALE_LOC_TYPE_NAME\n\t\tFOR EACH ROW\n\t\tBEGIN\n\t\t\tIF :NEW.ID IS NULL THEN\n\t\t\t\tSELECT SQ_B_SALE_LOC_TYPE_NAME.NEXTVAL INTO :NEW.ID FROM dual;\n\t\t\tEND IF;\n\t\tEND;");
// OK
}
if ($locationTypeNameTableExists) {
if (!$DB->IndexExists('b_sale_loc_type_name', array('TYPE_ID', 'LANGUAGE_ID'))) {
$DB->query('CREATE INDEX IX_B_SALE_LOC_TYPE_NAME_TI_LI ON b_sale_loc_type_name (TYPE_ID, LANGUAGE_ID)');
// OK: oracle, mssql
}
}
if (!$locationLoc2SiteTableExists) {
$updater->query(array("MySQL" => "create table b_sale_loc_2site(\n\t\t\t\t\t\t\t\t\tLOCATION_ID int not null,\n\t\t\t\t\t\t\t\t\tSITE_ID char(2) not null,\n\t\t\t\t\t\t\t\t\tLOCATION_TYPE char(1) not null default 'L',\n\n\t\t\t\t\t\t\t\t\tprimary key (SITE_ID, LOCATION_ID, LOCATION_TYPE)\n\t\t\t\t\t\t\t\t)", "MSSQL" => "CREATE TABLE B_SALE_LOC_2SITE(\n\t\t\t\t\t\t\t\t\tLOCATION_ID int NOT NULL,\n\t\t\t\t\t\t\t\t\tSITE_ID char(2) NOT NULL,\n\t\t\t\t\t\t\t\t\tLOCATION_TYPE char(1) NOT NULL\n\n\t\t\t\t\t\t\t\t\tCONSTRAINT PK_B_SALE_LOC_2SITE PRIMARY KEY (SITE_ID, LOCATION_ID, LOCATION_TYPE)\n\t\t\t\t\t\t\t\t)", "Oracle" => "CREATE TABLE B_SALE_LOC_2SITE(\n\t\t\t\t\t\t\t\t\tLOCATION_ID NUMBER(18) NOT NULL,\n\t\t\t\t\t\t\t\t\tSITE_ID CHAR(2 CHAR) NOT NULL,\n\t\t\t\t\t\t\t\t\tLOCATION_TYPE CHAR(1 CHAR) DEFAULT 'L' NOT NULL,\n\n\t\t\t\t\t\t\t\t\tPRIMARY KEY (SITE_ID, LOCATION_ID, LOCATION_TYPE)\n\t\t\t\t\t\t\t\t)"));
$updater->query(array("MSSQL" => "ALTER TABLE B_SALE_LOC_2SITE ADD CONSTRAINT DF_B_SALE_LOC_2SITE DEFAULT 'L' FOR LOCATION_TYPE"));
}
if (!$locationDefaul2SiteTableExists) {
$updater->query(array("MySQL" => "create table b_sale_loc_def2site(\n\t\t\t\t\t\t\t\t\tLOCATION_CODE varchar(100) not null,\n\t\t\t\t\t\t\t\t\tSITE_ID char(2) not null,\n\t\t\t\t\t\t\t\t\tSORT int default '100',\n\n\t\t\t\t\t\t\t\t\tprimary key (LOCATION_CODE, SITE_ID)\n\t\t\t\t\t\t\t\t)", "MSSQL" => "CREATE TABLE B_SALE_LOC_DEF2SITE(\n\t\t\t\t\t\t\t\t\tLOCATION_CODE varchar(100) NOT NULL,\n\t\t\t\t\t\t\t\t\tSITE_ID char(2) NOT NULL,\n\t\t\t\t\t\t\t\t\tSORT int\n\n\t\t\t\t\t\t\t\t\tCONSTRAINT PK_B_SALE_LOC_DEF2SITE PRIMARY KEY (LOCATION_CODE, SITE_ID)\n\t\t\t\t\t\t\t\t)", "Oracle" => "CREATE TABLE B_SALE_LOC_DEF2SITE(\n\t\t\t\t\t\t\t\t\tLOCATION_CODE VARCHAR2(100 CHAR) NOT NULL,\n\t\t\t\t\t\t\t\t\tSITE_ID CHAR(2 CHAR) NOT NULL,\n\t\t\t\t\t\t\t\t\tSORT NUMBER(18) DEFAULT '100',\n\n\t\t\t\t\t\t\t\t\tPRIMARY KEY (LOCATION_CODE, SITE_ID)\n\t\t\t\t\t\t\t\t)"));
$updater->query(array("MSSQL" => "ALTER TABLE B_SALE_LOC_DEF2SITE ADD CONSTRAINT DF_B_SALE_LOC_DEF2SITE_SORT DEFAULT '100' FOR SORT"));
}
// move tax and delivery to the new relation field: code
if ($tax2LocationTableExists && $DB->query("select LOCATION_ID from b_sale_tax2location WHERE 1=0", true)) {
$DB->query('delete from b_sale_tax2location where LOCATION_ID is null');
// OK: oracle, mssql // useless records to be deleted
if (!$DB->query("select LOCATION_CODE from b_sale_tax2location WHERE 1=0", true)) {
$updater->query(array("MySQL" => "ALTER TABLE b_sale_tax2location ADD LOCATION_CODE varchar(100) NOT NULL", "MSSQL" => "ALTER TABLE B_SALE_TAX2LOCATION ADD LOCATION_CODE varchar(100) default '' NOT NULL", "Oracle" => "ALTER TABLE B_SALE_TAX2LOCATION ADD LOCATION_CODE VARCHAR2(100 CHAR) default '' NOT NULL"));
}
$DB->query('update b_sale_tax2location set LOCATION_CODE = LOCATION_ID');
// OK: oracle, mssql
if ($DBType == 'mssql') {
$DB->query('ALTER TABLE b_sale_tax2location DROP CONSTRAINT PK_B_SALE_TAX2LOCATION');
} else {
$DB->query('ALTER TABLE b_sale_tax2location DROP PRIMARY KEY');
}
// OK: oracle
$DB->query('ALTER TABLE b_sale_tax2location DROP COLUMN LOCATION_ID');
// OK: oracle, mssql
$DB->query('ALTER TABLE b_sale_tax2location ADD CONSTRAINT PK_B_SALE_TAX2LOCATION PRIMARY KEY (TAX_RATE_ID, LOCATION_CODE, LOCATION_TYPE)');
// OK: oracle, mssql
}
if ($delivery2LocationTableExists && $DB->query("select LOCATION_ID from b_sale_delivery2location WHERE 1=0", true)) {
$DB->query('delete from b_sale_delivery2location where LOCATION_ID is null');
// OK: oracle, mssql // useless records to be deleted
if (!$DB->query("select LOCATION_CODE from b_sale_delivery2location WHERE 1=0", true)) {
$updater->query(array("MySQL" => "ALTER TABLE b_sale_delivery2location ADD LOCATION_CODE varchar(100) NOT NULL", "MSSQL" => "ALTER TABLE B_SALE_DELIVERY2LOCATION ADD LOCATION_CODE varchar(100) default '' NOT NULL", "Oracle" => "ALTER TABLE B_SALE_DELIVERY2LOCATION ADD LOCATION_CODE VARCHAR2(100 CHAR) default '' NOT NULL"));
}
$DB->query('update b_sale_delivery2location set LOCATION_CODE = LOCATION_ID');
// OK: oracle, mssql
if ($DBType == 'mssql') {
$DB->query('ALTER TABLE b_sale_delivery2location DROP CONSTRAINT PK_B_SALE_DELIVERY2LOCATION');
} else {
$DB->query('ALTER TABLE b_sale_delivery2location DROP PRIMARY KEY');
}
// OK: oracle
$DB->query('ALTER TABLE b_sale_delivery2location DROP COLUMN LOCATION_ID');
// OK: oracle, mssql
$DB->query('ALTER TABLE b_sale_delivery2location ADD CONSTRAINT PK_B_SALE_DELIVERY2LOCATION PRIMARY KEY (DELIVERY_ID, LOCATION_CODE, LOCATION_TYPE)');
// OK: oracle, mssql
}
if (\COption::GetOptionString('sale', 'sale_locationpro_migrated', '') != 'Y') {
\CAdminNotify::Add(array("MESSAGE" => Loc::getMessage('SALE_LOCATION_MIGRATION_PLZ_MIGRATE_NOTIFIER', array('#ANCHOR_MIGRATE#' => '<a href="/bitrix/admin/sale_location_migration.php">', '#ANCHOR_END#' => '</a>')), "TAG" => "SALE_LOCATIONPRO_PLZ_MIGRATE", "MODULE_ID" => "SALE", "ENABLE_CLOSE" => "Y"));
}
}
}
示例4: OnPageStartHandler
/**
* Checking all forms for spam
* @return null|boolean NULL when success or FALSE when spam detected
*/
public function OnPageStartHandler()
{
global $APPLICATION, $USER;
if (!is_object($USER)) {
$USER = new CUser();
}
$ct_status = COption::GetOptionString('cleantalk.antispam', 'status', '0');
$ct_global = COption::GetOptionString('cleantalk.antispam', 'form_global_check', '0');
$key = COption::GetOptionString('cleantalk.antispam', 'key', '');
$last_checked = COption::GetOptionString('cleantalk.antispam', 'last_checked', 0);
$last_status = COption::GetOptionString('cleantalk.antispam', 'is_paid', 0);
$new_checked = time();
$is_sfw = COption::GetOptionString('cleantalk.antispam', 'form_sfw', 0);
$sfw_last_updated = COption::GetOptionString('cleantalk.antispam', 'sfw_last_updated', 0);
if ($is_sfw == 1 && time() - $sfw_last_updated > 10) {
global $DB;
$data = array('auth_key' => $key, 'method_name' => '2s_blacklists_db');
$result = CleantalkAntispam::CleantalkSendRequest('https://api.cleantalk.org/2.1', $data, false);
$result = json_decode($result, true);
if (isset($result['data'])) {
$result = $result['data'];
$query = "INSERT INTO `" . $wpdb->base_prefix . "cleantalk_sfw` VALUES ";
//$wpdb->query("TRUNCATE TABLE `".$wpdb->base_prefix."cleantalk_sfw`;");
for ($i = 0; $i < sizeof($result); $i++) {
if ($i == sizeof($result) - 1) {
$query .= "(" . $result[$i][0] . "," . $result[$i][1] . ");";
} else {
$query .= "(" . $result[$i][0] . "," . $result[$i][1] . "), ";
}
}
$DB->Query($query);
}
include_once "cleantalk-sfw.class.php";
$sfw = new CleanTalkSFW();
$sfw->send_logs();
COption::SetOptionString('cleantalk.antispam', 'sfw_last_updated', time());
}
if ($is_sfw == 1 && !$USER->IsAdmin()) {
include_once "cleantalk-sfw.class.php";
$is_sfw_check = true;
$ip = CleantalkAntispam::CleantalkGetIP();
$ip = array_unique($ip);
$sfw_log = COption::GetOptionString('cleantalk.antispam', 'sfw_log', '');
for ($i = 0; $i < sizeof($ip); $i++) {
if (isset($_COOKIE['ct_sfw_pass_key']) && $_COOKIE['ct_sfw_pass_key'] == md5($ip[$i] . $key)) {
$is_sfw_check = false;
if (isset($_COOKIE['ct_sfw_passed'])) {
if ($sfw_log == '') {
$sfw_log = array();
$sfw_log[$ip[$i]] = array();
} else {
$sfw_log = json_decode($sfw_log, true);
}
$sfw_log[$ip[$i]]['allow']++;
COption::SetOptionString('cleantalk.antispam', 'sfw_log', json_encode($sfw_log));
@setcookie('ct_sfw_passed', '0', 1, "/");
}
}
}
if ($is_sfw_check) {
include_once "cleantalk-sfw.class.php";
$sfw = new CleanTalkSFW();
$sfw->cleantalk_get_real_ip();
$sfw->check_ip();
if ($sfw->result) {
$sfw->sfw_die();
}
}
}
if ($key != '' && $key != 'enter key' && $USER->IsAdmin()) {
$new_status = $last_status;
if ($new_checked - $last_checked > 86400) {
$url = 'https://api.cleantalk.org';
$dt = array('auth_key' => $key, 'method_name' => 'get_account_status');
$result = CleantalkAntispam::CleantalkSendRequest($url, $dt, false);
if ($result !== null) {
$result = json_decode($result);
if (isset($result->data) && isset($result->data->paid)) {
$new_status = intval($result->data->paid);
if ($last_status != 1 && $new_status == 1) {
COption::SetOptionString('cleantalk.antispam', 'is_paid', 1);
$show_notice = 1;
if (LANGUAGE_ID == 'ru') {
$review_message = "Нравится антиспам от CleanTalk? Расскажите другим об этом! <a target='_blank' href='http://marketplace.1c-bitrix.ru/solutions/cleantalk.antispam/#rating'>Оставьте отзыв в Bitrix.Marketplace</a>";
} else {
$review_mess = "Like Anti-spam by CleanTalk? Help others learn about CleanTalk! <a target='_blank' href='http://marketplace.1c-bitrix.ru/solutions/cleantalk.antispam/#rating'>Leave a review at the Bitrix.Marketplace</a>";
}
CAdminNotify::Add(array('MESSAGE' => $review_mess, 'TAG' => 'review_notify', 'MODULE_ID' => 'main', 'ENABLE_CLOSE' => 'Y'));
}
}
}
$url = 'https://api.cleantalk.org';
$dt = array('auth_key' => $key, 'method_name' => 'notice_paid_till');
$result = CleantalkAntispam::CleantalkSendRequest($url, $dt, false);
if ($result !== null) {
$result = json_decode($result);
//.........这里部分代码省略.........
示例5: showAlarmMessage
static function showAlarmMessage()
{
$tag = "PAY_SYSTEM_ACTION_ALARM";
$dbRes = CAdminNotify::GetList(array(), array("TAG" => $tag));
if ($res = $dbRes->Fetch()) {
return false;
}
return CAdminNotify::Add(array("MESSAGE" => GetMessage("SKGPSA_ALARM_MESSAGE", array("#LANGUAGE_ID#" => LANGUAGE_ID)), "TAG" => $tag, "MODULE_ID" => "SALE", "ENABLE_CLOSE" => "Y", "TYPE" => CAdminNotify::TYPE_ERROR));
}
示例6: array
$arFields = array(
"MESSAGE" => str_replace("#LINK#", '/bitrix/admin/cat_discount_convert.php', $arMess['BT_MOD_CAT_DSC_CONV_INVITE'][$strDefLang]),
"TAG" => "CATALOG_DISC_CONVERT",
"MODULE_ID" => "catalog",
"ENABLE_CLOSE" => "N"
);
$arLangMess = array();
foreach ($arMess['BT_MOD_CAT_DSC_CONV_INVITE'] as $strLangID => $strMess)
{
if (empty($strMess))
continue;
$arLangMess[$strLangID] = str_replace("#LINK#", '/bitrix/admin/cat_discount_convert.php', $strMess);
}
if (!empty($arLangMess))
$arFields['LANG'] = $arLangMess;
CAdminNotify::Add($arFields);
}
}
}
}
}
if ($bVarsFromForm)
{
if ($boolCondParseError)
{
$mxTempo = $arDiscount['CONDITIONS'];
$arDiscount = $arFields;
$arDiscount['CONDITIONS'] = $mxTempo;
unset($mxTempo);
}
示例7: notifyAdmin
protected function notifyAdmin($tag)
{
$dbRes = CAdminNotify::GetList(array(), array("TAG" => $tag));
if ($res = $dbRes->Fetch()) {
return false;
}
CAdminNotify::Add(array("MESSAGE" => GetMessage("SALE_DH_RP_MESS_" . $tag, array("##LANGUAGE_ID##" => LANGUAGE_ID)), "TAG" => $tag, "MODULE_ID" => "SALE", "ENABLE_CLOSE" => "Y"));
return true;
}
示例8: CommonTest
function CommonTest()
{
if (!IsModuleInstalled('intranet') || defined('BX_CRONTAB') || (defined('CHK_EVENT') && CHK_EVENT === true)) // can't get real HTTP server vars from cron
return "CSiteCheckerTest::CommonTest();";
if (($ntlm_varname = COption::GetOptionString('ldap', 'ntlm_varname', 'REMOTE_USER')) && ($user = trim($_SERVER[$ntlm_varname])))
return "CSiteCheckerTest::CommonTest();"; // Server NTLM is enabled, no way to connect through a socket
IncludeModuleLangFile($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/admin/site_checker.php');
$step = 0;
while(true)
{
if (is_object($oTest))
$ar = $oTest->arTestVars;
$oTest = new CSiteCheckerTest($step, $fast = 1);
$oTest->arTestVars = $ar;
$oTest->host = $_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : 'localhost';
$oTest->ssl = $_SERVER['HTTPS'] == 'on';
$oTest->port = $_SERVER['SERVER_PORT'] ? $_SERVER['SERVER_PORT'] : ($oTest->ssl ? 443 : 80);
$oTest->Start();
if ($oTest->result === false)
{
$ar = Array(
"MESSAGE" => GetMessage("MAIN_SC_GOT_ERRORS", array('#LINK#' => "/bitrix/admin/site_checker.php?lang=".LANGUAGE_ID."&express_test=Y")),
"TAG" => "SITE_CHECKER",
"MODULE_ID" => "MAIN",
'TYPE' => 'ERROR'
);
CAdminNotify::Add($ar);
break;
}
if ($oTest->percent >= 100)
break;
$step++;
}
return "CSiteCheckerTest::CommonTest();";
}
示例9: notifyAdmin
protected function notifyAdmin($code)
{
$tag = "YANDEX_MARKET_" . $code;
$problemsCount = intval(\Bitrix\Main\Config\Option::get("sale", $tag, 0, $this->siteId));
if ($problemsCount < 3) {
\Bitrix\Main\Config\Option::set("sale", $tag, $problemsCount + 1, $this->siteId);
return false;
}
$dbRes = CAdminNotify::GetList(array(), array("TAG" => $tag));
if ($res = $dbRes->Fetch()) {
return false;
}
CAdminNotify::Add(array("MESSAGE" => GetMessage("SALE_YMH_ADMIN_NOTIFY_" . $code, array("##LANGUAGE_ID##" => LANGUAGE_ID)), "TAG" => "YANDEX_MARKET_" . $code, "MODULE_ID" => "SALE", "ENABLE_CLOSE" => "Y"));
\Bitrix\Main\Config\Option::set("sale", $tag, 0, $this->siteId);
return true;
}
示例10: unset
$langList[] = $oneLanguage['ID'];
}
unset($oneLanguage, $languageIterator);
$messID = 'SALE_CONVERTER_ADMIN_NOTIFY_CONVERT_BASKET_DISCOUNT';
foreach ($langList as &$oneLanguage) {
$mess = Loc::loadLanguageFile(__FILE__, $oneLanguage);
if (!isset($mess[$messID]) || empty($mess[$messID])) {
continue;
}
$langMess[$oneLanguage] = str_replace('#LINK#', '/bitrix/admin/settings.php?lang=' . $oneLanguage . '&mid=sale', $mess[$messID]);
}
unset($mess, $oneLanguage);
reset($langMess);
$defaultMess = isset($langMess[LANGUAGE_ID]) ? $langMess[LANGUAGE_ID] : current($langMess);
$fields = array('MESSAGE' => $defaultMess, 'TAG' => 'BASKET_DISCOUNT_CONVERTED', 'MODULE_ID' => 'sale', 'ENABLE_CLOSE' => 'Y', 'PUBLIC_SECTION' => 'N', 'LANG' => $langMess);
CAdminNotify::Add($fields);
unset($fields, $langMess, $defaultMess, $langList);
}
unset($adminNotify);
}
}
} else {
$message = Loc::getMessage('SALE_CONVERTER_AJAX_STEP_UPDATE_BASKET');
$result['ERROR'] = true;
$type = 'ERROR';
$message .= "<br>" . $error;
}
ob_start();
CAdminMessage::ShowMessage(array("MESSAGE" => Loc::getMessage('SALE_CONVERTER_AJAX_STEP_FINAL_MESSAGE'), "DETAILS" => $message, "HTML" => true, "TYPE" => $type));
$result['DATA'] = ob_get_contents();
ob_end_clean();
示例11: _AddConvertDbNotify
protected static function _AddConvertDbNotify()
{
global $DB;
// Is module data exists?
if ($DB->TableExists('b_learn_lesson')) {
// Ensure, that data in database converted to 11.5.0 version of module
if (COption::GetOptionString('learning', '~LearnInstall201203ConvertDB::_IsAlreadyConverted', '-9', '') !== '1') {
// Data for module not converted yet, generate message
if (method_exists('CAdminNotify', 'Add')) {
CAdminNotify::Add(array('MESSAGE' => str_replace('#LANG#', LANGUAGE_ID, GetMessage('LEARNING_ADMIN_NOTIFY_CONVERT_DB')), 'TAG' => 'learning_convert_11_5_0', 'MODULE_ID' => 'learning', 'ENABLE_CLOSE' => 'N'));
}
}
}
}
示例12: informAdminLocationDatabaseFailure
public static function informAdminLocationDatabaseFailure()
{
static::deleteInformer('SALE_LOCATIONPRO_DATABASE_FAILURE');
$fields = array("MESSAGE" => Loc::getMessage('SALE_LOCATION_ADMIN_LOCATION_HELPER_DATABASE_FAILURE', array('#ANCHOR_IMPORT_URL#' => '<a target="_blank" href="' . static::getImportUrl() . '">', '#ANCHOR_END#' => '</a>')), "TAG" => 'SALE_LOCATIONPRO_DATABASE_FAILURE', "MODULE_ID" => "sale", "ENABLE_CLOSE" => "Y", "PUBLIC_SECTION" => "N");
\CAdminNotify::Add($fields);
}
示例13: getAdminId
private function getAdminId()
{
static $adminId;
if ($adminId === null) {
$adminId = CTasksTools::GetCommanderInChief();
if (!intval($adminId)) {
CAdminNotify::Add(array("MESSAGE" => GetMessage('TASKS_COUNTERS_PROCESSOR_ADMIN_IS_NOT_AN_ADMIN'), "TAG" => "TASKS_SYSTEM_NO_ADMIN", "MODULE_ID" => "TASKS", "ENABLE_CLOSE" => "Y"));
}
}
return $adminId;
}
示例14: updateConfig
/**
*
* @return bool
*
*/
private static function updateConfig()
{
if (!self::$config->lock()) {
return true;
}
$delayExpiration = true;
try {
try {
self::$config = CBitrixCloudCDNConfig::getInstance()->loadRemoteXML();
self::$config->saveToOptions();
self::$config->unlock();
} catch (CBitrixCloudException $e) {
//In case of documented XML error we'll disable CDN
if ($e->getErrorCode() !== "") {
self::SetActive(false);
$delayExpiration = false;
}
throw $e;
}
} catch (exception $e) {
if ($delayExpiration) {
self::$config->setExpired(time() + 1800);
}
CAdminNotify::Add(array("MESSAGE" => GetMessage("BCL_CDN_NOTIFY", array("#HREF#" => "/bitrix/admin/bitrixcloud_cdn.php?lang=" . LANGUAGE_ID)), "TAG" => "bitrixcloud_off", "MODULE_ID" => "bitrixcloud", "ENABLE_CLOSE" => "Y"));
self::$config->unlock();
return false;
}
self::$config->unlock();
//Web service were disabled
if (!self::$config->isActive()) {
//By traffic quota
if (self::$config->getQuota()->getTrafficSize() > self::$config->getQuota()->getAllowedSize()) {
self::$config->setExpired(time() + 1800);
CAdminNotify::Add(array("MESSAGE" => GetMessage("BCL_CDN_NOTIFY_QUOTA_LIMIT"), "TAG" => "bitrixcloud_off", "MODULE_ID" => "bitrixcloud", "ENABLE_CLOSE" => "N"));
self::$config->unlock();
return false;
} elseif (self::$config->getQuota()->isExpired()) {
self::$config->setExpired(time() + 1800);
CAdminNotify::Add(array("MESSAGE" => GetMessage("BCL_CDN_NOTIFY_QUOTA_EXPIRED"), "TAG" => "bitrixcloud_off", "MODULE_ID" => "bitrixcloud", "ENABLE_CLOSE" => "N"));
self::$config->unlock();
return false;
}
}
CAdminNotify::DeleteByTag("bitrixcloud_off");
return true;
}
示例15: SendCommand
private static function SendCommand($channelId, $message, $method = 'POST', $timeout = 5, $dont_wait_answer = true)
{
if (!is_array($channelId))
$channelId = Array($channelId);
$channelId = implode('/', array_unique($channelId));
if (strlen($channelId) <=0 || strlen($message) <= 0)
return false;
if (!in_array($method, Array('POST', 'GET')))
return false;
$nginx_error = COption::GetOptionString("pull", "nginx_error", "N");
if ($nginx_error != "N")
{
$nginx_error = unserialize($nginx_error);
if (intval($nginx_error['date'])+120 < time())
{
COption::SetOptionString("pull", "nginx_error", "N");
CAdminNotify::DeleteByTag("PULL_ERROR_SEND");
$nginx_error = "N";
}
else if ($nginx_error['count'] >= 10)
{
$ar = Array(
"MESSAGE" => GetMessage('PULL_ERROR_SEND'),
"TAG" => "PULL_ERROR_SEND",
"MODULE_ID" => "pull",
);
CAdminNotify::Add($ar);
return false;
}
}
$postdata = CHTTP::PrepareData($message);
$CHTTP = new CHTTP();
$CHTTP->http_timeout = intval($timeout);
$arUrl = $CHTTP->ParseURL(CPullOptions::GetPublishUrl($channelId), false);
if ($CHTTP->Query($method, $arUrl['host'], $arUrl['port'], $arUrl['path_query'], $postdata, $arUrl['proto'], 'N', $dont_wait_answer))
{
$result = $dont_wait_answer? '{}': $CHTTP->result;
}
else
{
if ($nginx_error == "N")
{
$nginx_error = Array(
'count' => 1,
'date' => time(),
'date_increment' => time(),
);
}
else if (intval($nginx_error['date_increment'])+1 < time())
{
$nginx_error['count'] = intval($nginx_error['count'])+1;
$nginx_error['date_increment'] = time();
}
COption::SetOptionString("pull", "nginx_error", serialize($nginx_error));
$result = false;
}
return $result;
}