uawdijnntqw1x1x1
IP : 18.221.176.186
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
yar.axolotls.ru
/
bitrix
/
modules
/
socialnetwork
/
lib
/
logview.php
/
/
<?php /** * Bitrix Framework * @package bitrix * @subpackage socialnetwork * @copyright 2001-2012 Bitrix */ namespace Bitrix\Socialnetwork; use Bitrix\Main; use Bitrix\Main\Entity; use Bitrix\Main\Localization\Loc; use Bitrix\Main\NotImplementedException; Loc::loadMessages(__FILE__); class LogViewTable extends Entity\DataManager { public static function getTableName() { return 'b_sonet_log_view'; } public static function getMap() { $fieldsMap = array( 'USER_ID' => array( 'data_type' => 'integer', 'primary' => true ), 'EVENT_ID' => array( 'data_type' => 'string', 'primary' => true ), 'TYPE' => array( 'data_type' => 'boolean', 'values' => array('N','Y') ), ); return $fieldsMap; } public static function getDefaultValue($eventId, $full = false) { $result = 'Y'; $eventId = trim($eventId); if($eventId <> '') { throw new Main\SystemException("Empty eventId."); } if (!$full) { $eventId = \CSocNetLogTools::findFullSetByEventID($eventId); } $res = self::getList(array( 'order' => array(), 'filter' => array( '=USER_ID' => 0, '=EVENT_ID' => \Bitrix\Main\Application::getConnection()->getSqlHelper()->forSql($eventId) ), 'select' => array('TYPE') )); if ($row = $res->fetch()) { $result = $row['TYPE']; } return $result; } public static function set($userId, $eventId, $type) { $userId = intval($userId); $type = ($type == "Y" ? "Y" : "N"); $eventId = trim($eventId); if ($eventId == '') { throw new Main\SystemException("Empty eventId."); } $eventId = \CSocNetLogTools::findFullSetByEventID($eventId); $connection = \Bitrix\Main\Application::getConnection(); $helper = $connection->getSqlHelper(); foreach ($eventId as $val) { $insertFields = array( "USER_ID" => $userId, "TYPE" => $type, "EVENT_ID" => $helper->forSql($val), ); $updateFields = array( "TYPE" => $type ); $merge = $helper->prepareMerge( static::getTableName(), array("USER_ID", "EVENT_ID"), $insertFields, $updateFields ); if ($merge[0] != "") { $connection->query($merge[0]); } } } public static function checkExpertModeAuto($userId, $tasksNum, $pageSize) { $result = false; $userId = intval($userId); $tasksNum = intval($tasksNum); $pageSize = intval($pageSize); if ( $userId <= 0 || $pageSize <= 0 ) { return false; } if ( $tasksNum >= 5 && ($tasksNum / $pageSize) >= 0.25 ) { $isAlreadyChecked = \CUserOptions::getOption("socialnetwork", "~log_expertmode_checked", "N", $userId); if ($isAlreadyChecked != 'Y') { self::set($userId, 'tasks', 'N'); \CUserOptions::setOption("socialnetwork", "~log_expertmode_checked", "Y", false, $userId); $result = true; } } return $result; } public static function add(array $data) { throw new NotImplementedException("Use set() method of the class."); } public static function update($primary, array $data) { throw new NotImplementedException("Use set() method of the class."); } }
/var/www/axolotl/data/www/yar.axolotls.ru/bitrix/modules/socialnetwork/lib/logview.php