Changeset 2837032
- Timestamp:
- 12/21/2022 04:22:47 AM (2 years ago)
- Location:
- wt-security
- Files:
-
- 448 added
- 1 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
wt-security/trunk/includes/css/main.css
r2797028 r2837032 52 52 margin-left: -18px; 53 53 } 54 .wtotem_body .lock { 54 .wtotem_body p{ 55 font-size: 14px; 56 } 57 .wtotem_body.lock, body.lock{ 55 58 overflow: hidden; 56 59 } … … 4875 4878 display: block; 4876 4879 position: fixed; 4877 min-height: 100vh;4880 height: 100vh; 4878 4881 overflow-y: auto; 4879 4882 top: 30px; … … 5218 5221 5219 5222 /* 5223 * Country blocking styles 5224 */ 5225 .wtotem_body .block-country-section { 5226 padding: 19px 17px; 5227 display: flex; 5228 align-items: center; 5229 } 5230 .wtotem_body .block-country-section__content{ 5231 width: 100%; 5232 } 5233 .wtotem_body .country-blocking-modal-attacks-container { 5234 display: flex; 5235 justify-content: space-between; 5236 padding: 16px 12px; 5237 border: 1px solid #f3f5f6; 5238 border-radius: 10px; 5239 } 5240 .wtotem_body .country-blocking-modal .side-modal__content{ 5241 width: 650px!important; 5242 } 5243 .wtotem_body .country-blocking-modal-attack-block { 5244 display: flex; 5245 flex-direction: column; 5246 /*color: #5e6977;*/ 5247 gap: 10px; 5248 margin-right: 10px; 5249 } 5250 .wtotem_body .country-blocking-modal-attack-block__percent { 5251 font-size: 20px; 5252 font-weight: 700; 5253 } 5254 .wtotem_body .country-blocking-modal-attack-block__country { 5255 font-weight: 500; 5256 font-size: 14px; 5257 } 5258 .wtotem_body .country-blocking-modal-attack-block__country span { 5259 color: #3d50df; 5260 } 5261 .wtotem_body .country-blocking-modal-header { 5262 padding: 30px; 5263 box-shadow: 0px 20px 20px -20px rgba(0, 0, 0, 0.15); 5264 display: flex; 5265 flex-direction: column; 5266 gap: 20px; 5267 } 5268 .wtotem_body .country-blocking-modal__search-input { 5269 padding: 3px 15px; 5270 border: 2px solid #f3f5f6; 5271 border-radius: 10px; 5272 width: 100%; 5273 font-weight: 500; 5274 font-size: 16px; 5275 } 5276 .wtotem_body .country-blocking-modal__search-input::placeholder { 5277 color: #86939e; 5278 font-weight: 500; 5279 font-size: 16px; 5280 } 5281 .wtotem_body .country-blocking-modal__content { 5282 height: calc(100% - 100px); 5283 } 5284 .wtotem_body .country-blocking-form { 5285 color: #9dafbd; 5286 font-size: 14px; 5287 min-height: calc(100% - 210px); 5288 display: flex; 5289 flex-direction: column; 5290 justify-content: space-between; 5291 } 5292 .wtotem_body .country-blocking-form__main { 5293 padding-bottom: 95px; 5294 } 5295 .wtotem_body .country-blocking-form__select-all { 5296 display: flex; 5297 align-items: center; 5298 gap: 16px; 5299 padding: 15px 30px 0; 5300 } 5301 .wtotem_body .country-blocking-form__checkbox:focus { 5302 border-width: 1px; 5303 } 5304 .wtotem_body .country-blocking-form__region-container { 5305 display: flex; 5306 justify-content: space-between; 5307 align-items: center; 5308 padding: 15px 30px; 5309 border-bottom: 1px solid #f3f5f6; 5310 background-color: transparent; 5311 border: none; 5312 cursor: pointer; 5313 width: 100%; 5314 color: inherit; 5315 } 5316 .wtotem_body .country-blocking-form__select-region { 5317 display: flex; 5318 align-items: center; 5319 justify-content: space-between; 5320 border-bottom: 1px solid #f3f5f6; 5321 padding: 15px 0; 5322 } 5323 .wtotem_body .country-blocking-form__region-name { 5324 color: #86939e; 5325 font-size: 18px; 5326 font-weight: 500; 5327 text-align: left; 5328 margin-bottom: 4px; 5329 } 5330 .wtotem_body .country-blocking-form__country-container { 5331 display: flex; 5332 align-items: center; 5333 justify-content: space-between; 5334 } 5335 .wtotem_body .country-blocking-form__region-countries { 5336 height: 0; 5337 overflow: hidden; 5338 } 5339 .wtotem_body .country-blocking-form__region-countries--open { 5340 padding: 13px 50px; 5341 height: auto; 5342 } 5343 .wtotem_body .country-blocking-form__country { 5344 padding: 15px 0; 5345 display: flex; 5346 align-items: center; 5347 gap: 12px; 5348 } 5349 .wtotem_body .country-blocking-form-save { 5350 padding: 20px 45px; 5351 display: flex; 5352 justify-content: space-between; 5353 align-items: center; 5354 background-color: #fff; 5355 box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.15); 5356 position: sticky; 5357 left: 0; 5358 width: 100%; 5359 bottom: 30px; 5360 } 5361 .wtotem_body .country-blocking-form-save__btn { 5362 margin: 0!important; 5363 text-transform: uppercase; 5364 font-weight: bold; 5365 } 5366 .wtotem_body .chevron { 5367 rotate: 0deg; 5368 transition: all 0.1s ease-in; 5369 } 5370 .wtotem_body .chevron--open { 5371 rotate: -90deg; 5372 } 5373 5374 /* 5375 * WP scan page styles 5376 */ 5377 .wtotem_scan__third { 5378 margin-top: 48px; 5379 } 5380 ::-webkit-scrollbar { 5381 width: 4px; 5382 } 5383 ::-webkit-scrollbar-thumb { 5384 background-color: #d1d5db; 5385 border-radius: 22222px; 5386 } 5387 .tab.audit-logs, 5388 .tab.links, 5389 .tab.scripts, 5390 .tab.iframes { 5391 display: none; 5392 } 5393 .tab.audit-logs.tab--active, 5394 .tab.links.tab--active, 5395 .tab.scripts.tab--active, 5396 .tab.iframes.tab--active { 5397 display: block; 5398 } 5399 .scan-tabs { 5400 display: flex; 5401 gap: 40px; 5402 padding: 12px 0 0; 5403 border-bottom: 1px solid #f3f4f6; 5404 margin: 0 16px; 5405 } 5406 .scan-tabs__item { 5407 padding-bottom: 16px; 5408 border-bottom: 2px solid transparent; 5409 transform: translateY(1.5px); 5410 } 5411 .scan-tabs__item .num { 5412 padding: 2px 10px; 5413 border-radius: 10px; 5414 margin-left: 8px; 5415 background-color: #f3f4f6; 5416 color: #1d293f; 5417 } 5418 .scan-tabs__item .num--empty { 5419 padding: 0; 5420 } 5421 .scan-tabs__item--active { 5422 border-bottom-color: #3d50df; 5423 } 5424 .scan-tabs__item--active .scan-tabs__btn { 5425 color: #3d50df; 5426 } 5427 .scan-tabs__item--active .num { 5428 color: #3d50df; 5429 background-color: #e0e7ff; 5430 } 5431 .scan-tabs__btn { 5432 font-weight: 500; 5433 cursor: pointer; 5434 color: #86939e; 5435 background-color: transparent; 5436 border: none; 5437 } 5438 .audit-logs { 5439 display: flex; 5440 flex-direction: column; 5441 } 5442 .audit-logs__controls { 5443 display: flex; 5444 padding: 12px 16px; 5445 border-bottom: 1px solid #f3f4f6; 5446 } 5447 .audit-logs__time { 5448 background-color: transparent; 5449 border: none; 5450 color: #86939e; 5451 text-transform: uppercase; 5452 display: flex; 5453 gap: 35px; 5454 align-items: center; 5455 padding-right: 15px 5456 } 5457 .audit-logs__time:hover { 5458 cursor: pointer; 5459 } 5460 .audit-logs__time-icon--up, 5461 .audit-logs__time-icon--down { 5462 width: 8px; 5463 fill: #86939e; 5464 } 5465 .audit-logs__time[data-order="descending"] .audit-logs__time-icon--down { 5466 fill: #1d293f; 5467 } 5468 .audit-logs__time[data-order="ascending"] .audit-logs__time-icon--up { 5469 fill: #1d293f; 5470 } 5471 .audit-logs__icon-container { 5472 height: 24px; 5473 display: flex; 5474 gap: 4px; 5475 justify-content: center; 5476 flex-direction: column; 5477 } 5478 .audit-logs__label { 5479 color: #86939e; 5480 text-transform: uppercase; 5481 } 5482 .audit-logs__event-container { 5483 display: flex; 5484 align-items: center; 5485 gap: 24px; 5486 flex: 3; 5487 } 5488 .audit-logs__event { 5489 padding: 5px 8px; 5490 border-radius: 6px; 5491 border: 1px solid #d1d5db; 5492 color: #86939e; 5493 } 5494 .audit-logs__left { 5495 display: flex; 5496 justify-content: space-between; 5497 align-items: center; 5498 flex: 2; 5499 } 5500 .audit-logs__ip { 5501 text-align: right; 5502 flex: 1; 5503 } 5504 .audit-logs__time, 5505 .audit-logs__user { 5506 flex: 1; 5507 } 5508 .audit-logs__user { 5509 padding-right: 20px; 5510 } 5511 .audit-logs__content { 5512 display: flex; 5513 flex-direction: column; 5514 gap: 32px; 5515 /*max-height: 390px;*/ 5516 overflow-y: scroll; 5517 padding: 12px 16px 20px; 5518 } 5519 .audit-logs__short-info { 5520 display: flex; 5521 align-items: center; 5522 } 5523 .audit-logs__date { 5524 color: #1d293f; 5525 font-size: 18px; 5526 margin-right: 12px; 5527 } 5528 .audit-logs__divider { 5529 flex: 5; 5530 background-color: #d1d5db; 5531 height: 1px; 5532 float: left; 5533 align-items: center; 5534 } 5535 .audit-logs__time-count { 5536 text-align: right; 5537 display: flex; 5538 align-items: center; 5539 justify-content: center; 5540 width: 35px; 5541 height: 35px; 5542 border: 1px solid #d1d5db; 5543 border-radius: 100%; 5544 } 5545 .audit-logs__entries-container { 5546 display: flex; 5547 flex-direction: column; 5548 gap: 20px; 5549 } 5550 .audit-logs-entry { 5551 display: flex; 5552 justify-content: space-between; 5553 } 5554 .audit-logs-entry__left { 5555 display: flex; 5556 justify-content: space-between; 5557 align-items: center; 5558 flex: 2; 5559 } 5560 .audit-logs-entry__ip { 5561 flex: 1; 5562 text-align: right; 5563 color: #86939e; 5564 font-size: 14px; 5565 } 5566 .audit-logs-entry__time { 5567 color: #86939e; 5568 display: flex; 5569 align-items: center; 5570 gap: 4px; 5571 flex: 1; 5572 margin-right: -25px; 5573 } 5574 .audit-logs-entry__description { 5575 flex: 3; 5576 color: #1d293f; 5577 max-width: 395px; 5578 word-break: break-all; 5579 } 5580 .audit-logs-entry__status-container { 5581 flex: 1; 5582 margin-right: 25px; 5583 width: 131px; 5584 position: relative; 5585 align-items: center; 5586 display: flex; 5587 } 5588 .audit-logs-entry__status{ 5589 padding: 0 10px; 5590 border-radius: 10px; 5591 max-width: 130px; 5592 width: fit-content; 5593 text-overflow:ellipsis; 5594 white-space: nowrap; 5595 overflow: hidden; 5596 display: block; 5597 position: absolute; 5598 } 5599 .audit-logs-entry__status:hover{ 5600 text-overflow:clip; 5601 width:auto; 5602 white-space: normal; 5603 max-width: none; 5604 } 5605 .audit-logs-entry__status--notice { 5606 color: #065f46; 5607 background-color: #d1fae5; 5608 } 5609 .audit-logs-entry__status--warning { 5610 color: #92400e; 5611 background-color: #fef3c7; 5612 } 5613 .audit-logs-entry__status--critical { 5614 color: #991b1b; 5615 background-color: #fee2e2; 5616 } 5617 .audit-logs-entry[data-unseen="1"] .audit-logs-entry__new { 5618 display: block; 5619 width: 6px; 5620 height: 6px; 5621 background-color: #3d50df; 5622 border-radius: 100%; 5623 } 5624 .tab.links.tab--active, 5625 .tab.scripts.tab--active, 5626 .tab.iframes.tab--active { 5627 display: flex; 5628 flex-direction: column; 5629 gap: 20px; 5630 /*height: 390px;*/ 5631 margin-top: 12px; 5632 overflow-y: scroll; 5633 } 5634 .tab.links.tab--active.tab--no-data, 5635 .tab.scripts.tab--active.tab--no-data, 5636 .tab.iframes.tab--active.tab--no-data { 5637 justify-content: center; 5638 align-items: center; 5639 color: #1d293f; 5640 } 5641 .tab.links.tab--active .links__item, 5642 .tab.links.tab--active .scripts__item, 5643 .tab.links.tab--active .iframes__item, 5644 .tab.scripts.tab--active .links__item, 5645 .tab.scripts.tab--active .scripts__item, 5646 .tab.scripts.tab--active .iframes__item, 5647 .tab.iframes.tab--active .links__item, 5648 .tab.iframes.tab--active .scripts__item, 5649 .tab.iframes.tab--active .iframes__item { 5650 color: #3d50df; 5651 padding: 8px 16px; 5652 display: flex; 5653 align-items: center; 5654 gap: 13px; 5655 } 5656 5657 .wtotem_body .span__item{ 5658 padding: 8px 16px; 5659 display: flex; 5660 align-items: center; 5661 gap: 13px; 5662 } 5663 5664 .tab.links.tab--active .links__item .hover-icon, 5665 .tab.links.tab--active .scripts__item .hover-icon, 5666 .tab.links.tab--active .iframes__item .hover-icon, 5667 .tab.scripts.tab--active .links__item .hover-icon, 5668 .tab.scripts.tab--active .scripts__item .hover-icon, 5669 .tab.scripts.tab--active .iframes__item .hover-icon, 5670 .tab.iframes.tab--active .links__item .hover-icon, 5671 .tab.iframes.tab--active .scripts__item .hover-icon, 5672 .tab.iframes.tab--active .iframes__item .hover-icon { 5673 display: none; 5674 } 5675 .tab.links.tab--active .links__item:hover, 5676 .tab.links.tab--active .scripts__item:hover, 5677 .tab.links.tab--active .iframes__item:hover, 5678 .tab.scripts.tab--active .links__item:hover, 5679 .tab.scripts.tab--active .scripts__item:hover, 5680 .tab.scripts.tab--active .iframes__item:hover, 5681 .tab.iframes.tab--active .links__item:hover, 5682 .tab.iframes.tab--active .scripts__item:hover, 5683 .tab.iframes.tab--active .iframes__item:hover { 5684 background-color: rgba(61, 80, 223, 0.04); 5685 } 5686 .tab.links.tab--active .links__item:hover .hover-icon, 5687 .tab.links.tab--active .scripts__item:hover .hover-icon, 5688 .tab.links.tab--active .iframes__item:hover .hover-icon, 5689 .tab.scripts.tab--active .links__item:hover .hover-icon, 5690 .tab.scripts.tab--active .scripts__item:hover .hover-icon, 5691 .tab.scripts.tab--active .iframes__item:hover .hover-icon, 5692 .tab.iframes.tab--active .links__item:hover .hover-icon, 5693 .tab.iframes.tab--active .scripts__item:hover .hover-icon, 5694 .tab.iframes.tab--active .iframes__item:hover .hover-icon { 5695 display: block; 5696 } 5697 .files__controls { 5698 display: flex; 5699 gap: 36px; 5700 border-bottom: 1px solid #f3f5f6; 5701 padding: 12px 16px; 5702 } 5703 .files__controls[data-order-type="date"] .files__btn--last-modify[data-order="descending"] .files__last-modify-icon--down { 5704 fill: #1d293f; 5705 } 5706 .files__controls[data-order-type="date"] .files__btn--last-modify[data-order="ascending"] .files__last-modify-icon--up { 5707 fill: #1d293f; 5708 } 5709 .files__controls[data-order-type="size"] .files__btn--size[data-order="descending"] .files__size-icon--down { 5710 fill: #1d293f; 5711 } 5712 .files__controls[data-order-type="size"] .files__btn--size[data-order="ascending"] .files__size-icon--up { 5713 fill: #1d293f; 5714 } 5715 .files__btn { 5716 background-color: transparent; 5717 border: none; 5718 display: flex; 5719 justify-content: space-between; 5720 align-items: center; 5721 color: #86939e; 5722 text-transform: uppercase; 5723 } 5724 .files__btn:hover { 5725 cursor: pointer; 5726 } 5727 .files__btn--size { 5728 flex: 1; 5729 } 5730 .files__btn--last-modify { 5731 flex: 2; 5732 } 5733 .files__btn--file-name { 5734 flex: 3; 5735 } 5736 .files__icon-container { 5737 height: 24px; 5738 display: flex; 5739 gap: 4px; 5740 justify-content: center; 5741 flex-direction: column; 5742 } 5743 .files__icon { 5744 width: 8px; 5745 fill: #86939e; 5746 } 5747 .files__file-name-title { 5748 color: #86939e; 5749 text-transform: uppercase; 5750 flex: 3; 5751 } 5752 .files__path { 5753 color: #86939e; 5754 text-transform: uppercase; 5755 flex: 4; 5756 } 5757 .files__empty { 5758 flex: 1; 5759 } 5760 .files__icon-container { 5761 display: flex; 5762 flex-direction: column; 5763 } 5764 .files__container { 5765 display: flex; 5766 flex-direction: column; 5767 gap: 16px; 5768 max-height: 390px; 5769 overflow-y: scroll; 5770 } 5771 .files__item { 5772 display: flex; 5773 gap: 36px; 5774 align-items: flex-start; 5775 padding: 8px 12px 16px; 5776 font-size: 14px; 5777 } 5778 .files__item:hover { 5779 background-color: rgba(61, 80, 223, 0.04); 5780 } 5781 .files__size { 5782 flex: 1; 5783 color: #86939e; 5784 text-transform: uppercase; 5785 } 5786 .files__last-modify { 5787 flex: 2; 5788 color: #1d293f; 5789 } 5790 .files__file-name { 5791 flex: 3; 5792 color: #3d50df; 5793 } 5794 .files__file-name:focus-visible { 5795 text-decoration: underline; 5796 } 5797 .files__file-path { 5798 flex: 4; 5799 word-break: break-all; 5800 color: #1d293f; 5801 line-height: 20px; 5802 } 5803 .files__btn-dots { 5804 display: flex; 5805 justify-content: end; 5806 background-color: transparent; 5807 border: 1px solid transparent; 5808 flex: 1; 5809 margin-top: 5px; 5810 position: relative; 5811 } 5812 .files__btn-dots:hover { 5813 cursor: pointer; 5814 } 5815 .options { 5816 flex-direction: column; 5817 border-radius: 4px; 5818 background-color: #fff; 5819 box-shadow: 0px 4px 16px rgba(83, 93, 184, 0.12); 5820 position: absolute; 5821 display: none; 5822 } 5823 .options.options--open { 5824 display: flex; 5825 } 5826 .options__item { 5827 background-color: transparent; 5828 border: none; 5829 cursor: pointer; 5830 color: #1d293f; 5831 font-size: 14px; 5832 padding: 11px 45px 11px 14px; 5833 text-align: left; 5834 display: flex; 5835 gap: 10px; 5836 align-items: flex-end; 5837 } 5838 .options__item:disabled { 5839 color: #86939e; 5840 cursor: default; 5841 } 5842 .options__item:not(:last-child) { 5843 border-bottom: 1px solid #f3f5f6; 5844 } 5845 .popup { 5846 position: fixed; 5847 z-index: 10; 5848 top: 0; 5849 left: 0; 5850 height: 100%; 5851 width: 100%; 5852 background: rgba(3, 4, 28, 0.3); 5853 justify-content: center; 5854 align-items: center; 5855 font-family: "Inter", sans-serif; 5856 display: none; 5857 } 5858 .popup--active { 5859 display: flex; 5860 } 5861 .popup__container { 5862 background-color: #fff; 5863 border-radius: 8px; 5864 padding: 24px; 5865 display: flex; 5866 flex-direction: column; 5867 width: 512px; 5868 box-shadow: 0px 20px 25px -5px rgba(0, 0, 0, 0.1), 0px 10px 10px -5px rgba(0, 0, 0, 0.04); 5869 } 5870 .popup__content { 5871 display: flex; 5872 gap: 16px; 5873 } 5874 .popup__text { 5875 display: flex; 5876 flex-direction: column; 5877 gap: 8px; 5878 } 5879 .popup__title { 5880 color: #1d293f; 5881 font-size: 18px; 5882 } 5883 .popup__file-name { 5884 color: #86939e; 5885 font-size: 14px; 5886 word-break: break-all; 5887 line-height: 20px; 5888 } 5889 .popup__btns { 5890 margin-left: auto; 5891 display: flex; 5892 gap: 12px; 5893 } 5894 .popup__btn { 5895 padding: 9px 17px; 5896 border-radius: 6px; 5897 font-size: 14px; 5898 border: 1px solid transparent; 5899 font-family: "Inter", sans-serif; 5900 } 5901 .popup__btn:hover { 5902 cursor: pointer; 5903 } 5904 .popup__cancel { 5905 border-color: #86939e; 5906 color: #1d293f; 5907 background-color: #fff; 5908 } 5909 .popup__delete { 5910 background-color: #dc2626; 5911 border-color: #dc2626; 5912 color: #fff; 5913 } 5914 5915 /* 5916 * Pagination styles 5917 */ 5918 .wtotem_pagination { 5919 display: flex; 5920 align-items: center; 5921 justify-content: center; 5922 padding: 12px 16px 45px; 5923 } 5924 .wtotem_pagination__number { 5925 color: #99a6b1; 5926 font-weight: 500; 5927 margin: 15px; 5928 display: flex; 5929 align-items: center; 5930 } 5931 .wtotem_pagination__number:hover { 5932 color: #5e6977; 5933 } 5934 .wtotem_pagination__number_active { 5935 width: 46px; 5936 height: 46px; 5937 background: #f1f3f5; 5938 color: #5e6977; 5939 margin: 0px; 5940 border-radius: 100px; 5941 display: flex; 5942 justify-content: center; 5943 align-items: center; 5944 } 5945 .wtotem_pagination__number_etc { 5946 margin-right: 22px; 5947 } 5948 .wtotem_pagination__arrow { 5949 width: 19px; 5950 height: 12px; 5951 display: block; 5952 cursor: pointer; 5953 } 5954 5955 /* 5220 5956 * MultiSite page 5221 5957 */ … … 5415 6151 .wtotem_theme—dark .wtotem_body .wt_card, 5416 6152 .wtotem_theme—dark .wtotem_body .wt_card:before, 5417 .wtotem_theme—dark .wtotem_chart-first__btn_active { 6153 .wtotem_theme—dark .wtotem_chart-first__btn_active, 6154 .wtotem_theme—dark .country-blocking-form-save{ 5418 6155 background: #282828; 5419 6156 } … … 5472 6209 .wtotem_theme—dark .wtotem_body .onoff__label:before, 5473 6210 .wtotem_theme—dark .wtotem_unit__expectation_loading, 5474 .wtotem_theme—dark .wtotem_alert__text { 6211 .wtotem_theme—dark .wtotem_alert__text, 6212 .wtotem_theme—dark .audit-logs-entry__description, 6213 .wtotem_theme—dark .audit-logs__date{ 5475 6214 color: #f3f5f6; 5476 6215 } … … 5487 6226 .wtotem_theme—dark .wtotem_last_scan_av { 5488 6227 border-color: #191919; 6228 } 6229 .wtotem_theme—dark .audit-logs__time-count{ 6230 border: 1px solid #3c3c3d; 5489 6231 } 5490 6232 .wtotem_theme—dark .wtotem_title-info__info { … … 5510 6252 border-right: none; 5511 6253 } 5512 .wtotem_theme—dark .wtotem_chart__line { 6254 .wtotem_theme—dark .wtotem_chart__line, 6255 .wtotem_theme—dark .audit-logs__divider{ 5513 6256 background: #3c3c3d; 5514 6257 } 5515 6258 .wtotem_theme—dark .wtotem_table__th, 5516 .wtotem_theme—dark .wtotem_table__td { 6259 .wtotem_theme—dark .wtotem_table__td, 6260 .wtotem_theme—dark .wtotem_body .country-blocking-form__select-region{ 5517 6261 border-bottom: 1px solid #3c3c3d; 6262 } 6263 .wtotem_theme—dark .wtotem_body .country-blocking-form{ 6264 color: #e2e2e2; 5518 6265 } 5519 6266 .wtotem_theme—dark .wtotem_table__link:after { … … 5536 6283 background: #2d2e2e; 5537 6284 } 5538 5539 6285 .wtotem_theme—dark .wtotem_body td, 5540 6286 .wtotem_theme—dark .wtotem_body th { … … 5542 6288 background: #282828; 5543 6289 } 5544 5545 6290 .wtotem_theme—dark .wtotem_footer__logo { 5546 6291 background: url("../img/dr-logo-footer.svg") no-repeat center center/cover; … … 5581 6326 color: #e2e2e2; 5582 6327 } 5583 .wtotem_theme—dark .wtotem_body . wtotem-waf-settings-popup__input{6328 .wtotem_theme—dark .wtotem_body .country-blocking-modal-attacks-container { 5584 6329 border: 1px solid #333333; 5585 background-color: #191919;5586 6330 color: #ffffff; 5587 6331 } 5588 .wtotem_theme—dark .wtotem_body .firewall-configuration__ip-adress { 6332 .wtotem_theme—dark .wtotem_body .wtotem-waf-settings-popup__input, 6333 .wtotem_theme—dark .wtotem_body .firewall-configuration__ip-adress, 6334 .wtotem_theme—dark .wtotem_body .country-blocking-modal__search-input{ 5589 6335 border: 1px solid #333333; 5590 6336 background-color: #191919; … … 5793 6539 color: #fff; 5794 6540 } 5795 6541 .wtotem_theme—dark .scan-tabs__item--active .scan-tabs__btn{ 6542 color: #7d8dff; 6543 } 6544 .wtotem_theme—dark .scan-tabs__item--active{ 6545 border-bottom-color: #7d8dff; 6546 } 5796 6547 .wtotem_theme—dark .firewall-log-report__payload{ 5797 6548 color: #000; 6549 } 6550 .wtotem_theme—dark .wtotem_body .audit-logs__event{ 6551 background: #191919 url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E) no-repeat right 5px top 55%; 6552 color: #f3f5f6; 6553 } 6554 .wtotem_theme—dark .scan-tabs__item .num{ 6555 background-color: #191919; 6556 color: #f3f5f6; 6557 } 6558 .wtotem_theme—dark .wtotem_body .scan-tabs__item--active .num{ 6559 background-color: #191919; 6560 color: #7d8dff; 6561 } 6562 .wtotem_theme—dark .wtotem_body .audit-logs__controls, 6563 .wtotem_theme—dark .wtotem_body .scan-tabs{ 6564 border-bottom: 1px solid #3c3c3d; 5798 6565 } 5799 6566 -
wt-security/trunk/includes/js/main.js
r2797028 r2837032 30 30 if (e.target.className.includes('popup-overlay')) { 31 31 $('.popup-overlay').addClass('d-none'); 32 $('body').removeClass('lock'); 32 33 } 33 34 }).on('click', '.firewall-configuration__multi-adding', function () { … … 103 104 const overlay = document.querySelector(".side-modal__overlay"); 104 105 const message = document.querySelector(".wtotem_input__messages"); 106 const bodyEl = document.getElementsByTagName("body")[0]; 105 107 const toggleClassName = "side-modal--opened"; 108 const toggleBody = "lock"; 106 109 107 110 const showModal = () => { 108 111 modal.classList.add(toggleClassName); 112 bodyEl.classList.add(toggleBody); 109 113 }; 110 114 111 115 const closeModal = () => { 112 116 modal.classList.remove(toggleClassName); 117 bodyEl.classList.remove(toggleBody); 113 118 if (form) { 114 119 form.reset(); … … 132 137 addSideModal(modal, openButton, closeButton, form); 133 138 addSideModal(modal, openButton2, closeButton, form); 139 } 140 })(); 141 142 (function () { 143 const modal = document.querySelector(".country-blocking-modal"); 144 const openButton = document.querySelector("#block_countries_btn"); 145 const closeButton = document.querySelector(".country-blocking-modal__closeBtn"); 146 147 if (modal) { 148 addSideModal(modal, openButton, closeButton, false); 134 149 } 135 150 })(); -
wt-security/trunk/includes/templates/layout.html.twig
r2797028 r2837032 127 127 </a> 128 128 </li> 129 130 <li class="wtotem_nav__item"> 131 <a href="{{ menu_url }}_wpscan" class="wtotem_nav__link {{ is_active.wpscan }}"> 132 {{ 'WP scan'|trans }} 133 </a> 134 </li> 129 135 </ul> 130 136 </nav> -
wt-security/trunk/includes/templates/notifications.html.twig
r2797028 r2837032 16 16 17 17 <script> 18 toastr["{{ notice.type_raw }}"]('{{ notice.text | raw }}'); 18 jQuery(document).ready(function ($) { 19 toastr["{{ notice.type_raw }}"]('{{ notice.text | raw }}'); 20 }); 19 21 </script> 20 22 </div> -
wt-security/trunk/includes/templates/settings_form.html.twig
r2797028 r2837032 153 153 }, 154 154 function (data) { 155 if(!data.success){ 156 jQuery('#gdn').prop("checked", false); 157 jQuery('#dos').prop("checked", true); 158 jQuery('#login_attempt').prop("checked", true); 159 jQuery('#dos_limit').val(1000); 160 jQuery('#login_attempt_limit').val(20); 161 162 jQuery('#wtotem-attempt-limit').removeClass('visually-hidden'); 163 jQuery('#wtotem-dos-limit').removeClass('visually-hidden'); 155 if(data.errors){ 156 $('.wtotem_error_waf_settings').remove(); 157 $('#wtotem-waf-settings input').removeClass('wtotem_input_error'); 158 $.each(data.errors, function(index, value){ 159 160 if(value){ 161 $('#wtotem_' + index).append('<div class="is--status--error wtotem-mb-15 wtotem_error_waf_settings">'+ value +'</div>') 162 $('#' + index ).addClass('wtotem_input_error'); 163 } 164 }); 165 166 } else { 167 $('.wtotem_error_waf_settings').remove(); 168 $('#wtotem-waf-settings input').removeClass('wtotem_input_error'); 164 169 } 170 171 165 172 jQuery('#wtotem-waf-settings').removeClass('wtotem_loader_spinner'); 166 173 jQuery('#wtotem_notifications').html(data.notifications); … … 328 335 jQuery('#dos').on('change', function (e) { 329 336 if(jQuery(this).is(':checked')){ 330 jQuery('#wtotem -dos-limit').removeClass('visually-hidden');337 jQuery('#wtotem_dos_limit').removeClass('visually-hidden'); 331 338 } else { 332 jQuery('#wtotem -dos-limit').addClass('visually-hidden');339 jQuery('#wtotem_dos_limit').addClass('visually-hidden'); 333 340 } 334 341 }); … … 336 343 jQuery('#login_attempt').on('change', function (e) { 337 344 if(jQuery(this).is(':checked')){ 338 jQuery('#wtotem -attempt-limit').removeClass('visually-hidden');345 jQuery('#wtotem_login_attempt_limit').removeClass('visually-hidden'); 339 346 } else { 340 jQuery('#wtotem -attempt-limit').addClass('visually-hidden');347 jQuery('#wtotem_login_attempt_limit').addClass('visually-hidden'); 341 348 } 342 349 }); … … 383 390 ); 384 391 }); 385 386 387 388 392 }); 389 393 </script> … … 495 499 </div> 496 500 </section> 501 502 <div class="wt_card wtotem-mb-20 block-country-section"> 503 <div class="block-country-section__content"> 504 <h3 class="h3 wtotem-mb-15">{{ 'Country blocking'|trans }}</h3> 505 <p class="notifications-settings__text">{{ 'Block countries you want to limit access to your website.'|trans }}</p> 506 </div> 507 <button class="wtotem_control__btn wtotem_btn_wc" id="block_countries_btn" style="white-space: nowrap;">{{ 'Block countries'|trans }}</button> 508 509 {% include 'country_blocking_modal.html.twig' with {'blocked_countries_list': blocked_countries_list, 'mock_attacks': mock_attacks} %} 510 </div> 497 511 498 512 <section class="wt_card wtotem-mb-20"> … … 906 920 </div> 907 921 908 <div id="wtotem-dos-limit" class="{{ waf_settings.dos.visually }}"> 909 <label class="wtotem-waf-settings-popup__label" 910 for="dos_limit">{{ 'Login attempts' | trans }}</label> 922 <div id="wtotem_dos_limit" class="{{ waf_settings.dos.visually }}"> 911 923 <input class="wtotem-waf-settings-popup__input wtotem_settings_input" value="{{ waf_settings.dos_limit }}" 912 type="number" min=" 0" id="dos_limit" name="dos_limit" required>924 type="number" min="500" max="100000" id="dos_limit" name="dos_limit" required> 913 925 </div> 914 926 … … 936 948 </div> 937 949 938 <div id="wtotem-attempt-limit" class="{{ waf_settings.login_attempt.visually }}"> 939 <label class="wtotem-waf-settings-popup__label" for="login_attempt_limit"> 940 {{ 'Login attempts' | trans }} 941 </label> 950 <div id="wtotem_login_attempt_limit" class="{{ waf_settings.login_attempt.visually }}"> 951 942 952 <input class="wtotem-waf-settings-popup__input wtotem_settings_input" value="{{ waf_settings.login_attempt_limit }}" 943 type="number" min=" 0" id="login_attempt_limit" name="login_attempt_limit" required>953 type="number" min="5" max="30" id="login_attempt_limit" name="login_attempt_limit" required> 944 954 </div> 945 955 -
wt-security/trunk/lang/wtotem-ru_RU.po
r2797028 r2837032 2 2 msgstr "" 3 3 "Project-Id-Version: WebTotem Security\n" 4 "POT-Creation-Date: 2022- 09-20 15:43+0600\n"4 "POT-Creation-Date: 2022-11-30 11:56+0600\n" 5 5 "PO-Revision-Date: \n" 6 6 "Last-Translator: wtsec <[email protected]>\n" … … 16 16 "_nx_noop:1,2,3c;esc_attr__;esc_attr_e;esc_html__;esc_html_e\n" 17 17 "X-Poedit-Basepath: ..\n" 18 "X-Generator: Poedit 3. 1.1\n"18 "X-Generator: Poedit 3.2\n" 19 19 "X-Poedit-SearchPath-0: .\n" 20 20 "X-Poedit-SearchPath-1: src\n" … … 23 23 "X-Poedit-SearchPathExcluded-0: node_modules\n" 24 24 25 #: includes/js/country-blocking.js:443 src/Strings.php:292 26 msgid "countries blocked from" 27 msgstr "стран заблокировано в регионе" 28 29 #: includes/js/country-blocking.js:457 src/Strings.php:293 30 msgid "Select all" 31 msgstr "Выбрать все" 32 33 #: includes/js/country-blocking.js:562 src/Strings.php:97 src/Strings.php:291 34 msgid "Attack from" 35 msgstr "Атаки из" 36 25 37 #: includes/js/flatpickr.js:117 26 38 msgid "Sunday" … … 163 175 msgstr "Не удалось добавить сайт на платформу WebTotem ." 164 176 165 #: lib/API.php:2 57177 #: lib/API.php:262 166 178 msgid "A new website has been added: " 167 179 msgstr "Новый сайт был добавлен: " … … 197 209 msgstr "API: пустое тело ответа ." 198 210 199 #: lib/Ajax.php:17 1211 #: lib/Ajax.php:170 200 212 #, php-format 201 213 msgid "Some scanning data for %s may be deleted." 202 214 msgstr "Некоторые данные для %s могут быть удалены." 203 215 204 #: lib/Ajax.php:18 2216 #: lib/Ajax.php:181 205 217 msgid "Are you sure you want to change the API key?" 206 218 msgstr "Вы уверены, что хотите изменить ключ API?" 207 219 208 #: lib/Ajax.php: 842220 #: lib/Ajax.php:943 209 221 msgid "Report generation error" 210 222 msgstr "Ошибка формирования отчета" 211 223 212 #: lib/Ajax.php: 872224 #: lib/Ajax.php:973 213 225 msgid "The report was successfully generated" 214 226 msgstr "Отчет успешно сформирован" 215 227 216 #: lib/Ajax.php: 902 lib/Ajax.php:1233228 #: lib/Ajax.php:1003 lib/Ajax.php:1384 217 229 msgid "" 218 230 "It is not possible to make changes because the agents are not installed." 219 231 msgstr "Внести изменения невозможно, так как агенты не установлены." 220 232 221 #: lib/Ajax.php:954 lib/Ajax.php:1013 lib/Ajax.php:1028 lib/Ajax.php:1053 222 #: lib/Ajax.php:1125 233 #: lib/Ajax.php:1024 lib/Ajax.php:1036 lib/Ajax.php:1052 lib/Ajax.php:1106 234 #: lib/Ajax.php:1164 lib/Ajax.php:1179 lib/Ajax.php:1204 lib/Ajax.php:1276 235 #: lib/Ajax.php:1554 223 236 msgid "Your changes have been applied successfully." 224 237 msgstr "Ваши изменения были успешно применены." 225 238 226 #: lib/Ajax.php:974 lib/Ajax.php:979 lib/Ajax.php:1074 lib/Ajax.php:1077 227 #: lib/Ajax.php:1093 lib/Ajax.php:1096 239 #: lib/Ajax.php:1040 240 msgid "Your changes have not been applied." 241 msgstr "Ваши изменения не были применены." 242 243 #: lib/Ajax.php:1068 lib/Ajax.php:1077 lib/Ajax.php:1125 lib/Ajax.php:1130 244 #: lib/Ajax.php:1225 lib/Ajax.php:1228 lib/Ajax.php:1244 lib/Ajax.php:1247 228 245 msgid "The field is required." 229 246 msgstr "Это поле обязательно для заполнения." 230 247 231 #: lib/Ajax.php:976 lib/Ajax.php:981 248 #: lib/Ajax.php:1071 lib/Ajax.php:1080 lib/Ajax.php:1232 lib/Ajax.php:1251 249 #, php-format 250 msgid "Please specify a value from %s to %s." 251 msgstr "Пожалуйста укажите значение от %s до %s." 252 253 #: lib/Ajax.php:1127 lib/Ajax.php:1132 232 254 msgid "Invalid field length." 233 255 msgstr "Недопустимая длина поля." 234 256 235 #: lib/Ajax.php: 991 lib/Ajax.php:992257 #: lib/Ajax.php:1142 lib/Ajax.php:1143 236 258 msgid "Make sure that you have filled in the field correctly." 237 259 msgstr "Убедитесь, что вы правильно заполнили это поле." 238 260 239 #: lib/Ajax.php:1 014261 #: lib/Ajax.php:1165 240 262 msgid "" 241 263 "Please make sure that no other recaptcha is used on your site. Otherwise, " … … 247 269 "проблемы при входе в админ панель." 248 270 249 #: lib/Ajax.php:1 030271 #: lib/Ajax.php:1181 250 272 msgid "" 251 273 "Please make sure that no other 2FA is used on your site. Otherwise, there " … … 256 278 "который повлечет за собой проблемы при входе в админ панель." 257 279 258 #: lib/Ajax.php:1081 lib/Ajax.php:1100 259 msgid "Please specify a value from 1 to 1000000." 260 msgstr "Пожалуйста укажите значение от 1 до 1000000." 261 262 #: lib/Ajax.php:1327 280 #: lib/Ajax.php:1478 263 281 msgid "You cannot delete the primary domain." 264 282 msgstr "Основной домен не может быть удален." 265 283 266 #: lib/Ajax.php:1617 lib/Ajax.php:1618 src/PageHandler.php:353 267 #: src/PageHandler.php:354 284 #: lib/Ajax.php:1535 285 msgid "You cannot edit this user." 286 msgstr "Вы не можете редактировать этого пользователя." 287 288 #: lib/Ajax.php:1557 289 msgid "You have entered an incorrect activation code." 290 msgstr "Вы ввели неверный код активации." 291 292 #: lib/Ajax.php:1771 lib/Ajax.php:1772 src/PageHandler.php:354 293 #: src/PageHandler.php:355 268 294 msgid "ms." 269 295 msgstr "мс." 270 296 271 #: lib/Ajax.php:1 705297 #: lib/Ajax.php:1859 272 298 #, php-format 273 299 msgid "" … … 278 304 "href=\"%s\" title=\"Забыли пароль\">Забыли пароль</a>?" 279 305 280 #: lib/Ajax.php:1 729306 #: lib/Ajax.php:1883 281 307 #, php-format 282 308 msgid "" … … 1319 1345 msgstr "Зимбабве" 1320 1346 1321 #: lib/Helper.php:156 1347 #: lib/Helper.php:174 lib/modules/logs/EventListener.php:23 1348 #: lib/modules/logs/EventListener.php:37 lib/modules/logs/EventListener.php:270 1349 #: lib/modules/logs/EventListener.php:299 1350 #: lib/modules/logs/EventListener.php:445 1351 #: lib/modules/logs/EventListener.php:546 1352 #: lib/modules/logs/EventListener.php:741 1353 #: lib/modules/logs/EventListener.php:776 1354 #: lib/modules/logs/EventListener.php:880 1322 1355 msgid "Unknown" 1323 1356 msgstr "Неизвестно" 1324 1357 1325 #: lib/Helper.php:2 641358 #: lib/Helper.php:282 1326 1359 msgid "Limit of adding sites exceeded." 1327 1360 msgstr "Превышен лимит добавления сайтов." 1328 1361 1329 #: lib/Helper.php:2 681362 #: lib/Helper.php:286 1330 1363 msgid "A user with this email already exists." 1331 1364 msgstr "Пользователь с таким email уще существует." 1332 1365 1333 #: lib/Helper.php:2 721366 #: lib/Helper.php:290 1334 1367 msgid "Duplicate host" 1335 1368 msgstr "Дублирование домена" 1336 1369 1337 #: lib/Helper.php:2 761370 #: lib/Helper.php:294 1338 1371 msgid "Invalid Domain Name" 1339 1372 msgstr "Неправильный формат домена" 1340 1373 1341 #: lib/Helper.php:3 811374 #: lib/Helper.php:399 1342 1375 msgid "Warning" 1343 1376 msgstr "Внимание" 1344 1377 1345 #: lib/Helper.php: 3821378 #: lib/Helper.php:400 1346 1379 msgid "Error" 1347 1380 msgstr "Ошибка" 1348 1381 1349 #: lib/Helper.php: 3831382 #: lib/Helper.php:401 1350 1383 msgid "Success" 1351 1384 msgstr "Успешно" 1352 1385 1353 #: lib/Helper.php: 3841386 #: lib/Helper.php:402 1354 1387 msgid "Info" 1355 1388 msgstr "Инфо" 1356 1389 1357 #: lib/Helper.php: 3851390 #: lib/Helper.php:403 1358 1391 msgid "Invalid" 1359 1392 msgstr "Недействительный" 1360 1393 1361 #: lib/Helper.php: 3861394 #: lib/Helper.php:404 1362 1395 msgid "Everything is OK" 1363 1396 msgstr "Все Ок" 1364 1397 1365 #: lib/Helper.php: 3871398 #: lib/Helper.php:405 1366 1399 msgid "Expired" 1367 1400 msgstr "Истек" 1368 1401 1369 #: lib/Helper.php: 3881402 #: lib/Helper.php:406 1370 1403 msgid "Expires" 1371 1404 msgstr "Истекает" 1372 1405 1373 #: lib/Helper.php: 3891406 #: lib/Helper.php:407 1374 1407 msgid "Expires today" 1375 1408 msgstr "Истекает сегодня" 1376 1409 1377 #: lib/Helper.php: 3901410 #: lib/Helper.php:408 1378 1411 msgid "Missing" 1379 1412 msgstr "Отсутствует" 1380 1413 1381 #: lib/Helper.php: 3911414 #: lib/Helper.php:409 1382 1415 msgid "Active" 1383 1416 msgstr "Активно" 1384 1417 1385 #: lib/Helper.php: 3921418 #: lib/Helper.php:410 1386 1419 msgid "Inactive" 1387 1420 msgstr "Отключен" 1388 1421 1389 #: lib/Helper.php: 393src/Strings.php:981422 #: lib/Helper.php:411 src/Strings.php:98 1390 1423 msgid "Pending" 1391 1424 msgstr "Проверяется" 1392 1425 1393 #: lib/Helper.php: 3941426 #: lib/Helper.php:412 1394 1427 msgid "Disabled" 1395 1428 msgstr "Отключен" 1396 1429 1397 #: lib/Helper.php: 3951430 #: lib/Helper.php:413 1398 1431 msgid "Available" 1399 1432 msgstr "Доступно" 1400 1433 1401 #: lib/Helper.php: 3961434 #: lib/Helper.php:414 1402 1435 msgid "Not supported" 1403 1436 msgstr "Не поддерживается" 1404 1437 1405 #: lib/Helper.php: 3971438 #: lib/Helper.php:415 1406 1439 msgid "Not registered" 1407 1440 msgstr "Не зарегистрирован" 1408 1441 1409 #: lib/Helper.php: 3981442 #: lib/Helper.php:416 1410 1443 msgid "Unsupported" 1411 1444 msgstr "Не поддерживается" 1412 1445 1413 #: lib/Helper.php: 3991446 #: lib/Helper.php:417 1414 1447 msgid "Clean" 1415 1448 msgstr "Чист" 1416 1449 1417 #: lib/Helper.php:4 001450 #: lib/Helper.php:418 1418 1451 msgid "Clear" 1419 1452 msgstr "Чист" 1420 1453 1421 #: lib/Helper.php:4 01 lib/Helper.php:402 lib/Helper.php:4151454 #: lib/Helper.php:419 lib/Helper.php:420 lib/Helper.php:433 1422 1455 msgid "Infected" 1423 1456 msgstr "Инфицирован" 1424 1457 1425 #: lib/Helper.php:4 03 lib/Helper.php:703src/Strings.php:2201458 #: lib/Helper.php:421 lib/Helper.php:721 src/Strings.php:220 1426 1459 msgid "Deface" 1427 1460 msgstr "Дефейс" 1428 1461 1429 #: lib/Helper.php:4 041462 #: lib/Helper.php:422 1430 1463 msgid "Modified" 1431 1464 msgstr "Модифицирован" 1432 1465 1433 #: lib/Helper.php:4 051466 #: lib/Helper.php:423 1434 1467 msgid "Detected" 1435 1468 msgstr "Обнаружен" 1436 1469 1437 #: lib/Helper.php:4 06src/Strings.php:1501470 #: lib/Helper.php:424 src/Strings.php:150 1438 1471 msgid "Open ports" 1439 1472 msgstr "Открытые порты" 1440 1473 1441 #: lib/Helper.php:4 07 src/Strings.php:95 src/Strings.php:2871474 #: lib/Helper.php:425 src/Strings.php:95 src/Strings.php:301 1442 1475 msgid "Blocked" 1443 1476 msgstr "Заблокирован" 1444 1477 1445 #: lib/Helper.php:4 081478 #: lib/Helper.php:426 1446 1479 msgid "Connected" 1447 1480 msgstr "Соединен" 1448 1481 1449 #: lib/Helper.php:4 091482 #: lib/Helper.php:427 1450 1483 msgid "Attacks detected" 1451 1484 msgstr "Обнаружена атака" 1452 1485 1453 #: lib/Helper.php:4 101486 #: lib/Helper.php:428 1454 1487 msgid "Signature found" 1455 1488 msgstr "Обнаружена сигнатура" 1456 1489 1457 #: lib/Helper.php:4 111490 #: lib/Helper.php:429 1458 1491 msgid "File changes" 1459 1492 msgstr "Изменения в файлах" 1460 1493 1461 #: lib/Helper.php:4 121494 #: lib/Helper.php:430 1462 1495 msgid "No cert" 1463 1496 msgstr "Нет сертификата" 1464 1497 1465 #: lib/Helper.php:4 131498 #: lib/Helper.php:431 1466 1499 msgid "Down" 1467 1500 msgstr "Не работает" 1468 1501 1469 #: lib/Helper.php:4 141502 #: lib/Helper.php:432 1470 1503 msgid "Up" 1471 1504 msgstr "Работает" 1472 1505 1473 #: lib/Helper.php:4 161506 #: lib/Helper.php:434 1474 1507 msgid "Need to install" 1475 1508 msgstr "Не установлен" 1476 1509 1477 #: lib/Helper.php:4 171510 #: lib/Helper.php:435 1478 1511 msgid "Agent not available" 1479 1512 msgstr "Агент недоступен" 1480 1513 1481 #: lib/Helper.php:4 181514 #: lib/Helper.php:436 1482 1515 msgid "Update error" 1483 1516 msgstr "Ошибка обновления" 1484 1517 1485 #: lib/Helper.php:4 191518 #: lib/Helper.php:437 1486 1519 msgid "Session Error" 1487 1520 msgstr "Ошибка сессии" 1488 1521 1489 #: lib/Helper.php:4 201522 #: lib/Helper.php:438 1490 1523 msgid "Internal Error" 1491 1524 msgstr "Внутренняя ошибка" 1492 1525 1493 #: lib/Helper.php:4 21src/Strings.php:341526 #: lib/Helper.php:439 src/Strings.php:34 1494 1527 msgid "Installing" 1495 1528 msgstr "Идет установка" 1496 1529 1497 #: lib/Helper.php:4 22src/Strings.php:331530 #: lib/Helper.php:440 src/Strings.php:33 1498 1531 msgid "Installed" 1499 1532 msgstr "Установлен" 1500 1533 1501 #: lib/Helper.php:4 231534 #: lib/Helper.php:441 1502 1535 msgid "Working" 1503 1536 msgstr "В работе" 1504 1537 1505 #: lib/Helper.php:4 241538 #: lib/Helper.php:442 1506 1539 msgid "Critical" 1507 1540 msgstr "Критический" 1508 1541 1509 #: lib/Helper.php:4 251542 #: lib/Helper.php:443 1510 1543 msgid "Deleted" 1511 1544 msgstr "Удален" 1512 1545 1513 #: lib/Helper.php:4 261546 #: lib/Helper.php:444 1514 1547 msgid "Changed" 1515 1548 msgstr "Изменен" 1516 1549 1517 #: lib/Helper.php:4 271550 #: lib/Helper.php:445 1518 1551 msgid "New" 1519 1552 msgstr "Новый" 1520 1553 1521 #: lib/Helper.php:4 281554 #: lib/Helper.php:446 1522 1555 msgid "Scanned" 1523 1556 msgstr "Сканирован" 1524 1557 1525 #: lib/Helper.php:4 291558 #: lib/Helper.php:447 1526 1559 msgid "In quarantine" 1527 1560 msgstr "В карантине" 1528 1561 1529 #: lib/Helper.php:4 461562 #: lib/Helper.php:464 1530 1563 msgid "" 1531 1564 "Invalid -The certificate is invalid. Please, make sure that relevant " … … 1535 1568 "соответствующие данные сертификата заполнены правильно." 1536 1569 1537 #: lib/Helper.php:4 471570 #: lib/Helper.php:465 1538 1571 msgid "" 1539 1572 "Expired - The certificate has expired. Connection is not secure. Please, " … … 1543 1576 "Пожалуйста, продлите его." 1544 1577 1545 #: lib/Helper.php:4 481578 #: lib/Helper.php:466 1546 1579 msgid "Expires - The certificate expires soon. Please, take actions." 1547 1580 msgstr "" … … 1549 1582 "Пожалуйста, примите меры." 1550 1583 1551 #: lib/Helper.php:4 491584 #: lib/Helper.php:467 1552 1585 msgid "Expires today - The certificate expires today. Please, take actions." 1553 1586 msgstr "" … … 1555 1588 "Пожалуйста, примите меры." 1556 1589 1557 #: lib/Helper.php:4 501590 #: lib/Helper.php:468 1558 1591 msgid "" 1559 1592 "Error - Something went wrong. Please, contact us, we'll fix the problem." … … 1562 1595 "проблему." 1563 1596 1564 #: lib/Helper.php:4 511597 #: lib/Helper.php:469 1565 1598 msgid "Pending - System processes your website. Data will be available soon." 1566 1599 msgstr "" … … 1568 1601 "ближайшее время." 1569 1602 1570 #: lib/Helper.php:4 521603 #: lib/Helper.php:470 1571 1604 msgid "Pause - The module is paused." 1572 1605 msgstr "Пауза - Модуль находится в режиме паузы." 1573 1606 1574 #: lib/Helper.php:4 531607 #: lib/Helper.php:471 1575 1608 msgid "Everything is OK - Nothing to worry about. Everything is alright." 1576 1609 msgstr "Все ОК - Не о чем беспокоиться. Все в порядке." 1577 1610 1578 #: lib/Helper.php:4 541611 #: lib/Helper.php:472 1579 1612 msgid "Deface - Website hacked. Please, contact us, we'll fix the problem." 1580 1613 msgstr "" 1581 1614 "Дефейс - Сайт взломан. Пожалуйста, свяжитесь с нами, мы решим эту проблему." 1582 1615 1583 #: lib/Helper.php:4 551616 #: lib/Helper.php:473 1584 1617 msgid "" 1585 1618 "Open ports - Open ports detected. Your website is vulnerable to attacks." … … 1588 1621 "атак." 1589 1622 1590 #: lib/Helper.php:4 561623 #: lib/Helper.php:474 1591 1624 msgid "Blocked - The module is blocked due to billing issues." 1592 1625 msgstr "" 1593 1626 "Заблокирован - Модуль заблокирован из-за проблем с выставлением счетов." 1594 1627 1595 #: lib/Helper.php:4 571628 #: lib/Helper.php:475 1596 1629 msgid "" 1597 1630 "No cert - You don't have SSL certificate. We recommend you to install it for " … … 1601 1634 "его по соображениям безопасности." 1602 1635 1603 #: lib/Helper.php:4 581636 #: lib/Helper.php:476 1604 1637 msgid "Down - The website is not available for visitors." 1605 1638 msgstr "Не работает - Сайт недоступен для посетителей." 1606 1639 1607 #: lib/Helper.php:4 591640 #: lib/Helper.php:477 1608 1641 msgid "Up - The website is available for visitors." 1609 1642 msgstr "Работает - Сайт доступен для посетителей." 1610 1643 1611 #: lib/Helper.php:4 601644 #: lib/Helper.php:478 1612 1645 msgid "" 1613 1646 "Infected - The website site is blacklisted and may have infected files. " … … 1617 1650 "файлы. Пожалуйста, проверьте антивирусный модуль." 1618 1651 1619 #: lib/Helper.php:4 611652 #: lib/Helper.php:479 1620 1653 msgid "" 1621 1654 "It means that the agent installation is in progress. Usually, it takes up to " … … 1625 1658 "одного часа." 1626 1659 1627 #: lib/Helper.php:4 621660 #: lib/Helper.php:480 1628 1661 msgid "We cannot locate the agent right now." 1629 1662 msgstr "Мы в данный момент не можем подключиться к агенту." 1630 1663 1631 #: lib/Helper.php:4 631664 #: lib/Helper.php:481 1632 1665 msgid "" 1633 1666 "It seems that your agent failed to update due to permissions restrictions." … … 1636 1669 "разрешений." 1637 1670 1638 #: lib/Helper.php:4 641671 #: lib/Helper.php:482 1639 1672 msgid "" 1640 1673 "This means that the agent did not create a secure session. Possible causes " … … 1646 1679 "производителей. Обратитесь в службу поддержки." 1647 1680 1648 #: lib/Helper.php:4 651681 #: lib/Helper.php:483 1649 1682 msgid "" 1650 1683 "It means that the server is overloaded or there might be some problems with " … … 1658 1691 "поддержкой." 1659 1692 1660 #: lib/Helper.php:4 66 lib/Helper.php:4671693 #: lib/Helper.php:484 lib/Helper.php:485 1661 1694 msgid "Everything is alright." 1662 1695 msgstr "Все в порядке." 1663 1696 1664 #: lib/Helper.php:4 681697 #: lib/Helper.php:486 1665 1698 msgid "You need to install agent manager to activate antivirus and firewall." 1666 1699 msgstr "" … … 1668 1701 "брандмауэр." 1669 1702 1670 #: lib/Helper.php: 699src/Strings.php:1781703 #: lib/Helper.php:717 src/Strings.php:178 1671 1704 msgid "Availability" 1672 1705 msgstr "Доступность" 1673 1706 1674 #: lib/Helper.php:7 00src/Strings.php:2211707 #: lib/Helper.php:718 src/Strings.php:221 1675 1708 msgid "Reputation" 1676 1709 msgstr "Репутация" 1677 1710 1678 #: lib/Helper.php:7 02src/Strings.php:2221711 #: lib/Helper.php:720 src/Strings.php:222 1679 1712 msgid "Technologies" 1680 1713 msgstr "Технологии" 1681 1714 1682 #: lib/Helper.php:7 04src/Strings.php:1791715 #: lib/Helper.php:722 src/Strings.php:179 1683 1716 msgid "Ports" 1684 1717 msgstr "Порты" 1685 1718 1686 #: lib/Helper.php:7 05 src/Common.php:84src/Strings.php:1201719 #: lib/Helper.php:723 src/Common.php:89 src/Strings.php:120 1687 1720 msgid "Firewall" 1688 1721 msgstr "Файрвол" 1689 1722 1690 #: lib/Helper.php:7 06 src/Common.php:86 src/PageHandler.php:3141691 #: src/PageHandler.php:60 5src/Strings.php:1211723 #: lib/Helper.php:724 src/Common.php:91 src/PageHandler.php:315 1724 #: src/PageHandler.php:606 src/Strings.php:121 1692 1725 msgid "Antivirus" 1693 1726 msgstr "Антивирус" 1694 1727 1695 #: lib/Helper.php:7 071728 #: lib/Helper.php:725 1696 1729 msgid "Domain" 1697 1730 msgstr "Домен" 1698 1731 1699 #: lib/Helper.php:7 231732 #: lib/Helper.php:741 1700 1733 msgid "Availability log" 1701 1734 msgstr "Журнал доступности" 1702 1735 1703 #: lib/Helper.php:7 241736 #: lib/Helper.php:742 1704 1737 msgid "Deface log" 1705 1738 msgstr "Журнал дефейсов" 1706 1739 1707 #: lib/Helper.php:7 251740 #: lib/Helper.php:743 1708 1741 msgid "Port log" 1709 1742 msgstr "Журнал портов" 1710 1743 1711 #: lib/Helper.php:7 261744 #: lib/Helper.php:744 1712 1745 msgid "Reputation log" 1713 1746 msgstr "Журнал репутации" 1714 1747 1715 #: lib/Helper.php:7 271748 #: lib/Helper.php:745 1716 1749 msgid "Evaluation log" 1717 1750 msgstr "Журнал оценки" 1718 1751 1719 #: lib/Helper.php:7 281752 #: lib/Helper.php:746 1720 1753 msgid "Antivirus log" 1721 1754 msgstr "Журнал антивируса" 1722 1755 1723 #: lib/Helper.php:7 291756 #: lib/Helper.php:747 1724 1757 msgid "Firewall log" 1725 1758 msgstr "Журнал файрвола" 1726 1759 1727 #: lib/Helper.php:7 451760 #: lib/Helper.php:763 1728 1761 msgid "All modules" 1729 1762 msgstr "Все модули" 1730 1763 1731 #: lib/Helper.php:7 701764 #: lib/Helper.php:788 1732 1765 msgid "Don't worry, your reputation is good" 1733 1766 msgstr "Не волнуйтесь, у вас хорошая репутация" 1734 1767 1735 #: lib/Helper.php:7 741768 #: lib/Helper.php:792 1736 1769 msgid "Oh, your reputation is bad" 1737 1770 msgstr "Упс, у вашего сайта плохая репутация" 1738 1771 1739 #: lib/Helper.php:7 781772 #: lib/Helper.php:796 1740 1773 msgid "Information is being updated" 1741 1774 msgstr "Информация обновляется" 1742 1775 1743 #: lib/Helper.php: 8981776 #: lib/Helper.php:916 1744 1777 msgid "Blocked IP" 1745 1778 msgstr "Заблокирован IP" 1746 1779 1747 #: lib/Helper.php: 8981780 #: lib/Helper.php:916 1748 1781 msgid "Not blocked" 1749 1782 msgstr "Не заблокирован" 1783 1784 #: lib/Helper.php:1408 1785 msgid "Error:" 1786 msgstr "Ошибка:" 1787 1788 #: lib/Helper.php:1408 1789 msgid "Info:" 1790 msgstr "Инфо:" 1750 1791 1751 1792 #: lib/Interface.php:132 … … 1777 1818 msgstr "Нет шаблона: " 1778 1819 1779 #: lib/ login/BFProtection.php:361820 #: lib/modules/login/BFProtection.php:36 1780 1821 #, php-format 1781 1822 msgid "Exceeded the maximum number of login failures which is: %1$s." … … 1784 1825 "составляет:%1$s." 1785 1826 1786 #: lib/ login/BFProtection.php:631827 #: lib/modules/login/BFProtection.php:61 1787 1828 #, php-format 1788 1829 msgid "" … … 1793 1834 "<a href=\"%2$s\" title=\"Восстановить пароль\">Потеряли свой пароль</a>?" 1794 1835 1795 #: lib/ login/BFProtection.php:761836 #: lib/modules/login/BFProtection.php:74 1796 1837 #, php-format 1797 1838 msgid "" … … 1802 1843 "установлено на:%1$s" 1803 1844 1804 #: lib/ login/Login.php:1621845 #: lib/modules/login/Login.php:162 1805 1846 #, php-format 1806 1847 msgid "Two-Factor Authentication Recovery Codes. %s (%s)" 1807 1848 msgstr "Коды Восстановления Двухфакторной Аутентификации. %s (%s)" 1808 1849 1809 #: lib/ login/Login.php:1631850 #: lib/modules/login/Login.php:163 1810 1851 msgid "" 1811 1852 "Each line is a single recovery code, with optional spaces for readability. " … … 1816 1857 "следующие:" 1817 1858 1818 #: src/Common.php:79 1859 #: lib/modules/logs/EventListener.php:24 1860 #, php-format 1861 msgid "User authentication succeeded: %s" 1862 msgstr "Аутентификация пользователя прошла успешно: %s" 1863 1864 #: lib/modules/logs/EventListener.php:38 1865 #, php-format 1866 msgid "User authentication failed: %s" 1867 msgstr "Ошибка аутентификации пользователя: %s" 1868 1869 #: lib/modules/logs/EventListener.php:52 lib/modules/logs/EventListener.php:53 1870 #: lib/modules/logs/EventListener.php:167 1871 #: lib/modules/logs/EventListener.php:193 1872 #: lib/modules/logs/EventListener.php:219 1873 #: lib/modules/logs/EventListener.php:245 1874 msgid "unknown" 1875 msgstr "неизвестно" 1876 1877 #: lib/modules/logs/EventListener.php:63 src/Strings.php:326 1878 msgid "User account created" 1879 msgstr "Создан аккаунт пользователя" 1880 1881 #: lib/modules/logs/EventListener.php:64 1882 #, php-format 1883 msgid "ID: %s; name: %s; email: %s; roles: %s" 1884 msgstr "ID: %s; имя: %s; email: %s; роли: %s" 1885 1886 #: lib/modules/logs/EventListener.php:86 1887 #, fuzzy, php-format 1888 #| msgid "User account deleted; ID: %d" 1889 msgid "User account deleted; ID: %d, name: %s" 1890 msgstr "Аккаунт пользователя удален; ID: %d" 1891 1892 #: lib/modules/logs/EventListener.php:104 src/Strings.php:328 1893 msgid "User account edited" 1894 msgstr "Внесены изменения в аккаунт пользователя" 1895 1896 #: lib/modules/logs/EventListener.php:106 1897 #, fuzzy 1898 #| msgid "User account edited" 1899 msgid "User account: " 1900 msgstr "Внесены изменения в аккаунт пользователя" 1901 1902 #: lib/modules/logs/EventListener.php:115 1903 msgid "has been changed" 1904 msgstr "был изменен" 1905 1906 #: lib/modules/logs/EventListener.php:138 1907 #, php-format 1908 msgid "Attempt to reset password: %s" 1909 msgstr "Попытка сбросить пароль: %s" 1910 1911 #: lib/modules/logs/EventListener.php:152 1912 #, php-format 1913 msgid "Password retrieval attempt: %s" 1914 msgstr "Попытка восстановления пароля: %s" 1915 1916 #: lib/modules/logs/EventListener.php:175 src/Strings.php:331 1917 msgid "User added to website" 1918 msgstr "Пользователь добавлен на веб-сайт" 1919 1920 #: lib/modules/logs/EventListener.php:176 1921 #: lib/modules/logs/EventListener.php:202 1922 #, php-format 1923 msgid "blog: %s; name: %s;" 1924 msgstr "блог: %s; имя: %s;" 1925 1926 #: lib/modules/logs/EventListener.php:201 src/Strings.php:332 1927 msgid "User removed from website" 1928 msgstr "Пользователь удален с веб-сайта" 1929 1930 #: lib/modules/logs/EventListener.php:231 1931 #, php-format 1932 msgid "Bookmark link added; ID: %s; name: %s; url: %s; target: %s" 1933 msgstr "Добавлена ссылка; ID: %s; имя: %s; url: %s; target: %s" 1934 1935 #: lib/modules/logs/EventListener.php:256 1936 #, php-format 1937 msgid "Bookmark link edited; ID: %s; name: %s; url: %s; target: %s" 1938 msgstr "Изменена ссылка; ID: %s; имя: %s; url: %s; target: %s" 1939 1940 #: lib/modules/logs/EventListener.php:273 1941 #, php-format 1942 msgid "Category created; ID: %s; name: %s" 1943 msgstr "Категория создана; ID: %s; имя: %s" 1944 1945 #: lib/modules/logs/EventListener.php:300 1946 msgid "Publication" 1947 msgstr "Публикация" 1948 1949 #: lib/modules/logs/EventListener.php:301 1950 #: lib/modules/logs/EventListener.php:314 1951 msgid "published" 1952 msgstr "опубликован" 1953 1954 #: lib/modules/logs/EventListener.php:309 1955 msgid "updated" 1956 msgstr "обновлен" 1957 1958 #: lib/modules/logs/EventListener.php:321 1959 #, php-format 1960 msgid "%s was %s; ID: %s; name: %s" 1961 msgstr "%s был %s; ID: %s; имя: %s" 1962 1963 #: lib/modules/logs/EventListener.php:359 1964 #, php-format 1965 msgid "ID: %s" 1966 msgstr "ID: %s" 1967 1968 #: lib/modules/logs/EventListener.php:360 1969 #, php-format 1970 msgid "Old status: %s" 1971 msgstr "Старый статус: %s" 1972 1973 #: lib/modules/logs/EventListener.php:361 1974 #, php-format 1975 msgid "New status: %s" 1976 msgstr "Новый статус: %s" 1977 1978 #: lib/modules/logs/EventListener.php:364 1979 #, php-format 1980 msgid "Title: %s" 1981 msgstr "Название: %s" 1982 1983 #: lib/modules/logs/EventListener.php:368 1984 #, php-format 1985 msgid "%s status has been changed" 1986 msgstr "%s статус был изменен" 1987 1988 #: lib/modules/logs/EventListener.php:405 src/Strings.php:341 1989 msgid "Post deleted" 1990 msgstr "Пост удален" 1991 1992 #: lib/modules/logs/EventListener.php:455 1993 #, php-format 1994 msgid "Post moved to trash; ID: %s; name: %s; status: %s" 1995 msgstr "Пост перемещен в корзину; ID: %s; имя: %s; статус: %s" 1996 1997 #: lib/modules/logs/EventListener.php:492 1998 #, php-format 1999 msgid "Media file added; ID: %s; name: %s; type: %s" 2000 msgstr "Добавлен медиафайл; ID: %s; имя: %s; тип: %s" 2001 2002 #: lib/modules/logs/EventListener.php:508 2003 msgid "activated" 2004 msgstr "активирован" 2005 2006 #: lib/modules/logs/EventListener.php:522 2007 msgid "deactivated" 2008 msgstr "деактивирован" 2009 2010 #: lib/modules/logs/EventListener.php:558 2011 #, php-format 2012 msgid "Plugin %s" 2013 msgstr "Плагин %s" 2014 2015 #: lib/modules/logs/EventListener.php:582 2016 #, php-format 2017 msgid "Theme activated: %s" 2018 msgstr "Тема активирована: %s" 2019 2020 #: lib/modules/logs/EventListener.php:598 2021 #, php-format 2022 msgid "WordPress updated to version: %s" 2023 msgstr "WordPress обновлен до версии: %s" 2024 2025 #: lib/modules/logs/EventListener.php:620 2026 #, php-format 2027 msgid "" 2028 "The value of the option <b>%s</b> was changed from <b>'%s'</b> to <b>'%s'</" 2029 "b>.<br>\n" 2030 msgstr "" 2031 "Значение параметра <b>%s</b> было изменено с <b>'%s'</b> на <b>'%s'</b>." 2032 "<br>\n" 2033 2034 #: lib/modules/logs/EventListener.php:629 2035 msgid "Common" 2036 msgstr "Общие" 2037 2038 #: lib/modules/logs/EventListener.php:633 2039 msgid "Global" 2040 msgstr "Глобальные" 2041 2042 #: lib/modules/logs/EventListener.php:647 2043 #, php-format 2044 msgid "%s settings changed" 2045 msgstr "%s настройки изменены" 2046 2047 #: lib/modules/logs/EventListener.php:649 src/Strings.php:347 2048 msgid "Settings changed" 2049 msgstr "Настройки изменены" 2050 2051 #: lib/modules/logs/EventListener.php:694 2052 msgid "Themes updated: (multiple entries): " 2053 msgstr "Темы обновлены: (несколько записей):" 2054 2055 #: lib/modules/logs/EventListener.php:696 2056 msgid "Theme updated:" 2057 msgstr "Тема обновлена:" 2058 2059 #: lib/modules/logs/EventListener.php:723 2060 #, php-format 2061 msgid "Theme editor used in: %s/%s" 2062 msgstr "Был использован редактор тем в: %s/%s" 2063 2064 #: lib/modules/logs/EventListener.php:744 2065 #, php-format 2066 msgid "Theme installed: %s" 2067 msgstr "Тема установлена: %s" 2068 2069 #: lib/modules/logs/EventListener.php:779 2070 #, php-format 2071 msgid "Theme deleted: %s" 2072 msgstr "Тема удалена: %s" 2073 2074 #: lib/modules/logs/EventListener.php:827 2075 msgid "Plugins deleted: (multiple entries):" 2076 msgstr "Удаленные плагины: (несколько записей):" 2077 2078 #: lib/modules/logs/EventListener.php:829 2079 msgid "Plugin deleted:" 2080 msgstr "Плагин удален:" 2081 2082 #: lib/modules/logs/EventListener.php:856 2083 #, php-format 2084 msgid "Plugin editor used in: %s" 2085 msgstr "Был использован редактор плагинов в: %s" 2086 2087 #: lib/modules/logs/EventListener.php:882 2088 #, php-format 2089 msgid "Plugin installed: %s" 2090 msgstr "Установлен плагин: %s" 2091 2092 #: lib/modules/logs/EventListener.php:935 2093 msgid "Plugins updated: (multiple entries):" 2094 msgstr "Плагины обновлены: (несколько записей):" 2095 2096 #: lib/modules/logs/EventListener.php:937 2097 msgid "Plugin updated:" 2098 msgstr "Обновлен плагин:" 2099 2100 #: lib/modules/logs/EventListener.php:979 2101 msgid "deleted" 2102 msgstr "удален" 2103 2104 #: lib/modules/logs/EventListener.php:984 2105 msgid "added" 2106 msgstr "добавлен" 2107 2108 #: lib/modules/logs/EventListener.php:991 2109 #, php-format 2110 msgid "Widget %s " 2111 msgstr "Виджет %s" 2112 2113 #: lib/modules/logs/EventListener.php:994 2114 #, php-format 2115 msgid "%s (%s) %s %s (#%d; size %dx%d)" 2116 msgstr "%s (%s) %s %s (#%d; размер %dx%d)" 2117 2118 #: src/Common.php:84 1819 2119 msgid "All sites" 1820 2120 msgstr "Все сайты" 1821 2121 1822 #: src/Common.php:8 3src/Strings.php:1192122 #: src/Common.php:88 src/Strings.php:119 1823 2123 msgid "Dashboard" 1824 2124 msgstr "Главная" 1825 2125 1826 #: src/Common.php: 87src/Strings.php:1222126 #: src/Common.php:92 src/Strings.php:122 1827 2127 msgid "Settings" 1828 2128 msgstr "Настройки" 1829 2129 1830 #: src/Common.php: 89src/Strings.php:1232130 #: src/Common.php:94 src/Strings.php:123 1831 2131 msgid "Reports" 1832 2132 msgstr "Отчеты" 1833 2133 1834 #: src/Common.php:9 0src/Strings.php:1132134 #: src/Common.php:95 src/Strings.php:113 1835 2135 msgid "Documentation" 1836 2136 msgstr "Документация" 1837 2137 1838 #: src/Common.php:106 src/Common.php:107 2138 #: src/Common.php:96 2139 msgid "WP scan" 2140 msgstr "WP scan" 2141 2142 #: src/Common.php:112 src/Common.php:113 1839 2143 msgid "WebTotem" 1840 2144 msgstr "WebTotem" 1841 2145 1842 #: src/Common.php:13 0 src/Common.php:1312146 #: src/Common.php:136 src/Common.php:137 1843 2147 msgid "Activation" 1844 2148 msgstr "Активация" 1845 2149 1846 #: src/PageHandler.php:24 3 src/PageHandler.php:476 src/PageHandler.php:4962150 #: src/PageHandler.php:244 src/PageHandler.php:477 src/PageHandler.php:497 1847 2151 msgid "Firewall activity" 1848 2152 msgstr "Файрвол активность" 1849 2153 1850 #: src/PageHandler.php:28 3 src/PageHandler.php:2852154 #: src/PageHandler.php:284 src/PageHandler.php:286 1851 2155 msgid "Server resources" 1852 2156 msgstr "Ресурсы сервера" 1853 2157 1854 #: src/PageHandler.php:28 62158 #: src/PageHandler.php:287 1855 2159 msgid "" 1856 2160 "Displays critical data about web-server usage. A large load on a server can " … … 1860 2164 "на сервер может замедлить работу сайта." 1861 2165 1862 #: src/PageHandler.php:33 62166 #: src/PageHandler.php:337 1863 2167 msgid "Monitoring" 1864 2168 msgstr "Мониторинг" 1865 2169 1866 #: src/PageHandler.php:3 792170 #: src/PageHandler.php:380 1867 2171 msgid "Scanning" 1868 2172 msgstr "Сканирование" 1869 2173 1870 #: src/PageHandler.php:55 2 src/PageHandler.php:6712174 #: src/PageHandler.php:553 src/PageHandler.php:672 1871 2175 msgid "Sorry, you are not allowed to view this page." 1872 2176 msgstr "Извините, вам не разрешен просмотр этой страницы." … … 1980 2284 msgstr "Показывает настройки разрешений или прав доступа." 1981 2285 1982 #: src/Strings.php:55 2286 #: src/Strings.php:55 src/Strings.php:320 1983 2287 msgid "Time" 1984 2288 msgstr "Время" … … 2087 2391 msgid "Low risk" 2088 2392 msgstr "Низкий риск" 2089 2090 #: src/Strings.php:972091 msgid "Attack from"2092 msgstr "Атаки из"2093 2393 2094 2394 #: src/Strings.php:99 … … 2699 2999 2700 3000 #: src/Strings.php:282 3001 msgid "save" 3002 msgstr "сохранить" 3003 3004 #: src/Strings.php:283 3005 msgid "close" 3006 msgstr "закрыть" 3007 3008 #: src/Strings.php:284 3009 msgid "Block countries" 3010 msgstr "Заблокировать страны" 3011 3012 #: src/Strings.php:285 3013 msgid "Name of the country" 3014 msgstr "Название страны" 3015 3016 #: src/Strings.php:286 3017 msgid "Select all countries" 3018 msgstr "Выбрать все страны" 3019 3020 #: src/Strings.php:287 3021 msgid "Access blocked to" 3022 msgstr "Доступ заблокирован в" 3023 3024 #: src/Strings.php:288 3025 msgid "countries" 3026 msgstr "странах" 3027 3028 #: src/Strings.php:289 3029 msgid "Country blocking" 3030 msgstr "Блокировка стран" 3031 3032 #: src/Strings.php:290 3033 msgid "Block countries you want to limit access to your website." 3034 msgstr "" 3035 "Заблокируйте страны, в которых вы хотите ограничить доступ к своему веб-" 3036 "сайту." 3037 3038 #: src/Strings.php:296 2701 3039 msgid "WebTotem two-factor protection" 2702 3040 msgstr "WebTotem двухфакторная защита" 2703 3041 2704 #: src/Strings.php:2 833042 #: src/Strings.php:297 2705 3043 msgid "Edit 2FA Settings" 2706 3044 msgstr "Редактировать настройки" 2707 3045 2708 #: src/Strings.php:2 843046 #: src/Strings.php:298 2709 3047 msgid "Disactivate 2FA" 2710 3048 msgstr "Деактивировать" 2711 3049 2712 #: src/Strings.php: 2903050 #: src/Strings.php:304 2713 3051 msgid "Services status" 2714 3052 msgstr "Статус сервисов" 2715 3053 2716 #: src/Strings.php: 2913054 #: src/Strings.php:305 2717 3055 msgid "Site name" 2718 3056 msgstr "Название сайта" 2719 3057 2720 #: src/Strings.php: 2923058 #: src/Strings.php:306 2721 3059 msgid "Report page" 2722 3060 msgstr "Страница отчета" 2723 3061 2724 #: src/Strings.php: 2933062 #: src/Strings.php:307 2725 3063 msgid "All stats" 2726 3064 msgstr "Статистика" 2727 3065 2728 #: src/Strings.php: 2973066 #: src/Strings.php:310 2729 3067 msgid "Try reinstalling the agents or changing the API key" 2730 3068 msgstr "Попробуйте переустановить агенты или заменить API ключ " 2731 3069 2732 #: src/Strings.php: 2983070 #: src/Strings.php:311 2733 3071 msgid "Data access error" 2734 3072 msgstr "Ошибка доступа к данным" 2735 3073 3074 #: src/Strings.php:314 3075 msgid "Logs" 3076 msgstr "Логи" 3077 3078 #: src/Strings.php:315 3079 msgid "" 3080 "Log of user actions. And logs on found links, scripts and iframes in " 3081 "published posts and in files of active plugins and the current theme of the " 3082 "site." 3083 msgstr "" 3084 "Журнал действий пользователей. И записи по найденным ссылкам, скриптам и " 3085 "iframe в опубликованных постах и в файлах активных плагинов и текущей темы " 3086 "сайта." 3087 3088 #: src/Strings.php:316 3089 msgid "Audit Logs" 3090 msgstr "Журнал событий" 3091 3092 #: src/Strings.php:317 3093 msgid "Links" 3094 msgstr "Ссылки" 3095 3096 #: src/Strings.php:318 3097 msgid "Scripts" 3098 msgstr "Скрипты" 3099 3100 #: src/Strings.php:319 3101 msgid "iFrames" 3102 msgstr "Фреймы" 3103 3104 #: src/Strings.php:321 3105 msgid "User" 3106 msgstr "Пользователь" 3107 3108 #: src/Strings.php:322 3109 msgid "Event" 3110 msgstr "Событие" 3111 3112 #: src/Strings.php:323 3113 msgid "All" 3114 msgstr "Все" 3115 3116 #: src/Strings.php:324 3117 msgid "User authentication succeeded" 3118 msgstr "Аутентификация пользователя прошла успешно" 3119 3120 #: src/Strings.php:325 3121 msgid "User authentication failed" 3122 msgstr "Ошибка аутентификации пользователя" 3123 3124 #: src/Strings.php:327 src/Strings.php:334 3125 msgid "User account deleted" 3126 msgstr "Aккаунт пользователя удален" 3127 3128 #: src/Strings.php:329 3129 msgid "Attempt to reset password" 3130 msgstr "Попытка сбросить пароль" 3131 3132 #: src/Strings.php:330 3133 msgid "Password retrieval attempt" 3134 msgstr "Попытка восстановления пароля" 3135 3136 #: src/Strings.php:333 3137 msgid "WordPress updated" 3138 msgstr "WordPress обновлен" 3139 3140 #: src/Strings.php:335 3141 msgid "Bookmark link added" 3142 msgstr "Добавлена ссылка" 3143 3144 #: src/Strings.php:336 3145 msgid "Bookmark link edited" 3146 msgstr "Ссылка изменена" 3147 3148 #: src/Strings.php:337 3149 msgid "Category created" 3150 msgstr "Категория создана" 3151 3152 #: src/Strings.php:338 3153 msgid "Publication was published" 3154 msgstr "Запись была опубликована" 3155 3156 #: src/Strings.php:339 3157 msgid "Publication was updated" 3158 msgstr "Запись обновлена" 3159 3160 #: src/Strings.php:340 3161 msgid "Post status has been changed" 3162 msgstr "Статус записи был изменен" 3163 3164 #: src/Strings.php:342 3165 msgid "Post moved to trash" 3166 msgstr "Запись перемещена в корзину" 3167 3168 #: src/Strings.php:343 3169 msgid "Media file added" 3170 msgstr "Добавлен медиафайл" 3171 3172 #: src/Strings.php:344 3173 msgid "Plugin activated" 3174 msgstr "Плагин активирован" 3175 3176 #: src/Strings.php:345 3177 msgid "Plugin deactivated" 3178 msgstr "Плагин деактивирован" 3179 3180 #: src/Strings.php:346 3181 msgid "Theme activated" 3182 msgstr "Тема активирована" 3183 3184 #: src/Strings.php:348 3185 msgid "Plugins deleted" 3186 msgstr "Плагин удален" 3187 3188 #: src/Strings.php:349 3189 msgid "Plugin editor used" 3190 msgstr "Был использован редактор плагинов" 3191 3192 #: src/Strings.php:350 3193 msgid "Plugin installed" 3194 msgstr "Установлен плагин" 3195 3196 #: src/Strings.php:351 3197 msgid "Plugins updated" 3198 msgstr "Плагин обновлен" 3199 3200 #: src/Strings.php:352 3201 msgid "Theme deleted" 3202 msgstr "Тема удалена" 3203 3204 #: src/Strings.php:353 3205 msgid "Theme editor used" 3206 msgstr "Был использован редактор тем" 3207 3208 #: src/Strings.php:354 3209 msgid "Theme installed" 3210 msgstr "Тема установлена" 3211 3212 #: src/Strings.php:355 3213 msgid "Themes updated" 3214 msgstr "Тема обновлена" 3215 3216 #: src/Strings.php:356 3217 msgid "Widget deleted" 3218 msgstr "Виджет удален" 3219 3220 #: src/Strings.php:357 3221 msgid "Widget added" 3222 msgstr "Виджет добавлен" 3223 3224 #, php-format 3225 #~ msgid "Post deleted: (multiple entries): %s" 3226 #~ msgstr "Пост удален: (несколько записей): %s" 3227 2736 3228 #~ msgid "Two-Factor Deactivate" 2737 3229 #~ msgstr "Деактивация Двухфакторная " … … 2764 3256 #~ msgstr "Атаки" 2765 3257 2766 #~ msgid "Attacks blocked"2767 #~ msgstr "Заблокировано атак"2768 2769 3258 #~ msgid "The reinstall process failed." 2770 3259 #~ msgstr "Процесс переустановки завершен неудачей." … … 2802 3291 #~ msgid "Go back" 2803 3292 #~ msgstr "Назад" 2804 2805 #~ msgid "close"2806 #~ msgstr "закрыть"2807 3293 2808 3294 #~ msgid "Information" -
wt-security/trunk/lib/API.php
r2797028 r2837032 336 336 $period = WebTotem::getPeriod($days); 337 337 338 $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 . '"}}';338 $payload = '{"query":"query($id: ID!, $dateRange: DateRangeInput!, $language: Language!, $dateRangeWeek: DateRangeInput!, $wafLogFilter: WafLogFilter!) { auth { viewer { sites { one(id: $id) { ports { status ip tcp lastTest { time } ignorePorts country } availability { status lastTest { time } responseTime downTime(dateRange: $dateRange) percent(dateRange: $dateRange) } deface { status lastTest { time } words count } domain { status registrar owner email createdDate expiredDate } 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 . '"}}'; 339 339 $response = self::sendRequest($payload, TRUE); 340 340 … … 431 431 $period = WebTotem::getPeriod($params['days']); 432 432 433 $payload = '{"operationName":null,"variables":{"id":"' . $params['host_id'] . '","avLogFilter":{' . $permissions . '"event":' . $event . ', "dateRange":{"to":' . $period['to'] . ',"from":' . $period['from'] . '},"order":{"direction":"DESC","field":"time"},"pagination":{"first":' . $params['limit'] . ',"cursor":' . $cursor . '}}},"query":"query ($id: ID!, $avLogFilter: AvLogFilter!) { auth { viewer { sites { one(id: $id) { id ... on Site { configs { ... on AvConfig { isActive id } } } antivirus { quarantine{ id path date } status log(avLogFilter: $avLogFilter) { edges { node { filePath event signatures time permissions permissionsChanged } } pageInfo { endCursor hasNextPage __typename} } lastTest { time } stats { changed deleted scanned infected } } } } } } }"}';433 $payload = '{"operationName":null,"variables":{"id":"' . $params['host_id'] . '","avLogFilter":{' . $permissions . '"event":' . $event . ', "dateRange":{"to":' . $period['to'] . ',"from":' . $period['from'] . '},"order":{"direction":"DESC","field":"time"},"pagination":{"first":' . $params['limit'] . ',"cursor":' . $cursor . '}}},"query":"query ($id: ID!, $avLogFilter: AvLogFilter!) { auth { viewer { sites { one(id: $id) { id ... on Site { configs { ... on AvConfig { isActive id } } } antivirus { quarantine{ id path date } status log(avLogFilter: $avLogFilter) { edges { node { filePath event signatures time permissions permissionsChanged } } pageInfo { endCursor hasNextPage } } lastTest { time } stats { changed deleted scanned infected } } } } } } }"}'; 434 434 $response = self::sendRequest($payload, TRUE); 435 435 … … 883 883 } 884 884 885 /** 886 * Method to get blocked countries list. 887 * 888 * @param string $host_id 889 * Host id on WebTotem. 890 * 891 * @return array 892 * Returns blocked countries list. 893 */ 894 public static function getBlockedCountries($host_id) { 895 $period = WebTotem::getPeriod(7); 896 $payload = '{"variables":{"dateRange":{"to":' . $period['to'] . ',"from":' . $period['from'] . '}} , "query":"query($dateRange: DateRangeInput!){ auth { viewer { sites { one(id: \"' . $host_id . '\"){ firewall{ blockedCountries map(dateRange: $dateRange) { attacks, country, location { country { nameEn } } } } } } } } }"}'; 897 $response = self::sendRequest($payload, TRUE); 898 899 if (isset($response['data']['auth']['viewer']['sites']['one']['firewall'])) { 900 return $response['data']['auth']['viewer']['sites']['one']['firewall']; 901 } 902 903 return []; 904 } 905 906 /** 907 * Method for synchronizing data on the list of blocked countries. 908 * 909 * @param string $host_id 910 * Host id on WebTotem. 911 * @param array $countries 912 * Array of countries to block. 913 * 914 * @return bool|string 915 * Returns information whether the request was successful. 916 */ 917 public static function syncBlockedCountries($host_id, $countries) { 918 919 $countries = $countries ? WebTotem::convertArrayToString($countries) : ''; 920 $payload = '{"variables":{ "input": { "siteId": "' . $host_id . '", "countries": [' . $countries . '] } }, "query":"mutation($input: WafBlockedCountriesInput!,) { auth { sites { waf { syncBlockedCountries(input: $input) } } } }"} '; 921 $response = self::sendRequest($payload, TRUE); 922 923 if (isset($response['data']['auth']['sites']['waf']['syncBlockedCountries'])) { 924 return $response['data']['auth']['sites']['waf']['syncBlockedCountries']; 925 } 926 927 return FALSE; 928 } 929 885 930 /** 886 931 * Method to get user's email. … … 890 935 */ 891 936 public static function getEmail(){ 892 $payload = '{"query":"query { auth { viewer { email __typename } __typename} }"}';937 $payload = '{"query":"query { auth { viewer { email } } }"}'; 893 938 $response = self::sendRequest($payload, true); 894 939 -
wt-security/trunk/lib/Ajax.php
r2797028 r2837032 6 6 die('Protected By WebTotem!'); 7 7 } 8 8 9 9 class WebTotemAjax { 10 10 11 11 /** 12 12 * Activation plugin. … … 15 15 */ 16 16 public static function activation() { 17 17 18 18 if (WebTotemRequest::post('ajax_action') !== 'activation') { 19 19 return; 20 20 } 21 21 22 22 if($api_key = WebTotemRequest::post('api_key')) { 23 23 24 24 $result = WebTotemAPI::auth($api_key); 25 25 26 26 if($result == 'success') { 27 27 if(WebTotem::isMultiSite()) { … … 36 36 ], 200); 37 37 } else { 38 38 39 39 wp_send_json([ 40 40 'notifications' => self::notifications(), … … 43 43 } 44 44 } 45 46 } 47 45 46 } 47 48 48 /** 49 49 * The process of installing agents (WAF, AV) on the main page. … … 52 52 */ 53 53 public static function agentsInstallation() { 54 54 55 55 if (WebTotemRequest::post('ajax_action') !== 'agents_installation') { 56 56 return; 57 57 } 58 58 59 59 $av_installed = WebTotemOption::getOption('av_installed'); 60 60 $waf_installed = WebTotemOption::getOption('waf_installed'); 61 61 62 62 // Check if the agents are installed. 63 63 if ($av_installed and $waf_installed) { … … 73 73 $host = WebTotemAPI::siteInfo(); 74 74 $data = WebTotemAPI::getAgentsStatusesFromAPI($host['id']); 75 75 76 76 $agents_statuses = [ 77 77 'av' => $data['av']['status'], 78 78 'waf' => $data['waf']['status'], 79 79 ]; 80 80 81 81 $agents_statuses = WebTotem::getAgentsStatuses($agents_statuses); 82 82 } 83 83 84 84 $build[] = [ 85 85 'variables' => [ … … 88 88 'template' => 'agents_installation', 89 89 ]; 90 90 91 91 $status = [ 92 92 'av' => $agents_statuses['process_statuses']['av'] == 'installed', 93 93 'waf' => $agents_statuses['process_statuses']['waf'] == 'installed', 94 94 ]; 95 95 96 96 WebTotemOption::setOptions([ 97 97 'av_installed' => $status['av'], 98 98 'waf_installed' => $status['waf'], 99 99 ]); 100 100 101 101 $template = new WebTotemTemplate(); 102 102 $agents = $template->arrayRender($build); 103 103 104 104 wp_send_json([ 105 105 'success' => true, … … 109 109 ]); 110 110 } 111 112 111 113 112 /** 114 113 * Reinstall agents. … … 117 116 */ 118 117 public static function reinstallAgents() { 119 118 120 119 if (WebTotemRequest::post('ajax_action') !== 'reinstall_agents') { 121 120 return; 122 121 } 123 122 124 123 if (WebTotemAgentManager::removeAgents()) { 125 124 WebTotemAgentManager::amInstall(); … … 128 127 $response['redirect_link'] = WebTotem::adminURL('admin.php?page=wtotem'); 129 128 wp_send_json($response); 130 131 } 132 129 130 } 131 133 132 /** 134 133 * Deleting plugin activation data and redirecting to the activation page. … … 137 136 */ 138 137 public static function logout() { 139 138 140 139 if (WebTotemRequest::post('ajax_action') !== 'logout') { 141 140 return; 142 141 } 143 142 144 143 WebTotemOption::logout(); 145 144 146 145 $response['success'] = true; 147 146 $response['redirect_link'] = WebTotem::adminURL('admin.php?page=wtotem_activation'); 148 147 wp_send_json($response); 149 150 } 151 148 149 } 150 152 151 /** 153 152 * Creating a modal window. … … 156 155 */ 157 156 public static function popup() { 158 157 159 158 if (WebTotemRequest::post('ajax_action') !== 'popup') { 160 159 return; 161 160 } 162 161 163 162 $action = WebTotemRequest::post('popup_action'); 164 163 $template = new WebTotemTemplate(); 165 164 166 165 if($action){ 167 166 switch ($action) { … … 176 175 ]; 177 176 break; 178 177 179 178 case 'logout': 180 179 $build[] = [ … … 188 187 break; 189 188 } 190 189 191 190 wp_send_json([ 192 191 'success' => true, … … 194 193 ]); 195 194 } 196 195 197 196 wp_send_json([ 198 197 'success' => false, 199 198 ]); 200 201 } 202 199 200 } 201 203 202 /** 204 203 * Request to update charts with parameters. … … 207 206 */ 208 207 public static function chart() { 209 208 210 209 if (WebTotemRequest::post('ajax_action') !== 'chart') { 211 210 return; 212 211 } 213 212 214 213 $template = new WebTotemTemplate(); 215 214 216 215 $days = (integer) WebTotemRequest::post('days'); 217 216 $service = WebTotemRequest::post('service'); 218 217 219 218 $host = WebTotemAPI::siteInfo(); 220 219 221 220 switch ($service) { 222 221 case 'waf': 223 222 224 223 WebTotemOption::setSessionOptions(['firewall_period' => $days]); 225 224 226 225 // Firewall chart. 227 226 $data = WebTotemAPI::getFirewallChart($host['id'], $days); 228 227 $chart = WebTotem::generateWafChart($data['chart']); 229 228 230 229 $_chart[] = [ 231 230 'variables' => [ … … 235 234 'template' => 'firewall_chart', 236 235 ]; 237 236 238 237 // Firewall logs. 239 238 $data = WebTotemAPI::getFirewall($host['id'], 10, NULL, $days); 240 239 $firewall = $data['firewall']; 241 240 242 241 $waf_logs[] = [ 243 242 'variables' => [ … … 246 245 'template' => 'firewall_logs', 247 246 ]; 248 247 249 248 // Firewall stats. 250 249 $waf_stats[] = [ … … 258 257 'template' => 'firewall_stats', 259 258 ]; 260 259 261 260 WebTotemOption::setSessionOptions([ 262 261 'firewall_cursor' => $firewall['logs']['pageInfo']['endCursor'], 263 262 ]); 264 263 265 264 $has_next_page = $firewall['logs']['pageInfo']['hasNextPage']; 266 265 267 266 $response = [ 268 267 'chart' => $template->arrayRender($_chart), … … 272 271 'service' => 'waf', 273 272 ]; 274 275 break; 276 273 274 break; 275 277 276 case 'cpu': 278 277 WebTotemOption::setSessionOptions(['cpu_period' => $days]); 279 278 280 279 $data = WebTotemAPI::getServerStatusData($host['id'], $days); 281 280 $chart = WebTotem::generateChart($data['cpuChart'], $days); 282 281 283 282 $_chart[] = [ 284 283 'variables' => [ … … 288 287 'template' => 'cpu_chart', 289 288 ]; 290 289 291 290 $response = [ 292 291 'chart' => $template->arrayRender($_chart), 293 292 'service' => 'cpu', 294 293 ]; 295 296 break; 297 294 295 break; 296 298 297 case 'ram': 299 298 WebTotemOption::setSessionOptions(['ram_period' => $days]); 300 299 301 300 $data = WebTotemAPI::getServerStatusData($host['id'], $days); 302 301 $chart = WebTotem::generateChart($data['ramChart'], $days); 303 302 304 303 $_chart[] = [ 305 304 'variables' => [ … … 309 308 'template' => 'ram_chart', 310 309 ]; 311 310 312 311 $response = [ 313 312 'chart' => $template->arrayRender($_chart), 314 313 'service' => 'ram', 315 314 ]; 316 317 break; 318 315 316 break; 317 319 318 case 'map': 320 319 $data = WebTotemAPI::getFirewallChart($host['id'], $days); 321 320 $chart = WebTotem::generateAttacksMapChart($data['map']); 322 321 $world_map_json = WEBTOTEM_URL . '/includes/js/world_map.json'; 323 322 324 323 $_chart[] = [ 325 324 'variables' => [ … … 329 328 'template' => 'map_chart', 330 329 ]; 331 330 332 331 $response = [ 333 332 'chart' => $template->arrayRender($_chart), 334 333 'service' => 'map', 335 334 ]; 336 337 break; 338 339 } 340 335 336 break; 337 338 } 339 341 340 if ($service) { 342 341 $response['success'] = true; … … 344 343 wp_send_json($response); 345 344 } 346 347 } 348 345 346 } 347 349 348 /** 350 349 * Data lazy load. 351 350 352 351 * @return void 353 352 */ 354 353 public static function lazyLoad() { 355 356 354 355 357 356 if (WebTotemRequest::post('ajax_action') !== 'lazy_load') { 358 357 return; 359 358 } 360 359 361 360 $template = new WebTotemTemplate(); 362 361 363 362 $service = WebTotemRequest::post('service'); 364 363 365 364 $host = WebTotemAPI::siteInfo(); 366 365 367 366 switch ($service) { 368 367 case 'all_sites': 369 368 $cursor = WebTotemOption::getSessionOption('sites_cursor') ?: NULL; 370 369 $allSites = WebTotemAPI::getSites($cursor); 371 370 372 371 $has_next_page = $allSites['pageInfo']['hasNextPage']; 373 372 374 373 WebTotemOption::setSessionOptions([ 375 374 'sites_cursor' => $allSites['pageInfo']['endCursor'], 376 375 ]); 377 376 378 377 // Sites list. 379 378 $build[] = [ … … 384 383 'template' => 'multisite_list' 385 384 ]; 386 387 break; 388 385 386 break; 387 389 388 case 'firewall': 390 389 $cursor = WebTotemOption::getSessionOption('firewall_cursor') ?: NULL; … … 393 392 $service_data = $data['firewall']; 394 393 $has_next_page = $service_data['logs']['pageInfo']['hasNextPage']; 395 394 396 395 WebTotemOption::setSessionOptions([ 397 396 'firewall_cursor' => $service_data['logs']['pageInfo']['endCursor'], 398 397 ]); 399 398 400 399 // Firewall logs. 401 400 $build[] = [ … … 405 404 'template' => 'firewall_logs', 406 405 ]; 407 408 break; 409 406 407 break; 408 410 409 case 'antivirus': 411 410 $cursor = WebTotemOption::getSessionOption('antivirus_cursor') ?: NULL; 412 411 $event = WebTotemOption::getSessionOption('antivirus_event') ?: NULL; 413 412 $permissions = WebTotemOption::getSessionOption('antivirus_permissions') ?: NULL; 414 413 415 414 $params = [ 416 415 'host_id' => $host['id'], … … 421 420 'permissions' => $permissions, 422 421 ]; 423 422 424 423 $data = WebTotemAPI::getAntivirus($params); 425 424 $has_next_page = $data['log']['pageInfo']['hasNextPage']; 426 425 427 426 WebTotemOption::setSessionOptions([ 428 427 'antivirus_cursor' => $data['log']['pageInfo']['endCursor'], 429 428 ]); 430 429 431 430 // Antivirus logs. 432 431 $build[] = [ … … 436 435 'template' => 'antivirus_logs', 437 436 ]; 438 439 break; 440 437 438 break; 439 441 440 case 'reports': 442 441 $cursor = WebTotemOption::getSessionOption('reports_cursor') ?: NULL; 443 442 444 443 $data = WebTotemAPI::getAllReports($host['id'], 10, $cursor); 445 444 $has_next_page = $data['pageInfo']['hasNextPage']; 446 445 447 446 WebTotemOption::setSessionOptions([ 448 447 'reports_cursor' => $data['pageInfo']['endCursor'], 449 448 ]); 450 449 451 450 // Reports. 452 451 $build[] = [ … … 457 456 'template' => 'reports_list', 458 457 ]; 459 460 break; 461 458 459 break; 460 462 461 case 'reports_m': 463 462 $cursor = WebTotemOption::getSessionOption('reports_m_cursor') ?: NULL; 464 463 465 464 $data = WebTotemAPI::getAllReports($host['id'], 10, $cursor); 466 465 $has_next_page = $data['pageInfo']['hasNextPage']; 467 466 468 467 WebTotemOption::setSessionOptions([ 469 468 'reports_m_cursor' => $data['pageInfo']['endCursor'], 470 469 ]); 471 470 472 471 // Reports mobile. 473 472 $build[] = [ … … 478 477 'template' => 'reports_list_mobile', 479 478 ]; 480 481 break; 482 } 483 479 480 break; 481 } 482 484 483 if ($service) { 485 484 486 485 wp_send_json([ 487 486 'success' => true, … … 492 491 } 493 492 } 494 495 493 494 /** 495 * Data lazy load. 496 497 * @return void 498 */ 499 public static function logs() { 500 if (WebTotemRequest::post('ajax_action') !== 'logs') { 501 return; 502 } 503 504 $template = new WebTotemTemplate(); 505 $logs_action = WebTotemRequest::post('logs_action'); 506 507 switch ($logs_action) { 508 case 'audit_logs_pagination': 509 $order = WebTotemRequest::post('order') === 'ascending' ? 'ASC' : 'DESC'; 510 $current_page = (int) WebTotemRequest::post('current_page'); 511 $event = WebTotemRequest::post('event'); 512 $filter = $event === 'All' ? [] : ['LIKE', ['event' => $event . '%']]; 513 514 $audit_logs = WebTotemDB::getRows( 515 $filter, 516 'audit_logs', 517 false, 518 ['limit' => 10, 'page' => $current_page], 519 ['order_by' => 'created_at', 'direction' => $order] 520 ); 521 522 $build[] = [ 523 'variables' => [ 524 "audit_logs" => WebTotem::getAuditLogs($audit_logs['data'], $audit_logs['dates_count']), 525 ], 526 'template' => 'scan_audit_logs', 527 ]; 528 529 $response = [ 530 'success' => true, 531 'content' => $template->arrayRender($build), 532 "pagination" => WebTotem::paginationBuild(10, $audit_logs['count'], $current_page), 533 'notifications' => self::notifications(), 534 ]; 535 536 break; 537 538 case 'audit_logs_sort_filter': 539 $order = WebTotemRequest::post('order') === 'ascending' ? 'ASC' : 'DESC'; 540 $event = WebTotemRequest::post('event'); 541 $filter = $event === 'All' ? [] : ['LIKE', ['event' => $event . '%']]; 542 $audit_logs = WebTotemDB::getRows( 543 $filter, 544 'audit_logs', 545 false, 546 ['limit' => 10, 'page' => 1], 547 ['order_by' => 'created_at', 'direction' => $order] 548 ); 549 550 $build[] = [ 551 'variables' => [ 552 "audit_logs" => WebTotem::getAuditLogs($audit_logs['data'], $audit_logs['dates_count']), 553 ], 554 'template' => 'scan_audit_logs', 555 ]; 556 557 $response = [ 558 'success' => true, 559 'content' => $template->arrayRender($build), 560 "pagination" => WebTotem::paginationBuild(10, $audit_logs['count'], 1), 561 'notifications' => self::notifications(), 562 ]; 563 564 break; 565 566 case 'logs_pagination': 567 $current_page = (int) WebTotemRequest::post('current_page'); 568 $type = WebTotemRequest::post('type'); 569 570 $scan_logs = WebTotemDB::getRows( 571 ['AND',['data_type' => $type]], 572 'scan_logs', 573 'content', 574 ['limit' => 10, 'page' => $current_page], 575 ); 576 577 $build[] = [ 578 'variables' => [ 579 "logs" => $scan_logs['data'], 580 "data_type" => $type 581 ], 582 'template' => 'scan_logs_items', 583 ]; 584 585 $response = [ 586 'success' => true, 587 'content' => $template->arrayRender($build), 588 "pagination" => WebTotem::paginationBuild(10, $scan_logs['count'], $current_page), 589 'notifications' => self::notifications(), 590 ]; 591 592 break; 593 } 594 595 wp_send_json($response); 596 } 597 496 598 /** 497 599 * Add date filter. … … 500 602 */ 501 603 public static function wafDateFilter() { 502 604 503 605 if (WebTotemRequest::post('ajax_action') !== 'waf_date_filter') { 504 606 return; 505 607 } 506 608 507 609 $template = new WebTotemTemplate(); 508 610 509 611 $date_from = WebTotemRequest::post('date_from'); 510 612 511 613 $period = explode(" to ", $date_from); 512 614 WebTotemOption::setSessionOptions(['firewall_period' => $period]); 513 615 514 616 $host = WebTotemAPI::siteInfo(); 515 617 516 618 // Firewall logs. 517 619 $data = WebTotemAPI::getFirewall($host['id'], 10, NULL, $period); 518 620 $firewall = $data['firewall']; 519 621 520 622 $waf_logs[] = [ 521 623 'variables' => [ … … 524 626 'template' => 'firewall_logs', 525 627 ]; 526 628 527 629 // Firewall chart. 528 630 $data = WebTotemAPI::getFirewallChart($host['id'], $period); 529 631 $chart = WebTotem::generateWafChart($data['chart']); 530 632 531 633 $_chart[] = [ 532 634 'variables' => [ … … 536 638 'template' => 'firewall_chart', 537 639 ]; 538 640 539 641 // Firewall stats. 540 642 $waf_stats[] = [ … … 548 650 'template' => 'firewall_stats', 549 651 ]; 550 652 551 653 WebTotemOption::setSessionOptions([ 552 654 'firewall_cursor' => $firewall['logs']['pageInfo']['endCursor'], 553 655 ]); 554 656 555 657 $has_next_page = $firewall['logs']['pageInfo']['hasNextPage']; 556 658 557 659 $response = [ 558 660 'success' => true, … … 563 665 'notifications' => self::notifications(), 564 666 ]; 565 667 566 668 wp_send_json($response); 567 669 } 568 569 670 671 570 672 /** 571 673 * Request to restart re-scan and receive antivirus data. … … 574 676 */ 575 677 public static function antivirus() { 576 678 577 679 if (WebTotemRequest::post('ajax_action') !== 'antivirus') { 578 680 return; 579 681 } 580 682 581 683 $action = WebTotemRequest::post('av_action'); 582 684 583 685 $host = WebTotemAPI::siteInfo(); 584 686 585 687 switch ($action) { 586 688 case 'rescan': 587 689 $response = WebTotemAPI::forceCheck($host['id'], 'av'); 588 690 589 691 if (!isset($response['errors'])) { 590 692 $data = WebTotemAPI::getAntivirusLastTest($host['id']); 591 693 $response['last_scan'] = WebTotem::dateFormatter($data['lastTest']['time']); 592 593 } 594 break; 595 694 } 695 break; 696 596 697 case 'download_report': 597 698 $response = WebTotemAPI::avExport($host['id']); … … 600 701 } 601 702 break; 602 703 603 704 case 'filter': 604 705 605 706 $file_status = WebTotemRequest::post('file_status'); 606 707 $permission = filter_var( WebTotemRequest::post('permission'), FILTER_VALIDATE_BOOLEAN); 607 708 608 709 WebTotemOption::setSessionOptions([ 609 710 'antivirus_permissions' => $permission, 610 711 'antivirus_event' => $file_status, 611 712 ]); 612 713 613 714 $params = [ 614 715 'host_id' => $host['id'], … … 619 720 'permissions' => $permission, 620 721 ]; 621 722 622 723 $data = WebTotemAPI::getAntivirus($params); 623 724 $has_next_page = $data['log']['pageInfo']['hasNextPage']; 624 725 625 726 WebTotemOption::setSessionOptions([ 626 727 'antivirus_cursor' => $data['log']['pageInfo']['endCursor'], 627 728 ]); 628 729 629 730 // Antivirus logs. 630 731 $build[] = [ … … 634 735 'template' => 'antivirus_logs', 635 736 ]; 636 737 637 738 $template = new WebTotemTemplate(); 638 739 $response = [ … … 640 741 'has_next_page' => $has_next_page, 641 742 ]; 642 643 break; 644 } 645 743 744 break; 745 } 746 646 747 $response['success'] = true; 647 748 $response['notifications'] = self::notifications(); 648 749 649 750 wp_send_json($response); 650 751 } 651 752 652 753 /** 653 754 * Request to add a file to quarantine. … … 659 760 return; 660 761 } 661 762 662 763 $action = WebTotemRequest::post('quarantine_action'); 663 764 $id_or_path = WebTotemRequest::post('id_or_path'); 664 765 665 766 $host = WebTotemAPI::siteInfo(); 666 767 $response = []; 667 768 668 769 switch ($action) { 669 770 case 'add': 670 771 $api_response = WebTotemAPI::moveToQuarantine($host['id'], $id_or_path); 671 772 break; 672 773 673 774 case 'remove': 674 775 $api_response = WebTotemAPI::moveFromQuarantine($id_or_path); 675 776 break; 676 777 } 677 778 678 779 if (!isset($api_response['errors'])) { 679 780 680 781 $quarantine_logs = WebTotemAPI::getQuarantineList($host['id']); 681 782 $quarantine_count = count($quarantine_logs); 682 783 683 784 // Quarantine logs. 684 785 $quarantine[] = [ … … 689 790 'template' => 'quarantine', 690 791 ]; 691 792 692 793 $cursor = WebTotemOption::getSessionOption('antivirus_cursor') ?: NULL; 693 794 $event = WebTotemOption::getSessionOption('antivirus_event') ?: NULL; 694 795 $permissions = WebTotemOption::getSessionOption('antivirus_permissions') ?: NULL; 695 796 696 797 $params = [ 697 798 'host_id' => $host['id'], … … 702 803 'permissions' => $permissions, 703 804 ]; 704 805 705 806 $data = WebTotemAPI::getAntivirus($params); 706 807 WebTotemCache::setData(['getAntivirus' => $data], $host['id']); 707 808 708 809 $has_next_page = $data['log']['pageInfo']['hasNextPage']; 709 810 710 811 WebTotemOption::setSessionOptions([ 711 812 'antivirus_cursor' => $data['log']['pageInfo']['endCursor'], 712 813 ]); 713 814 714 815 // Antivirus logs. 715 816 $antivirus_logs[] = [ … … 719 820 'template' => 'antivirus_logs', 720 821 ]; 721 722 822 823 723 824 $template = new WebTotemTemplate(); 724 825 $response = [ … … 727 828 'has_next_page' => $has_next_page, 728 829 ]; 729 730 } 731 830 831 } 832 732 833 $response['success'] = true; 733 834 $response['notifications'] = self::notifications(); 734 835 735 836 wp_send_json($response); 736 737 } 738 837 838 } 839 739 840 /** 740 841 * Request to add or remove a port to the ignore list. … … 743 844 */ 744 845 public static function ignorePorts() { 745 846 746 847 if (WebTotemRequest::post('ajax_action') !== 'ignore_ports') { 747 848 return; 748 849 } 749 850 750 851 $template = new WebTotemTemplate(); 751 852 752 853 $action = WebTotemRequest::post('port_action'); 753 854 $port = (int) WebTotemRequest::post('port'); 754 855 755 856 $host = WebTotemAPI::siteInfo(); 756 857 757 858 switch ($action) { 758 859 case 'add': 759 860 $response = WebTotemAPI::addIgnorePort($host['id'], $port); 760 861 break; 761 862 762 863 case 'remove': 763 864 $response = WebTotemAPI::removeIgnorePort($host['id'], $port); 764 865 break; 765 866 } 766 867 767 868 if (!isset($response['errors'])) { 768 869 769 870 $ports = WebTotemAPI::getAllPortsList($host['id']); 770 871 $open_ports[] = [ … … 774 875 'template' => 'open_ports', 775 876 ]; 776 877 777 878 $ignore_ports[] = [ 778 879 'variables' => [ … … 785 886 'ignore_ports' => $template->arrayRender($ignore_ports), 786 887 ]; 787 788 } 789 888 889 } 890 790 891 $response['success'] = true; 791 892 $response['notifications'] = self::notifications(); 792 893 793 894 wp_send_json($response); 794 895 } 795 896 796 897 /** 797 898 * Request for a report link. … … 800 901 */ 801 902 public static function reports() { 802 903 803 904 if (WebTotemRequest::post('ajax_action') !== 'reports') { 804 905 return; 805 906 } 806 907 807 908 $template = new WebTotemTemplate(); 808 909 809 910 $action = WebTotemRequest::post('report_action'); 810 911 811 912 switch ($action) { 812 913 case 'download': … … 818 919 break; 819 920 case 'report_form': 820 921 821 922 $period = explode(" to ", WebTotemRequest::post('date_period')); 822 923 $modules_data = WebTotemRequest::post('modules'); 823 924 824 925 $modules = [ 825 926 'wa' => 'false', … … 831 932 'waf' => 'false' 832 933 ]; 833 934 834 935 foreach ($modules_data as $module => $value){ 835 936 $modules[$module] = 'true'; 836 937 } 837 938 838 939 $host = WebTotemAPI::siteInfo(); 839 940 $api_response = WebTotemAPI::generateReport($host['id'], $period, $modules); 840 941 841 942 if (!$api_response) { 842 943 $massage = '<div class="message error_message">' . __('Report generation error', 'wtotem') . '</div>'; … … 845 946 $data = WebTotemAPI::getAllReports($host['id']); 846 947 WebTotemCache::setData(['getAllReports' => $data], $host['id']); 847 948 848 949 // Reports. 849 950 $build[] = [ … … 854 955 'template' => 'reports_list', 855 956 ]; 856 957 857 958 // Reports mobile. 858 959 $build_mobile[] = [ … … 863 964 'template' => 'reports_list_mobile', 864 965 ]; 865 966 866 967 $response = [ 867 968 'reports' => $template->arrayRender($build), … … 869 970 'link' => $api_response, 870 971 ]; 871 972 872 973 $massage = '<div class="message success_message">' . __('The report was successfully generated', 'wtotem') . '</div>'; 873 974 } 874 975 875 976 $response['massage'] = $massage; 876 877 break; 878 } 879 977 978 break; 979 } 980 880 981 $response['success'] = true; 881 982 $response['notifications'] = self::notifications(); 882 983 wp_send_json($response); 883 984 } 884 985 885 986 /** 886 987 * Request for a report link. … … 889 990 */ 890 991 public static function settings() { 891 992 892 993 if (WebTotemRequest::post('ajax_action') !== 'settings') { 893 994 return; 894 995 } 895 996 896 997 $av_installed = WebTotemOption::getOption('av_installed'); 897 998 $waf_installed = WebTotemOption::getOption('waf_installed'); 898 999 $action = WebTotemRequest::post('settings_action'); 899 1000 900 if(in_array($action, ['module_toggle', 'module_notifications', 'waf_settings', 'add_allow_ip', 'add_deny_ip', 'add_allow_url', 'add_ip_list' ])){1001 if(in_array($action, ['module_toggle', 'module_notifications', 'waf_settings', 'add_allow_ip', 'add_deny_ip', 'add_allow_url', 'add_ip_list', 'country_blocking'])){ 901 1002 if(!$av_installed && !$waf_installed) { 902 1003 WebTotemOption::setNotification('warning', __('It is not possible to make changes because the agents are not installed.', 'wtotem')); … … 912 1013 $host = WebTotemAPI::siteInfo(); 913 1014 $template = new WebTotemTemplate(); 914 1015 915 1016 switch ($action) { 916 1017 917 1018 case 'module_toggle': 918 1019 $config = WebTotemAPI::toggleConfigs(WebTotemRequest::post('value')); 919 1020 920 1021 $configs_data = WebTotemAPI::getConfigs($host['id']); 921 1022 WebTotemCache::setData(['getConfigs' => $configs_data], $host['id']); … … 925 1026 $response['success'] = true; 926 1027 break; 927 1028 1029 case 'country_blocking': 1030 $countries = WebTotemRequest::post('checked_countries'); 1031 1032 if(WebTotemAPI::syncBlockedCountries($host['id'], $countries)){ 1033 $waf_data = WebTotemAPI::getBlockedCountries($host['id']); 1034 WebTotemCache::setData(['getBlockedCountries' => $waf_data], $host['id']); 1035 1036 WebTotemOption::setNotification('success', __('Your changes have been applied successfully.', 'wtotem')); 1037 $response['blocked_countries_list'] = $waf_data['blockedCountries']; 1038 $response['success'] = true; 1039 } else { 1040 WebTotemOption::setNotification('success', __('Your changes have not been applied.', 'wtotem')); 1041 $response['success'] = false; 1042 } 1043 1044 break; 1045 928 1046 case 'module_notifications': 929 1047 $config = WebTotemAPI::toggleNotifications($host['id'], WebTotemRequest::post('value')); 930 1048 931 1049 $configs_data = WebTotemAPI::getConfigs($host['id']); 932 1050 WebTotemCache::setData(['getConfigs' => $configs_data], $host['id']); … … 936 1054 $response['success'] = true; 937 1055 break; 938 1056 939 1057 case 'waf_settings': 940 1058 1059 $response['success'] = true; 1060 1061 $dos = WebTotemRequest::post('dos'); 1062 $dos_limit = WebTotemRequest::post('dos_limit'); 1063 $login_attempt = WebTotemRequest::post('login_attempt'); 1064 $login_attempt_limit = WebTotemRequest::post('login_attempt_limit'); 1065 1066 if($dos){ 1067 if(empty($dos_limit)){ 1068 $response['errors']['dos_limit'] = __('The field is required.', 'wtotem'); 1069 } else if($dos_limit < 500 or $dos_limit > 100000) { 1070 $response['success'] = false; 1071 $response['errors']['dos_limit'] = sprintf(__('Please specify a value from %s to %s.', 'wtotem'), '500', '100 000'); 1072 } 1073 } 1074 1075 if($login_attempt){ 1076 if(empty($login_attempt_limit)){ 1077 $response['errors']['login_attempt_limit'] = __('The field is required.', 'wtotem'); 1078 } else if($login_attempt_limit < 5 or $login_attempt_limit > 30) { 1079 $response['success'] = false; 1080 $response['errors']['login_attempt_limit'] = sprintf(__('Please specify a value from %s to %s.', 'wtotem'), '5', '30'); 1081 } 1082 } 1083 1084 if(!$response['success']){ 1085 break; 1086 } else { 1087 $response['errors'] = false; 1088 } 1089 941 1090 $settings = [ 942 1091 'gdn' => WebTotemRequest::post('gdn'), 943 'dosProtection' => WebTotemRequest::post('dos'),944 'dosLimit' => WebTotemRequest::post('dos_limit'),945 'loginAttemptsProtection' => WebTotemRequest::post('login_attempt'),946 'loginAttemptsLimit' => WebTotemRequest::post('login_attempt_limit'),947 ]; 948 1092 'dosProtection' => $dos, 1093 'dosLimit' => $dos_limit, 1094 'loginAttemptsProtection' => $login_attempt, 1095 'loginAttemptsLimit' => $login_attempt_limit, 1096 ]; 1097 949 1098 $host = WebTotemAPI::siteInfo(); 950 1099 $api_response = WebTotemAPI::setFirewallSettings($host['id'], $settings); 951 1100 952 1101 if (!$api_response['errors']) { 953 1102 954 1103 $data = WebTotemAPI::getIpLists($host['id']); 955 1104 WebTotemCache::setData(['getIpLists' => $data], $host['id']); 956 1105 957 1106 WebTotemOption::setNotification('success', __('Your changes have been applied successfully.', 'wtotem')); 958 1107 } 959 960 $response['success'] = true; 961 break; 962 1108 1109 break; 1110 963 1111 case 'recaptcha_settings': 964 1112 965 1113 $recaptcha_v3_site_key = WebTotemRequest::post('recaptcha_v3_site_key'); 966 1114 $recaptcha_v3_secret = WebTotemRequest::post('recaptcha_v3_secret'); … … 997 1145 } 998 1146 } 999 1147 1000 1148 if($recaptcha){ 1001 1149 $settings = [ … … 1005 1153 } 1006 1154 $settings['recaptcha'] = $recaptcha; 1007 1155 1008 1156 if($settings['hide_wp_version']){ 1009 1157 WebTotemOption::hideReadme(); … … 1011 1159 WebTotemOption::restoreReadme(); 1012 1160 } 1013 1161 1014 1162 WebTotemOption::setPluginSettings($settings); 1015 1163 1016 1164 WebTotemOption::setNotification('success', __('Your changes have been applied successfully.', 'wtotem')); 1017 1165 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')); 1018 1166 1019 1167 $response['success'] = true; 1020 1021 1168 1169 1022 1170 break; 1023 1171 … … 1082 1230 } else if($data['login_number_of_attempts'] <= 0 or $data['login_number_of_attempts'] > 1000000) { 1083 1231 $response['success'] = false; 1084 $response['errors']['login_number_of_attempts'] = __('Please specify a value from 1 to 1000000.', 'wtotem');1232 $response['errors']['login_number_of_attempts'] = sprintf(__('Please specify a value from %s to %s.', 'wtotem'), '1', '1000000'); 1085 1233 } 1086 1234 } … … 1101 1249 } else if($data['password_reset_number_of_attempts'] <= 0 or $data['password_reset_number_of_attempts'] > 1000000) { 1102 1250 $response['success'] = false; 1103 $response['errors']['password_reset_number_of_attempts'] = __('Please specify a value from 1 to 1000000.', 'wtotem');1251 $response['errors']['password_reset_number_of_attempts'] = sprintf(__('Please specify a value from %s to %s.', 'wtotem'), '1', '1000000'); 1104 1252 } 1105 1253 } … … 1141 1289 'template' => 'allow_deny_list', 1142 1290 ]; 1143 1291 1144 1292 $response['content'] = $template->arrayRender($build); 1145 1293 } 1146 1294 1147 1295 $response['success'] = true; 1148 1296 break; 1149 1297 1150 1298 case 'add_deny_ip': 1151 1299 $api_response = WebTotemAPI::addIpToList($host['id'], WebTotemRequest::post('value'), 'black'); … … 1159 1307 'template' => 'allow_deny_list', 1160 1308 ]; 1161 1309 1162 1310 $response['content'] = $template->arrayRender($build); 1163 1311 } 1164 1312 1165 1313 $response['success'] = true; 1166 1314 break; 1167 1315 1168 1316 case 'add_allow_url': 1169 1317 $api_response = WebTotemAPI::addUrlToAllowList($host['id'], WebTotemRequest::post('value')); … … 1176 1324 'template' => 'allow_url_list', 1177 1325 ]; 1178 1326 1179 1327 $response['content'] = $template->arrayRender($build); 1180 1328 } 1181 1329 1182 1330 $response['success'] = true; 1183 1331 break; 1184 1332 1185 1333 case 'add_ip_list': 1186 1334 $ips = WebTotemRequest::post('ips'); 1187 1335 $list_name = WebTotemRequest::post('list'); 1188 1336 1189 1337 $host = WebTotemAPI::siteInfo(); 1190 1338 $api_response = WebTotemAPI::addIpToList($host['id'], $ips, $list_name); 1191 1339 1192 1340 if ($api_response) { 1193 1341 $data = WebTotemAPI::getIpLists($host['id']); 1194 1342 1195 1343 $data_list = ($list_name == 'white') ? $data['whiteList'] : $data['blackList']; 1196 1344 $ip_list = ($list_name == 'white') ? 'ip_allow' : 'ip_deny'; 1197 1345 1198 1346 $build[] = [ 1199 1347 'variables' => [ … … 1202 1350 'template' => 'allow_deny_list', 1203 1351 ]; 1204 1352 1205 1353 if ($api_response['status'] != 0) { 1206 1354 $response['invalidIPs'] = implode("\n", $api_response['invalidIPs']); 1207 1355 } 1208 1356 1209 1357 $response['wrap'] = ($list_name == 'white') ? '#wtotem_ip_allow_list' : '#wtotem_ip_deny_list'; 1210 1358 $response['content'] = $template->arrayRender($build); 1211 1359 } 1212 1360 $response['success'] = true; 1213 1214 break; 1215 } 1216 1361 1362 break; 1363 } 1364 1217 1365 $response['notifications'] = self::notifications(); 1218 1366 wp_send_json($response); 1219 1367 } 1220 1368 1221 1369 /** 1222 1370 * Request to remove from the list of deny/allowed ip or url addresses. … … 1225 1373 */ 1226 1374 public static function remove() { 1227 1375 1228 1376 if (WebTotemRequest::post('ajax_action') !== 'remove') { 1229 1377 return; 1230 1378 } 1231 1379 1232 1380 $av_installed = WebTotemOption::getOption('av_installed'); 1233 1381 $waf_installed = WebTotemOption::getOption('waf_installed'); 1234 1382 1235 1383 if(!$av_installed && !$waf_installed) { 1236 1384 WebTotemOption::setNotification('warning', __('It is not possible to make changes because the agents are not installed.', 'wtotem')); 1237 1385 1238 1386 wp_send_json([ 1239 1387 'success' => false, … … 1241 1389 ]); 1242 1390 } 1243 1391 1244 1392 $action = WebTotemRequest::post('remove_action'); 1245 1393 $host = WebTotemAPI::siteInfo(); 1246 1394 $template = new WebTotemTemplate(); 1247 1395 1248 1396 switch ($action) { 1249 1397 case 'ip_allow': 1250 1398 $api_response = WebTotemAPI::removeIpFromList( WebTotemRequest::post('id') ); 1251 1399 1252 1400 if ($api_response) { 1253 1401 $data = WebTotemAPI::getIpLists($host['id']); 1254 1402 1255 1403 $build[] = [ 1256 1404 'variables' => [ … … 1259 1407 'template' => 'allow_deny_list', 1260 1408 ]; 1261 1409 1262 1410 $response['content'] = $template->arrayRender($build); 1263 1411 $response['wrap'] = '#wtotem_ip_allow_list'; 1264 1412 } 1265 1413 break; 1266 1414 1267 1415 case 'ip_deny': 1268 1416 $api_response = WebTotemAPI::removeIpFromList( WebTotemRequest::post('id') ); 1269 1417 1270 1418 if ($api_response) { 1271 1419 $data = WebTotemAPI::getIpLists($host['id']); 1272 1420 1273 1421 $build[] = [ 1274 1422 'variables' => [ … … 1277 1425 'template' => 'allow_deny_list', 1278 1426 ]; 1279 1427 1280 1428 $response['content'] = $template->arrayRender($build); 1281 1429 $response['wrap'] = '#wtotem_ip_deny_list'; 1282 1430 } 1283 1431 break; 1284 1432 1285 1433 case 'url_allow': 1286 1434 $api_response = WebTotemAPI::removeUrlFromAllowList( WebTotemRequest::post('id') ); 1287 1435 1288 1436 if ($api_response) { 1289 1437 $data = WebTotemAPI::getAllowUrlList($host['id']); 1290 1438 1291 1439 $build[] = [ 1292 1440 'variables' => [ … … 1295 1443 'template' => 'allow_url_list', 1296 1444 ]; 1297 1445 1298 1446 $response['content'] = $template->arrayRender($build); 1299 1447 $response['wrap'] = '#wtotem_allow_url'; … … 1301 1449 break; 1302 1450 } 1303 1451 1304 1452 $response['success'] = true; 1305 1453 $response['notifications'] = self::notifications(); 1306 1454 wp_send_json($response); 1307 1455 } 1308 1456 1309 1457 /** 1310 1458 * Request to remove site from WebTotem. … … 1313 1461 */ 1314 1462 public static function multisite() { 1315 1463 1316 1464 if (WebTotemRequest::post('ajax_action') !== 'multisite') { 1317 1465 return; 1318 1466 } 1319 1467 1320 1468 $action = WebTotemRequest::post('multisite_action'); 1321 1469 $template = new WebTotemTemplate(); 1322 1470 1323 1471 switch ($action) { 1324 1472 case 'remove_site': 1325 1473 1326 1474 $host_id = WebTotemRequest::post('hid'); 1327 1475 $main_host = WebTotemOption::getMainHost(); 1328 1476 1329 1477 if($host_id == $main_host['id']){ 1330 1478 WebTotemOption::setNotification('error', __('You cannot delete the primary domain.', 'wtotem')); … … 1332 1480 } 1333 1481 WebTotemAPI::removeMultiSiteHost($host_id); 1334 1335 break; 1336 1482 1483 break; 1484 1337 1485 case 'add_site': 1338 1486 1339 1487 $new_site = WebTotemRequest::post('site_name'); 1340 1488 WebTotemAPI::addMultiSiteNewSites([$new_site]); 1341 1342 break; 1343 } 1344 1489 1490 break; 1491 } 1492 1345 1493 $allSites = WebTotemAPI::getSites(); 1346 1494 $has_next_page = $allSites['pageInfo']['hasNextPage']; 1347 1495 1348 1496 WebTotemOption::setSessionOptions([ 1349 1497 'sites_cursor' => $allSites['pageInfo']['endCursor'], 1350 1498 ]); 1351 1499 1352 1500 // Sites list. 1353 1501 $build[] = [ … … 1358 1506 'template' => 'multisite_list' 1359 1507 ]; 1360 1508 1361 1509 $response['content'] = $template->arrayRender($build); 1362 1510 1363 1511 $response['success'] = true; 1364 1512 $response['notifications'] = self::notifications(); 1365 1513 wp_send_json($response); 1366 1514 } 1367 1515 1368 1516 /** 1369 1517 * Request to remove site from WebTotem. … … 1372 1520 */ 1373 1521 public static function twoFactorAuth() { 1374 1522 1375 1523 if (WebTotemRequest::post('ajax_action') !== 'two_factor_auth') { 1376 1524 return; 1377 1525 } 1378 1526 1379 1527 $action = WebTotemRequest::post('case_action'); 1380 1528 $template = new WebTotemTemplate(); … … 1392 1540 $user = $current_user; 1393 1541 } 1394 1542 1395 1543 switch ($action) { 1396 1544 case 'activate': 1397 1545 1398 1546 $g = new WebTotemGoogleAuthenticator(); 1399 1547 … … 1401 1549 $recovery = WebTotemRequest::post('recovery'); 1402 1550 $code = WebTotemRequest::post('code'); 1403 1551 1404 1552 if($g->checkCode($secret, $code)){ 1405 1553 WebTotemLogin::saveData($user->ID, $recovery, $secret); … … 1410 1558 $response['success'] = false; 1411 1559 } 1412 1413 break; 1414 1560 1561 break; 1562 1415 1563 case 'deactivate': 1416 1564 1417 1565 WebTotemLogin::delete($user->ID); 1418 1566 1419 1567 $response['success'] = true; 1420 1568 1421 1569 break; 1422 1570 } … … 1430 1578 'template' => 'two_factor_auth' 1431 1579 ]; 1432 1580 1433 1581 $response['content'] = $template->arrayRender($build); 1434 1582 1435 1583 $response['notifications'] = self::notifications(); 1436 1584 wp_send_json($response); 1437 1585 } 1438 1586 1439 1587 /** 1440 1588 * Changing the theme mode. … … 1443 1591 */ 1444 1592 public static function changeThemeMode() { 1445 1593 1446 1594 if (WebTotemRequest::post('ajax_action') !== 'theme_mode') { 1447 1595 return; 1448 1596 } 1449 1597 1450 1598 $theme_mode = WebTotemOption::getSessionOption('theme_mode'); 1451 1599 1452 1600 if ($theme_mode == 'dark') { 1453 1601 WebTotemOption::setSessionOptions(['theme_mode' => 'light']); … … 1458 1606 $response = 'dark'; 1459 1607 } 1460 1608 1461 1609 wp_send_json($response); 1462 1610 } 1463 1611 1464 1612 /** 1465 1613 * Set user time zone offset. … … 1468 1616 */ 1469 1617 public static function userTimeZone() { 1470 1618 1471 1619 if (WebTotemRequest::post('ajax_action') !== 'set_time_zone') { 1472 1620 return; 1473 1621 } 1474 1622 1475 1623 $time_zone_offset = WebTotemRequest::post('offset'); 1476 1624 $now = strtotime('now'); 1477 1625 $check = WebTotemOption::getOption('time_zone_check') ?: 0; 1478 1626 1479 1627 // Checking whether an hour has elapsed since the previous request. 1480 1628 if ($now >= $check) { … … 1486 1634 WebTotemOption::setOptions(['time_zone_offset' => $time_zone_offset]); 1487 1635 } 1488 1636 1489 1637 wp_send_json([ 1490 1638 'success' => true, 1491 1639 'time_zone_offset' => $time_zone_offset 1492 1640 ]); 1493 1494 } 1495 1641 1642 } 1643 1496 1644 /** 1497 1645 * Updating the page data in the specified time interval. … … 1500 1648 */ 1501 1649 public static function reloadPage() { 1502 1650 1503 1651 if (WebTotemRequest::post('ajax_action') !== 'reload_page') { 1504 1652 return; 1505 1653 } 1506 1654 1507 1655 $page = WebTotemRequest::post('page'); 1508 1656 1509 1657 $template = new WebTotemTemplate(); 1510 1658 1511 1659 // Get data from WebTotem API. 1512 1660 $host = WebTotemAPI::siteInfo(); 1513 1661 1514 1662 switch ($page) { 1515 1663 case 'dashboard': 1516 1664 1517 1665 $data = WebTotemAPI::getAllData($host['id']); 1518 1666 1519 1667 // Start build array for rendering. 1520 1668 // Scoring block. … … 1535 1683 'template' => 'score', 1536 1684 ]; 1537 1685 1538 1686 // Firewall stats. 1539 1687 $period = WebTotemOption::getSessionOption('firewall_period'); 1540 1688 $service_data = $period ? WebTotemAPI::getFirewall($host['id'], 10, NULL, $period) : $data; 1541 1689 $service_data = $service_data['firewall']; 1542 1690 1543 1691 $chart = WebTotem::generateWafChart($service_data['chart']); 1544 1692 $build['firewall_stats'] = [ … … 1552 1700 'template' => 'firewall_stats', 1553 1701 ]; 1554 1702 1555 1703 $build['chart_periods'] = [ 1556 1704 'variables' => [ … … 1560 1708 'template' => 'chart_periods', 1561 1709 ]; 1562 1710 1563 1711 // Firewall blocks. 1564 1712 $build['firewall_data'] = [ … … 1570 1718 'template' => 'firewall', 1571 1719 ]; 1572 1720 1573 1721 // Server Status RAM. 1574 1722 $period = WebTotemOption::getSessionOption('ram_period') ?: 7; 1575 1723 $service_data = $period ? WebTotemAPI::getServerStatusData($host['id'], $period) : $data['serverStatus']; 1576 1724 1577 1725 $build['server_status_ram'] = [ 1578 1726 'variables' => [ … … 1583 1731 'template' => 'server_status_ram', 1584 1732 ]; 1585 1733 1586 1734 // Server Status CPU. 1587 1735 $period = WebTotemOption::getSessionOption('cpu_period') ?: 7; … … 1592 1740 "days" => $period, 1593 1741 ], 1594 1742 1595 1743 'template' => 'server_status_cpu', 1596 1744 ]; 1597 1745 1598 1746 // Antivirus stats blocks. 1599 1747 $antivirus_stats = $data['antivirus']['stats']; … … 1605 1753 "infected" => $antivirus_stats["infected"] ?: 0, 1606 1754 ], 1607 1755 1608 1756 'template' => 'antivirus_stats', 1609 1757 ]; 1610 1758 1611 1759 // Monitoring blocks. 1612 1760 $build['monitoring'] = [ … … 1636 1784 'template' => 'monitoring', 1637 1785 ]; 1638 1786 1639 1787 // Scanning blocks. 1640 1788 $disc_usage_data = $data['serverStatus']['discUsage']; … … 1644 1792 'used' => $disc_usage_data['total'] - $disc_usage_data['free'], 1645 1793 ]; 1646 1794 1647 1795 $build['scanning'] = [ 1648 1796 'variables' => [ … … 1666 1814 'template' => 'scanning', 1667 1815 ]; 1668 1816 1669 1817 $response['content'][] = ['selector' => '#scoring', 'content' => $template->arrayRender($build['scoring'])]; 1670 1818 $response['content'][] = ['selector' => '#firewall_stats', 'content' => $template->arrayRender($build['firewall_stats'])]; … … 1676 1824 $response['content'][] = ['selector' => '#monitoring', 'content' => $template->arrayRender($build['monitoring'])]; 1677 1825 $response['content'][] = ['selector' => '#scanning', 'content' => $template->arrayRender($build['scanning'])]; 1678 1679 break; 1680 } 1681 1826 1827 break; 1828 } 1829 1682 1830 $response['success'] = true; 1683 1831 $response['notifications'] = self::notifications(); 1684 1832 wp_send_json($response); 1685 1833 } 1686 1687 1834 1835 1688 1836 public static function authenticate() { 1689 1837 1690 1838 if (WebTotemRequest::post('ajax_action') !== 'authenticate') { 1691 1839 return; 1692 1840 } 1693 1841 1694 1842 $credentials = array( 1695 1843 'log' => 'pwd', … … 1711 1859 $response['error'] = wp_kses(sprintf(__('<strong>ERROR</strong>: A username and password must be provided. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), wp_lostpassword_url()), array('strong'=>array(), 'a'=>array('href'=>array(), 'title'=>array()))); 1712 1860 } 1713 1861 1714 1862 do_action_ref_array('wp_authenticate', array(&$username, &$password)); 1715 1863 1716 1864 $user = wp_authenticate($username, $password); 1717 1865 $user = WebTotemBFProtection::checkBruteForceAttempts($user, $username); 1718 1866 1719 1867 if (is_object($user) && ($user instanceof \WP_User)) { 1720 1868 1721 1869 $response['login'] = true; 1722 1870 1723 1871 if(WebTotemLogin::hasUser2faActivated($user)){ 1724 1872 1725 1873 $template = new WebTotemTemplate(); 1726 1874 1727 1875 $response['2fa'] = true; 1728 1876 $response['content'] = $template->getHtml( 'login_auth_form' ); 1729 1877 1730 1878 } 1731 1879 } else if (is_wp_error($user)) { … … 1741 1889 } 1742 1890 } 1743 1891 1744 1892 if (!empty($errors)) { 1745 1893 $errors = implode('<br>', $errors); 1746 1894 $response['error'] = apply_filters('login_errors', $errors); 1747 1895 } 1748 1749 } 1750 1896 1897 } 1898 1751 1899 wp_send_json($response); 1752 1900 } 1753 1901 1754 1902 /** 1755 1903 * Notification output. … … 1758 1906 */ 1759 1907 public static function notifications() { 1760 1908 1761 1909 $notifications = WebTotem::getNotifications(); 1762 1910 1763 1911 if($notifications){ 1764 1912 $build[] = [ … … 1766 1914 'notifications' => $notifications, 1767 1915 ], 1768 1916 1769 1917 'template' => 'notifications', 1770 1918 ]; 1771 1919 1772 1920 $template = new WebTotemTemplate(); 1773 1921 return $template->arrayRender($build); 1774 1922 } 1775 1923 return false; 1776 1777 } 1778 1779 1924 1925 } 1926 1927 1780 1928 } -
wt-security/trunk/lib/Cache.php
r2797028 r2837032 67 67 } 68 68 69 /** 70 * Delete data from cache. 71 * 72 * @param string $key 73 * Data key. 74 * @param string $host_id 75 * The data belongs to this host. 76 * 77 * @return bool 78 */ 79 public static function deleteData($key, $host_id) { 80 81 $cache = json_decode(WebTotemOption::getOption('cache'), true) ?: []; 82 83 unset($cache[$host_id][$key]); 84 WebTotemOption::setOptions(['cache' => $cache]); 85 86 return TRUE; 87 88 } 89 69 90 } -
wt-security/trunk/lib/DB.php
r2797028 r2837032 15 15 const WTOTEM_TABLE_SETTINGS = 'wtotem_settings'; 16 16 const WTOTEM_TABLE_BLOCKED_LIST = 'wtotem_blocked_list'; 17 const WTOTEM_TABLE_AUDIT_LOGS = 'wtotem_audit_logs'; 18 const WTOTEM_TABLE_SCAN_LOGS = 'wtotem_scan_logs'; 17 19 18 20 /** … … 45 47 reason tinytext, 46 48 blockedTime tinytext, 49 UNIQUE KEY id (id) 50 );"; 51 52 dbDelta($sql); 53 } 54 55 $audit_logs_table = self::add_prefix(self::WTOTEM_TABLE_AUDIT_LOGS); 56 if($wpdb->get_var("show tables like '$audit_logs_table'") != $audit_logs_table) { 57 58 $sql = "CREATE TABLE " . $audit_logs_table . " ( 59 id mediumint(9) NOT NULL AUTO_INCREMENT, 60 created_at DATETIME NOT NULL, 61 user_name tinytext, 62 status tinytext, 63 event tinytext, 64 title tinytext, 65 description text, 66 ip tinytext, 67 viewed tinytext, 68 UNIQUE KEY id (id) 69 );"; 70 71 dbDelta($sql); 72 } 73 74 $scan_logs_table = self::add_prefix(self::WTOTEM_TABLE_SCAN_LOGS); 75 if($wpdb->get_var("show tables like '$scan_logs_table'") != $scan_logs_table) { 76 77 $sql = "CREATE TABLE " . $scan_logs_table . " ( 78 id mediumint(9) NOT NULL AUTO_INCREMENT, 79 created_at DATETIME NOT NULL, 80 scan_source tinytext, 81 data_type tinytext, 82 source tinytext, 83 content text, 47 84 UNIQUE KEY id (id) 48 85 );"; … … 90 127 global $wpdb; 91 128 $table_name = self::getTable($table); 92 93 foreach ($options as $key => $value){ 94 $where[] = $key . " = '" . $value . "'"; 95 } 96 $where = implode(' AND ', $where); 97 98 $options = $wpdb->get_row( "SELECT * FROM $table_name WHERE $where" ); 99 100 return (array) $options ?: []; 101 } 129 $where = ''; 130 131 if($options){ 132 $where = []; 133 foreach ($options as $key => $value){ 134 $where[] = $key . " = '" . $value . "'"; 135 } 136 $where = 'WHERE ' . implode(' AND ', $where); 137 } 138 139 $_options = []; 140 if($wpdb->get_var("show tables like '$table_name'") == $table_name) { 141 $_options = $wpdb->get_row("SELECT * FROM $table_name $where"); 142 } 143 144 return (array) $_options ?: []; 145 } 146 147 /** 148 * Check availability. 149 */ 150 public static function checkAvailability ($table, $values, $field) { 151 global $wpdb; 152 $table_name = self::getTable($table); 153 $result = []; 154 155 if($wpdb->get_var("show tables like '$table_name'") == $table_name) { 156 foreach ($values as $value){ 157 $is_exists = $wpdb->get_row( "SELECT COUNT(*) as count FROM $table_name WHERE $field = '$value'" ); 158 if($is_exists->count){ 159 $result[$value] = __($value, 'wtotem'); 160 } 161 } 162 } 163 return $result; 164 } 165 166 /** 167 * Getting rows from the table. 168 * 169 * @param array $options 170 * Option name. 171 * 172 * @return array 173 */ 174 public static function getRows ($options, $table, $group_by = false, $pagination = ['limit' => 10, 'page' => 1], $sort = ['order_by' => 'id', 'direction' => 'DESC']) { 175 global $wpdb; 176 $table_name = self::getTable($table); 177 178 if($wpdb->get_var("show tables like '$table_name'") != $table_name) { 179 WebTotemDB::install(); 180 } 181 182 if($wpdb->get_var("show tables like '$table_name'") == $table_name) { 183 $where = ''; 184 if($options){ 185 if($options[0] == 'AND' or $options[0] == 'OR'){ 186 $where = []; 187 foreach ($options[1] as $key => $value){ 188 if(is_array($value)){ 189 foreach ($value as $val){ 190 $where[] = $key . " = '" . $val . "'"; 191 } 192 } else { 193 $where[] = $key . " = '" . $value . "'"; 194 } 195 } 196 $where = 'WHERE ' . implode(' '.$options[0].' ', $where); 197 } 198 if($options[0] == 'LIKE'){ 199 $where = []; 200 foreach ($options[1] as $key => $value){ 201 $where[] = $key . " LIKE '" . $value . "'"; 202 } 203 $where = 'WHERE ' . implode(' OR ', $where); 204 } 205 } 206 207 $_pagination = $pagination == 'all' ? '' : 'LIMIT '. $pagination['limit'] .' OFFSET ' . $pagination['limit'] * ($pagination['page'] - 1); 208 $_sort = 'ORDER BY `' . $sort['order_by'] . '` ' . $sort['direction']; 209 210 $_group_by = $group_by ? 'GROUP BY ' . $group_by : ''; 211 212 $result['data'] = WebTotem::convertObjectToArray( $wpdb->get_results( "SELECT * FROM $table_name $where $_group_by $_sort $_pagination" ) ); 213 214 if($pagination != 'all'){ 215 if($group_by){ 216 $count = $wpdb->get_results( "SELECT COUNT(DISTINCT $group_by) as count FROM $table_name $where" ); 217 } else { 218 $count = $wpdb->get_results( "SELECT COUNT(*) as count FROM $table_name $where" ); 219 } 220 } 221 222 $result['count'] = !empty($count) ? $count[0]->count : 0; 223 224 if($table == 'audit_logs'){ 225 226 // Set viewed mark. 227 $ids = implode(",", array_column($result['data'], 'id')); 228 if( $ids ) $wpdb->query( "UPDATE $table_name SET viewed = 1 WHERE id in ($ids)" ); 229 230 // Get dates count 231 $created_at = array_column($result['data'], 'created_at'); 232 $dates = []; 233 foreach ($created_at as $value){ 234 $dates[] = date_i18n('Y-m-d', strtotime($value)); 235 } 236 $dates = array_unique($dates); 237 foreach ($dates as $date){ 238 $count = $wpdb->get_results( "SELECT COUNT(*) as count FROM $table_name WHERE created_at BETWEEN '$date 00:00:00' AND '$date 23:59:59'" ); 239 $dates_count[date_i18n('M j, Y', strtotime($date))] = $count[0]->count; 240 } 241 $result['dates_count'] = $dates_count ?? []; 242 } 243 } 244 return $result ?? ['data' => [], 'count' => 0]; 245 } 102 246 103 247 /** … … 105 249 */ 106 250 public static function uninstall() { 107 $tables = [ self::WTOTEM_TABLE_SETTINGS, self::WTOTEM_TABLE_BLOCKED_LIST ]; 251 $tables = [ 252 self::WTOTEM_TABLE_SETTINGS, 253 self::WTOTEM_TABLE_BLOCKED_LIST, 254 self::WTOTEM_TABLE_AUDIT_LOGS, 255 self::WTOTEM_TABLE_SCAN_LOGS, 256 ]; 108 257 foreach ($tables as $table) { 109 258 global $wpdb; … … 121 270 public static function add_prefix($table) { 122 271 global $wpdb; 123 return $wpdb-> prefix . $table;272 return $wpdb->base_prefix . $table; 124 273 } 125 274 … … 133 282 case 'blocked_list': 134 283 return self::add_prefix(self::WTOTEM_TABLE_BLOCKED_LIST); 284 case 'audit_logs': 285 return self::add_prefix(self::WTOTEM_TABLE_AUDIT_LOGS); 286 case 'scan_logs': 287 return self::add_prefix(self::WTOTEM_TABLE_SCAN_LOGS); 135 288 } 136 289 -
wt-security/trunk/lib/Helper.php
r2797028 r2837032 79 79 80 80 /** 81 * Returns the md5 hash representing the content of a file.81 * Returns full path to image. 82 82 * 83 83 * @param string $image 84 84 * Relative path to the file. 85 85 * @return string 86 * Seven first characters in the hash of the file.86 * Full path to image. 87 87 */ 88 88 public static function getImagePath($image) { 89 89 return WEBTOTEM_URL. '/includes/img/' . $image; 90 90 } 91 92 /** 93 * Convert object to array. 94 * 95 * @param array $data 96 * Array. 97 * @return array 98 * Returns array. 99 */ 100 public static function convertObjectToArray($data) { 101 102 if(!is_array($data)) $data = (array)$data; 103 array_walk_recursive($data, function(&$item){ 104 if(is_object($item)) $item = (array)$item; 105 }); 106 107 return $data; 108 } 91 109 92 110 /** … … 1187 1205 * @param array $map 1188 1206 * Map logs from WebTotem. 1189 * @param int $count_attacks1190 * Total attacks.1191 1207 * 1192 1208 * @return array … … 1208 1224 return ['percent' => 0, 'country' => FALSE, 'offset' => 0]; 1209 1225 } 1226 1227 /** 1228 * Get data on the three most attacking countries. 1229 * 1230 * @param array $map 1231 * Map logs from WebTotem. 1232 * 1233 * @return array 1234 * Returns array of data. 1235 */ 1236 public static function getTreeMostAttacksData($map) { 1237 $total_attacks = array_sum(array_column($map, 'attacks')); 1238 1239 if ($map) { 1240 array_multisort (array_column($map, 'attacks'), SORT_DESC, $map); 1241 $data = array_slice($map, 0, 3); 1242 1243 foreach ($data as $key => $value){ 1244 $data[$key]['percent'] = round($value['attacks'] / $total_attacks * 100); 1245 $data[$key]['country'] = self::getCountryName($value['country']); 1246 } 1247 1248 return $data; 1249 } 1250 1251 return []; 1252 } 1210 1253 1211 1254 /** … … 1333 1376 1334 1377 /** 1335 * Encodes the less than, greater than, ampersand,double quote 1336 * and single quote characters. Will never double encode entities. 1337 * 1338 * @see https://developer.wordpress.org/reference/functions/esc_attr/ 1339 * 1340 * @param string $text 1341 * The text which is to be encoded. 1342 * 1343 * @return string 1344 * The encoded text with HTML entities. 1345 */ 1346 public static function escape($text = '') 1347 { 1348 return esc_attr($text); 1349 } 1378 * Encodes the less than, greater than, ampersand,double quote 1379 * and single quote characters. Will never double encode entities. 1380 * 1381 * @see https://developer.wordpress.org/reference/functions/esc_attr/ 1382 * 1383 * @param string $text 1384 * The text which is to be encoded. 1385 * 1386 * @return string 1387 * The encoded text with HTML entities. 1388 */ 1389 public static function escape($text = '') { 1390 return esc_attr($text); 1391 } 1392 1393 /** 1394 * Throw generic exception. 1395 * 1396 * @throws Exception 1397 * 1398 * @param string $message 1399 * Error or information message. 1400 * @param string $type 1401 * Either info or error. 1402 * 1403 * @return bool 1404 * False all the time, used for debug. 1405 */ 1406 public static function throwException($message, $type = 'error') { 1407 if (defined('WTOTEM_THROW_EXCEPTIONS') && WTOTEM_THROW_EXCEPTIONS === true && is_string($message) ) { 1408 $message = str_replace( '<strong>WebTotem:</strong>', ($type === 'error' ? __('Error:', 'wtotem') : __('Info:', 'wtotem')), $message ); 1409 throw new Exception($message, $type === 'error' ? 157 : 333); 1410 } 1411 return false; 1412 } 1413 1414 /** 1415 * Get audit logs data 1416 * 1417 * @return array 1418 */ 1419 public static function getAuditLogs($data, $dates_count) { 1420 $logs = []; 1421 foreach ($data as $datum){ 1422 $date_time = strtotime($datum['created_at']); 1423 $date = date_i18n('M j, Y', $date_time); 1424 1425 $logs[$date]['date'] = $date; 1426 $logs[$date]['count'] = $dates_count[$date]; 1427 $logs[$date]['logs'][] = [ 1428 'time' => date_i18n('H:i', $date_time), 1429 'user_name' => $datum['user_name'], 1430 'status' => $datum['status'], 1431 'title' => $datum['title'], 1432 'event' => $datum['event'], 1433 'description' => $datum['description'], 1434 'ip' => $datum['ip'], 1435 'viewed' => (int) !$datum['viewed'] 1436 ]; 1437 } 1438 return $logs; 1439 } 1440 1441 /** 1442 * Building navigation and forming a template 1443 * 1444 * @param integer $limit 1445 * number of entries per 1 page 1446 * @param integer $count_all 1447 * total number of all entries 1448 * @param integer $currentPage 1449 * the number of the page being viewed 1450 * @param integer $nextPrev 1451 * Show the "Forward" and "Back" buttons 1452 * @return mixed 1453 * Generated navigation template ready for output 1454 */ 1455 public static function paginationBuild($limit, $count_all, $currentPage = 1, $nextPrev = true) { 1456 if( $limit < 1 OR $count_all <= $limit ) return ''; 1457 $count_pages = ceil( $count_all / $limit ); 1458 1459 $spread = 3; 1460 $separator = "<i>...</i>"; 1461 $wrap = "<div class=\"wtotem_pagination\">{pages}</div>"; 1462 1463 $nextTitle = '←'; 1464 $prevTitle = '→'; 1465 1466 $currentPage = intval( $currentPage ); 1467 if( $currentPage < 1 ) $currentPage = 1; 1468 1469 $shift_start = max( $currentPage - $spread, 2 ); 1470 $shift_end = min( $currentPage + $spread, $count_pages-1 ); 1471 if( $shift_end < $spread * 2 ) { 1472 $shift_end = min( $spread * 2, $count_pages-1 ); 1473 } 1474 if( $shift_end == $count_pages - 1 AND $shift_start > 3 ) { 1475 $shift_start = max( 3, min( $count_pages - $spread * 2 + 1, $shift_start ) ); 1476 } 1477 1478 $list = self::getPaginationItem( 1, $currentPage ); 1479 1480 if ($shift_start == 3) { 1481 $list .= self::getPaginationItem( 2, $currentPage ); 1482 } elseif ( $shift_start > 3 ) { 1483 $list .= $separator; 1484 } 1485 1486 for( $i = $shift_start; $i <= $shift_end; $i++ ) { 1487 $list .= self::getPaginationItem( $i, $currentPage ); 1488 } 1489 1490 $last_page = $count_pages - 1; 1491 if( $shift_end == $last_page-1 ){ 1492 $list .= self::getPaginationItem( $last_page, $currentPage ); 1493 } elseif( $shift_end < $last_page ) { 1494 $list .= $separator; 1495 } 1496 1497 $list .= self::getPaginationItem( $count_pages, $currentPage ); 1498 1499 if( $nextPrev ) { 1500 $list = self::getPaginationItem( 1501 $currentPage > 1 ? $currentPage - 1 : 0, 1502 $currentPage, 1503 $nextTitle, 1504 true ) 1505 . $list 1506 . self::getPaginationItem( 1507 $currentPage < $count_pages ? $currentPage + 1 : 0, 1508 $currentPage, 1509 $prevTitle, 1510 true 1511 ); 1512 } 1513 1514 return str_replace( "{pages}", $list, $wrap ); 1515 } 1516 1517 /** 1518 * Button/Link Formation 1519 * @param int $page_num 1520 * page number 1521 * @param string $currentPage 1522 * current page 1523 * @param string $page_name 1524 * if specified, the text will be displayed instead of the page number 1525 * @return string 1526 * span block with active page or link. 1527 */ 1528 public static function getPaginationItem( $page_num, $currentPage, $page_name = '' ) { 1529 if($page_num === 0){return '';} 1530 $page_name = $page_name ?: $page_num; 1531 1532 if( $currentPage == $page_num ) { 1533 return "<span class=\"wtotem_pagination__number wtotem_pagination__number_active\">{$page_name}</span>"; 1534 } else { 1535 return "<a href=\"#\" data-page=\"{$page_num}\" class=\"wtotem_pagination__number\">{$page_name}</a>"; 1536 } 1537 } 1350 1538 1351 1539 /** -
wt-security/trunk/lib/Interface.php
r2797028 r2837032 288 288 */ 289 289 public static function enqueueScripts() { 290 290 291 // Adding CSS files. 291 292 wp_register_style( … … 348 349 true 349 350 ); 351 wp_set_script_translations( 'wtotem_flatpickr_js', 'wtotem', WEBTOTEM_PLUGIN_PATH . '/lang/'); 350 352 wp_enqueue_script('wtotem_flatpickr_js'); 351 wp_set_script_translations( 'wtotem_flatpickr_js', 'wtotem' );352 353 353 354 wp_register_script( … … 387 388 wp_enqueue_script('wtotem_toastr'); 388 389 390 $_page = WebTotemRequest::get('page'); 391 if($_page === 'wtotem_settings'){ 392 wp_register_script( 393 'wtotem_country_blocking', 394 WEBTOTEM_URL . '/includes/js/country-blocking.js', 395 ['wp-i18n'], 396 WebTotem::fileVersion('includes/js/country-blocking.js'), 397 true 398 ); 399 wp_set_script_translations( 'wtotem_country_blocking', 'wtotem' , WEBTOTEM_PLUGIN_PATH . '/lang/'); 400 wp_enqueue_script('wtotem_country_blocking'); 401 } 402 389 403 wp_register_script( 390 404 'wtotem_main', … … 396 410 wp_enqueue_script('wtotem_main'); 397 411 } 398 399 400 412 } -
wt-security/trunk/lib/Option.php
r2797028 r2837032 636 636 return $matches[1] . '=' . ($wp_version === $matches[2] ? wp_hash($matches[2]) : $matches[2]) . $matches[3]; 637 637 } 638 639 /** 640 * Check the nonce comming from any of the settings pages. 641 * 642 * @return bool True if the nonce is valid, false otherwise. 643 */ 644 public static function checkOptionsNonce() { 645 // Create the option_page value if permalink submission. 646 if (!isset($_POST['option_page']) && isset($_POST['permalink_structure'])) { 647 $_POST['option_page'] = 'permalink'; 648 } 649 650 /* check if the option_page has an allowed value */ 651 $option_page = WebTotemRequest::post('option_page'); 652 653 if (!$option_page) { 654 return false; 655 } 656 657 $action = ''; 658 $nonce = '_wpnonce'; 659 660 switch ($option_page) { 661 case 'general': 662 case 'writing': 663 case 'reading': 664 case 'discussion': 665 case 'media': 666 case 'options': 667 $action = $option_page . '-options'; 668 break; 669 case 'permalink': 670 $action = 'update-permalink'; 671 break; 672 } 673 674 /* check the nonce validity */ 675 return (bool) ( 676 !empty($action) 677 && isset($_REQUEST[$nonce]) 678 && wp_verify_nonce($_REQUEST[$nonce], $action) 679 ); 680 } 681 682 /** 683 * Retrieve all the options stored by Wordpress in the database. 684 * 685 * @return array All the options stored by Wordpress in the database. 686 */ 687 private static function getSiteOptions() { 688 $settings = array(); 689 690 if (array_key_exists('wpdb', $GLOBALS)) { 691 $results = $GLOBALS['wpdb']->get_results( 692 'SELECT * FROM ' . $GLOBALS['wpdb']->options . ' WHERE option_name NOT LIKE "%_transient_%" ORDER BY option_id ASC' 693 ); 694 695 foreach ($results as $row) { 696 $settings[$row->option_name] = $row->option_value; 697 } 698 } 699 700 return $settings; 701 } 702 703 /** 704 * Check what Wordpress options were changed comparing the values in the database 705 * with the values sent through a simple request using a GET or POST method. 706 * 707 * @param array $request The content of the global variable GET or POST considering SERVER[REQUEST_METHOD]. 708 * @return array A list of all the options that were changes through this request. 709 */ 710 public static function whatOptionsWereChanged($request = array()) 711 { 712 $options_changed = [ 'original' => [], 'changed' => [] ]; 713 714 $site_options = self::getSiteOptions(); 715 716 foreach ($request as $req_name => $req_value) { 717 if (array_key_exists($req_name, $site_options) && $site_options[ $req_name ] != $req_value ) { 718 $options_changed['original'][ $req_name ] = $site_options[ $req_name ]; 719 $options_changed['changed'][ $req_name ] = $req_value; 720 } 721 } 722 723 return $options_changed; 724 } 725 726 638 727 } -
wt-security/trunk/readme.txt
r2818705 r2837032 71 71 72 72 == Changelog == 73 = 2.4.17 = 74 * Added the setting blocking countries 75 * Added WP scan page: Log of user actions. Logs on found links, scripts and iframes 76 73 77 = 2.4.16 = 74 * Added pop-up notification 78 * Added pop-up notification 75 79 * Added 2FA to all users 76 80 * Fixed an error saving settings without installed agents -
wt-security/trunk/src/Common.php
r2797028 r2837032 19 19 20 20 /** Execute pre-checks before every page */ 21 add_action('init', 'WebTotemInterface::startupChecks'); //wp_loaded21 add_action('init', 'WebTotemInterface::startupChecks'); 22 22 23 23 /** Attach HTTP request handlers for the AJAX requests */ … … 61 61 62 62 /** */ 63 add_action( 'wp', 'webtotem_add_cron' ); 64 add_action( 'webtotem_daily_cron', 'dailyCron' ); 65 66 function webtotem_add_cron() { 63 add_action( 'wp', 'webtotem_add_cron_' ); 64 function webtotem_add_cron_() { 67 65 if( ! wp_next_scheduled( 'webtotem_daily_cron' ) ) { 68 66 wp_schedule_event( time(), 'daily', 'webtotem_daily_cron' ); 69 67 } 70 68 } 69 70 add_action( 'webtotem_daily_cron', 'WtotemDailyCron' ); 71 72 function WtotemDailyCron(){ 73 WebTotemScan::scanDB(); 74 WebTotemScan::scanFiles(); 75 } 71 76 72 77 /** … … 88 93 } 89 94 $pages['wtotem_reports'] = [ 'title' => __('Reports', 'wtotem'), 'slug' => $slug]; 90 $pages['wtotem_documentation'] = [ 'title' => __('Documentation', 'wtotem'), 'slug' => 'wtotem']; 95 $pages['wtotem_documentation'] = [ 'title' => __('Documentation', 'wtotem'), 'slug' => 'wtotem']; 96 $pages['wtotem_wpscan'] = [ 'title' => __('WP scan', 'wtotem'), 'slug' => 'wtotem']; 91 97 92 return $pages;98 return $pages; 93 99 } 94 100 … … 142 148 } 143 149 add_action('admin_menu', 'wtotemAddMenu'); 144 145 146 150 } 147 151 152 /** 153 * Event hooks. 154 * 155 */ 156 if (class_exists('WebTotemEventListener')) { 157 add_action('add_user_to_blog', 'WebTotemEventListener::hookAddUserToBlog', 50, 4); 158 add_action('remove_user_from_blog', 'WebTotemEventListener::hookRemoveUserFromBlog', 50, 2); 159 add_action('login_form_resetpass', 'WebTotemEventListener::hookLoginFormResetpass', 50, 5); 160 add_action('profile_update', 'WebTotemEventListener::hookProfileUpdate', 50, 5); 161 add_action('retrieve_password', 'WebTotemEventListener::hookRetrievePassword', 50, 5); 162 add_action('user_register', 'WebTotemEventListener::hookUserRegister', 50, 5); 163 add_action('deleted_user', 'WebTotemEventListener::hookUserDelete', 50, 3); 164 add_action('wp_login', 'WebTotemEventListener::hookLoginSuccess', 50, 5); 165 add_action('wp_login_failed', 'WebTotemEventListener::hookLoginFailure', 50, 5); 166 add_action('add_link', 'WebTotemEventListener::hookLinkAdd', 50, 5); 167 add_action('edit_link', 'WebTotemEventListener::hookLinkEdit', 50, 5); 168 add_action('create_category', 'WebTotemEventListener::hookCategoryCreate', 50, 5); 169 add_action('publish_post', 'WebTotemEventListener::hookPublishPost', 50, 5); 170 add_action('transition_post_status', 'WebTotemEventListener::hookPostStatus', 50, 3); 171 add_action('xmlrpc_publish_post', 'WebTotemEventListener::hookPublishPostXMLRPC', 50, 5); 172 add_action('before_delete_post', 'WebTotemEventListener::hookPostBeforeDelete', 50, 5); 173 add_action('delete_post', 'WebTotemEventListener::hookPostDelete', 50, 5); 174 add_action('wp_trash_post', 'WebTotemEventListener::hookPostTrash', 50, 5); 175 add_action('publish_page', 'WebTotemEventListener::hookPublishPage', 50, 5); 176 add_action('add_attachment', 'WebTotemEventListener::hookAttachmentAdd', 50, 5); 177 add_action('activated_plugin', 'WebTotemEventListener::hookPluginActivate', 50, 2); 178 add_action('deactivated_plugin', 'WebTotemEventListener::hookPluginDeactivate', 50, 2); 179 add_action('switch_theme', 'WebTotemEventListener::hookThemeSwitch', 50, 5); 180 181 add_action('admin_init', 'WebTotemEventListener::hookCoreUpdate'); 182 add_action('admin_init', 'WebTotemEventListener::hookOptionsManagement'); 183 add_action('admin_init', 'WebTotemEventListener::hookPluginDelete'); 184 add_action('admin_init', 'WebTotemEventListener::hookPluginEditor'); 185 add_action('admin_init', 'WebTotemEventListener::hookPluginInstall'); 186 add_action('admin_init', 'WebTotemEventListener::hookPluginUpdate'); 187 add_action('admin_init', 'WebTotemEventListener::hookThemeDelete'); 188 add_action('admin_init', 'WebTotemEventListener::hookThemeEditor'); 189 add_action('admin_init', 'WebTotemEventListener::hookThemeInstall'); 190 add_action('admin_init', 'WebTotemEventListener::hookThemeUpdate'); 191 add_action('admin_init', 'WebTotemEventListener::hookWidgetAdd'); 192 add_action('admin_init', 'WebTotemEventListener::hookWidgetDelete'); 193 194 } 195 148 196 } -
wt-security/trunk/src/PageHandler.php
r2797028 r2837032 19 19 function wtotem_ajax_callback() { 20 20 21 $composer_autoload = WEBTOTEM_PLUGIN_PATH . '/vendor/autoload.php'; 22 if ( file_exists( $composer_autoload ) ) { 23 require_once $composer_autoload; 24 } 25 21 26 if (WebTotemRequest::post('ajax_action') != NULL) { 22 27 WebTotemAjax::authenticate(); … … 25 30 if (WebTotemRequest::post('ajax_action') != NULL && WebTotemInterface::checkNonce()) { 26 31 27 $composer_autoload = WEBTOTEM_PLUGIN_PATH . '/vendor/autoload.php';28 if ( file_exists( $composer_autoload ) ) {29 require_once $composer_autoload;30 }31 32 32 WebTotemAjax::activation(); 33 33 WebTotemAjax::agentsInstallation(); 34 34 WebTotemAjax::reinstallAgents(); 35 WebTotemAjax::chart(); 35 WebTotemAjax::chart(); 36 WebTotemAjax::logs(); 36 37 WebTotemAjax::wafDateFilter(); 37 38 WebTotemAjax::ignorePorts(); … … 702 703 } 703 704 705 if($cacheData = WebTotemCache::getdata('getBlockedCountries', $host['id'])){ 706 $waf_data = $cacheData['data']; 707 } else { 708 $waf_data = WebTotemAPI::getBlockedCountries($host['id']); 709 WebTotemCache::setData(['getBlockedCountries' => $waf_data], $host['id']); 710 } 711 704 712 if (empty($configs_data) or 705 713 empty($agents_statuses) or … … 726 734 ]; 727 735 } 736 728 737 729 738 // Settings form. … … 738 747 'waf_settings' => WebTotem::getWafSettingData($ip_list['settings']), 739 748 'plugin_settings' => WebTotem::getPluginSettingsData(), 740 'two_factor' => WebTotemLogin::getTwoFactorData(), 749 'two_factor' => WebTotemLogin::getTwoFactorData(), 750 'blocked_countries_list' => json_encode($waf_data['blockedCountries']), 751 'mock_attacks' => json_encode(WebTotem::getTreeMostAttacksData($waf_data['map'])), 741 752 ], 742 753 … … 747 758 echo $template->baseTemplate($page_content); 748 759 } 749 750 760 751 761 /** … … 817 827 $page_content = $template->arrayRender($build); 818 828 echo $template->baseTemplate($page_content); 819 820 } 829 } 830 831 /** 832 * Scan WP page. 833 * 834 * @return void 835 */ 836 function wtotem_wpscan_page() { 837 $template = new WebTotemTemplate(); 838 $audit_logs = WebTotemDB::getRows([],'audit_logs'); 839 $links = WebTotemDB::getRows(['AND', ['data_type' => 'links']],'scan_logs', 'content'); 840 $scripts = WebTotemDB::getRows(['AND', ['data_type' => 'scripts']],'scan_logs', 'content'); 841 $iframes = WebTotemDB::getRows(['AND', ['data_type' => 'iframes']],'scan_logs', 'content'); 842 843 $events = [ 844 'User authentication succeeded', 845 'User authentication failed', 846 'User account created', 847 'User account deleted', 848 'User account edited', 849 'Attempt to reset password', 850 'Password retrieval attempt', 851 'User added to website', 852 'User removed from website', 853 'WordPress updated', 854 855 'User account deleted', 856 'Bookmark link added', 857 'Bookmark link edited', 858 'Category created', 859 'Publication was published', 860 'Publication was updated', 861 'Post status has been changed', 862 'Post deleted', 863 'Post moved to trash', 864 'Media file added', 865 'Plugin activated', 866 'Plugin deactivated', 867 'Theme activated', 868 'Settings changed', 869 'Plugins deleted', 870 'Plugin editor used', 871 'Plugin installed', 872 'Plugins updated', 873 'Theme deleted', 874 'Theme editor used', 875 'Theme installed', 876 'Themes updated', 877 'Widget deleted', 878 'Widget added', 879 ]; 880 881 // Scan logs block. 882 $build[] = [ 883 'variables' => [ 884 "audit_logs_count" => $audit_logs['count'], 885 "audit_logs" => WebTotem::getAuditLogs($audit_logs['data'], $audit_logs['dates_count']), 886 "audit_logs_pagination" => WebTotem::paginationBuild(10, $audit_logs['count']), 887 "audit_logs_events" => WebTotemDB::checkAvailability('audit_logs', $events, 'event'), 888 889 "links_count" => $links['count'], 890 "links" => $links['data'], 891 "links_pagination" => WebTotem::paginationBuild(10, $links['count']), 892 893 "scripts_count" => $scripts['count'], 894 "scripts" => $scripts['data'], 895 "scripts_pagination" => WebTotem::paginationBuild(10, $scripts['count']), 896 897 "iframes_count" => $iframes['count'], 898 "iframes" => $iframes['data'], 899 "iframes_pagination" => WebTotem::paginationBuild(10, $iframes['count']), 900 ], 901 'template' => 'scan_logs', 902 ]; 903 904 $page_content = $template->arrayRender($build); 905 echo $template->baseTemplate($page_content); 906 } 907 821 908 822 909 /** -
wt-security/trunk/src/Strings.php
r2797028 r2837032 279 279 __('Enter the code','wtotem'); 280 280 281 // country_blocking_modal.html.twig 282 __('save','wtotem'); 283 __('close','wtotem'); 284 __('Block countries','wtotem'); 285 __('Name of the country','wtotem'); 286 __('Select all countries','wtotem'); 287 __('Access blocked to','wtotem'); 288 __('countries','wtotem'); 289 __('Country blocking','wtotem'); 290 __('Block countries you want to limit access to your website.','wtotem'); 291 __('Attack from','wtotem'); 292 __('countries blocked from','wtotem'); 293 __('Select all','wtotem'); 294 281 295 // User profile 282 296 __('WebTotem two-factor protection','wtotem'); … … 293 307 __('All stats', 'wtotem'); 294 308 295 296 309 // multisite.html.twig 297 310 __('Try reinstalling the agents or changing the API key', 'wtotem'); 298 311 __('Data access error', 'wtotem'); 312 313 // scan_logs.html.twig 314 __('Logs', 'wtotem'); 315 __('Log of user actions. And logs on found links, scripts and iframes in published posts and in files of active plugins and the current theme of the site.', 'wtotem'); 316 __('Audit Logs', 'wtotem'); 317 __('Links', 'wtotem'); 318 __('Scripts', 'wtotem'); 319 __('iFrames', 'wtotem'); 320 __('Time', 'wtotem'); 321 __('User', 'wtotem'); 322 __('Event', 'wtotem'); 323 __('All', 'wtotem'); 324 __('User authentication succeeded', 'wtotem'); 325 __('User authentication failed', 'wtotem'); 326 __('User account created', 'wtotem'); 327 __('User account deleted', 'wtotem'); 328 __('User account edited', 'wtotem'); 329 __('Attempt to reset password', 'wtotem'); 330 __('Password retrieval attempt', 'wtotem'); 331 __('User added to website', 'wtotem'); 332 __('User removed from website', 'wtotem'); 333 __('WordPress updated', 'wtotem'); 334 __('User account deleted', 'wtotem'); 335 __('Bookmark link added', 'wtotem'); 336 __('Bookmark link edited', 'wtotem'); 337 __('Category created', 'wtotem'); 338 __('Publication was published', 'wtotem'); 339 __('Publication was updated', 'wtotem'); 340 __('Post status has been changed', 'wtotem'); 341 __('Post deleted', 'wtotem'); 342 __('Post moved to trash', 'wtotem'); 343 __('Media file added', 'wtotem'); 344 __('Plugin activated', 'wtotem'); 345 __('Plugin deactivated', 'wtotem'); 346 __('Theme activated', 'wtotem'); 347 __('Settings changed', 'wtotem'); 348 __('Plugins deleted', 'wtotem'); 349 __('Plugin editor used', 'wtotem'); 350 __('Plugin installed', 'wtotem'); 351 __('Plugins updated', 'wtotem'); 352 __('Theme deleted', 'wtotem'); 353 __('Theme editor used', 'wtotem'); 354 __('Theme installed', 'wtotem'); 355 __('Themes updated', 'wtotem'); 356 __('Widget deleted', 'wtotem'); 357 __('Widget added', 'wtotem'); -
wt-security/trunk/wt-security.php
r2797028 r2837032 7 7 * Text Domain: wtotem 8 8 * Domain Path: /lang 9 * Version: 2.4.1 69 * Version: 2.4.17 10 10 * 11 11 * PHP version 7.1 … … 54 54 * Current version of the plugin's code. 55 55 */ 56 define('WEBTOTEM_VERSION', '2.4.1 6');56 define('WEBTOTEM_VERSION', '2.4.17'); 57 57 58 58 /** … … 93 93 require_once 'lib/DB.php'; 94 94 require_once 'lib/Cache.php'; 95 require_once 'lib/login/Login.php'; 95 require_once 'lib/modules/login/Login.php'; 96 require_once 'lib/modules/logs/EventListener.php'; 97 require_once 'lib/modules/logs/Scan.php'; 96 98 require_once 'lib/Request.php'; 97 99 require_once 'lib/Interface.php';
Note: See TracChangeset
for help on using the changeset viewer.