From 31ebdf84fa17777bb00a1350210556ee57eaaaca Mon Sep 17 00:00:00 2001 From: imrcli-remediator Date: Sat, 18 Jul 2026 18:04:25 +0200 Subject: [PATCH] =?UTF-8?q?quarantine:=20family=3Duploader-dropper=20(62?= =?UTF-8?q?=20f=C3=A1jl)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vhost: clusers.cadline.hu rel_path: clusers/.svn/text-base/user_new_submit.php.svn-base result: quarantined evidence_sha256: 6967d992a9ea9a197dc185dbf43a0d871dba4c5a5c5224ed9b4841f4f11080aa timestamp: 20260718T160424Z finding_ref: 6508 vhost: clusers.cadline.hu rel_path: clusers/user_new_submit.php result: quarantined evidence_sha256: c854211bdbab6a57eb1562aabaa7db338500c4ca11e6dcb72da03358512ec67c timestamp: 20260718T160424Z finding_ref: 6332 vhost: clusers.cadline.hu rel_path: clusers_eng/.svn/text-base/user_new_submit.php.svn-base result: quarantined evidence_sha256: 501b60e0a1a8e89628300b2cf2d62f9523647767288e0b9deb24269bb8f5ecd8 timestamp: 20260718T160424Z finding_ref: 6285 vhost: clusers.cadline.hu rel_path: clusers_eng/user_new_submit.php result: quarantined evidence_sha256: c40d074909d6576b4de42a69c47ad3d0a5ab0d303ce9eb5636d3eeee294d072e timestamp: 20260718T160424Z finding_ref: 6116 vhost: clusers.cadline.hu rel_path: clusers_spa/user_new_submit.php result: quarantined evidence_sha256: b64f6aad0a0107ce36748f719ccf5e7ce36e35a80375b51b2c490d46f5c930bc timestamp: 20260718T160424Z finding_ref: 5931 vhost: clusers.cadline.hu rel_path: editcrm/user_new_submit.php result: quarantined evidence_sha256: b64f6aad0a0107ce36748f719ccf5e7ce36e35a80375b51b2c490d46f5c930bc timestamp: 20260718T160424Z finding_ref: 6103 vhost: crm.cadline.hu rel_path: public/application/helpers/sajatfeltolto.php result: quarantined evidence_sha256: 4b99ac9759922b713dde14d6d6968d578f2bf1f464ca5f92d99f880954981808 timestamp: 20260718T160424Z finding_ref: 5913 vhost: dev.cadline.hu rel_path: php7_update/crm.cadline.hu/application/helpers/sajatfeltolto.php result: quarantined evidence_sha256: 4b99ac9759922b713dde14d6d6968d578f2bf1f464ca5f92d99f880954981808 timestamp: 20260718T160424Z finding_ref: 6761 vhost: dev.cadline.hu rel_path: php7_update/partners.archlinexp.com/application/controllers/admin.php result: quarantined evidence_sha256: 6478891d9ef465846f47f196bec45855da4d86e3d617207348b2549de69ca732 timestamp: 20260718T160424Z finding_ref: 6772 vhost: dev.cadline.hu rel_path: php7_update/partners.archlinexp.com/application/controllers/collection.php result: quarantined evidence_sha256: 623c2d631d8e875f065612f01001082802e2cd4c3088640d3d6c393dec3782dd timestamp: 20260718T160424Z finding_ref: 6765 vhost: dev.cadline.hu rel_path: php7_update/partners.archlinexp.com/application/controllers/forum.php result: quarantined evidence_sha256: 3412487058a8a6bf79254df2d86f5cbf06b8c96adc9b26e645dd537b80ff13db timestamp: 20260718T160424Z finding_ref: 6769 vhost: dev.cadline.hu rel_path: php7_update/partners.archlinexp.com/application/controllers/forum.php~ result: quarantined evidence_sha256: 8a8870bd25fea815ae45a267b82e968b5bbafafac66a0b2bc83b949439403312 timestamp: 20260718T160424Z finding_ref: 6766 vhost: dev.cadline.hu rel_path: php7_update/partners.archlinexp.com/application/controllers/groups.php result: quarantined evidence_sha256: cce23a7e4244cfd82817f25ec0dbb697c22cb1c92425334ee2d163d0e290d921 timestamp: 20260718T160424Z finding_ref: 6774 vhost: dev.cadline.hu rel_path: php7_update/partners.archlinexp.com/application/controllers/objects.php result: quarantined evidence_sha256: 38a24706801b0127273d0776f59e480f1d75b681cbd700038140fef397226303 timestamp: 20260718T160424Z finding_ref: 6767 vhost: dev.cadline.hu rel_path: php7_update/partners.archlinexp.com/application/controllers/projects.php result: quarantined evidence_sha256: 2860e757380bcee28db11d0edb77d54d6a4940c76661d6c71f5ebddfd22f6616 timestamp: 20260718T160424Z finding_ref: 6770 vhost: dev.cadline.hu rel_path: php7_update/partners.archlinexp.com/application/controllers/testforum.php result: quarantined evidence_sha256: 6eb44fd9b69b4cf5a4b0cb71210bb47fab65e8d04ad69b568c640e878cd52986 timestamp: 20260718T160424Z finding_ref: 6773 vhost: dev.cadline.hu rel_path: php7_update/partners.archlinexp.com/application/helpers/sajatfeltolto.php result: quarantined evidence_sha256: 75359fbae41809f21d9fb056c84ae525b579ad78f2e688033c3ac583b9dba833 timestamp: 20260718T160424Z finding_ref: 6831 vhost: dev.cadline.hu rel_path: php7_update/partners.archlinexp.com/application/views/objects/submit.php result: quarantined evidence_sha256: 2cc8c8932a3a8f6e5137226df6e6b6e04836874f611f9b1ca366a0c3b96915ff timestamp: 20260718T160424Z finding_ref: 6801 vhost: dev.cadline.hu rel_path: php7_update/partners.archlinexp.com/application/views/projects/submit.php result: quarantined evidence_sha256: a60aa86f2aafb6a1fbfab05e06f158279b701126547b74e6c4d96599a487c7dc timestamp: 20260718T160424Z finding_ref: 6802 vhost: dev.cadline.hu rel_path: php7_update/partners.archlinexp.com/public/order/nonpro.php result: quarantined evidence_sha256: c1a490b958a2c4c3b108788f5a11b1d2271539b2a3127ed3af5c04b1032f72a7 timestamp: 20260718T160424Z finding_ref: 6884 vhost: dev.cadline.hu rel_path: php7_update/partners.archlinexp.com/public/order/szerver.php result: quarantined evidence_sha256: b86dc1faaa6db4787cd84016f05a9789aa2fe331c0dc9f5c1110fc49faba4187 timestamp: 20260718T160424Z finding_ref: 6885 vhost: dev.cadline.hu rel_path: php7_update/partners.archlinexp.com/public/order/szerver2.php result: quarantined evidence_sha256: fbffb453e8e48ee0a2888583a65ff6aac1315ae8843ea81088960b49bf93d099 timestamp: 20260718T160424Z finding_ref: 6883 vhost: dev.cadline.hu rel_path: php7_update/sub.archline.hu/components/com_showroom/views/upload/view.html.php result: quarantined evidence_sha256: be23b29230dc83d9194c6b3047dec8b7693d8ff582880de84399d41e57a968e7 timestamp: 20260718T160424Z finding_ref: 6888 vhost: dev.cadline.hu rel_path: tcexam/admin/code/tce_functions_upload.php result: quarantined evidence_sha256: 526624f3cb1ffec1b482de63aac1ef343a36c7670eac72d45397d47813cfe5fc timestamp: 20260718T160424Z finding_ref: 6922 vhost: partners.archlinexp.com rel_path: application/controllers/admin.php result: quarantined evidence_sha256: 2bd1ff9d0a4f74d48be91709e433f190bbd91cbc65ab251c0daeba252573af55 timestamp: 20260718T160424Z finding_ref: 5316 vhost: partners.archlinexp.com rel_path: application/controllers/collection.php result: quarantined evidence_sha256: 24937d9c44f51eb173223c5cf5271f02869850ac07a2b8bb03c83845a57666be timestamp: 20260718T160424Z finding_ref: 5309 vhost: partners.archlinexp.com rel_path: application/controllers/forum.php result: quarantined evidence_sha256: dc04c2be6ceb85d87c001033e28d9f26e7f0aaff3ca367ba58b66202ac951087 timestamp: 20260718T160424Z finding_ref: 5313 vhost: partners.archlinexp.com rel_path: application/controllers/forum.php~ result: quarantined evidence_sha256: bc5530aba3a1c3ad0e26f50d32bdd4e9e4e9cd9ed3b5985e87dba6f7d7fc936c timestamp: 20260718T160424Z finding_ref: 5310 vhost: partners.archlinexp.com rel_path: application/controllers/groups.php result: quarantined evidence_sha256: fdcb90729c1adf9157b1bab5c026f02b89deb9a847ebb04809ad4676527d6387 timestamp: 20260718T160424Z finding_ref: 5318 vhost: partners.archlinexp.com rel_path: application/controllers/objects.php result: quarantined evidence_sha256: b6f11c4b3be5f7f0a5a2e18c82cf8861937fdbc3ee9b317d03ec4ec923cdaf5f timestamp: 20260718T160424Z finding_ref: 5311 vhost: partners.archlinexp.com rel_path: application/controllers/projects.php result: quarantined evidence_sha256: b42c1a5d2f1fefe1598248fc7213915e840173c5196c1022ec40dde2d01446a6 timestamp: 20260718T160424Z finding_ref: 5314 vhost: partners.archlinexp.com rel_path: application/controllers/testforum.php result: quarantined evidence_sha256: b56e2ebdd92c705cfee85f13a961ad4cc6a3811524f511e5f65b6bc0d7218fa2 timestamp: 20260718T160424Z finding_ref: 5317 vhost: partners.archlinexp.com rel_path: application/helpers/sajatfeltolto.php result: quarantined evidence_sha256: 75359fbae41809f21d9fb056c84ae525b579ad78f2e688033c3ac583b9dba833 timestamp: 20260718T160424Z finding_ref: 5375 vhost: partners.archlinexp.com rel_path: application/views/objects/submit.php result: quarantined evidence_sha256: 79a5a4a225083fadcdbfd71ac01d201e386ec1aa5535726917d9c555dc8534d0 timestamp: 20260718T160424Z finding_ref: 5345 vhost: partners.archlinexp.com rel_path: application/views/projects/submit.php result: quarantined evidence_sha256: 26abc82bae9ad062f66a6fc78021fdb126eebc56d1b77527148c2773cf5c0c44 timestamp: 20260718T160424Z finding_ref: 5346 vhost: partners.archlinexp.com rel_path: public/order/nonpro.php result: quarantined evidence_sha256: ced4101b56c89a10905dec6c040e30953f093bea56cbbe66c970826ce31c9411 timestamp: 20260718T160424Z finding_ref: 5431 vhost: partners.archlinexp.com rel_path: public/order/szerver.php result: quarantined evidence_sha256: 7b8dee9c5d3bc7610ae0983b64bf14ed45468a114c644cee34849d503c6dc9d7 timestamp: 20260718T160424Z finding_ref: 5432 vhost: partners.archlinexp.com rel_path: public/order/szerver2.php result: quarantined evidence_sha256: e719641444395e6412e4bbe9a2c485ebfa20efc84d340c4b6ae2f6561a1f7464 timestamp: 20260718T160424Z finding_ref: 5430 vhost: partners.archlinexp.com rel_path: public/order/uploadDocument.php result: quarantined evidence_sha256: caff146c66537fbbb7dbafe119045537ba0005db4a102c720ad6b5ff674b0eb6 timestamp: 20260718T160424Z finding_ref: 5429 vhost: partners.archlinexp.com rel_path: public/resourcemanager/uploader.php result: quarantined evidence_sha256: fdf26f52fcd52019b8c9a16ea80bbd34be04fb1ab65aa63ecae7c11cb53e0c80 timestamp: 20260718T160424Z finding_ref: 5428 vhost: tcexam.archline.hu rel_path: admin/code/tce_functions_upload.php result: quarantined evidence_sha256: 73b304e867c9d32a20013d492c8d8d2614acd86580427b378b1be524576311e5 timestamp: 20260718T160424Z finding_ref: 4830 vhost: www.cadline.hu rel_path: application/controllers/admin.php result: quarantined evidence_sha256: dc2640ce42b3227552feacd9dc8b9d0ae32c0f0343d66c75c9ddad0ba3b6af38 timestamp: 20260718T160424Z finding_ref: 5450 vhost: www.cadline.hu rel_path: application/controllers/collection.php result: quarantined evidence_sha256: a592d4c5753ffc7aa532296c9a64057714541e62efed7eca8e368d52343d1606 timestamp: 20260718T160424Z finding_ref: 5443 vhost: www.cadline.hu rel_path: application/controllers/forum.php result: quarantined evidence_sha256: 9ff320957968cee7484108a7546a4ac2b6bf092fff325c7327b312ab382d632b timestamp: 20260718T160424Z finding_ref: 5447 vhost: www.cadline.hu rel_path: application/controllers/forum.php~ result: quarantined evidence_sha256: bc5530aba3a1c3ad0e26f50d32bdd4e9e4e9cd9ed3b5985e87dba6f7d7fc936c timestamp: 20260718T160424Z finding_ref: 5444 vhost: www.cadline.hu rel_path: application/controllers/groups.php result: quarantined evidence_sha256: fdcb90729c1adf9157b1bab5c026f02b89deb9a847ebb04809ad4676527d6387 timestamp: 20260718T160424Z finding_ref: 5452 vhost: www.cadline.hu rel_path: application/controllers/objects.php result: quarantined evidence_sha256: b6f11c4b3be5f7f0a5a2e18c82cf8861937fdbc3ee9b317d03ec4ec923cdaf5f timestamp: 20260718T160424Z finding_ref: 5445 vhost: www.cadline.hu rel_path: application/controllers/projects.php result: quarantined evidence_sha256: b42c1a5d2f1fefe1598248fc7213915e840173c5196c1022ec40dde2d01446a6 timestamp: 20260718T160424Z finding_ref: 5448 vhost: www.cadline.hu rel_path: application/controllers/testforum.php result: quarantined evidence_sha256: b56e2ebdd92c705cfee85f13a961ad4cc6a3811524f511e5f65b6bc0d7218fa2 timestamp: 20260718T160424Z finding_ref: 5451 vhost: www.cadline.hu rel_path: application/helpers/sajatfeltolto.php result: quarantined evidence_sha256: 75359fbae41809f21d9fb056c84ae525b579ad78f2e688033c3ac583b9dba833 timestamp: 20260718T160424Z finding_ref: 5509 vhost: www.cadline.hu rel_path: application/views/objects/submit.php result: quarantined evidence_sha256: 79a5a4a225083fadcdbfd71ac01d201e386ec1aa5535726917d9c555dc8534d0 timestamp: 20260718T160424Z finding_ref: 5479 vhost: www.cadline.hu rel_path: application/views/projects/submit.php result: quarantined evidence_sha256: 26abc82bae9ad062f66a6fc78021fdb126eebc56d1b77527148c2773cf5c0c44 timestamp: 20260718T160424Z finding_ref: 5480 vhost: www.cadline.hu rel_path: public/mysqldumper/filemanagement.php result: quarantined evidence_sha256: 435dd6ab5a4b1cbdf6b39ce78a24b58045bdcbdb8e60504d730d7b7c9dce506a timestamp: 20260718T160424Z finding_ref: 5643 vhost: www.cadline.hu rel_path: public/mysqldumper/install.php result: quarantined evidence_sha256: 92387c48234e05c051bf4eba14fbecd2d9d4ccb6075078c00239bd187a8eecfd timestamp: 20260718T160424Z finding_ref: 5644 vhost: www.cadline.hu rel_path: public/resourcemanager/uploader.php result: quarantined evidence_sha256: fdf26f52fcd52019b8c9a16ea80bbd34be04fb1ab65aa63ecae7c11cb53e0c80 timestamp: 20260718T160424Z finding_ref: 5573 vhost: www.cadline.hu rel_path: public/swf/upload/upload-file.php result: quarantined evidence_sha256: 38f4abfe83820372777b81204184f90f3a03d7f16f2889897dc4ddb60b9d6bf1 timestamp: 20260718T160424Z finding_ref: 5868 vhost: www.cadline.hu rel_path: public/tcexam/admin/code/tce_functions_upload.php result: quarantined evidence_sha256: 73b304e867c9d32a20013d492c8d8d2614acd86580427b378b1be524576311e5 timestamp: 20260718T160424Z finding_ref: 5901 vhost: www.cadline.hu rel_path: public/tikiwiki/tiki-edit_article.php result: quarantined evidence_sha256: d046d94287a9f324665227b4dd88c9e5716ae4352a779f73fc172dd8b2e347eb timestamp: 20260718T160424Z finding_ref: 5658 vhost: www.cadline.hu rel_path: public/tikiwiki/tiki-edit_submission.php result: quarantined evidence_sha256: e8b3d1e22d261471ddd27360235923ef4093f918a38cb2e53e3906f35cc593ad timestamp: 20260718T160424Z finding_ref: 5659 vhost: www.cadline.hu rel_path: public/tikiwiki/tiki-editpage.php result: quarantined evidence_sha256: 0e43540567d88d028ff7d535b8d628a0387a94d94c349bfe88cc38c700064811 timestamp: 20260718T160424Z finding_ref: 5661 vhost: www.cadline.hu rel_path: public/tikiwiki/tiki-map_upload.php result: quarantined evidence_sha256: 15f06e8e4479abe0c9919e2347cafaf02e3926fcc983ed0d6501db43aeb2641b timestamp: 20260718T160424Z finding_ref: 5663 vhost: www.cadline.hu rel_path: public/tikiwiki/tiki-webmail.php result: quarantined evidence_sha256: 3e3c705ec10920aa496c8ff0a3324165a5045306b530359f18f02b538dc7977f timestamp: 20260718T160424Z finding_ref: 5660 --- .../admin/code/tce_functions_upload.php | 122 + .../tce_functions_upload.php.evidence.json | 15 + .../application/controllers/admin.php | 4647 ++++++++++++++++ .../controllers/admin.php.evidence.json | 15 + .../application/controllers/collection.php | 1385 +++++ .../controllers/collection.php.evidence.json | 15 + .../application/controllers/forum.php | 2556 +++++++++ .../controllers/forum.php.evidence.json | 15 + .../application/controllers/forum.php~ | 2602 +++++++++ .../controllers/forum.php~.evidence.json | 15 + .../application/controllers/groups.php | 340 ++ .../controllers/groups.php.evidence.json | 15 + .../application/controllers/objects.php | 429 ++ .../controllers/objects.php.evidence.json | 15 + .../application/controllers/projects.php | 445 ++ .../controllers/projects.php.evidence.json | 15 + .../application/controllers/testforum.php | 2367 ++++++++ .../controllers/testforum.php.evidence.json | 15 + .../application/helpers/sajatfeltolto.php | 102 + .../helpers/sajatfeltolto.php.evidence.json | 15 + .../application/views/objects/submit.php | 69 + .../views/objects/submit.php.evidence.json | 15 + .../application/views/projects/submit.php | 69 + .../views/projects/submit.php.evidence.json | 15 + .../partners/public/order/nonpro.php | 120 + .../public/order/nonpro.php.evidence.json | 15 + .../partners/public/order/szerver.php | 2255 ++++++++ .../public/order/szerver.php.evidence.json | 15 + .../partners/public/order/szerver2.php | 1553 ++++++ .../public/order/szerver2.php.evidence.json | 15 + .../partners/public/order/uploadDocument.php | 123 + .../order/uploadDocument.php.evidence.json | 15 + .../public/resourcemanager/uploader.php | 31 + .../uploader.php.evidence.json | 15 + .../text-base/user_new_submit.php.svn-base | 97 + ...user_new_submit.php.svn-base.evidence.json | 15 + .../clusers/clusers/user_new_submit.php | 208 + .../clusers/user_new_submit.php.evidence.json | 15 + .../text-base/user_new_submit.php.svn-base | 100 + ...user_new_submit.php.svn-base.evidence.json | 15 + .../clusers/clusers_eng/user_new_submit.php | 198 + .../user_new_submit.php.evidence.json | 15 + .../clusers/clusers_spa/user_new_submit.php | 104 + .../user_new_submit.php.evidence.json | 15 + .../clusers/editcrm/user_new_submit.php | 104 + .../editcrm/user_new_submit.php.evidence.json | 15 + .../application/helpers/sajatfeltolto.php | 84 + .../helpers/sajatfeltolto.php.evidence.json | 15 + .../application/helpers/sajatfeltolto.php | 84 + .../helpers/sajatfeltolto.php.evidence.json | 15 + .../application/controllers/admin.php | 4757 +++++++++++++++++ .../controllers/admin.php.evidence.json | 15 + .../application/controllers/collection.php | 1385 +++++ .../controllers/collection.php.evidence.json | 15 + .../application/controllers/forum.php | 2556 +++++++++ .../controllers/forum.php.evidence.json | 15 + .../application/controllers/forum.php~ | 2602 +++++++++ .../controllers/forum.php~.evidence.json | 15 + .../application/controllers/groups.php | 340 ++ .../controllers/groups.php.evidence.json | 15 + .../application/controllers/objects.php | 429 ++ .../controllers/objects.php.evidence.json | 15 + .../application/controllers/projects.php | 445 ++ .../controllers/projects.php.evidence.json | 15 + .../application/controllers/testforum.php | 2367 ++++++++ .../controllers/testforum.php.evidence.json | 15 + .../application/helpers/sajatfeltolto.php | 102 + .../helpers/sajatfeltolto.php.evidence.json | 15 + .../application/views/objects/submit.php | 69 + .../views/objects/submit.php.evidence.json | 15 + .../application/views/projects/submit.php | 68 + .../views/projects/submit.php.evidence.json | 15 + .../public/order/nonpro.php | 119 + .../public/order/nonpro.php.evidence.json | 15 + .../public/order/szerver.php | 1855 +++++++ .../public/order/szerver.php.evidence.json | 15 + .../public/order/szerver2.php | 1830 +++++++ .../public/order/szerver2.php.evidence.json | 15 + .../com_showroom/views/upload/view.html.php | 235 + .../views/upload/view.html.php.evidence.json | 15 + .../admin/code/tce_functions_upload.php | 105 + .../tce_functions_upload.php.evidence.json | 15 + .../www/application/controllers/admin.php | 4757 +++++++++++++++++ .../controllers/admin.php.evidence.json | 15 + .../application/controllers/collection.php | 1375 +++++ .../controllers/collection.php.evidence.json | 15 + .../www/application/controllers/forum.php | 2702 ++++++++++ .../controllers/forum.php.evidence.json | 15 + .../www/application/controllers/forum.php~ | 2602 +++++++++ .../controllers/forum.php~.evidence.json | 15 + .../www/application/controllers/groups.php | 340 ++ .../controllers/groups.php.evidence.json | 15 + .../www/application/controllers/objects.php | 429 ++ .../controllers/objects.php.evidence.json | 15 + .../www/application/controllers/projects.php | 445 ++ .../controllers/projects.php.evidence.json | 15 + .../www/application/controllers/testforum.php | 2367 ++++++++ .../controllers/testforum.php.evidence.json | 15 + .../www/application/helpers/sajatfeltolto.php | 102 + .../helpers/sajatfeltolto.php.evidence.json | 15 + .../www/application/views/objects/submit.php | 69 + .../views/objects/submit.php.evidence.json | 15 + .../www/application/views/projects/submit.php | 69 + .../views/projects/submit.php.evidence.json | 15 + .../www/public/mysqldumper/filemanagement.php | 518 ++ .../filemanagement.php.evidence.json | 15 + .../www/public/mysqldumper/install.php | 753 +++ .../mysqldumper/install.php.evidence.json | 15 + .../www/public/resourcemanager/uploader.php | 31 + .../uploader.php.evidence.json | 15 + .../www/public/swf/upload/upload-file.php | 16 + .../swf/upload/upload-file.php.evidence.json | 15 + .../admin/code/tce_functions_upload.php | 122 + .../tce_functions_upload.php.evidence.json | 15 + .../www/public/tikiwiki/tiki-edit_article.php | 691 +++ .../tiki-edit_article.php.evidence.json | 15 + .../public/tikiwiki/tiki-edit_submission.php | 551 ++ .../tiki-edit_submission.php.evidence.json | 15 + .../www/public/tikiwiki/tiki-editpage.php | 1479 +++++ .../tikiwiki/tiki-editpage.php.evidence.json | 15 + .../www/public/tikiwiki/tiki-map_upload.php | 178 + .../tiki-map_upload.php.evidence.json | 15 + .../www/public/tikiwiki/tiki-webmail.php | 977 ++++ .../tikiwiki/tiki-webmail.php.evidence.json | 15 + 124 files changed, 60961 insertions(+) create mode 100644 var/www/hosting/archline.hu/tcexam/admin/code/tce_functions_upload.php create mode 100644 var/www/hosting/archline.hu/tcexam/admin/code/tce_functions_upload.php.evidence.json create mode 100644 var/www/hosting/archlinexp.com/partners/application/controllers/admin.php create mode 100644 var/www/hosting/archlinexp.com/partners/application/controllers/admin.php.evidence.json create mode 100644 var/www/hosting/archlinexp.com/partners/application/controllers/collection.php create mode 100644 var/www/hosting/archlinexp.com/partners/application/controllers/collection.php.evidence.json create mode 100644 var/www/hosting/archlinexp.com/partners/application/controllers/forum.php create mode 100644 var/www/hosting/archlinexp.com/partners/application/controllers/forum.php.evidence.json create mode 100644 var/www/hosting/archlinexp.com/partners/application/controllers/forum.php~ create mode 100644 var/www/hosting/archlinexp.com/partners/application/controllers/forum.php~.evidence.json create mode 100644 var/www/hosting/archlinexp.com/partners/application/controllers/groups.php create mode 100644 var/www/hosting/archlinexp.com/partners/application/controllers/groups.php.evidence.json create mode 100644 var/www/hosting/archlinexp.com/partners/application/controllers/objects.php create mode 100644 var/www/hosting/archlinexp.com/partners/application/controllers/objects.php.evidence.json create mode 100644 var/www/hosting/archlinexp.com/partners/application/controllers/projects.php create mode 100644 var/www/hosting/archlinexp.com/partners/application/controllers/projects.php.evidence.json create mode 100644 var/www/hosting/archlinexp.com/partners/application/controllers/testforum.php create mode 100644 var/www/hosting/archlinexp.com/partners/application/controllers/testforum.php.evidence.json create mode 100644 var/www/hosting/archlinexp.com/partners/application/helpers/sajatfeltolto.php create mode 100644 var/www/hosting/archlinexp.com/partners/application/helpers/sajatfeltolto.php.evidence.json create mode 100644 var/www/hosting/archlinexp.com/partners/application/views/objects/submit.php create mode 100644 var/www/hosting/archlinexp.com/partners/application/views/objects/submit.php.evidence.json create mode 100644 var/www/hosting/archlinexp.com/partners/application/views/projects/submit.php create mode 100644 var/www/hosting/archlinexp.com/partners/application/views/projects/submit.php.evidence.json create mode 100644 var/www/hosting/archlinexp.com/partners/public/order/nonpro.php create mode 100644 var/www/hosting/archlinexp.com/partners/public/order/nonpro.php.evidence.json create mode 100644 var/www/hosting/archlinexp.com/partners/public/order/szerver.php create mode 100644 var/www/hosting/archlinexp.com/partners/public/order/szerver.php.evidence.json create mode 100644 var/www/hosting/archlinexp.com/partners/public/order/szerver2.php create mode 100644 var/www/hosting/archlinexp.com/partners/public/order/szerver2.php.evidence.json create mode 100644 var/www/hosting/archlinexp.com/partners/public/order/uploadDocument.php create mode 100644 var/www/hosting/archlinexp.com/partners/public/order/uploadDocument.php.evidence.json create mode 100644 var/www/hosting/archlinexp.com/partners/public/resourcemanager/uploader.php create mode 100644 var/www/hosting/archlinexp.com/partners/public/resourcemanager/uploader.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/clusers/clusers/.svn/text-base/user_new_submit.php.svn-base create mode 100644 var/www/hosting/cadline.hu/clusers/clusers/.svn/text-base/user_new_submit.php.svn-base.evidence.json create mode 100644 var/www/hosting/cadline.hu/clusers/clusers/user_new_submit.php create mode 100644 var/www/hosting/cadline.hu/clusers/clusers/user_new_submit.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/clusers/clusers_eng/.svn/text-base/user_new_submit.php.svn-base create mode 100644 var/www/hosting/cadline.hu/clusers/clusers_eng/.svn/text-base/user_new_submit.php.svn-base.evidence.json create mode 100644 var/www/hosting/cadline.hu/clusers/clusers_eng/user_new_submit.php create mode 100644 var/www/hosting/cadline.hu/clusers/clusers_eng/user_new_submit.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/clusers/clusers_spa/user_new_submit.php create mode 100644 var/www/hosting/cadline.hu/clusers/clusers_spa/user_new_submit.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/clusers/editcrm/user_new_submit.php create mode 100644 var/www/hosting/cadline.hu/clusers/editcrm/user_new_submit.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/crm/public/application/helpers/sajatfeltolto.php create mode 100644 var/www/hosting/cadline.hu/crm/public/application/helpers/sajatfeltolto.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/crm.cadline.hu/application/helpers/sajatfeltolto.php create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/crm.cadline.hu/application/helpers/sajatfeltolto.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/admin.php create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/admin.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/collection.php create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/collection.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/forum.php create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/forum.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/forum.php~ create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/forum.php~.evidence.json create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/groups.php create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/groups.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/objects.php create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/objects.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/projects.php create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/projects.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/testforum.php create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/testforum.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/helpers/sajatfeltolto.php create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/helpers/sajatfeltolto.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/views/objects/submit.php create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/views/objects/submit.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/views/projects/submit.php create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/views/projects/submit.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/nonpro.php create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/nonpro.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/szerver.php create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/szerver.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/szerver2.php create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/szerver2.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/sub.archline.hu/components/com_showroom/views/upload/view.html.php create mode 100644 var/www/hosting/cadline.hu/dev/php7_update/sub.archline.hu/components/com_showroom/views/upload/view.html.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/dev/tcexam/admin/code/tce_functions_upload.php create mode 100644 var/www/hosting/cadline.hu/dev/tcexam/admin/code/tce_functions_upload.php.evidence.json create mode 100755 var/www/hosting/cadline.hu/www/application/controllers/admin.php create mode 100644 var/www/hosting/cadline.hu/www/application/controllers/admin.php.evidence.json create mode 100755 var/www/hosting/cadline.hu/www/application/controllers/collection.php create mode 100644 var/www/hosting/cadline.hu/www/application/controllers/collection.php.evidence.json create mode 100755 var/www/hosting/cadline.hu/www/application/controllers/forum.php create mode 100644 var/www/hosting/cadline.hu/www/application/controllers/forum.php.evidence.json create mode 100755 var/www/hosting/cadline.hu/www/application/controllers/forum.php~ create mode 100644 var/www/hosting/cadline.hu/www/application/controllers/forum.php~.evidence.json create mode 100755 var/www/hosting/cadline.hu/www/application/controllers/groups.php create mode 100644 var/www/hosting/cadline.hu/www/application/controllers/groups.php.evidence.json create mode 100755 var/www/hosting/cadline.hu/www/application/controllers/objects.php create mode 100644 var/www/hosting/cadline.hu/www/application/controllers/objects.php.evidence.json create mode 100755 var/www/hosting/cadline.hu/www/application/controllers/projects.php create mode 100644 var/www/hosting/cadline.hu/www/application/controllers/projects.php.evidence.json create mode 100755 var/www/hosting/cadline.hu/www/application/controllers/testforum.php create mode 100644 var/www/hosting/cadline.hu/www/application/controllers/testforum.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/www/application/helpers/sajatfeltolto.php create mode 100644 var/www/hosting/cadline.hu/www/application/helpers/sajatfeltolto.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/www/application/views/objects/submit.php create mode 100644 var/www/hosting/cadline.hu/www/application/views/objects/submit.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/www/application/views/projects/submit.php create mode 100644 var/www/hosting/cadline.hu/www/application/views/projects/submit.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/www/public/mysqldumper/filemanagement.php create mode 100644 var/www/hosting/cadline.hu/www/public/mysqldumper/filemanagement.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/www/public/mysqldumper/install.php create mode 100644 var/www/hosting/cadline.hu/www/public/mysqldumper/install.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/www/public/resourcemanager/uploader.php create mode 100644 var/www/hosting/cadline.hu/www/public/resourcemanager/uploader.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/www/public/swf/upload/upload-file.php create mode 100644 var/www/hosting/cadline.hu/www/public/swf/upload/upload-file.php.evidence.json create mode 100755 var/www/hosting/cadline.hu/www/public/tcexam/admin/code/tce_functions_upload.php create mode 100644 var/www/hosting/cadline.hu/www/public/tcexam/admin/code/tce_functions_upload.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/www/public/tikiwiki/tiki-edit_article.php create mode 100644 var/www/hosting/cadline.hu/www/public/tikiwiki/tiki-edit_article.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/www/public/tikiwiki/tiki-edit_submission.php create mode 100644 var/www/hosting/cadline.hu/www/public/tikiwiki/tiki-edit_submission.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/www/public/tikiwiki/tiki-editpage.php create mode 100644 var/www/hosting/cadline.hu/www/public/tikiwiki/tiki-editpage.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/www/public/tikiwiki/tiki-map_upload.php create mode 100644 var/www/hosting/cadline.hu/www/public/tikiwiki/tiki-map_upload.php.evidence.json create mode 100644 var/www/hosting/cadline.hu/www/public/tikiwiki/tiki-webmail.php create mode 100644 var/www/hosting/cadline.hu/www/public/tikiwiki/tiki-webmail.php.evidence.json diff --git a/var/www/hosting/archline.hu/tcexam/admin/code/tce_functions_upload.php b/var/www/hosting/archline.hu/tcexam/admin/code/tce_functions_upload.php new file mode 100644 index 0000000..26042cc --- /dev/null +++ b/var/www/hosting/archline.hu/tcexam/admin/code/tce_functions_upload.php @@ -0,0 +1,122 @@ +. +// +// Additionally, you can't remove, move or hide the original TCExam logo, +// copyrights statements and links to Tecnick.com and TCExam websites. +// +// See LICENSE.TXT file for more information. +//============================================================+ + +/** + * @file + * Functions to upload files. + * @package com.tecnick.tcexam.admin + * @author Nicola Asuni + * @since 2001-11-19 + */ + +/** + * Check if the uploaded file extension is allowed. + * @author Nicola Asuni + * @since 2001-11-19 + * @param $filename (string) the filename + * @return true in case of allowed file type, false otherwise + */ +function F_is_allowed_upload($filename) { + if (!defined('K_ALLOWED_UPLOAD_EXTENSIONS')) { + return false; + } + $allowed_extensions = unserialize(K_ALLOWED_UPLOAD_EXTENSIONS); + $path_parts = pathinfo($filename); + if (in_array(strtolower($path_parts['extension']), $allowed_extensions)) { + return true; + } + return false; +} + +/** + * Uploads image file to the server. + * @author Nicola Asuni + * @since 2010-06-12 + * @param $fieldname (string) form field name containing the source file path + * @param $uploaddir (string) upload directory + * @return mixed file name or false in case of error + */ +function F_upload_file($fieldname, $uploaddir) { + global $l; + require_once('../config/tce_config.php'); + // sanitize file name + $filename = preg_replace('/[\s]/', '_', $_FILES[$fieldname]['name']); + $filename = preg_replace('/[^a-zA-Z0-9_\.\-]/', '', $filename); + $filepath = $uploaddir.$filename; + if (F_is_allowed_upload($filename) AND move_uploaded_file($_FILES[$fieldname]['tmp_name'], $filepath)) { + F_print_error('MESSAGE', htmlspecialchars($filename).': '.$l['m_upload_yes']); + return $filename; + } + F_print_error('ERROR', htmlspecialchars($filename).': '.$l['m_upload_not'].''); + return FALSE; +} + +/** + * returns the file size in bytes + * @author Nicola Asuni + * @since 2001-11-19 + * @param $filetocheck (string) file to check (local path or URL) + * @return mixed file size in bytes or false in case of error + */ +function F_read_file_size($filetocheck) { + global $l; + require_once('../config/tce_config.php'); + $filesize = 0; + if($fp = fopen($filetocheck, 'rb')) { + $s_array = fstat($fp); + if($s_array['size']) { + $filesize = $s_array['size']; + } else {//read size from remote file (very slow function) + while(!feof($fp)) { + $content = fread($fp, 1); + $filesize++; + } + } + fclose($fp); + return($filesize); + } + F_print_error('ERROR', basename($filetocheck).': '.$l['m_openfile_not']); + return FALSE; +} + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/var/www/hosting/archline.hu/tcexam/admin/code/tce_functions_upload.php.evidence.json b/var/www/hosting/archline.hu/tcexam/admin/code/tce_functions_upload.php.evidence.json new file mode 100644 index 0000000..e82ec12 --- /dev/null +++ b/var/www/hosting/archline.hu/tcexam/admin/code/tce_functions_upload.php.evidence.json @@ -0,0 +1,15 @@ +{ + "finding_ref": "4830", + "log_excerpt": "[quarantine] tcexam.archline.hu:admin/code/tce_functions_upload.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/archline.hu/tcexam/admin/code/tce_functions_upload.php)", + "original_sha256": "73b304e867c9d32a20013d492c8d8d2614acd86580427b378b1be524576311e5", + "original_stat": { + "gid": 30037, + "mtime": 1599048198, + "size": 3943, + "uid": 11669 + }, + "rel_path": "admin/code/tce_functions_upload.php", + "result": "quarantined", + "timestamp": "20260718T160424Z", + "vhost": "tcexam.archline.hu" +} diff --git a/var/www/hosting/archlinexp.com/partners/application/controllers/admin.php b/var/www/hosting/archlinexp.com/partners/application/controllers/admin.php new file mode 100644 index 0000000..c85e4e7 --- /dev/null +++ b/var/www/hosting/archlinexp.com/partners/application/controllers/admin.php @@ -0,0 +1,4647 @@ +uri->segment(2) == 'login') { + } else { + if (isset($this->muser->user['admin']) && $this->muser->user['admin'] === true) { + $this->lang->load('admin', $this->muser->user['admin_lang']); + } else { + redirect(PREURL . 'admin/login'); + } + } + } + + function login() + { + + $lang = $this->uri->segment(3); + + if ($lang == 'jap') { + $this->muser->user['lang'] = 'jap'; + + unset($this->muser->user['admin']); + unset($this->muser->user['admin_lang']); + $this->phpsession->save('user', $this->muser->user); + redirect('/admin/login'); + } elseif ($lang == 'gr') { + $this->muser->user['lang'] = 'gr'; + + unset($this->muser->user['admin']); + unset($this->muser->user['admin_lang']); + $this->phpsession->save('user', $this->muser->user); + redirect('/admin/login'); + } elseif ($lang == 'cr') { + $this->muser->user['lang'] = 'cr'; + + unset($this->muser->user['admin']); + unset($this->muser->user['admin_lang']); + $this->phpsession->save('user', $this->muser->user); + redirect('/admin/login'); + } elseif ($lang == 'ita') { + $this->muser->user['lang'] = 'ita'; + + unset($this->muser->user['admin']); + unset($this->muser->user['admin_lang']); + $this->phpsession->save('user', $this->muser->user); + redirect('/admin/login'); + } + + + $passwd = $this->input->post('passwd'); + if (!$passwd) { + $data['admin'] = true; + $data['tartalom'] = 'admin/login'; + $data['csik'] = array('home', 'admin', 'adminlogin'); + $this->load->view('site', $data); + } else { + $accounts = $this->config->item('accounts'); + + if (in_array($passwd, $accounts) && $accounts[$this->muser->user['lang']] == $passwd) { + $this->muser->user['admin'] = true; + //$this->muser->user['admin_lang']=array_search($passwd,$this->config->item('accounts')); + $this->muser->user['admin_lang'] = $this->muser->user['lang']; + + $this->phpsession->save('user', $this->muser->user); + + redirect(PREURL . 'admin'); + } else { + $data['error'] = 'Hibás jelszó'; + $data['admin'] = true; + $data['tartalom'] = 'admin/login'; + $data['csik'] = array('home', 'admin', 'adminlogin'); + $this->load->view('site', $data); + } + } + } + + function error_log() + { + $yesterday = date("Y-m-d", strtotime("-1 days")); + if (file_exists('/home/cadline/public_html/website/system/logs/log-' . $yesterday . '.php')) { + exec('mail -s "Log file for date: ' . $yesterday . '" abartha84@gmail.com < /home/cadline/public_html/website/system/logs/log-' . $yesterday . '.php'); + } else { + exec('echo "No log file!" | mail -s "Log file for date: ' . $yesterday . '" abartha84@gmail.com'); + } + + redirect('admin'); + } + + function index() + { + $data['admin'] = true; + $data['title'] = 'ARCHLine.XP Admin'; + $data['tartalom'] = 'admin/index'; + $data['csik'] = array('home', 'admin'); + + + $num_dl_trial = $this->db->select("count(*) as c")->where('stat_version', 'trial')->get('download_stats')->row()->c; + $num_dl_student = $this->db->select("count(*) as c")->where('stat_version', 'student')->get('download_stats')->row()->c; + $sum = $num_dl_student + $num_dl_trial; + $num_dl_interior = $this->db->select("count(*) as c")->where('stat_version', 'interior')->get('download_stats')->row()->c; + $num_dl_free = $this->db->select("count(*) as c")->where('stat_version', 'free')->get('download_stats')->row()->c; + + $sum = $num_dl_student + $num_dl_trial + $num_dl_interior + $num_dl_free; + $data['dl_trial_percent'] = floor(($num_dl_trial / $sum) * 100); + $data['dl_student_percent'] = floor(($num_dl_student / $sum) * 100); + $data['dl_interior_percent'] = floor(($num_dl_interior / $sum) * 100); + $data['dl_free_percent'] = floor(($num_dl_free / $sum) * 100); + + + $num_act_trial = $this->db->select("count(*) as c")->where('act_version', 'trial')->get('activations')->row()->c; + $num_act_student = $this->db->select("count(*) as c")->where('act_version', 'student')->get('activations')->row()->c; + // $num_act_interior = $this->db->select("count(*) as c")->where('act_version','interior')->get('activations')->row()->c; + $num_act_full = $this->db->select("count(*) as c")->where('act_version', 'full')->get('activations')->row()->c; + + $sum = $num_act_student + $num_act_trial + $num_act_full; + $data['act_trial_percent'] = floor(($num_act_trial / $sum) * 100); + $data['act_student_percent'] = floor(($num_act_student / $sum) * 100); + // $data['act_interior_percent'] = floor(($num_act_interior/$sum)*100); + $data['act_full_percent'] = floor(($num_act_full / $sum) * 100); + + // LT letöltés próba + $this->load->helper('file'); + $data['lt_counter'] = read_file('lt_counter.txt'); + // vége + + + $this->load->view('site', $data); + } + + function act_stat() + { + $data['admin'] = true; + $data['tartalom'] = 'admin/act_stat'; + $data['csik'] = array('home', 'admin'); + + $from = $this->uri->segment(3); + if (!$from || !is_numeric($from)) { + $from = 0; + } + $this->load->library('pagination'); + + $config['base_url'] = '/admin/act_stat2/'; + $config['total_rows'] = $this->db->select('count(*) as c')->get('activations')->row()->c; + $config['per_page'] = '100'; + $config['full_tag_open'] = '
'; + $config['full_tag_close'] = '
'; + + $config['last_link'] = 'Utolsó'; + $config['first_link'] = 'Első'; + + $config['cur_tag_open'] = ''; + $config['cur_tag_close'] = ''; + + $this->pagination->initialize($config); + + $data['stats'] = $this->db->orderby('act_date', 'desc')->limit($config['per_page'], $from)->get('activations')->result(); + $this->load->view('site', $data); + } + + function act_stat2() + { + $data['admin'] = true; + $data['tartalom'] = 'admin/act_stat2'; + $data['csik'] = array('home', 'admin'); + + + $from = $this->uri->segment(3); + if (!$from || !is_numeric($from)) { + $from = 0; + } + $this->load->library('pagination'); + + $config['base_url'] = '/admin/act_stat2/'; + $config['total_rows'] = $this->db->select('count(*) as c')->get('activations2')->row()->c; + $config['per_page'] = '100'; + $config['full_tag_open'] = '
'; + $config['full_tag_close'] = '
'; + + $config['last_link'] = 'Utolsó'; + $config['first_link'] = 'Első'; + + $config['cur_tag_open'] = ''; + $config['cur_tag_close'] = ''; + + $this->pagination->initialize($config); + + $data['stats'] = $this->db->orderby('act_date', 'desc')->limit($config['per_page'], $from)->get('activations2')->result(); + + $this->load->view('site', $data); + } + + function promo_mail_stat() + { + $data['admin'] = true; + $data['tartalom'] = 'admin/promo_mail_stat'; + $data['csik'] = array('home', 'admin'); + + + $from = $this->uri->segment(3); + if (!$from || !is_numeric($from)) { + $from = 0; + } + $this->load->library('pagination'); + + $config['base_url'] = '/admin/promo_mail_stat/'; + $config['total_rows'] = $this->db->select('count(*) as c')->get('promo_mail')->row()->c; + $config['per_page'] = '100'; + $config['full_tag_open'] = '
'; + $config['full_tag_close'] = '
'; + + $config['last_link'] = 'Utolsó'; + $config['first_link'] = 'Első'; + + $config['cur_tag_open'] = ''; + $config['cur_tag_close'] = ''; + + $this->pagination->initialize($config); + + //get the stats + $data['stats'] = $this->db->orderby('date', 'desc')->limit($config['per_page'], $from)->get('promo_mail')->result(); + + //get the mail types + $data['types'] = $this->db->select('type')->distinct()->orderby('type', 'ASC')->get('promo_mail')->result(); + + //get the count for each type + foreach ($data['types'] as $t) { + $data['counts'][$t->type] = $this->db->select('COUNT(`id`) as count')->where('type', $t->type)->get('promo_mail')->result(); + $data['counts_dist'][$t->type] = $this->db->select('COUNT(DISTINCT(`email`)) as count_dist')->where('type', $t->type)->get('promo_mail')->result(); + } + + $this->load->view('site', $data); + } + + function promo_iroda() + { + $strEmails = ''; + $strType = $this->uri->segment(3); + + $emailek = $this->db->select('DISTINCT(`email`)')->where('type', $strType)->get('promo_mail')->result(); + + foreach ($emailek as $e) { + $strEmails .= $e->email . "\n"; + } + + $data = array('emailek' => $strEmails); + + echo $this->do_post_request('http://iroda/clusers_test/clusers/search_by_email_post', $data); + } + + function do_post_request($url, $data, $optional_headers = null) + { + $params = array( + 'http' => array( + 'method' => 'post', + 'content' => $data + ) + ); + + if ($optional_headers !== null) { + $params['http']['header'] = $optional_headers; + } + + $ctx = stream_context_create($params); + $fp = @fopen($url, 'rb', false, $ctx); + + if (!$fp) { + throw new Exception("Problem with $url, $php_errormsg"); + } + + $response = @stream_get_contents($fp); + + if ($response === false) { + throw new Exception("Problem reading data from $url, $php_errormsg"); + } + + return $response; + } + + function dl_stat() + { + $data['admin'] = true; + $data['tartalom'] = 'admin/dl_stat'; + $data['csik'] = array('home', 'admin'); + + + $from = $this->uri->segment(3); + if (!$from || !is_numeric($from)) { + $from = 0; + } + $this->load->library('pagination'); + + $config['base_url'] = '/admin/dl_stat/'; + $config['total_rows'] = $this->db->select('count(*) as c')->get('download_stats')->row()->c; + $config['per_page'] = '100'; + $config['full_tag_open'] = '
'; + $config['full_tag_close'] = '
'; + + $config['last_link'] = 'Utolsó'; + $config['first_link'] = 'Első'; + + $config['cur_tag_open'] = ''; + $config['cur_tag_close'] = ''; + + $this->pagination->initialize($config); + + $data['ctrs'] = array('hun' => 'magyar', 'ita' => 'olasz', 'aus' => 'osztrák', 'che' => 'cseh', 'cro' => 'horvát', 'ger' => 'német', 'gre' => 'görög', 'jap' => 'japán', 'spa' => 'spanyol', 'kor' => 'koreai', 'pol' => 'lengyel', 'mex' => 'mexikói', 'ser' => 'szerb', 'ben' => 'benelux', 'uk' => 'angol'); + + $data['stats'] = $this->db->orderby('stat_date', 'desc')->limit($config['per_page'], $from)->get('download_stats')->result(); + + $this->load->view('site', $data); + } + + function dl_stat_xls() + { + if ($this->uri->segment(3)) { + $ctr = $this->uri->segment(3); + + switch ($ctr) { + case 'hun': + $ctr_where = "stat_country = 'Magyarország' OR stat_country = 'Hungary'"; + break; + case 'ita': + $ctr_where = "stat_country = 'Olaszország' OR stat_country = 'Italy'"; + break; + case 'aus': + $ctr_where = "stat_country = 'Ausztria' OR stat_country = 'Austria'"; + break; + case 'che': + $ctr_where = "stat_country = 'Csehország' OR stat_country = 'Czech Republic'"; + break; + case 'cro': + $ctr_where = "stat_country = 'Horvátország' OR stat_country = 'Croatia'"; + break; + case 'ger': + $ctr_where = "stat_country = 'Németország' OR stat_country = 'Germany'"; + break; + case 'gre': + $ctr_where = "stat_country = 'Görögország' OR stat_country = 'Greece'"; + break; + case 'jap': + $ctr_where = "stat_country = 'Japán' OR stat_country = 'Japan' OR stat_country = 'jap'"; + break; + case 'spa': + $ctr_where = "stat_country = 'Spanyolország' OR stat_country = 'Spain'"; + break; + case 'kor': + $ctr_where = "stat_country = 'Dél-Korea' OR stat_country = 'Korea, South'"; + break; + case 'pol': + $ctr_where = "stat_country = 'Lengyelország' OR stat_country = 'Poland'"; + break; + case 'mex': + $ctr_where = "stat_country = 'Mexikó' OR stat_country = 'Mexico'"; + break; + case 'ser': + $ctr_where = "stat_country = 'Szerbia' OR stat_country = 'Serbia'"; + break; + case 'ben': + $ctr_where = "stat_country = 'Hollandia' OR stat_country = 'Belgium' OR stat_country = 'Luxemburg' OR stat_country = 'Netherlands'"; + break; + case 'uk': + $ctr_where = "stat_country = 'United Kingdom' OR stat_country = 'Egyesült Királyság'"; + break; + default: + $ctr_where = "stat_country = ''"; + break; + } + + $stats = $this->db->orderby('stat_date', 'desc')->where('stat_email!=', '0')->where($ctr_where)->get('download_stats')->result(); + } else + $stats = $this->db->orderby('stat_date', 'desc')->where('stat_email!=', '0')->where('stat_date>1325385015')->get('download_stats')->result(); + + $this->load->library('Excel'); + + $workbook = new Excel(); + + //sending header and creating a worksheet + $workbook->send('download_stat.xls'); + $workbook->setVersion(8); + $worksheet = $workbook->addWorksheet('Download Stats'); + + //setting encoding + $worksheet->setInputEncoding('UTF-8'); + + //bold formating + $fm_ttl = $workbook->addFormat(); + $fm_ttl->setBold(); + $fm_ttl->setAlign('equal_space'); + + //set the titles + $worksheet->write(0, 0, 'Dátum', $fm_ttl); + $worksheet->write(0, 1, 'Név', $fm_ttl); + $worksheet->write(0, 2, 'Email', $fm_ttl); + $worksheet->write(0, 3, 'Tel', $fm_ttl); + $worksheet->write(0, 4, 'Ország', $fm_ttl); + $worksheet->write(0, 5, 'Típus', $fm_ttl); + + //populate the worksheet + $i = 1; + foreach ($stats as $s) { + $worksheet->write($i, 0, date('Y-m-d', $s->stat_date)); + $worksheet->write($i, 1, $s->stat_first); + $worksheet->write($i, 2, $s->stat_email); + $worksheet->write($i, 3, $s->stat_tel); + $worksheet->write($i, 4, $s->stat_country); + $worksheet->write($i, 5, $s->stat_version); + $i++; + } + + $workbook->close(); + } + + + function forum_xls() + { + $stats = $this->db->orderby('datum', 'desc')->where('nUserID IS NOT NULL')->where('datum IS NOT NULL')->where('szabaly!=', '0')->get('`cadline2`.`forum_user`')->result(); + + $this->load->library('Excel'); + + $workbook = new Excel(); + + //sending header and creating a worksheet + $workbook->send('forum_belepok.xls'); + $workbook->setVersion(8); + $worksheet = $workbook->addWorksheet('Download Stats'); + + //setting encoding + $worksheet->setInputEncoding('UTF-8'); + + //bold formating + $fm_ttl = $workbook->addFormat(); + $fm_ttl->setBold(); + $fm_ttl->setAlign('equal_space'); + + //set the titles + $worksheet->write(0, 0, 'Dátum', $fm_ttl); + $worksheet->write(0, 1, 'Név', $fm_ttl); + $worksheet->write(0, 2, 'Email', $fm_ttl); + $worksheet->write(0, 3, 'nUserID', $fm_ttl); + + //populate the worksheet + $i = 1; + foreach ($stats as $s) { + $worksheet->write($i, 0, $s->datum); + $worksheet->write($i, 1, $s->nev); + $worksheet->write($i, 2, $s->email); + $worksheet->write($i, 3, $s->nUserID); + $i++; + } + + $workbook->close(); + } + + + function db_backup() + { + $this->load->helper('file'); + $this->load->library('zip'); + + $name = 'db-backup-' . date("Y-m-d-H-i-s"); + + file_exists("backup.sql") ? @unlink("backup.sql") : ""; + file_exists("backup.tgz") ? @unlink("backup.tgz") : ""; + + exec("mysqldump -ucadline cadline2 > backup.sql"); + + $this->zip->add_data($name . '.sql', read_file("backup.sql")); + $this->zip->download($name . '.sql.zip'); + + file_exists("backup.sql") ? @unlink("backup.sql") : ""; + } + + function services() + { + $data['flashinfok'] = $this->db->query("SELECT * FROM service_flash WHERE position > 0 ORDER BY service, position")->result(); + + $data['admin'] = true; + $data['aktiv'] = 14; + $data['tartalom'] = 'admin/services'; + $data['csik'] = array('home', 'admin'); + $data['javascript'] = array('admin_settings'); + $this->load->view('site', $data); + } + + function set_services() + { + $idk = $this->input->post('idk'); + $pozok = $this->input->post('poz'); + $fajlok = $this->input->post('fajl'); + $feltoltott_fajlok = $this->input->post('fajlfel'); + $mpk = $this->input->post('mp'); + $temak = $this->input->post('service'); + $delek = $this->input->post('del'); + + foreach ($idk as $id) { + $del = $delek[$id]; + if ($del == "on") { + $this->db->query("UPDATE service_flash SET position = 0 WHERE id = {$id}"); + } else { + // új kép feltöltése ha van + $this->kep2($fajlok[$id], 'public/img/services/reel', $_FILES["fajlfel"], $id); + + $uj->position = $pozok[$id]; + $uj->filename = $fajlok[$id]; + $uj->runtime = $mpk[$id]; + $uj->service = $temak[$id]; + + $this->db->update('service_flash', $uj, "id={$id}"); + //$this->mflashreel->edit($uj,$id); + } + } + + // ha van új, akkor beszúrjuk + $uj_del = $this->input->post('uj_del'); + if ($uj_del != "on") { + $kep = $this->input->post('uj_fajl'); + + // új kép feltöltése ha van + $this->kep3($kep, 'public/img/services/reel', 'uj_fajlfel'); + + $uj->position = $this->input->post('uj_poz'); + $uj->filename = $kep; + $uj->runtime = $this->input->post('uj_mp'); + $uj->service = $this->input->post('uj_service'); + + $this->db->insert('service_flash', $uj); + //$this->mflashreel->newrow($uj); + } + + redirect('admin/services'); + } + + + function settings() + { + $settings = $this->db->where('lang', $this->muser->user['lang'])->get('settings'); + if ($settings->num_rows() == 0) { + $data['settings'] = false; + } else { + $data['settings'] = $settings->result(); + } + + $settings->free_result(); + + $nyelv = $this->muser->user['admin_lang']; + + $foolaliinfok = $this->db->query("SELECT * FROM welcome_box WHERE (sorszam_2014>0 or sorszam_2014=-1) AND nyelv='{$nyelv}' ORDER BY sorszam_2014")->result(); + + foreach ($foolaliinfok as $doboz) { + $doboz->infok = $this->db->query("SELECT * FROM welcome_info WHERE doboz=" . $doboz->id . " AND (sorszam>0 or sorszam=-1) AND nyelv='{$nyelv}' ORDER BY sorszam")->result(); + } + + $data['fooldalinfok'] = $foolaliinfok; + $data['info_json'] = json_encode($foolaliinfok); + $data['info_fo_json'] = json_encode($this->db->query("SELECT * FROM welcome_info WHERE sorszam=200 AND nyelv='{$nyelv}' ORDER BY sorszam")->result()); + + $kepek = $this->muser->get_welcome_img(); + $data['kepek'] = $kepek; + + $bannerek = $this->db->query("SELECT * FROM welcome_banner2 WHERE position>0 AND lang='{$nyelv}' ORDER BY position ASC")->result(); + $data['bannerek'] = $bannerek; + + $data['admin'] = true; + $data['aktiv'] = 9; + $data['tartalom'] = 'admin/settings'; + $data['csik'] = array('home', 'admin'); + $data['javascript'] = array('admin_settings', 'jquery_ui', 'ui.datepicker-hu'); + $data['style'] = array('jquery.ui'); + $this->load->view('site', $data); + } + + function boxedit() + { + $id = $this->input->post('id'); + $tomb['cim_2014'] = $this->input->post('cim_2014'); + $tomb['sorszam_2014'] = $this->input->post('sorszam_2014'); + + // tartalom kép csere + if ($_FILES["kep"]["error"] == 0) { + include('application/helpers/sajatfeltolto.php'); + $hova = "public/img/welcome/2014/"; + $ujkep = feltolt("kep", $hova, 'icon_' . $_FILES["kep"]["name"], true); + + // átméretezés + include('application/helpers/myimg_helper.php'); + kemeretezesvagassh($ujkep, $ujkep, 41, 41); + chmod($ujkep, 0777); + } + + if ($ujkep) { + $tomb['kep'] = basename($ujkep); + } + + if ($id == "uj") { + $tomb['nyelv'] = $this->muser->user['admin_lang']; + $this->db->insert('welcome_box', $tomb); + } else { + $this->db->update('welcome_box', $tomb, "id={$id}"); + } + //$this->cache->delete('welcome-dobozok-'.$nyelv); + //$this->cache->delete('foinfo-dobozok-'.$nyelv); + + redirect('admin/settings'); + } + + function delwelbox() + { + $id = $this->uri->segment(3); + $this->db->update('welcome_box', array('sorszam' => 0), "id={$id}"); + + //$this->cache->delete('foinfo-dobozok-hun'); + //$this->cache->delete('foinfo-dobozok-eng'); + redirect('admin/settings'); + } + + function infoedit() + { + $i_id = $this->input->post('info_id'); + $doboz = $this->input->post('doboz'); + $sorszam = $this->input->post('sorszam'); + $cim = $this->input->post('cim_2014'); + $info = $this->input->post('info'); + $link = $this->input->post('link'); + $link_cim = $this->input->post('link_cim'); + $ujkep = ""; + + $nyelv = $this->muser->user['admin_lang']; + + $tomb = array( + 'doboz' => $doboz, + 'sorszam' => $sorszam, + 'cim_2014' => $cim, + 'info' => $info, + 'link' => $link, + 'link_cim' => $link_cim + ); + + // tartalom kép csere + if ($_FILES["kep"]["error"] == 0) { + include('application/helpers/sajatfeltolto.php'); + $hova = "public/img/welcome/{$nyelv}/"; + $ujkep = feltolt("kep", $hova, $_FILES["kep"]["name"], true); + + // átméretezés + include('application/helpers/myimg_helper.php'); + kemeretezesvagassh($ujkep, $ujkep, 110, 60); + chmod($ujkep, 0777); + } + + if ($ujkep) { + $tomb['kep'] = $ujkep; + } + + // tartalom szerkesztése + if ($i_id == "uj") { + $tomb['nyelv'] = $nyelv; + $this->db->insert('welcome_info', $tomb); + $c_id = mysql_insert_id(); + } else { + $this->db->update('welcome_info', $tomb, "info_id={$i_id}"); + } + + //$this->cache->delete('welcome-dobozok-'.$nyelv); + //$this->cache->delete('foinfo-dobozok-'.$nyelv); + + redirect('admin/settings'); + } + + function foinfoedit() + { + $i_id = $this->input->post('info_id'); + $cim = $this->input->post('cim_2014'); + $info = $this->input->post('info'); + $link = $this->input->post('link'); + + $tomb = array( + 'cim_2014' => $cim, + 'info' => $info, + 'link' => $link + ); + $this->db->update('welcome_info', $tomb, "info_id={$i_id}"); + + //$this->cache->delete('foinfo-dobozok-hun'); + //$this->cache->delete('foinfo-dobozok-eng'); + + redirect('admin/settings'); + } + + function delwelinfo() + { + $i_id = $this->uri->segment(3); + $this->db->update('welcome_info', array('sorszam' => 0), "info_id={$i_id}"); + + $this->cache->delete('foinfo-dobozok-hun'); + $this->cache->delete('foinfo-dobozok-eng'); + redirect('admin/settings'); + } + + function set_settings() + { + $mezonevek = $this->db->query('select name from settings where lang=\'' . $this->muser->user['admin_lang'] . '\''); + foreach ($mezonevek->result() as $mezo) { + $value = mysql_real_escape_string($this->input->post($mezo->name)); + + $this->db->update('settings', array('value' => $value), "name='" . $mezo->name . "' and lang='" . $this->muser->user['admin_lang'] . "'"); + } + + redirect('admin/settings'); + } + + function set_settings_img() + { + + //flash adatok módosítása + $this->load->model('mflashreel'); + $idk = $this->input->post('idk'); + $cimek = $this->input->post('title'); + $pozok = $this->input->post('poz'); + $fajlok = $this->input->post('fajl'); + $feltoltott_fajlok = $this->input->post('fajlfel'); + $linkek = $this->input->post('link'); + $startok = $this->input->post('start'); + $stopok = $this->input->post('stop'); + $delek = $this->input->post('del'); + + foreach ($idk as $id) { + unset($uj); + $del = $delek[$id]; + if ($del == "on") { + $uj->position = 0; + $this->db->update('welcome_banner2', $uj, 'id=' . $id); + } else { + // új kép feltöltése ha van + $this->kep2($fajlok[$id], 'public/img/banner405', $_FILES["fajlfel"], $id); + + $uj->title = $cimek[$id]; + $uj->position = $pozok[$id]; + $uj->filename = $fajlok[$id]; + $uj->link = $linkek[$id]; + $uj->start_date = strtotime($startok[$id]); + $uj->stop_date = strtotime($stopok[$id]); + + $this->db->update('welcome_banner2', $uj, 'id=' . $id); + } + } + + // ha van új, akkor beszúrjuk + $uj_del = $this->input->post('uj_del'); + if ($uj_del != "on") { + $kep = $this->input->post('uj_fajl'); + + // új kép feltöltése ha van + $this->kep3($kep, 'public/img/banner405', 'uj_fajlfel'); + + $uj->lang = hun() ? "hun" : "eng"; + $uj->title = $this->input->post('uj_title'); + $uj->position = $this->input->post('uj_poz'); + $uj->filename = $kep; + $uj->title = $this->input->post('uj_title'); + $uj->link = $this->input->post('uj_link'); + $uj->start_date = strtotime($this->input->post('uj_start')); + $uj->stop_date = strtotime($this->input->post('uj_stop')); + + $this->db->insert('welcome_banner2', $uj); + } + + redirect('admin/settings'); + } + + + function set_settings_video() + { + // videók módosítása + $videokdb = $this->input->post('videokdb'); + for ($i = 0; $i < $videokdb; $i++) { + $welvid_id = $this->input->post('vidwelvid_id' . $i); + $sorszam = $this->input->post('vidsorszam' . $i); + $youtubeid = $this->input->post('vidyoutube' . $i); + $kep = $this->input->post('vidkep' . $i); + $cim = $this->input->post('vidcim' . $i); + $leiras = $this->input->post('vidleiras' . $i); + $torles = $this->input->post('viddel' . $i); + + + $kepuj = 'vidkep' . $i; + + if ($torles == "on") + $sorszam = 0; + + if (hun()) + $lang = "hun"; + else + $lang = "eng"; + + $utvonal = 'public/img/welcome/' . $lang; + + $this->kep3($kepuj, $utvonal, 'vidkep' . $i); + + if ($kepuj != ('vidkep' . $i)) { + $kep = $utvonal . "/" . $kepuj; + } else { + $kep = false; + } + + if ($welvid_id) + $this->muser->set_settings_video($welvid_id, $sorszam, $youtubeid, $kep, $cim, $leiras); + } + + + // új videó + $uj = $this->input->post('ujviddel'); + if ($uj != "on") { + $record->sorszam = $this->input->post('ujvidsorszam'); + $record->youtubeid = $this->input->post('ujvidyoutube'); + // $record->kep = $this->input->post('ujvidkep'); + $record->cim = $this->input->post('ujvidcim'); + $record->leiras = $this->input->post('ujvidleiras'); + + $kepuj = 'ujvidkep'; + + if (hun()) + $lang = "hun"; + else + $lang = "eng"; + + $record->nyelv = $lang; + + $utvonal = 'public/img/welcome/' . $lang; + + $this->kep3($kepuj, $utvonal, 'ujvidkep'); + + if ($kepuj != '') { + $record->kep = $utvonal . "/" . $kepuj; + } else { + // $record->kep = false; + } + + + //$this->muser->new_video($sorszam, $youtubeid, $kep, $cim, $leiras); + $this->db->insert('`welcome_videos`', $record); + } + + redirect("admin/settings"); + } + + + function faq() + { + $this->load->model('mfaq'); + + $data['latest_100'] = $this->mfaq->get_latest(100, $this->muser->user['admin_lang'], true); + $data['admin'] = true; + $data['aktiv'] = 4; + $data['tartalom'] = 'admin/faq'; + $data['csik'] = array('home', 'admin'); + $this->load->view('site', $data); + } + + function events() + { + $this->load->model('mevents'); + + $data['events'] = $this->mevents->get_latest(100, $this->muser->user['admin_lang'], true, false); + $data['admin'] = true; + $data['aktiv'] = 7; + $data['tartalom'] = 'admin/events'; + $data['csik'] = array('home', 'admin'); + $this->load->view('site', $data); + } + + function events_new() + { + $this->load->model('mevents'); + + $data['error'] = false; + + $do = $this->input->post('do'); + + //esemény módosítása + if ($do && $do == 'modositas') { + $post['datum'] = $this->input->post('datum'); + $post['ora_kezdet'] = $this->input->post('ora_kezdet'); + $post['ora_veg'] = $this->input->post('ora_veg'); + $post['perc_kezdet'] = $this->input->post('perc_kezdet'); + $post['perc_veg'] = $this->input->post('perc_veg'); + $post['event_limit'] = $this->input->post('event_limit'); + $post['active'] = $this->input->post('active'); + $post['nev'] = $this->input->post('nev'); + $post['event_id'] = $this->input->post('event_id'); + $post['event_main_id'] = $this->input->post('event_main_id'); + + if ($error = $this->mevents->modifyEvent($post)) { + $data['error'] = $error; + } + } + + //új esemény rögzítése + if ($do && $do == 'rogzites') { + $post['datum'] = $this->input->post('datum'); + $post['ora_kezdet'] = $this->input->post('ora_kezdet'); + $post['ora_veg'] = $this->input->post('ora_veg'); + $post['perc_kezdet'] = $this->input->post('perc_kezdet'); + $post['perc_veg'] = $this->input->post('perc_veg'); + $post['event_limit'] = $this->input->post('event_limit'); + $post['active'] = $this->input->post('active'); + $post['nev'] = $this->input->post('nev'); + $post['event_main_id'] = $this->input->post('event_main_id'); + + if ($error = $this->mevents->createEvent($post)) { + $data['error'] = $error; + } + } + + //főesemény módosítása + if ($do && $do == 'modositas_main') { + $config['upload_path'] = '/home/cadline/public_html/website/public/upload/eng/image/events/banner/'; + $config['allowed_types'] = 'gif|jpg|png'; + $config['max_size'] = '1000'; + $config['overwrite'] = true; + + $this->load->library('upload', $config); + + if (isset($_FILES, $_FILES['kep']['name']) && $_FILES['kep']['name'] != '') { + if (!$this->upload->do_upload('kep')) { + $data['error'] = $this->upload->display_errors('

', '

'); + } else { + $kep = $this->upload->file_name; + } + } else { + $kep = $this->input->post('kep_eredeti'); + } + + $config['upload_path'] = '/home/cadline/public_html/website/public/upload/eng/image/events/banner/thumbs/'; + $config['allowed_types'] = 'gif|jpg|png|swf'; + $config['max_size'] = '1000'; + $config['overwrite'] = true; + + $this->upload->initialize($config); + + if (isset($_FILES, $_FILES['thumb']['name']) && $_FILES['thumb']['name'] != '') { + if (!$this->upload->do_upload('thumb')) { + $data['error'] = $this->upload->display_errors('

', '

'); + } else { + $thumb = $this->upload->file_name; + } + } else { + $thumb = $this->input->post('thumb_eredeti'); + } + + for ($i = 1; $i < 5; $i++) { + if (isset($_FILES['kiskep' . $i]) && $_FILES['kiskep' . $i]["error"] == 0) { + if (!$this->upload->do_upload('kiskep' . $i)) { + $data['error'] = $this->upload->display_errors('

', '

'); + } else { + $kisk = 'elokep' . $i; + $$kisk = $this->upload->file_name; + + // lekicsinyitett valtozat letrehozasa + $helye = substr($config['upload_path'], 0, -1); + $mibol = $config['upload_path'] . $kisk; + include('application/helpers/myimg_helper.php'); + kepmeretezesvagas($mibol, $helye, "elo_" . $kisk, 130, 65); + } + } else { + $kisk = 'elokep' . $i; + $$kisk = $this->input->post('kiskep_eredeti' . $i); + } + } + + if (isset($_FILES['kozepkep']) && $_FILES['kozepkep']["error"] == 0) { + if (!$this->upload->do_upload('kozepkep')) { + $data['error'] = $this->upload->display_errors('

', '

'); + } else { + $kozepkep = 'public/upload/eng/image/events/banner/thumbs/' . $this->upload->file_name; + } + } else { + $kozepkep = $this->input->post('kozepkep_eredeti'); + } + + + if (!$data['error']) { + $post = array( + 'event_main_id' => $this->input->post('event_main_id'), + 'nev' => $this->input->post('nev'), + 'leiras' => substr($this->input->post('leiras'), 0, 500), + 'kep' => $kep, + 'thumb' => $thumb, + 'weboldal' => $this->input->post('weboldal'), + 'archline_oldal' => $this->input->post('archline_oldal'), + 'sikeres_reg_oldal' => $this->input->post('sikeres_reg_oldal'), + 'sikeres_reg_mail' => $this->input->post('sikeres_reg_mail'), + 'reg_torles_oldal' => $this->input->post('reg_torles_oldal'), + 'datum_kezdet' => $this->input->post('datum_kezdet'), + 'ora_kezdet' => $this->input->post('ora_kezdet'), + 'perc_kezdet' => $this->input->post('perc_kezdet'), + 'datum_veg' => $this->input->post('datum_veg'), + 'ora_veg' => $this->input->post('ora_veg'), + 'perc_veg' => $this->input->post('perc_veg'), + 'limit' => $this->input->post('event_main_limit'), + 'active' => $this->input->post('active'), + 'event_view_id' => $this->input->post('event_view_id'), + + 'rss' => $this->input->post('rss'), + + 'elokep1' => $elokep1, + 'elokep2' => $elokep2, + 'elokep3' => $elokep3, + 'elokep4' => $elokep4, + 'kozepkep' => $kozepkep, + 'shorttext' => $this->input->post('rovid_oldal') + ); + + if ($error = $this->mevents->modifyMainEvent($post)) { + $data['error'] = $error; + } + } + } + + //új főesemény létrehozása + if ($do && $do == 'rogzites_main') { + $config['upload_path'] = '/home/cadline/public_html/website/public/upload/eng/image/events/banner/'; + $config['allowed_types'] = 'gif|jpg|png|swf'; + $config['max_size'] = '1000'; + $config['overwrite'] = true; + + $this->load->library('upload', $config); + + if (isset($_FILES, $_FILES['kep']['name']) && $_FILES['kep']['name'] != '') { + if (!$this->upload->do_upload('kep')) { + $data['error'] = $this->upload->display_errors('

', '

'); + } else { + $kep = $this->upload->file_name; + } + } else { + $kep = ''; + } + + $config['upload_path'] = '/home/cadline/public_html/website/public/upload/eng/image/events/banner/thumbs/'; + $config['allowed_types'] = 'gif|jpg|png|swf'; + $config['max_size'] = '1000'; + $config['overwrite'] = true; + + $this->upload->initialize($config); + + if (isset($_FILES, $_FILES['thumb']['name']) && $_FILES['thumb']['name'] != '') { + if (!$this->upload->do_upload('thumb')) { + $data['error'] = $this->upload->display_errors('

', '

'); + } else { + $thumb = $this->upload->file_name; + } + } else { + $thumb = ''; + } + + if (!$data['error']) { + $post = array( + 'nev' => $this->input->post('nev'), + 'leiras' => substr($this->input->post('leiras'), 0, 500), + 'kep' => $kep, + 'thumb' => $thumb, + 'weboldal' => $this->input->post('weboldal'), + 'archline_oldal' => $this->input->post('archline_oldal'), + 'sikeres_reg_oldal' => $this->input->post('sikeres_reg_oldal'), + 'sikeres_reg_mail' => $this->input->post('sikeres_reg_mail'), + 'reg_torles_oldal' => $this->input->post('reg_torles_oldal'), + 'datum_kezdet' => $this->input->post('datum_kezdet'), + 'ora_kezdet' => $this->input->post('ora_kezdet'), + 'perc_kezdet' => $this->input->post('perc_kezdet'), + 'datum_veg' => $this->input->post('datum_veg'), + 'ora_veg' => $this->input->post('ora_veg'), + 'perc_veg' => $this->input->post('perc_veg'), + 'limit' => $this->input->post('event_main_limit'), + 'active' => $this->input->post('active'), + 'lang' => $this->muser->user['admin_lang'], + 'event_view_id' => $this->input->post('event_view_id'), + + 'rss_date' => time(), + 'rss' => $this->input->post('rss') + ); + + if ($error = $this->mevents->createMainEvent($post)) { + $data['error'] = $error; + } + } + } + + //collecting pages + $this->load->model('mpages'); + + if (hun()) { + $category = 'események'; + } else { + $category = 'events'; + } + + $data['event_pages'] = $this->mpages->get_category_pages($category, $this->muser->user['admin_lang'], true, 'page_title', 'asc'); + + //collecting events + $main_events = $this->mevents->getMainEvents($this->muser->user['admin_lang']); + + //creating json for the javascript + + + foreach ($main_events as $main_event) { + $main_event->events_list = $this->mevents->getEvents($main_event->event_main_id); + + $main_event->urlname = $this->db->query("SELECT urlname FROM events_new_main WHERE event_main_id = " . $main_event->event_main_id)->row()->urlname; + + $elokepek = $this->mevents->getEventImages($main_event->event_main_id); + + for ($i = 1; $i < 5; $i++) { + $qaf = "elokep" . $i; + $main_event->$qaf = $elokepek->$qaf; + } + $main_event->kozepkep = $elokepek->kozepkep; + $main_event->shorttext = $elokepek->shorttext; + + if ($main_event->events_list) { + foreach ($main_event->events_list as $event) { + $event->reg_list = $this->mevents->getRegistrations($event->event_id); + } + } + } + + $data['main_events_json'] = json_encode($main_events); + + $data['main_events'] = $main_events; + + //collecting event view types + $event_views = $this->mevents->getEventViews(); + + $data['event_views'] = $event_views; + + $data['admin'] = true; + $data['aktiv'] = 10; + $data['tartalom'] = 'admin/events_new/index'; + $data['csik'] = array('home', 'admin'); + $data['javascript'] = array('jquery_ui', 'ui.datepicker-hu', 'jquery.numeric.pack'); + $data['style'] = array('jquery.ui'); + + $this->load->view('site', $data); + } + + function events_new_event_delete() + { + $this->load->model('mevents'); + + $event_id = $this->uri->segment(3); + + if ($event_id) { + $this->mevents->deleteEventByID($event_id); + $this->cache->delete('archline-klub-idopontok'); + } + + redirect('admin/workshop'); + } + + function events_new_main_event_delete() + { + $this->load->model('mevents'); + + $event_main_id = $this->uri->segment(3); + + if ($event_main_id) { + $this->mevents->deleteMainEventByID($event_main_id); + } + + redirect('admin/workshop'); + } + + function events_new_reg_delete() + { + $this->load->model('mevents'); + + $reg_id = $this->uri->segment(3); + + if ($reg_id && $reg_details = $this->mevents->getRegistrationDetails($reg_id)) { + + //set the email's content and... + $event_main_details = $this->mevents->getMainEventDetails($reg_details->event_main_id); + + $page = $this->mpages->get_row($event_main_details->reg_delete_page); + + //send the email + $this->load->library('email'); + $this->email->initialize(); + $this->email->setFrom('info@archlinexp.com', 'CadLine'); + $this->email->subject($page->page_title); + $this->email->message($page->page_body); + + $this->email->send($reg_details->reg_email, 'smtp'); + + //delete registration + $this->mevents->deleteRegistrationByID($reg_id); + + if ($reg_details->event_main_id == 56) + $this->cache->delete('archline-klub-idopontok'); + } + + redirect('admin/workshop'); + } + + function faqedit() + { + $this->load->model('mfaq'); + + $faq_id = $this->uri->segment(3); + + if (!is_numeric($faq_id) && $faq_id != 'new') { + show_error('Hibás azonosító: ' . $faq_id); + } + + $do = $this->input->post('do'); + if (!$do) + // AKKOR FORM + { + if ($faq_id == 'new') { + $record = $this->mdb->set_empty_object('faq'); + $record->faq_id = $faq_id; + } else { + $record = $this->mfaq->get_row($faq_id); + if (!$record) { + show_error('Nincs ilyen azonosítójú hír: ' . $faq_id); + } + } + + $data['record'] = $record; + $data['admin'] = true; + $data['aktiv'] = 4; + $data['tartalom'] = 'admin/faqedit'; + $data['csik'] = array('home', 'admin'); + + + + $types = $this->config->item('faq_types'); + foreach ($types as $type) { + $data['types'][$type] = $this->lang->line('faq_cat_' . $type); + } + + + $this->load->view('site', $data); + } else + //AKKOR PEDIG ADATBÁZISBEVITEL + { + $record = $this->mdb->set_post_object('faq'); + + $record->faq_lang = $this->muser->user['admin_lang']; + $record->faq_date = time(); + + if ($record->faq_id == 'new') { + unset($record->faq_id); + $this->db->insert('faq', $record); + } else { + unset($record->faq_count); + $this->db->update('faq', $record, 'faq_id=' . $record->faq_id); + } + + redirect('admin/faq'); + } + } + + function eventsedit() + { + $this->load->model('mevents'); + + $event_id = $this->uri->segment(3); + + if (!is_numeric($event_id) && $event_id != 'new') { + show_error('Hibás azonosító: ' . $event_id); + } + + $do = $this->input->post('do'); + if (!$do) + // AKKOR FORM + { + if ($event_id == 'new') { + $record = $this->mdb->set_empty_object('events'); + $record->event_id = $event_id; + + $record->event_ev = $this->mevents->ev; + $record->event_ho = $this->mevents->ho; + $record->event_nap = $this->mevents->nap; + } else { + $record = $this->mevents->get_row($event_id); + if (!$record) { + show_error('Nincs ilyen azonosítójú hír: ' . $event_id); + } + } + + + $data['record'] = $record; + $data['admin'] = true; + $data['aktiv'] = 7; + $data['tartalom'] = 'admin/eventsedit'; + $data['csik'] = array('home', 'admin'); + + + + $this->load->view('site', $data); + } else + //AKKOR PEDIG ADATBÁZISBEVITEL + { + $record = $this->mdb->set_post_object('events'); + + $record->event_title = str_replace('_', ' ', $record->event_title); + + $record->event_title = trim($record->event_title); + + $record->event_lang = $this->muser->user['admin_lang']; + + $record->event_stamp = mktime(0, 0, 0, $record->event_ho, $record->event_nap + 1, $record->event_ev); + + if ($record->event_id == 'new') { + unset($record->event_id); + $this->db->insert('events', $record); + } else { + $this->db->update('events', $record, 'event_id=' . $record->event_id); + } + + + + // többi frissítése + + $this->db->update('events', array('event_text' => $record->event_text), "event_title='" . $record->event_title . "'"); + + + redirect('admin/events'); + } + } + + + function events2sedit() + { + $this->load->model('mevents'); + + $event_id = $this->uri->segment(3); + + if (!is_numeric($event_id) && $event_id != 'new') { + show_error('Hibás azonosító: ' . $event_id); + } + + $do = $this->input->post('do'); + if (!$do) + // AKKOR FORM + { + if ($event_id == 'new') { + $record = $this->mdb->set_empty_object('events2'); + $record->event_id = $event_id; + } else { + $record = $this->mevents->get_row2($event_id); + if (!$record) { + show_error('Nincs ilyen azonosítójú hír: ' . $event_id); + } + } + + + $data['record'] = $record; + $data['admin'] = true; + $data['aktiv'] = 4; + $data['tartalom'] = 'admin/eventsedit'; + $data['csik'] = array('home', 'admin'); + + + + $this->load->view('site', $data); + } else + //AKKOR PEDIG ADATBÁZISBEVITEL + { + $record = $this->mdb->set_post_object('events'); + + $record->event_lang = $this->muser->user['admin_lang']; + + $record->event_stamp = mktime(0, 0, 0, $record->event_ho, $record->event_nap + 1, $record->event_ev); + + if ($record->event_id == 'new') { + unset($record->event_id); + $this->db->f('events', $record); + } else { + $this->db->update('events', $record, 'event_id=' . $record->event_id); + } + + redirect('admin/events'); + } + } + + + function faqdelete() + { + $faq_id = $this->uri->segment(3); + + if (!$faq_id || !is_numeric($faq_id)) { + show_404(); + } + + $this->db->delete('faq', 'faq_id=' . $faq_id, 1); + + redirect('admin/faq'); + } + + function eventsdelete() + { + $event_id = $this->uri->segment(3); + + if (!$event_id || !is_numeric($event_id)) { + show_404(); + } + + $this->db->delete('events', 'event_id=' . $event_id, 1); + + redirect('admin/events'); + } + + + + function japanCSV() + { + if (jap()) { + $q = $this->db->where('stat_version', '3months')->orwhere('stat_version', 'japtrial')->orderby('stat_date', 'desc')->get('download_stats'); + if ($q->num_rows() == 0) { + die('No data avaiable for CSV Creation (no downloads)'); + } else { + $data = 'Date;E-Mail;Name;Pronounciation;Company;Address;Telephone;FAX;Version;AutoCAD;VectorWorks;ArchiCAD;JWCAD;ARCHITREND;GoogleSketchup;DRACAD;SuperSoft;Other;Opinion'; + + foreach ($q->result() as $sor) { + $date = date("Y-m-d", $sor->stat_date); + + $data .= "\n" . $date . ';' . $sor->stat_email . ';' . $sor->stat_first . ';' . $sor->stat_pron . ';' . $sor->stat_company . ';' . $sor->stat_cim . ';' . $sor->stat_tel . ';' . $sor->stat_fax . ';' . $sor->stat_version . ';' . $sor->stat_ucAUC . ';' . $sor->stat_ucARC . ';' . $sor->stat_ucVEW . ';' . $sor->stat_ucJWC . ';' . $sor->stat_ucART . ';' . $sor->stat_ucGSK . ';' . $sor->stat_ucDRC . ';' . $sor->stat_ucSSO . ';' . $sor->stat_ucELS . ';' . $sor->stat_opinion; + } + + header("Content-type: application/octet-stream"); + header("Content-Disposition: attachment; filename=\"download-stats.csv\""); + + echo $data; + } + } + } + + function news() + { + $this->load->model('mnews'); + $lang = $this->muser->user['admin_lang']; + + // $data['latest_100']=$this->mnews->get_latest(100,$this->muser->user['admin_lang']); + + // hírek + $data['latest_100'] = $this->db->query("SELECT *, DATE(CONCAT(news_y,'/',news_m,'/',news_d)) as ujdatum FROM `news` WHERE news_lang='{$lang}' order by ujdatum DESC")->result(); + + + // hírlevelek + $parancs = " (SELECT *, substr(video,26,11) vidazon, 0 keptipus FROM newsletter WHERE `deleted` = 0 AND lang = '{$lang}' AND video LIKE '%youtube.com%') "; + $parancs .= " UNION "; + $parancs .= " (SELECT *, video vidazon, 1 keptipus FROM newsletter WHERE `deleted` = 0 AND lang = '{$lang}' AND (video NOT LIKE '%youtube.com%' OR video IS NULL) ) "; + $parancs .= " ORDER BY title"; + //print $parancs; + $data['hirlevelek'] = $this->db->query($parancs)->result(); + + foreach ($data['hirlevelek'] as $level) { + $szoveg = $level->text; + /*$tmpv = */ + preg_match("/(

).+(<\/strong><\/p>)/", $level->text, $tmpv); + $level->alcim = substr($tmpv[0], 32); + $level->alcim = substr($level->alcim, 0, -13); + $rizsa = explode($tmpv[0], $level->text); + $level->szoveg = $rizsa[1]; + } + + $data['hirlevelek_json'] = json_encode($data['hirlevelek']); + + + + // 2014.06.05. F.Zs. + $data['napitippek'] = $this->db->query("SELECT t.*, IF(LOCATE('youtube.com',t.`video`)>0,substr(t.`video`,26,11),`video`) AS vidazon, IF(LOCATE('youtube.com',t.`video`)>0,0,1) keptipus FROM tipoftheday t WHERE t.`deleted` = 0 AND t.`lang`='{$lang}';")->result(); + foreach ($data['napitippek'] as $level) { + $szoveg = $level->text; + //preg_match("/(

).+(<\/strong><\/p>)/",$level->text,$tmpv); + //$level->alcim = substr($tmpv[0],32); + //$level->alcim = substr($level->alcim,0,-13); + //$rizsa = explode($tmpv[0],$level->text); + $level->szoveg = $szoveg; //$rizsa[1]; + } + $data['napitippek_json'] = json_encode($data['napitippek']); + // 2014.06.05. F.Zs. + + + + // követési linkek + $old_db = hun() ? 'clusers' : 'clusers_eng'; + $field = hun() ? 'strTopic' : 'strTopic_Eng'; + $data['linkek'] = $this->db->query("SELECT * FROM followed_links WHERE lang='{$lang}' AND `show`=1 ORDER BY name ASC")->result(); + $data['json_linkek'] = json_encode($data['linkek']); + $data['crmtopics'] = $this->db->query("SELECT nTopicID, {$field} as topicnev FROM `cl_hlusers`.`u_topic` WHERE old_db='{$old_db}' ORDER BY topicnev ASC")->result(); + + + $data['javascript'] = array('jquery_ui', 'plugin/jquery.maskedinput-1.2.2', 'plugin/jquery.maskedinput-1.2.2.min'); + $data['style'] = array('jquery.ui'); + + $data['admin'] = true; + $data['aktiv'] = 2; + $data['tartalom'] = 'admin/news'; + $data['csik'] = array('home', 'admin'); + $this->load->view('site', $data); + } + + function set_nl() + { + $nl_id = $this->input->post('nl_id'); + $hirlevel['title'] = $this->input->post('title'); + if ($this->input->post('baltipus') == "mappa") + $hirlevel['video'] = $this->input->post('video'); + else + $hirlevel['video'] = "http://www.youtube.com/v/" . $this->input->post('video') . "?version=3&hl=hu_HU&rel=0"; + //$hirlevel['text'] = $this->input->post('leiras'); + $hirlevel['text'] = "

" . $this->input->post('subtitle') . "

" . $this->input->post('leiras'); + $hirlevel['link'] = $this->input->post('link'); + + if ($this->input->post('baltipus') == "kep" && isset($_FILES, $_FILES['kep']['name']) && $_FILES['kep']['name'] != '') { + include('application/helpers/sajatfeltolto.php'); + + //$kepurl = "public/img/newsletter/"; + move_uploaded_file($_FILES["kep"]["tmp_name"], "public/img/newsletter/" . $_FILES["kep"]["name"]); + // $kepurl = feltolt('kep',"public/img/newsletter/",$_FILES[$asd]['name'],true); + $kepurl = "public/img/newsletter/" . $_FILES["kep"]["name"]; + + $hirlevel['video'] = $kepurl; + } elseif ($this->input->post('baltipus') == "kep") { + unset($hirlevel['video']); + } + + + if (!$nl_id) { + $subject = str_replace(' ', '-', strtolower($this->input->post('url'))); + $pattern = '/[-_a-z0-9]*/'; + preg_match_all($pattern, $subject, $matches, PREG_OFFSET_CAPTURE); + $url = ""; + foreach ($matches[0] as $m) + if ($m[0]) + $url .= $m[0]; + + + $hirlevel['lang'] = $this->muser->user['admin_lang']; + $hirlevel['deleted'] = '0'; + $hirlevel['url'] = $url; + $this->db->insert('newsletter', $hirlevel); + + $azonhossz = strlen($url); + + // Twitter bejegyzés + require_once('application/plugins/Twitter-PHP/twitter.class.php'); + require_once('application/plugins/Twitter-PHP/OAuth.php'); + if (hun()) { + $msg = "Hírlevél: " . substr($hirlevel['title'], 0, (140 - 53 - $azonhossz)) . " (http://www.archline.hu/newsletter/show/" . $url . ")"; + + require_once('application/plugins/codebird-php-2.4.1/src/codebird.php'); + $cb = \Codebird\Codebird::getInstance(); + $reply = $cb->statuses_update('status=' . $msg); + redirect("admin/news"); + exit; + + /*$consumerKey = 'y550xIIROlUYS0TubCqAJA'; + $consumerSecret = 'sWHuS8TevjHopNeSCf73AeX6JUT1B3e1ma1zF810I'; + $accessToken = '136217633-6MIHowRunalfGoUHUoMd53MtgGqtXCO36vtxEWAL'; + $accessTokenSecret = 'KNGkVbV8cTqY9DlSj61neMNJYgdexL90WXSpEgqwmw'; + */ + } else { + $consumerKey = 'DWj2LuQIRRTgu9Qxk23VLQ'; + $consumerSecret = 'GbFeFwO5u3y9rt059ecHvBRwsrquz8v3qu4x0W9Uxwg'; + $accessToken = '121794123-a5fJS7pIA4q70vEP4deT41lm0NsTfsXqR3EaTrno'; + $accessTokenSecret = 'RKQnfiQrrklBxN0imwGTn6BPuwq1IJqHuQN2iQ0ms'; + + $msg = "Newsletter: " . substr($hirlevel['title'], 0, (140 - 58 - $azonhossz)) . " (http://www.archlinexp.com/newsletter/show/" . $url . ")"; + + $twitter = new Twitter($consumerKey, $consumerSecret, $accessToken, $accessTokenSecret); + $status = $twitter->send($msg); + // End Twitter bejegyzés + } + redirect("admin/news"); + } else { + $this->db->update('newsletter', $hirlevel, "nl_id = '" . $nl_id . "'"); + } + + redirect("admin/news"); + } + + function del_nl() + { + $nl_id = $this->uri->segment(3); + + $this->db->update('newsletter', array('deleted' => '1'), "nl_id = '" . $nl_id . "'"); + redirect('admin/news'); + } + + + + // 2014.06.06. F.Zs. + function set_nt() + { + $nl_id = $this->input->post('nl_id'); + $hirlevel['title'] = $this->input->post('title'); + $hirlevel['video'] = ($this->input->post('baltipus') == "kep" ? $this->input->post('kep2') : "http://www.youtube.com/v/" . $this->input->post('video') . "?version=3&hl=hu_HU&rel=0"); + $hirlevel['text'] = "

" . $this->input->post('subtitle') . "

" . $this->input->post('leiras'); + $hirlevel['link'] = $this->input->post('link'); + + if ($this->input->post('baltipus') == "kep" && isset($_FILES, $_FILES['kep']['name']) && $_FILES['kep']['name'] != '') { + /* + include('application/helpers/sajatfeltolto.php'); + $hirlevel['video'] = "/public/img/tipoftheday/".$_FILES["kep"]["name"]; + move_uploaded_file($_FILES["kep"]["tmp_name"], $hirlevel['video']); +*/ + include('application/helpers/sajatfeltolto.php'); + move_uploaded_file($_FILES["kep"]["tmp_name"], "public/img/tipoftheday/" . $_FILES["kep"]["name"]); + $hirlevel['video'] = "/public/img/tipoftheday/" . $_FILES["kep"]["name"]; + } + + if (!$nl_id) { + $subject = str_replace(' ', '-', strtolower($this->input->post('url'))); + $pattern = '/[-_a-z0-9]*/'; + preg_match_all($pattern, $subject, $matches, PREG_OFFSET_CAPTURE); + + $url = ""; + foreach ($matches[0] as $m) if ($m[0]) $url .= $m[0]; + + $hirlevel['lang'] = $this->muser->user['admin_lang']; + $hirlevel['deleted'] = '0'; + $hirlevel['url'] = $url; + + $this->db->insert('tipoftheday', $hirlevel); + + $azonhossz = strlen($url); + + /* + // Twitter bejegyzés + require_once('application/plugins/Twitter-PHP/twitter.class.php'); + require_once('application/plugins/Twitter-PHP/OAuth.php'); + if(hun()){ + $msg = "Hírlevél: ".substr($hirlevel['title'],0,(140-53-$azonhossz))." (http://www.archline.hu/newsletter/show/".$url.")"; + + require_once('application/plugins/codebird-php-2.4.1/src/codebird.php'); + $cb = \Codebird\Codebird::getInstance(); + $reply = $cb->statuses_update('status='.$msg); + redirect("admin/news"); + exit; + +// $consumerKey = 'y550xIIROlUYS0TubCqAJA'; +// $consumerSecret = 'sWHuS8TevjHopNeSCf73AeX6JUT1B3e1ma1zF810I'; +// $accessToken = '136217633-6MIHowRunalfGoUHUoMd53MtgGqtXCO36vtxEWAL'; +// $accessTokenSecret = 'KNGkVbV8cTqY9DlSj61neMNJYgdexL90WXSpEgqwmw'; + + }else{ + $consumerKey = 'DWj2LuQIRRTgu9Qxk23VLQ'; + $consumerSecret = 'GbFeFwO5u3y9rt059ecHvBRwsrquz8v3qu4x0W9Uxwg'; + $accessToken = '121794123-a5fJS7pIA4q70vEP4deT41lm0NsTfsXqR3EaTrno'; + $accessTokenSecret = 'RKQnfiQrrklBxN0imwGTn6BPuwq1IJqHuQN2iQ0ms'; + + $msg = "Newsletter: ".substr($hirlevel['title'],0,(140-58-$azonhossz))." (http://www.archlinexp.com/newsletter/show/".$url.")"; + + $twitter = new Twitter($consumerKey, $consumerSecret, $accessToken, $accessTokenSecret); + $status = $twitter->send($msg); + // End Twitter bejegyzés + } +*/ + redirect("admin/news"); + } else { + $this->db->update('tipoftheday', $hirlevel, "nl_id = '" . $nl_id . "'"); + } + redirect("admin/news"); + } + + function del_nt() + { + $this->db->update('tipoftheday', array('deleted' => '1'), "nl_id = '" . $this->uri->segment(3) . "'"); + redirect('admin/news'); + } + // 2014.06.06. F.Zs. + + + + function set_followlink() + { + $id = $this->input->post('id'); + if (!is_numeric($id) && $id != "new") + return; + + $tomb = array(); + $tomb['name'] = $this->input->post('name'); + $tomb['esem_id'] = $this->input->post('esem_id'); + $tomb['esem_cont'] = $this->input->post('esem_cont'); + $tomb['redirect'] = $this->input->post('redirect'); + + if ($id == "new") { + $tomb['lang'] = $this->muser->user['admin_lang']; + + $subject = str_replace(' ', '-', strtolower($this->input->post('alias'))); + $pattern = '/[-_a-z0-9]*/'; + preg_match_all($pattern, $subject, $matches, PREG_OFFSET_CAPTURE); + $alias = ""; + foreach ($matches[0] as $m) + if ($m[0]) + $alias .= $m[0]; + + if (!$alias) { + print "Hibas url azonosito: " . $this->input->post('alias'); + return; + } + + $tomb['alias'] = $alias; + $this->db->insert('followed_links', $tomb); + } else { + $this->db->update('followed_links', $tomb, "id = {$id}"); + } + + redirect('admin/news'); + } + + function del_followlink() + { + $id = $this->uri->segment(3); + if (!is_numeric($id)) + return; + + $this->db->update('followed_links', array('show' => 0), "id = {$id}"); + + redirect('admin/news'); + } + + function editor() + { + $this->load->model('mpages'); + + $data['list'] = $this->mpages->get_latest(1000, $this->muser->user['admin_lang']); + + $sort = $this->uri->segment(3); + + if (!$sort) { + $sort = 'page_date'; + } + + $data['by_category'] = $this->mpages->get_all_by_category($sort, "0"); + $data['admin'] = true; + $data['aktiv'] = 6; + $data['tartalom'] = 'admin/editor'; + $data['csik'] = array('home', 'admin'); + $this->load->view('site', $data); + } + + function pageedit() + { + $this->load->model('mpages'); + + $page_id = $this->uri->segment(3); + + if (!is_numeric($page_id) && $page_id != 'new') { + show_error('Hibás azonosító: ' . $page_id); + } + + $do = $this->input->post('do'); + if (!$do) + // AKKOR FORM + { + if ($page_id == 'new') { + $record = $this->mdb->set_empty_object('pages'); + $record->page_id = $page_id; + } else { + $record = $this->mpages->get_row($page_id); + if (!$record) { + show_error('Nincs ilyen azonosítójú hír: ' . $page_id); + } + } + + $data['cat'] = $this->mpages->get_category_dropdown(); + $data['record'] = $record; + $data['admin'] = true; + $data['aktiv'] = 6; + $data['tartalom'] = 'admin/pageedit'; + $data['javascript'] = '../ckeditor/ckeditor'; + $data['csik'] = array('home', 'admin'); + $this->load->view('site', $data); + } else + //AKKOR PEDIG ADATBÁZISBEVITEL + { + $record = $this->mdb->set_post_object('pages'); + + $record->page_lang = $this->muser->user['admin_lang']; + + $record->page_date = time(); + + unset($record->page_url); + + if ($record->page_id == 'new') { + unset($record->page_id); + $this->db->insert('pages', $record); + } else { + $this->db->update('pages', $record, 'page_id=' . $record->page_id); + } + + redirect('admin/editor'); + } + } + + function pageedit_help() + { + if (!hun()) + redirect('admin/editor'); + + $this->load->model('mpages'); + + $page_id = $this->uri->segment(3); + + if (!is_numeric($page_id) && $page_id != 'new') { + show_error('Hibás azonosító: ' . $page_id); + } + + $do = $this->input->post('do'); + if (!$do) + // AKKOR FORM + { + if ($page_id == 'new') { + $record = $this->mdb->set_empty_object('pages'); + $record->page_id = $page_id; + } else { + $record = $this->mpages->get_row($page_id); + if (!$record) { + show_error('Nincs ilyen azonosítójú hír: ' . $page_id); + } + } + + $data['record'] = $record; + $data['admin'] = true; + $data['aktiv'] = 6; + $data['tartalom'] = 'admin/pageedit_help'; + $data['csik'] = array('home', 'admin'); + $this->load->view('site', $data); + } else + //AKKOR PEDIG ADATBÁZISBEVITEL + { + die(print_r($this->input->post('page_body'))); + $record = $this->mdb->set_post_object('pages'); + + $record->page_lang = $this->muser->user['admin_lang']; + + $record->page_date = time(); + + if ($record->page_id == 'new') { + unset($record->page_id); + $this->db->insert('pages', $record); + } else { + $this->db->update('pages', $record, 'page_id=' . $record->page_id); + } + + redirect('admin/editor'); + } + } + + function logout() + { + $this->muser->user['admin'] = false; + $this->phpsession->save('user', $this->muser->user); + + redirect(); + } + + function banner() + { + $do = $this->input->post('do'); + + if ($do) { + if ($_FILES['banner']['name']) { + $config['upload_path'] = 'public/upload/' . $this->muser->user['admin_lang']; + $config['allowed_types'] = 'gif|jpg|png|swf'; + $config['max_size'] = '1000'; + $config['max_width'] = '2048'; + $config['max_height'] = '2048'; + + $this->load->library('upload', $config); + + if (! $this->upload->do_upload('banner')) { + show_error($this->upload->display_errors()); + } else { + $file = $this->upload->data(); + + $path = 'public/upload/' . $this->muser->user['admin_lang'] . '/' . $file['file_name']; + $this->muser->set_setting('banner', '/' . $path, $this->muser->user['admin_lang']); + + + if (substr_count($file['file_name'], '.swf') != 0) { + $config['image_library'] = 'gd2'; + $config['source_image'] = $path; + $config['maintain_ratio'] = TRUE; + $config['width'] = 648; + $config['height'] = 648; + + $this->load->library('image_lib', $config); + + $this->image_lib->resize(); + + $is_flash = false; + } else { + $is_flash = true; + } + } + } + + $page = $this->input->post('page'); + if ($page == 'none') { + $this->muser->set_setting('banner_link', $this->input->post('banner_link'), $this->muser->user['admin_lang']); + } else { + $this->muser->set_setting('banner_link', $page, $this->muser->user['admin_lang']); + } + + + redirect('admin/banner'); + } else { + $data['admin'] = true; + $data['tartalom'] = 'admin/banner'; + $data['csik'] = array('home', 'admin'); + $data['aktiv'] = 5; + + $data['banner'] = $this->muser->get_setting('banner', $this->muser->user['admin_lang']); + $data['banner_link'] = $this->muser->get_setting('banner_link', $this->muser->user['admin_lang']); + + if ($data['banner_link'] == '') { + $data['banner_link'] = 'http://'; + } + + if ($data['banner']) { + $file = substr($data['banner'], 1); + if (is_file($file)) { + $data['file'] = $file; + } else { + $data['file'] = false; + } + } else { + $data['file'] = false; + } + + $this->load->view('site', $data); + } + } + + function newsedit() + { + $this->load->model('mnews'); + + $news_id = $this->uri->segment(3); + + if (!is_numeric($news_id) && $news_id != 'new') { + show_error('Hibás azonosító: ' . $news_id); + } + + $do = $this->input->post('do'); + if (!$do) + // AKKOR FORM + { + if ($news_id == 'new') { + $record = $this->mdb->set_empty_object('news'); + $record->news_id = $news_id; + + $record->news_y = date('Y'); + $record->news_m = date('m'); + $record->news_d = date('d'); + + // alap keret angolhoz + if (!hun()) { + $recordtemp = $this->mnews->get_row(135); + $record->news_text = $recordtemp->news_text; + } + } else { + $record = $this->mnews->get_row($news_id); + if (!$record) { + show_error('Nincs ilyen azonosítójú hír: ' . $news_id); + } + } + + $data['cat'] = $this->mnews->get_category_dropdown(); + $data['record'] = $record; + $data['admin'] = true; + $data['aktiv'] = 2; + $data['tartalom'] = 'admin/newsedit'; + $data['csik'] = array('home', 'admin'); + $this->load->view('site', $data); + } else + //AKKOR PEDIG ADATBÁZISBEVITEL + { + + $record = $this->mdb->set_post_object('news'); + + $record->news_lang = $this->muser->user['admin_lang']; + + if ($record->news_id == 'new') { + if ($this->input->post('news_url') == "") + print "Hiba: Nem volt kitöltve az url!"; + unset($record->news_id); + $subject = str_replace(' ', '-', strtolower($this->input->post('news_url'))); + $pattern = '/[-_a-z0-9]*/'; + preg_match_all($pattern, $subject, $matches, PREG_OFFSET_CAPTURE); + $url = ""; + foreach ($matches[0] as $m) + if ($m[0]) + $url .= $m[0]; + $record->url = $url; + unset($record->news_url); + $this->db->insert('news', $record); + + $ujid = mysql_insert_id(); + + // Ha nem volt sikeres a beszúrás kilépés. + if (!$ujid) { + print "Az új hír felvétele sikertelen!"; + exit; + } + + if ($url) + $new_id = $url; + else + $new_id = $ujid; + + // Twitter bejegyzés + require_once('application/plugins/Twitter-PHP/twitter.class.php'); + require_once('application/plugins/Twitter-PHP/OAuth.php'); + if (hun()) { + $msg = "Új hír: " . substr($record->news_title, 0, 85) . " (http://www.archline.hu/news/show/" . $new_id . ")"; + require_once('application/plugins/codebird-php-2.4.1/src/codebird.php'); + $cb = \Codebird\Codebird::getInstance(); + $reply = $cb->statuses_update('status=' . $msg); + /*$consumerKey = 'y550xIIROlUYS0TubCqAJA'; + $consumerSecret = 'sWHuS8TevjHopNeSCf73AeX6JUT1B3e1ma1zF810I'; + $accessToken = '136217633-6MIHowRunalfGoUHUoMd53MtgGqtXCO36vtxEWAL'; + $accessTokenSecret = 'KNGkVbV8cTqY9DlSj61neMNJYgdexL90WXSpEgqwmw'; + */ + } else { + $consumerKey = 'DWj2LuQIRRTgu9Qxk23VLQ'; + $consumerSecret = 'GbFeFwO5u3y9rt059ecHvBRwsrquz8v3qu4x0W9Uxwg'; + $accessToken = '121794123-a5fJS7pIA4q70vEP4deT41lm0NsTfsXqR3EaTrno'; + $accessTokenSecret = 'RKQnfiQrrklBxN0imwGTn6BPuwq1IJqHuQN2iQ0ms'; + + $msg = "New: " . substr($record->news_title, 0, 85) . " (http://www.archlinexp.com/news/show/" . $new_id . ")"; + print "twitter kozben 1"; + /*$twitter = new Twitter($consumerKey, $consumerSecret, $accessToken, $accessTokenSecret); + $status = $twitter->send($msg);*/ + require_once('application/plugins/codebird-php-2.4.1/src/codebird.php'); + $cb = \Codebird\Codebird::getInstance(); + $reply = $cb->statuses_update('status=' . $msg); + // End Twitter bejegyzés + print "twitter utan"; + } + } else { + unset($record->news_url); + unset($record->url); + $this->db->update('news', $record, 'news_id=' . $record->news_id); + } + + redirect('admin/news'); + } + } + + function newsdelete() + { + $news_id = $this->uri->segment(3); + + if (!$news_id || !is_numeric($news_id)) { + show_404(); + } + + $this->db->delete('news', 'news_id=' . $news_id); + + redirect('admin/news'); + } + + function pagedelete() + { + $page_id = $this->uri->segment(3); + + if (!$page_id || !is_numeric($page_id)) { + show_404(); + } + + //die("Ezt törölném ha be lenne kapcsolva a törlés: ".$page_id); + + $this->db->delete('pages', "page_id=$page_id and page_lang='" . $this->muser->user['admin_lang'] . "'", 1); + + redirect('admin/editor'); + } + + function downloads() + { + $this->load->model('mdownloads'); + $this->load->model('mversion'); + + $data['trials'] = $this->mdownloads->generate_subfolder_dropdown('trials'); + + $data['trial'] = $this->muser->get_setting('trial_' . $this->muser->user['admin_lang']); + $data['student'] = $this->muser->get_setting('student_' . $this->muser->user['admin_lang']); + + if ($data['trial'] == '') { + $data['trial'] = 'http://'; + } + + if ($data['student'] == '') { + $data['student'] = 'http://'; + } + + + $data['downloads'] = $this->mdownloads->get_latest(999, $this->muser->user['admin_lang']); + $data['frissitesek'] = $this->mversion->get_all("", "ev DESC, projectid ASC, pkgid DESC"); + + $data['frissitesek_json'] = json_encode($data['frissitesek']); + + $fajlok = $this->get_directory_file("public/downloads", "exe"); + // $dokumentumok = $this->get_directory_file("public/downloads"); + + // hogy a kis es nagybetuk ne szamitsanak a rendezesnel + $array_lowercase = array_map('strtolower', $fajlok); + array_multisort($array_lowercase, SORT_ASC, SORT_STRING, $fajlok); + + + // sort($fajlok); + // sort($dokumentumok); + + $data['fajlok'] = $fajlok; + // $data['dokumentumok'] = $dokumentumok; + + $data['utolso'] = $data['frissitesek'][count($data['frissitesek']) - 1]->azonosito; + + $data['admin'] = true; + $data['aktiv'] = 3; + $data['javascript'] = array('jquery_ui', 'jquery.numeric.pack', 'tablesorter/jquery.tablesorter.min'); + $data['style'] = array('jquery.ui', '../js/tablesorter/themes/blue/style'); + $data['tartalom'] = 'admin/downloads'; + $data['csik'] = array('home', 'admin'); + + $this->load->view('site', $data); + } + + + function set_update() + { + $ver_id = $this->input->post('ver_id'); + $nyelvek = $this->input->post('lang'); + $verzio['azonosito'] = $this->input->post('azonosito'); + $verzio['projectid'] = $this->input->post('projectid'); + $verzio['pkgid'] = $this->input->post('pkgid'); + $verzio['ev'] = $this->input->post('ev'); + // $verzio['lang'] = ";"; + // $verzio['usertype'] = $this->input->post('usertype'); + $verzio['tipus'] = $this->input->post('tipus'); + $verzio['fajl'] = $this->input->post('fajl'); + $verzio['datum'] = $this->input->post('datum'); + $verzio['doksi'] = $this->input->post('doksi'); + $verzio['doksi_hun'] = $this->input->post('doksi_hun'); + $verzio['leiras'] = $this->input->post('leiras'); + $verzio['leiras_hun'] = $this->input->post('leiras_hun'); + $verzio['hash'] = $this->input->post('hash'); + if ($_POST['csendes'] == "on") + $verzio['csendes'] = '1'; + else + $verzio['csendes'] = '0'; + if ($_POST['aktiv'] == "on") + $verzio['aktiv'] = '1'; + else + $verzio['aktiv'] = '0'; + if ($_POST['public'] == "on") + $verzio['public'] = '1'; + else + $verzio['public'] = '0'; + + + if ($this->input->post('userek') == "xy") { + $usereknek = trim($this->input->post('usertype')); + if (substr($usereknek, 0, 1) != ";") + $usereknek = ";" . $usereknek; + if (substr($usereknek, -1) != ";") + $usereknek .= ";"; + + $verzio['usertype'] = $usereknek; + } else + $verzio['usertype'] = "all"; + + + /*foreach($nyelvek as $nyelv) + $verzio['lang'] .= $nyelv.";"; + + if(strstr($verzio['lang'],'99')) + $verzio['lang'] = '99';*/ + + $this->db->update('version', $verzio, "ver_id = '" . $ver_id . "'"); + redirect("admin/downloads"); + } + + function newupdate() + { + $nyelvek = $this->input->post('lang'); + + $verzio['azonosito'] = $this->input->post('azonosito'); + $verzio['projectid'] = $this->input->post('projectid'); + $verzio['pkgid'] = $this->input->post('pkgid'); + $verzio['ev'] = $this->input->post('ev'); + // $verzio['lang'] = ";"; + $verzio['tipus'] = $this->input->post('tipus'); + // $verzio['usertype'] = $this->input->post('usertype'); + $verzio['fajl'] = $this->input->post('fajl'); + $verzio['datum'] = $this->input->post('datum'); + $verzio['doksi'] = $this->input->post('doksi'); + $verzio['doksi_hun'] = $this->input->post('doksi_hun'); + $verzio['leiras'] = $this->input->post('leirasuj'); + $verzio['leiras_hun'] = $this->input->post('leirasuj_hun'); + $verzio['hash'] = $this->input->post('hash'); + if ($_POST['csendes'] == "on") + $verzio['csendes'] = '1'; + else + $verzio['csendes'] = '0'; + + if ($_POST['aktiv'] == "on") + $verzio['aktiv'] = '1'; + else + $verzio['aktiv'] = '0'; + + if ($_POST['public'] == "on") + $verzio['public'] = '1'; + else + $verzio['public'] = '0'; + + if ($this->input->post('userek') == "xy") { + $usereknek = trim($this->input->post('usertype')); + if (substr($usereknek, 0, 1) != ";") + $usereknek = ";" . $usereknek; + if (substr($usereknek, -1) != ";") + $usereknek .= ";"; + + $verzio['usertype'] = $usereknek; + } else + $verzio['usertype'] = "all"; + + /*foreach($nyelvek as $nyelv) + $verzio['lang'] .= $nyelv.";"; + + if(strstr($verzio['lang'],'99')) + $verzio['lang'] = '99';*/ + + $this->db->insert('version', $verzio); + redirect("admin/downloads"); + } + + function updatedelete() + { + $ver_id = $this->uri->segment(3); + + $this->db->update('version', array('deleted' => "1"), "ver_id='" . $ver_id . "'"); + redirect("admin/downloads"); + } + + function collection() + { + $this->load->model('mcollection'); + + $tipusok = $this->mcollection->get_type(); + foreach ($tipusok as $tipus) { + $tipus->kategoria = $this->mcollection->get_kategoriak($tipus->tipus); + foreach ($tipus->kategoria as $kategoria) { + $kategoria->fajl = $this->mcollection->get_bykategoria($kategoria->dl_id); + $kategoria->darab = $this->mcollection->get_darabegykategoria($kategoria->dl_id); + } + $tipus->darab = $this->mcollection->get_darabegytipus($tipus->tipus); + } + + $data['main_events_json'] = json_encode($tipusok); + + $data['tipusok'] = $tipusok; + + $data['admin'] = true; + $data['aktiv'] = 11; + if (true || strstr($_SERVER['HTTP_USER_AGENT'], 'Ubuntu/8.04')) + $data['tartalom'] = 'admin/collection_new'; + else + $data['tartalom'] = 'admin/collection'; + $data['csik'] = array('home', 'admin'); + + $data['javascript'] = array('jquery_ui', 'ui.datepicker-hu', 'jquery.numeric.pack'); + $data['style'] = array('jquery.ui'); + + $this->load->view('site', $data); + } + + + function kategedit() + { + if ($this->input->post('do') != false) { + $dl_id = $this->input->post('dlid'); + $tipus = $this->input->post('tipus'); + $nev_hun = $this->input->post('nev_hun'); + $nev_eng = $this->input->post('nev_eng'); + + if ($dl_id == "uj") { + $this->muser->new_kategoria($tipus, $nev_hun, $nev_eng); + } else { + $this->muser->set_kategoria($dl_id, $tipus, $nev_hun, $nev_eng); + } + + redirect('admin/collection'); + } else { + if (hun()) + $data['title'] = 'ARCHLine.XP Kategória szerkesztés'; + else + $data['title'] = 'ARCHLine.XP Edit Category'; + $data['admin'] = true; + $data['aktiv'] = 11; + $data['tartalom'] = 'admin/kategedit'; + $data['csik'] = array('home', 'admin'); + + if ($this->uri->segment(3) == "new") { + $data['uj'] = true; + $kateg->tipus = $this->uri->segment(4); + $data['kateg'] = $kateg; + } else { + $dlid = $this->uri->segment(3); + $data['kateg'] = $this->muser->get_kategoria($dlid); + } + + $this->load->view('site', $data); + } + } + + function delkateg() + { + $mit = $this->uri->segment(3); + + if ($mit != "" && is_numeric($mit)) + $this->muser->del_kategoria($mit); + + redirect('admin/collection'); + } + + function projectsedit() + { + $this->load->model('mprojects'); + $this->load->model('mcollection'); + + if ($this->input->post('do') != false) { + $pr_id = $this->input->post('prid'); + $lang = $this->muser->user['lang']; + + $error = ""; + $kep = ""; + + $this->kep($kep); + + $prSize = 6500; + $mi = "/home/cadline/public_html/website/" . $_POST["originalFilenameField"]; + $prSize = filesize($mi); //?? + + + if (!$error) { + $ujpr->email = $_POST["projectEmailField"]; + $ujpr->title = $_POST["projhectNameField"]; + $ujpr->meret = $prSize; + $ujpr->datum = date('Y-m-d H:i:s', time()); + $ujpr->nyelv = $lang; + $ujpr->kep = $kep; + $ujpr->kategoria = $_POST["kategoria"]; + $ujpr->text = $_POST["projectDescriptionField"]; + $ujpr->project = $_POST["originalFilenameField"]; + $ujpr->object = $_POST["originalFilenameField"]; + $ujpr->szerzo = $_POST["SzerzoField"]; + $ujpr->kat_id = $_POST["kategoria"]; + + $this->mprojects->editproject($ujpr, $pr_id); + //$this->mcollection->editobject($ujpr,$pr_id); + } + + redirect('admin/collection'); + } else { + $data['admin'] = true; + $data['aktiv'] = 11; + + $data['title'] = 'ARCHLine.XP Project szerkesztés'; + $data['tartalom'] = 'admin/projectedit'; + $data['csik'] = array('home', 'admin'); + + $prid = $this->uri->segment(3); + $data['project'] = $this->mprojects->get_row($prid); + + $data['kategoriak'] = $this->muser->get_kategoriak('project'); + + $this->load->view('site', $data); + } + } + + function delproject() + { + $this->load->model('mprojects'); + $this->load->model('mcollection'); + + $prid = $this->uri->segment(3); + $this->mprojects->del($prid); // A project fájlt és a hozzá tartozó képet is törli a szerverről. + //$this->mcollection->del($prid); + + redirect('admin/collection'); + } + + function objectsedit() + { + $this->load->model('mobjects'); + $this->load->model('mcollection'); + + if ($this->input->post('do') != false) { + $pr_id = $this->input->post('prid'); + $lang = $this->muser->user['lang']; + + $error = ""; + $kep = ""; + + $this->kep($kep, 'objects'); + + $prSize = 6500; + $mi = "/home/cadline/public_html/website/" . $_POST["originalFilenameField"]; + $prSize = filesize($mi); //?? + + + if (!$error) { + $ujpr->email = $_POST["projectEmailField"]; + $ujpr->title = $_POST["projhectNameField"]; + $ujpr->meret = $prSize; + $ujpr->datum = date('Y-m-d H:i:s', time()); + $ujpr->nyelv = $lang; + $ujpr->kep = $kep; + $ujpr->kategoria = $_POST["kategoria"]; + $ujpr->text = $_POST["projectDescriptionField"]; + $ujpr->object = $_POST["originalFilenameField"]; + $ujpr->szerzo = $_POST["SzerzoField"]; + $ujpr->kat_id = $_POST["kategoria"]; + + // $this->mobjects->editobject($ujpr,$pr_id); + $this->mcollection->editobject($ujpr, $pr_id); + } + + redirect('admin/collection'); + } else { + if (hun()) + $data['title'] = 'ARCHLine.XP Objektum szerkesztés'; + else + $data['title'] = 'ARCHLine.XP Edit Object'; + $data['admin'] = true; + $data['aktiv'] = 11; + $data['tartalom'] = 'admin/objectedit'; + $data['csik'] = array('home', 'admin'); + + $prid = $this->uri->segment(3); + $data['object'] = $this->mcollection->get_row($prid); + + $data['kategoriak'] = $this->muser->get_kategoriak('object'); + + $this->load->view('site', $data); + } + } + + function delobject() + { + $this->load->model('mobjects'); + $this->load->model('mcollection'); + + $objid = $this->uri->segment(3); + $this->mobjects->del($objid); // Az objektum fajlt es a hozza tartozo kepet is torli a szerverrol. + //$this->mcollection->del($objid); + + redirect('admin/collection'); + } + + function groupsedit() + { + $this->load->model('mgroups'); + $this->load->model('mcollection'); + $this->load->model('mforum'); + + if ($this->input->post('do') != false) { + $pr_id = $this->input->post('prid'); + $lang = $this->muser->user['lang']; + + $error = ""; + $kep = $this->input->post('kep_eredeti'); + + $tipusa = $this->mcollection->get_tipus($_POST["kategoria"]); + $this->kep($kep, $tipusa); + + $prSize = 6500; + $mi = "/home/cadline/public_html/website/" . $_POST["originalFilenameField"]; + $prSize = filesize($mi); //?? + + + if (!$error) { + $ujpr->email = $_POST["projectEmailField"]; + $ujpr->title = $_POST["projhectNameField"]; + $ujpr->meret = $prSize; + $ujpr->datum = date('Y-m-d H:i:s', time()); + $ujpr->nyelv = $lang; + $ujpr->kep = $kep; + $ujpr->kategoria = $_POST["kategoria"]; + $ujpr->text = $_POST["projectDescriptionField"]; + $ujpr->group = $_POST["originalFilenameField"]; + $ujpr->object = $_POST["originalFilenameField"]; + $ujpr->szerzo = $_POST["SzerzoField"]; + $ujpr->kat_id = $_POST["kategoria"]; + $ujpr->fajl = $_POST["originalFilenameField"]; + if ($_POST["bizalom"] != "") + $ujpr->bizalom = $_POST["bizalom"]; + if ($_POST["sorszam"] != "" && is_numeric($_POST["sorszam"])) + $ujpr->archline_sorszam = $_POST["sorszam"]; + + //$this->mgroups->editgroup($ujpr,$pr_id); + $this->mcollection->editobject($ujpr, $pr_id); + } + + redirect('admin/collection'); + } else { + if (hun()) + $data['title'] = 'ARCHLine.XP Csoport szerkesztés'; + else + $data['title'] = 'ARCHLine.XP Edit Group'; + $data['admin'] = true; + $data['aktiv'] = 11; + $data['tartalom'] = 'admin/groupedit'; + $data['csik'] = array('home', 'admin'); + + $prid = $this->uri->segment(3); + $group = $this->mcollection->get_row($prid); + $data['group'] = $group; + + $data['tulaj'] = $this->mforum->get_userUid($group->u_id); + + $tipus = $this->mcollection->get_tipus($data['group']->kat_id); + + $data['kategoriak'] = $this->muser->get_kategoriak($tipus); + + $this->load->view('site', $data); + } + } + + function delgroup() + { + $this->load->model('mgroups'); + $this->load->model('mcollection'); + + $grid = $this->uri->segment(3); + //$this->mgroups->del($grid); // A csoport fajlt es a hozza tartozo kepet is torli a szerverrol. + $this->mcollection->del($grid); + + redirect('admin/collection'); + } + + function kep(&$kep, $mappa = "group", $ujkep = "kep") + { + if ($_FILES[$ujkep]["error"] == 0) { + $lang = $this->muser->user['lang']; + $kepnev = time() . "_" . $_FILES[$ujkep]["name"]; + $ide = "public/img/collection/" . $mappa . "/" . $kepnev; + if (copy($_FILES[$ujkep]["tmp_name"], $ide)) { + $kep = $ide; + //print " Sikerült a képmásolás! "; + } else { + $prFile = "NULL"; + //print " Nem sikerült a képet felmásolni!
"; print_r($_FILES[$ujkep]);
+			}
+		}
+	}
+
+	function kep2(&$kep, $hova, $filestomb, $id)
+	{
+		if ($filestomb["error"][$id] == 0) {
+			$lang = $this->muser->user['lang'];
+			$kepnev = $filestomb["name"][$id];
+			$ide = $hova . "/" . $kepnev;
+			if (copy($filestomb["tmp_name"][$id], $ide)) {
+				$kep = $kepnev; //$ide;
+			}
+		}
+	}
+
+	function kep3(&$kep, $hova, $ujkep)
+	{
+		if ($_FILES[$ujkep]["error"] == 0) {
+			$kepnev = $_FILES[$ujkep]["name"];
+			$ide = $hova . "/" . $kepnev;
+			if (copy($_FILES[$ujkep]["tmp_name"], $ide)) {
+				$kep = $kepnev; //$ide;
+			}
+		}
+	}
+
+	function kep4(&$kep, $hova, $ujkep)
+	{
+		if ($_FILES[$ujkep]["error"] == 0) {
+			$kepnev = $_FILES[$ujkep]["name"];
+			$ide = $hova . "/" . $kepnev;
+			if (copy($_FILES[$ujkep]["tmp_name"], $ide)) {
+				$kep = $ide;
+			}
+		}
+	}
+
+	function download_set()
+	{
+		$this->muser->set_setting('trial_' . $this->muser->user['admin_lang'], $this->input->post('trial'));
+		$this->muser->set_setting('student_' . $this->muser->user['admin_lang'], $this->input->post('student'));
+
+
+		redirect('admin/downloads');
+	}
+
+	function downloadsedit()
+	{
+		$this->load->model('mdownloads');
+
+		$this->load->helper('directory');
+
+		$data['dropdown'] = $this->mdownloads->generate_file_dropdown();
+
+
+
+		$download_id = $this->uri->segment(3);
+
+		if (!is_numeric($download_id) && $download_id != 'new') {
+			show_error('Hibás azonosító: ' . $download_id);
+		}
+
+		$do = $this->input->post('do');
+		if (!$do)
+		// AKKOR FORM
+		{
+			if ($download_id == 'new') {
+				$record = $this->mdb->set_empty_object('downloads');
+				$record->download_id = $download_id;
+
+				$data['remote'] = 'http://';
+			} else {
+				$record = $this->mdownloads->get_row($download_id);
+				if (!$record) {
+					show_error('Nincs ilyen azonosítójú hír: ' . $download_id);
+				}
+
+				if (array_key_exists($record->download_file, $data['dropdown'])) {
+					$data['remote'] = '';
+				} else {
+					$data['remote'] = $record->download_file;
+				}
+			}
+
+
+
+
+
+
+
+			$data['record'] = $record;
+			$data['admin'] = true;
+			$data['aktiv'] = 3;
+			$data['tartalom'] = 'admin/downloadsedit';
+			$data['csik'] = array('home', 'admin');
+			$this->load->view('site', $data);
+		} else
+		//AKKOR PEDIG ADATBÁZISBEVITEL
+		{
+			$record = $this->mdb->set_post_object('downloads');
+
+			//	if( $this->input->post('download_category') == "workshop" ){
+			//		$record->download_date = $this->input->post('download_date');
+			//	}else{
+			$record->download_date = time();
+			//	}
+
+			//$record->download_date = time();
+
+			$this->load->helper('file');
+
+			$record->download_lang = $this->muser->user['admin_lang'];
+
+
+			$download_file_remote = $this->input->post('download_file_remote');
+
+			if ($download_file_remote == 'http://') {
+				$download_file_remote = '';
+			}
+
+			if ($download_file_remote != '') {
+				$record->download_file = mysql_real_escape_string($download_file_remote);
+				$record->download_size = 0;
+			} else {
+				$fileinfo = get_file_info('.' . $record->download_file);
+				$record->download_size = $fileinfo['size'];
+			}
+
+
+
+
+			if ($record->download_id == 'new') {
+				unset($record->download_id);
+				$this->db->insert('downloads', $record);
+			} else {
+				$this->db->update('downloads', $record, 'download_id=' . $record->download_id);
+			}
+
+			redirect('admin/downloads');
+		}
+	}
+
+	function downloadsdelete()
+	{
+		$news_id = $this->uri->segment(3);
+
+		if (!$news_id || !is_numeric($news_id)) {
+			show_404();
+		}
+
+		$this->db->delete('downloads', 'download_id=' . $news_id, 1);
+
+		redirect('admin/downloads');
+	}
+
+
+	function render()
+	{
+		$this->load->model('mrender');
+		$this->load->model('mforum');
+
+		$data['title'] = 'ARCHLine.XP Renderek';
+		$data['admin'] = true;
+		$data['aktiv'] = 12;
+		$data['tartalom'] = 'admin/render';
+		$data['csik'] = array('home', 'admin');
+
+		$data['style'] = array('fancybox2');
+		$data['javascript'] = array('fancybox/jquery-1.3.2.min', 'fancybox/jquery.easing.1.3', 'fancybox/jquery.fancybox-1.2.1.pack', 'fancybox/fancy');
+
+		$rend = "";
+		$ir = "";
+
+		if ($this->uri->segment(3) != "")
+			$rend = $this->uri->segment(3);
+		if ($this->uri->segment(4) != "")
+			$ir = $this->uri->segment(4);
+
+		$uresek = $this->mrender->get_all($rend, $ir);
+		foreach ($uresek as $render) {
+			$render->tulaj = $this->mforum->get_nev($render->user_id);
+		}
+
+		if ($rend == 'user_id' && $ir == "asc")
+			usort($uresek, "hasonlito");
+		elseif ($rend == 'user_id' && $ir == "desc")
+			usort($uresek, "hasonlitovissza");
+
+		/*	$hibasak = $this->mrender->get_byallapot("32");
+		foreach($hibasak as $render){
+			$render->tulaj = $this->mforum->get_nev($render->user_id);
+		}
+		
+		$varakozok = $this->mrender->get_byallapot("4");
+		foreach($varakozok as $render){
+			$render->tulaj = $this->mforum->get_nev($render->user_id);
+		}
+		*/
+		$data['uresek'] = $uresek;
+		$data['irany'] = $ir;
+		//	$data['hibasak'] = $hibasak;
+		//	$data['varakozok'] = $varakozok;
+
+		$this->load->view('site', $data);
+	}
+
+	function editrender()
+	{
+		$render_id = $this->uri->segment(3);
+		$a = $_POST['allapot'];
+
+		$this->db->update('render_img', array('allapot' => $a, 'datum' => time()), "render_id = '" . $render_id . "'");
+		redirect('admin/render');
+	}
+
+	function delrender()
+	{
+		$render_id = $this->uri->segment(3);
+
+		$this->db->update('render_img', array('deleted' => '1'), "render_id = '" . $render_id . "'");
+		redirect('admin/render');
+	}
+
+	function rendertorol()
+	{
+		$this->load->model('mrender');
+
+		$miket = $this->input->post('torol');
+
+		foreach ($miket as $mi) {
+			//	print "
id: ".$mi; + $this->mrender->del($mi); + + $record->osztaly = "admin"; + $record->fv = "rendertorol"; + $record->hiba = "törlés: " . $mi; + $record->datum = date('Y-m-d H:i:s', time()); + // $this->db->insert('a_hibak',$record); + } + + redirect('admin/render'); + } + + function phpinfo() + { + phpinfo(); + } + + + function get_directory_file($path, $kit = "pdf") + { + $path_id = opendir($path); + while ($file_name = readdir($path_id)) { + if ($file_name != "." && $file_name != "..") { + $file["type"] = filetype($path . "/" . $file_name); + if ($file["type"] == "dir") { + $file_array = array(); + $file_array = $this->get_directory_file($path . "/" . $file_name, $kit); + if (isset($found)) + $found = array_merge($found, $file_array); + else + $found = $file_array; + } else { + /* $file["accessed"] = fileatime($path . "/" . $file_name); + $file["changed"] = filectime($path . "/" . $file_name); + $file["group"] = filegroup($path . "/" . $file_name); + $file["inode"] = fileinode($path . "/" . $file_name); + $file["modified"] = filemtime($path . "/" . $file_name); + $file["owner"] = fileowner($path . "/" . $file_name); + $file["permissions"] = fileperms($path . "/" . $file_name); + $file["size"] = filesize($path . "/" . $file_name);*/ + if (substr($file_name, -4) == "." . $kit) + $found[substr($path, 17) . "/" . $file_name] = substr($path, 17) . "/" . $file_name; + // $found[$path][] = substr($path,17)."/".$file_name; + } + } + } + closedir($path_id); + if (!isset($found)) { + $found = array(); + } + return ($found); + } + + + function galeria() + { + $this->load->model('mgallery'); + + $fajlok = array('img/honapkepe' => 'img/honapkepe'); + + $intfajlok = scandir('/var/www/hosting/cadline.hu/www/public/gallery/'); + $archfajlok = scandir('/var/www/hosting/cadline.hu/www/public/galeria/'); + + foreach ($intfajlok as $m) { + if ($m != "." && $m != "..") { + $fajlok['gallery/' . $m] = 'gallery/' . $m; + } + } + + foreach ($archfajlok as $m) { + if ($m != "." && $m != "..") { + $fajlok['galeria/' . $m] = 'galeria/' . $m; + } + } + + + $nyelv = $this->muser->user['admin_lang']; + + $honapkepekepek = $this->mgallery->get_all('hun', 'honapkepe'); + foreach ($honapkepekepek as $hk) { + $hk->kiemelt4 = $hk->kiemelt3 = $hk->kiemelt2 = $hk->kiemelt1 = null; + if (file_exists('public/img/honapkepe/galeria/' . $hk->sorszam . '/sorrend.php')) { + include('public/img/honapkepe/galeria/' . $hk->sorszam . '/sorrend.php'); + $kiemeltek = $images; + + $hk->kiemelt1 = $kiemeltek[0]; + $hk->kiemelt2 = $kiemeltek[1]; + $hk->kiemelt3 = $kiemeltek[2]; + $hk->kiemelt4 = $kiemeltek[3]; + } else { + $images = scandir('public/img/honapkepe/galeria/' . $hk->sorszam); + $i = 1; + foreach ($images as $img) { + if ($img != ".." && $img != "." && !is_dir('public/img/honapkepe/galeria/' . $hk->sorszam . "/" . $img) && $img != "sorrend.php") { + $hk->{'kiemelt' . $i} = $img; + $i++; + } + } + } + } + //print_r($honapkepekepek); + + $data['honapkepek_json'] = json_encode($honapkepekepek); + $data['honapkepek'] = $honapkepekepek; + $data['ktkepek'] = $this->mgallery->get_all($nyelv, 'kezzel'); + $data['interiorkepek'] = $this->mgallery->get_all($nyelv, 'interior'); + $data['architectkepek'] = $this->mgallery->get_all($nyelv, 'architect'); + $data['photokepek'] = $this->mgallery->get_all($nyelv, 'photo'); + + $data['galeriak_json'] = json_encode($this->mgallery->get_all($nyelv)); + + $data['fajlok'] = $fajlok; + + $data['title'] = 'ARCHLine.XP Galériák'; + $data['admin'] = true; + $data['aktiv'] = 13; + $data['tartalom'] = 'admin/galeria'; + $data['csik'] = array('home', 'admin'); + + $data['style'] = array('jquery.ui'); + $data['javascript'] = array('jquery_ui'); + + $this->load->view('site', $data); + } + + /*function editgaleria(){ + $gal_id = $this->input->post('gal_id'); + $galeria['cim'] = $this->input->post('cim'); + $galeria['terulet'] = $this->input->post('terulet'); + $galeria['leiras'] = $this->input->post('leiras'); + $galeria['mappa'] = $this->input->post('mappa'); + $galeria['link'] = $this->input->post('link'); + $galeria['kezdo'] = $this->input->post('kezdo'); + $galeria['sorszam'] = $this->input->post('sorszam'); + if( $_POST['uj'] == "on" ) + $galeria['uj'] = '1'; + else + $galeria['uj'] = '0'; + + if( $galeria['terulet'] == "honapkepe" ) + $galeria['leiras'] .= "###".$this->input->post('leiras2'); + + + if( isset($_FILES) && $_FILES['fajlok']['name'] != ''){ + include('application/helpers/sajatfeltolto.php'); + + // $hovakep = "public/upload/eng/"; + switch($galeria['terulet']){ + case 'interior': + $hovakep = 'public/gallery/'; + + if( $galeria['mappa'] == "" && $this->input->post('ujgal') == 'igen' && substr(basename( $_FILES['fajlok']['name'] ),-4) == ".zip" ) + $hovakep .= substr(basename( $_FILES['fajlok']['name'] ), 0, -4) . '/'; + break; + case 'architect': + $hovakep = 'public/gallery/'; + if( $galeria['mappa'] == "" && $this->input->post('ujgal') == 'igen' && substr(basename( $_FILES['fajlok']['name'] ),-4) == ".zip" ) + $hovakep .= substr(basename( $_FILES['fajlok']['name'] ), 0, -4) . '/'; + break; + case 'photo': + $hovakep = 'public/gallery/'; + if( $galeria['mappa'] == "" && $this->input->post('ujgal') == 'igen' && substr(basename( $_FILES['fajlok']['name'] ),-4) == ".zip" ) + $hovakep .= substr(basename( $_FILES['fajlok']['name'] ), 0, -4) . '/'; + break; + case 'kezzel': + $hovakep = 'public/img/kezzeltervez/'.$galeria['mappa'].'/'; + break; + case 'honapkepe': + $hovakep = 'public/img/honapkepe/galeria/'.$galeria['sorszam']; + break; + } + + if( !is_dir($hovakep) && $hovakep != "" ){ + mkdir($hovakep,0777); + exec('chmod 777 /var/www/hosting/cadline.hu/www/'.$hovakep); + } + + + $ered = feltolt('fajlok',$hovakep,$_FILES['fajlok']['name'],true); + if($ered){ + + $mit = '/var/www/hosting/cadline.hu/www/'.$ered; + exec('chmod 777 '.$mit); + + if( substr($ered,-4) == ".zip" ){ + $hova2 = '/var/www/hosting/cadline.hu/www/'.$hovakep; + + + require_once('application/helpers/pclzip.lib.php'); + $archive = new PclZip($mit); + if($archive->extract(PCLZIP_OPT_PATH, $hova2) == 0){ + die("Error : ".$archive->errorInfo(true)); + } + + $galeria['mappa'] = substr(basename($ered),0,-4); + + unlink($ered); + }elseif( is_dir($hovakep.$galeria['mappa']) ){ + copy($ered,$hovakep.$galeria['mappa']); + } + } + else{ + $record->osztaly = "admin"; + $record->fv = "editgaleria"; + $record->hiba = "Fajl feltoltesi hiba:\n".$_FILES['fajlok']['name']."\nide: ".$hovakep; + $record->datum = date('Y-m-d H:i:s',time()); + $this->db->insert('a_hibak',$record); + } + } + + + if( $this->input->post('ujgal') == 'nem' ) + $this->db->update('gallerys',$galeria,"gal_id = '".$gal_id."'"); + elseif( $this->input->post('ujgal') == 'igen' ){ + $galeria['nyelv'] = $this->muser->user['admin_lang']; + $galeria['deleted'] = '0'; + $this->db->insert('gallerys',$galeria); + } + + redirect('admin/galeria'); + }*/ + + function edithkgaleria() + { + $gal_id = $this->input->post('gal_id'); + $galeria['cim'] = $this->input->post('cim'); + $galeria['terulet'] = 'honapkepe'; + $galeria['leiras'] = $this->input->post('leiras'); + $galeria['kezdo'] = $this->input->post('kezdo'); + $galeria['sorszam'] = $this->input->post('sorszam'); + + // kiemelt képek + $kiemeltek = "array(\n"; //array(); + $kiemeltekmappa = 'public/img/honapkepe/galeria/' . $galeria['sorszam']; + $kiemeltekfajl = $kiemeltekmappa . '/sorrend.php'; + + exec('rm -R public/img/honapkepe/galeria/' . $galeria['sorszam']); + mkdir($kiemeltekmappa, 0644); + chmod($kiemeltekmappa, 0777); + + mkdir($kiemeltekmappa . '/thumbs', 0644); + chmod($kiemeltekmappa . '/thumbs', 0777); + + $kivev = (2011 + (int)($galeria['sorszam'] / 12.00009)); + $kivhonap = (($galeria['sorszam'] - 1) % 12 + 1); + $evho = ($kivhonap < 10) ? $kivev . "0" . $kivhonap : $kivev . $kivhonap; + + for ($i = 1; $i <= 4; $i++) { + if ($this->input->post('kiemelt' . $i)) { + $fajli = $this->input->post('kiemelt' . $i); + exec('cp public/img/honapkepe/' . $evho . '/' . $fajli . ' ' . $kiemeltekmappa . '/' . $fajli); + exec('cp public/img/honapkepe/' . $evho . '/thumbs/' . $fajli . ' ' . $kiemeltekmappa . '/thumbs/' . $fajli); + $kiemeltek .= '\t\"' . $this->input->post('kiemelt' . $i) . '\"'; + if ($this->input->post('kiemelt' . ($i + 1))) + $kiemeltek .= ",\n"; + else + $kiemeltek .= "\n"; + } + } + $kiemeltek .= ");\n"; + // $sorrendphp = print_r($kiemeltek,true); + $sorrendphp = $kiemeltek; + // print ""; + // ... + + // adatbázis + if ($this->input->post('ujgal') == 'nem') + $this->db->update('gallerys', $galeria, "gal_id = '" . $gal_id . "'"); + elseif ($this->input->post('ujgal') == 'igen') { + $galeria['nyelv'] = $this->muser->user['admin_lang']; + $galeria['deleted'] = '0'; + $this->db->insert('gallerys', $galeria); + } + + redirect('admin/galeria'); + } + + function ajaxhkkepek() + { + $sorszam = $this->uri->segment(3); + $ev = 2011 + (int)(($sorszam - 1) / 12); + $honap = (($sorszam - 1) % 12) + 1; + $honap = ($honap >= 10) ? $honap : '0' . $honap; + $mappa = $ev . $honap; + + $utvonal = '/var/www/hosting/cadline.hu/www/public/img/honapkepe/' . $mappa . '/'; + $kepek = scandir($utvonal); + $nyerteskep = $this->db->query("SELECT kezdo FROM gallerys WHERE sorszam={$sorszam} AND terulet='honapkepe' AND deleted=0")->row(); + + print ""; + } + + + function galeriadelete() + { + $gal_id = $this->uri->segment(3); + + $this->db->update('gallerys', array('deleted' => '1'), "gal_id = '" . $gal_id . "'"); + redirect('admin/galeria'); + } + + function ujgalkep() + { + if ($_FILES["gallery2012"]["error"] == 0) { + include('application/helpers/sajatfeltolto.php'); + include('application/helpers/myimg_helper.php'); + + $hova = "public/img/gallery2012/"; + $fajlnev = $_FILES["gallery2012"]["name"]; + feltolt("gallery2012", $hova, $fajlnev, true); + kemeretezesvagassh($hova . $fajlnev, $hova . $fajlnev, 800, 600); + kemeretezesvagassh($hova . $fajlnev, $hova . 'thumbs/' . $fajlnev, 68, 68); + kemeretezesvagassh($hova . $fajlnev, $hova . '300/' . $fajlnev, 300, 225); + chmod($hova . $fajlnev, 0777); + } + + redirect('admin/galeria'); + } + + function ujarchgalkep() + { + if ($_FILES["gallery2012"]["error"] == 0) { + include('application/helpers/sajatfeltolto.php'); + include('application/helpers/myimg_helper.php'); + + $hova = "public/img/gallery2012architect/"; + $fajlnev = $_FILES["gallery2012"]["name"]; + feltolt("gallery2012", $hova, $fajlnev, true); + kemeretezesvagassh($hova . $fajlnev, $hova . $fajlnev, 800, 600); + kemeretezesvagassh($hova . $fajlnev, $hova . 'thumbs/' . $fajlnev, 68, 68); + kemeretezesvagassh($hova . $fajlnev, $hova . '300/' . $fajlnev, 300, 225); + chmod($hova . $fajlnev, 0777); + } + + redirect('admin/galeria'); + } + + function createthumbs() + { + $utvonal = $this->input->post('utvonal'); + + + if (!$utvonal) { +?> +
+ Utvonal:
+ pelda: public/img/gallery2012/ +
+ "; + print "
ok: " . $ujkiskep; + } + } + print "Letrehozva: " . $letrehozva; + exit(); + } + } + + function creategallerylink() + { + $utvonal = $this->input->post('utvonal'); + + + if (!$utvonal) { + ?> +
+ Mappa:
+ pelda: public/img/gallery2012/ +
+load->model('mevents'); + + $data['error'] = false; + $nyelv = hun() ? "hun" : "eng"; + + $do = $this->input->post('do'); + + //esemény módosítása + if ($do && $do == 'modositas') { + $post['datum'] = $this->input->post('datum'); + $post['ora_kezdet'] = $this->input->post('ora_kezdet'); + $post['ora_veg'] = $this->input->post('ora_veg'); + $post['perc_kezdet'] = $this->input->post('perc_kezdet'); + $post['perc_veg'] = $this->input->post('perc_veg'); + $post['event_limit'] = $this->input->post('event_limit'); + $post['active'] = $this->input->post('active'); + $post['nev'] = $this->input->post('nev'); + $post['event_id'] = $this->input->post('event_id'); + $post['event_main_id'] = $this->input->post('event_main_id'); + $post['location'] = ($this->input->post('event_location2') != "") ? $this->input->post('event_location2') : $this->input->post('event_location'); + $post['csoport'] = $this->input->post('csoport'); + + if ($this->input->post('online') == "on") + $post['online'] = '1'; + else + $post['online'] = 'NULL'; + + if ($error = $this->mevents->modifyEvent($post)) { + $data['error'] = $error; + } + + if ($post['event_main_id'] == 56 || $post['event_main_id'] == 63) + $this->cache->delete('archline-klub-idopontok-' . $nyelv); + } + + //új esemény rögzítése + if ($do && $do == 'rogzites') { + $post['datum'] = $this->input->post('datum'); + $post['ora_kezdet'] = $this->input->post('ora_kezdet'); + $post['ora_veg'] = $this->input->post('ora_veg'); + $post['perc_kezdet'] = $this->input->post('perc_kezdet'); + $post['perc_veg'] = $this->input->post('perc_veg'); + $post['event_limit'] = $this->input->post('event_limit'); + $post['active'] = $this->input->post('active'); + $post['nev'] = $this->input->post('nev'); + $post['event_main_id'] = $this->input->post('event_main_id'); + $post['location'] = ($this->input->post('event_location2') != "") ? $this->input->post('event_location2') : $this->input->post('event_location'); + $post['csoport'] = $this->input->post('csoport'); + + if ($this->input->post('online') == "on") + $post['online'] = '1'; + else + $post['online'] = 'NULL'; + + if ($error = $this->mevents->createEvent($post)) { + $data['error'] = $error; + } + + if ($post['event_main_id'] == 56 || $post['event_main_id'] == 63) + $this->cache->delete('archline-klub-idopontok-' . $nyelv); + } + + //főesemény módosítása + if ($do && $do == 'modositas_main') { + + $config['upload_path'] = 'public/img/workshop/ENG/subjects/'; + $config['allowed_types'] = 'gif|jpg|png'; + $config['max_size'] = '1000'; + $config['overwrite'] = true; + + $this->load->library('upload', $config); + + $this->upload->initialize($config); + + if (isset($_FILES['fokep']) && $_FILES['fokep']["error"] == 0) { + + include('application/helpers/sajatfeltolto.php'); + + $fokep = feltolt('fokep', $config['upload_path'], "big_" . $_FILES['fokep']["name"], true); + + if (!$fokep) { + $data['error'] = "Kép feltöltési hiba"; + } else { + exec('convert -resize 458 ' . $fokep . ' public/img/workshop/ENG/subjects/' . substr(basename($fokep), 4)); + $fokep = substr(basename($fokep), 4); + } + } else { + $fokep = $this->input->post('fokep_eredeti'); + } + + + if (!$data['error']) { + $post = array( + 'event_main_id' => $this->input->post('event_main_id'), + 'nev' => $this->input->post('nev'), + 'sikeres_reg_oldal' => $this->input->post('sikeres_reg_oldal'), + 'sikeres_reg_mail' => $this->input->post('sikeres_reg_mail'), + 'reg_torles_oldal' => $this->input->post('reg_torles_oldal'), + 'datum_kezdet' => $this->input->post('datum_kezdet'), + 'ora_kezdet' => $this->input->post('ora_kezdet'), + 'perc_kezdet' => $this->input->post('perc_kezdet'), + 'datum_veg' => $this->input->post('datum_veg'), + 'ora_veg' => $this->input->post('ora_veg'), + 'perc_veg' => $this->input->post('perc_veg'), + 'limit' => $this->input->post('event_main_limit'), + 'active' => $this->input->post('active'), + 'rss' => $this->input->post('rss'), + 'fokep' => $fokep, + 'shorttext' => $this->input->post('rovid_oldal'), + 'project' => $this->input->post('project'), + 'video' => $this->input->post('video'), + 'guide' => $this->input->post('guide'), + 'shortfile' => $this->input->post('shortfile') + ); + + if ($error = $this->mevents->modifyMainEvent($post)) { + $data['error'] = $error; + } + } + } + + //új főesemény létrehozása + if ($do && $do == 'rogzites_main') { + $config['upload_path'] = 'public/img/workshop/ENG/subjects/'; + $config['allowed_types'] = 'gif|jpg|png'; + $config['max_size'] = '1000'; + $config['overwrite'] = true; + + // $this->upload->initialize($config); + + /*if(isset($_FILES, $_FILES['fokep']) && $_FILES['fokep'] != ''){ + if(!$this->upload->do_upload('thumb')){ + $data['error'] = $this->upload->display_errors('

', '

'); + } else { + $fokep = $this->upload->file_name; + } + } else { + $fokep = ''; + }*/ + if (isset($_FILES['fokep']) && $_FILES['fokep']["error"] == 0) { + + include('application/helpers/sajatfeltolto.php'); + + $fokep = feltolt('fokep', $config['upload_path'], "big_" . $_FILES['fokep']["name"], true); + + if (!$fokep) { + $data['error'] = "Kép feltöltési hiba"; + } else { + exec('convert -resize 458 ' . $fokep . ' public/img/workshop/ENG/subjects/' . substr(basename($fokep), 4)); + $fokep = substr(basename($fokep), 4); + } + } else { + $fokep = $this->input->post('fokep_eredeti'); + } + + if (!$data['error']) { + $post = array( + 'nev' => $this->input->post('nev'), + 'leiras' => substr($this->input->post('leiras'), 0, 500), + 'kep' => $kep, + 'thumb' => $thumb, + 'weboldal' => $this->input->post('weboldal'), + 'sikeres_reg_oldal' => $this->input->post('sikeres_reg_oldal'), + 'sikeres_reg_mail' => $this->input->post('sikeres_reg_mail'), + 'reg_torles_oldal' => $this->input->post('reg_torles_oldal'), + 'datum_kezdet' => $this->input->post('datum_kezdet'), + 'ora_kezdet' => $this->input->post('ora_kezdet'), + 'perc_kezdet' => $this->input->post('perc_kezdet'), + 'datum_veg' => $this->input->post('datum_veg'), + 'ora_veg' => $this->input->post('ora_veg'), + 'perc_veg' => $this->input->post('perc_veg'), + 'limit' => $this->input->post('event_main_limit'), + 'active' => $this->input->post('active'), + 'lang' => $this->muser->user['admin_lang'], + + 'rss_date' => time(), + 'rss' => $this->input->post('rss') + ); + + if ($error = $this->mevents->createMainEvent($post)) { + $data['error'] = $error; + } + } + } + + //collecting pages + $this->load->model('mpages'); + + if (hun()) { + $category = 'események'; + } else { + $category = 'events'; + } + + $data['event_pages'] = $this->mpages->get_category_pages($category, $this->muser->user['admin_lang'], true, 'page_title', 'asc'); + + //collecting events + $main_events = $this->mevents->getMainEvents($this->muser->user['admin_lang']); + + //creating json for the javascript + foreach ($main_events as $main_event) { + $main_event->events_list = $this->mevents->getEvents($main_event->event_main_id); + $ujreszinfok = $this->db->query("SELECT urlname, project, video, guide, shortfile FROM events_new_main WHERE event_main_id = " . $main_event->event_main_id)->row(); + $main_event->urlname = $ujreszinfok->urlname; + $main_event->project = $ujreszinfok->project; + $main_event->video = $ujreszinfok->video; + $main_event->guide = $ujreszinfok->guide; + $main_event->shortfile = $ujreszinfok->shortfile; + + // $main_event->shorttext = $elokepek->shorttext; + + if ($main_event->events_list) { + foreach ($main_event->events_list as $event) { + $event->reg_list = $this->mevents->getRegistrations($event->event_id); + } + } + } + + $data['main_events_json'] = json_encode($main_events); + + $data['main_events'] = $main_events; + + //collecting event view types + $event_views = $this->mevents->getEventViews(); + + $data['event_views'] = $event_views; + + $klubtemak = $this->db->query("SELECT url, menu_cim FROM archline_klub WHERE aktiv=1 AND nyelv='{$nyelv}' ORDER BY menu_cim")->result(); + $data['klubtemak'] = $klubtemak; + + $data['admin'] = true; + $data['aktiv'] = 13; + $data['tartalom'] = 'admin/workshop'; + $data['csik'] = array('home', 'admin'); + $data['javascript'] = array('jquery_ui', 'ui.datepicker-hu', 'jquery.numeric.pack'); + $data['style'] = array('jquery.ui'); + + $this->load->view('site', $data); + } + + function wsparkolo() + { + $irany = $this->uri->segment(3); + $reg_id = $this->uri->segment(4); + + $this->db->query("UPDATE events_new_registrations SET parkolo=parkolo+({$irany}) WHERE events_new_registrations_id={$reg_id}"); + header("Location: " . $_SERVER["HTTP_REFERER"]); + } + + function wsgep() + { + $irany = $this->uri->segment(3); + $reg_id = $this->uri->segment(4); + + $this->db->query("UPDATE events_new_registrations SET gep=gep+({$irany}) WHERE events_new_registrations_id={$reg_id}"); + header("Location: " . $_SERVER["HTTP_REFERER"]); + } + + function alklubtemak() + { + + $nyelv = hun() ? "hun" : "eng"; + + if ($this->input->post("do")) { + $tema_id = $this->input->post("tema_id"); + $uj["sorsz"] = $this->input->post("sorsz"); + $uj["cim"] = $this->input->post("cim"); + $uj["menu_cim"] = $this->input->post("menu_cim"); + $uj["page"] = $this->input->post("page"); + // $uj["pdf"] = $_FILES["pdf"]["name"]; + $uj["aktiv"] = ($this->input->post("aktiv") == "on") ? 1 : 0; + + if ($_FILES["pdf"]["error"] == 0) { + include('application/helpers/sajatfeltolto.php'); + $pdf = feltolt('pdf', "public/downloads/hun/archlineklub/", $_FILES['pdf']["name"], true); + + if ($pdf) { + $uj["pdf"] = basename($pdf); + } + } + + // módosítás + if (is_numeric($tema_id) && $tema_id > 0) { + $this->db->update('archline_klub', $uj, "tema_id={$tema_id}"); + //print "modosít: "; print_r($uj); + } + // új + else { + $uj["nyelv"] = $nyelv; + $uj["url"] = $this->input->post("url"); + $this->db->insert('archline_klub', $uj); + //print "uj: "; print_r($uj); + } + + //redirect("admin/alklubtemak"); + } + + $pcategory = hun() ? 'Események' : 'Events'; + $temak = $this->db->query("SELECT * FROM archline_klub WHERE nyelv='{$nyelv}' ORDER BY sorsz DESC")->result(); + $esemlapok = $this->db->query("SELECT page_id, page_title FROM pages WHERE page_category='{$pcategory}' AND page_urls!='e-mail' AND del=0 ORDER BY page_title")->result(); + $utolso = $this->db->query("SELECT max(sorsz) as sorsz FROM archline_klub WHERE nyelv='{$nyelv}'")->row(); + + $data['kovsorszam'] = $utolso->sorsz + 1; + $data['temak'] = $temak; + $data['esemlapok'] = $esemlapok; + $data['admin'] = true; + $data['aktiv'] = 13; + $data['tartalom'] = 'admin/alklubtemak'; + $data['csik'] = array('home', 'admin'); + $data['javascript'] = array('jquery_ui'); + $data['style'] = array('jquery.ui'); + + $this->load->view('site', $data); + } + + function collection2() + { + $this->load->model('mcollection2'); + + $gyartolimit = array("ita" => "2", "ger" => "itc"); + + $adminlang = $this->muser->user['lang']; + + if (array_key_exists($adminlang, $gyartolimit)) { + if (ita()) + $gyartok = $this->db->query("SELECT * FROM coll2_man WHERE deleted=0 AND group_id LIKE ';{$gyartolimit[$adminlang]};'")->result(); + else + $gyartok[0] = $this->mcollection2->get_manBydir($gyartolimit[$adminlang]); + } else { + $gyartok = $this->mcollection2->get_gyartok(); + } + + $ordernev = hun() ? 'title_hun' : 'title_eng'; + + foreach ($gyartok as $gyarto) { + $gyarto->kategoria = $this->mcollection2->get_kategoriak($gyarto->dir); + $gyarto->darab = 0; + foreach ($gyarto->kategoria as $kategoria) { + $kategoria->fajl = $this->mcollection2->get_objektumok($kategoria->c_id, $ordernev . ' ASC'); + if (!$kategoria->fajl) + $kategoria->fajl = array(); + $kategoria->darab = count($kategoria->fajl); + $gyarto->darab += $kategoria->darab; + } + } + + + switch ($adminlang) { + case 'hun': + $urlelotag = 'http://www.archline.hu/'; + break; + case 'ita': + $urlelotag = 'http://www.archlinexp.com/it/'; + break; + case 'esp': + $urlelotag = 'http://www.archlinexp.com/es/'; + break; + default: + $urlelotag = 'http://www.archlinexp.com/'; + break; + } + + $brandgroup = false; + if (ita()) + $brandgroup = $this->db->query("SELECT * FROM coll2_mangrp WHERE group_id=2")->row(); + elseif (hun() || eng()) + $brandgroup = $this->db->query("SELECT * FROM coll2_mangrp WHERE deleted=0")->result(); + + $data['main_events_json'] = json_encode($gyartok); + $data['gyartok'] = $gyartok; + $data['brandgroup'] = $brandgroup; + $data['tipusok'] = $this->db->query("SELECT * FROM coll2_types ORDER BY type ASC")->result(); + $data['archlinetipusok'] = $this->db->query("SELECT distinct(type_download) FROM coll2_types ORDER BY type_download")->result(); + + $data['urlelotag'] = $urlelotag; + + $data['admin'] = true; + $data['aktiv'] = 11; + + $data['csik'] = array('home', 'admin'); + $data['javascript'] = array('jquery_ui', 'ui.datepicker-hu'); + $data['style'] = array('jquery.ui'); + $data['tartalom'] = 'admin/collection2'; + + $this->load->view('site', $data); + } + + function kategedit2() + { + $c_id = $this->input->post('cid'); + $mid = $this->input->post('mid'); + $nev_hun = $this->input->post('nev_hun'); + $nev_eng = $this->input->post('nev_eng'); + + + // kategória átnevezése + if ($c_id == "uj") { + $this->db->insert('coll2_cat', array('m_id' => $mid, 'nev_hun' => $nev_hun, 'nev_eng' => $nev_eng)); + $c_id = mysql_insert_id(); + } else { + $this->db->update('coll2_cat', array('nev_hun' => $nev_hun, 'nev_eng' => $nev_eng), "c_id={$c_id}"); + } + + + // kategória kép csere + if ($_FILES["katkep"]["error"] == 0) { + include('application/helpers/sajatfeltolto.php'); + $hova = "public/img/collection/category/"; + // korábbi kép törlése + exec("rm public/img/collection/category/" . $c_id . ".jpg"); + $ujkatkep = $hova . $c_id . ".jpg"; + feltolt("katkep", $hova, $c_id . ".jpg", true); + + // átméretezés + include('application/helpers/myimg_helper.php'); + kemeretezesvagassh($ujkatkep, $hova . $c_id . "_182x152.jpg", 182, 152); + kemeretezesvagassh($ujkatkep, $ujkatkep, 182, 131); + chmod($ujkatkep, 0777); + } + + redirect('admin/collection2'); + } + + function delkateg2() + { + $cid = $this->uri->segment(3); + + if ($cid != "" && is_numeric($cid)) + $this->db->update('coll2_cat', array('deleted' => 1), "c_id={$cid}"); + + redirect('admin/collection2'); + } + + function gyartocsopedit2() + { + $group_id = $this->input->post('group_id'); + $nev = $this->input->post('nev'); + + $azon = ""; + $subject = str_replace(' ', '-', strtolower($this->input->post('azon'))); + $pattern = '/[-_a-z0-9]*/'; + preg_match_all($pattern, $subject, $matches, PREG_OFFSET_CAPTURE); + foreach ($matches[0] as $m) + if ($m[0]) + $azon .= $m[0]; + + if ($group_id == "uj") { + $this->db->insert('coll2_mangrp', array('azon' => $azon, 'nev' => $nev)); + } else { + $this->db->update('coll2_mangrp', array('nev' => $nev), "group_id={$group_id}"); + } + + redirect('admin/collection2'); + } + + function delmangroup2() + { + $grpid = $this->uri->segment(3); + + if ($grpid != "" && is_numeric($grpid)) + $this->db->update('coll2_mangrp', array('deleted' => 1), "group_id={$grpid}"); + + redirect('admin/collection2'); + } + + function gyartoedit2() + { + include('application/helpers/sajatfeltolto.php'); + $mid = $this->input->post('mid'); + $name = $this->input->post('name'); + // $dir = strtolower($this->input->post('dir')); + + $dir = ""; + + if ($mid == "uj") { + $dir = urlazon($this->input->post('dir')); + + $tomb = array('name' => $name, 'dir' => $dir); + if (is_array($this->input->post('group_id')) && count($this->input->post('group_id')) > 0) { + $tomb['group_id'] = ";"; + foreach ($this->input->post('group_id') as $v) { + $tomb['group_id'] .= $v . ";"; + } + } + + + $this->db->insert('coll2_man', $tomb); + mkdir("public/img/collection/" . $dir . "/"); + chmod("public/img/collection/" . $dir . "/", 0777); + + mkdir("public/collection/" . $dir . "/"); + chmod("public/collection/" . $dir . "/", 0777); + } else { + $tomb = array('name' => $name); + + if (is_array($this->input->post('group_id')) && count($this->input->post('group_id')) > 0) { + $tomb['group_id'] = ";"; + foreach ($this->input->post('group_id') as $v) { + $tomb['group_id'] .= $v . ";"; + } + } elseif ((hun() || eng())) { + $tomb['group_id'] = null; + } + + $this->db->update('coll2_man', $tomb, "id={$mid}"); + + $this->load->model('mcollection2'); + $gyarto = $this->mcollection2->get_manById($mid); + $dir = $gyarto->dir; + } + + + // gyártó logó csere + if ($_FILES["gyartokep"]["error"] == 0) { + $hova = "public/img/collection/" . $dir . "/"; + // korábbi kép törlése + exec("rm public/img/collection/" . $dir . "/logo.png"); + $ujgylogo = $hova . "logo2.png"; + feltolt("gyartokep", $hova, "logo2.png", true); + + // átméretezés + include('application/helpers/myimg_helper.php'); + // kepmeretezesvagas($ujgylogo,$hova,"logo.png",237,122); + kemeretezesvagassh($ujgylogo, $hova . "logo.png", 239, 122); + exec("rm public/img/collection/" . $dir . "/logo2.png"); + chmod($hova . "logo.png", 0777); + } + + + redirect('admin/collection2'); + } + + function delman2() + { + $mid = $this->uri->segment(3); + + if ($mid != "" && is_numeric($mid)) + $this->db->update('coll2_man', array('deleted' => 1), "id={$mid}"); + + redirect('admin/collection2'); + } + + function coll2tipusedit() + { + include('application/helpers/sajatfeltolto.php'); + include('application/helpers/myimg_helper.php'); + $tipus = $this->input->post('tipus'); + $ujtipus['name_eng'] = $this->input->post('name_eng'); + $ujtipus['name_hun'] = $this->input->post('name_hun'); + $ujtipus['desc_eng'] = $this->input->post('desc_eng'); + $ujtipus['desc_hun'] = $this->input->post('desc_hun'); + + if ($tipus == "new") { + $subject = str_replace(' ', '-', strtolower($this->input->post('typeurl'))); + $pattern = '/[-_a-z0-9]*/'; + preg_match_all($pattern, $subject, $matches, PREG_OFFSET_CAPTURE); + $typeurl = ""; + foreach ($matches[0] as $m) + if ($m[0]) + $typeurl .= $m[0]; + + if (!$typeurl) { + print "Hiányos vagy hibás azonosító: " . $this->input->post('typeurl'); + return; + } + + + $ujtipus['type'] = $typeurl; + $ujtipus['type_download'] = $this->input->post('type_download'); + $this->db->insert('coll2_types', $ujtipus); + } else + $this->db->update('coll2_types', $ujtipus, "type = '{$tipus}'"); + + // képek feltöltése + if ($_FILES["image_eng"]["error"] == 0) { // angol kép + $hova = "public/img/collection/types/"; + // korábbi kép törlése + exec("rm public/img/collection/types/{$tipus}.png"); + $ujtipuskep = $hova . "{$tipus}.png"; + feltolt("image_eng", $hova, "{$tipus}.png", true); + + // átméretezés + kemeretezesvagassh($ujtipuskep, $ujtipuskep, 733, 468); + chmod($ujtipuskep, 0777); + } + if ($_FILES["image_hun"]["error"] == 0) { // magyar kép + $hova = "public/img/collection/types/"; + // korábbi kép törlése + exec("rm public/img/collection/types/{$tipus}_hun.png"); + $ujtipuskep = $hova . "{$tipus}_hun.png"; + feltolt("image_hun", $hova, "{$tipus}_hun.png", true); + + // átméretezés + kemeretezesvagassh($ujtipuskep, $ujtipuskep, 733, 468); + chmod($ujtipuskep, 0777); + } + + + redirect('admin/collection2'); + } + + + function delobjekt2() + { + $mid = $this->uri->segment(3); + $this->db->update('collection2', array('deleted' => 1), "o_id={$mid}"); + redirect('admin/collection2'); + } + + function shwrobjfiledel() + { + $fajl = base64_decode($this->uri->segment(3)); + $path = "public/collection/"; + $fajlinfok = explode('/', $fajl); + + $gyartodir = $fajlinfok[0]; + $objid = $fajlinfok[1]; + $fajlnev = $fajlinfok[2]; + + // jogosultság ellenőrzése + if (ita()) { + $brands = $this->db->query("SELECT * FROM coll2_man WHERE group_id LIKE '%;2;%' AND dir='{$gyartodir}'")->row(); + if (!$brands) { + print "jogosultsági hiba"; + return; + } + } elseif (!hun() && !eng()) { + print "jogosultsági hiba"; + return; + } + + if (!file_exists($path . $fajl)) { + print "A fájl nem található!"; + return; + } + + exec("mv {$path}{$fajl} {$path}zz_trash/{$objid}__{$fajlnev}"); + + $this->db->query("UPDATE coll2_ver SET deleted=0 WHERE fajl='{$fajlnev}' AND o_id={$objid}"); + + redirect('admin/col2objedit/' . $objid); + } + + function col2objedit() + { + $this->load->model('mcollection2'); + + if ($this->input->post('do') != false && is_numeric($_POST['oid'])) { + include('application/helpers/sajatfeltolto.php'); + include('application/helpers/myimg_helper.php'); + $o_id = $this->input->post('oid'); + + $ujpr->title_hun = $_POST["name_hun"]; + $ujpr->title_eng = $_POST["name_eng"]; + /**/ + $ujpr->desc_hun = $_POST["objectdeschun"]; + /**/ + $ujpr->desc_eng = $_POST["objectdesceng"]; + $ujpr->c_id = $_POST["kategoria"]; + $ujpr->tipus = $_POST["tipus"]; + $ujpr->rendelheto = ($_POST["rendelheto"] == "on") ? 1 : 0; + + // mentés + $this->db->update("cadline2.collection2", $ujpr, "o_id=" . $o_id); + + // név, leírás módosítás/beszúrás + foreach ($this->collectionlangs as $nyelv) { + if (!$_POST["name_" . $nyelv] && !$_POST["objectdesc" . $nyelv]) + continue; + + $d_id = $this->db->query("SELECT d_id FROM coll2_desc WHERE lang='{$nyelv}' AND o_id=" . $o_id)->row(); + $d_id = $d_id->d_id; + + $ujdesc->title = $_POST["name_" . $nyelv]; + $ujdesc->desc = $_POST["objectdesc" . $nyelv]; + if (!$d_id) { + $ujdesc->o_id = $o_id; + $ujdesc->lang = $nyelv; + $this->db->insert("cadline2.coll2_desc", $ujdesc); + unset($ujdesc->o_id, $ujdesc->lang); + } else + $this->db->update("cadline2.coll2_desc", $ujdesc, "d_id=" . $d_id); + } + + + $object = $this->mcollection2->get_elem($o_id); + $gyarto = $this->mcollection2->get_manById($object->m_id); + + + // új fájl + /*if( $_FILES["fajl"]["error"]==0 ){ + $hova = "public/collection/".$gyarto->dir."/".$o_id."/"; + $ujfajl = $hova.$_FILES["fajl"]["name"]; + feltolt("fajl",$hova,$_FILES["fajl"]["name"],true); + chmod($ujfajl,0777); + + if( $_POST["verzio"]!="" && is_numeric($_POST["verzio"]) ){ + $verzio->o_id = $o_id; + $verzio->version = $_POST['verzio']; + $verzio->fajl = $_FILES["fajl"]["name"]; + $this->db->insert('cadline2.coll2_ver',$verzio); + } + }*/ + + // új kis kép + /*if( $_FILES["kep"]["error"]==0 ){ + $hova = "public/img/collection/".$gyarto->dir."/".$o_id."/"; + // korábbi kis képek törlése + //exec("rm public/img/collection/".$gyarto->dir."/".$o_id."/*"); // ez konyvtarat nem torol + $ujkep = $hova.$_FILES["kep"]["name"]; + feltolt("kep",$hova,$_FILES["kep"]["name"],true); + kemeretezesvagassh($ujkep,$hova."zz_small.jpg",79,66); // új kis kép + kemeretezesvagassh($ujkep,$ujkep,70,68); // kis kép + chmod($jkep,0777); + }*/ + + // új nagy (és előnézeti) kép + kis kép + if ($_FILES["nagykep"]["error"] == 0) { + $hova = "public/img/collection/" . $gyarto->dir . "/" . $o_id . "/big/"; + $hova2 = "public/img/collection/" . $gyarto->dir . "/" . $o_id . "/"; + // korábbi nagy kép törlése + exec("rm public/img/collection/" . $gyarto->dir . "/" . $o_id . "/big/*"); + exec("rm public/img/collection/" . $gyarto->dir . "/" . $o_id . "/thumb/*"); + $ujnagykep = $hova . $_FILES["nagykep"]["name"]; + $ujelonezet = "public/img/collection/" . $gyarto->dir . "/" . $o_id . "/thumb/" . $_FILES["nagykep"]["name"]; + feltolt("nagykep", $hova, $_FILES["nagykep"]["name"], true); + + kemeretezesvagassh($ujnagykep, $hova2 . "zz_big.jpg", 480, 400); // új nagy kép + kemeretezesvagassh($ujnagykep, $hova2 . "zz_thumb.jpg", 182, 152); // új előnézeti kép + kemeretezesvagassh($ujnagykep, $hova2 . "zz_small.jpg", 79, 66); // új kis kép + // kemeretezesvagassh($ujnagykep,$ujkep,70,68); // kis kép + kemeretezesvagassh($ujnagykep, $ujnagykep, 488, 396); // regi nagy kep + kemeretezesvagassh($ujnagykep, $ujelonezet, 182, 131); // regi elonezeti kep + chmod($ujnagykep, 0777); + } + + // rendelhető elemek listájának frissítése + $this->nemrendelhetoelemek(); + + redirect('admin/collection2'); + } else { + if (hun()) + $data['title'] = 'ARCHLine.XP Objektum szerkesztés'; + else + $data['title'] = 'ARCHLine.XP Edit Object'; + $data['admin'] = true; + $data['aktiv'] = 11; + $data['tartalom'] = 'admin/col2objedit'; + $data['csik'] = array('home', 'admin'); + + $data['nyelvek'] = $this->collectionlangs; + $data['tipusok'] = $this->db->query("SELECT * FROM coll2_types ORDER BY type ASC")->result(); + + $oid = $this->uri->segment(3); + $object = $this->mcollection2->get_elem($oid); + $gyarto = $this->mcollection2->get_manById($object->m_id); + $verziok = $this->db->query("SELECT fajl, version FROM coll2_ver WHERE o_id={$oid} AND deleted=0")->result_array(); + + foreach ($this->collectionlangs as $nyelv) { + $tempt = 'title_' . $nyelv; + $tempd = 'desc_' . $nyelv; + + $tempobj = $this->db->query("SELECT title, `desc` FROM coll2_desc WHERE lang='{$nyelv}' AND o_id=" . $oid)->row(); + $object->$tempt = $tempobj->title; + $object->$tempd = $tempobj->desc; + } + + + function fajl_ev($array) + { + $vals = array(); + foreach ($array as $value) { + $vals[$value['fajl']] = $value['version']; + } + return $vals; + } + + if (count($verziok) > 0) { + $verziok2 = fajl_ev($verziok); + } + + + $data['group'] = $object; + $data['gyarto'] = $gyarto; + $data['verziok'] = $verziok2; + $data['fajlok'] = scandir('public/collection/' . $gyarto->dir . '/' . $oid); + + $data['kategoriak'] = $this->mcollection2->get_kategoriak($gyarto->dir); + + $this->load->view('site', $data); + } + } + + function col2brandchange() + { + $elemid = $this->uri->segment(3); + + // módosítás + if ($this->input->post('do') != false && is_numeric($elemid)) { + $newbrandkategoria = explode("*", $this->input->post('newbrandkategoria')); + $brandid = $newbrandkategoria[0]; + $branddir = $newbrandkategoria[1]; + $category = $newbrandkategoria[2]; + + $alapbol = $this->db->query("SELECT * FROM collection2 WHERE o_id=" . $elemid)->row(); + $olddir = $this->db->query("SELECT dir FROM coll2_man WHERE id=" . $alapbol->m_id)->row(); + $olddir = $olddir->dir; + + // kategória beállítása + $this->db->update('collection2', array('c_id' => $category, 'm_id' => $brandid), "o_id = " . $elemid); + + // fájlok átmásolása + rename("public/img/collection/{$olddir}/{$elemid}", "public/img/collection/{$branddir}/{$elemid}"); + rename("public/collection/{$olddir}/{$elemid}", "public/collection/{$branddir}/{$elemid}"); + + //exec("mv -R ".PATH_WEBSITE."public/img/collection/{$olddir}/{$elemid} ".PATH_WEBSITE."public/img/collection/{$branddir}/{$elemid}"); + redirect('admin/collection2'); + } + // űrlap + else { + + $gyartok = $this->db->query("SELECT * FROM coll2_man WHERE deleted=0 ORDER BY name")->result(); + $elemek = array(); + foreach ($gyartok as $gyarto) { + $kategoriak = $this->db->query("SELECT * FROM coll2_cat WHERE m_id={$gyarto->id} AND deleted=0 ORDER BY nev_hun")->result(); + foreach ($kategoriak as $kategoria) { + $elemek[$gyarto->id . "*" . $gyarto->dir . "*" . $kategoria->c_id] = $gyarto->name . " :: " . $kategoria->nev_hun; + } + } + + $data['gyartok'] = $elemek; + + $data['elem'] = $this->db->query("SELECT * FROM collection2 WHERE o_id=" . $elemid)->row(); + $mostanidir = $this->db->query("SELECT dir FROM coll2_man WHERE id=" . $data['elem']->m_id)->row(); + $data['mostani'] = $data['elem']->m_id . "*" . $mostanidir->dir . "*" . $data['elem']->c_id; + + $data['admin'] = true; + $data['aktiv'] = 11; + $data['tartalom'] = 'admin/col2brandchange'; + $data['csik'] = array('home', 'admin'); + + $this->load->view('site', $data); + } + } + + + // teljes kategóriát áttenni másik márkához + function col2categorybrandchange() + { + $catid = $this->uri->segment(3); + + // módosítás + if ($this->input->post('do') != false && is_numeric($catid)) { + $newbrandkategoria = explode("*", $this->input->post('newbrandkategoria')); + $brandid = $newbrandkategoria[0]; + $branddir = $newbrandkategoria[1]; + $category = $newbrandkategoria[2]; + + $katelemek = $this->db->query("SELECT * FROM collection2 WHERE c_id=" . $catid)->result(); + $olddir = $this->db->query("SELECT dir FROM coll2_man WHERE id=" . $katelemek[0]->m_id)->row(); + $olddir = $olddir->dir; + + // kategória beállítása + $this->db->update('collection2', array('c_id' => $category, 'm_id' => $brandid), "c_id = " . $catid); + + // fájlok átmásolása + foreach ($katelemek as $elem) { + rename("public/img/collection/{$olddir}/{$elem->o_id}", "public/img/collection/{$branddir}/{$elem->o_id}"); + rename("public/collection/{$olddir}/{$elem->o_id}", "public/collection/{$branddir}/{$elem->o_id}"); + } + + //exec("mv -R ".PATH_WEBSITE."public/img/collection/{$olddir}/{$elemid} ".PATH_WEBSITE."public/img/collection/{$branddir}/{$elemid}"); + redirect('admin/collection2'); + } + // űrlap + else { + + $gyartok = $this->db->query("SELECT * FROM coll2_man WHERE deleted=0 ORDER BY name")->result(); + $elemek = array(); + foreach ($gyartok as $gyarto) { + $kategoriak = $this->db->query("SELECT * FROM coll2_cat WHERE m_id={$gyarto->id} AND deleted=0 ORDER BY nev_hun")->result(); + foreach ($kategoriak as $kategoria) { + $elemek[$gyarto->id . "*" . $gyarto->dir . "*" . $kategoria->c_id] = $gyarto->name . " :: " . $kategoria->nev_hun; + } + } + + $data['gyartok'] = $elemek; + + $data['elem'] = $this->db->query("SELECT * FROM coll2_cat WHERE c_id=" . $catid)->row(); + $mostanidir = $this->db->query("SELECT dir FROM coll2_man WHERE id=" . $data['elem']->m_id)->row(); + $data['mostani'] = $data['elem']->m_id . "*" . $mostanidir->dir . "*" . $data['elem']->c_id; + + $data['admin'] = true; + $data['aktiv'] = 11; + $data['tartalom'] = 'admin/col2categorybrandchange'; + $data['csik'] = array('home', 'admin'); + + $this->load->view('site', $data); + } + } + + // public/collection/nemrendelhetoelemek.txt újra generálása + function nemrendelhetoelemek() + { + $nemrendelhetoelemekfajl = 'public/collection/nemrendelhetoelemek.txt'; + exec('rm ' . $nemrendelhetoelemekfajl); + exec('touch ' . $nemrendelhetoelemekfajl); + + $gyartok = $this->db->query("SELECT id, dir FROM coll2_man")->result(); + $gyartoktmp = array(); + foreach ($gyartok as $gyarto) { + $gyartoktmp[$gyarto->id] = $gyarto->dir; + } + $gyartok = $gyartoktmp; + + $elemek = $this->db->query("SELECT o_id, m_id FROM collection2 WHERE rendelheto=0 AND deleted=0")->result(); + + $utvonal = 'public/collection/'; + foreach ($elemek as $elem) { + $fajlokmappa = $utvonal . $gyartok[$elem->m_id] . "/" . $elem->o_id . "/"; + $fajlok = scandir($fajlokmappa); + unset($fajlok[0], $fajlok[1]); // . és .. törlése + /* unset($fajlok[array_search('.', $fajlok)]); + unset($fajlok[array_search('..', $fajlok)]);*/ + foreach ($fajlok as $fajl) { + if (!is_dir($fajlokmappa . $fajl)) { + exec('echo "' . $fajl . '" >> ' . $nemrendelhetoelemekfajl); + } + } + } + } + + function coll2stat() + { + $this->load->model('mcollection2'); + + $gyartolimit = array("ita" => "cadlinesw", "ger" => "itc"); + $adminlang = $this->muser->user['lang']; + + if (array_key_exists($adminlang, $gyartolimit)) { + $gyartok[0] = $this->mcollection2->get_manBydir($gyartolimit[$adminlang]); + } else { + $gyartok = $this->mcollection2->get_gyartok(); + } + + $statisztika = array(); + + foreach ($gyartok as $gyarto) { + $statisztika[$gyarto->name] = array(); + $statisztika[$gyarto->name]["letoltvedarab"] = 0; + $statisztika[$gyarto->name]["megnezvedarab"] = 0; + + $kategoriak = $this->mcollection2->get_kategoriak($gyarto->dir); + foreach ($kategoriak as $kategoria) { + $parancs = "SELECT SUM(down) letoltve, SUM(`show`) megnezve FROM collection2 WHERE c_id=" . $kategoria->c_id . " AND deleted=0"; + $db = $this->db->query($parancs)->row(); + $statisztika[$gyarto->name][$kategoria->nev_eng]["letoltvedarab"] = $db->letoltve; + $statisztika[$gyarto->name][$kategoria->nev_eng]["megnezvedarab"] = $db->megnezve; + + $statisztika[$gyarto->name]["letoltvedarab"] += $db->letoltve; + $statisztika[$gyarto->name]["megnezvedarab"] += $db->megnezve; + } + } + + // print "
";
+		//	print_r($statisztika);
+
+		$this->load->library('Excel');
+
+		$workbook = new Excel();
+
+		//sending header and creating a worksheet
+		$workbook->send('showroom_stat.xls');
+		$workbook->setVersion(8);
+		$worksheet = $workbook->addWorksheet('Showroom Download Stats');
+
+		//setting encoding
+		$worksheet->setInputEncoding('UTF-8');
+
+		//bold formating
+		$fm_ttl = $workbook->addFormat();
+		$fm_ttl->setBold();
+		$fm_ttl->setAlign('equal_space');
+
+		//set the titles
+		$worksheet->write(0, 0, 'Gyártó',    $fm_ttl);
+		$worksheet->write(0, 1, 'Kategória', $fm_ttl);
+		$worksheet->write(0, 2, 'Letöltve',  $fm_ttl);
+		$worksheet->write(0, 3, 'Megtekintve', $fm_ttl);
+
+		//populate the worksheet
+		$i = 1;
+		foreach ($statisztika as $k => $s) {
+			$worksheet->write($i, 0, "");
+			$worksheet->write($i, 1, "");
+			$worksheet->write($i, 2, "");
+			$worksheet->write($i, 3, "");
+
+			$i++;
+
+			$worksheet->write($i, 0, $k);
+			$worksheet->write($i, 1, "összesen");
+			$worksheet->write($i, 2, $s["letoltvedarab"]);
+			$worksheet->write($i, 3, $s["megnezvedarab"]);
+			$i++;
+
+			foreach ($s as $k2 => $s2) {
+				if ($k2 == "letoltvedarab" || $k2 == "megnezvedarab")
+					continue;
+
+				$worksheet->write($i, 0, "");
+				$worksheet->write($i, 1, $k2);
+				$worksheet->write($i, 2, $s2["letoltvedarab"]);
+				$worksheet->write($i, 3, $s2["megnezvedarab"]);
+				$i++;
+			}
+		}
+
+		$workbook->close();
+	}
+
+	function videok()
+	{
+		$nyelv = hun() ? "hun" : "eng";
+		$oktatovideokt = $this->db->query("SELECT * FROM videos WHERE sorszam>0 AND nyelv='{$nyelv}' ORDER BY sorszam")->result();
+		$oktatovideok = array();
+		foreach ($oktatovideokt as $video) {
+			$csoport = $video->csoport;
+			if (!is_array($oktatovideok[$csoport]))
+				$oktatovideok[$csoport] = array();
+
+			$oktatovideok[$csoport][] = $video;
+		}
+
+		$ovcsoportok = $this->db->query("SELECT * FROM videogroups WHERE nyelv='{$nyelv}'")->result();
+
+		$data['oktatovideok'] = $oktatovideok;
+		$data['ovcsoportok']  = $ovcsoportok;
+		$data['admin']        = true;
+		$data['aktiv']        = 5;
+
+		$data['title'] = hun() ? 'ARCHLine.XP Oktatóvideók' : 'ARCHLine.XP videos';
+		$data['tartalom'] = 'admin/videok';
+
+		$this->load->view('site', $data);
+	}
+
+	function set_oktatovideok()
+	{
+		// videók módosítása
+		include('application/helpers/sajatfeltolto.php');
+		include('application/helpers/myimg_helper.php');
+		$videokdb = $this->input->post('videokdb');
+		$lang = hun() ? "hun" : "eng";
+		for ($i = 0; $i < $videokdb; $i++) {
+			$video = new stdClass();
+			$video->vid_id  = $this->input->post('vid_id' . $i);
+			$video->sorszam = $this->input->post('vidsorszam' . $i);
+			$video->youtubeid = $this->input->post('vidyoutube' . $i);
+			$video->kep     = $this->input->post('vidkep' . $i);
+			$video->cim     = $this->input->post('vidcim' . $i);
+			$video->leiras  = $this->input->post('vidleiras' . $i);
+			$video->csoport = $this->input->post('csoport' . $i);
+			$torles  = $this->input->post('viddel' . $i);
+
+
+			$kepuj = 'vidkep' . $i;
+
+			if ($torles == "on")
+				$video->sorszam = 0;
+
+
+			$utvonal = 'public/img/welcome/' . $lang . '/';
+
+			//	$this->kep3($kepuj,$utvonal,'vidkep'.$i);
+			if ($_FILES['vidkep' . $i]["error"] == 0) {
+				$kepuj = feltolt('vidkep' . $i, $utvonal, $_FILES['vidkep' . $i]["name"], true);
+				kemeretezesvagassh($kepuj, $kepuj, 60, 48);
+			}
+
+			if ($kepuj != ('vidkep' . $i)) {
+				$video->kep = $kepuj;
+			} else {
+				unset($video->kep);
+			}
+			unset($kepuj);
+
+			if ($video->vid_id) {
+				$this->db->update('videos', $video, "vid_id={$video->vid_id}");
+				//		print "
".$this->db->last_query(); + } + } + + + // új videó + $uj = $this->input->post('ujviddel'); + if ( /*isset($_POST['ujviddel']) &&*/$uj != "on") { + $record->sorszam = $this->input->post('ujvidsorszam'); + $record->youtubeid = $this->input->post('ujvidyoutube'); + $record->cim = $this->input->post('ujvidcim'); + $record->leiras = $this->input->post('ujvidleiras'); + $record->csoport = $this->input->post('ujvidcsoport'); + $record->nyelv = $lang; + + $kepuj = ''; + + $record->nyelv = $lang; + + $utvonal = 'public/img/welcome/' . $lang . '/'; + + //$this->kep3($kepuj,$utvonal,'ujvidkep'); + if ($_FILES['ujvidkep']["error"] == 0) { + $kepuj = feltolt('ujvidkep', $utvonal, $_FILES['ujvidkep']["name"], true); + kemeretezesvagassh($kepuj, $kepuj, 60, 48); + } + + if ($kepuj != '') { + $record->kep = $kepuj; + } + + $this->db->insert('`videos`', $record); + } + + // print_r($_POST); + + redirect('admin/videok'); + } + + function set_videokcsoport() + { + // csoportok módosítása + $csoportokdb = $this->input->post('csoportokdb'); + $lang = hun() ? "hun" : "eng"; + for ($i = 0; $i < $csoportokdb; $i++) { + $csoport = new stdClass(); + $csoport->vg_id = $this->input->post('vg_id' . $i); + $csoport->cim = $this->input->post('csopcim' . $i); + $csoport->leiras = $this->input->post('csopleiras' . $i); + + if ($csoport->vg_id) { + $this->db->update('videogroups', $csoport, "vg_id={$csoport->vg_id}"); + } + } + + $uj = $this->input->post('ujcsoportdel'); + if ($uj != "on") { + $record = new stdClass(); + $record->azon = trim($this->input->post('ujcsopazon'), '#'); + $record->cim = $this->input->post('ujcsopcim'); + $record->leiras = $this->input->post('ujcsopleiras'); + $record->nyelv = $lang; + + $this->db->insert('videogroups', $record); + } + + redirect('admin/videok'); + } + + function viewer() + { + $vendegek2 = $this->db->query("SELECT cp_id, guestname, mappa FROM collection_projects WHERE userid='guest' AND deleted=0 GROUP BY guestname ORDER BY guestname ASC")->result(); + $projektek = array(); + + foreach ($vendegek2 as $vendeg) { + $vendeg->projektek = $this->db->query("SELECT * FROM collection_projects WHERE userid='guest' AND guestname='{$vendeg->guestname}' AND deleted=0 AND cp_id IN (SELECT DISTINCT(cp_id) FROM collection_user WHERE userid='guest' AND deleted=0) ORDER BY nev ASC")->result(); + $vendeg->darab = 0; + foreach ($vendeg->projektek as $projekt) { + $projektek[] = $projekt; + $projekt->fajlok = $this->db->query("SELECT * FROM collection_user WHERE cp_id={$projekt->cp_id} AND deleted=0 ORDER BY title ASC")->result(); + if (!$projekt->fajlok) + $projekt->fajlok = array(); + $projekt->darab = count($projekt->fajlok); + $vendeg->darab += $projekt->darab; + } + } + + $data['guests'] = $vendegek2; + $data['projektek'] = $projektek; + /*$data['main_events_json'] = json_encode($vendegek2);*/ + + $elemek = $this->db->query("SELECT cu_id, cp_id, title, `desc`, shared FROM collection_user WHERE `deleted`=0")->result(); + $data['elemek_json'] = json_encode($elemek); + + $data['admin'] = true; + $data['aktiv'] = 15; + $data['javascript'] = array('jquery_ui'); + $data['style'] = array('jquery.ui'); + $data['title'] = "ARCHLine View App edit"; + $data['tartalom'] = 'admin/viewer'; + $this->load->view('site', $data); + } + + function viewguestnameedit() + { + $guestname = $this->input->post('guestname'); + $uj['guestname'] = $this->input->post('name'); + + $this->db->update('collection_projects', $uj, 'guestname="' . $guestname . '"'); + + redirect('admin/viewer'); + } + + function viewguestnamedel() + { + $cp_id = $this->uri->segment(3); + $guestnamet = $this->db->query("SELECT guestname, mappa FROM collection_projects WHERE cp_id={$cp_id}")->row(); + $guestname = $guestnamet->guestname; + $uj['deleted'] = 1; + + $this->db->update('collection_projects', $uj, 'userid="guest" AND guestname="' . $guestname . '"'); + + // kukába áttenni a projekteket + $guestdir = current(explode('/', $guestnamet->mappa)); + $utvonal = "public/img/collection/users/guest/" . $guestdir . "/"; + $trash = 'public/img/collection/users/trash/guest/'; + $guestmappa = scandir($utvonal); + unset($guestmappa[0], $guestmappa[1]); + foreach ($guestmappa as $projekt) { + mkdir("{$trash}{$guestdir}"); + mkdir("{$trash}{$guestdir}/" . $projekt); + exec("cp -R {$utvonal}{$projekt} {$trash}{$guestdir}"); + exec("rm -R {$utvonal}{$projekt}"); + } + + redirect('admin/viewer'); + } + + function viewprojectnameedit() + { + $cp_id = $this->input->post('cp_id'); + $uj['nev'] = $this->input->post('nev'); + $uj['autodel'] = ($this->input->post('autodel') == "on") ? 1 : 0; + + $this->db->update('collection_projects', $uj, 'cp_id=' . $cp_id); + + redirect('admin/viewer'); + } + + function viewguestprojectdel() + { + $cp_id = $this->uri->segment(3); + $uj['deleted'] = 1; + $this->db->update('collection_projects', $uj, 'cp_id=' . $cp_id); + + $infok = $this->db->query("SELECT mappa FROM collection_projects WHERE cp_id={$cp_id}")->row(); + $mappa = current(explode('/', $infok->mappa)); + $trash = 'public/img/collection/users/trash/guest/'; + $prutvonal = "public/img/collection/users/guest/" . $infok->mappa; + + // kukába áttenni a projektet + mkdir("{$trash}{$mappa}"); + mkdir($trash . $infok->mappa); + exec("cp -R {$prutvonal} " . $trash . $mappa); + exec("rm -R {$prutvonal}"); + + redirect('admin/viewer'); + } + + function viewitemedit() + { + $cu_id = $this->input->post('cu_id'); + $uj['title'] = $this->input->post('it_title'); + $uj['desc'] = $this->input->post('it_desc'); + $cp_id = $this->input->post('it_cp_id'); + + if ($_FILES['ujfajl']['error'] == 0) { + include('application/helpers/sajatfeltolto.php'); + $sql = "SELECT mappa FROM collection_projects WHERE cp_id=(SELECT cp_id FROM collection_user WHERE cu_id={$cu_id})"; + $adatok = $this->db->query($sql)->row(); + $hova = "public/img/collection/users/guest/" . $adatok->mappa . "/" . $cu_id . "/"; + $kepnev = $_FILES['ujfajl']["name"]; + + if (feltolt('ujfajl', $hova, $kepnev, true)) { + include('application/helpers/myimg_helper.php'); + // kulonbozo kepmeretek letrehozasa + exec("cp {$hova}{$kepnev} {$hova}1__big.jpg"); + exec("cp {$hova}{$kepnev} {$hova}1__1024.jpg"); + kemeretezesvagassh($hova . $kepnev, $hova . "1__300.jpg", 300, 225); + kemeretezesvagassh($hova . $kepnev, $hova . "1__small.jpg", 79, 66); + + $uj['file'] = $kepnev; + } else { + print "A kep feltoltese kozben hiba tortent! Nem sikerult modositani az adatokat!"; + return; + } + } + + $adatok2 = $this->db->query("SELECT cp_id FROM collection_user WHERE cu_id={$cu_id}")->row(); + // más projektbe áthelyezés + if ($cp_id != $adatok2->cp_id) { + $ujpr = $this->db->query("SELECT * FROM collection_projects WHERE cp_id={$cp_id}")->row(); + $regipr = $this->db->query("SELECT * FROM collection_projects WHERE cp_id=" . $adatok2->cp_id)->row(); + + $honnan = "public/img/collection/users/guest/" . $regipr->mappa . "/" . $cu_id; + $hova = "public/img/collection/users/guest/" . $ujpr->mappa; + + mkdir($hova . "/" . $cu_id); + exec("cp -R {$honnan} {$hova}"); + exec("rm -R {$honnan}"); + + if (file_exists($hova . "/" . $cu_id . "/1__300.jpg")) + $uj['cp_id'] = $cp_id; + } + + $this->db->update('collection_user', $uj, 'cu_id=' . $cu_id); + + redirect('admin/viewer'); + } + + function viewitemdel() + { + $cu_id = $this->uri->segment(3); + $uj['deleted'] = 1; + $this->db->update('collection_user', $uj, 'cu_id=' . $cu_id); + + $infok = $this->db->query("SELECT mappa FROM collection_projects WHERE cp_id=(SELECT cp_id FROM collection_user WHERE cu_id={$cu_id})")->row(); + $trash = 'public/img/collection/users/trash/guest/'; + $elemutvonal = "public/img/collection/users/guest/" . $infok->mappa . "/" . $cu_id; + + // attenni a trash/guest-be + mkdir("{$trash}{$cu_id}"); + exec("cp -R {$elemutvonal} " . $trash); + exec("rm -R {$elemutvonal}"); + + redirect('admin/viewer'); + } + + function viewerstat() + { + $sql = "SELECT count(cu_id) db, nev FROM `collection_user` v INNER JOIN forum_user ON userid=user_id WHERE v.deleted=0 AND cp_id IN (SELECT cp_id FROM collection_projects WHERE deleted=0) GROUP BY nev"; + $ered = $this->db->query($sql)->result(); + print ""; + foreach ($ered as $v) { + print ""; + } + print "
" . $v->nev . ": " . $v->db . " db elem
"; + } + + + function crashlist() + { + $adatok = $this->db->query("SELECT * FROM crash WHERE deleted=0 ORDER BY datum DESC LIMIT 0,1000")->result(); + $data['adatok'] = $adatok; + + $data['javascript'] = array('jquery_ui', 'tablesorter/jquery.tablesorter.min', 'DataTables/media/js/jquery.dataTables'); + $data['style'] = array('jquery.ui', '../js/tablesorter/themes/blue/style', '../js/DataTables/media/css/demo_table'); + $data['admin'] = true; + $data['title'] = "ARCHLine crash list"; + $data['tartalom'] = 'admin/crashlist'; + $this->load->view('site', $data); + } + + function crashedit() + { + $id = $this->uri->segment(3); + + if (isset($_POST['do']) && $_POST['do'] == 'do') { + $uj['statusz'] = $this->input->post('statusz'); + $uj['info'] = $this->input->post('info'); + $this->db->update('crash', $uj, 'id=' . $id); + redirect('admin/crashlist'); + } else { + $data['crash'] = $this->db->query("SELECT * FROM crash WHERE id=" . $id)->row(); + $this->load->view('admin/crashedit', $data); + } + } + + function crashdel() + { + $id = $this->uri->segment(3); + $uj['deleted'] = 1; + $this->db->update('crash', $uj, 'id=' . $id); + redirect("admin/crashlist"); + } + + function serial2() + { + $adatok = $this->db->query("SELECT * FROM download_serial ORDER BY datum ASC")->result(); + $data['adatok'] = $adatok; + + $data['javascript'] = array('jquery_ui', 'DataTables/media/js/jquery.dataTables.min'); + $data['style'] = array('jquery.ui', '../js/DataTables/media/css/demo_table'); + $data['admin'] = true; + $data['tartalom'] = 'admin/serial2'; + $this->load->view('site', $data); + } + + function kodgeneralohibak() + { + $hibalista = $this->db->query("SELECT * FROM `clusers`.`cl_aktkod_hibak` WHERE torolve=0 AND leiras NOT LIKE 'felvettem: UPDATE%'")->result(); + $data['hibalista'] = $hibalista; + + $data['javascript'] = array('jquery_ui', 'DataTables/media/js/jquery.dataTables.min'); + $data['style'] = array('jquery.ui', '../js/DataTables/media/css/demo_table'); + $data['admin'] = true; + $data['tartalom'] = 'admin/kodgeneralohibak'; + $this->load->view('site', $data); + } +} + +function hasonlito($a, $b) +{ + if ($a->tulaj == $b->tulaj) + return 0; + if ($a->tulaj < $b->tulaj) + return -1; + return 1; +} + +function hasonlitovissza($a, $b) +{ + if ($a->tulaj == $b->tulaj) + return 0; + if ($a->tulaj > $b->tulaj) + return -1; + return 1; +} + +?> \ No newline at end of file diff --git a/var/www/hosting/archlinexp.com/partners/application/controllers/admin.php.evidence.json b/var/www/hosting/archlinexp.com/partners/application/controllers/admin.php.evidence.json new file mode 100644 index 0000000..411effe --- /dev/null +++ b/var/www/hosting/archlinexp.com/partners/application/controllers/admin.php.evidence.json @@ -0,0 +1,15 @@ +{ + "finding_ref": "5316", + "log_excerpt": "[quarantine] partners.archlinexp.com:application/controllers/admin.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/archlinexp.com/partners/application/controllers/admin.php)", + "original_sha256": "2bd1ff9d0a4f74d48be91709e433f190bbd91cbc65ab251c0daeba252573af55", + "original_stat": { + "gid": 30037, + "mtime": 1739518151, + "size": 143599, + "uid": 11669 + }, + "rel_path": "application/controllers/admin.php", + "result": "quarantined", + "timestamp": "20260718T160424Z", + "vhost": "partners.archlinexp.com" +} diff --git a/var/www/hosting/archlinexp.com/partners/application/controllers/collection.php b/var/www/hosting/archlinexp.com/partners/application/controllers/collection.php new file mode 100644 index 0000000..0ec6f1b --- /dev/null +++ b/var/www/hosting/archlinexp.com/partners/application/controllers/collection.php @@ -0,0 +1,1385 @@ +'ita', 'itc'=>'ger'); + + function Collection() + { + parent::Controller(); + $this->lang->load('site', $this->muser->user['lang']); + $this->load->model('mcollection'); + $this->cookieupdate(); + } + + function index() + { + $this->kategoria(); + } + + function upload(){ + $this->load->model('mcollection2'); + + // volt-e belepesi hiba + $hibavoltekorabban = $this->phpsession->get('feltoltesbelepesihiba'); + $hibavoltekorabbanemail = $this->phpsession->get('feltoltesbelepesihibaemail'); + if( $hibavoltekorabban == "hfvj" ){ + $error = "Hibás név vagy jelszó"; + $data["error"] = $error; + $data["email"] = $hibavoltekorabbanemail; + unset($_SESSION['default']['feltoltesbelepesihiba']); + unset($_SESSION['default']['feltoltesbelepesihibaemail']); + } + + + if(hun()){ + $data['title'] = 'ARCHLine.XP Feltöltés'; + $data['feltetel'] = $this->mpages->get_row(572); + } + else{ + $data['title'] = 'ARCHLine.XP Upload'; + $data['feltetel'] = $this->mpages->get_row(571); + } + + + // nyelv megadása: url 5. paraméter + $lang = $this->uri->segment(5); + // ha volt, elmenteni + if( $lang ) + $_SESSION['showroom']['lang'] = $lang; + + // ha nem volt nyelv es elmentve sincs, legyen angol + /*if( !$lang ){ + $lang = ( isset($_SESSION['showroom']['lang']) && $_SESSION['showroom']['lang'] != "" ) ? $_SESSION['showroom']['lang'] : "eng"; + }*/ + + if ( $this->cookieupdate() ){ + $data['email'] = $_COOKIE['azonosito']; + $data['belepve'] = true; + $belepve = $_COOKIE['azonosito']; + + if( isset($this->limitalt[$belepve]) && $this->limitalt[$belepve] != $lang && $lang ){ + //$data["error"] .= "Denied: ".$lang; + print "Denied: ".$lang; + return; + } + } + + if($this->uri->segment(3)!=""){ + $tipus = $this->uri->segment(4); + if( !$tipus ) + $tipus = "temp"; + + $data["fajl"] = $this->uri->segment(3); + + /* szövegfájl átadással */ + $fajlnev = '/home/vendeg/'.$this->uri->segment(3); + $fa = fopen( $fajlnev, "r" ) or die("Upload error, nem sikerult megnyitni: ".$fajlnev); + $ol = fgets( $fa, 1024); + $adatok = explode("#",$ol); + // $lang = $this->muser->user['lang']; + $honnan = "/home/vendeg/".$adatok[2]; + $kepnev = time()."_".$adatok[3]; + $ide= "public/img/collection/".$tipus."/".$kepnev; + if( /*$belepve && */copy($honnan,$ide) ){ + $adatok[3] = $ide; + }else{ + $adatok[3] = ""; + } + + + $data["fajl"] = $adatok[0]; + $data["eredeti"] = $adatok[1]; + $data["vendegkep"] = $adatok[2]; + $data["kepalap"] = $adatok[3]; + $data["cim"] = $adatok[4]; + $data["cimhun"] = $adatok[5] ? $adatok[5] : $adatok[4]; + $data["prver"] = ($adatok[6]=="-1") ? "2012" : $adatok[6]; + $data["tipus"] = $tipus; + $data["archline_nyelv"] = $lang; + $data["limituser"] = $this->limitalt; + + fclose($fa); + + }else{ + redirect('objects/upload'); + } + + // $kategoriak = $this->muser->get_kategoriak($tipus); + // $kategoriak = $this->mcollection->get_darab($kategoriak); + if($lang=="ita") + $kategoriak = $this->db->query("SELECT * FROM coll2_cat WHERE m_id=6 AND deleted=0")->result(); + if($tipus=="project") + $kategoriak = $this->db->query("SELECT CONCAT(nev_hun,' - ',nev_eng) as nev FROM dl_kategoriak WHERE tipus='project' AND deleted=0")->result(); + + $tipusok = $this->db->query("SELECT type, CONCAT(type_download,': ',name_eng,' - ',name_hun) typename FROM coll2_types ORDER BY typename")->result(); + + $data['gyartok'] = $this->mcollection2->get_gyartok(); + + $data['tartalom'] = 'collection/upload'; + $data['style'] = array('temp/style_interior'); + $data['javascript'] = array('objfeltoltes_2'); + $data['kategoriak'] = $kategoriak; + $data['tipusok'] = $tipusok; + + $this->load->view('site_upload',$data); + + } + + function uploadhozzaad(){ + $lang = $_SESSION['showroom']['lang']; + + if ( $this->cookieupdate() ){ + $data['email'] = $_COOKIE['azonosito']; + $data['belepve'] = true; + $belepve = $_COOKIE['azonosito']; + + if( isset($this->limitalt[$belepve]) && $this->limitalt[$belepve] != $lang && $lang ){ + //$data["error"] .= "Denied: ".$lang; + print "Denied: ".$lang; + return; + } + }else{ + print "login in"; + return; + } + + if(!$this->uri->segment(3)!=""){ + print "leiro fajl hianyzik"; + return; + } + + $fajlnev = '/home/vendeg/'.$this->uri->segment(3); + $fa = fopen( $fajlnev, "r" ) or die("Upload error, nem sikerult megnyitni: ".$fajlnev); + $ol = fgets( $fa, 1024); + $adatok = explode("#",$ol); + fclose($fa); + + $data["fajl"] = $adatok[0]; + $data["eredeti"] = $adatok[1]; + $data["prver"] = ($adatok[6]=="-1") ? "2012" : $adatok[6]; + $data["archline_nyelv"] = $lang; + $data["limituser"] = $this->limitalt; + + + + + + + $this->load->model('mcollection2'); + $guid = '/[A-F0-9]{8}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{12}/'; + $elemnev = !(preg_match($guid, $adatok[4])) ? $adatok[4] : $adatok[5]; + $azonoscim = array(); + + + $sql = "SELECT o_id, m_id, c_id FROM collection2 WHERE title_eng='{$elemnev}' AND deleted=0"; + $nevobjektumok = $this->db->query($sql)->result(); + foreach($nevobjektumok as $obj){ + $gyarto = $this->mcollection2->get_manById($obj->m_id); + $kateg = $this->mcollection2->get_kategoria($obj->c_id); + $elemujnev = $this->db->query("SELECT title FROM coll2_desc WHERE o_id={$obj->o_id}")->row(); + + $tmpelem = array( + "objid" => $obj->o_id, + "gyarto" => $gyarto->name, + "dir" => $gyarto->dir, + "nev" => $elemujnev->title + ); + $tmpelem["kategoria"] = hun() ? $kateg->nev_hun : $kateg->nev_eng; + $azonoscim[] = $tmpelem; + } + $data["azonoscimuek"] = $azonoscim; + + $gyartolimit = array( "ita" => "2", "ger" => "itc" ); + + if( array_key_exists($lang, $gyartolimit) ){ + if(ita()) + $gyartok = $this->db->query("SELECT * FROM coll2_man WHERE deleted=0 AND group_id LIKE ';{$gyartolimit[$lang]};'")->result(); + else + $gyartok[0] = $this->mcollection2->get_manBydir($gyartolimit[$lang]); + }else{ + $gyartok = $this->mcollection2->get_gyartok(); + } + + $ordernev = hun() ? 'title_hun' : 'title_eng'; + + foreach($gyartok as $gyarto){ + $gyarto->kategoria = $this->mcollection2->get_kategoriak($gyarto->dir); + $gyarto->darab = 0; + foreach($gyarto->kategoria as $kategoria){ + $kategoria->fajl = $this->mcollection2->get_objektumok($kategoria->c_id,$ordernev.' ASC'); + if( !$kategoria->fajl ) + $kategoria->fajl = array(); + $kategoria->darab = count($kategoria->fajl); + $gyarto->darab += $kategoria->darab; + } + } + + + $brandgroup = false; + if(ita()) + $brandgroup = $this->db->query("SELECT * FROM coll2_mangrp WHERE group_id=2")->row(); + elseif(hun()||eng()) + $brandgroup = $this->db->query("SELECT * FROM coll2_mangrp WHERE deleted=0")->result(); + + $data['tipusok'] = $gyartok; + + + + + + + $data['tartalom']='collection/uploadhozzaad'; + $data['style'] = array('temp/style_interior'); + + $this->load->view('site_upload',$data); + + } + + // felhasználó akar feltölteni a viewerbe + function uploaduser(){ + + if( $_SERVER['HTTP_HOST'] == 'old.archlinexp.com' && hun()) + { + $this->muser->user['lang']='eng'; + unset($this->muser->user['admin']); + unset($this->muser->user['admin_lang']); + $this->phpsession->save('user',$this->muser->user); + redirect('collection/uploaduser/'.$this->uri->segment(3)); + } + + // feltoltési információk + if($this->uri->segment(3)==""){ + print "Hiba: hiányzó adatok!"; + exit(); + } + + // volt-e belepesi hiba + $hibavoltekorabban = $this->phpsession->get('feltoltesbelepesihiba'); + $hibavoltekorabbanemail = $this->phpsession->get('feltoltesbelepesihibaemail'); + if( $hibavoltekorabban == "hfvj" ){ + $error = "Hibás név vagy jelszó"; + $data["error"] = $error; + $data["email"] = $hibavoltekorabbanemail; + unset($_SESSION['default']['feltoltesbelepesihiba']); + unset($_SESSION['default']['feltoltesbelepesihibaemail']); + } + + if( $this->cookieupdate() ){ + $this->load->model('mforum'); + $data['email'] = $_COOKIE['azonosito']; + $data['belepve'] = true; + $belepve = $_COOKIE['azonosito']; + } + $data['email'] = $_COOKIE['azonosito']; + + $fajlnev = $this->uri->segment(3); + $data["fajl"] = $fajlnev; + + /* szövegfájl átadással */ + $leirofajl = '/home/vendeg/'.$fajlnev; + $fa = fopen( $leirofajl, "r" ) or die("Upload error, nem sikerult megnyitni: ".$leirofajl); + $ol = fgets( $fa, 1024); + $adatok = explode("#",$ol); + $projekt = $adatok[0]; + $uplfajl = "/home/vendeg/".$adatok[1]; // kép, pdf, stb. + $elonezet = "/home/vendeg/".$adatok[2]; // előnézeti kép + $nagykep = "/home/vendeg/".$adatok[3]; // nagy kép + $elonezettemp = "public/img/collection/temp/".time()."_".$adatok[2]; + $fajlmeret = filesize($uplfajl); + + // fájl méret korlát + if($fajlmeret >= $this->viewerfilelimit){ + $record->osztaly = "collection"; + $record->fv = "upload"; + $record->hiba = "Túl nagy fájl: ".$adatok[1]." ({$fajlmeret})\n".$_COOKIE['azonosito']; + $record->datum = date('Y-m-d H:i:s',time()); + $this->db->insert('a_hibak',$record); + + $data['tartalom'] = 'forum/kiir'; + $data['style'] = array('temp/style_interior'); + $data['email'] = $_COOKIE['azonosito']; + + $data['info'] = "
File size is too large
"; + + $this->load->view('site_upload',$data); + return; + } + + if( $belepve ){ + copy($elonezet,$elonezettemp); + } + + // új projekt vagy meglevő bővítése + $projektdir = strtolower($this->ekezet($projekt)); + $nyelv = hun() ? "hun" : "eng"; + $login = $_COOKIE['azonosito']; + if( $login!="guest" ){ + $query = $this->db->query("SELECT user_id FROM `cadline2`.`forum_user` WHERE login = '".$login."' AND nyelv='{$nyelv}'")->row(); + $userid = $query->user_id; + } + else{ + $userid = "guest"; + } + + //vendege-e + if( $userid == "guest" && isset($_COOKIE['uploaduserPrevUsername']) ){ + $subject = str_replace(' ','-',strtolower($_COOKIE['uploaduserPrevUsername'])); + $pattern = '/[-_a-z0-9]*/'; + preg_match_all($pattern, $subject, $matches, PREG_OFFSET_CAPTURE); + $username = ""; + foreach($matches[0] as $m) if($m[0]) $username .= $m[0]; + + $ujprojekt = false; + $tmpprtitl = $this->db->query("SELECT nev FROM collection_projects WHERE userid='guest' AND mappa='{$username}/{$projektdir}' AND deleted=0 ")->row(); + $projekttitle = $tmpprtitl->nev; + + + if($tmpprtitl->nev){ + $ujprojekt = false; + $projekttitle = $tmpprtitl->nev; + }else{ + $projektdir2 = strtolower($this->ekezet($_COOKIE['uploaduserPrevProjname'])); + $tmpprtitl2 = $this->db->query("SELECT nev FROM collection_projects WHERE userid='guest' AND mappa='{$username}/{$projektdir2}' AND deleted=0 ")->row(); + + + if($tmpprtitl2->nev){ + $ujprojekt = false; + $projekttitle = $tmpprtitl2->nev; + }else{ + $ujprojekt = true; + $projekttitle = isset($_COOKIE['uploaduserPrevProjname']) ? $_COOKIE['uploaduserPrevProjname'] : $projekt; + } + } + + } + elseif( !is_dir("public/img/collection/users/".$userid."/".$projektdir."/") ){ + $ujprojekt = true; + $projekttitle = $projekt; + }else{ + $ujprojekt = false; + $tmpprtitl = $this->db->query("SELECT nev FROM collection_projects WHERE userid='{$userid}' AND mappa='{$projektdir}' AND deleted=0 ")->row(); + $projekttitle = $tmpprtitl->nev; + + if($tmpprtitl->nev){ + $ujprojekt = false; + $projekttitle = $tmpprtitl->nev; + }else{ + $ujprojekt = true; + $projekttitle = $projekt; + } + } + + if(hun()) + $data['feltetel'] = $this->mpages->get_row(728); + else + $data['feltetel'] = $this->mpages->get_row(727); + + $data["projekt"] = $projekt; + $data["ujprojekt"] = $ujprojekt; + $data["projekttitle"] = $projekttitle; + $data["nagyfajl"] = $uplfajl; + $data["elonezet"] = $elonezet; + $data["nagykep"] = $nagykep; + $data["elonezettemp"] = $elonezettemp; + + fclose($fa); + + + $data['tartalom'] = 'collection/uploaduser'; + $data['style'] = array('temp/style_interior'); + $data['javascript'] = array('objfeltoltes_2'); + + $this->load->view('site_upload',$data); + } + + function kategoria(){ + + if( !$this->uri->segment(3) ) + $kat = 26; + else + $kat = $this->uri->segment(3); + + $data['objects']=$this->mcollection->get_bykategoria($kat); + + $tipus = $this->mcollection->get_tipus($kat); + $kategoriak = $this->mcollection->get_kategoriak($tipus); + $kategoriak = $this->mcollection->get_darab($kategoriak); + + $darab = $this->mcollection->get_darabegykategoria($kat); + + $data['kategoriak'] = $kategoriak; + + $data['aktiv']=$kat; + + $data['tartalom']='collection/kat'; + $data['csik']=array('home',$tipus.'s'); + $data['javascript']=array('dl_select','objfeltoltes_2','fancybox/jquery-1.3.2.min','fancybox/jquery.easing.1.3','fancybox/jquery.fancybox-1.2.1.pack','fancybox/fancy'); + + $data['onload']="leirasmeretezes(".$darab.")"; + + $data['title'] = 'ARCHLine.XP Collection'; + $data['title'] .= " - " . $this->muser->get_katName($kat); + + if( true || ( strstr($_SERVER['HTTP_USER_AGENT'],'Ubuntu/8.04') ) ){ + $data['style'] = array('temp/style_interior','fancybox2'); + $this->load->view('site_upload',$data); + } + else{ + $data['style'] = array('fancybox2'); + $this->load->view('site',$data); + } + } + + function category_archlinexp(){ + + // nyelv megadása: url 3. paraméter + $lang = $this->uri->segment(3); + // ha volt, elmenteni + if( $lang ) + $_SESSION['projects']['lang'] = $lang; + + // ha nem volt nyelv es elmentve sincs, legyen angol + if( !$lang ){ + if( isset($_SESSION['projects']['lang']) && $_SESSION['projects']['lang'] != "" ) + $lang = $_SESSION['projects']['lang']; + else + $lang = "Eng"; + } + + $CI = &get_instance(); + if( $lang == "Hun" ){ + $CI->muser->user['lang']="hun"; + }else{ + $CI->muser->user['lang']="eng"; + } + + + // gyári vagy felhasználói projektek - minimum bizalom szint + if( $_POST["trust"] ) + $bizalom = $_POST["trust"]; + else + $bizalom = 10; + + + // kategória + if( !$_POST["category"] ) + $kat = $this->archline_default_kat; + else + $kat = $_POST["category"]; + + + // saját nyelvre szűrés + if( $_POST["mycountry"] == "on" ) + $mycountry = true; + else + $mycountry = false; + + + $data['projects'] = $this->mcollection->getInArchline($kat,$bizalom,$lang,$mycountry); + + $lang_file = "public/collection/start_dialog_".$lang.".xml"; + if( !file_exists($lang_file) ) + $lang_file = "public/collection/start_dialog_Eng.xml";; + $data['lang'] = simplexml_load_file($lang_file); + + + $kategoriak = $this->mcollection->get_kategoriak("project"); + $kategoriak = $this->mcollection->get_darab($kategoriak); + + // $darab = count($data['projects']); + + $data['urllang'] = $lang; + $data['kategoriak'] = $kategoriak; + + $data['aktiv']=$kat; + + // $data['style'] = array('temp/style_interior','fancybox2'); + $this->load->view('collection/category_archlinexp',$data); + + /* + const CALLanguage::LanguageParameters CALLanguage::Languages[] = { + "Eng", "eng", // english 0 + "Ita", "ita", // Italian 1 + "Esp", "spanish", // Esp 2 + "Hun", "hun", // Hun 3 + "Ger", "german", // Ger 4 + "Gre", "greek", // Gre 5 + "Cz", "czech", // Cz 6 + "Pol", "polish", // Pol 7 + "Cr", "eng", // Cr 8 + "Nl", "dutch", // Nl 9 + "Kor", "korean", // Kor 10 + "JP", "japan", // JP 11 + }; + */ + } + + function submit(){ + $this->load->model('mforum'); + $email = $_POST["email"]; + $jelszo = $_POST["jelszo"]; + $fajltipus = $_POST["tipus"]; + $error = ""; + $kep = ""; + $stop = ""; + + + $ell = md5($_COOKIE['azonosito'].$this->pw.$_COOKIE['sessid']); + + $belepve = $this->phpsession->get('feltolo'); + if( !empty($_COOKIE['hash']) && $_COOKIE['hash']== $ell ){ + + $user_id = $this->mforum->get_userid($_COOKIE['azonosito']); + + }elseif( !$this->mforum->belep($email,$jelszo) ){ + $error = "hibás felhasználó név vagy jelszó"; + $stop = $error; + + $data["error"] = $error; + + if(hun()){ + $data['title'] = 'ARCHLine.XP Feltöltés'; + $data['feltetel'] = $this->mpages->get_row(572); + } + else{ + $data['title'] = 'ARCHLine.XP Upload'; + $data['feltetel'] = $this->mpages->get_row(571); + } + + $data["fajl"] = $_POST["originalFilenameField"]; + $data["eredeti"] = $_POST["eredetinev"]; + $data["kepalap"] = $_POST["kepalap"]; + $data["cim"] = $_POST["projhectNameField"]; + $data["tipus"] = $_POST["tipus"]; + $data["szerzo"] = $_POST["SzerzoField"]; + $data["leiras"] = $_POST["projectDescriptionField"]; + $data["archline_nyelv"] = $_POST["archline_nyelv"]; + + $data['tartalom']='collection/upload'; + $data['style'] = array('temp/style_interior'); + $data['javascript'] = array('objfeltoltes_2'); + $data['kategoriak'] = $this->muser->get_kategoriak($_POST["tipus"]); + + + $this->load->view('site_upload',$data); + + }else{ + $user_id = $this->mforum->get_userid($email); + $tomb = array(); + $tomb['feltolto_id'] = $user_id; + $tomb['email'] = $email; + $this->phpsession->save('feltolo',$tomb); + } + + + $lang = $this->muser->user['lang']; + + $fajlnev = $_POST["originalFilenameField"]; // ez van a vendegnel + $fajlnev2 = $this->ekezet($_POST["eredetinev"]); // ez legyen a publicban + + $tempFolder = "/home/vendeg/"; //ide másolja az FTP applet a fájlt + $storeFolder = "public/collection/".$fajltipus."s/"; //mi itt szeretnénk tárolni + + $fajl = $tempFolder.$fajlnev; + + $ido = time(); + $storeFilename= $storeFolder.$ido."_".$fajlnev2; + + if(!$error){ + if (copy($fajl,$storeFilename)){ + $prFile = $storeFilename; + $prSize = filesize($storeFilename); + }else{ + $prFile = "NULL"; + $error .= "Nem másoltam át a fájlt
vendegben: ".$fajl." publicba: ".$storeFilename; + } + } + + $link = "public/collection/".$fajltipus."s/".$ido."_".$fajlnev2; + + $kep = $_POST["kepalap"]; + $this->kep(&$kep,$fajltipus); + + + // új kategória felvétele, ha megadták + if( $_POST["ujkat"] != "" && !$stop ){ + if(hun()){ + $nevhun = $_POST["ujkat"]; + $neveng = ""; + }else{ + $nevhun = ""; + $neveng = $_POST["ujkat"]; + } + + $kat_id = $this->muser->new_kategoria($fajltipus,$nevhun,$neveng); + }else{ + $kat_id = $_POST["kategoria"]; + } + + + // Felvétel az adatbázisba + if(!$error){ + $ujpr->user_id = $user_id; + $ujpr->object = $link; + $ujpr->title = $_POST["projhectNameField"]; + $ujpr->meret = $prSize; + $ujpr->datum = date('Y-m-d H:i:s',time()); + $ujpr->nyelv = $lang; + $ujpr->kep = $kep; + $ujpr->text = $_POST["projectDescriptionField"]; + $ujpr->szerzo = $_POST["SzerzoField"]; + $ujpr->kat_id = $kat_id; + $ujpr->tipus = $fajltipus; + $ujpr->eredeti = $_POST["eredetinev"]; + $ujpr->bizalom = 5; + $ujpr->sorszam = 50; + $ujpr->archline_nyelv = $_POST["archline_nyelv"]; + + $this->mcollection->newobject($ujpr); + + + // felhasználóhoz beírni a feltöltést + $emailcim = $_COOKIE['azonosito']; + + // ha nem email cim, lekerdezzuk az emailt + if(!preg_match('/^([a-zA-Z0-9_\.])+([\-]?[a-zA-Z0-9]+)*@([a-zA-Z0-9_\-\.])+(\.[a-zA-Z]{2,4})$/i', $emailcim)){ + $qaf = $this->mforum->get_user_szem($emailcim); + $emailcim = $qaf[0]->email; + + if(!$emailcim){ + $qaf = $this->mforum->get_user_alap($_COOKIE['azonosito']); + $emailcim = $qaf[0]->email; + } + } + + $nUserID = $this->mforum->get_nUserID30($emailcim); + if( is_numeric($nUserID) ){ + $this->load->model('mclusers'); + $this->mclusers->addEvent($nUserID, 114, "Feltöltés: ".$fajltipus.", név: ".$_POST["projhectNameField"].", ".$link); + } + + + // Felvétel a régi helyére + switch($fajltipus){ + case 'project': + $this->load->model('mprojects'); + $this->mprojects->newproject($ujpr); + break; + case 'object': + $this->load->model('mobjects'); + $this->mobjects->newobject($ujpr); + break; + case 'group': + $this->load->model('mgroups'); + $ujpr->group = $ujpr->object; + $ujpr->kategoria = 900; + $ujpr->email = $user_id; + $this->mgroups->newgroup($ujpr); + break; + } + + + //print "
Új ".$fajltipuftp://eszter%40cadline.hu@cadline.hu:21/www.cadline.hu/application/controllers/collection.phps." felvéve"; + }else{ + //print "
Nem került adat az adatbázisba"; + //print $error; + } + + //ha nem volt print: + if( !$stop ) + redirect('collection/kategoria/'.$kat_id); + } + + // 2012. 04. ??-tól, cégekhez rendelt objektumok + function ujsubmit(){ + $this->load->model('mcollection2'); + include('application/helpers/sajatfeltolto.php'); + include('application/helpers/myimg_helper.php'); + + $gyarto = $_POST['gyarto']; // mappa + $gyartominden = $this->mcollection2->get_manBydir($gyarto); + + // új kategória felvétele, ha megadták + if( $_POST["ujkat_hun"] != "" || $_POST["ujkat_eng"] != "" ){ + $nevhun = (isset($_POST["ujkat_hun"]) && strlen($_POST["ujkat_hun"])>0 ) ? $_POST["ujkat_hun"] : $_POST["ujkat_eng"]; + $neveng = $_POST["ujkat_eng"]; + + $kat_id = $this->mcollection2->new_kategoria($gyarto,$nevhun,$neveng); + + if( $_FILES["ujkatkep"]["error"]==0 ){ + + $hova = "public/img/collection/category/"; + // korábbi kép törlése + exec("rm public/img/collection/category/".$kat_id.".jpg"); + feltolt("ujkatkep",$hova,$kat_id.".jpg",true); + $ujkatkep = $hova.$kat_id.".jpg"; + + // átméretezés + kemeretezesvagassh($ujkatkep,$hova.$kat_id."_182x152.jpg",182,152); + kemeretezesvagassh($ujkatkep,$ujkatkep,182,131); + chmod($ujkatkep,0777); + } + + }else{ + $kat_id = $_POST["kategoria"]; + } + + + // adatbázisba mentés + $ujid = false; + if(!$error){ + $uj->m_id = $gyartominden->id; + $uj->desc_hun = trim($_POST['projectDescriptionFieldhun']); + $uj->desc_eng = trim($_POST['projectDescriptionField']); + $uj->c_id = $kat_id; + $uj->datum = date('Y-m-d H:i:s',time()); + if($_POST["projhectNameFieldhun"]) + $uj->title_hun = trim($_POST["projhectNameFieldhun"]); + $uj->title_eng = trim($_POST["projhectNameField"]); + $uj->tipus = $_POST["tipus"]; + + $this->db->insert('cadline2.collection2',$uj); + $ujid = mysql_insert_id(); + + + $leiras->o_id = $ujid; + $leiras->lang = 'eng'; + $leiras->title = trim($_POST["projhectNameField"]); + $leiras->desc = trim($_POST['projectDescriptionField']); + $this->db->insert('cadline2.coll2_desc',$leiras); + + if( $_POST['archline_nyelv'] != "" && $_POST['archline_nyelv'] != "eng" ){ + $leiras->o_id = $ujid; + $leiras->lang = $_POST['archline_nyelv']; + $leiras->title = trim($_POST["projhectNameField".$_POST['archline_nyelv']]); + $leiras->desc = trim($_POST['projectDescriptionField'.$_POST['archline_nyelv']]); + $this->db->insert('cadline2.coll2_desc',$leiras); + } + + if( $_POST['prver'] != "" && is_numeric($_POST['prver']) ){ + $verzio->o_id = $ujid; + $verzio->version = $_POST['prver']; + $verzio->fajl = $this->ekezet($_POST["eredetinev"]); + $this->db->insert('cadline2.coll2_ver',$verzio); + } + + } + + if(!$ujid){ + print "sql error"; + return; + } + + + // fájlt a helyére + $tempFolder = "/home/vendeg/"; //ide másolja az FTP applet a fájlt + $storeFolder = "public/collection/".$gyarto."/".$ujid."/"; //mi itt szeretnénk tárolni + mkdir($storeFolder,0777); + chmod($storeFolder,0777); + $fajlnev = $_POST["originalFilenameField"]; // ez van a vendegnel + $fajlnev2 = $this->ekezet($_POST["eredetinev"]); // ez legyen a publicban + $fajl = $tempFolder.$fajlnev; + $storeFilename= $storeFolder.$fajlnev2; + + if (copy($fajl,$storeFilename)){ + chmod($storeFilename,0777); + }else{ + $error .= "Nem másoltam át a fájlt
vendegben: ".$fajl." public helye: ".$storeFilename; + } + + + // képes dolgok + $hova = "public/img/collection/".$gyarto."/".$ujid."/"; + $kiskep = ""; + mkdir($hova,0777); + chmod($hova,0777); + mkdir($hova."big/",0777); + mkdir($hova."thumb/",0777); + mkdir($hova."orig/",0777); + + + // ha új kis képet kapott + if( $_FILES["kep"]["error"]==0 && isset($_FILES["kep"]["name"]) ){ + $kiskep = $hova.$_FILES["kep"]["name"]; + // feltolt("kep",$hova,$_FILES["kep"]["name"],true); + chmod($kiskep,0777); + }else{ + $tmp = $_POST['kepalap']; + $tmp = explode("/",$tmp); + $tmp = end($tmp); + $honnan = "/home/vendeg/".substr($tmp,11); + $kiskep = $hova.$this->ekezet(substr($tmp,11)); + + // athelyez($honnan,$kiskep,true); + chmod($kiskep,0777); + } + + // eredetileg feltoltott kep lementese + copy($honnan,$hova.'orig/'.$this->ekezet(substr($tmp,11))); + copy($honnan,$kiskep); + + // materialnal az elonezeti kep legyen a nagy kep ha nem toltottek fel masikat + $nagykeparany = (488/396); + $nagykeparany2 = (480/400); + if( $_POST["tipus"]=="material" && $_FILES["nagykep22"]["error"]!=0 ){ + $nagykep = $hova."big/".end(explode("/",$kiskep)); + $nagykep = str_replace(' ','\ ',$nagykep); + $nagykep = str_replace("'","\'",$nagykep); + $elonezeti = $hova."thumb/".end(explode("/",$kiskep)); + $ujkiskep = $hova.end(explode("/",$kiskep)); + copy($kiskep,$nagykep); + kemeretezesvagassh($nagykep,$elonezeti,182,131); + kemeretezesvagassh($nagykep,$hova."zz_thumb.jpg",182,152); // uj kozepes kep + chmod($nagykep,0777); + // kis kep a nagy kepbol + kemeretezesvagassh($nagykep,$ujkiskep,70,68); + kemeretezesvagassh($nagykep,$hova."zz_small.jpg",79,66); // uj kis kep + + // nagy kep atmeretezes + list($ow,$oh) = getimagesize($nagykep); + $orignagykeparany = ($ow/$oh); + + $diff2 = abs($nagykeparany2-$orignagykeparany); + // ha nagyon eltérő az arány, akkor meghagyja az eredetit, és fehérrel tölti ki a maradék helyet + if( $diff2 < 0.3 ) + kemeretezesvagassh($nagykep,$hova."zz_big.jpg",480,400); // uj nagy kep + else + kemeretezesvagasshbg($nagykep,$hova."zz_big.jpg",480,400); + + $diff = abs($nagykeparany-$orignagykeparany); + // ha nagyon eltérő az arány, akkor meghagyja az eredetit, és fehérrel tölti ki a maradék helyet + if( $diff < 0.3 ) + kemeretezesvagassh($nagykep,$nagykep,488,396); + else + kemeretezesvagasshbg($nagykep,$nagykep,488,396); + + + chmod($ujkiskep,0777); + + } + else{ + $ujnagykep = $hova."big/".$this->ekezet($_FILES["nagykep22"]["name"]); + $elonezeti = $hova."thumb/".$this->ekezet($_FILES["nagykep22"]["name"]); + feltolt("nagykep22",$hova."big/",$_FILES["nagykep22"]["name"],true); + + chmod($ujnagykep,0777); + kemeretezesvagassh($ujnagykep,$elonezeti,182,131); // előnézeti kép a nagy képből + kemeretezesvagassh($ujnagykep,$hova."zz_thumb.jpg",182,152); // uj kozepes kep + $ujkiskep = $hova.end(explode("/",$kiskep)); + + + kemeretezesvagassh($ujnagykep,$ujkiskep,70,68); // kis kép a nagy képből + kemeretezesvagassh($ujnagykep,$hova."zz_small.jpg",79,66); // uj kis kep + + // nagy kep atmeretezes + list($ow,$oh) = getimagesize($ujnagykep); + + $diff2 = abs($nagykeparany2-$orignagykeparany); + if( $diff2 < 0.3 ){ + kemeretezesvagassh($ujnagykep,$hova."zz_big.jpg",480,400); + }else{ + kemeretezesvagasshbg($ujnagykep,$hova."zz_big.jpg",480,400); + } + + /*$diff = abs($nagykeparany-$orignagykeparany); + if( $diff < 0.3 ){ + kemeretezesvagassh($ujnagykep,$ujnagykep,488,396); + }else{ + kemeretezesvagasshbg($ujnagykep,$ujnagykep,488,396); + }*/ + + } + + + chmod($hova."big",0777); + chmod($hova."thumb",0777); + } + + function uploadhozzaadsubmit(){ + $objidesgyarto = explode("#",$this->input->post('objidesgyarto')); + $obj_id = $objidesgyarto[0]; + $gyardir = $objidesgyarto[1]; + $pverzio = $this->input->post('prverzio'); + $eredeti = $this->input->post('eredeti'); // ez van a vendegnel + $ujfajl = $this->input->post('fajl'); // ez legyen a publicban + + + // fájl elhelyezése + $tempFolder = "/home/vendeg/"; // ide másolja az FTP applet a fájlt + $storeFolder = "public/collection/".$gyardir."/".$obj_id."/"; // mi itt szeretnénk tárolni + $tempFajl = $tempFolder.$eredeti; + $storeFajl = $storeFolder.$ujfajl; + + if(is_numeric($obj_id) && is_dir($storeFolder) && copy($tempFajl,$storeFajl)){ + chmod($storeFajl,0777); + + $verzio->o_id = $obj_id; + $verzio->version = $pverzio; + $verzio->fajl = $ujfajl; + $this->db->insert('cadline2.coll2_ver',$verzio); + + //print "új elem feltöltve: ".$storeFajl; + + }else{ + $record->osztaly = "collection"; + $record->fv = "uploadhozzaadsubmit"; + $record->hiba = "Hibás hozzáadott feltöltés: ".$obj_id."\ntemp fajl: ".$tempFajl; + $record->datum = date('Y-m-d H:i:s',time()); + $this->db->insert('a_hibak',$record); + + //print "Hiba a feltöltéskor"; + } + + } + + + // felhasználó viewerbe + function usersubmit(){ + if( !$this->cookieupdate() ) + header("Location: ".$_SERVER["HTTP_REFERER"]); + include('application/helpers/sajatfeltolto.php'); + include('application/helpers/myimg_helper.php'); + + $nyelv = hun() ? "hun" : "eng"; + + setcookie("uploaduserPrevUsername",$this->input->post('username'),time()+$this->ervenydesseg,"/"); + setcookie("uploaduserPrevProjname",$this->input->post('projecttitle'),time()+$this->ervenydesseg,"/"); + + $error = ""; + $login = $_COOKIE['azonosito']; + if($login != "guest"){ + $query = $this->db->query("SELECT user_id FROM `cadline2`.`forum_user` WHERE login = '".$login."' AND nyelv='{$nyelv}'")->row(); + $userid = $query->user_id; + }else{ + //$subject = str_replace(' ','-',strtolower($this->input->post('username'))); + $username = $this->input->post('username'); + if(!$username) + $username = "a"; + $subject = str_replace(' ','-',strtolower($username)); + $pattern = '/[-_a-z0-9]*/'; + preg_match_all($pattern, $subject, $matches, PREG_OFFSET_CAPTURE); + $username = ""; + foreach($matches[0] as $m) if($m[0]) $username .= $m[0]; + + $userid = "guest"; + } + $shared = ($this->input->post('shared')=="on") ? 1 : 0; + + $projecttitle = $this->input->post('projecttitle'); + $projekt = $this->input->post('projekt'); // projekt neve + $projektdir = strtolower($this->ekezet($projekt)); // mappa neve + $projekt = strtolower($this->ekezet($projekt)); + preg_match_all('/[-_a-z0-9]*/', $projektdir, $prdirarray, PREG_OFFSET_CAPTURE); + $projektdir = ($username!="") ? $username."/" : ""; + foreach($prdirarray[0] as $m) if($m[0]) $projektdir .= $m[0]; + $nagyfajl = $this->input->post('nagyfajl'); + + $cp_id = $this->db->query("SELECT cp_id FROM collection_projects WHERE userid='{$userid}' AND mappa='{$projektdir}'")->result(); + $cp_id = $cp_id[0]->cp_id; + if(!$cp_id){ + $ujprojekt = new stdClass(); + $ujprojekt->nev = $projecttitle; + $ujprojekt->mappa = $projektdir; + $ujprojekt->userid = $userid; + if( $this->input->post('username') ) + $ujprojekt->guestname = $this->input->post('username'); + $this->db->insert('cadline2.collection_projects',$ujprojekt); + $cp_id = mysql_insert_id(); + } + + $uj->userid = $userid; + $uj->cp_id = $cp_id; + $uj->project = $projektdir; + $uj->file = basename($nagyfajl); + $uj->title = $this->input->post('cim'); + $uj->desc = $this->input->post('leiras'); + $uj->shared = $shared; + + $this->db->insert('cadline2.collection_user',$uj); + $ujid = mysql_insert_id(); + + + // fajl feltoltese + $helye = "public/img/collection/users/".$userid."/".$projektdir."/".$ujid."/"; + $nagyfajlhelye = $helye.basename($nagyfajl); + // user első feltöltése + if(!is_dir("public/img/collection/users/".$userid."/")){ + mkdir("public/img/collection/users/".$userid."/",0777); + chmod("public/img/collection/users/".$userid."/",0777); + } + // guest, első username + if( $userid == "guest" && !is_dir("public/img/collection/users/".$userid."/".$username."/") ){ + mkdir("public/img/collection/users/".$userid."/".$username."/",0777); + chmod("public/img/collection/users/".$userid."/".$username."/",0777); + } + // új projekt + if(!is_dir("public/img/collection/users/".$userid."/".$projektdir."/")){ + mkdir("public/img/collection/users/".$userid."/".$projektdir."/",0777); + chmod("public/img/collection/users/".$userid."/".$projektdir."/",0777); + } + + mkdir($helye,0777); + chmod($helye,0777); + + if (copy($nagyfajl,$nagyfajlhelye)){ + $prSize = filesize($nagyfajlhelye); + chmod($nagyfajlhelye,0777); + }else{ + $prSize = 0; + $error .= "Nem másoltam át a fájlt
vendegben: ".$nagyfajl." publicba: ".$nagyfajlhelye; + } + + + // 1024-es elonezeti kep mentese + copy($this->input->post('elonezetorig'),$helye."1__1024.jpg"); + + // nagy kep feltoltese + if( isset($_FILES['nagykep']) && $_FILES['nagykep']['error'] == 0 ){ + // új nagy kép + $hova = $helye; + $ujnagykep = $hova."1__big.jpg"; + feltolt("nagykep",$hova,"1__big.jpg",true); + }else{ + // programból küldött nagy kép + $orignagykep = $this->input->post('elonezetorig'); + $hova = $helye; + $ujnagykep = $hova."1__big.jpg"; + copy($orignagykep,$ujnagykep); + } + // nagy kep atmeretezes + $nagykeparany = (488/396); + list($ow,$oh) = getimagesize($ujnagykep); + $orignagykeparany = ($ow/$oh); + // print "nagy kep sima arany: {$nagykeparany} , eredeti arany: {$orignagykeparany}"; + $diff = abs($nagykeparany-$orignagykeparany); + if( $diff < 0.3 ){ + kemeretezesvagassh($ujnagykep,$ujnagykep,488,396); + }else{ + kemeretezesvagasshbg($ujnagykep,$ujnagykep,488,396); + } + chmod($ujnagykep,0777); + + + // kis kep feltoltese + if( isset($_FILES['kiskep']) && $_FILES['kiskep']['error'] == 0 ){ + // új kis kép + $hova = $helye; + $ujkiskep = $hova."1__small.jpg"; + feltolt("kiskep",$hova,"1_small.jpg",true); + }else{ + // programból küldött kis kép + $elonezetorig = $this->input->post('elonezetorig'); + $hova = $helye; + $ujkiskep = $hova."1__small.jpg"; + copy($elonezetorig,$ujkiskep); + } + // kis kep atmeretezes + kemeretezesvagassh($ujkiskep,$ujkiskep,68,68); + chmod($ujkiskep,0777); + + // 300 szeles elonezeti kep letrehozasa + $kozepkep = $helye.'1__300.jpg'; + /*exec('convert -resize 300 '.$this->input->post('elonezetorig').' '.$kozepkep);*/ + kemeretezesvagasshbg($this->input->post('elonezetorig'),$kozepkep,300,225); + chmod($ujnagykep,0777); + + } + + function ujjelszo(){ + hun() ? $data['title'] = 'ARCHLine.XP Fórum új jelszó' : $data['title'] = 'ARCHLine.XP Forum new password'; + + $data['tartalom']='collection/ujjelszo'; + $data['style'] = array('temp/style_new'); + $data['javascript'] = array('objfeltoltes_2'); + + $this->load->view('site_upload',$data); + } + + function szabalyzat(){ + if(hun()){ + $data['title'] = 'ARCHLine.XP Feltöltés'; + $data['page'] = $this->mpages->get_row(572); + } + else{ + $data['title'] = 'ARCHLine.XP Upload'; + $data['page'] = $this->mpages->get_row(571); + } + + $data['tartalom']='page/show'; + $data['style'] = array('style_new'); + + $this->load->view('site_upload',$data); + } + + function login(){ + $this->load->model('mforum'); + + $email = $_POST["email"]; + $jelszo = $_POST["jelszo"]; + $link = $_SERVER["HTTP_REFERER"]; + $error = ""; + + + // ha vendégként lépnek be + if( $this->uri->segment(3) == "guest" ){ + + $user_id = "guest"; + $email = "guest"; + + $sessid=md5($email.time()); + $hash=md5($email . $this->pw . $sessid); + setcookie("sessid",$sessid,time()+$this->ervenydesseg,"/"); + setcookie("azonosito", $email, time()+$this->ervenydesseg,"/"); + setcookie("hash",$hash,time()+$this->ervenydesseg,"/"); + + $tomb = array(); + $tomb['feltolto_id'] = $user_id; + $tomb['email'] = $email; + $this->phpsession->save('feltolo',$tomb); + + header("Location: ".$link); + + } + // ha hibásak a bejelentkezési adatok + elseif( !$this->mforum->belep($email,$jelszo) ){ + + $this->phpsession->save('feltoltesbelepesihiba',"hfvj"); + $this->phpsession->save('feltoltesbelepesihibaemail',$email); + header("Location: ".$link); + + }else{ + $user_id = $this->mforum->get_userid($email); + $tomb = array(); + $tomb['feltolto_id'] = $user_id; + $tomb['email'] = $email; + //$this->phpsession->save('feltolo',$tomb); + + //header("Location: ".$link); + + + + $sessid=md5($email.time()); + $hash=md5($email . $this->pw . $sessid); + setcookie("sessid",$sessid,time()+$this->ervenydesseg,"/"); + setcookie("azonosito", $email, time()+$this->ervenydesseg,"/"); + setcookie("hash",$hash,time()+$this->ervenydesseg,"/"); + + $user_id = $this->mforum->get_userid($email); + $tomb = array(); + $tomb['feltolto_id'] = $user_id; + $tomb['email'] = $email; + $this->phpsession->save('feltolo',$tomb); + + header("Location: ".$link); + } + + } + + function logout(){ + $link = $_SERVER["HTTP_REFERER"]; + unset($_SESSION['default']['feltolo']); + + setcookie("sessid","",0,"/"); + setcookie("azonosito","",0,"/"); + setcookie("hash","",0,"/"); + + header("Location: ".$link); + } + + function desc(){ + if( $this->uri->segment(3) ) + $c_id = $this->uri->segment(3); + else + redirect('collection/kategoria'); + + $adatok = $this->mcollection->get_row($c_id); + + $data['adatok'] = $adatok; + + $data['style'] = array('temp/style_interior'); + + $data['title'] = 'ARCHLine.XP Collection'; + $data['title'] .= " - " . $adatok->title; + + $data['tartalom'] = 'collection/desc'; + + $this->load->view('site_upload',$data); + } + + function mycollection(){ + + $this->load->model('mforum'); + + $ell = md5($_COOKIE['azonosito'].$this->pw.$_COOKIE['sessid']); + + if( !empty($_COOKIE['hash']) && $_COOKIE['hash']== $ell ){ + + $user_id = $this->mforum->get_userid($_COOKIE['azonosito']); + $adatok = $this->mcollection->get_allUserId($user_id); + + $data['objects'] = $adatok; + $data['szerk'] = true; + + $data['javascript']=array('dl_select','objfeltoltes_2','fancybox/jquery-1.3.2.min','fancybox/jquery.easing.1.3','fancybox/jquery.fancybox-1.2.1.pack','fancybox/fancy'); + + $data['tartalom'] = 'collection/kat'; + + }else{ + $data['tartalom'] = 'collection/login'; + $data['javascript'] = array('objfeltoltes_2'); + + if(hun()) + $data['feltetel'] = $this->mpages->get_row(572); + else + $data['feltetel'] = $this->mpages->get_row(571); + } + + $data['style'] = array('temp/style_interior','fancybox2'); + $data['title'] = 'ARCHLine.XP Collection'; + $this->load->view('site_upload',$data); + } + + function edit(){ + $this->load->model('mforum'); + + $c_id = $this->uri->segment(3); + $user_id = $this->mforum->get_userid($_COOKIE['azonosito']); + $adatok = $this->mcollection->get_row($c_id); + + + if( is_numeric($c_id) && $this->cookieupdate() && $adatok->u_id == $user_id ){ + + if( !$this->input->post('do') ){ + $data['object'] = $adatok; + + $kategoriak = $this->muser->get_kategoriak($adatok->tipus); + $kategoriak = $this->mcollection->get_darab($kategoriak); + + $data['kategoriak'] = $kategoriak; + $data['szerk'] = true; + + $data['tartalom'] = 'collection/edit'; + print "rendben"; + + $data['style'] = array('temp/style_interior'); + $data['javascript'] = array('objfeltoltes_2'); + $data['title'] = 'ARCHLine.XP Collection'; + $this->load->view('site_upload',$data); + + }else{ + + $lang = $this->muser->user['lang']; + + $error = ""; + $kep = $adatok->kep; + $kat_id = 0; + + $tipusa = $adatok->tipus; + $this->kep(&$kep,$tipusa); + + + // új kategória felvétele, ha megadták + if( $_POST["ujkat"] != "" ){ + if(hun()){ + $nevhun = $_POST["ujkat"]; + $neveng = ""; + }else{ + $nevhun = ""; + $neveng = $_POST["ujkat"]; + } + + $kat_id = $this->muser->new_kategoria($tipusa,$nevhun,$neveng); + }else{ + $kat_id = $_POST["kategoria"]; + } + + + if(!$error){ + $ujpr->title = $_POST["projhectNameField"]; + $ujpr->meret = $adatok->size; + $ujpr->datum = $adatok->datum; + $ujpr->nyelv = $adatok->nyelv; + $ujpr->kep = $kep; + $ujpr->text = $_POST["projectDescriptionField"]; + $ujpr->fajl = $adatok->fajl; + $ujpr->szerzo = $_POST["SzerzoField"]; + $ujpr->kat_id = $kat_id; + + $this->mcollection->editobject($ujpr,$c_id); + } + + redirect('collection/mycollection'); + + } + + }else{ + + //print "hiba"; + redirect('collection/mycollection'); + } + } + + function del(){ + $this->load->model('mforum'); + + $c_id = $this->uri->segment(3); + $user_id = $this->mforum->get_userid($_COOKIE['azonosito']); + $adatok = $this->mcollection->get_row($c_id); + + if( is_numeric($c_id) && $this->cookieupdate() && $adatok->u_id == $user_id ){ + $this->mcollection->del($c_id); + } + + redirect('collection/mycollection'); + } + + function ekezet($input){ + $mit = array("/á/", "/Á/", "/é/", "/É/", "/í/", "/Í/", "/ö/", "/Ö/", "/ő/", "/Ő/", "/ó/", "/Ó/", "/ú/", "/Ú/", "/ü/", "/Ü/", "/ű/", "/Ű/", "/ /"); + $mire = array("a", "A", "e", "E", "i", "I", "o", "O", "o", "O", "o", "O", "u", "U", "u", "U", "u", "U", "_"); + $output = preg_replace($mit, $mire, $input); + return $output; + } + + function cookieupdate(){ + if( isset($_COOKIE['azonosito'],$_COOKIE['sessid']) ) + $ell = md5($_COOKIE['azonosito'].$this->pw.$_COOKIE['sessid']); + else + return false; + + if ( !empty($_COOKIE['hash']) && $_COOKIE['hash']== $ell ){ + setcookie("sessid",$_COOKIE['sessid'],time()+$this->ervenydesseg,"/"); + setcookie("azonosito", $_COOKIE['azonosito'] , time()+$this->ervenydessegemail,"/"); + setcookie("hash",$_COOKIE['hash'] ,time()+$this->ervenydesseg,"/"); + + return true; + + }else{ + return false; + } + } + + function kep(&$kep,$tipus){ + if ($_FILES["kep"]["error"]==0){ + $kepnev = time()."_". $_FILES["kep"]["name"]; + $ide= "public/img/collection/".$tipus."/".$kepnev; + if (copy($_FILES["kep"]["tmp_name"],$ide)){ + $kep = $ide; + //print " Sikerült a képmásolás! "; + }else{ + //print " Nem sikerült a képet felmásolni! "; + } + } + } + + +} + +?> \ No newline at end of file diff --git a/var/www/hosting/archlinexp.com/partners/application/controllers/collection.php.evidence.json b/var/www/hosting/archlinexp.com/partners/application/controllers/collection.php.evidence.json new file mode 100644 index 0000000..5ba2708 --- /dev/null +++ b/var/www/hosting/archlinexp.com/partners/application/controllers/collection.php.evidence.json @@ -0,0 +1,15 @@ +{ + "finding_ref": "5309", + "log_excerpt": "[quarantine] partners.archlinexp.com:application/controllers/collection.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/archlinexp.com/partners/application/controllers/collection.php)", + "original_sha256": "24937d9c44f51eb173223c5cf5271f02869850ac07a2b8bb03c83845a57666be", + "original_stat": { + "gid": 30037, + "mtime": 1423824406, + "size": 42503, + "uid": 11669 + }, + "rel_path": "application/controllers/collection.php", + "result": "quarantined", + "timestamp": "20260718T160424Z", + "vhost": "partners.archlinexp.com" +} diff --git a/var/www/hosting/archlinexp.com/partners/application/controllers/forum.php b/var/www/hosting/archlinexp.com/partners/application/controllers/forum.php new file mode 100644 index 0000000..245213b --- /dev/null +++ b/var/www/hosting/archlinexp.com/partners/application/controllers/forum.php @@ -0,0 +1,2556 @@ +userekoldal = 30; + + $user = $this->phpsession->get('fuser'); + if(!$user){ + + }else{ + $this->fuser = $user; + $this->cookieupdate(); + } + + $this->lang->load('site', $this->muser->user['lang']); + $this->load->model('mforum'); + + define( "BENTIIP", "62.201.77.86"); + define( "UBUNTU", "inux"); + define( "MEHET", "igen"); + define( "MEHETUJ", "nem"); + + /* if( $_SERVER['REMOTE_ADDR'] == "84.3.52.156" && strstr($_SERVER['HTTP_USER_AGENT'],"o") ){ + define( 'KUPONKERES', true); + }else + define( 'KUPONKERES', false);*/ + + } + + function index() + { + $this->temakorok(); + } + + function temakorok(){ + hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum'; + $data['tartalom']='forum/temakorok'; + $data['csik']=array('home','forum'); + + $user = $this->phpsession->get('fuser'); + if( $this->mforum->moderator($user['name']) ) + $data['moderator'] = true; + $this->phpsession->save('valasz',false); + $this->phpsession->save('hszid',false); + $this->phpsession->save('oldal',0); + $this->phpsession->save('temakor',false); + + if( is_numeric($this->uri->segment(3)) ) $temaoldal = $this->uri->segment(3); + else $temaoldal = 0; + $this->phpsession->save('temakoroldal',$temaoldal); + + $temak = $this->mforum->get_alaptemakorok($temaoldal); + foreach( $temak as $tema ){ + $cim = $tema->cim; + if(count($cim) > 26) + $ut26 = array($cim[26]); + else + $ut26 = array("a"); + $tomb = preg_grep("/[abcdefghijklmnopqrstxyzA-Z]/",$ut26); + if( count($tomb) == 0 ){ + if(strlen($tema->cim) > 26){ + $tema->rov_cim = substr($tema->cim,0,20); + $tema->rov_cim .= ".."; + } + }else{ + $tema->rov_cim = substr($tema->cim,0,27); + if(strlen($tema->cim) > 27) + $tema->rov_cim .= ".."; + } + + $xx = $this->mforum->get_tkuthsz($tema->temakor_id); + if($xx != ""){ + $tema->datum = $xx->datum; + if($xx->user != "586"){ + $xxxx = $this->mforum->get_userUid($xx->user); + if(isset($xxxx->nev)) + $tema->utolsouser = $xxxx->nev; + else + $tema->utolsouser = ""; + } + else + $tema->utolsouser = "Németh Kálmán"; + } + else + $tema->datum = $this->mforum->get_tkdate($tema->temakor_id); + + } + + usort( $temak, "hasonlito" ); + $data['temak'] = $temak; + + if( $this->mforum->vanmegtemakor($this->phpsession->get('temakoroldal')) ){ + $data['kovetkezo'] = true; + $data['kov'] = ($temaoldal+1); + } + if( $temaoldal > 0 ){ + $data['elozo'] = true; + $data['elobbi'] = ($temaoldal-1); + } + + $data['oldalak_szama'] = $this->mforum->get_tkoldal(); + $data['akt_oldal'] = $this->phpsession->get('temakoroldal'); + $data['style'] = array('jquery.ui'); + + $data['aktmenu'] = "1"; + $this->load->view('site_forum',$data); + } + + function temak(){ + hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum'; + $data['tartalom']='forum/temak'; + $data['csik']=array('home','forum'); + + $user = $this->phpsession->get('fuser'); + if( $this->mforum->moderator($this->fuser['name']) ) + $data['moderator'] = true; + $this->phpsession->save('valasz',false); + $this->phpsession->save('hszid',false); + $this->phpsession->save('oldal',0); + + if( is_numeric($this->uri->segment(3)) ) $temakor = $this->uri->segment(3); + else if( $this->phpsession->get('temakor') ) $temakor = $this->phpsession->get('temakor'); + else redirect('forum'); + $this->phpsession->save('temakor',$temakor); + + if( is_numeric($this->uri->segment(4)) ) $temaoldal = $this->uri->segment(4); + else $temaoldal = 0; + $this->phpsession->save('temaoldal',$temaoldal); + + + if( in_array($temakor,$this->noindextemakorok) ) + $data["noindex"] = true; + + $temak = $this->mforum->get_alap2($temakor, $temaoldal); + $desctemak = ""; + foreach( $temak as $tema ){ + $cim = $tema->cim; + $desctemak .= $tema->cim.", "; + $tema->rov_cim = $tema->cim; + + $tema->utolsouser = $this->mforum->get_utolsouserTema($tema->tema_id); + if( isset($tema->utolsouser->user) && $tema->utolsouser->user == "586" ) + $tema->utolsouser = "Németh Kálmán"; + elseif( isset($tema->utolsouser->nev) ) + $tema->utolsouser = $tema->utolsouser->nev; + else + $tema->utolsouser = ""; + } + + + if( !$temak ){ + $data['infok'] = array("1"); + } + else{ + if( $this->mforum->vanmegtema($this->phpsession->get('temaoldal'),$temakor) ){ + $data['kovetkezo'] = true; + $data['kov'] = ($temaoldal+1); + } + if( $temaoldal > 0 ){ + $data['elozo'] = true; + $data['elobbi'] = ($temaoldal-1); + } + + $data['oldalak_szama'] = $this->mforum->get_toldal(); + $data['akt_oldal'] = $this->phpsession->get('temaoldal'); + } + + $data['temak'] = $temak; + $data['temakorcim'] = $this->mforum->get_tkcim($temakor)->cim; + + + $data['meta']['keyw'] = $data['temakorcim'].', '; + $data['title'] .= ' - ' . $data['temakorcim']; + $data['meta']['desc'] = hun() ? "ARCHLine.XP fórum, ".$data['temakorcim']." témái: ".trim($desctemak,", ") : "ARCHLine.XP forum, topics of ".$data['temakorcim']." board: ".trim($desctemak,", "); + + $data['aktmenu'] = "1"; + $data['javascript'] = array('jquery_ui'); + $data['style'] = array('jquery.ui'); + $this->load->view('site_forum',$data); + } + + function ujtema(){ + $tomb = $this->phpsession->get('fuser'); + $user = $tomb['name']; + $temakor_id = $this->phpsession->get('temakor'); + if( $user ){ + if($this->input->post('nyit')!=false){ + $this->mforum->temabeszur($this->input->post('temacim')); + + $record->osztaly = "forum"; + $record->fv = "ujtema"; + $record->hiba = "Új téma: ".$this->input->post('temacim'); + $record->datum = date('Y-m-d H:i:s',time()); + $this->db->insert('a_hibak',$record); + + redirect('forum'); + }else{ + hun() ? $data['title'] = $data['title'] = 'ARCHLine.XP Fórum téma nyitás' : $data['title'] = 'ARCHLine.XP Forum new topic'; + $data['tartalom']='forum/ujtema'; + $data['csik']=array('home','forum'); + + $this->load->view('site_forum',$data); + } + }else{ + $this->index(); + } + } + + function ujtemakor(){ + $tomb = $this->phpsession->get('fuser'); + $user = $tomb['name']; + $temakor_id = 0; + if( $this->mforum->moderator($tomb['name']) ){ + if($this->input->post('nyit')!=false){ + $this->mforum->temakorbeszur($this->input->post('temacim')); + + redirect('forum/temakorok'); + }else{ + hun() ? $data['title'] = 'ARCHLine.XP Fórum témakör nyitás' : $data['title'] = 'ARCHLine.XP Forum new board'; + $data['tartalom']='forum/ujtemakor'; + $data['csik']=array('home','forum'); + + $this->load->view('site_forum',$data); + } + }else{ + $this->index(); + } + } + + function csere($input){ + $mit[0]="/>/"; + $mit[1]="/"; + $mire[3]="\'"; + $mire[4]="\="; + $mire[5]="\\\""; + $mire[6]="\;"; + return preg_replace($mit,$mire,$input); + } + + function csere2($input){ + $mit[2]="/\n/"; + $mire[2]="
"; + return preg_replace($mit,$mire,$input); + } + + function ujhsz(){ + $tomb = $this->phpsession->get('fuser'); + if( $tomb ){ + if($this->input->post('hozzaad')!=false){ + $tema_id = $this->phpsession->get('temaid'); + $error = ""; + + $kep = "NULL"; + + if(!$this->input->post('hszuj')) + $hszszoveg = $this->input->post('hsz'); + else + $hszszoveg = $this->input->post('hszuj'); + + + // formázás eltávolítása ?? + //$hszszoveg = preg_replace('#style="[^"]*"#i', '', $hszszoveg); + //$hszszoveg = preg_replace('//i', '', $hszszoveg); + //$hszszoveg = strip_tags($hszszoveg, '