Plugin Directory

Changeset 2782267


Ignore:
Timestamp:
09/09/2022 04:31:10 AM (4 years ago)
Author:
wtsec
Message:

2.4.15

  • Fixed the cause of php warnings
  • Fixed conflict with Google Authenticator
  • Fixed errors in styles
  • Internal improvements
Location:
wt-security
Files:
411 added
14 edited

Legend:

Unmodified
Added
Removed
  • wt-security/trunk/includes/css/main.css

    r2781286 r2782267  
    53385338  font-family: monospace !important;
    53395339}
    5340 
    53415340.wtotem_body .wtotem_control__btn.wtotem_disabled {
    53425341  color: #777;
     
    53465345  opacity: 0.75;
    53475346}
    5348 
    53495347.wtotem-recovery-list{
    53505348  width: 350px;
     
    53565354  color: #5a5a5a;
    53575355}
    5358 
    53595356.wtotem-recovery-btn{
    53605357  position: absolute;
     
    53625359  right: 14px;
    53635360}
    5364 
    53655361.wtotem-recovery-btn img{
    53665362  margin-right: 10px;
    53675363  cursor: pointer;
    53685364}
    5369 
    53705365.wtotem-hr{
    53715366  border: 0;
     
    53735368  border-bottom: 1px solid #f6f7f7;
    53745369}
     5370#wtotem_ga_qr canvas{
     5371  border: 10px solid #fff;
     5372}
    53755373
    53765374/**
    53775375 * Login attempts
    53785376 */
    5379 
    53805377.wtotem-interval-select{
    53815378  border: 2px solid #e1e8ee;
    5382   border-radius: 8px;
     5379  border-radius: 5px;
    53835380  margin-bottom: 5px;
    53845381  position: relative;
     
    57875784  border-bottom: 1px solid #505050;
    57885785}
     5786.wtotem_theme—dark  .wtotem-interval-select{
     5787  border: 2px solid #686868;
     5788}
     5789.wtotem_theme—dark .wtotem-interval-select select{
     5790  background-color: #191919;
     5791  background-image: url('../img/arrow-down.svg');
     5792  color: #fff;
     5793}
     5794
     5795.wtotem_theme—dark .firewall-log-report__payload{
     5796  color: #000;
     5797}
    57895798
    57905799/*
  • wt-security/trunk/includes/templates/settings_form.html.twig

    r2781286 r2782267  
    597597                    <ul class="wtotem-mb-20">
    598598                        <li class="togglers-list__item one-element">
    599                             <p class="togglers-list__name">{{ 'Enable reCAPTCHA'|trans }}</p>
     599                            <p class="togglers-list__name">
     600                                {{ 'Enable reCAPTCHA'|trans }}
     601                                <div class="wtotem_title-info__info wtotem-tooltip">
     602                                    <div class="wtotem-tooltip__content">
     603                                        <p class="wtotem-tooltip__header">{{ 'Enable reCAPTCHA'|trans }}</p>
     604                                        <p class="wtotem-tooltip__text">
     605                                            {{ 'Please make sure that no other recaptcha is used on your site. Otherwise, there may be a conflict that will cause problems when logging into the admin panel.'|trans }}
     606                                        </p>
     607                                    </div>
     608                                </div>
     609                            </p>
    600610                            <div class="wtotem_option__checkbox onoff">
    601611                                <input type="checkbox" class="onoff__input" id="recaptcha"
  • wt-security/trunk/lang/wtotem-ru_RU.po

    r2781286 r2782267  
    22msgstr ""
    33"Project-Id-Version: WebTotem Security\n"
    4 "POT-Creation-Date: 2022-08-31 21:05+0600\n"
     4"POT-Creation-Date: 2022-09-08 14:22+0600\n"
    55"PO-Revision-Date: \n"
    66"Last-Translator: wtsec <info@wtotem.com>\n"
     
    155155msgstr "Минута"
    156156
    157 #: lib/API.php:37
     157#: lib/API.php:38
    158158msgid "Invalid API key"
    159159msgstr "Неверный API ключ"
    160160
    161 #: lib/API.php:166
     161#: lib/API.php:167
    162162msgid "Failed to add the site to the WebTotem platform."
    163163msgstr "Не удалось добавить сайт на платформу WebTotem ."
    164164
    165 #: lib/API.php:256
     165#: lib/API.php:257
    166166msgid "A new website has been added: "
    167167msgstr "Новый сайт был добавлен: "
     
    214214msgstr "Отчет успешно сформирован"
    215215
    216 #: lib/Ajax.php:900 lib/Ajax.php:1215
     216#: lib/Ajax.php:900 lib/Ajax.php:1214
    217217msgid ""
    218218"It is not possible to make changes because the agents are not installed."
    219219msgstr "Внести изменения невозможно, так как агенты не установлены."
    220220
    221 #: lib/Ajax.php:951 lib/Ajax.php:1011 lib/Ajax.php:1032 lib/Ajax.php:1107
     221#: lib/Ajax.php:951 lib/Ajax.php:1011 lib/Ajax.php:1034 lib/Ajax.php:1106
    222222msgid "Your changes have been applied successfully."
    223223msgstr "Ваши изменения были успешно применены."
    224224
    225 #: lib/Ajax.php:971 lib/Ajax.php:976 lib/Ajax.php:1053 lib/Ajax.php:1056
     225#: lib/Ajax.php:971 lib/Ajax.php:976 lib/Ajax.php:1055 lib/Ajax.php:1058
    226226#: lib/Ajax.php:1074 lib/Ajax.php:1077
    227227msgid "The field is required."
     
    236236msgstr "Убедитесь, что вы правильно заполнили это поле."
    237237
    238 #: lib/Ajax.php:1062 lib/Ajax.php:1084
     238#: lib/Ajax.php:1012
     239msgid ""
     240"Please make sure that no other recaptcha is used on your site. Otherwise, "
     241"there may be a conflict that will cause problems when logging into the admin "
     242"panel."
     243msgstr ""
     244"Пожалуйста, убедитесь что на вашем сайте не используется другая recaptcha. В "
     245"противном случае может возникнуть конфликт, который повлечет за собой "
     246"проблемы при входе в админ панель."
     247
     248#: lib/Ajax.php:1062 lib/Ajax.php:1081
    239249msgid "Please specify a value from 1 to 1000000."
    240250msgstr "Пожалуйста укажите значение от 1 до 1000000."
    241251
    242 #: lib/Ajax.php:1309
     252#: lib/Ajax.php:1308
    243253msgid "You cannot delete the primary domain."
    244254msgstr "Основной домен не может быть удален."
    245255
    246 #: lib/Ajax.php:1590 lib/Ajax.php:1591 src/PageHandler.php:352
    247 #: src/PageHandler.php:353
     256#: lib/Ajax.php:1589 lib/Ajax.php:1590 src/PageHandler.php:353
     257#: src/PageHandler.php:354
    248258msgid "ms."
    249259msgstr "мс."
    250260
    251 #: lib/Ajax.php:1678
     261#: lib/Ajax.php:1677
    252262#, php-format
    253263msgid ""
     
    258268"href=\"%s\" title=\"Забыли пароль\">Забыли пароль</a>?"
    259269
    260 #: lib/Ajax.php:1702
     270#: lib/Ajax.php:1701
    261271#, php-format
    262272msgid ""
     
    16681678msgstr "Файрвол"
    16691679
    1670 #: lib/Helper.php:706 src/Common.php:74 src/PageHandler.php:313
    1671 #: src/PageHandler.php:603 src/Strings.php:121
     1680#: lib/Helper.php:706 src/Common.php:74 src/PageHandler.php:314
     1681#: src/PageHandler.php:605 src/Strings.php:121
    16721682msgid "Antivirus"
    16731683msgstr "Антивирус"
     
    18241834msgstr "Активация"
    18251835
    1826 #: src/PageHandler.php:243 src/PageHandler.php:475 src/PageHandler.php:495
     1836#: src/PageHandler.php:243 src/PageHandler.php:476 src/PageHandler.php:496
    18271837msgid "Firewall activity"
    18281838msgstr "Файрвол активность"
    18291839
    1830 #: src/PageHandler.php:282 src/PageHandler.php:284
     1840#: src/PageHandler.php:283 src/PageHandler.php:285
    18311841msgid "Server resources"
    18321842msgstr "Ресурсы сервера"
    18331843
    1834 #: src/PageHandler.php:285
     1844#: src/PageHandler.php:286
    18351845msgid ""
    18361846"Displays critical data about web-server usage. A large load on a server can "
     
    18401850"на сервер может замедлить работу сайта."
    18411851
    1842 #: src/PageHandler.php:335
     1852#: src/PageHandler.php:336
    18431853msgid "Monitoring"
    18441854msgstr "Мониторинг"
    18451855
    1846 #: src/PageHandler.php:378
     1856#: src/PageHandler.php:379
    18471857msgid "Scanning"
    18481858msgstr "Сканирование"
    18491859
    1850 #: src/PageHandler.php:550 src/PageHandler.php:669
     1860#: src/PageHandler.php:552 src/PageHandler.php:671
    18511861msgid "Sorry, you are not allowed to view this page."
    18521862msgstr "Извините, вам не разрешен просмотр этой страницы."
  • wt-security/trunk/lib/API.php

    r2781286 r2782267  
    327327    $period = WebTotem::getPeriod($days);
    328328
    329     $payload = '{"query":"query($id: ID!, $dateRange: DateRangeInput!, $language: Language!, $dateRangeWeek: DateRangeInput!, $wafLogFilter: WafLogFilter!) { auth { viewer { sites { one(id: $id) { ports { status ip tcp ignorePorts lastTest { time } } availability { status lastTest { time } responseTime downTime(dateRange: $dateRange) percent(dateRange: $dateRange) } deface { status lastTest { time } words count } domain { status registrar owner email createdDate expiredDate } ports { status lastTest { time } ip tcp country } ssl { status daysLeft expiryDate issueDate } reputation { status lastTest { time } virusList { virus{ type path } antiVirus } } firewall { lastTest { time } logs(wafLogFilter: $wafLogFilter){ edges{ node{ type blocked payload ip location{ country{ nameEn } } time request status country category } } } map(dateRange: $dateRange) { attacks, country } status chart(dateRange: $dateRange) { time attacks blocked } report(dateRange: $dateRange) { time attacks ip } } serverStatus { info { phpVersion phpServerUser phpServerSoftware phpGatewayInterface phpServerProtocol osInfo cpuCount cpuModel CpuFreq cpuFamily lsCpu maxExecTime mathLibraries } ramChart(dateRange: $dateRangeWeek){ total value time } cpuChart(dateRange: $dateRangeWeek){ value time } discUsage{ total free } status } maliciousScript { lastTest { time } status } scoring( language: $language ){ score lastTest{ time } result{ ip country isHigherThan }} agentManager{ createdAt } antivirus { status stats { changed deleted scanned infected error } lastTest { time } isFirstCheck } } } } } }","variables":{"id":"' . $host_id . '","dateRange":{"to":' . $period['to'] . ',"from":' . $period['from'] . '}, "dateRangeWeek":{"to":' . $period['to'] . ',"from":' . $period['from'] . '}, "wafLogFilter": {"dateRange":{"to":' . $period['to'] . ',"from":' . $period['from'] . '},"order":{"direction":"DESC","field":"time"},"pagination":{"first": 10,"cursor":null}}, "language":"' . $language . '"}}';
     329    $payload = '{"query":"query($id: ID!, $dateRange: DateRangeInput!, $language: Language!, $dateRangeWeek: DateRangeInput!, $wafLogFilter: WafLogFilter!) { auth { viewer { sites { one(id: $id) { ports { status ip tcp ignorePorts lastTest { time } } availability { status lastTest { time } responseTime downTime(dateRange: $dateRange) percent(dateRange: $dateRange) } deface { status lastTest { time } words count } domain { status registrar owner email createdDate expiredDate } ports { status lastTest { time } ip tcp country } ssl { status daysLeft expiryDate issueDate } reputation { status lastTest { time } virusList { virus{ type path } antiVirus } } firewall { lastTest { time } logs(wafLogFilter: $wafLogFilter){ edges{ node{ type blocked payload ip proxyIp userAgent description source region signatureId location{ country{ nameEn } } time request status country category } } } map(dateRange: $dateRange) { attacks, country } status chart(dateRange: $dateRange) { time attacks blocked } report(dateRange: $dateRange) { time attacks ip } } serverStatus { info { phpVersion phpServerUser phpServerSoftware phpGatewayInterface phpServerProtocol osInfo cpuCount cpuModel CpuFreq cpuFamily lsCpu maxExecTime mathLibraries } ramChart(dateRange: $dateRangeWeek){ total value time } cpuChart(dateRange: $dateRangeWeek){ value time } discUsage{ total free } status } maliciousScript { lastTest { time } status } scoring( language: $language ){ score lastTest{ time } result{ ip country isHigherThan }} agentManager{ createdAt } antivirus { status stats { changed deleted scanned infected error } lastTest { time } isFirstCheck } } } } } }","variables":{"id":"' . $host_id . '","dateRange":{"to":' . $period['to'] . ',"from":' . $period['from'] . '}, "dateRangeWeek":{"to":' . $period['to'] . ',"from":' . $period['from'] . '}, "wafLogFilter": {"dateRange":{"to":' . $period['to'] . ',"from":' . $period['from'] . '},"order":{"direction":"DESC","field":"time"},"pagination":{"first": 10,"cursor":null}}, "language":"' . $language . '"}}';
    330330    $response = self::sendRequest($payload, TRUE);
    331331
  • wt-security/trunk/lib/Ajax.php

    r2781286 r2782267  
    10101010   
    10111011                    WebTotemOption::setNotification('success', __('Your changes have been applied successfully.', 'wtotem'));
    1012                     $response['success'] = true;
     1012                    WebTotemOption::setNotification('warning', __('Please make sure that no other recaptcha is used on your site. Otherwise, there may be a conflict that will cause problems when logging into the admin panel.', 'wtotem'));
     1013
     1014                  $response['success'] = true;
    10131015   
    10141016   
     
    10301032                    WebTotemOption::setPluginSettings($settings);
    10311033
    1032                     WebTotemOption::setNotification('success', __('Your changes have been applied successfully.', 'wtotem'));
     1034                  WebTotemOption::setNotification('success', __('Your changes have been applied successfully.', 'wtotem'));
     1035
    10331036                    $response['success'] = true;
    1034 
    10351037
    10361038                    break;
     
    10561058                                $response['errors']['login_minutes_of_ban'] = __('The field is required.', 'wtotem');
    10571059                            }
    1058                         }
    1059                         if(isset($data['login_number_of_attempts']) and
    1060                             ($data['login_number_of_attempts'] <= 0 or $data['login_number_of_attempts'] > 1000000)) {
     1060                        } else if($data['login_number_of_attempts'] <= 0 or $data['login_number_of_attempts'] > 1000000) {
    10611061                          $response['success'] = false;
    10621062                          $response['errors']['login_number_of_attempts'] = __('Please specify a value from 1 to 1000000.', 'wtotem');
     
    10771077                                $response['errors']['password_reset_minutes_of_ban'] = __('The field is required.', 'wtotem');
    10781078                            }
    1079                         }
    1080 
    1081                       if(isset($data['password_reset_number_of_attempts']) and
    1082                           ($data['password_reset_number_of_attempts'] <= 0 or $data['password_reset_number_of_attempts'] > 1000000)) {
     1079                        } else if($data['password_reset_number_of_attempts'] <= 0 or $data['password_reset_number_of_attempts'] > 1000000) {
    10831080                        $response['success'] = false;
    10841081                        $response['errors']['password_reset_number_of_attempts'] = __('Please specify a value from 1 to 1000000.', 'wtotem');
     
    10871084                    if(!$response['success']){
    10881085                        break;
     1086                    } else {
     1087                      $response['errors']  = false;
    10891088                    }
    10901089
     
    13621361                case 'activate':
    13631362   
    1364                     $g = new GoogleAuthenticator();
     1363                    $g = new WebTotemGoogleAuthenticator();
    13651364   
    13661365                    $user = wp_get_current_user();
  • wt-security/trunk/lib/DB.php

    r2781286 r2782267  
    9696        $where = implode(' AND ', $where);
    9797
    98         $options = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $table_name WHERE $where" ) );
     98        $options = $wpdb->get_row( "SELECT * FROM $table_name WHERE $where" );
    9999
    100100        return (array) $options ?: [];
  • wt-security/trunk/lib/Interface.php

    r2781286 r2782267  
    228228            'recaptcha_site_key' => WebTotemCaptcha::_siteKey(),
    229229            'recaptcha_is_enabled' => $recaptcha_enabled,
    230             'ajaxurl' => admin_url('admin-ajax.php'),
     230            'ajaxurl' => admin_url('admin-ajax.php', 'relative'),
    231231        ]);
    232 
    233     }
    234    
     232    }
    235233
    236234    /**
  • wt-security/trunk/lib/Option.php

    r2781286 r2782267  
    2424  public static function getOption($option) {
    2525    $data = WebTotemDB::getData([ 'name' => $option ],'settings');
    26     return $data['value'];
     26    return (array_key_exists('value', $data)) ? $data['value'] : '';
    2727  }
    2828
  • wt-security/trunk/lib/login/FixedByteNotation.php

    r2773990 r2782267  
    1515* @package FixedBitNotation
    1616*/
    17 class FixedBitNotation
     17class WebTotemFixedBitNotation
    1818{
    1919    protected $_chars;
  • wt-security/trunk/lib/login/GoogleAuthenticator.php

    r2773990 r2782267  
    2525
    2626
    27 class GoogleAuthenticator {
     27class WebTotemGoogleAuthenticator {
    2828    static $PASS_CODE_LENGTH = 6;
    2929    static $PIN_MODULO;
     
    5252            $time = floor(time() / 30);
    5353        }
    54         $base32 = new FixedBitNotation(5, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', TRUE, TRUE);
     54        $base32 = new WebTotemFixedBitNotation(5, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', TRUE, TRUE);
    5555        $secret = $base32->decode($secret);
    5656       
     
    8989            $secret .= pack("c",$c);
    9090        }
    91         $base32 = new FixedBitNotation(5, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', TRUE, TRUE);
     91        $base32 = new WebTotemFixedBitNotation(5, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', TRUE, TRUE);
    9292        return  $base32->encode($secret);
    9393    }
  • wt-security/trunk/lib/login/Login.php

    r2781286 r2782267  
    120120    public static function check2faCode($user, $code){
    121121        $data = self::getData($user->ID);
    122         $g = new GoogleAuthenticator();
     122        $g = new WebTotemGoogleAuthenticator();
    123123        $code = trim($code);
    124124
     
    220220
    221221        $data = self::getRecoveryData($user);
    222         $g = new GoogleAuthenticator();
     222        $g = new WebTotemGoogleAuthenticator();
    223223
    224224        $host = WebTotemOption::getMainHost();
  • wt-security/trunk/readme.txt

    r2781286 r2782267  
    7171
    7272== Changelog ==
     73= 2.4.15 =
     74* Fixed the cause of php warnings
     75* Fixed conflict with Google Authenticator
     76* Fixed errors in styles
     77* Internal improvements
     78
    7379= 2.4.14 =
    7480* Added firewall log report
  • wt-security/trunk/wt-security.php

    r2781286 r2782267  
    77 * Text Domain: wtotem
    88 * Domain Path: /lang
    9  * Version: 2.4.14
     9 * Version: 2.4.15
    1010 *
    1111 * PHP version 7.1
     
    5454 * Current version of the plugin's code.
    5555 */
    56 define('WEBTOTEM_VERSION', '2.4.14');
     56define('WEBTOTEM_VERSION', '2.4.15');
    5757
    5858/**
Note: See TracChangeset for help on using the changeset viewer.