����JFIF�����%%��� }!1AQa"q2���#B��R��$3br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz������������������������������������������������������������������������� w!1AQaq"2�B���� #3R�br� $4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|��O�������h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@��o�E��/�?��ߵE_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ ?�z�����������goڢ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?��=[�Qg�����o����Q@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y�����[����TP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,���|-��v��(���� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�������;~��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@�������?�_�����j������ (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@��o�E��/�?��ߵE_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ ?�z�����������goڢ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?��=[�Qg�����o����Q@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y�����[����TP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,���|-��v��(���� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�������;~��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@�������?�_�����j������ (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@��o�E��/�?��ߵE_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ ?�z�����������goڢ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?��=[�Qg�����o����Q@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y�����[����TP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,��������ο�O�P��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������k�w���~���v��������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j�?�5o�%��?��� g����U@�����&O3�����a�;�^=�wH���D��/��*� �fX�I���,������k?g_���?�5o�%��?��� g����U@�F�����������*������?�o�}��Τ~g��ʀ�#V��Y������~ο�T�j��K/� ������������z��������#;�~���A�;��� w�F�����������*���տ��_�@�o��5����EU������������u�誠��W��[�����������O��?jW���@��տ���@�o��5����EM������������v�訠�#V��Y�������������V��Zv��~����vw�~���c�Q@���,��~���kgo���?�5o�%��/��� o����Q@��o�%�>�ߤ���߳����S������?��o�%�~�ߠ�d�߳����S����g�P��j��K?� _������������[� g�D����[�;�TP7���������'Ѿ���=��;/�P��j��K?� _������������[� g�D����[�;�TP���,��~���kgo���a������۔���B{���ea�`T�+ �n%Ц �����j��K?� _������������[� g�D����[�;�TP���,��~���kgo����?���%�/�~�����#����x��c�~�q�v�t`ȫ��_'h���������'�]�;{s� Pp=N= 5���%�����ڜs�����=���J��A@�����Kp�b��}��X�����4g v+:�Բ�+60�ʩ,� @�����������I �uO�����ToUv��bgUl�cP�T?�#V��Y������������j��K?� _����������!��X��]���������TK�|4��`� ��#��P\y��aa >NgL��j��K?� _������������[� g�D����[�;�TP���,��~���kgo���o�F�����$��ہ�� ��vݞr6��S�q''*02���[� g�D����[�;�TP���,��~���kgo���?�5o�%��/��� o����Q@�F�����������*(��տ���@�o��5����EE������������v�訠��������~1�o���}G�L�������5o�%��/��� o����Q@�F�����������*(��տ���@�o��5����EE5����%�˷���r�v����y�\~���)(?0���=[� i����>��gc��N=����5o�%��/��� o����Q@�F�����������*(��W��Z�l����m#���X�wn_�j`0C6윅����5o�%��/��� o����Q@��տ��y9���gbO�G�5@�n�>���#V��Y������~ο�T��V��Y����9�gc��s�T.�?Z_��[� e�D����Y�:��UP���,������k?g_����_�=_� n�~~�rI������w�,"~ԓ�!72���)( u��#V��Y������~ο�T�j��K/� ��������������K
�����Kr_���}�De>~��Z=��pjX�n[p(�"� �a,Ub�/�×�<����;��<�����K>��o���[�:����V���,��$��ϧ�*�����5O����տ��_�@�o��5����EU5��o�%����?�ꜜm�_�;>Gbs�S�����@��տ��_�@�o��5����EU ��տ��}�~�����v?�������-��o�l��~�ȥ�v����r��B1���@��տ���A�?����ggP��c�S�`@%�*����տ��_�@�o��5����EU������������u�誠7���� O���!c�|0��ёv��4�+�X�Vx�RX3��8����K>��o���[�:���u#�x��#V��Y������~ο�T�j��K/� ������������[� e�D����Y�:��UP���,������k?g_���O��[� g�D����[�:��T��=_� k����~��k����c�;����.8����c��z��Ͽ�/��zc�o����F?Z_��[� e�D����Y�:��UP���,������k?g_���C���,�v����v�o���H������(�z���w�/�����v ��T.G��Ϡ���տ��_�@�o��5����EU������������u�誠��W��[��'����%��o���:�Cڕ�R̀���j���������?�o���[�;������g0q�?��o�%�>o�_��>�gf����~4�������������u�誠�z���7�/��o���������_��[� e�D����Y�:��UP���,������k?g_���C���,�|�����o��;�Ԟ��9�l�z��ؠ3|��O�X�~���;~�q����Z�F�����������*���տ��_�@�o��5����EU!��տ��}�~����-��G��I�T�������������u�誠�#V��Y������~ο�T�j��K/� ����������#�=_� n|���KbB�gtdM��"�ڒA#n�63�6�m�P�����,���/���gS�u����#�9��5o�%��?��� g����U@��o�%�o�_�����u��'�������?��o��� ���3��?go���|m�ڇ���-S�O��x��>���^�����7����x�]_�>�qke>���m��4��7P�Yހ��
0byt3m1n1
0byt3m1n1
Path:
/
hermes
/
bosweb
/
web
/
sb_web
/
web
/
sb_web
/
b2432
/
glovault.njhealey.com
/
[
Home
]
File: admin.php
<?php require_once ( 'includes/commons.inc.php' ); require_once ( 'includes/index.class.php' ); $tpl_admin = new Template ( 'templates/' . $UPL['SETTINGS']['tpl'] . '/tpl_admin.php' ); $tpl_admin->set ( 'current_user', $UPL['USER']['name'] ); if ( !$demo && $UPL['USER']['level'] == LEVEL_NORMAL ) { $tpl_message->set ( 'message', 'You do not have the permission to access this page.' ); $tpl_admin->setr ( 'content', $tpl_message ); $tpl_admin->display ( ); exit; } // multidimenional array search function find_index ( &$array, $index, $value ) { while ( list ( $k, $v ) = each ( $array ) ) { if ( $v[$index] == $value ) { return $k; } } return false; } // get stats of a directory function dir_stats ( $path, $result = array ( 'file_count' => 0, 'file_size' => 0, 'folder_count' => 0 ) ) { $h = @opendir ( $path ); if ( !$h ) return $result; while ( false !== ( $f = readdir ( $h ) ) ) { if ( $f != '.' && $f != '..' ) { if ( is_file ( $path . '/' . $f ) ) { $result['file_count']++; $result['file_size'] += filesize ( $path . '/' . $f ); } else { $result['folder_count']++; $result = dir_stats ( $path . '/' . $f, $result ); } } } closedir ( $h ); return $result; } // display permission message function display_message1 ( ) { global $tpl_admin, $tpl_message; $tpl_message->set ( 'message', 'Permission denied, you need to be an Admin.' ); $tpl_message->set ( 'back_url', 'admin.php' ); $tpl_admin->setr ( 'content', $tpl_message ); $tpl_admin->display ( ); exit; } function uksort_function ( $left, $right ) { return strtolower ( $left ) > strtolower ( $right ); } // wut doing? switch ( $action ) { case 'ann': { $tpl_ann = new Template ( TPL_DIR . 'tpl_announcements_admin.php' ); $tpl_ann->setr ( 'task', $task ); // read in old announcements $db = new DB; if ( !$db->open ( ANNOUNCEMENT_FILE ) ) { exit ( 'Unable to open announcement file ' . ANNOUNCEMENT_FILE ); } $ann = $db->all(); reset ( $ann ); $ann2 = array_reverse ( $ann ); for ( $i = 0; $i < count ( $ann2 ); $i++ ) { $ann2[$i]['view_url'] = 'admin.php?action=ann&task=view&id=' . $ann2[$i]['id']; $ann2[$i]['edit_url'] = 'admin.php?action=ann&task=add&id=' . $ann2[$i]['id']; $ann2[$i]['delete_url'] = 'admin.php?action=ann&task=delete&id=' . $ann2[$i]['id']; $ann2[$i]['moveup_url'] = 'admin.php?action=ann&task=move&direction=up&id=' . $ann2[$i]['id']; $ann2[$i]['movedown_url'] = 'admin.php?action=ann&task=move&direction=down&id=' . $ann2[$i]['id']; } $tpl_ann->setr ( 'ann', $ann2 ); // wut doing? switch ( $task ) { case 'move': { $direction = gpc ( 'direction', 'G', 'up' ); $id = gpc ( 'id', 'G', 0 ); $i = find_index ( $ann, 'id', $id ); if ( $id && $i !== false ) { if ( $direction == 'down' && $i > 0 ) { $temp = $ann[$i]; $ann[$i] = $ann[$i-1]; $ann[$i-1] = $temp; $db->set($ann,true); $db->save(); } elseif ( $direction == 'up' && $i < ( count ( $ann ) - 1 ) ) { $temp = $ann[$i]; $ann[$i] = $ann[$i+1]; $ann[$i+1] = $temp; $db->set($ann,true); $db->save(); } } header ( 'Location: admin.php?action=ann' ); } break; case 'delete': { if ( $demo ) exit ( "Demo only!" ); $id = gpc ( 'id', 'G', 0 ); $i = find_index ( $ann, 'id', $id ); if ( $id && $i !== false && isset ( $ann[$i] ) ) { unset ( $ann[$i] ); $ann = array_values ( $ann ); $db->set($ann,true); $db->save(); } header ( 'Location: admin.php?action=ann' ); } break; case 'add': { // might be edit $id = gpc ( 'id', 'G', 0 ); $i = find_index ( $ann, 'id', $id ); if ( $id && $i !== false ) { $ann[$i]['content'] = htmlentities ( $ann[$i]['content'] ); $ann[$i]['id'] = $id; $tpl_ann->setr ( 'edit_ann', $ann[$i] ); } else { $tpl_ann->set ( 'edit_ann', array ( 'title' => '', 'content' => '', 'id' => '', 'parse_bb' => true, ) ); } $tpl_admin->setr ( 'content', $tpl_ann ); $tpl_admin->display ( ); } break; case 'doadd': { if ( $demo ) exit ( 'Demo only!' ); $new_ann = isset ( $_POST['new_ann'] ) ? $_POST['new_ann'] : array ( ); $new_ann['parse_bb'] = isset ( $new_ann['parse_bb'] ) ? (bool)$new_ann['parse_bb'] : false; if ( count ( $new_ann ) ) { if ( $new_ann['title'] == '' || $new_ann['content'] == '' ) { $tpl_message->set ( 'message', 'Please fill out both the title and message fields.' ); $tpl_message->set ( 'back_url', 'javascript:history.go(-1);' ); $tpl_uploader->set ( 'content', $tpl_message ); exit ( $tpl_uploader->display ( ) ); } // if it's an edit, replace old announcement, otherwise just add it $i = find_index ( $ann, 'id', $new_ann['id'] ); if ( $i === false ) { // new ann $new_ann['time'] = time ( ); $new_ann['id'] = $new_ann['time']; // posted by... $new_ann['userid'] = $UPL['USER']['id']; $new_ann['username'] = $UPL['USER']['name']; // add it $ann [] = $new_ann; } else { // an edit $ann[$i]['parse_bb'] = isset ( $new_ann['parse_bb'] ) ? (bool)$new_ann['parse_bb'] : false; $ann[$i]['title'] = $new_ann['title']; $ann[$i]['content'] = $new_ann['content']; } $db->set($ann,true); $db->save(); } header ( 'Location: admin.php?action=ann' ); } case 'view': { $id = gpc ( 'id', 'G', 0 ); $k = find_index ( $ann, 'id', $id ); if ( $id && $k !== false ) { $cur_ann = $ann[$k]; $cur_ann['time'] = date ( $UPL['CONFIGS']['TIME_FORMAT'], $cur_ann['time'] ); $cur_ann['content'] = str_replace ( ' ', ' ', nl2br ( $cur_ann['content'] ) ); $tpl_ann->setr ( 'cur_ann', $cur_ann ); $tpl_admin->setr ( 'content', $tpl_ann ); $tpl_admin->display ( ); } } break; default: { $tpl_admin->setr ( 'content', $tpl_ann ); $tpl_admin->display ( ); } break; } } break; // uploader settings case 'settings': { if (!$demo && $UPL['USER']['level'] != LEVEL_ADMIN ) display_message1 ( ); if ( $task == 'save' ) { if ( $demo ) exit ( 'Demo only!' ); $psettings =& $_POST['settings']; $settings = array ( 'uploader_url' => trim ( $psettings['uploader_url'] ), 'userfiles_dir' => trim ( $psettings['userfiles_dir'] ), 'userfiles_url' => trim ( $psettings['userfiles_url'] ), 'reg' => isset ( $psettings['reg'] ) ? (bool)$psettings['reg'] : false, 'approval' => isset ( $psettings['approval'] ) ? (bool)$psettings['approval'] : false, 'activation_req'=> isset ( $psettings['activation_req'] ) ? (bool)$psettings['activation_req'] : false, 'browsing' => trim ( $psettings['browsing'] ), 'filetypes' => strtolower ( trim ( $psettings['filetypes'], ', ' ) ), 'email' => trim ( $psettings['email'] ), 'notify_reg' => (bool)@$psettings['notify_reg'], 'log' => (int)$psettings['log'], 'tpl' => trim ( $psettings['tpl'] ), 'wm' => trim ( $psettings['wm'] ), 'wm_path' => trim ( $psettings['wm_path'] ), ); // save $db = new DB; if ( !$db->open ( UPLOADER_SETTINGS ) ) { exit ( 'Unable to open settings file ' . UPLOADER_SETTINGS ); } $db->set ( $settings, true ); $db->save ( ); header ( 'Location: admin.php?action=settings&saved' ); } else { $db = new DB; if ( !$db->open ( UPLOADER_SETTINGS ) ) { exit ( 'Unable to open settings file ' . UPLOADER_SETTINGS ); } $settings = $db->all ( ); $tpl_settings = new Template ( TPL_DIR . 'tpl_settings.php' ); $tpl_settings->set ( 'action', $action ); $tpl_settings->setr ( 'settings', $settings ); $tpl_settings->set ( 'uploader_absolute_path', dir_name ( __FILE__ ) ); $tpl_admin->set ( 'page_title', 'Glovault Settings' ); $tpl_admin->setr ( 'content', $tpl_settings ); $tpl_admin->display ( ); } } break; // user settings case 'user_settings': { if (!$demo && $UPL['USER']['level'] != LEVEL_ADMIN ) display_message1 ( ); $db = new DB; if(!$db->open(USER_SETTINGS)) { exit ( 'Unable to open default user settings file for reading at ' . USER_SETTINGS ); } if ( $task == 'save' ) { if ( $demo ) exit ( 'Demo only!' ); $psettings = isset ( $_POST['settings'] ) ? $_POST['settings'] : exit ( 'Settings expected in POST data' ); // clean up inputs $psettings2 = array ( 'fl_max_storage' => (float)$psettings['fl_max_storage'], 'fl_max_filesize' => (float)$psettings['fl_max_filesize'], 'fl_max_folders' => (float)$psettings['fl_max_folders'], 'fl_allowed_filetypes' => strtolower ( trim ( $psettings['fl_allowed_filetypes'], ' ,' ) ), 'bw_max' => (float)$psettings['bw_max'], 'bw_reset_period' => (float)$psettings['bw_reset_period'], 'fl_images_only' => (bool)$psettings['fl_images_only'], 'fl_allow_rename' => trim ( $psettings['fl_allow_rename'] ), 'fl_create_folder' => (bool)$psettings['fl_create_folder'], 'fl_watermark' => (bool)$psettings['fl_watermark'], 'bw_auto_reset' => (bool)$psettings['bw_auto_reset'], ); $restrictions = array ( 'name_min_len' => (int)$psettings['name_min_len'], 'name_max_len' => (int)$psettings['name_max_len'], 'disallowed_names' => strtolower ( trim ( $psettings['disallowed_names'], ' ,' ) ), ); //save $db->set('new_user_settings', $psettings2); $db->set('restrictions', $restrictions ); $db->save(); header ( 'Location: admin.php?action=user_settings&saved' ); } else { $settings = array_merge ( $db->get('new_user_settings'), $db->get ( 'restrictions' ) ); $tpl_settings = new Template ( TPL_DIR . 'tpl_settings.php' ); $tpl_settings->set ( 'action', $action ); $tpl_settings->set ( 'saved', isset ( $_GET['saved'] ) ); $tpl_settings->setr ( 'settings', $settings ); $tpl_admin->set ( 'page_title', 'New User Settings' ); $tpl_admin->setr ( 'content', $tpl_settings ); $tpl_admin->display ( ); } } break; // email templates case 'emails': { $emails_db = new DB; if ( !$emails_db->open ( EMAIL_TEMPLATES ) ) { exit ( 'Unable to open the email templates ' . EMAIL_TEMPLATES ); } if ( $task == 'save' ) { $emails = gpc ( 'emails', 'P', array ( ) ); if ( count ( $emails ) ) { while ( list ( $k, $v ) = each ( $emails ) ) { $emails_db->set ( $k, $v ); } $emails_db->save (); } go_to ( ); } else { $tpl_settings = new Template ( TPL_DIR . 'tpl_settings.php' ); $emails = $emails_db->all (); $tpl_settings->set ( 'emails', $emails ); $tpl_settings->set ( 'action', $action ); $tpl_admin->set ( 'page_title', 'Email Templates' ); $tpl_admin->setr ( 'content', $tpl_settings ); $tpl_admin->display ( ); } } break; case 'logs': { $tpl_logs = new Template ( TPL_DIR . 'tpl_logs.php' ); $log_files = array ( ); $log_total_size = 0; if ( false !== ( $h = opendir ( LOGS_DIR ) ) ) { while ( false !== ( $f = readdir ( $h ) ) ) { if ( get_extension ( $f ) == 'log' ) { $log_size = filesize ( LOGS_DIR . $f ); $log_total_size += $log_size; $log_files [] = array ( 'name' => $f, 'size' => get_size ( $log_size, 'B', 0 ), 'view_url' => 'admin.php?action=logs&log_file=' . $f, 'delete_url' => 'admin.php?action=logs&task=del&log_file=' . $f, ); } } reset ( $log_files ); } else exit ( sprintf ( 'Unable to open the logs directory "%s"', LOGS_DIR ) ); closedir ( $h ); $log_files = multi_sort ( $log_files, 'name' ); switch ( $task ) { case 'del': { if ( $demo ) exit ( 'Demo only!' ); $log_file = gpc ( 'log_file', 'G', '' ); if ( is_file ( LOGS_DIR . $log_file ) && unlink ( LOGS_DIR . $log_file ) ) { header ( 'Location: admin.php?action=logs' ); } exit ( 'Could not delete ' . $log_file ); } break; case 'delall': { if ( $demo ) exit ( 'Demo only!' ); for ( $i = 0; $i < count ( $log_files ); $i++ ) { if ( is_file ( LOGS_DIR . $log_files[$i]['name'] ) ) { if ( !unlink ( LOGS_DIR . $log_files[$i]['name'] ) ) { exit ( 'Could not delete log file.' ); } } } header ( 'Location: admin.php?action=logs' ); } case 'clear': { if ( $demo ) exit ( 'Demo only!' ); $log_file = gpc ( 'log_file', 'G', '' ); if ( is_file ( LOGS_DIR . $log_file ) ) { fclose ( fopen ( LOGS_DIR . $log_file, 'w' ) ); header ( 'Location: admin.php?action=logs' ); } exit ( 'Could not delete ' . $log_file ); } break; default: { $log_file = gpc ( 'log_file', 'G', '' ); if ( $log_file == '' && count ( $log_files ) ) { $last = end ( $log_files ); $log_file = $last['name']; } // read log data if ( $log_file != '' && is_file ( LOGS_DIR . $log_file ) ) { $fp = fopen ( LOGS_DIR . $log_file, 'rt' ); $log_data = filesize ( LOGS_DIR . $log_file ) > 0 ? fread ( $fp, filesize ( LOGS_DIR . $log_file ) ) : 'This log file is empty.'; //$log_data = nl2br ( $log_data ); fclose ( $fp ); } else { $log_data = 'Invalid log file.'; } // display $tpl_logs->set ( 'log_total_size', get_size ( $log_total_size, 'B' ) ); $tpl_logs->setr ( 'log_files', $log_files ); $tpl_logs->set ( 'log_file', $log_file ); $tpl_logs->set ( 'delete_all_url', 'admin.php?action=logs&task=delall' ); $tpl_logs->setr ( 'log_data', $log_data ); $tpl_admin->setr ( 'content', $tpl_logs ); $tpl_admin->set ( 'page_title', 'Glovault logs' ); $tpl_admin->display ( ); } } } break; case 'user_info': { $tpl_userinfo = new Template ( TPL_DIR . 'tpl_user_admin.php' ); $tpl_userinfo->set ( 'action', $action ); $userid = gpc ( 'userid', 'GP', 0 ); $user = new User; if ( $user->open ( $userid ) ) { $userinfo = $user->all ( ); $userinfo['comments'] = trim ( $userinfo['xtr_admin_comments'] ) == '' ? 'No comments' : nl2br ( $userinfo['xtr_admin_comments'] ); // urls $userinfo['email_url'] = 'admin.php?action=emailer&to=' . $userinfo['email']; $userinfo['edit_url'] = 'admin.php?action=edit_user&userid=' . $userid; $userinfo['manage_files_url'] = 'admin.php?action=user_files&userid=' . $userid; $userinfo['bandwidth_reset_url'] = 'admin.php?action=quick_edit_user_info&task=bandwidth_counter&userid=' . $userid; // regdate $userinfo['reg_date'] = date ( $UPL['CONFIGS']['TIME_FORMAT2'], $userinfo['reg_date'] ); // login record $userinfo['last_login_time'] = date ( $UPL['CONFIGS']['TIME_FORMAT2'], $user->get ( 'xtr_last_login_time' ) ); $userinfo['last_login_ip'] = $user->get ( 'xtr_last_login_ip' ); // stats $userinfo['max_storage'] = get_size ( $userinfo['fl_max_storage'], 'MB', 1 ); $userinfo['max_filesize'] = get_size ( $userinfo['fl_max_filesize'], 'KB', 1 ); $userinfo['filetypes'] = str_replace ( ',', ', ', $userinfo['fl_allowed_filetypes'] ); $userinfo['bw_used'] = get_size ( $userinfo['bw_used'], 'KB' ); $userinfo['max_bandwidth'] = get_size ( $userinfo['bw_max'], 'MB' ); $userinfo['bw_last_reset_days'] = floor ( ( time ( ) - $userinfo['bw_last_reset'] ) / 86400 ); $userinfo['bw_last_reset'] = date ( $UPL['CONFIGS']['TIME_FORMAT2'], $userinfo['bw_last_reset'] ); $userinfo['level'] = $userinfo['level'] == LEVEL_ADMIN ? 'Admin' : ( $userinfo['level'] == LEVEL_MODERATOR ? 'Moderator' : 'Normal' ); $userinfo['allow_rename'] = $userinfo['fl_allow_rename']; $userinfo['allow_create_folder'] = $userinfo['fl_create_folder']; $userinfo['max_folders'] = $userinfo['fl_max_folders']; $userinfo['images_only'] = $userinfo['fl_images_only']; $tpl_userinfo->setr ( 'userinfo', $userinfo ); $tpl_admin->setr ( 'content', $tpl_userinfo ); $tpl_admin->set ( 'page_title', 'Account info' ); $tpl_admin->display ( ); } else { $tpl_message->set ( 'message', 'Unable to load user data, perhaps user does not exists.' ); $tpl_message->set ( 'back_url', 'admin.php?action=users' ); $tpl_admin->setr ( 'content', $tpl_message ); $tpl_admin->display ( ); } } break; case 'user_files': { // get inputs $folder = isset ( $_GET['folder'] ) ? path_decode ( $_GET['folder'] ) : ''; $userid = abs ( intval ( gpc ( 'userid', 'G', 0 ) ) ); // load templates $tpl_userfiles = new Template ( TPL_DIR . 'tpl_user_admin.php' ); $tpl_userfiles->set ( 'action', $action ); // load user $user = new User; if ( !$user->open ( $userid ) ) { exit ( 'Unable to open info file for user ' . $userid ); } $userinfo = $user->all (); $userinfo['edit_url'] = 'admin.php?action=edit_user&userid=' . $userid; $userinfo['info_url'] = 'admin.php?action=user_info&userid=' . $userid; $tpl_userfiles->set ( 'userinfo', $userinfo ); // get user files $user_root = $UPL['SETTINGS']['userfiles_dir'] . $userid . '/'; $user_url = $UPL['SETTINGS']['userfiles_url'] . $userid . '/'; $user_contents = get_contents ( $user_root ); $user_folders =& $user_contents['dirs']; $user_files =& $user_contents['files'][$folder==''?'<MAIN_FOLDER>':$folder]; $main_folder_content =& $user_contents['files']['<MAIN_FOLDER>']; $main_folder_count = count ( $main_folder_content ); $main_folder_size = 0; for ( $i = 0; $i < $main_folder_count; $i++ ) $main_folder_size += $main_folder_content[$i]['size']; $main_folder = array ( 'size' => get_size ( $main_folder_size ), 'url' => 'admin.php?action=user_files&userid=' . $userid, 'files'=> $main_folder_count ); $tpl_userfiles->set ( 'main_folder', $main_folder ); $user_files_count = count ( $user_files ); for ( $i = 0; $i < $user_files_count; $i++ ) { $user_files[$i]['perm'] = substr ( sprintf ( '%o', @fileperms ( $user_root . $folder . '/' . $user_fildes[$i]['name'] ) ), -4); $user_files[$i]['size'] = get_size ( $user_files[$i]['size'] ); $user_files[$i]['file_url'] = $user_url . clean_url ( $folder . '/' . rawurlencode ( $user_files[$i]['name'] ) ); $user_files[$i]['date'] = filemtime ( $user_root . $folder . '/' . $user_files[$i]['name'] ); $user_files[$i]['date'] = date ( $UPL['CONFIGS']['TIME_FORMAT'], $user_files[$i]['date'] ); $user_files[$i]['form_name'] = rawurlencode ( $user_files[$i]['name'] ); } // folders $user_folders_count = count ( $user_folders ); for ( $i = 0; $i < $user_folders_count; $i++ ) { $user_folders[$i]['folder_url'] = 'admin.php?action=user_files&userid=' . $userid . '&folder=' . path_encode ( $user_folders[$i]['path'] ); $user_folders[$i]['size'] = get_size ( $user_folders[$i]['size'] ); $user_folders[$i]['path'] = path_encode ( $user_folders[$i]['path'] ); } // to template and display $tpl_userfiles->set ( 'current_folder_path', path_encode ( $folder ) ); $tpl_userfiles->set ( 'current_folder_name', basename ( $folder ) ); $tpl_userfiles->setr ( 'user_files', $user_files ); $tpl_userfiles->setr ( 'user_folders', $user_folders ); $tpl_admin->setr ( 'content', $tpl_userfiles ); $tpl_admin->display ( ); } break; case 'prune_non_images': { $userid = abs ( intval ( gpc ( 'userid', 'G', 0 ) ) ); if ( $userid ) { $user_root = $UPL['SETTINGS']['userfiles_dir'] . $userid . '/'; $user_files = get_contents ( $user_root ); $ref = &$user_files['files']; while ( list ( $dir, $files ) = each ( $ref ) ) { for ( $i = 0; $i < count ( $files ); $i++ ) { $path = $user_root . ( $dir == '<MAIN_FOLDER>' ? '' : $dir ) . '/' . $files[$i]['name']; if ( !is_image ( $path ) ) { unlink ( $path ); } } } clear_contents_cache ( $user_root ); } header ( 'Location: ' . $_SERVER['HTTP_REFERER'] ); } break; case 'user_files_actions': { $files = gpc ( 'files', 'P', array ( ) ); $userid = gpc ( 'userid', 'P' ); $folder = path_decode ( gpc ( 'folder', 'P' ) ); $task_value = gpc ( 'task_value', 'P' ); $move_to = path_decode ( gpc ( 'move_to', 'P' ) ); //print $move_to; //print $folder; //exit; $user_root = $UPL['SETTINGS']['userfiles_dir'] . $userid . '/'; $user_url = $UPL['SETTINGS']['userfiles_url'] . $userid . '/'; if ( is_array ( $files ) ) { $files_count = count ( $files ); for ( $i = 0; $i < $files_count; $i++ ) { $files[$i] = rawurldecode ( $files[$i] ); if ( $files[$i] == '' ) continue; switch ( $task ) { case 'chmod': { if ( $task_value != '' ) { if ( !change_mode ( $user_root . $folder . '/' . $files[$i], $task_value ) ) { exit ( 'Could not chmod ' . $user_root . $folder . '/' . $files[$i] ); } } } break; case 'rename': { if ( $task_value != '' && !preg_match ( $UPL['CONFIGS']['REGEX_INVALID_CHARS'], $task_value ) && !is_file ( $user_root . $folder . '/' . $task_value ) ) { if ( !rename ( $user_root . $folder . '/' . $files[$i], $user_root . $folder . '/' . $task_value ) ) { exit ( 'Could not rename ' . $user_root . $folder . '/' . $files[$i] ); } go_to ( ); } } break; case 'delete': { if ( is_file ( $user_root . $folder . '/' . $files[$i] ) ) { if ( !unlink ( $user_root . $folder . '/' . $files[$i] ) ) { exit ( 'Could not delete ' . $user_root . $folder . '/' . $files[$i] ); } } } break; case 'move': { if ( $folder != $move_to && !file_exists ( $user_root . $move_to . '/' . $files[$i] ) ) { if ( !rename ( $user_root . $folder . '/' . $files[$i], $user_root . $move_to . '/' . $files[$i] ) ) { exit ( 'Could not move ' . $user_root . $folder . '/' . $files[$i] . ' to ' . ( $move_to == '' ? 'Main Folder' : $move_to ) ); } } } break; } } clear_contents_cache ( $user_root ); } go_to ( ); } break; case 'user_folders_actions': { $userid = gpc ( 'userid', 'P' ); $folder = path_decode ( gpc ( 'folder', 'P' ) ); $task_value = gpc ( 'task_value', 'P' ); $selected_folder = path_decode ( gpc ( 'selected_folder', 'P' ) ); $user_root = $UPL['SETTINGS']['userfiles_dir'] . $userid . '/'; $user_url = $UPL['SETTINGS']['userfiles_url'] . $userid . '/'; switch ( $task ) { case 'delete': { delete_dir ( $user_root . $selected_folder ); } break; case 'rename': { if ( $task_value != '' ) { rename ( $user_root . $selected_folder, $user_root . dir_name ( $selected_folder ) . '/' . $task_value ); } } break; } clear_contents_cache ( $user_root ); go_to ( 'admin.php?action=user_files&userid=' . $userid ); } break; case 'edit_user': { if (!$demo && $UPL['USER']['level'] != LEVEL_ADMIN ) display_message1 ( ); $tpl_user = new Template ( TPL_DIR . 'tpl_user_admin.php' ); $tpl_user->set ( 'action', $action ); $tpl_user->set ( 'saved', isset ( $_GET['saved'] ) ); $userid = gpc ( 'userid', 'GP', 0 ); $user = new User; if ( $user->open ( $userid ) ) { if ( $task == 'save' ) { if ( $demo ) exit ( 'Demo only!' ); $userinfo = isset ( $_POST['userinfo'] ) ? $_POST['userinfo'] : array ( ); if ( isset ( $userinfo['new_password'] ) && $userinfo['new_password'] != '' ) { $user->set ( 'password', md5 ( $userinfo['new_password'] ) ); } #exit ( $userinfo['fl_allow_rename'] ); $new_settings = array ( 'email' => trim ( $userinfo['email'] ), 'level' => (int)$userinfo['level'], 'is_activated' => (bool)@$userinfo['is_activated'], //'is_approved' => (bool)$userinfo['is_approved'], 'is_suspended' => (bool)@$userinfo['is_suspended'], 'xtr_admin_comments' => substr ( $userinfo['comments'], 0, 100 ), 'fl_max_storage' => (float)$userinfo['fl_max_storage'], 'fl_max_filesize' => (float)$userinfo['fl_max_filesize'], 'fl_max_folders' => (int)$userinfo['fl_max_folders'], 'fl_images_only' => (bool)@$userinfo['fl_images_only'], 'fl_allow_rename' => trim ( $userinfo['fl_allow_rename']), 'fl_watermark' => (bool)@$userinfo['fl_watermark'], 'fl_create_folder' => (bool)@$userinfo['fl_create_folder'], 'fl_allowed_filetypes' => strtolower ( trim ( $userinfo['fl_allowed_filetypes'] ) ), 'bw_max' => (float)$userinfo['bw_max'], 'bw_reset_period' => (float)$userinfo['bw_reset_period'], 'bw_auto_reset' => (bool)$userinfo['bw_auto_reset'] ); // update index $emails_idx = new Index; if ( !$emails_idx->open( EMAILS_INDEX ) ) { exit ( 'Unable to open the emails index at ' . EMAILS_INDEX ); } $emails_idx->update_key ( strtolower ( $user->get ( 'email' ) ), strtolower ( $new_settings['email'] ) ); $emails_idx->save ( ); // save user setting $user->set ( $new_settings ); $user->save ( ); header ( 'Location: admin.php?action=edit_user&userid=' . $userid . '&saved=1' ); } else { $userinfo = $user->all ( ); $userinfo['comments'] = trim ( $userinfo['xtr_admin_comments'] ); // urls $userinfo['info_url'] = 'admin.php?action=user_info&userid=' . $userid; $userinfo['manage_files_url'] = 'admin.php?action=user_files&userid=' . $userid; $tpl_user->setr ( 'userinfo', $userinfo ); $tpl_admin->setr ( 'content', $tpl_user ); $tpl_admin->set ( 'page_title', 'Edit account' ); $tpl_admin->display ( ); } } else { $tpl_message->set ( 'message', 'Unable to load user data, perhaps user does not exists.' ); $tpl_message->set ( 'back_url', 'admin.php?action=users' ); $tpl_admin->setr ( 'content', $tpl_message ); $tpl_admin->display ( ); } } break; case 'users': { // inputs $tpl_users = new Template ( TPL_DIR . 'tpl_users.php' ); $list_type = gpc ( 'list', 'G', 'all' ); $sort_by = gpc ( 'sort_by', 'G', 'id' ); $current_page = gpc ( 'page', 'G', 0 ); $filters = gpc ( 'filters', 'G', '' ); $filters = ( $filters == '' ? gpc ( 'filters', 'P', array ( ) ) : unserialize ( $filters ) ); $per_page = 25; // filter string $filter_str = rawurlencode ( serialize ( $filters ) ); if ( isset ( $_POST['filters'] ) ) { header ( 'Location: admin.php?action=users&list=filter&filters=' . $filter_str ); } #print_r ( $filters ); // sorting type $filter_url = $list_type . ( $list_type == 'filter' && count ( $filters ) ? '&filters=' . $filter_str : '' ); $sort_name_url = 'admin.php?action=users&sort_by=name&list=' . $filter_url; $sort_id_url = 'admin.php?action=users&sort_by=id&list=' . $filter_url; $sort_space_url = 'admin.php?action=users&sort_by=space&list=' . $filter_url; $sort_bw_url = 'admin.php?action=users&sort_by=bw&list=' . $filter_url; // get users $users = array ( ); if ( $list_type == 'approval' ) { $approval_idx = new Index; $approval_idx->open ( APPROVAL_INDEX ); $users = $approval_idx->all ( ); unset ( $approval_idx ); } elseif ( $list_type == 'bandwidth' ) { $bandwidth_idx = new Index; $bandwidth_idx->open ( BANDWIDTH_INDEX ); $users = $bandwidth_idx->all ( ); unset ( $bandwidth_idx ); } elseif ( $list_type == 'filter' ) { // load all users $names_idx = new Index; $names_idx->open ( NAMES_INDEX ); $all_users = $names_idx->all ( ); unset ( $names_idx ); //go through each user and filter them out. // Create filter $tmp = array ( ); while ( list ( $filter, $value ) = each ( $filters ) ) { $value = trim ( $value ); if ( $value != '' ) { switch ( $filter ) { case 'name': $tmp [] = 'strstr($user->get("name"),"' . addslashes ( $value ) . '")'; break; case 'email': $tmp [] = 'strstr($user->get("email"),"' . addslashes ( $value ) . '")'; break; case 'admin_comments': $tmp [] = 'strstr($user->get("xtr_admin_comments"),"' . addslashes ( $value ) . '")'; break; case 'reg_time': $tmp [] = '((time()-$user->get("reg_date"))/86400)>=' . $value; break; case 'last_login': $tmp [] = '((time()-$user->get("xtr_last_login_time"))/86400)>=' . $value; break; case 'bw_used': $tmp [] = '(($user->get("bw_used")/1024)/$user->get("bw_max"))*100'.($filters['bw_used_op']=='lt'?'<=':'>=').$value;break; case 'is_approved': $tmp [] = ( $value == 'true' ? '' : '!' ) . '$user->get("is_approved")'; break; case 'is_suspended': $tmp [] = ( $value == 'true' ? '' : '!' ) . '$user->get("is_suspended")'; break; case 'is_activated': $tmp [] = ( $value == 'true' ? '' : '!' ) . '$user->get("is_activated")'; break; case 'level': { $level_str = 'LEVEL_NORMAL'; switch ( $value ) { case 'admin': $level_str = 'LEVEL_ADMIN'; break; case 'moderator': $level_str = 'LEVEL_MODERATOR'; break; } $tmp [] = '($user->get("level") == ' . $level_str . ' )'; } break; } } } if ( count ( $tmp ) ) { #$eval = 'if ( ' . implode ( ' && ', $tmp ) . ' ) { $users [$username] = $userid; }'; $eval = 'if ( !(' . implode ( ' && ', $tmp ) . ') ) { unset($all_users[$username]); }'; while ( list ( $username, $userid ) = each ( $all_users ) ) { $user = new User; if ( $user->open ( $userid ) ) eval ( $eval ); unset($user); } $users = &$all_users; } else { $users =& $all_users; } } else { $names_idx = new Index; $names_idx->open ( NAMES_INDEX ); $users = $names_idx->all ( ); } // do sorting if ( $sort_by == 'id' ) asort ( $users, SORT_NUMERIC ); elseif ( $sort_by == 'name' ) { if ( !uksort ( $users, 'uksort_function' ) ) exit ( 'uksort failed' ); } elseif ( $sort_by == 'bw' ) { $all_users_tmp = array ( ); while ( list ( , $userid ) = each ( $users ) ) { $user = new User; if ( $user->open ( $userid ) ) { $all_users_tmp [] = array ( 'name' => $user->get ( 'name' ), 'id' => $user->get ( 'id' ), 'bw_used' => $user->get ( 'bw_used' ) ); } unset ( $user ); } $all_users_tmp = multi_sort ( $all_users_tmp, 'bw_used', SORT_DESC, SORT_NUMERIC ); $users = array ( ); $all_users_tmp_count = count ( $all_users_tmp ); for ( $i = 0; $i < $all_users_tmp_count; $i++ ) { $users[$all_users_tmp[$i]['name']] = $all_users_tmp[$i]['id']; } } elseif ( $sort_by == 'space' ) { $all_users_tmp = array ( ); while ( list ( , $userid ) = each ( $users ) ) { $user = new User; if ( $user->open ( $userid ) ) { $user_stats = dir_stats ( $UPL['SETTINGS']['userfiles_dir'] . '/' . $user->get ( 'id' ) ); $all_users_tmp [] = array ( 'name' => $user->get ( 'name' ), 'id' => $user->get ( 'id' ), 'space_used' => $user_stats['file_size'] ); } unset ( $user ); } $all_users_tmp = multi_sort ( $all_users_tmp, 'space_used', SORT_DESC, SORT_NUMERIC ); $users = array ( ); $all_users_tmp_count = count ( $all_users_tmp ); for ( $i = 0; $i < $all_users_tmp_count; $i++ ) { $users[$all_users_tmp[$i]['name']] = $all_users_tmp[$i]['id']; } } // divide into pages if ( count ( $users ) > $per_page ) { $pages = array_chunk ( $users, $per_page, 1 ); $users = isset ( $pages[$current_page] ) ? $pages[$current_page] : $pages[0]; $page_count = count ( $pages ); } else $page_count = 1; $page_links = array ( ); for ( $i = 0; $i < $page_count; $i++ ) { $page_links [] = 'admin.php?action=users&sort_by=' . $sort_by . '&list=' . $list_type . '&page=' . $i . ( $list_type == 'filter' && count ( $filters ) ? '&filters=' . $filter_str : ''); } // form a list reset ( $users ); $user_list = array ( ); while ( list ( $uname, $uid ) = each ( $users ) ) { $user = new User; if ( $user->open ( $uid ) ) { $user_info = $user->all(); $user_info['email_url'] = 'admin.php?action=emailer&to=' . $user_info['email']; $user_info['info_url'] = 'admin.php?action=user_info&userid=' . $uid; $user_info['edit_url'] = 'admin.php?action=edit_user&userid=' . $uid; $user_info['files_url'] = 'admin.php?action=user_files&userid=' . $uid; $user_list [] = $user_info; } unset ( $user ); } // display $tpl_users->setr ( 'filters', $filters ); $tpl_users->set ( 'current_page', $current_page ); $tpl_users->set ( 'page_count', $page_count ); $tpl_users->setr ( 'page_links', $page_links ); $tpl_users->setr ( 'sort_name_url', $sort_name_url ); $tpl_users->setr ( 'sort_id_url', $sort_id_url ); $tpl_users->setr ( 'sort_space_url', $sort_space_url ); $tpl_users->setr ( 'sort_bw_url', $sort_bw_url ); $tpl_users->setr ( 'list_type', $list_type ); $tpl_users->setr ( 'sort_by', $sort_by ); $tpl_users->setr ( 'users', $user_list ); $tpl_admin->setr ( 'content', $tpl_users ); $tpl_admin->display ( ); } break; case 'user_actions': { // get inputs $selected_users = gpc ( 'selected_users', 'P', array ( ) ); $target_users = gpc ( 'user_action_target', 'P', 'selected' ); $user_action = gpc ( 'user_action_type', 'P', '' ); $field_values = gpc ( 'user_field_values', 'P', array () ); // get list of target users if ( $target_users != 'selected' ) { $names_idx = new Index; if ( !$names_idx->open ( NAMES_INDEX ) ) { exit ( 'Unable to open names index ' . NAMES_INDEX ); } $all_users = $names_idx->all ( ); $selected_users = array ( ); if ( $target_users == 'all' ) { $selected_users = array_values ( $all_users ); } else { // by user level while ( list ( $i, $userid ) = each ( $all_users ) ) { $user = new User; if ( $user->open ( $userid ) ) { if ( ( $target_users == 'priviledged' && $user->get ( 'level' ) != LEVEL_NORMAL ) || ( $target_users == 'normal' && $user->get ( 'level' ) == LEVEL_NORMAL ) ) { $selected_users [] = $userid; } } } } } // Send email if ( $target_users == 'selected' && $user_action == 'sendemail' && count ( $selected_users ) ) { $emails = array ( ); while ( list ( $i, $userid ) = each ( $selected_users ) ) { $user = new User; if ( $user->open ( $userid ) ) { $emails[] = $user->get ( 'email' ); } unset ( $user ); } exit ( header ( 'Location: admin.php?action=emailer&to=' . $UPL['SETTINGS']['email'] . '&bcc=' . rawurlencode ( implode ( ', ', $emails ) ) ) ); } // print $user_action; // loop through user list and perform actions // Load indices in advance $names_idx = new Index; if ( !$names_idx->open ( NAMES_INDEX ) ) exit ( 'Unable to load index ' . NAMES_INDEX ); $emails_idx = new Index; if ( !$emails_idx->open( EMAILS_INDEX ) ) exit ( 'Unable to load index ' . EMAILS_INDEX ); $users_idx = new Index; if ( !$users_idx->open ( USERS_INDEX ) ) exit ( 'Unable to load index ' . USERS_INDEX ); $bw_idx = new Index; if ( !$bw_idx->open ( BANDWIDTH_INDEX ) ) exit ( 'Unable to load index ' . BANDWIDTH_INDEX ); $approve_idx = new Index; if ( !$approve_idx->open ( APPROVAL_INDEX ) ) exit ( 'Unable to load index ' . APPROVAL_INDEX ); while ( list ( $i, $userid ) = each ( $selected_users ) ) { $user = new User; if ( $user->open ( $userid ) ) { switch ( $user_action ) { case 'resetbw': { // reset user counter and remove user from the list $user->set ( 'bw_used', 0 ); $user->set ( 'bw_limit_notice', 0 ); $user->set ( 'bw_last_reset', time ( ) ); $bw_idx->delete ( $user->get ( 'name' ) ); $bw_idx->save ( ); $user->save ( ); } break; case 'approve': { // approve user and remove user from the list if ( !$user->get ( 'is_approved' ) ) { $user->set ( 'is_approved', true ); $approve_idx->delete ( $user->get ( 'name' ) ); $approve_idx->save ( ); $user->save ( ); // Send message to user $email_templates = new DB; if ( !$email_templates->open ( EMAIL_TEMPLATES ) ) { exit ( 'Unable to open email templates' ); } $message = parse ( $email_templates->get ( 'email_header' ), '{username}', $user->get ( 'name' ) ); $message .= parse ( $email_templates->get ( 'user_approved' ), '{uploader_url}', $UPL['SETTINGS']['uploader_url'] ); $message .= $email_templates->get ( 'email_footer' ); send_email ( $user->get ( 'email' ), 'Account approved', $message, 'From: Glovault Admin <' . $UPL['SETTINGS']['email'] . '>' ); } } break; case 'suspend': { $user->set ( 'is_suspended', true ); $user->save ( ); } break; case 'unsuspend': { $user->set ( 'is_suspended', false ); $user->save ( ); } break; case 'delete': { // remove from indices $username = $user->get ( 'name' ); $names_idx->delete ( $username ); $emails_idx->delete ( strtolower ( $user->get ( 'email' ) ) ); $users_idx->delete ( strtolower ( $username ) ); $bw_idx->delete ( $username ); $approve_idx->delete ( $username ); $names_idx->save ( ); $emails_idx->save ( ); $users_idx->save ( ); $bw_idx->save ( ); $approve_idx->save ( ); // remove user file $user->remove ( $userid ); // remove user directory delete_dir ( $UPL['SETTINGS']['userfiles_dir'] . $userid ); } break; case 'prune_non_images': { $user_root = $UPL['SETTINGS']['userfiles_dir'] . $userid . '/'; $user_files = get_contents ( $user_root ); $ref = &$user_files['files']; while ( list ( $dir, $files ) = each ( $ref ) ) { for ( $i = 0; $i < count ( $files ); $i++ ) { $path = $user_root . ( $dir == '<MAIN_FOLDER>' ? '' : $dir ) . '/' . $files[$i]['name']; if ( !is_image ( $path ) ) { unlink ( $path ); } } } clear_contents_cache ( $user_root ); } break; case 'setfield': { while ( list ( $field_name, $field_value ) = each ( $field_values ) ) { $field_value = trim ( $field_value ); if ( $field_value != '' ) { switch ( $field_name ) { // float values case 'fl_max_filesize': case 'fl_max_storage': case 'bw_max': { $field_value = (float)$field_value; } break; // int values case 'bw_reset_period': case 'fl_max_folders': { $field_value = (int)$field_value; } break; // bool values case 'bw_auto_reset': case 'fl_create_folder': case 'fl_images_only': case 'fl_watermark': { $field_value = (bool)$field_value; } break; // text case 'fl_allowed_filetypes': { $field_value = ( $field_value == 'ALL' ) ? '' : trim ( $field_value, ' ,' ); } break; } $user->set ( $field_name, $field_value ); } } reset ( $field_values ); $user->save(); } break; } } } go_to (); } break; case 'quick_edit_user_info': { if ( $demo ) exit ( 'Demo only!' ); $userid = isset ( $_GET['userid'] ) ? abs ( intval ( $_GET['userid'] ) ) : 0; $user = new User; if ( $user->open ( $userid ) ) { switch ( $task ) { case 'bandwidth_counter': { $user->set ( 'bw_used', 0 ); $user->set ( 'bw_limit_notice', 0 ); $user->set ( 'bw_last_reset', time ( ) ); $user->save ( ); } break; } } header ( 'Location: ' . $_SERVER['HTTP_REFERER'] ); } break; case 'var_dumps': { print_r ( $_SERVER ); } break; case 'export_users': { header("Content-Type: application/xml; charset=ISO-8859-1"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: ". gmdate("D, d M Y H:i:s") ." GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); // load all users $names_idx = new Index; $names_idx->open ( NAMES_INDEX ); $all_users = $names_idx->all ( ); $users = array (); $tabs = 0; print '<?xml version="1.0"?>' . "\n"; while ( list ( $name, $userid ) = each ( $all_users ) ) { $user_info = new User; if ( $user_info->open ( $userid ) ) { $user_data = $user_info->all(); print str_pad('',$tabs, "\t") . "<user>\n"; $tabs++; while ( list ( $field, $value ) = each ( $user_data ) ) { print str_pad('',$tabs, "\t") ."<$field>$value</$field>\n"; } $tabs--; print str_pad('',$tabs, "\t") . "</user>\n"; } } } break; case 'stats': { $userfiles_stats = dir_stats ( $UPL['SETTINGS']['userfiles_dir'] ); $users_index = new Index; $users_index->open ( NAMES_INDEX ); $all_users = $users_index->all ( ); $users_count = count ( $all_users ); $newest_user = $users_index->get_last ( ); $apprvl_idx = new Index; $apprvl_idx->open ( APPROVAL_INDEX ); $apprvl_count = count ( $apprvl_idx->all ( ) ); $bw_idx = new Index; $bw_idx->open ( BANDWIDTH_INDEX ); $bw_count = count ( $bw_idx->all ( ) ); // bandwidth usage $total_bw_used = 0; $highest_bw_user = array ( 'name' => '<NO ONE>', 'used' => 0, 'url' => '' ); while ( list ( , $userid ) = each ( $all_users ) ) { $user = new User; if ( $user->open ( $userid ) ) { $x = $user->get ( 'bw_used' ); if ( $x > $highest_bw_user['used'] ) { $highest_bw_user['used'] = $x; $highest_bw_user['name'] = $user->get ( 'name' ); $highest_bw_user['url'] = 'admin.php?action=user_info&userid=' . $user->get ( 'id' ); } $total_bw_used += $x; } unset ( $user ); } $highest_bw_user['used'] = get_size ( $highest_bw_user['used'], 'KB' ); $stats = array ( 'userfiles_exists' => is_dir ( $UPL['SETTINGS']['userfiles_dir'] ), 'userfiles_files' => $userfiles_stats['file_count'], 'userfiles_size' => get_size ( $userfiles_stats['file_size'], 'B', 2 ), 'userfiles_folders' => $userfiles_stats['folder_count'], 'users_count' => $users_count, 'newest_user_name' => key ( $newest_user ), 'newest_user_url' => 'admin.php?action=user_info&userid=' . current ( $newest_user ), 'approval_req_count' => $apprvl_count, 'bandwidth_count' => $bw_count, 'total_bandwidth_used' => get_size ( $total_bw_used, 'KB' ), 'highest_bw_user' => $highest_bw_user, ); $tpl_stats = new Template ( TPL_DIR . '/tpl_stats.php' ); $tpl_stats->setr ( 'stats', $stats ); $tpl_admin->setr ( 'content', $tpl_stats ); $tpl_admin->display ( ); } break; case 'tools': { $tpl_tools = new Template ( TPL_DIR . '/tpl_tools.php' ); $tpl_tools->set ( 'action', $action ); $tpl_admin->setr ( 'content', $tpl_tools ); $tpl_admin->display ( ); } break; case 'export': { if ( $task == 'export' ) { $export_settings = gpc ( 'export_settings', 'P', 0 ); $users_index = new Index; $users_index->open ( NAMES_INDEX ); $all_users = $users_index->all ( ); reset ( $all_users ); $users_count = count ( $all_users ); $export_data = array ( ); while ( list ( $uname, $uid ) = each ( $all_users ) ) { $user = new User; if ( $user->open ( $uid ) ) { $export_data ['users'][] = $user->all(); } unset ( $user ); } if ( $export_settings ) { $upl_settings = new DB; if ( $upl_settings->open ( UPLOADER_SETTINGS ) ) { $export_data ['upl_settings'] = $upl_settings->all ( ); } $usr_settings = new DB; if ( $usr_settings->open ( USER_SETTINGS ) ) { $export_data ['usr_settings'] = $usr_settings->all ( ); } } header ( 'Content-type: text/plain' ); header ( 'Content-disposition: attachment; filename=uploader_data_' . date('M_d_y') . '.php' ); print sprintf("<?php\n\$this->_d=%s;\n?>",var_export($export_data,true)); } else { $tpl_tools = new Template ( TPL_DIR . '/tpl_tools.php' ); $tpl_tools->set ( 'action', $action ); $tpl_admin->set ( 'content', $tpl_tools ); $tpl_admin->display ( ); } } break; case 'import': { if ( $task == 'import' ) { $error = 'none'; $success = ''; $import_file = @$_FILES['import_file']; $import_settings = gpc ( 'import_settings', 'P', 0 ); $import_users = gpc ( 'import_users', 'P', 0 ); if ( isset ( $import_file['tmp_name'] ) && is_uploaded_file ( $import_file['tmp_name'] ) ) { if ( $import_file['size'] == 0 || $import_file['error'] != 0 ) { $error = 'Import file is not valid.'; } else { $db = new DB; if ( $db->open ( $import_file['tmp_name'] ) ) { $import_data = $db->all(); // Import settings if ( $import_settings && isset ( $import_data['upl_settings'] ) ) { $settings_db = new DB; if ( $settings_db->open ( UPLOADER_SETTINGS ) ) { $settings_db->set ( $import_data['upl_settings'], 1 ); $settings_db->save(); } else exit ( 'Could not open uploader settings file: ' . UPLOADER_SETTINGS ); $usr_settings_db = new DB; if ( $usr_settings_db->open ( USER_SETTINGS ) ) { $usr_settings_db->set ( $import_data['usr_settings'], 1 ); $usr_settings_db->save(); } else exit ( 'Could not open uploader user settings file: ' . USER_SETTINGS ); $success = 'Glovault settings imported. '; } // Import users if ( $import_users && isset ( $import_data['users'] ) ) { $users =& $import_data['users']; $success .= 'Users imported.'; print_r ( $users ); } } } } else { $error = 'No import file selected.'; } if ( $error !== 'none' ) { header ( 'Refresh: 2;url=admin.php?action=import' ); $tpl_message->set ( 'message', $error ); $tpl_message->set ( 'back_url', 'admin.php?action=import' ); $tpl_admin->set ( 'content', $tpl_message ); $tpl_admin->display ( ); } else { $tpl_message->set ( 'message', ( $success == '' ? 'Not import option selected.' : $success ) ); $tpl_message->set ( 'back_url', 'admin.php?action=import' ); $tpl_admin->set ( 'content', $tpl_message ); $tpl_admin->display ( ); } } else { $tpl_tools = new Template ( TPL_DIR . '/tpl_tools.php' ); $tpl_tools->set ( 'action', $action ); $tpl_admin->set ( 'content', $tpl_tools ); $tpl_admin->display ( ); } } break; case 'emailer': { $tpl_tools = new Template ( TPL_DIR . '/tpl_tools.php' ); $tpl_tools->set ( 'action', $action ); $to = gpc ( 'to', 'G', $UPL['SETTINGS']['email'] ); $bcc = gpc ( 'bcc', 'G', '' ); $email = gpc ( 'email', 'P', array ( ) ); if ( $task == 'send' && count ( $email ) ) { $header = 'From: Glovault Admin <' . $UPL['SETTINGS']['email'] . '>' . "\n"; // mass email? if ( isset ( $email['mass_email'] ) ) { $emails_idx = new Index; if ( !$emails_idx->open( EMAILS_INDEX ) ) exit ( 'Unable to load index ' . EMAILS_INDEX ); $bcc_list = array_keys ( $emails_idx->all() ); $chunks = array_chunk ( $bcc_list, 100 ); for ( $i = 0; $i < count ( $chunks ); $i++ ) { $header = 'From: Glovault Admin <' . $UPL['SETTINGS']['email'] . '>' . "\n"; $header .= 'Bcc: ' . implode ( ', ', $chunks[$i] ) . "\n"; // send it send_email ( $email['send_to'], $email['subject'], $email['message'], $header ); } } else { // send it $header = 'From: Glovault Admin <' . $UPL['SETTINGS']['email'] . '>' . "\n"; if ( isset ( $email['bcc'] ) ) { $header .= 'Bcc: ' . $email['bcc'] . "\n"; } send_email ( $email['send_to'], $email['subject'], $email['message'], $header ); } $tpl_message->set ( 'message', 'Your message has been sent.' ); $tpl_message->set ( 'back_url', 'admin.php?action=tools' ); $tpl_admin->setr ( 'content', $tpl_message ); $tpl_admin->display ( ); } else { // show form $tpl_tools->set ( 'bcc', $bcc ); $tpl_tools->set ( 'receivers', $to ); $tpl_admin->setr ( 'content', $tpl_tools ); $tpl_admin->display ( ); } } break; default: { $tpl_admin->set ( 'content', 'Welcome to the admin section.' ); $tpl_admin->display ( ); } } ?>
© 2017 -
ZeroByte.ID
.