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'] = '
', '
'); + } 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('subtitle') . " ', ' ', ' ', ' ', ' ', ' ', ' ', ' ).+(<\/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('subtitle')." ', ' ', ' ', ' ', ' ', ' ', ' ', ' ).+(<\/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 = $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('subtitle')." ', ' "; 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 "
+
+ } else {
+ if (substr($utvonal, -1) != "/")
+ $utvonal .= "/";
+
+ if (!is_dir($utvonal)) {
+ print "A megadott mappa nem letezik: " . $utvonal;
+ exit();
+ }
+
+ $utvonalthumbs = $utvonal . "thumbs/";
+
+ if (!is_dir($utvonalthumbs)) {
+ mkdir($utvonalthumbs, 0644);
+ chmod($utvonalthumbs, 0777);
+ }
+
+ $nagykepek = scandir($utvonal);
+ $letrehozva = "";
+
+ include('application/helpers/myimg_helper.php');
+ foreach ($nagykepek as $nagy) {
+ $nagykep = $utvonal . $nagy;
+ // ha letezik a thumb kep akkor ne irja felul
+ if ($nagy != "." && $nagy != ".." && !is_dir($nagykep) && !file_exists($utvonalthumbs . $nagy)) {
+ $ujkiskep = $utvonalthumbs . $nagy;
+ kemeretezesvagassh($nagykep, $ujkiskep, 68, 68);
+ chmod($ujkiskep, 0777);
+ $letrehozva .= $ujkiskep . "
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) {
+?>
+
";
+ print "
ok: " . $ujkiskep;
+ }
+ }
+ print "Letrehozva: " . $letrehozva;
+ exit();
+ }
+ }
+
+ function creategallerylink()
+ {
+ $utvonal = $this->input->post('utvonal');
+
+
+ if (!$utvonal) {
+ ?>
+
+
+ } else {
+ if (substr($utvonal, -1) != "/")
+ $utvonal .= "/";
+
+ if (!is_dir($utvonal)) {
+ print "A megadott mappa nem letezik: " . $utvonal;
+ exit();
+ }
+
+ print $utvonal . " : " . base64_encode($utvonal);
+ exit();
+ }
+ }
+
+ function workshop()
+ {
+ $this->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('";
+ // 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 "
";
+ }
+
+
+ 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'] = " ";
+ }
+ print "" . $v->nev . ": " . $v->db . " db elem
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]="/";
+ $mit[2]="/\n/";
+ $mit[3]="/'/";
+ $mit[4]="/=/";
+ $mit[5]="/\"/";
+ $mit[6]="/;/";
+ $mire[0]=">";
+ $mire[1]="<";
+ $mire[2]="
";
+ $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, '
")
+ $error .= "Üres hozzászólás!
";
+
+
+ if ($_FILES["fkep"]["error"]==0 && ($error == "") ){
+ $login = $tomb['name'];
+ $user_id = $this->mforum->get_userid($login);
+ //ha nincs mappája
+ if(hun())
+ $hova = $this->kepek_utvonal.$user_id;
+ elseif(eng())
+ $hova = $this->kepek_utvonal_eng.$user_id;
+
+ if(!is_dir($hova)){
+ //akkor hozza létre
+ mkdir($hova,0644);
+ chmod($hova,0777);
+ }
+ $feltolt_konyvtar = $hova."/";
+ //ha több fájl lenne ugyanazon a néven
+ $rand = rand(100,999);
+ $basefilename = $rand . "__" .$this->ekezet($_FILES["fkep"]["name"]);
+ $feltolt_fajlnev=$feltolt_konyvtar . $basefilename;
+
+ $error = "";
+ $mi = $_FILES['fkep']['name']."$";
+
+ $mire = "\.bmp|\.jpg|\.jpeg|\.png|\.gif|\.tif|\.BMP|\.JPG|\.PNG|\.GIF";
+ if( !(ereg( $mire , $mi )) ){
+ $error .= "Hibás fájl kiterjesztés, elfogadott kiterjesztések: .bmp, .jpg, .png, .gif
";
+ }
+ if( $_FILES['fkep']['size'] > 1024 * 1024 * 10 ){
+ $error .= "A kép mérete nagyobb 10 MB-nál.
";
+ }
+ else if( $hszszoveg != "" && !$error){
+ if (copy($_FILES["fkep"]["tmp_name"], $feltolt_fajlnev)){
+ $kep = $rand . "__". $this->ekezet($_FILES["fkep"]["name"]);
+ $mit = $hova."/".$kep;
+ chmod($mit,0777);
+
+ // elonezeti kep elkeszitese 200x150-ben
+ // include('application/helpers/myimg_helper.php');
+ // @kepmeretezesvagasmax($feltolt_fajlnev,$hova,"elo_".$basefilename,300,300);
+ }else{
+ $kep = "NULL";
+ }
+ }
+ }
+
+ if(!$error){
+ $this->mforum->hszbeszur($hszszoveg,$tema_id,$valasz,$kep);
+
+
+ // ertesitesek kikuldese
+ $this->load->library('email');
+ $this->email->initialize();
+
+ $mail_data['tema'] = $this->mforum->get_cim($tema_id)->cim;
+ $mail_data['user'] = $tomb['name'];
+ $mail_data['hsz'] = $hszszoveg;
+
+ $this->email->message($this->load->view('mail/forum_ujhsz', $mail_data, true));
+ $this->email->from('info@cadline.hu', 'Cadline Weboldal');
+ $this->email->subject('ARCHLine.XP Fórum - Új hozzászólás');
+
+ $kiknek = $this->mforum->ertesites($tema_id);
+ foreach($kiknek as $kinek){
+ $alap = $this->mforum->default_mail($kinek->email);
+ if(!$alap)
+ $alap = $kinek->email;
+
+ if($alap)
+ $this->email->send($alap, 'smtp');
+ }
+ // end ertesitesek kikuldese
+
+
+ $temaid = $this->phpsession->get('tema_id');
+ header("Location: listaz/$temaid");
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='forum/ujhsz';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+ $data['error']=$error;
+ $data['hsz']=$this->input->post('hsz');
+
+ $this->load->view('site_forum',$data);
+ }
+ }else if( $this->phpsession->get('temaid') ){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='forum/ujhsz';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('../editor/fckeditor');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ $this->index();
+ }
+ }
+
+ function valasz(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->uri->segment(3) ){
+ $this->phpsession->save('valasz',$this->uri->segment(3));
+ $id = $this->uri->segment(3);
+ $temaid = $this->mforum->get_temaidByHszid($id);
+ $this->phpsession->save('temaid',$temaid);
+ }
+ if( $tomb ){
+ if( $this->phpsession->get('temaid') ){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='forum/ujhsz';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('../editor/fckeditor');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ $this->index();
+ }
+ }
+
+ function listaz(){
+ $this->phpsession->save('valasz',false);
+ if( !($this->phpsession->get('oldal')) ) $this->phpsession->save('oldal',0);
+ if( $this->uri->segment(3) == 'kov' ) $this->kovetkezo();
+ if( $this->uri->segment(3) == 'elozo' ) $this->elozo();
+
+ if( is_numeric($this->uri->segment(3)) ){
+ $tema_id = $this->uri->segment(3);
+ $this->phpsession->save('temaid',$tema_id);
+// redirect('forum/listaz');
+ }else if($this->phpsession->get('temaid')){
+ $tema_id = $this->phpsession->get('temaid');
+ }else{
+ $tema_id = 0;
+ }
+
+ if(!($tema_id) || !is_numeric($tema_id) || !$this->mforum->is_temaid($tema_id)){
+ redirect('forum');
+ }else{
+ $data['tartalom']='forum/temamutat';
+ $data['csik']=array('home','forum');
+
+
+ if( in_array($tema_id,$this->noindextemak) )
+ $data["noindex"] = true;
+
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ if( !is_numeric($this->uri->segment(4)) )
+ $oldal = $this->phpsession->get('oldal');
+ else{
+ $oldal = $this->uri->segment(4);
+ $this->phpsession->save('oldal',$oldal);
+ }
+ $hszek = $this->mforum->get_lista($tema_id,$oldal);
+ foreach( $hszek as $hsz){
+ if( !($hsz->valasz == "0" || $hsz->valasz == "NULL") ){
+ $vszid = $hsz->valasz;
+ $elozo = $this->mforum->get_hsz($vszid);
+ if( $elozo->user == "" )
+ $elozo = $this->mforum->get_hsz2($vszid);
+ if( isset($elozo->user) && $elozo->user != "0" && $elozo->user != "" ){
+ $hsz->valasz = $elozo->user . ", (" . $elozo->datum . ")";
+ if( $elozo->user == 586 )
+ $hsz->valasz = "Németh Kálmán, (" . $elozo->datum . ")";
+ elseif( $elozo->user == 270 )
+ $hsz->valasz = "Tóth M.Levente, Mészáros Marcel, (" . $elozo->datum . ")";
+ }
+ elseif( $elozo )
+ $hsz->valasz = "[Törölt felhasználó], (" . $elozo->datum . ")";
+ else
+ $hsz->valasz = "-";
+ }
+ //if(!eng()) $hsz->szoveg = $this->csere2($hsz->szoveg);
+ if( strtotime($hsz->datum) < 1282039000) $hsz->szoveg = $this->csere2($hsz->szoveg);
+
+ if( $hsz->user_id == 586 ){
+ $hsz->user = "Németh Kálmán";
+ }elseif( $hsz->user_id == 270 ){
+ $hsz->user = "Tóth M.Levente, Mészáros Marcel";
+ }
+ }
+
+ if( !$hszek ){
+ $data['infok'] = array("2");
+ }else{
+ if( $this->mforum->vanmegoldal($tema_id,$this->phpsession->get('oldal')))
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('oldal') > 0 )
+ $data['elozo'] = true;
+ }
+
+ $data['hszek_json'] = json_encode($hszek);
+
+ $user = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($user['name']) )
+ $data['szerk']=true;
+ $data['temacim'] = $this->mforum->get_cim($tema_id)->cim;
+ $temakor_id = $this->mforum->get_tema1($tema_id)->temakor_id;
+ $data['temakorcim'] = $this->mforum->get_temakor1($temakor_id)->cim;
+ $data['temakorid'] = $temakor_id;
+ $data['tema_id'] = $tema_id;
+ $data['oldalak_szama'] = (int)$this->mforum->get_temaoldal($tema_id);
+ $data['akt_oldal'] = $oldal;
+
+ $data['hozzaszolasok'] = $hszek;
+
+ $data['meta']['keyw'] = $data['temacim'].', ';
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['title'] .= ' - ' . $data['temacim'];
+ $data['meta']['desc'] = hun() ? "ARCHLine.XP fórum, ".$data['temakorcim']." > ".$data['temacim']." téma hozzászólásai, ".($oldal+1).". oldal" : "ARCHLine.XP forum, posts of ".$data['temacim']." topic, ".($oldal+1).". page";
+
+ $data['aktmenu'] = "1";
+ $data['style'] = array('jquery.ui','fancybox2');
+ $data['javascript'] = array('../editor/fckeditor','jquery_ui'/*,'fancybox/jquery-1.3.2.min','fancybox/jquery.easing.1.3'*/,'fancybox/jquery.fancybox-1.2.1.pack','fancybox/fancy');
+ $this->load->view('site_forum',$data);
+ }
+
+ }
+
+ function kovetkezo(){
+ $oldalszam = $this->phpsession->get('oldal');
+ if( $this->mforum->vanmegoldal($this->phpsession->get('temaid'),$oldalszam)){
+ $oldalszam++;
+ }
+ $this->phpsession->save('oldal',$oldalszam);
+ }
+
+ function elozo(){
+ $oldalszam = $this->phpsession->get('oldal');
+ if( $oldalszam > 0 )
+ $oldalszam--;
+ $this->phpsession->save('oldal',$oldalszam);
+ }
+
+ 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 login(){
+ $name = $this->input->post('name');
+ $passwd = $this->input->post('passwd');
+
+ $name = mysql_escape_string($name);//$this->csere($name);
+
+ if(!$passwd || !$name)
+ {
+ $this->belephiba(9);
+ }
+ else
+ {
+ $name2 = $this->ekezet($name);
+ $vanaktiv = $this->mforum->vanaktivprog($name);
+
+ if( ($this->mforum->belep($name,$passwd) || $this->mforum->belep($name2,$passwd))
+ && $vanaktiv )
+ {
+ $uid = $this->mforum->get_userid($name);
+ if( !$uid || !is_numeric($uid) ){
+ $this->belephiba(6);
+ }else{
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$name;
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+ $fuser['rang'] = $this->mforum->get_rang($uid);
+ $rang = $fuser['rang'];
+ }
+
+
+
+
+ // ha csak feltolto
+ if( $rang != "user" && $rang != "moderator" ){
+ $fuser['user_id'] = $uid;
+
+ // webrenderbe is beléptetni
+ $sessid=md5($name.time());
+ $hash=md5($name . $this->pw . $sessid);
+ setcookie("sessid",$sessid,time()+$this->ervenydesseg,"/");
+ setcookie("azonosito", $name, time()+$this->ervenydesseg,"/");
+ setcookie("hash",$hash,time()+$this->ervenydesseg,"/");
+
+ $this->phpsession->save('feltolto',$fuser);
+ $this->belephiba(8);
+ }
+ //ha még nem fogadta el a szabályzatot:
+ elseif( !($this->mforum->szabalyzat($uid) ) ){
+ if(hun())
+ $lap = $this->mpages->get_row(454);
+ else
+ $lap = $this->mpages->get_row(559);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum szabályzat' : $data['title'] = 'ARCHLine.XP Forum Rules';
+ $data['tartalom'] = '/forum/szabalyzat';
+ $data['lap'] = $lap;
+ //$user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($name))
+ $data['moderator']=true;
+
+ //ha még nem fogadta el a szabályzatot:
+ if( !($this->mforum->szabalyzat($uid) ) ){
+ $data['uid'] = $uid;
+ $data['login'] = $name2;
+ $data['pw'] = md5($passwd);
+ $data['nemelfogad'] = true;
+ $data['infok'] = array("0");
+ }
+
+ $this->load->view('site_forum',$data);
+ }
+ else{
+ $fuser['user_id'] = $uid;
+ $this->phpsession->save('fuser',$fuser);
+
+
+ // webrenderbe is beléptetni
+ $sessid=md5($name.time());
+ $hash=md5($name . $this->pw . $sessid);
+ setcookie("sessid",$sessid,time()+$this->ervenydesseg,"/");
+ setcookie("azonosito", $name, time()+$this->ervenydesseg,"/");
+ setcookie("hash",$hash,time()+$this->ervenydesseg,"/");
+
+ redirect('forum');
+ }
+ }else{
+ if( $name == "moderator" ){
+ $szam = date(W);
+ $this->mforum->jelszovaltmod($szam);
+ if( $this->mforum->belep($name,$passwd) ){
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$name;
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+ $uid = $this->mforum->get_userid($name);
+ $fuser['user_id'] = $uid;
+ $this->phpsession->save('fuser',$fuser);
+ redirect('forum');
+ }
+ }
+
+ if( !$vanaktiv )
+ $this->belephiba(7);
+ else{
+ $this->belephiba(6);
+ }
+ }
+ }
+ }
+
+ function belephiba($szoveg){
+ $data['tartalom']='forum/temakorok';
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['csik']=array('home','forum');
+
+ if( !is_numeric($szoveg) ){
+ $data['error'] = $szoveg;
+ }
+ else{
+ $data['error'] = array($szoveg);
+ }
+
+ $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;
+ $tema->rov_cim = $tema->cim;
+
+ /*if(strlen($tema->cim) > 26){
+ $ut26 = array($cim[26]);
+ $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")
+ $tema->utolsouser = $this->mforum->get_userUid($xx->user)->nev;
+ 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'] = 1;
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function logout(){
+ unset($_SESSION['default']['fuser']);
+ unset($_SESSION['default']['feltolto']);
+ redirect('forum');
+ }
+
+ function szerkeszt(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->uri->segment(3) != "")
+ $hszid = $this->uri->segment(3);
+ else
+ //$hszid = $this->phpsession->get('hszid');
+ $hszid = $this->input->post('hszid');
+
+ if( $this->mforum->moderator($tomb['name']) || $this->mforum->get_sajathsz($tomb['user_id'], $hszid) ){
+ if($this->input->post('szerk')!=false){
+ //$hszid = $this->phpsession->get('hszid');
+ $hszid = $this->input->post('hszid');
+ $this->mforum->hszszerk($this->input->post('hsz'),$hszid);
+ $user_id = $this->mforum->get_hsz($hszid)->user_id;
+
+ if( $this->input->post('kepki')=='on' ){
+ if(hun())
+ $kep = $this->kepek_utvonal . $user_id ."/". $this->mforum->get_Kep($hszid)->kep;
+ elseif(eng())
+ $kep = $this->kepek_utvonal_eng . $user_id ."/". $this->mforum->get_Kep($hszid)->kep;
+
+ chmod($kep, 777);
+ unlink($kep);
+ $this->mforum->kepki($hszid);
+ }
+
+ $temaid = $this->phpsession->get('tema_id');
+ header("Location: listaz/$temaid");
+ }else if( $this->uri->segment(3) != "" ){
+ $this->phpsession->save('hszid',$this->uri->segment(3));
+
+ $data['szoveg']=$this->mforum->get_Text($this->phpsession->get('hszid'))->szoveg;
+ $kep = $this->mforum->get_Kep($this->phpsession->get('hszid'))->kep;
+ if( $kep != "" && $kep != "NULL" ){
+ $user_id = $this->mforum->get_hsz($this->phpsession->get('hszid'))->user_id;
+ if(hun())
+ $data['kep'] = "/".$this->kepek_utvonal. $user_id . "/".$kep;
+ elseif(eng())
+ $data['kep'] = "/".$this->kepek_utvonal_eng. $user_id . "/".$kep;
+ }
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['javascript'] = array('../editor/fckeditor');
+ $data['tartalom']='forum/szerkeszt';
+ $data['csik']=array('home','forum');
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function torles(){
+ $tomb = $this->phpsession->get('fuser');
+ $hszid = $this->uri->segment(3);
+ if( $this->mforum->moderator($tomb['name']) || $this->mforum->get_sajathsz($tomb['user_id'], $hszid) ){
+ if( $this->uri->segment(3) != "" ){
+ $hszid = $this->uri->segment(3);
+ $uid = $this->mforum->torol($hszid);
+
+ //ha nincs kep a mappajaban:
+ if(hun())
+ $mappa = $this->kepek_utvonal . $uid;
+ elseif(eng())
+ $mappa = $this->kepek_utvonal_eng . $uid;
+
+ $handle = opendir($mappa);
+ //ha nincs fajl a konyvtarban, akkor toroljuk a mappat
+ chmod($mappa,0777);
+ $fajl = readdir($handle);
+ $fajl = readdir($handle);
+ $fajl = readdir($handle);
+ if(!($fajl)){
+ //closedir($mappa);
+ rmdir($mappa);
+ }
+
+ $tema_id = $this->phpsession->get('temaid');
+ if( is_int($this->mforum->get_temaoldal($tema_id)) && ($this->phpsession->get('oldal') == $this->mforum->get_temaoldal($tema_id)) ){
+ $this->elozo();
+ }
+ redirect('forum/listaz');
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tatnevez(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" && ($this->input->post('atnevez')==false) ){
+ $tid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='forum/temaatnevez';
+ $data['csik']=array('home','forum');
+ $data['tema_id'] = $tid;
+ $data['temacim'] = $this->mforum->get_cim($tid)->cim;
+ $data['moderator'] = true;
+
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('atnevez')!=false){
+ $this->mforum->tatnevez($this->input->post('tid'),$this->input->post('ujnev'));
+
+ header("Location: index");
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tkatnevez(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" && ($this->input->post('atnevez')==false) ){
+ $tid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='forum/tkatnevez';
+ $data['csik']=array('home','forum');
+ $data['tema_id'] = $tid;
+ $data['temacim'] = $this->mforum->get_tkcim($tid)->cim;
+ $data['moderator'] = true;
+
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('atnevez')!=false){
+ $this->mforum->tkatnevez($this->input->post('tid'),$this->input->post('ujnev'));
+
+ header("Location: index");
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tematorol(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $tomb && $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" ){
+ $tid = $this->uri->segment(3);
+ $this->mforum->tematorol($tid);
+
+ redirect('forum');
+ }else{
+ redirect('forum');
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function temakortorol(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $tomb && $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" ){
+ $tid = $this->uri->segment(3);
+ $this->mforum->temakortorol($tid);
+
+ redirect('forum');
+ }else{
+ redirect('forum');
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function mypost(){
+ $this->phpsession->save('valasz',false);
+
+ $data['tartalom']='forum/mypost';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('forum');
+ $data['style'] = array('forum_2011');
+ $user = $this->phpsession->get('fuser');
+
+ if(!$user)
+ redirect('forum');
+
+ $hszek = $this->mforum->get_mypost($user['user_id']);
+ foreach( $hszek as $hsz){
+ $elo = $hsz->valasz;
+ $hsz->valasz = $this->mforum->get_valaszok($hsz->hsz_id);
+ $hsz->valaszdb = count($hsz->valasz);
+ $hsz->elozo = $this->mforum->get_hsz($elo);
+ $tema = $this->mforum->get_tema1($hsz->tema_id);
+ $hsz->tema = $this->mforum->get_tema1($hsz->tema_id);
+ $temakor = $this->mforum->get_temakor1($tema->temakor_id);
+ $hsz->temakor = $temakor->cim;
+
+ //print_r($hsz->elozo);
+ }
+
+ $data['hozzaszolasok'] = $hszek;
+ $data['hszdb'] = count($hszek);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+
+ $this->load->view('site_forum',$data);
+ }
+
+
+ function myuser(){
+ $user = $this->phpsession->get('fuser');
+
+ if(!$user)
+ $user = $this->phpsession->get('feltolto');
+
+ if($user){
+ /*$tomb = $this->phpsession->get('fuser');*/
+ $login = $user['name'];
+ $this->user($login);
+ }else
+ redirect('forum');
+ }
+
+ function user($login){
+ if(!$login)
+ redirect('forum');
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='forum/user';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['user']=$login;
+ $data['adatok'] = $this->mforum->get_user($login);
+ $szemadatok = $this->mforum->get_user_szem($login);
+ $emailek = $szemadatok[0]->email;
+ $emailek = explode(";",$emailek);
+ $szemadatok[0]->email = "";
+ foreach( $emailek as $email ){
+ $szemadatok[0]->email .= $email . "
";
+ }
+ $van = $szemadatok[0]->nev;
+ if($van)
+ $data['szemadatok'] = $szemadatok;
+ else
+ $data['szemadatok'] = $this->mforum->get_user_alap($login);
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+
+ $kulcsok[$key_kulcs]->programok = $programs;
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }
+
+ function users(){
+ $user = $this->phpsession->get('fuser');
+
+ if( $user && $this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+ $this->phpsession->save('belep',"");
+
+ if( !($this->phpsession->get('uoldal')) ){
+ $this->phpsession->save('uoldal',0);
+ $oldal = 0;
+ }else{
+ $oldal = $this->phpsession->get('uoldal');
+ }
+
+ if( $this->uri->segment(3) == "kov" ){
+ $oldal++;
+ $this->phpsession->save('uoldal',$oldal);
+ }else if( $this->uri->segment(3) == "elozo" && $oldal > 0 ){
+ $oldal--;
+ $this->phpsession->save('uoldal',$oldal);
+ }
+ else if( is_numeric($this->uri->segment(3))){
+ $oldal = $this->uri->segment(3);
+ $this->phpsession->save('uoldal',$oldal);
+ }
+
+ if( $this->uri->segment(3) == "rendez" ){
+ $ord = $this->uri->segment(4);
+
+
+ $vissza = $this->phpsession->get('rendezvissza');
+ if($this->phpsession->get('rendez') == $ord){
+ $vissza = !$vissza;
+ }
+ $this->phpsession->save('rendezvissza',$vissza);
+
+
+ $this->phpsession->save('rendez',$ord);
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ }else if( $this->phpsession->get('rendez') ){
+ $ord = $this->phpsession->get('rendez');
+ $vissza = $this->phpsession->get('rendezvissza');
+ }else{
+ $ord = "nev";
+ $vissza = false;
+ }
+
+ $data['users']=$this->mforum->get_users($oldal,$ord,$vissza);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ukeres(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+ if( !($this->phpsession->get('ukoldal')) ){
+ $this->phpsession->save('ukoldal',0);
+ $oldal = 0;
+ }else{
+ $oldal = $this->phpsession->get('ukoldal');
+ }
+
+ if( is_numeric($this->uri->segment(3))){
+ $oldal = $this->uri->segment(3);
+ $this->phpsession->save('ukoldal',$oldal);
+ }
+
+ if( $this->uri->segment(3) == "rendez" ){
+ $ord = $this->uri->segment(4);
+
+ $vissza = $this->phpsession->get('rendezvissza');
+ if($this->phpsession->get('rendez') == $ord){
+ $vissza = !$vissza;
+ }
+ $this->phpsession->save('rendezvissza',$vissza);
+
+ $this->phpsession->save('rendez',$ord);
+ $oldal = 0;
+ $this->phpsession->save('ukoldal',0);
+ }else if( $this->phpsession->get('rendez') ){
+ $ord = $this->phpsession->get('rendez');
+ $vissza = $this->phpsession->get('rendezvissza');
+ }else{
+ $ord = "nev";
+ $vissza = false;
+ }
+
+ if( $this->input->post('klogin') || $this->input->post('knev') || $this->input->post('kemail') || $this->input->post('kulcssz') || ($this->input->post('belep') != -1 && $this->input->post('belep') != "" ) ){
+ $oldal = 0;
+ $this->phpsession->save('ukoldal',$oldal);
+ $klog = $this->input->post('klogin');
+ $this->phpsession->save('klogin',$this->input->post('klogin'));
+ $knev = $this->input->post('knev');
+ $this->phpsession->save('knev',$knev);
+ $kmail = $this->input->post('kemail');
+ $this->phpsession->save('kemail',$this->input->post('kemail'));
+ $kulcs = $this->input->post('kulcssz');
+ $this->phpsession->save('kulcssz',$this->input->post('kulcssz'));
+ $belep = $this->input->post('belep');
+ $this->phpsession->save('belep',$this->input->post('belep'));
+ }else{
+ $klog = $this->phpsession->get('klogin');
+ $knev = $this->phpsession->get('knev');
+ $kmail = $this->phpsession->get('kemail');
+ $kulcs = $this->phpsession->get('kulcssz');
+ $belep = $this->phpsession->get('belep');
+ }
+
+ if(UJUGYFELKEZELO===true)
+ $users = $this->mforum->get_kusersujcrm($oldal,$klog,$knev,$kmail,$belep,$kulcs,$ord,$vissza);
+ else
+ $users = $this->mforum->get_kusers($oldal,$klog,$knev,$kmail,$belep,$kulcs,$ord,$vissza);
+ $data['users'] = $users;
+
+ if(UJUGYFELKEZELO===true){
+ if( $this->mforum->vanmegkuserujcrm($this->phpsession->get('ukoldal'),$klog,$knev,$kmail,$belep,$kulcs) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('ukoldal') > 0 )
+ $data['elozo'] = true;
+ }
+ else{
+ if( $this->mforum->vanmegkuser($this->phpsession->get('ukoldal'),$klog,$knev,$kmail,$belep,$kulcs) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('ukoldal') > 0 )
+ $data['elozo'] = true;
+ }
+
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_kusersdb($klog,$knev,$kmail,$belep,$kulcs);
+ $data['akt_oldal'] = $oldal;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function edit_user(){
+ $user = $this->phpsession->get('fuser');
+ if($user && $this->mforum->moderator($user['name'])){
+ if( $this->uri->segment(3) != "" && ($this->input->post('edituser')==false) ){
+ $uid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználó szerkesztése' : $data['title'] = 'ARCHLine.XP Forum Edit User';
+ $data['tartalom']='forum/edit_user';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+ $login = $this->mforum->get_login($uid);
+ $data['adatok'] = $this->mforum->get_user($login);
+
+ $szemadatok = $this->mforum->get_user_szem($login);
+
+ if($szemadatok[0])
+ $data['szemadat'] = $szemadatok[0];
+ else{
+ $cucc = $this->mforum->get_user_alap($login);
+ $data['szemadat'] = $cucc[0];
+ }
+
+ //$data['kulcsok'] = $this->mforum->get_user_kulcsok($login);
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+
+ $i=0;
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $i++;
+
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+
+ $kulcsok[$key_kulcs]->programok = $programs;
+
+
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('edituser')!=false){
+
+ $error = "";
+ $langerror = array();
+ if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') != $this->input->post('jelszo2') ){
+ $error .= "A megadott két jelszó nem egyezik.
";
+ array_push($langerror,0);
+ }else if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') == $this->input->post('jelszo2') && strlen($this->input->post('jelszo1') ) < 5 ){
+ $error .= "A megadott jelszó 5 karakternél rövidebb.
";
+ array_push($langerror,1);
+ }
+
+ $user = $tomb['name'];
+ //$myid = $this->mforum->get_userid($user);
+
+ if( $this->input->post('login') == "" ){
+ $error .= "A login mező értéke nem lehet üres.
";
+ array_push($langerror,4);
+ }
+
+ if( $this->input->post('login') != "" && !$this->mforum->szabadlogin($this->input->post('login'),$this->input->post('uid')) ){
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+ array_push($langerror,2);
+ }
+ elseif( strlen($this->input->post('login') ) < 5 ){
+ $error .= "A megadott login 5 karakternél rövidebb.
";
+ array_push($langerror,3);
+ }
+
+ if( $this->input->post('login') != $this->ekezet($this->input->post('login')) ){
+ $error .= "A felhasználó névben nem szerepelhet ékezet vagy szóköz!
";
+ array_push($langerror,5);
+ }
+
+
+ $uid = $this->input->post('uid');
+
+ if( !$error ){
+ // frissítés
+ $mod['nev'] = $this->input->post('nev');
+ $mod['login'] = $this->input->post('login');
+ $mod['rang'] = $this->input->post('rang');
+ if($this->input->post('jelszo1') != "")
+ $mod['jelszo'] = md5($this->input->post('jelszo1'));
+ $mod['viewsub'] = ($this->input->post('viewsub') == "on") ? 1 : 0;
+
+ $this->db->update('forum_user',$mod,"user_id={$uid}");
+ //$this->mforum->set_user($this->input->post('uid'),$this->input->post('nev'),$this->input->post('email'),$this->input->post('jelszo1'),$this->input->post('login'),$this->input->post('rang'));
+
+ redirect("forum/users");
+ }else{
+
+
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználó szerkesztése' : $data['title'] = 'ARCHLine.XP Forum Edit User';
+ $data['tartalom']='forum/edit_user';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+
+ $login = $this->mforum->get_login($uid);
+ $data['adatok'] = $this->mforum->get_user($login);
+
+ $szemadatok = $this->mforum->get_user_szem($login);
+
+ if($szemadatok[0])
+ $data['szemadat'] = $szemadatok[0];
+ else{
+ $cucc = $this->mforum->get_user_alap($login);
+ $data['szemadat'] = $cucc[0];
+ }
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+
+ $i=0;
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $i++;
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+ $kulcsok[$key_kulcs]->programok = $programs;
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+ $data['error'] = $error;
+ $data['hibak2'] = $langerror;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+
+ print " ";
+ }
+
+ $ezt = "edit_user/".$uid;
+ header("Location: ".$ezt);
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujuser(){
+ $user = $this->phpsession->get('fuser');
+ if($user && $this->mforum->moderator($user['name'])){
+ if($this->input->post('do')!=false){
+ $login = $this->input->post('login');
+ $nev = $this->input->post('nev');
+ $jsz1 = $this->input->post('jelszo1');
+ $jsz2 = $this->input->post('jelszo2');
+ $email = $this->input->post('email');
+ $kulcs = $this->input->post('kulcs');
+ $rang = $this->input->post('rang');
+
+ if($kulcs)
+ $nUserID = $this->mforum->get_nUserID($kulcs);
+ else
+ $nUserID = "NULL";
+
+ $error = "";
+ $langerror = array();
+
+ if( $login == "" )
+ $error .= "Nincs login megadva.
";
+
+ if( $login != $this->ekezet($login) )
+ $error .= "A felhasználó névben nem lehet ékezet vagy szóköz.
";
+ elseif( !$this->mforum->szabadlogin($login,10000) )
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+
+ if( $jsz1 == "" || $jsz2 == "" || $jsz1 != $jsz2 )
+ $error .= "A két jelszó nem egyezik vagy nincsenek megadva.
";
+
+ if( $this->mforum->is_email($email) )
+ $error .= "A megadott e-mail-cím már szerepel az adatbázisban.
";
+
+ if(!$error){
+ $this->mforum->ujuser($login,$nev,$jsz1,$email,$nUserID,$rang);
+
+ redirect('forum/users');
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új felhasználó' : $data['title'] = 'ARCHLine.XP Forum new user';
+ $data['tartalom']='forum/ujuser';
+ $data['csik']=array('home','forum');
+ $data['error2'] = $error;
+ $data['moderator']=true;
+ $data['javascript']=array('forum');
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }
+
+ }else{
+ $data['title'] = 'ARCHLine.XP Fórum új felhasználó';
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Új Felhasználó' : $data['title'] = 'ARCHLine.XP Forum New User';
+ $data['tartalom']='forum/ujuser';
+ $data['csik']=array('home','forum');
+ $data['javascript']=array('forum');
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function del_user(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ $id = $this->uri->segment(3);
+ $this->mforum->del_user($this->uri->segment(3));
+ redirect("forum/users");
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujuserdb(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+
+
+
+
+ $this->access_id = 36;
+
+ $this->load->model('mpartners');
+ $this->keydb = $this->load->database('clusers',true);
+ $search = false;//$this->input->post('search');
+
+ $from = 0;
+ $to = 999999;
+ $limit = 2000;
+
+ $this->keydb->query("SET NAMES utf8");
+ $result = $this->keydb->from('cl_fo_hardlock')->join('cl_users','cl_fo_hardlock.hlUser=cl_users.nUserID','left')->orderby('hlNum','desc')->where("hlCtrID ='".$this->access_id."'")->where('hlStat',1)->where("hlNum >= '".$from."' AND hlNum <= '".$to."'")->limit(99999)->get();
+
+ //$sorok = $result->result();
+
+
+
+
+
+ $query = $this->keydb->from('cl_fo_hardlock')->join('cl_users','cl_fo_hardlock.hlUser=cl_users.nUserID','left')->join('cl_users_emails','cl_users.nUserID=cl_users_emails.nUserID','left')->orderby('hlNum','desc')->where("hlCtrID ='".$this->access_id."'")->where('hlStat',1)->where('default',1)->where("hlNum >= '".$from."' AND hlNum <= '".$to."'")->limit(99999)->get();
+ $sorok = $query->result();
+
+
+ //$this->keydb->query("SET NAMES latin2");
+
+
+
+
+ if($result->num_rows()==0)
+ {
+ $data['sorok'] = false;
+ }
+ else
+ {
+ $data['sorok'] = $sorok;
+ $data['found'] = $result->num_rows();
+ }
+
+ $sorok2 = $sorok;
+ $i = 0;
+ $j = 0;
+ $db = 0;
+ foreach($sorok2 as $sor){
+ $mailek = $sor->email;
+ $mailek = explode(";",$mailek);
+
+ foreach( $mailek as $mail ){
+ $mail = trim($mail);
+
+ //megnezzuk hogy benne van-e az adatbázisban és aktív-e
+ if( $mail != "" && $sor->hlStat == 1 && !$this->mforum->is_email(strtolower($mail)) ){
+ $mailresz = explode('@',$mail);
+ $login = $mail;
+ $nev = $sor->strName;
+ $nev = trim($nev);
+ $jsz1 = $mailresz[0];
+ $nUserID = $sor->nUserID;
+ $rang = "user";
+
+ // eladási dátum 0000-00-00 -e
+ $datum = $this->keydb->from('cl_fo_programs')->where("prHlNum",$sor->hlNum)->select('prSellDate')->get()->row();
+ if($datum->prSellDate != '0000-00-00'){
+ $this->mforum->ujuser($login,$nev,$jsz1,strtolower($mail),$nUserID,$rang);
+ $db++;
+ $kik[$j]->Nev = $nev;
+ $kik[$j]->Login = $login;
+ $kik[$j]->Email = $mail;
+ $kik[$j]->Datum = $datum->prSellDate;
+ }
+ $j++;
+ }
+ }
+ $i++;
+ }
+ $data['darab'] = $db;
+ $data['kik'] = $kik;
+
+
+
+ $data['sorok2'] = $sorok2;
+
+
+
+
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $this->load->view('site_forum',$data);
+ }else
+ redirect('forum');
+ }
+
+ function myedit(){
+ $tomb = $this->phpsession->get('fuser');
+
+ if(!$tomb) $tomb = $this->phpsession->get('feltolto');
+
+ if( $tomb ){
+ if($this->input->post('mysave')!=false){
+
+ $error = "";
+ $langerror = array();
+ if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') != $this->input->post('jelszo2') ){
+ $error .= "A megadott két jelszó nem egyezik.
";
+ array_push($langerror,0);
+ }else if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') == $this->input->post('jelszo2') && strlen($this->input->post('jelszo1') ) < 5 ){
+ $error .= "A megadott jelszó 5 karakternél rövidebb.
";
+ array_push($langerror,1);
+ }
+
+ $user = $tomb['name'];
+ $myid = $this->mforum->get_userid($user);
+
+ if( $this->input->post('login') == "" ){
+ $error .= "A login mező értéke nem lehet üres.
";
+ array_push($langerror,4);
+ }
+
+ if( $this->input->post('login') != "" && !$this->mforum->szabadlogin($this->input->post('login'),$myid) ){
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+ array_push($langerror,2);
+ }
+ elseif( strlen($this->input->post('login') ) < 5 ){
+ $error .= "A megadott login 5 karakternél rövidebb.
";
+ array_push($langerror,3);
+ }
+
+ if( $this->input->post('login') != $this->ekezet($this->input->post('login')) ){
+ $error .= "A felhasználó névben nem szerepelhet ékezet vagy szóköz!
";
+ array_push($langerror,5);
+ }
+
+
+ $ertesitesek = $this->input->post('temak');
+ if(count($ertesitesek) == 0 || (count($ertesitesek) == 1 && $ertesitesek[0] == "") )
+ $ertesit = NULL;
+ elseif( count($ertesitesek) == count($this->mforum->get_temak()) )
+ $ertesit = "mind";
+ else
+ $ertesit = ";".implode(";", $ertesitesek).";";
+
+
+ if($error){
+ hun() ? $data['title'] = 'ARCHLine.XP Adatok változtatása' : $data['title'] = 'ARCHLine.XP Edit Data';
+ $data['tartalom']='forum/myedit';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+ $data['error2'] = $error;
+ $data['hibak2'] = $langerror;
+
+ $user = $tomb['name'];
+ $user_id = $this->mforum->get_userid($user);
+ $data['user_id'] = $user_id;
+ $data['cucc'] = $this->mforum->get_user_alap($user);
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }else{
+ $plogin = $this->input->post('login');
+ $pnev = $this->input->post('nev');
+ $pjelszo = $this->input->post('jelszo1');
+
+ $this->mforum->myedit($plogin, $pnev, $pjelszo, $myid, $ertesit);
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['t_nev'] = $this->mforum->get_nev($plogin);
+ $fuser['name'] = $this->input->post('login');
+ $this->phpsession->save('fuser',$fuser);
+ $this->myuser();
+ }
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Adatok változtatása' : $data['title'] = 'ARCHLine.XP Edit Data';
+ $data['tartalom']='forum/myedit';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ if(hun())
+ $nyelv = "hun";
+ else
+ $nyelv = "eng";
+
+ $user = $tomb['name'];
+ $user_id = $this->mforum->get_userid($user);
+ $data['user_id'] = $user_id;
+ $data['temak'] = $this->mforum->get_temak($nyelv);
+ $data['cucc'] = $this->mforum->get_user_alap($user);
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujjelszo(){
+ if($this->input->post('kuld')!=false){
+ $email = $this->input->post('email');
+ if(hun()) $uzenet = "A megadott e-mail-cím: " . $email;
+ //$uzenet = $email;
+
+ $ujjelszo = $this->mforum->ujjelszo($email);
+
+ if($ujjelszo){
+
+ $this->load->library('email');
+ $this->load->helper('email');
+ $this->email->initialize();
+ $this->email->addOfficialImages();
+
+ $mailnek->ujjsz = $ujjelszo;
+ $mailnek->login = $this->mforum->get_login2($email);
+
+
+ /* Akarmilyem mailcimet is adott meg, a default emailre kuldjuk a levelet */
+ $email2 = $this->mforum->default_mail($email);
+ if($email2 != "")
+ $email = $email2;
+
+
+ $this->email->from('info@cadline.hu', 'Cadline Weboldal');
+ if(hun())
+ $this->email->subject('Uj jelszo');
+ else
+ $this->email->subject('New Password');
+ $this->email->message($this->load->view('mail_ujjelszo',$mailnek,true));
+ $this->email->send($email,'smtp');
+
+ if(hun())
+ $uzenet = $email." -ra kiküldtük az Ön új jelszavát.
";
+ else
+ $uzenet = "New password sent to ".$email;
+
+ }else{
+ if(hun()) $uzenet .= " nincs a felhasználók között.
";
+ else $uzenet = "E-mail error: ".$email;
+ }
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új jelszó' : $data['title'] = 'ARCHLine.XP Forum new password';
+
+ $data['uzenet']=$uzenet;
+ $this->phpsession->save('fuzenet',$uzenet);
+
+ if( isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'],'/collection/') ){
+ $data['tartalom']='collection/ujjelszo_valasz';
+ $data['style'] = array('temp/style_new');
+ $this->load->view('site_upload',$data);
+ }
+ else{
+ /*$data['tartalom']='forum/temakorok';
+ $data['csik']=array('home','forum');
+ $this->load->view('site_forum',$data);*/
+ redirect('forum');
+ }
+
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új jelszó' : $data['title'] = 'ARCHLine.XP Forum new password';
+
+ $data['tartalom']='forum/ujjelszo';
+ $data['csik']=array('home','forum');
+
+ if( isset($_SERVER['HTTP_REFERER']) && (strstr($_SERVER['HTTP_REFERER'],'collection/upload') || strstr($_SERVER['HTTP_REFERER'],'collection/submit')) ){
+ $data['style'] = array('temp/style_new');
+ $this->load->view('site_upload',$data);
+ }
+ else{
+ $this->load->view('site_new',$data);
+ }
+ }
+ }
+
+ function szabalyzat(){
+ if(hun())
+ $lap = $this->mpages->get_row(454);
+ else
+ $lap = $this->mpages->get_row(559);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum szabályzat' : $data['title'] = 'ARCHLine.XP Forum Rules';
+ $data['tartalom'] = '/forum/szabalyzat';
+ $data['lap'] = $lap;
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $uid = $this->mforum->get_userid($user['name']);
+ //ha még nem fogadta el a szabályzatot:
+ if( !($this->mforum->szabalyzat($uid) ) ){
+ $data['uid'] = $uid;
+ $data['nemelfogad'] = true;
+ }
+
+ $data['aktmenu'] = "2";
+ $this->load->view('site_forum',$data);
+ }
+
+ function elfogad(){
+ if($this->input->post('el')=="igen"){
+ $this->load->model('mclusers');
+
+ $uid = $this->input->post('uid');
+ $name = $this->input->post('fnev');
+ $passwd = $this->input->post('jelszo');
+ if( $this->mforum->belep($name,$passwd,false) ){
+ $this->mforum->elfogad($uid);
+
+ $felhasznalo = $this->mforum->getrow($uid);
+ if($felhasznalo->nUserID > 0 && $felhasznalo->nyelv == "hun")
+ $this->mclusers->addEvent($felhasznalo->nUserID, 109, 'Elso bejelentkezes a forumba.', "hun");
+ elseif( $felhasznalo->nUserID > 0 && $felhasznalo->nyelv == "eng" )
+ $this->mclusers->addEvent($felhasznalo->nUserID, 148, 'Elso bejelentkezes a forumba.', "eng");
+
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$this->mforum->get_login($uid);
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+
+ $fuser['user_id'] = $uid;
+
+ $this->phpsession->save('fuser',$fuser);
+ $Date = date('Y-m-d',time());
+
+ $nUserID = $this->mforum->get_nUserID2($uid);
+ }
+
+ redirect('forum');
+
+ }else{
+ $this->logout();
+ }
+ }
+
+ function ido(){
+ die(date('Y-m-d H:i:s', time()));
+ }
+
+ function emailjavitas(){
+ $tomb = $this->phpsession->get('fuser');
+ if(!$tomb)
+ redirect('forum');
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+
+ $cl_users = $this->mforum->get_cl_users();
+
+ $db = 0;
+ $cserek = "";
+ foreach($cl_users as $user){
+ $nUserID = $user->nUserID;
+ //print $user->strName;
+ $x = $this->mforum->cseremail($nUserID);
+ if( $x ){
+ $cserek .= $x;
+ $db++;
+ }
+ }
+
+ $data['email']=$db;
+ $data['cserek']=$cserek;
+
+
+
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function ujuserdb_eng(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $sorok = $this->mforum->get_cl_users_eng();
+
+ $i = 0;
+ $j = 0;
+ $db = 0;
+ foreach($sorok as $sor){
+ $mailek = $sor->strEMail;
+ $mailek = explode(";",$mailek);
+
+ foreach( $mailek as $mail ){
+ /* csak az elso email cimet veszi fel */
+ $mail = trim($mailek[0]);
+
+
+ //megnezzuk hogy benne van-e az adatbázisban és aktív-e
+ if( $mail != "" && $sor->hlStat == 1 && !$this->mforum->is_email(strtolower($mail)) ){
+ $mailresz = explode('@',$mail);
+ $login = $mail;
+ $nev = $sor->strName;
+ $nev = trim($nev);
+ $jsz1 = $mailresz[0];
+ $nUserID = $sor->nUserID;
+ $rang = "user";
+
+
+ // eladási dátum 0000-00-00 -e
+ $datum = $this->db->from('`clusers_eng`.`cl_fo_programs`')->where("prHlNum",$sor->hlNum)->select('prSellDate')->get()->row();
+
+ $prog = $this->db->query(" SELECT * FROM `clusers_eng`.`cl_fo_programs` WHERE prHlNum = '".$sor->hlNum."'")->result();
+
+ if($datum->prSellDate != '0000-00-00' && $this->mforum->szabadlogin($login) ){
+ $this->mforum->ujuser_eng($login,$nev,$jsz1,strtolower($mail),$nUserID,$rang);
+
+ // print "
Felvenném: ".$login.$nev.$jsz1.strtolower($mail).$nUserID.$rang;
+
+ $db++;
+ $kik[$j]->Nev = $nev;
+ $kik[$j]->Login = $login;
+ $kik[$j]->Email = $mail;
+ $kik[$j]->Datum = $datum->prSellDate;
+ }
+ $j++;
+ }
+ }
+ $i++;
+ }
+ $data['darab'] = $db;
+ $data['kik'] = $kik;
+
+ $data['sorok2'] = $sorok;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function info($info){
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/kiir';
+ $data['info'] = $info;
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function galeria(){
+ $user = $this->phpsession->get('fuser');
+
+ if( is_numeric($this->uri->segment(3)) ){
+ $this->galeriamutat();
+ }elseif($user){
+ $this->sajatgaleria();
+ }else{
+ redirect("forum");
+ }
+ }
+
+ function galeriamutat(){
+ $user_id = $this->uri->segment(3);
+ $lang = $this->muser->user['lang'];
+
+ $fajlok = $this->mforum->get_galeria($user_id,$lang);
+
+ $data["fajlok"] = $fajlok;
+ if(hun())
+ $data['utvonal'] = $this->galeria_utvonal.$user_id;
+ else
+ $data['utvonal'] = $this->galeria_utvonal_eng.$user_id;
+
+ $data['tartalom'] = '/forum/galeria';
+ $data['javascript'] = array(
+ 'interior_menu',
+ 'fancybox/jquery-1.3.2.min',
+ 'fancybox/jquery.easing.1.3',
+ 'fancybox/jquery.fancybox-1.2.1.pack',
+ 'fancybox/fancy'
+ );
+
+ $data['style'] = array('fancybox');
+
+ $this->load->view('site_forum',$data);
+
+ }
+
+ function sajatgaleria(){
+ $this->load->model('mrender');
+ $user = $this->phpsession->get('fuser');
+
+ if($user){
+ hun() ? $data['title'] = 'ARCHLine.XP Saját Galéria' : $data['title'] = 'ARCHLine.XP My Gallery';
+ $data['tartalom'] = '/forum/sajatgaleria';
+
+ $uid = $user['user_id'];
+ $data['uid'] = $uid;
+
+ $data['fajlok'] = $this->mforum->fajlok($uid);
+ $data['szabad_hely'] = (200 * 1024 * 1024) - $this->foglalt_hely($uid);
+
+ // $data['renderek'] = $this->mrender->get_byuserid($uid);
+
+ $data['javascript'] = array('fancybox/jquery-1.3.2.min','fancybox/jquery.easing.1.3','fancybox/jquery.fancybox-1.2.1.pack','fancybox/fancy','jquery','jquery_ui');
+ $data['style'] = array('fancybox2','jquery.ui');
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "5";
+ $this->load->view('site_forum',$data);
+ }else
+ redirect("forum");
+ }
+
+ function foglalt_hely($user_id){
+ if(hun())
+ $fajlok = $this->galeria_utvonal.$user_id."/";
+ else
+ $fajlok = $this->galeria_utvonal_eng.$user_id."/";
+
+ $total = 0;
+
+ if( is_dir($fajlok) ){
+ $handle = opendir($fajlok);
+ while($file = readdir($handle)){
+ $total += filesize($fajlok.$file);
+ if((is_dir($fajlok.$file.'/')) &&($file != '..')&&($file != '.'))
+ {
+ $total = $total + $this->foglalt_hely($fajlok.$file.'/');
+ }
+ }
+ }
+
+ return $total;
+ }
+
+ function feltolt(){
+ $user = $this->phpsession->get('fuser');
+ $uid = $user['user_id'];
+
+ if($uid && $_FILES["fajl"]["error"]==0){
+
+ $fajl = "";
+ $meret = 0;
+
+ if(hun())
+ $hova = $this->galeria_utvonal.$uid;
+ elseif(eng())
+ $hova = $this->galeria_utvonal_eng.$uid;
+
+ if(!is_dir($hova)){
+ mkdir($hova,0644);
+ chmod($hova,0777);
+ }
+
+
+ $feltolt_konyvtar = $hova."/";
+ //ha több fájl lenne ugyanazon a néven
+ $elotag = substr(time(),-6);
+ $fajlnev = $this->ekezet($_FILES["fajl"]["name"]);
+ $feltolt_fajlnev=$feltolt_konyvtar . $elotag . "__" . $fajlnev;
+
+ $error = "";
+ $mi = $_FILES['fajl']['name']."$";
+
+ $mire = "\.exe|\.EXE|\.php|\.PHP|\.sh|\.SH";
+ if( (ereg( $mire , $mi )) ){
+ $error .= "Hibás fájl kiterjesztés
";
+ }
+ if( $_FILES['fajl']['size'] > 1024 * 1024 * 10 ){
+ $error .= "A fájl mérete nagyobb 10 MB-nál.
";
+ }
+ else if( !$error){
+ if (copy($_FILES["fajl"]["tmp_name"], $feltolt_fajlnev)){
+ $fajl = $elotag . "__". $fajlnev;
+ $meret = $_FILES["fajl"]["size"];
+ $mit = $hova."/".$fajl;
+ chmod($mit,0777);
+
+
+ // elonezeti kep elkeszitese 150x113-ban
+ include('application/helpers/myimg_helper.php');
+ kepmeretezesvagas($feltolt_fajlnev,$hova,"elo_".$fajl,"150","113");
+
+ }else{
+ $fajl = "NULL";
+ $error = "Fájl másolás hiba.
";
+ }
+ }
+
+ if( !$error ){
+ $szamla = $this->input->post('szamla');
+ $info = $this->input->post('leiras');
+ $megoszt = 1;
+
+ if( $this->input->post('megosztas') != "on" ){
+ $megoszt = 0;
+ }
+
+ $this->mforum->feltolt($uid,$fajl,$meret,$szamla,$megoszt,$info);
+
+ redirect("forum/galeria/".$uid);
+ }else{
+ $this->info($error);
+ }
+
+
+ }else{
+ if( $_FILES['fajl']['error'] != 0 )
+ $this->info("Hiba a fájl feltöltésekor!");
+ else
+ redirect("forum");
+ }
+
+ }
+
+ function delfajl(){
+ $fajl_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ $user_id = $user['user_id'];
+
+ if(!$user)
+ redirect('forum');
+
+ if( is_numeric($fajl_id) && $this->mforum->sajatfajl($fajl_id, $user_id) ){
+ $this->load->model('mrender');
+
+ $fajl = $this->mforum->delfajl($fajl_id);
+
+ if(hun())
+ $mit = "public/forum-galeria/hun/".$user_id."/elo_".$fajl;
+ else
+ $mit = "public/forum-galeria/eng/".$user_id."/elo_".$fajl;
+
+ // elonezeti kep torlese ha van
+ if( file_exists( $mit ) ){
+ chmod($mit, 777);
+ unlink($mit);
+ }
+
+ // A fájlhoz tartozó rendereknél törölni a galériás fájl id-t.
+ $renderek = $this->mrender->get_rowBygforumgalid($fajl_id);
+ if( $renderek ){
+ foreach($renderek as $render){
+ $ertek = NULL;
+ $this->db->update('render_img',array('forumgal_id'=>$ertek),"render_id='".$render->render_id."'");
+ }
+ }
+ }
+ redirect("forum/galeria");
+ }
+
+ function editgaleria(){
+ $fajl_id = $this->input->post('fajl_id');
+ // $fajl_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ $user_id = $user['user_id'];
+
+ if(!$user)
+ redirect('forum');
+
+
+ if( is_numeric($fajl_id) && $this->mforum->sajatfajl($fajl_id, $user_id) ){
+ if( $this->input->post('do') ){
+ $leiras = $this->input->post('leiras');
+ $megoszt = 1;
+
+ if( $this->input->post('megosztas') != "on" ){
+ $megoszt = 0;
+ }
+
+ $this->mforum->editgaleria($fajl_id,$leiras,$megoszt);
+
+ redirect("forum/galeria");
+
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Saját Galéria' : $data['title'] = 'ARCHLine.XP My Gallery';
+ $data['tartalom'] = '/forum/editgaleria';
+
+ $data['uid'] = $user_id;
+ $data['fajlinfo'] = $this->mforum->fajlinfo($fajl_id);
+ if(hun())
+ $data['utvonal'] = $this->galeria_utvonal;
+ else
+ $data['utvonal'] = $this->galeria_utvonal_eng;
+
+ $data['utvonal'] .= "/".$user_id;
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "5";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect("forum");
+ }
+ }
+
+ function regisztracio(){
+ if($this->input->post('do') != ""){
+ $nev = $this->input->post('regnev');
+ $login = $this->input->post('email');
+ $email = $login;
+ $jelszo = $this->input->post('jelszo1');
+
+ $szabad = $this->mforum->szabadlogin($login,999999);
+ if( $szabad ){
+ //$this->mforum->ujuser($login,$nev,$jelszo,$email,"","feltolto");
+
+
+ $kod = md5($jelszo.time().$nev);
+
+ $record['login'] = $email;
+ $record['jelszo'] = md5($jelszo);
+ $record['nev'] = $nev;
+ $record['email'] = $email;
+ $record['rang'] = "guest";
+ $record['kod'] = $kod;
+ $record['datum'] = date("Y-m-d H:i:s",time());
+ $record['nyelv'] = $this->muser->user['lang'];
+
+ $this->db->insert('forum_user_temp',$record);
+
+
+ $this->load->helper('email');
+
+ //sending the e-mail
+ $mail_vars['kod'] = $kod;
+ $mail_vars['email'] = $email;
+ $mail_vars['first'] = $nev;
+
+ //set the authenticating link
+ $mail_vars['link'] = hun() ? 'http://archline.hu/forum/confirm/' . $kod : 'http://www.archlinexp.com/forum/confirm/' . $kod;
+
+ //setting and sending the email
+ $this->load->library('email');
+ $this->email->initialize();
+ $this->email->addOfficialImages();
+
+ $this->email->setFrom('info@cadline.hu', 'CadLine');
+
+ if(hun())
+ {
+ $mail_vars['mailcontent'] = 'mail/confirm_forum_hun';
+ $this->email->subject('ARCHLine.XP regisztráció');
+ }
+ else
+ {
+ $mail_vars['mailcontent'] = 'mail/confirm_forum_eng';
+ $this->email->subject('ARCHLine.XP registration');
+ }
+
+ $this->email->message($this->load->view('mail',$mail_vars,true));
+ $this->email->send($mail_vars['email'],'smtp');
+
+ redirect('forum/sentconf');
+ }
+ else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/regisztracio';
+ $data['javascript'] = array('forum');
+ $data['style'] = array('temp/style_interior');
+ $data['foglalt'] = "igen";
+
+ $this->load->view('site_upload',$data);
+ }
+ }else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/regisztracio';
+ $data['javascript'] = array('forum');
+ $data['style'] = array('temp/style_interior');
+
+ $this->load->view('site_upload',$data);
+ }
+ }
+
+ function sentconf(){
+ $data['tartalom']='forum/sentconf';
+ $data['lang']=$this->muser->user['lang'];
+ $data['style'] = array('temp/style_new');
+
+ $this->load->view('site_upload',$data);
+ }
+
+ function confirm(){
+ $kod = $this->uri->segment(3);
+
+ $data['style'] = array('temp/style_new');
+
+ if( $this->mforum->confirm($kod) ){
+
+ /* a felhasználóhoz új eseményt felvenni, ha szerepel az adatbázisban */
+ $adatok = $this->mforum->get_userByKod($kod);
+ $nUserID = $this->mforum->get_nUserID30($adatok->email);
+ if( $nUserID ){
+ $this->load->model('mclusers');
+ $this->mclusers->addEvent($nUserID, 114, "Regisztráció");
+ }
+
+ $data['tartalom']='forum/confirm_ok';
+ $data['lang']=$this->muser->user['lang'];
+ }else{
+ $data['tartalom']='forum/confirm_hiba';
+ $data['lang']=$this->muser->user['lang'];
+ }
+
+ $this->load->view('site_upload',$data);
+ }
+
+ function belepfeltolto(){
+ if( $this->input->post("do") != "" ){
+ $login = $this->input->post("email");
+ $jelszo = $this->input->post("jelszo");
+
+ if( $this->mforum->belep($login,$jelszo) ){
+ print "ok";
+ }else
+ print "nem ok";
+
+ }else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/belepfeltolto';
+ $data['javascript'] = array('forum');
+
+ $this->load->view('site',$data);
+ }
+ }
+
+ function renderek(){
+ $this->load->model('mrender');
+ $user = $this->phpsession->get('fuser');
+ $feltolto = $this->phpsession->get('feltolto');
+
+ if($user){
+ $uid = $user['user_id'];
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ }elseif($feltolto){
+ $uid = $feltolto['user_id'];
+ }
+ else
+ redirect("forum");
+
+ hun() ? $data['title'] = 'ARCHLine.XP Renderek' : $data['title'] = 'ARCHLine.XP Renders';
+ $data['tartalom'] = '/forum/renderek';
+
+ $data['uid'] = $uid;
+
+ $renderek = $this->mrender->get_byuserid($uid);
+
+ if($renderek){
+ foreach($renderek as $render){
+ if($render->allapot=='1' && file_exists($render->keszkep)){
+ list($width, $height) = getimagesize($render->keszkep);
+ $render->kepmeret = $width . " x ". $height;
+ }
+ else{
+ $render->kepmeret = '-';
+ }
+ }
+ }
+
+ $data['renderek'] = $renderek;
+
+ $data['onload'] = "betolt()";
+
+ $data['javascript'] = array('fancybox-1.3.4/fancybox/jquery-1.4.3.min','fancybox/jquery.easing.1.3','fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack','jquery_ui','plugin/jquery.maskedinput-1.2.2','plugin/jquery.maskedinput-1.2.2.min');
+ $data['style'] = array('jquery.fancybox-1.3.4','jquery.ui');
+ $data['aktmenu'] = "6";
+ $this->load->view('site_forum',$data);
+
+ unset($_SESSION['webrender']); // ne legyenek meg a render beallitasanal a default ertekek
+ }
+
+ function delrender(){
+ $this->load->model('mrender');
+
+ $render_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ if(!$user)
+ $user = $this->phpsession->get('feltolto');
+
+ if(!$user)
+ redirect('forum');
+
+ $render = $this->mrender->get_row($render_id);
+
+ if( is_numeric($render_id) && $render->user_id == $user['user_id'] ){
+ $this->mrender->del($render_id);
+ }
+
+ header("Location: ".$_SERVER["HTTP_REFERER"]);
+ }
+
+ function rendercopy(){
+ $this->load->model('mrender');
+
+ $guid = $this->uri->segment(3);
+ $render = $this->mrender->get_rowByguid($guid);
+
+ if( is_numeric($render->render_id) ){
+ if( $this->muser->user['lang'] == "hun" )
+ $almappa = "hun";
+ else
+ $almappa = "eng";
+
+ $uid = $render->user_id;
+
+ $helye = "public/forum-galeria/".$almappa."/".$uid;
+
+ if(!is_dir($helye)){
+ mkdir($helye,0644);
+ chmod($helye,0777);
+ }
+
+ $fajluj = basename($render->keszkep);
+
+ $honnan = $render->keszkep;
+ $hova = $helye."/".$fajluj;
+
+ if( copy($honnan,$hova) ){
+ $meret = filesize($hova);
+ $this->mforum->feltolt($render->user_id,$fajluj,$meret,"","1",$render->render_name,$render->nyelv);
+ $fajl_id = mysql_insert_id();
+ $this->db->update('render_img',array('forumgal_id'=>$fajl_id),"render_id='".$render->render_id."'");
+
+ $uzenet = array(4);
+ $this->phpsession->save('fuzenet',$uzenet);
+
+ // elonezeti kep masolasa is ha van
+ $fajlnev = basename($render->keszkep);
+ $mappak = substr( $render->keszkep,0,(-1*(strlen($fajlnev))) );
+ $elokep = $mappak."elo_".$fajlnev;
+ if(file_exists($elokep)){
+ $ujelokep = $helye."/elo_".$fajlnev;
+ copy($elokep,$ujelokep);
+ }
+ }else{
+ $uzenet = array(14);
+ $this->phpsession->save('fhiba',$uzenet);
+ }
+
+ redirect('forum/renderek');
+ }else{
+ $uzenet = array(14);
+ $this->phpsession->save('fhiba',$uzenet);
+ redirect('forum/renderek');
+ }
+ }
+
+ function renderletolt(){
+ $this->load->model('mrender');
+ $render_id = $this->uri->segment(3);
+ $render = $this->mrender->get_row($render_id);
+
+ $user = $this->phpsession->get('fuser');
+ $feltolto = $this->phpsession->get('feltolto');
+
+ if( isset($render->keszkep) && $render->keszkep != "" && file_exists($render->keszkep) && ( $render->user_id == $user['user_id'] || $render->user_id == $feltolto['user_id'] ) ){
+ $path_parts = pathinfo($render->keszkep);
+ $ext = strtolower($path_parts["extension"]);
+
+ if($render->render_name == "")
+ $render->render_name = "Image";
+
+ header("Content-type: application-download");
+ header('Content-Disposition: attachment; filename="'.$render->render_name.'.'.$ext.'"');
+ readfile($render->keszkep);
+ }else{
+ print "hiba a letoltes kozben";
+ }
+ }
+
+ function myshowroom(){
+ $user = $this->phpsession->get('fuser');
+ $feltolto = $this->phpsession->get('feltolto');
+ if(!$user && !$feltolto)
+ redirect('forum');
+
+ if(!$user)
+ $user = $feltolto;
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['tartalom'] = 'forum/myshowroom';
+
+ $data['title'] = hun() ? 'ARCHLine.XP Saját Bemutatóterem' : 'ARCHLine.XP My Showroom';
+ $uid = $user['user_id'];
+ $data['uid'] = $uid;
+ $data['elemek'] = $this->db->query("SELECT * FROM collection_user WHERE userid={$uid} AND deleted=0")->result();
+
+ $data['aktmenu'] = "5";
+
+ $data['javascript'] = array('fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack','fancybox/fancy');
+ $data['style'] = array('../js/fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4v2');
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function szerver(){
+ print "";
+ print_r($_SERVER);
+ print "\n\n";
+ // print_r($GLOBALS);
+ print "
";
+ }
+
+
+ function downloadbeta32(){
+ $user = $this->fuser;
+ $login = $user['name'];
+ $email = $this->mforum->get_user_alap($login);
+ redirect('events/click/betaletoltes32/'.$email[0]->email);
+ }
+
+ function downloadbeta64(){
+ $user = $this->phpsession->get('fuser');
+ $login = $user['name'];
+ $email = $this->mforum->get_user_alap($login);
+ redirect('events/click/betaletoltes64/'.$email[0]->email);
+ }
+
+
+ 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->ervenydessegazon,"/");
+ setcookie("hash",$_COOKIE['hash'] ,time()+$this->ervenydesseg,"/");
+
+ return true;
+
+ }else{
+ return false;
+ }
+ }
+
+
+}
+
+function hasonlito( $a, $b ){
+ if ( $a->datum == $b->datum )
+ return 0;
+ if ( $a->datum > $b->datum )
+ return -1;
+ return 1;
+}
+
+?>
\ No newline at end of file
diff --git a/var/www/hosting/archlinexp.com/partners/application/controllers/forum.php.evidence.json b/var/www/hosting/archlinexp.com/partners/application/controllers/forum.php.evidence.json
new file mode 100644
index 0000000..5d00236
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/application/controllers/forum.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "5313",
+ "log_excerpt": "[quarantine] partners.archlinexp.com:application/controllers/forum.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/archlinexp.com/partners/application/controllers/forum.php)",
+ "original_sha256": "dc04c2be6ceb85d87c001033e28d9f26e7f0aaff3ca367ba58b66202ac951087",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1553076035,
+ "size": 79090,
+ "uid": 11669
+ },
+ "rel_path": "application/controllers/forum.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..b1336e4
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/application/controllers/forum.php~
@@ -0,0 +1,2602 @@
+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]="/";
+ $mit[2]="/\n/";
+ $mit[3]="/'/";
+ $mit[4]="/=/";
+ $mit[5]="/\"/";
+ $mit[6]="/;/";
+ $mire[0]=">";
+ $mire[1]="<";
+ $mire[2]="
";
+ $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, '
")
+ $error .= "Üres hozzászólás!
";
+
+
+ if ($_FILES["fkep"]["error"]==0 && ($error == "") ){
+ $login = $tomb['name'];
+ $user_id = $this->mforum->get_userid($login);
+ //ha nincs mappája
+ if(hun())
+ $hova = $this->kepek_utvonal.$user_id;
+ elseif(eng())
+ $hova = $this->kepek_utvonal_eng.$user_id;
+
+ if(!is_dir($hova)){
+ //akkor hozza létre
+ mkdir($hova,0644);
+ chmod($hova,0777);
+ }
+ $feltolt_konyvtar = $hova."/";
+ //ha több fájl lenne ugyanazon a néven
+ $rand = rand(100,999);
+ $basefilename = $rand . "__" .$this->ekezet($_FILES["fkep"]["name"]);
+ $feltolt_fajlnev=$feltolt_konyvtar . $basefilename;
+
+ $error = "";
+ $mi = $_FILES['fkep']['name']."$";
+
+ $mire = "\.bmp|\.jpg|\.jpeg|\.png|\.gif|\.tif|\.BMP|\.JPG|\.PNG|\.GIF";
+ if( !(ereg( $mire , $mi )) ){
+ $error .= "Hibás fájl kiterjesztés, elfogadott kiterjesztések: .bmp, .jpg, .png, .gif
";
+ }
+ if( $_FILES['fkep']['size'] > 1024 * 1024 * 10 ){
+ $error .= "A kép mérete nagyobb 10 MB-nál.
";
+ }
+ else if( $hszszoveg != "" && !$error){
+ if (copy($_FILES["fkep"]["tmp_name"], $feltolt_fajlnev)){
+ $kep = $rand . "__". $this->ekezet($_FILES["fkep"]["name"]);
+ $mit = $hova."/".$kep;
+ chmod($mit,0777);
+
+ // elonezeti kep elkeszitese 200x150-ben
+ // include('application/helpers/myimg_helper.php');
+ // @kepmeretezesvagasmax($feltolt_fajlnev,$hova,"elo_".$basefilename,300,300);
+ }else{
+ $kep = "NULL";
+ }
+ }
+ }
+
+ if(!$error){
+ $this->mforum->hszbeszur($hszszoveg,$tema_id,$valasz,$kep);
+
+
+ // ertesitesek kikuldese
+ $this->load->library('email');
+ $this->email->initialize();
+
+ $mail_data['tema'] = $this->mforum->get_cim($tema_id)->cim;
+ $mail_data['user'] = $tomb['name'];
+ $mail_data['hsz'] = $hszszoveg;
+
+ $this->email->message($this->load->view('mail/forum_ujhsz', $mail_data, true));
+ $this->email->from('info@cadline.hu', 'Cadline Weboldal');
+ $this->email->subject('ARCHLine.XP Fórum - Új hozzászólás');
+
+ $kiknek = $this->mforum->ertesites($tema_id);
+ foreach($kiknek as $kinek){
+ $alap = $this->mforum->default_mail($kinek->email);
+ if(!$alap)
+ $alap = $kinek->email;
+
+ if($alap)
+ $this->email->send($alap, 'smtp');
+ }
+ // end ertesitesek kikuldese
+
+
+ $temaid = $this->phpsession->get('tema_id');
+ header("Location: listaz/$temaid");
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='forum/ujhsz';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+ $data['error']=$error;
+ $data['hsz']=$this->input->post('hsz');
+
+ $this->load->view('site_forum',$data);
+ }
+ }else if( $this->phpsession->get('temaid') ){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='forum/ujhsz';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('../editor/fckeditor');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ $this->index();
+ }
+ }
+
+ function valasz(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->uri->segment(3) ){
+ $this->phpsession->save('valasz',$this->uri->segment(3));
+ $id = $this->uri->segment(3);
+ $temaid = $this->mforum->get_temaidByHszid($id);
+ $this->phpsession->save('temaid',$temaid);
+ }
+ if( $tomb ){
+ if( $this->phpsession->get('temaid') ){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='forum/ujhsz';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('../editor/fckeditor');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ $this->index();
+ }
+ }
+
+ function listaz(){
+ $this->phpsession->save('valasz',false);
+ if( !($this->phpsession->get('oldal')) ) $this->phpsession->save('oldal',0);
+ if( $this->uri->segment(3) == 'kov' ) $this->kovetkezo();
+ if( $this->uri->segment(3) == 'elozo' ) $this->elozo();
+
+ if( is_numeric($this->uri->segment(3)) ){
+ $tema_id = $this->uri->segment(3);
+ $this->phpsession->save('temaid',$tema_id);
+// redirect('forum/listaz');
+ }else if($this->phpsession->get('temaid')){
+ $tema_id = $this->phpsession->get('temaid');
+ }else{
+ $tema_id = 0;
+ }
+
+ if(!($tema_id) || !is_numeric($tema_id) || !$this->mforum->is_temaid($tema_id)){
+ redirect('forum');
+ }else{
+ $data['tartalom']='forum/temamutat';
+ $data['csik']=array('home','forum');
+
+
+ if( in_array($tema_id,$this->noindextemak) )
+ $data["noindex"] = true;
+
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ if( !is_numeric($this->uri->segment(4)) )
+ $oldal = $this->phpsession->get('oldal');
+ else{
+ $oldal = $this->uri->segment(4);
+ $this->phpsession->save('oldal',$oldal);
+ }
+ $hszek = $this->mforum->get_lista($tema_id,$oldal);
+ foreach( $hszek as $hsz){
+ if( !($hsz->valasz == "0" || $hsz->valasz == "NULL") ){
+ $vszid = $hsz->valasz;
+ $elozo = $this->mforum->get_hsz($vszid);
+ if( $elozo->user == "" )
+ $elozo = $this->mforum->get_hsz2($vszid);
+ if( isset($elozo->user) && $elozo->user != "0" && $elozo->user != "" ){
+ $hsz->valasz = $elozo->user . ", (" . $elozo->datum . ")";
+ if( $elozo->user == 586 )
+ $hsz->valasz = "Németh Kálmán, (" . $elozo->datum . ")";
+ elseif( $elozo->user == 270 )
+ $hsz->valasz = "Tóth M.Levente, Mészáros Marcel, (" . $elozo->datum . ")";
+ }
+ elseif( $elozo )
+ $hsz->valasz = "[Törölt felhasználó], (" . $elozo->datum . ")";
+ else
+ $hsz->valasz = "-";
+ }
+ //if(!eng()) $hsz->szoveg = $this->csere2($hsz->szoveg);
+ if( strtotime($hsz->datum) < 1282039000) $hsz->szoveg = $this->csere2($hsz->szoveg);
+
+ if( $hsz->user_id == 586 ){
+ $hsz->user = "Németh Kálmán";
+ }elseif( $hsz->user_id == 270 ){
+ $hsz->user = "Tóth M.Levente, Mészáros Marcel";
+ }
+ }
+
+ if( !$hszek ){
+ $data['infok'] = array("2");
+ }else{
+ if( $this->mforum->vanmegoldal($tema_id,$this->phpsession->get('oldal')))
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('oldal') > 0 )
+ $data['elozo'] = true;
+ }
+
+ $data['hszek_json'] = json_encode($hszek);
+
+ $user = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($user['name']) )
+ $data['szerk']=true;
+ $data['temacim'] = $this->mforum->get_cim($tema_id)->cim;
+ $temakor_id = $this->mforum->get_tema1($tema_id)->temakor_id;
+ $data['temakorcim'] = $this->mforum->get_temakor1($temakor_id)->cim;
+ $data['temakorid'] = $temakor_id;
+ $data['tema_id'] = $tema_id;
+ $data['oldalak_szama'] = (int)$this->mforum->get_temaoldal($tema_id);
+ $data['akt_oldal'] = $oldal;
+
+ $data['hozzaszolasok'] = $hszek;
+
+ $data['meta']['keyw'] = $data['temacim'].', ';
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['title'] .= ' - ' . $data['temacim'];
+ $data['meta']['desc'] = hun() ? "ARCHLine.XP fórum, ".$data['temakorcim']." > ".$data['temacim']." téma hozzászólásai, ".($oldal+1).". oldal" : "ARCHLine.XP forum, posts of ".$data['temacim']." topic, ".($oldal+1).". page";
+
+ $data['aktmenu'] = "1";
+ $data['style'] = array('jquery.ui','fancybox2');
+ $data['javascript'] = array('../editor/fckeditor','jquery_ui'/*,'fancybox/jquery-1.3.2.min','fancybox/jquery.easing.1.3'*/,'fancybox/jquery.fancybox-1.2.1.pack','fancybox/fancy');
+ $this->load->view('site_forum',$data);
+ }
+
+ }
+
+ function kovetkezo(){
+ $oldalszam = $this->phpsession->get('oldal');
+ if( $this->mforum->vanmegoldal($this->phpsession->get('temaid'),$oldalszam)){
+ $oldalszam++;
+ }
+ $this->phpsession->save('oldal',$oldalszam);
+ }
+
+ function elozo(){
+ $oldalszam = $this->phpsession->get('oldal');
+ if( $oldalszam > 0 )
+ $oldalszam--;
+ $this->phpsession->save('oldal',$oldalszam);
+ }
+
+ 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 login(){
+ $name = $this->input->post('name');
+ $passwd = $this->input->post('passwd');
+
+ $name = mysql_escape_string($name);//$this->csere($name);
+
+ if(!$passwd || !$name)
+ {
+ $this->belephiba(9);
+ }
+ else
+ {
+ $name2 = $this->ekezet($name);
+ $vanaktiv = $this->mforum->vanaktivprog($name);
+
+ if( ($this->mforum->belep($name,$passwd) || $this->mforum->belep($name2,$passwd))
+ && $vanaktiv )
+ {
+ $uid = $this->mforum->get_userid($name);
+ if( !$uid || !is_numeric($uid) ){
+ $this->belephiba(6);
+ }else{
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$name;
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+ $fuser['rang'] = $this->mforum->get_rang($uid);
+ $rang = $fuser['rang'];
+ }
+
+
+
+
+ // ha csak feltolto
+ if( $rang != "user" && $rang != "moderator" ){
+ $fuser['user_id'] = $uid;
+
+ // webrenderbe is beléptetni
+ $sessid=md5($name.time());
+ $hash=md5($name . $this->pw . $sessid);
+ setcookie("sessid",$sessid,time()+$this->ervenydesseg,"/");
+ setcookie("azonosito", $name, time()+$this->ervenydesseg,"/");
+ setcookie("hash",$hash,time()+$this->ervenydesseg,"/");
+
+ $this->phpsession->save('feltolto',$fuser);
+ $this->belephiba(8);
+ }
+ //ha még nem fogadta el a szabályzatot:
+ elseif( !($this->mforum->szabalyzat($uid) ) ){
+ if(hun())
+ $lap = $this->mpages->get_row(454);
+ else
+ $lap = $this->mpages->get_row(559);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum szabályzat' : $data['title'] = 'ARCHLine.XP Forum Rules';
+ $data['tartalom'] = '/forum/szabalyzat';
+ $data['lap'] = $lap;
+ //$user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($name))
+ $data['moderator']=true;
+
+ //ha még nem fogadta el a szabályzatot:
+ if( !($this->mforum->szabalyzat($uid) ) ){
+ $data['uid'] = $uid;
+ $data['login'] = $name2;
+ $data['pw'] = md5($passwd);
+ $data['nemelfogad'] = true;
+ $data['infok'] = array("0");
+ }
+
+ $this->load->view('site_forum',$data);
+ }
+ else{
+ $fuser['user_id'] = $uid;
+ $this->phpsession->save('fuser',$fuser);
+
+
+ // webrenderbe is beléptetni
+ $sessid=md5($name.time());
+ $hash=md5($name . $this->pw . $sessid);
+ setcookie("sessid",$sessid,time()+$this->ervenydesseg,"/");
+ setcookie("azonosito", $name, time()+$this->ervenydesseg,"/");
+ setcookie("hash",$hash,time()+$this->ervenydesseg,"/");
+
+ redirect('forum');
+ }
+ }else{
+ if( $name == "moderator" ){
+ $szam = date(W);
+ $this->mforum->jelszovaltmod($szam);
+ if( $this->mforum->belep($name,$passwd) ){
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$name;
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+ $uid = $this->mforum->get_userid($name);
+ $fuser['user_id'] = $uid;
+ $this->phpsession->save('fuser',$fuser);
+ redirect('forum');
+ }
+ }
+
+ if( !$vanaktiv )
+ $this->belephiba(7);
+ else{
+ $this->belephiba(6);
+ }
+ }
+ }
+ }
+
+ function belephiba($szoveg){
+ $data['tartalom']='forum/temakorok';
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['csik']=array('home','forum');
+
+ if( !is_numeric($szoveg) ){
+ $data['error'] = $szoveg;
+ }
+ else{
+ $data['error'] = array($szoveg);
+ }
+
+ $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;
+ $tema->rov_cim = $tema->cim;
+
+ /*if(strlen($tema->cim) > 26){
+ $ut26 = array($cim[26]);
+ $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")
+ $tema->utolsouser = $this->mforum->get_userUid($xx->user)->nev;
+ 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'] = 1;
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function logout(){
+ unset($_SESSION['default']['fuser']);
+ unset($_SESSION['default']['feltolto']);
+ redirect('forum');
+ }
+
+ function szerkeszt(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->uri->segment(3) != "")
+ $hszid = $this->uri->segment(3);
+ else
+ //$hszid = $this->phpsession->get('hszid');
+ $hszid = $this->input->post('hszid');
+
+ if( $this->mforum->moderator($tomb['name']) || $this->mforum->get_sajathsz($tomb['user_id'], $hszid) ){
+ if($this->input->post('szerk')!=false){
+ //$hszid = $this->phpsession->get('hszid');
+ $hszid = $this->input->post('hszid');
+ $this->mforum->hszszerk($this->input->post('hsz'),$hszid);
+ $user_id = $this->mforum->get_hsz($hszid)->user_id;
+
+ if( $this->input->post('kepki')=='on' ){
+ if(hun())
+ $kep = $this->kepek_utvonal . $user_id ."/". $this->mforum->get_Kep($hszid)->kep;
+ elseif(eng())
+ $kep = $this->kepek_utvonal_eng . $user_id ."/". $this->mforum->get_Kep($hszid)->kep;
+
+ chmod($kep, 777);
+ unlink($kep);
+ $this->mforum->kepki($hszid);
+ }
+
+ $temaid = $this->phpsession->get('tema_id');
+ header("Location: listaz/$temaid");
+ }else if( $this->uri->segment(3) != "" ){
+ $this->phpsession->save('hszid',$this->uri->segment(3));
+
+ $data['szoveg']=$this->mforum->get_Text($this->phpsession->get('hszid'))->szoveg;
+ $kep = $this->mforum->get_Kep($this->phpsession->get('hszid'))->kep;
+ if( $kep != "" && $kep != "NULL" ){
+ $user_id = $this->mforum->get_hsz($this->phpsession->get('hszid'))->user_id;
+ if(hun())
+ $data['kep'] = "/".$this->kepek_utvonal. $user_id . "/".$kep;
+ elseif(eng())
+ $data['kep'] = "/".$this->kepek_utvonal_eng. $user_id . "/".$kep;
+ }
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['javascript'] = array('../editor/fckeditor');
+ $data['tartalom']='forum/szerkeszt';
+ $data['csik']=array('home','forum');
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function torles(){
+ $tomb = $this->phpsession->get('fuser');
+ $hszid = $this->uri->segment(3);
+ if( $this->mforum->moderator($tomb['name']) || $this->mforum->get_sajathsz($tomb['user_id'], $hszid) ){
+ if( $this->uri->segment(3) != "" ){
+ $hszid = $this->uri->segment(3);
+ $uid = $this->mforum->torol($hszid);
+
+ //ha nincs kep a mappajaban:
+ if(hun())
+ $mappa = $this->kepek_utvonal . $uid;
+ elseif(eng())
+ $mappa = $this->kepek_utvonal_eng . $uid;
+
+ $handle = opendir($mappa);
+ //ha nincs fajl a konyvtarban, akkor toroljuk a mappat
+ chmod($mappa,0777);
+ $fajl = readdir($handle);
+ $fajl = readdir($handle);
+ $fajl = readdir($handle);
+ if(!($fajl)){
+ //closedir($mappa);
+ rmdir($mappa);
+ }
+
+ $tema_id = $this->phpsession->get('temaid');
+ if( is_int($this->mforum->get_temaoldal($tema_id)) && ($this->phpsession->get('oldal') == $this->mforum->get_temaoldal($tema_id)) ){
+ $this->elozo();
+ }
+ redirect('forum/listaz');
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tatnevez(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" && ($this->input->post('atnevez')==false) ){
+ $tid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='forum/temaatnevez';
+ $data['csik']=array('home','forum');
+ $data['tema_id'] = $tid;
+ $data['temacim'] = $this->mforum->get_cim($tid)->cim;
+ $data['moderator'] = true;
+
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('atnevez')!=false){
+ $this->mforum->tatnevez($this->input->post('tid'),$this->input->post('ujnev'));
+
+ header("Location: index");
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tkatnevez(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" && ($this->input->post('atnevez')==false) ){
+ $tid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='forum/tkatnevez';
+ $data['csik']=array('home','forum');
+ $data['tema_id'] = $tid;
+ $data['temacim'] = $this->mforum->get_tkcim($tid)->cim;
+ $data['moderator'] = true;
+
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('atnevez')!=false){
+ $this->mforum->tkatnevez($this->input->post('tid'),$this->input->post('ujnev'));
+
+ header("Location: index");
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tematorol(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $tomb && $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" ){
+ $tid = $this->uri->segment(3);
+ $this->mforum->tematorol($tid);
+
+ redirect('forum');
+ }else{
+ redirect('forum');
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function temakortorol(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $tomb && $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" ){
+ $tid = $this->uri->segment(3);
+ $this->mforum->temakortorol($tid);
+
+ redirect('forum');
+ }else{
+ redirect('forum');
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function mypost(){
+ $this->phpsession->save('valasz',false);
+
+ $data['tartalom']='forum/mypost';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('forum');
+ $data['style'] = array('forum_2011');
+ $user = $this->phpsession->get('fuser');
+
+ if(!$user)
+ redirect('forum');
+
+ $hszek = $this->mforum->get_mypost($user['user_id']);
+ foreach( $hszek as $hsz){
+ $elo = $hsz->valasz;
+ $hsz->valasz = $this->mforum->get_valaszok($hsz->hsz_id);
+ $hsz->valaszdb = count($hsz->valasz);
+ $hsz->elozo = $this->mforum->get_hsz($elo);
+ $tema = $this->mforum->get_tema1($hsz->tema_id);
+ $hsz->tema = $this->mforum->get_tema1($hsz->tema_id);
+ $temakor = $this->mforum->get_temakor1($tema->temakor_id);
+ $hsz->temakor = $temakor->cim;
+
+ //print_r($hsz->elozo);
+ }
+
+ $data['hozzaszolasok'] = $hszek;
+ $data['hszdb'] = count($hszek);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+
+ $this->load->view('site_forum',$data);
+ }
+
+
+ function myuser(){
+ $user = $this->phpsession->get('fuser');
+
+ if(!$user)
+ $user = $this->phpsession->get('feltolto');
+
+ if($user){
+ /*$tomb = $this->phpsession->get('fuser');*/
+ $login = $user['name'];
+ $this->user($login);
+ }else
+ redirect('forum');
+ }
+
+ function user($login){
+ if(!$login)
+ redirect('forum');
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='forum/user';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['user']=$login;
+ $data['adatok'] = $this->mforum->get_user($login);
+ $szemadatok = $this->mforum->get_user_szem($login);
+ $emailek = $szemadatok[0]->email;
+ $emailek = explode(";",$emailek);
+ $szemadatok[0]->email = "";
+ foreach( $emailek as $email ){
+ $szemadatok[0]->email .= $email . "
";
+ }
+ $van = $szemadatok[0]->nev;
+ if($van)
+ $data['szemadatok'] = $szemadatok;
+ else
+ $data['szemadatok'] = $this->mforum->get_user_alap($login);
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+
+ $kulcsok[$key_kulcs]->programok = $programs;
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }
+
+ function users(){
+ $user = $this->phpsession->get('fuser');
+
+ if( $user && $this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+ $this->phpsession->save('belep',"");
+
+ if( !($this->phpsession->get('uoldal')) ){
+ $this->phpsession->save('uoldal',0);
+ $oldal = 0;
+ }else{
+ $oldal = $this->phpsession->get('uoldal');
+ }
+
+ if( $this->uri->segment(3) == "kov" ){
+ $oldal++;
+ $this->phpsession->save('uoldal',$oldal);
+ }else if( $this->uri->segment(3) == "elozo" && $oldal > 0 ){
+ $oldal--;
+ $this->phpsession->save('uoldal',$oldal);
+ }
+ else if( is_numeric($this->uri->segment(3))){
+ $oldal = $this->uri->segment(3);
+ $this->phpsession->save('uoldal',$oldal);
+ }
+
+ if( $this->uri->segment(3) == "rendez" ){
+ $ord = $this->uri->segment(4);
+
+
+ $vissza = $this->phpsession->get('rendezvissza');
+ if($this->phpsession->get('rendez') == $ord){
+ $vissza = !$vissza;
+ }
+ $this->phpsession->save('rendezvissza',$vissza);
+
+
+ $this->phpsession->save('rendez',$ord);
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ }else if( $this->phpsession->get('rendez') ){
+ $ord = $this->phpsession->get('rendez');
+ $vissza = $this->phpsession->get('rendezvissza');
+ }else{
+ $ord = "nev";
+ $vissza = false;
+ }
+
+ $data['users']=$this->mforum->get_users($oldal,$ord,$vissza);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ukeres(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+ if( !($this->phpsession->get('ukoldal')) ){
+ $this->phpsession->save('ukoldal',0);
+ $oldal = 0;
+ }else{
+ $oldal = $this->phpsession->get('ukoldal');
+ }
+
+ if( is_numeric($this->uri->segment(3))){
+ $oldal = $this->uri->segment(3);
+ $this->phpsession->save('ukoldal',$oldal);
+ }
+
+ if( $this->uri->segment(3) == "rendez" ){
+ $ord = $this->uri->segment(4);
+
+ $vissza = $this->phpsession->get('rendezvissza');
+ if($this->phpsession->get('rendez') == $ord){
+ $vissza = !$vissza;
+ }
+ $this->phpsession->save('rendezvissza',$vissza);
+
+ $this->phpsession->save('rendez',$ord);
+ $oldal = 0;
+ $this->phpsession->save('ukoldal',0);
+ }else if( $this->phpsession->get('rendez') ){
+ $ord = $this->phpsession->get('rendez');
+ $vissza = $this->phpsession->get('rendezvissza');
+ }else{
+ $ord = "nev";
+ $vissza = false;
+ }
+
+ if( $this->input->post('klogin') || $this->input->post('knev') || $this->input->post('kemail') || $this->input->post('kulcssz') || ($this->input->post('belep') != -1 && $this->input->post('belep') != "" ) ){
+ $oldal = 0;
+ $this->phpsession->save('ukoldal',$oldal);
+ $klog = $this->input->post('klogin');
+ $this->phpsession->save('klogin',$this->input->post('klogin'));
+ $knev = $this->input->post('knev');
+ $this->phpsession->save('knev',$knev);
+ $kmail = $this->input->post('kemail');
+ $this->phpsession->save('kemail',$this->input->post('kemail'));
+ $kulcs = $this->input->post('kulcssz');
+ $this->phpsession->save('kulcssz',$this->input->post('kulcssz'));
+ $belep = $this->input->post('belep');
+ $this->phpsession->save('belep',$this->input->post('belep'));
+ }else{
+ $klog = $this->phpsession->get('klogin');
+ $knev = $this->phpsession->get('knev');
+ $kmail = $this->phpsession->get('kemail');
+ $kulcs = $this->phpsession->get('kulcssz');
+ $belep = $this->phpsession->get('belep');
+ }
+
+ if(UJUGYFELKEZELO===true)
+ $users = $this->mforum->get_kusersujcrm($oldal,$klog,$knev,$kmail,$belep,$kulcs,$ord,$vissza);
+ else
+ $users = $this->mforum->get_kusers($oldal,$klog,$knev,$kmail,$belep,$kulcs,$ord,$vissza);
+ $data['users'] = $users;
+
+ if(UJUGYFELKEZELO===true){
+ if( $this->mforum->vanmegkuserujcrm($this->phpsession->get('ukoldal'),$klog,$knev,$kmail,$belep,$kulcs) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('ukoldal') > 0 )
+ $data['elozo'] = true;
+ }
+ else{
+ if( $this->mforum->vanmegkuser($this->phpsession->get('ukoldal'),$klog,$knev,$kmail,$belep,$kulcs) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('ukoldal') > 0 )
+ $data['elozo'] = true;
+ }
+
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_kusersdb($klog,$knev,$kmail,$belep,$kulcs);
+ $data['akt_oldal'] = $oldal;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function edit_user(){
+ $user = $this->phpsession->get('fuser');
+ if($user && $this->mforum->moderator($user['name'])){
+ if( $this->uri->segment(3) != "" && ($this->input->post('edituser')==false) ){
+ $uid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználó szerkesztése' : $data['title'] = 'ARCHLine.XP Forum Edit User';
+ $data['tartalom']='forum/edit_user';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+ $login = $this->mforum->get_login($uid);
+ $data['adatok'] = $this->mforum->get_user($login);
+
+ $szemadatok = $this->mforum->get_user_szem($login);
+
+ if($szemadatok[0])
+ $data['szemadat'] = $szemadatok[0];
+ else{
+ $cucc = $this->mforum->get_user_alap($login);
+ $data['szemadat'] = $cucc[0];
+ }
+
+ //$data['kulcsok'] = $this->mforum->get_user_kulcsok($login);
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+
+ $i=0;
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $i++;
+
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+
+ $kulcsok[$key_kulcs]->programok = $programs;
+
+
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('edituser')!=false){
+
+ $error = "";
+ $langerror = array();
+ if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') != $this->input->post('jelszo2') ){
+ $error .= "A megadott két jelszó nem egyezik.
";
+ array_push($langerror,0);
+ }else if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') == $this->input->post('jelszo2') && strlen($this->input->post('jelszo1') ) < 5 ){
+ $error .= "A megadott jelszó 5 karakternél rövidebb.
";
+ array_push($langerror,1);
+ }
+
+ $user = $tomb['name'];
+ //$myid = $this->mforum->get_userid($user);
+
+ if( $this->input->post('login') == "" ){
+ $error .= "A login mező értéke nem lehet üres.
";
+ array_push($langerror,4);
+ }
+
+ if( $this->input->post('login') != "" && !$this->mforum->szabadlogin($this->input->post('login'),$this->input->post('uid')) ){
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+ array_push($langerror,2);
+ }
+ elseif( strlen($this->input->post('login') ) < 5 ){
+ $error .= "A megadott login 5 karakternél rövidebb.
";
+ array_push($langerror,3);
+ }
+
+ if( $this->input->post('login') != $this->ekezet($this->input->post('login')) ){
+ $error .= "A felhasználó névben nem szerepelhet ékezet vagy szóköz!
";
+ array_push($langerror,5);
+ }
+
+
+ $uid = $this->input->post('uid');
+
+ if( !$error ){
+ // frissítés
+ $mod['nev'] = $this->input->post('nev');
+ $mod['login'] = $this->input->post('login');
+ $mod['rang'] = $this->input->post('rang');
+ if($this->input->post('jelszo1') != "")
+ $mod['jelszo'] = md5($this->input->post('jelszo1'));
+ $mod['viewsub'] = ($this->input->post('viewsub') == "on") ? 1 : 0;
+
+ $this->db->update('forum_user',$mod,"user_id={$uid}");
+ //$this->mforum->set_user($this->input->post('uid'),$this->input->post('nev'),$this->input->post('email'),$this->input->post('jelszo1'),$this->input->post('login'),$this->input->post('rang'));
+
+ redirect("forum/users");
+ }else{
+
+
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználó szerkesztése' : $data['title'] = 'ARCHLine.XP Forum Edit User';
+ $data['tartalom']='forum/edit_user';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+
+ $login = $this->mforum->get_login($uid);
+ $data['adatok'] = $this->mforum->get_user($login);
+
+ $szemadatok = $this->mforum->get_user_szem($login);
+
+ if($szemadatok[0])
+ $data['szemadat'] = $szemadatok[0];
+ else{
+ $cucc = $this->mforum->get_user_alap($login);
+ $data['szemadat'] = $cucc[0];
+ }
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+
+ $i=0;
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $i++;
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+ $kulcsok[$key_kulcs]->programok = $programs;
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+ $data['error'] = $error;
+ $data['hibak2'] = $langerror;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+
+ print " ";
+ }
+
+ $ezt = "edit_user/".$uid;
+ header("Location: ".$ezt);
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujuser(){
+ $user = $this->phpsession->get('fuser');
+ if($user && $this->mforum->moderator($user['name'])){
+ if($this->input->post('do')!=false){
+ $login = $this->input->post('login');
+ $nev = $this->input->post('nev');
+ $jsz1 = $this->input->post('jelszo1');
+ $jsz2 = $this->input->post('jelszo2');
+ $email = $this->input->post('email');
+ $kulcs = $this->input->post('kulcs');
+ $rang = $this->input->post('rang');
+
+ if($kulcs)
+ $nUserID = $this->mforum->get_nUserID($kulcs);
+ else
+ $nUserID = "NULL";
+
+ $error = "";
+ $langerror = array();
+
+ if( $login == "" )
+ $error .= "Nincs login megadva.
";
+
+ if( $login != $this->ekezet($login) )
+ $error .= "A felhasználó névben nem lehet ékezet vagy szóköz.
";
+ elseif( !$this->mforum->szabadlogin($login,10000) )
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+
+ if( $jsz1 == "" || $jsz2 == "" || $jsz1 != $jsz2 )
+ $error .= "A két jelszó nem egyezik vagy nincsenek megadva.
";
+
+ if( $this->mforum->is_email($email) )
+ $error .= "A megadott e-mail-cím már szerepel az adatbázisban.
";
+
+ if(!$error){
+ $this->mforum->ujuser($login,$nev,$jsz1,$email,$nUserID,$rang);
+
+ redirect('forum/users');
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új felhasználó' : $data['title'] = 'ARCHLine.XP Forum new user';
+ $data['tartalom']='forum/ujuser';
+ $data['csik']=array('home','forum');
+ $data['error2'] = $error;
+ $data['moderator']=true;
+ $data['javascript']=array('forum');
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }
+
+ }else{
+ $data['title'] = 'ARCHLine.XP Fórum új felhasználó';
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Új Felhasználó' : $data['title'] = 'ARCHLine.XP Forum New User';
+ $data['tartalom']='forum/ujuser';
+ $data['csik']=array('home','forum');
+ $data['javascript']=array('forum');
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function del_user(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ $id = $this->uri->segment(3);
+ $this->mforum->del_user($this->uri->segment(3));
+ redirect("forum/users");
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujuserdb(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+
+
+
+
+ $this->access_id = 36;
+
+ $this->load->model('mpartners');
+ $this->keydb = $this->load->database('clusers',true);
+ $search = false;//$this->input->post('search');
+
+ $from = 0;
+ $to = 999999;
+ $limit = 2000;
+
+ $this->keydb->query("SET NAMES utf8");
+ $result = $this->keydb->from('cl_fo_hardlock')->join('cl_users','cl_fo_hardlock.hlUser=cl_users.nUserID','left')->orderby('hlNum','desc')->where("hlCtrID ='".$this->access_id."'")->where('hlStat',1)->where("hlNum >= '".$from."' AND hlNum <= '".$to."'")->limit(99999)->get();
+
+ //$sorok = $result->result();
+
+
+
+
+
+ $query = $this->keydb->from('cl_fo_hardlock')->join('cl_users','cl_fo_hardlock.hlUser=cl_users.nUserID','left')->join('cl_users_emails','cl_users.nUserID=cl_users_emails.nUserID','left')->orderby('hlNum','desc')->where("hlCtrID ='".$this->access_id."'")->where('hlStat',1)->where('default',1)->where("hlNum >= '".$from."' AND hlNum <= '".$to."'")->limit(99999)->get();
+ $sorok = $query->result();
+
+
+ //$this->keydb->query("SET NAMES latin2");
+
+
+
+
+ if($result->num_rows()==0)
+ {
+ $data['sorok'] = false;
+ }
+ else
+ {
+ $data['sorok'] = $sorok;
+ $data['found'] = $result->num_rows();
+ }
+
+ $sorok2 = $sorok;
+ $i = 0;
+ $j = 0;
+ $db = 0;
+ foreach($sorok2 as $sor){
+ $mailek = $sor->email;
+ $mailek = explode(";",$mailek);
+
+ foreach( $mailek as $mail ){
+ $mail = trim($mail);
+
+ //megnezzuk hogy benne van-e az adatbázisban és aktív-e
+ if( $mail != "" && $sor->hlStat == 1 && !$this->mforum->is_email(strtolower($mail)) ){
+ $mailresz = explode('@',$mail);
+ $login = $mail;
+ $nev = $sor->strName;
+ $nev = trim($nev);
+ $jsz1 = $mailresz[0];
+ $nUserID = $sor->nUserID;
+ $rang = "user";
+
+ // eladási dátum 0000-00-00 -e
+ $datum = $this->keydb->from('cl_fo_programs')->where("prHlNum",$sor->hlNum)->select('prSellDate')->get()->row();
+ if($datum->prSellDate != '0000-00-00'){
+ $this->mforum->ujuser($login,$nev,$jsz1,strtolower($mail),$nUserID,$rang);
+ $db++;
+ $kik[$j]->Nev = $nev;
+ $kik[$j]->Login = $login;
+ $kik[$j]->Email = $mail;
+ $kik[$j]->Datum = $datum->prSellDate;
+ }
+ $j++;
+ }
+ }
+ $i++;
+ }
+ $data['darab'] = $db;
+ $data['kik'] = $kik;
+
+
+
+ $data['sorok2'] = $sorok2;
+
+
+
+
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $this->load->view('site_forum',$data);
+ }else
+ redirect('forum');
+ }
+
+ function listVMData()
+ {
+ $azureVMID = $this->uri->segment(3);
+ $txt = "SELECT * FROM cl_hlusers.AzureVM WHERE VMID = '".$azureVMID."'";
+ $vm = $this->db->query($txt)->result();
+ if( count($vm) != 1 )
+ return false;
+
+ $vmGrp = $this->db->query("SELECT * FROM cl_hlusers.AzureGroups WHERE ID = '".$vm[0]->GROUPID."'")->result();
+ if( count($vmGrp) != 1 )
+ return false;
+
+ $data['tartalom']='forum/azurevm';
+ //$data['csik']=array('home','forum');
+ $data['vm'] = $vm;
+ $data['vmGrp'] = $vmGrp;
+ $data['azureVMID'] = $azureVMID;
+ $this->load->view('site_simple',$data);
+ }
+
+ function myStart(){
+ //$output = array();
+ //exec("pwd", $output);
+ //$res = shell_exec("azure");
+ //exec("azure vm list > /home/hosting/cadline.hu/battila/www.cadline.hu/teszt.out");
+
+
+ chdir('/var/tmp');
+ $command = "/usr/bin/azure account import /var/www/hosting/cadline.hu/www/public/downloads/cadlineazurecertificate.publishsettings";
+ #$command = "pwd";
+ $ph = popen( $command, "r" )
+ or die( "Hiba" );
+ while(!feof($fp))
+ {
+ // send the current file part to the browser
+ print fread($fp, 1024);
+ // flush the content to the browser
+ flush();
+ }
+ pclose($fp);
+ //$kamu = fgets( $ph, 20490 );
+ //print "Output: ".$kamu;
+ //pclose( $ph );
+ //print $res;
+ }
+
+ function myedit(){
+ $tomb = $this->phpsession->get('fuser');
+
+ if(!$tomb) $tomb = $this->phpsession->get('feltolto');
+
+ if( $tomb ){
+ if($this->input->post('mysave')!=false){
+
+ $error = "";
+ $langerror = array();
+ if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') != $this->input->post('jelszo2') ){
+ $error .= "A megadott két jelszó nem egyezik.
";
+ array_push($langerror,0);
+ }else if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') == $this->input->post('jelszo2') && strlen($this->input->post('jelszo1') ) < 5 ){
+ $error .= "A megadott jelszó 5 karakternél rövidebb.
";
+ array_push($langerror,1);
+ }
+
+ $user = $tomb['name'];
+ $myid = $this->mforum->get_userid($user);
+
+ if( $this->input->post('login') == "" ){
+ $error .= "A login mező értéke nem lehet üres.
";
+ array_push($langerror,4);
+ }
+
+ if( $this->input->post('login') != "" && !$this->mforum->szabadlogin($this->input->post('login'),$myid) ){
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+ array_push($langerror,2);
+ }
+ elseif( strlen($this->input->post('login') ) < 5 ){
+ $error .= "A megadott login 5 karakternél rövidebb.
";
+ array_push($langerror,3);
+ }
+
+ if( $this->input->post('login') != $this->ekezet($this->input->post('login')) ){
+ $error .= "A felhasználó névben nem szerepelhet ékezet vagy szóköz!
";
+ array_push($langerror,5);
+ }
+
+
+ $ertesitesek = $this->input->post('temak');
+ if(count($ertesitesek) == 0 || (count($ertesitesek) == 1 && $ertesitesek[0] == "") )
+ $ertesit = NULL;
+ elseif( count($ertesitesek) == count($this->mforum->get_temak()) )
+ $ertesit = "mind";
+ else
+ $ertesit = ";".implode(";", $ertesitesek).";";
+
+
+ if($error){
+ hun() ? $data['title'] = 'ARCHLine.XP Adatok változtatása' : $data['title'] = 'ARCHLine.XP Edit Data';
+ $data['tartalom']='forum/myedit';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+ $data['error2'] = $error;
+ $data['hibak2'] = $langerror;
+
+ $user = $tomb['name'];
+ $user_id = $this->mforum->get_userid($user);
+ $data['user_id'] = $user_id;
+ $data['cucc'] = $this->mforum->get_user_alap($user);
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }else{
+ $plogin = $this->input->post('login');
+ $pnev = $this->input->post('nev');
+ $pjelszo = $this->input->post('jelszo1');
+
+ $this->mforum->myedit($plogin, $pnev, $pjelszo, $myid, $ertesit);
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['t_nev'] = $this->mforum->get_nev($plogin);
+ $fuser['name'] = $this->input->post('login');
+ $this->phpsession->save('fuser',$fuser);
+ $this->myuser();
+ }
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Adatok változtatása' : $data['title'] = 'ARCHLine.XP Edit Data';
+ $data['tartalom']='forum/myedit';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ if(hun())
+ $nyelv = "hun";
+ else
+ $nyelv = "eng";
+
+ $user = $tomb['name'];
+ $user_id = $this->mforum->get_userid($user);
+ $data['user_id'] = $user_id;
+ $data['temak'] = $this->mforum->get_temak($nyelv);
+ $data['cucc'] = $this->mforum->get_user_alap($user);
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujjelszo(){
+ if($this->input->post('kuld')!=false){
+ $email = $this->input->post('email');
+ if(hun()) $uzenet = "A megadott e-mail-cím: " . $email;
+ //$uzenet = $email;
+
+ $ujjelszo = $this->mforum->ujjelszo($email);
+
+ if($ujjelszo){
+
+ $this->load->library('email');
+ $this->load->helper('email');
+ $this->email->initialize();
+ $this->email->addOfficialImages();
+
+ $mailnek->ujjsz = $ujjelszo;
+ $mailnek->login = $this->mforum->get_login2($email);
+
+
+ /* Akarmilyem mailcimet is adott meg, a default emailre kuldjuk a levelet */
+ $email2 = $this->mforum->default_mail($email);
+ if($email2 != "")
+ $email = $email2;
+
+
+ $this->email->from('info@cadline.hu', 'Cadline Weboldal');
+ if(hun())
+ $this->email->subject('Uj jelszo');
+ else
+ $this->email->subject('New Password');
+ $this->email->message($this->load->view('mail_ujjelszo',$mailnek,true));
+ $this->email->send($email,'smtp');
+
+ if(hun())
+ $uzenet = $email." -ra kiküldtük az Ön új jelszavát.
";
+ else
+ $uzenet = "New password sent to ".$email;
+
+ }else{
+ if(hun()) $uzenet .= " nincs a felhasználók között.
";
+ else $uzenet = "E-mail error: ".$email;
+ }
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új jelszó' : $data['title'] = 'ARCHLine.XP Forum new password';
+
+ $data['uzenet']=$uzenet;
+ $this->phpsession->save('fuzenet',$uzenet);
+
+ if( isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'],'/collection/') ){
+ $data['tartalom']='collection/ujjelszo_valasz';
+ $data['style'] = array('temp/style_new');
+ $this->load->view('site_upload',$data);
+ }
+ else{
+ /*$data['tartalom']='forum/temakorok';
+ $data['csik']=array('home','forum');
+ $this->load->view('site_forum',$data);*/
+ redirect('forum');
+ }
+
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új jelszó' : $data['title'] = 'ARCHLine.XP Forum new password';
+
+ $data['tartalom']='forum/ujjelszo';
+ $data['csik']=array('home','forum');
+
+ if( isset($_SERVER['HTTP_REFERER']) && (strstr($_SERVER['HTTP_REFERER'],'collection/upload') || strstr($_SERVER['HTTP_REFERER'],'collection/submit')) ){
+ $data['style'] = array('temp/style_new');
+ $this->load->view('site_upload',$data);
+ }
+ else{
+ $this->load->view('site_new',$data);
+ }
+ }
+ }
+
+ function szabalyzat(){
+ if(hun())
+ $lap = $this->mpages->get_row(454);
+ else
+ $lap = $this->mpages->get_row(559);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum szabályzat' : $data['title'] = 'ARCHLine.XP Forum Rules';
+ $data['tartalom'] = '/forum/szabalyzat';
+ $data['lap'] = $lap;
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $uid = $this->mforum->get_userid($user['name']);
+ //ha még nem fogadta el a szabályzatot:
+ if( !($this->mforum->szabalyzat($uid) ) ){
+ $data['uid'] = $uid;
+ $data['nemelfogad'] = true;
+ }
+
+ $data['aktmenu'] = "2";
+ $this->load->view('site_forum',$data);
+ }
+
+ function elfogad(){
+ if($this->input->post('el')=="igen"){
+ $this->load->model('mclusers');
+
+ $uid = $this->input->post('uid');
+ $name = $this->input->post('fnev');
+ $passwd = $this->input->post('jelszo');
+ if( $this->mforum->belep($name,$passwd,false) ){
+ $this->mforum->elfogad($uid);
+
+ $felhasznalo = $this->mforum->getrow($uid);
+ if($felhasznalo->nUserID > 0 && $felhasznalo->nyelv == "hun")
+ $this->mclusers->addEvent($felhasznalo->nUserID, 109, 'Elso bejelentkezes a forumba.', "hun");
+ elseif( $felhasznalo->nUserID > 0 && $felhasznalo->nyelv == "eng" )
+ $this->mclusers->addEvent($felhasznalo->nUserID, 148, 'Elso bejelentkezes a forumba.', "eng");
+
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$this->mforum->get_login($uid);
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+
+ $fuser['user_id'] = $uid;
+
+ $this->phpsession->save('fuser',$fuser);
+ $Date = date('Y-m-d',time());
+
+ $nUserID = $this->mforum->get_nUserID2($uid);
+ }
+
+ redirect('forum');
+
+ }else{
+ $this->logout();
+ }
+ }
+
+ function ido(){
+ die(date('Y-m-d H:i:s', time()));
+ }
+
+ function emailjavitas(){
+ $tomb = $this->phpsession->get('fuser');
+ if(!$tomb)
+ redirect('forum');
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+
+ $cl_users = $this->mforum->get_cl_users();
+
+ $db = 0;
+ $cserek = "";
+ foreach($cl_users as $user){
+ $nUserID = $user->nUserID;
+ //print $user->strName;
+ $x = $this->mforum->cseremail($nUserID);
+ if( $x ){
+ $cserek .= $x;
+ $db++;
+ }
+ }
+
+ $data['email']=$db;
+ $data['cserek']=$cserek;
+
+
+
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function ujuserdb_eng(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $sorok = $this->mforum->get_cl_users_eng();
+
+ $i = 0;
+ $j = 0;
+ $db = 0;
+ foreach($sorok as $sor){
+ $mailek = $sor->strEMail;
+ $mailek = explode(";",$mailek);
+
+ foreach( $mailek as $mail ){
+ /* csak az elso email cimet veszi fel */
+ $mail = trim($mailek[0]);
+
+
+ //megnezzuk hogy benne van-e az adatbázisban és aktív-e
+ if( $mail != "" && $sor->hlStat == 1 && !$this->mforum->is_email(strtolower($mail)) ){
+ $mailresz = explode('@',$mail);
+ $login = $mail;
+ $nev = $sor->strName;
+ $nev = trim($nev);
+ $jsz1 = $mailresz[0];
+ $nUserID = $sor->nUserID;
+ $rang = "user";
+
+
+ // eladási dátum 0000-00-00 -e
+ $datum = $this->db->from('`clusers_eng`.`cl_fo_programs`')->where("prHlNum",$sor->hlNum)->select('prSellDate')->get()->row();
+
+ $prog = $this->db->query(" SELECT * FROM `clusers_eng`.`cl_fo_programs` WHERE prHlNum = '".$sor->hlNum."'")->result();
+
+ if($datum->prSellDate != '0000-00-00' && $this->mforum->szabadlogin($login) ){
+ $this->mforum->ujuser_eng($login,$nev,$jsz1,strtolower($mail),$nUserID,$rang);
+
+ // print "
Felvenném: ".$login.$nev.$jsz1.strtolower($mail).$nUserID.$rang;
+
+ $db++;
+ $kik[$j]->Nev = $nev;
+ $kik[$j]->Login = $login;
+ $kik[$j]->Email = $mail;
+ $kik[$j]->Datum = $datum->prSellDate;
+ }
+ $j++;
+ }
+ }
+ $i++;
+ }
+ $data['darab'] = $db;
+ $data['kik'] = $kik;
+
+ $data['sorok2'] = $sorok;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function info($info){
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/kiir';
+ $data['info'] = $info;
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function galeria(){
+ $user = $this->phpsession->get('fuser');
+
+ if( is_numeric($this->uri->segment(3)) ){
+ $this->galeriamutat();
+ }elseif($user){
+ $this->sajatgaleria();
+ }else{
+ redirect("forum");
+ }
+ }
+
+ function galeriamutat(){
+ $user_id = $this->uri->segment(3);
+ $lang = $this->muser->user['lang'];
+
+ $fajlok = $this->mforum->get_galeria($user_id,$lang);
+
+ $data["fajlok"] = $fajlok;
+ if(hun())
+ $data['utvonal'] = $this->galeria_utvonal.$user_id;
+ else
+ $data['utvonal'] = $this->galeria_utvonal_eng.$user_id;
+
+ $data['tartalom'] = '/forum/galeria';
+ $data['javascript'] = array(
+ 'interior_menu',
+ 'fancybox/jquery-1.3.2.min',
+ 'fancybox/jquery.easing.1.3',
+ 'fancybox/jquery.fancybox-1.2.1.pack',
+ 'fancybox/fancy'
+ );
+
+ $data['style'] = array('fancybox');
+
+ $this->load->view('site_forum',$data);
+
+ }
+
+ function sajatgaleria(){
+ $this->load->model('mrender');
+ $user = $this->phpsession->get('fuser');
+
+ if($user){
+ hun() ? $data['title'] = 'ARCHLine.XP Saját Galéria' : $data['title'] = 'ARCHLine.XP My Gallery';
+ $data['tartalom'] = '/forum/sajatgaleria';
+
+ $uid = $user['user_id'];
+ $data['uid'] = $uid;
+
+ $data['fajlok'] = $this->mforum->fajlok($uid);
+ $data['szabad_hely'] = (200 * 1024 * 1024) - $this->foglalt_hely($uid);
+
+ // $data['renderek'] = $this->mrender->get_byuserid($uid);
+
+ $data['javascript'] = array('fancybox/jquery-1.3.2.min','fancybox/jquery.easing.1.3','fancybox/jquery.fancybox-1.2.1.pack','fancybox/fancy','jquery','jquery_ui');
+ $data['style'] = array('fancybox2','jquery.ui');
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "5";
+ $this->load->view('site_forum',$data);
+ }else
+ redirect("forum");
+ }
+
+ function foglalt_hely($user_id){
+ if(hun())
+ $fajlok = $this->galeria_utvonal.$user_id."/";
+ else
+ $fajlok = $this->galeria_utvonal_eng.$user_id."/";
+
+ $total = 0;
+
+ if( is_dir($fajlok) ){
+ $handle = opendir($fajlok);
+ while($file = readdir($handle)){
+ $total += filesize($fajlok.$file);
+ if((is_dir($fajlok.$file.'/')) &&($file != '..')&&($file != '.'))
+ {
+ $total = $total + $this->foglalt_hely($fajlok.$file.'/');
+ }
+ }
+ }
+
+ return $total;
+ }
+
+ function feltolt(){
+ $user = $this->phpsession->get('fuser');
+ $uid = $user['user_id'];
+
+ if($uid && $_FILES["fajl"]["error"]==0){
+
+ $fajl = "";
+ $meret = 0;
+
+ if(hun())
+ $hova = $this->galeria_utvonal.$uid;
+ elseif(eng())
+ $hova = $this->galeria_utvonal_eng.$uid;
+
+ if(!is_dir($hova)){
+ mkdir($hova,0644);
+ chmod($hova,0777);
+ }
+
+
+ $feltolt_konyvtar = $hova."/";
+ //ha több fájl lenne ugyanazon a néven
+ $elotag = substr(time(),-6);
+ $fajlnev = $this->ekezet($_FILES["fajl"]["name"]);
+ $feltolt_fajlnev=$feltolt_konyvtar . $elotag . "__" . $fajlnev;
+
+ $error = "";
+ $mi = $_FILES['fajl']['name']."$";
+
+ $mire = "\.exe|\.EXE|\.php|\.PHP|\.sh|\.SH";
+ if( (ereg( $mire , $mi )) ){
+ $error .= "Hibás fájl kiterjesztés
";
+ }
+ if( $_FILES['fajl']['size'] > 1024 * 1024 * 10 ){
+ $error .= "A fájl mérete nagyobb 10 MB-nál.
";
+ }
+ else if( !$error){
+ if (copy($_FILES["fajl"]["tmp_name"], $feltolt_fajlnev)){
+ $fajl = $elotag . "__". $fajlnev;
+ $meret = $_FILES["fajl"]["size"];
+ $mit = $hova."/".$fajl;
+ chmod($mit,0777);
+
+
+ // elonezeti kep elkeszitese 150x113-ban
+ include('application/helpers/myimg_helper.php');
+ kepmeretezesvagas($feltolt_fajlnev,$hova,"elo_".$fajl,"150","113");
+
+ }else{
+ $fajl = "NULL";
+ $error = "Fájl másolás hiba.
";
+ }
+ }
+
+ if( !$error ){
+ $szamla = $this->input->post('szamla');
+ $info = $this->input->post('leiras');
+ $megoszt = 1;
+
+ if( $this->input->post('megosztas') != "on" ){
+ $megoszt = 0;
+ }
+
+ $this->mforum->feltolt($uid,$fajl,$meret,$szamla,$megoszt,$info);
+
+ redirect("forum/galeria/".$uid);
+ }else{
+ $this->info($error);
+ }
+
+
+ }else{
+ if( $_FILES['fajl']['error'] != 0 )
+ $this->info("Hiba a fájl feltöltésekor!");
+ else
+ redirect("forum");
+ }
+
+ }
+
+ function delfajl(){
+ $fajl_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ $user_id = $user['user_id'];
+
+ if(!$user)
+ redirect('forum');
+
+ if( is_numeric($fajl_id) && $this->mforum->sajatfajl($fajl_id, $user_id) ){
+ $this->load->model('mrender');
+
+ $fajl = $this->mforum->delfajl($fajl_id);
+
+ if(hun())
+ $mit = "public/forum-galeria/hun/".$user_id."/elo_".$fajl;
+ else
+ $mit = "public/forum-galeria/eng/".$user_id."/elo_".$fajl;
+
+ // elonezeti kep torlese ha van
+ if( file_exists( $mit ) ){
+ chmod($mit, 777);
+ unlink($mit);
+ }
+
+ // A fájlhoz tartozó rendereknél törölni a galériás fájl id-t.
+ $renderek = $this->mrender->get_rowBygforumgalid($fajl_id);
+ if( $renderek ){
+ foreach($renderek as $render){
+ $ertek = NULL;
+ $this->db->update('render_img',array('forumgal_id'=>$ertek),"render_id='".$render->render_id."'");
+ }
+ }
+ }
+ redirect("forum/galeria");
+ }
+
+ function editgaleria(){
+ $fajl_id = $this->input->post('fajl_id');
+ // $fajl_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ $user_id = $user['user_id'];
+
+ if(!$user)
+ redirect('forum');
+
+
+ if( is_numeric($fajl_id) && $this->mforum->sajatfajl($fajl_id, $user_id) ){
+ if( $this->input->post('do') ){
+ $leiras = $this->input->post('leiras');
+ $megoszt = 1;
+
+ if( $this->input->post('megosztas') != "on" ){
+ $megoszt = 0;
+ }
+
+ $this->mforum->editgaleria($fajl_id,$leiras,$megoszt);
+
+ redirect("forum/galeria");
+
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Saját Galéria' : $data['title'] = 'ARCHLine.XP My Gallery';
+ $data['tartalom'] = '/forum/editgaleria';
+
+ $data['uid'] = $user_id;
+ $data['fajlinfo'] = $this->mforum->fajlinfo($fajl_id);
+ if(hun())
+ $data['utvonal'] = $this->galeria_utvonal;
+ else
+ $data['utvonal'] = $this->galeria_utvonal_eng;
+
+ $data['utvonal'] .= "/".$user_id;
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "5";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect("forum");
+ }
+ }
+
+ function regisztracio(){
+ if($this->input->post('do') != ""){
+ $nev = $this->input->post('regnev');
+ $login = $this->input->post('email');
+ $email = $login;
+ $jelszo = $this->input->post('jelszo1');
+
+ $szabad = $this->mforum->szabadlogin($login,999999);
+ if( $szabad ){
+ //$this->mforum->ujuser($login,$nev,$jelszo,$email,"","feltolto");
+
+
+ $kod = md5($jelszo.time().$nev);
+
+ $record['login'] = $email;
+ $record['jelszo'] = md5($jelszo);
+ $record['nev'] = $nev;
+ $record['email'] = $email;
+ $record['rang'] = "guest";
+ $record['kod'] = $kod;
+ $record['datum'] = date("Y-m-d H:i:s",time());
+ $record['nyelv'] = $this->muser->user['lang'];
+
+ $this->db->insert('forum_user_temp',$record);
+
+
+ $this->load->helper('email');
+
+ //sending the e-mail
+ $mail_vars['kod'] = $kod;
+ $mail_vars['email'] = $email;
+ $mail_vars['first'] = $nev;
+
+ //set the authenticating link
+ $mail_vars['link'] = hun() ? 'http://archline.hu/forum/confirm/' . $kod : 'http://www.archlinexp.com/forum/confirm/' . $kod;
+
+ //setting and sending the email
+ $this->load->library('email');
+ $this->email->initialize();
+ $this->email->addOfficialImages();
+
+ $this->email->setFrom('info@cadline.hu', 'CadLine');
+
+ if(hun())
+ {
+ $mail_vars['mailcontent'] = 'mail/confirm_forum_hun';
+ $this->email->subject('ARCHLine.XP regisztráció');
+ }
+ else
+ {
+ $mail_vars['mailcontent'] = 'mail/confirm_forum_eng';
+ $this->email->subject('ARCHLine.XP registration');
+ }
+
+ $this->email->message($this->load->view('mail',$mail_vars,true));
+ $this->email->send($mail_vars['email'],'smtp');
+
+ redirect('forum/sentconf');
+ }
+ else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/regisztracio';
+ $data['javascript'] = array('forum');
+ $data['style'] = array('temp/style_interior');
+ $data['foglalt'] = "igen";
+
+ $this->load->view('site_upload',$data);
+ }
+ }else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/regisztracio';
+ $data['javascript'] = array('forum');
+ $data['style'] = array('temp/style_interior');
+
+ $this->load->view('site_upload',$data);
+ }
+ }
+
+ function sentconf(){
+ $data['tartalom']='forum/sentconf';
+ $data['lang']=$this->muser->user['lang'];
+ $data['style'] = array('temp/style_new');
+
+ $this->load->view('site_upload',$data);
+ }
+
+ function confirm(){
+ $kod = $this->uri->segment(3);
+
+ $data['style'] = array('temp/style_new');
+
+ if( $this->mforum->confirm($kod) ){
+
+ /* a felhasználóhoz új eseményt felvenni, ha szerepel az adatbázisban */
+ $adatok = $this->mforum->get_userByKod($kod);
+ $nUserID = $this->mforum->get_nUserID30($adatok->email);
+ if( $nUserID ){
+ $this->load->model('mclusers');
+ $this->mclusers->addEvent($nUserID, 114, "Regisztráció");
+ }
+
+ $data['tartalom']='forum/confirm_ok';
+ $data['lang']=$this->muser->user['lang'];
+ }else{
+ $data['tartalom']='forum/confirm_hiba';
+ $data['lang']=$this->muser->user['lang'];
+ }
+
+ $this->load->view('site_upload',$data);
+ }
+
+ function belepfeltolto(){
+ if( $this->input->post("do") != "" ){
+ $login = $this->input->post("email");
+ $jelszo = $this->input->post("jelszo");
+
+ if( $this->mforum->belep($login,$jelszo) ){
+ print "ok";
+ }else
+ print "nem ok";
+
+ }else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/belepfeltolto';
+ $data['javascript'] = array('forum');
+
+ $this->load->view('site',$data);
+ }
+ }
+
+ function renderek(){
+ $this->load->model('mrender');
+ $user = $this->phpsession->get('fuser');
+ $feltolto = $this->phpsession->get('feltolto');
+
+ if($user){
+ $uid = $user['user_id'];
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ }elseif($feltolto){
+ $uid = $feltolto['user_id'];
+ }
+ else
+ redirect("forum");
+
+ hun() ? $data['title'] = 'ARCHLine.XP Renderek' : $data['title'] = 'ARCHLine.XP Renders';
+ $data['tartalom'] = '/forum/renderek';
+
+ $data['uid'] = $uid;
+
+ $renderek = $this->mrender->get_byuserid($uid);
+
+ if($renderek){
+ foreach($renderek as $render){
+ if($render->allapot=='1' && file_exists($render->keszkep)){
+ list($width, $height) = getimagesize($render->keszkep);
+ $render->kepmeret = $width . " x ". $height;
+ }
+ else{
+ $render->kepmeret = '-';
+ }
+ }
+ }
+
+ $data['renderek'] = $renderek;
+
+ $data['onload'] = "betolt()";
+
+ $data['javascript'] = array('fancybox-1.3.4/fancybox/jquery-1.4.3.min','fancybox/jquery.easing.1.3','fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack','jquery_ui','plugin/jquery.maskedinput-1.2.2','plugin/jquery.maskedinput-1.2.2.min');
+ $data['style'] = array('jquery.fancybox-1.3.4','jquery.ui');
+ $data['aktmenu'] = "6";
+ $this->load->view('site_forum',$data);
+
+ unset($_SESSION['webrender']); // ne legyenek meg a render beallitasanal a default ertekek
+ }
+
+ function delrender(){
+ $this->load->model('mrender');
+
+ $render_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ if(!$user)
+ $user = $this->phpsession->get('feltolto');
+
+ if(!$user)
+ redirect('forum');
+
+ $render = $this->mrender->get_row($render_id);
+
+ if( is_numeric($render_id) && $render->user_id == $user['user_id'] ){
+ $this->mrender->del($render_id);
+ }
+
+ header("Location: ".$_SERVER["HTTP_REFERER"]);
+ }
+
+ function rendercopy(){
+ $this->load->model('mrender');
+
+ $guid = $this->uri->segment(3);
+ $render = $this->mrender->get_rowByguid($guid);
+
+ if( is_numeric($render->render_id) ){
+ if( $this->muser->user['lang'] == "hun" )
+ $almappa = "hun";
+ else
+ $almappa = "eng";
+
+ $uid = $render->user_id;
+
+ $helye = "public/forum-galeria/".$almappa."/".$uid;
+
+ if(!is_dir($helye)){
+ mkdir($helye,0644);
+ chmod($helye,0777);
+ }
+
+ $fajluj = basename($render->keszkep);
+
+ $honnan = $render->keszkep;
+ $hova = $helye."/".$fajluj;
+
+ if( copy($honnan,$hova) ){
+ $meret = filesize($hova);
+ $this->mforum->feltolt($render->user_id,$fajluj,$meret,"","1",$render->render_name,$render->nyelv);
+ $fajl_id = mysql_insert_id();
+ $this->db->update('render_img',array('forumgal_id'=>$fajl_id),"render_id='".$render->render_id."'");
+
+ $uzenet = array(4);
+ $this->phpsession->save('fuzenet',$uzenet);
+
+ // elonezeti kep masolasa is ha van
+ $fajlnev = basename($render->keszkep);
+ $mappak = substr( $render->keszkep,0,(-1*(strlen($fajlnev))) );
+ $elokep = $mappak."elo_".$fajlnev;
+ if(file_exists($elokep)){
+ $ujelokep = $helye."/elo_".$fajlnev;
+ copy($elokep,$ujelokep);
+ }
+ }else{
+ $uzenet = array(14);
+ $this->phpsession->save('fhiba',$uzenet);
+ }
+
+ redirect('forum/renderek');
+ }else{
+ $uzenet = array(14);
+ $this->phpsession->save('fhiba',$uzenet);
+ redirect('forum/renderek');
+ }
+ }
+
+ function renderletolt(){
+ $this->load->model('mrender');
+ $render_id = $this->uri->segment(3);
+ $render = $this->mrender->get_row($render_id);
+
+ $user = $this->phpsession->get('fuser');
+ $feltolto = $this->phpsession->get('feltolto');
+
+ if( isset($render->keszkep) && $render->keszkep != "" && file_exists($render->keszkep) && ( $render->user_id == $user['user_id'] || $render->user_id == $feltolto['user_id'] ) ){
+ $path_parts = pathinfo($render->keszkep);
+ $ext = strtolower($path_parts["extension"]);
+
+ if($render->render_name == "")
+ $render->render_name = "Image";
+
+ header("Content-type: application-download");
+ header('Content-Disposition: attachment; filename="'.$render->render_name.'.'.$ext.'"');
+ readfile($render->keszkep);
+ }else{
+ print "hiba a letoltes kozben";
+ }
+ }
+
+ function myshowroom(){
+ $user = $this->phpsession->get('fuser');
+ $feltolto = $this->phpsession->get('feltolto');
+ if(!$user && !$feltolto)
+ redirect('forum');
+
+ if(!$user)
+ $user = $feltolto;
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['tartalom'] = 'forum/myshowroom';
+
+ $data['title'] = hun() ? 'ARCHLine.XP Saját Bemutatóterem' : 'ARCHLine.XP My Showroom';
+ $uid = $user['user_id'];
+ $data['uid'] = $uid;
+ $data['elemek'] = $this->db->query("SELECT * FROM collection_user WHERE userid={$uid} AND deleted=0")->result();
+
+ $data['aktmenu'] = "5";
+
+ $data['javascript'] = array('fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack','fancybox/fancy');
+ $data['style'] = array('../js/fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4v2');
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function szerver(){
+ print "";
+ print_r($_SERVER);
+ print "\n\n";
+ // print_r($GLOBALS);
+ print "
";
+ }
+
+
+ function downloadbeta32(){
+ $user = $this->fuser;
+ $login = $user['name'];
+ $email = $this->mforum->get_user_alap($login);
+ redirect('events/click/betaletoltes32/'.$email[0]->email);
+ }
+
+ function downloadbeta64(){
+ $user = $this->phpsession->get('fuser');
+ $login = $user['name'];
+ $email = $this->mforum->get_user_alap($login);
+ redirect('events/click/betaletoltes64/'.$email[0]->email);
+ }
+
+
+ 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->ervenydessegazon,"/");
+ setcookie("hash",$_COOKIE['hash'] ,time()+$this->ervenydesseg,"/");
+
+ return true;
+
+ }else{
+ return false;
+ }
+ }
+
+
+}
+
+function hasonlito( $a, $b ){
+ if ( $a->datum == $b->datum )
+ return 0;
+ if ( $a->datum > $b->datum )
+ return -1;
+ return 1;
+}
+
+?>
diff --git a/var/www/hosting/archlinexp.com/partners/application/controllers/forum.php~.evidence.json b/var/www/hosting/archlinexp.com/partners/application/controllers/forum.php~.evidence.json
new file mode 100644
index 0000000..869f1ba
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/application/controllers/forum.php~.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "5310",
+ "log_excerpt": "[quarantine] partners.archlinexp.com:application/controllers/forum.php~ -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/archlinexp.com/partners/application/controllers/forum.php~)",
+ "original_sha256": "bc5530aba3a1c3ad0e26f50d32bdd4e9e4e9cd9ed3b5985e87dba6f7d7fc936c",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1404821325,
+ "size": 80439,
+ "uid": 11669
+ },
+ "rel_path": "application/controllers/forum.php~",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "partners.archlinexp.com"
+}
diff --git a/var/www/hosting/archlinexp.com/partners/application/controllers/groups.php b/var/www/hosting/archlinexp.com/partners/application/controllers/groups.php
new file mode 100644
index 0000000..59d8bb5
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/application/controllers/groups.php
@@ -0,0 +1,340 @@
+lang->load('site', $this->muser->user['lang']);
+ $this->load->model('mgroups');
+ }
+
+
+ function index()
+ {
+ $this->kategoria();
+ }
+
+ function upload(){
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Új Csoport';
+ else
+ $data['title'] = 'ARCHLine.XP New Group';
+
+ if($this->uri->segment(3)=="java"){
+ $data['tartalom']='groups/java';
+ }
+ else if($this->uri->segment(3)=="simple"){
+ $data['tartalom']='groups/simple';
+ }
+ else{
+ $data['tartalom']='groups/upload';
+ }
+ $data['csik']=array('home','groups');
+ $data['javascript'] = array('onUploadFinished','dl_select');
+ $data['kategoriak'] = $this->muser->get_kategoriak('group');
+
+ $this->load->view('site',$data);
+ }
+
+ function uploadnew(){
+ redirect('/collection/upload/'.$this->uri->segment(3).'/group');
+
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Új Csoport';
+ else
+ $data['title'] = 'ARCHLine.XP New Group';
+
+ if($this->uri->segment(3)!=""/* && $this->uri->segment(4)!=""*/){
+ $data["fajl"] = $this->uri->segment(3);
+
+ $data["eredeti"] = $this->uri->segment(4);
+
+
+ $fajlnev = '/home/vendeg/'.$this->uri->segment(3);
+ $fa = fopen( $fajlnev, "r" ) or die("Upload error"); //or die("$fajlnev nem nyithato meg");
+ $ol = fgets( $fa, 1024);
+ $adatok = explode("#",$ol);
+ // if( count($adatok) == 5){
+ $lang = $this->muser->user['lang'];
+ $honnan = "/home/vendeg/".$adatok[2];
+ $kepnev = time()."_".$adatok[3];
+ $ide= "public/img/groups/".$lang."/".$kepnev;
+ //$ide= "public/img/groups/temp/".$kepnev;
+ if( 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];
+
+
+ // $kepresz = substr($data["kepalap"],0,18);
+ // print "rész: ".$kepresz.$lang."/".$data["kepalap"];
+
+ // }
+ fclose($fa);
+
+
+
+ $data['tartalom']='groups/uploadnew';
+ }else{
+ redirect('groups/upload');
+ }
+
+ $data['csik']=array('home','groups');
+ $data['javascript'] = array('objfeltoltes');
+
+ $data['kategoriak'] = $this->muser->get_kategoriak('group');
+
+ $this->load->view('site',$data);
+ }
+
+ function simple(){
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Új Csoport';
+ else
+ $data['title'] = 'ARCHLine.XP New Group';
+ $data['tartalom']='groups/simple';
+ $data['csik']=array('home','groups');
+
+ $this->load->view('site',$data);
+ }
+
+ function kat(){
+
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Csoportok';
+ else
+ $data['title'] = 'ARCHLine.XP Groups';
+
+ $data['tartalom']='groups/kat';
+ $data['csik']=array('home','groups');
+ $data['javascript']=array('dl_select');
+
+ if(!$this->uri->segment(3))
+ $kat = 2;
+ else
+ $kat = $this->uri->segment(3);
+ $csoportok = $this->mgroups->get_bykat($kat);
+ $data['groups']=$csoportok;
+
+ $data['kategoriak'] = $this->muser->get_kategoriak('group');
+
+ $data['aktiv']=$kat;
+ $this->load->view('site',$data);
+ }
+
+ function kategoria(){
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Csoportok';
+ else
+ $data['title'] = 'ARCHLine.XP Groups';
+
+ $data['tartalom']='groups/kat';
+ $data['csik']=array('home','groups');
+ $data['javascript']=array('dl_select');
+
+ if(!$this->uri->segment(3) || !( $this->muser->letezokategoria($this->uri->segment(3),'group') ) )
+ $kat = 20;
+ else
+ $kat = $this->uri->segment(3);
+
+ redirect("/collection/kategoria/".$kat);
+
+ $data['groups']=$this->mgroups->get_bykategoria($kat);
+
+ $kategoriak = $this->muser->get_kategoriak('group');
+ $kategoriak = $this->mgroups->get_darab($kategoriak);
+
+ $data['kategoriak'] = $kategoriak;
+
+ $data['aktiv']=$kat;
+
+ $data['title'] .= " - " . $this->muser->get_katName($kat);
+
+ $this->load->view('site',$data);
+ }
+
+ function submit(){
+ $lang = $this->muser->user['lang'];
+ $tempFolder = "/home/vendeg/"; //ide másolja az FTP applet a fájlt
+ $storeFolder = "/home/cadline/public_html/website/public/groups/".$lang."/"; //mi itt szeretnénk tárolni
+ $error = "";
+ $kep = "";
+ $link = "public/groups/".$lang."/";
+
+ // ha java-val:
+ if( isset($_POST["tempFilenameField"]) ){
+ $tempFilename = $_POST["tempFilenameField"]; //ezen a néven kerül feltöltésre a fájl (pl. 123456.file)
+ $originalFilename = $_POST["originalFilenameField"]; //ez volt az eredeti neve (pl. szoveg.doc)
+ $storeFilename = time()."_".$originalFilename; //ezen a neven taroljuk mi (pl. 2347686323_szoveg.doc)
+
+
+ $storePath = $storeFolder.$storeFilename;
+ $tempPath = $tempFolder.$tempFilename;
+
+ if ((strlen($tempFilename) < 3) || (strlen($originalFilename) < 3)){
+ die ("Hibás fáljnevek!");
+ $error .= "hiba";
+ }
+
+ if (!copy($tempPath,$storePath)){
+ $error .= "nem másoltam.
mit: ".$tempPath.", hova: ".$storePath;
+ }else{
+ $link .= $storeFilename;
+ $prSize = 6500;
+ $prSize = filesize($storePath); //??
+ $this->kep(&$kep);
+ }
+
+ }
+ // ha egyszerusitve:
+ else if ($_FILES["originalFilenameField"]["error"]==0){
+
+ $storeFolder = "public/groups/".$lang."/";
+ $storeFilename= $storeFolder.time()."_". $_FILES["originalFilenameField"]["name"];
+
+ $tempFilename = $_FILES["originalFilenameField"]["tmp_name"];
+
+ if (copy($_FILES["originalFilenameField"]["tmp_name"],$storeFilename)){
+ $prFile = $storeFilename;
+ $prSize = $_FILES['originalFilenameField']['size'];
+ }else{
+ $prFile = "NULL";
+ $error .= "
nem másoltam.
ezt: ".$_FILES["originalFilenameField"]["tmp_name"].", ide: ".$storeFilename;
+ }
+ $originalFilename = $_FILES["originalFilenameField"]["name"];
+ $storePath = $storeFilename;
+
+ $this->kep(&$kep);
+
+ $link = $storeFilename;
+
+ }else{
+ $error = "nincs csoport fajl";
+ }
+
+
+
+ // Felvétel az adatbázisba
+ if(!$error){
+ $ujgr->email = $_POST["projectEmailField"];
+ $ujgr->title = $_POST["projhectNameField"];
+ $ujgr->meret = $prSize;
+ $ujgr->datum = date('Y-m-d H:i:s',time());
+ $ujgr->nyelv = $lang;
+ $ujgr->kep = $kep;
+ $ujgr->kategoria = $_POST["kategoria"];
+ $ujgr->text = $_POST["projectDescriptionField"];
+ $ujgr->group = $link;
+ $ujgr->szerzo = $_POST["SzerzoField"];
+
+ if( $_POST["kategoria"] > 20 )
+ $ujgr->kat_id = $_POST["kategoria"];
+ else
+ $ujgr->kat_id = "";
+
+ $this->mgroups->newgroup($ujgr);
+
+ //print "
Új csoport felvéve!";
+ }else{
+ //print "
Nem került új csoport az adatbázisba!";
+ //print $error;
+ }
+
+ //ha nem volt print:
+ redirect('groups/kategoria/'.$_POST["kategoria"]);
+ }
+
+ function submitnew(){
+ $lang = $this->muser->user['lang'];
+ $tempFolder = "/home/vendeg/"; //ide másolja az FTP applet a fájlt
+ $storeFolder = "/home/cadline/public_html/website/public/groups/".$lang."/"; //mi itt szeretnénk tárolni
+ $error = "";
+ $kep = "";
+
+ $fajlnev = $_POST["originalFilenameField"]; // ez van a vendegnel
+ $fajlnev2 = $_POST["eredetinev"]; // ez legyen a publicban
+ $fajl = $tempFolder.$fajlnev;
+
+ $ido = time();
+
+ $storeFilename= $storeFolder.$ido."_".$fajlnev2;
+
+
+ if (copy($fajl,$storeFilename)){
+ $prFile = $storeFilename;
+ $prSize = filesize($storeFilename);
+ // print " Sikerült a másolás! ";
+ }else{
+ $prFile = "NULL";
+ $error .= "Nem másoltam át a fájlt.
Mit: ".$fajlnev.", Hova: ".$fajlnev2;
+ }
+
+ $link = "public/groups/".$lang."/".$ido."_".$fajlnev2;
+
+ $kep = $_POST["kepalap"];
+ $this->kep(&$kep);
+
+
+ // ú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('group',$nevhun,$neveng);
+ }else{
+ $kat_id = $_POST["kategoria"];
+ }
+
+
+ // Felvétel az adatbázisba
+ if(!$error){
+ $ujgr->email = $_POST["projectEmailField"];
+ $ujgr->title = $_POST["projhectNameField"];
+ $ujgr->meret = $prSize;
+ $ujgr->datum = date('Y-m-d H:i:s',time());
+ $ujgr->nyelv = $lang;
+ $ujgr->kep = $kep;
+ $ujgr->kategoria = $_POST["kategoria"];
+ $ujgr->text = $_POST["projectDescriptionField"];
+ $ujgr->group = $link;
+ $ujgr->szerzo = $_POST["SzerzoField"];
+ $ujgr->kat_id = $kat_id;
+
+ $this->mgroups->newgroup($ujgr);
+
+ }
+
+ //ha nem volt print:
+ redirect('groups/kategoria/'.$kat_id);
+ }
+
+ function kep(&$kep){
+ if ($_FILES["kep"]["error"]==0){
+ $lang = $this->muser->user['lang'];
+ $kepnev = time()."_". $_FILES["kep"]["name"];
+ $ide= "public/img/groups/".$lang."/".$kepnev;
+ if (copy($_FILES["kep"]["tmp_name"],$ide)){
+ $kep = $ide;
+ $prSize = $_FILES['kep']['size'];
+ }else{
+ $prFile = "NULL";
+ }
+ }
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/var/www/hosting/archlinexp.com/partners/application/controllers/groups.php.evidence.json b/var/www/hosting/archlinexp.com/partners/application/controllers/groups.php.evidence.json
new file mode 100644
index 0000000..115b0c2
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/application/controllers/groups.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "5318",
+ "log_excerpt": "[quarantine] partners.archlinexp.com:application/controllers/groups.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/archlinexp.com/partners/application/controllers/groups.php)",
+ "original_sha256": "fdcb90729c1adf9157b1bab5c026f02b89deb9a847ebb04809ad4676527d6387",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1396359077,
+ "size": 8872,
+ "uid": 11669
+ },
+ "rel_path": "application/controllers/groups.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "partners.archlinexp.com"
+}
diff --git a/var/www/hosting/archlinexp.com/partners/application/controllers/objects.php b/var/www/hosting/archlinexp.com/partners/application/controllers/objects.php
new file mode 100644
index 0000000..e3d8147
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/application/controllers/objects.php
@@ -0,0 +1,429 @@
+lang->load('site', $this->muser->user['lang']);
+ $this->load->model('mobjects');
+ }
+
+ function index()
+ {
+ $this->kategoria();
+ }
+
+ function upload(){
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Új Objektum';
+ else
+ $data['title'] = 'ARCHLine.XP New Object';
+
+ if($this->uri->segment(3)=="java"){
+ $data['tartalom']='objects/java';
+ }
+ else if($this->uri->segment(3)=="simple"){
+ $data['tartalom']='objects/simple';
+ }
+ else{
+ $data['tartalom']='objects/upload';
+ }
+ $data['csik']=array('home','objects');
+ $data['javascript'] = array('onUploadFinished');
+ $data['kategoriak'] = $this->muser->get_kategoriak('object');
+
+ $this->load->view('site',$data);
+ }
+
+ function uploadnew(){
+ redirect('/collection/upload/'.$this->uri->segment(3).'/object');
+
+ if(hun()){
+ $data['title'] = 'ARCHLine.XP Új Objektum';
+ $data['feltetel'] = $this->mpages->get_row(572);
+ }
+ else{
+ $data['title'] = 'ARCHLine.XP New Object';
+ $data['feltetel'] = $this->mpages->get_row(571);
+ }
+
+ if($this->uri->segment(3)!=""/* && $this->uri->segment(4)!=""*/){
+ $data["fajl"] = $this->uri->segment(3);
+ $data["eredeti"] = $this->uri->segment(4);
+
+ /* szövegfájl átadással */
+ if(/*eng()*/true){
+ $fajlnev = '/home/vendeg/'.$this->uri->segment(3);
+ $fa = fopen( $fajlnev, "r" ) or die("Upload error");
+ $ol = fgets( $fa, 1024);
+ $adatok = explode("#",$ol);
+ // if( count($adatok) == 5){
+ $lang = $this->muser->user['lang'];
+ $honnan = "/home/vendeg/".$adatok[2];
+ $kepnev = time()."_".$adatok[3];
+ $ide= "public/img/objects/".$lang."/".$kepnev;
+ //$ide= "public/img/objects/temp/".$kepnev;
+ if( 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];
+
+ // echo(unicode_encode($data["fajl"], 'UTF-8'));
+ //print_r($data);
+ // }
+ fclose($fa);
+ }
+
+ }else{
+ redirect('objects/upload');
+ }
+
+ $data['tartalom']='objects/uploadnew';
+ $data['csik']=array('home','objects');
+ $data['javascript'] = array('objfeltoltes');
+ $data['kategoriak'] = $this->muser->get_kategoriak('object');
+
+ //print_r($data);
+
+ $this->load->view('site_upload',$data);
+ }
+
+
+
+
+
+
+ function upload2(){
+ redirect("collection/upload/".$this->uri->segment(3)."/object");
+
+ /*if(hun()){
+ $data['title'] = 'ARCHLine.XP Új Objektum';
+ $data['feltetel'] = $this->mpages->get_row(572);
+ }
+ else{
+ $data['title'] = 'ARCHLine.XP New Object';
+ $data['feltetel'] = $this->mpages->get_row(571);
+ }
+
+ if($this->uri->segment(3)!=""){
+ $data["fajl"] = $this->uri->segment(3);
+ $data["eredeti"] = $this->uri->segment(4);
+
+ /* szövegfájl átadással */
+ /*$fajlnev = '/home/vendeg/'.$this->uri->segment(3);
+ $fa = fopen( $fajlnev, "r" ) or die("Upload error");
+ $ol = fgets( $fa, 1024);
+ $adatok = explode("#",$ol);
+ $lang = $this->muser->user['lang'];
+ $honnan = "/home/vendeg/".$adatok[2];
+ $kepnev = time()."_".$adatok[3];
+ $ide= "public/img/objects/".$lang."/".$kepnev;
+ if( 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];
+
+ fclose($fa);
+
+ }else{
+ redirect('objects/upload');
+ }
+
+ $data['tartalom']='objects/uploadnew';
+ $data['javascript'] = array('objfeltoltes');
+ $data['kategoriak'] = $this->muser->get_kategoriak('object');
+
+ $this->load->view('site_upload',$data);*/
+ }
+
+
+
+
+
+
+
+ function simple(){
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Új Objektum';
+ else
+ $data['title'] = 'ARCHLine.XP New Object';
+ $data['tartalom']='objects/simple';
+ $data['csik']=array('home','objects');
+
+ $this->load->view('site',$data);
+ }
+
+ function kat(){
+
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Objektumok';
+ else
+ $data['title'] = 'ARCHLine.XP Objects';
+
+ $data['tartalom']='objects/kat';
+ $data['csik']=array('home','objects');
+ $data['javascript']=array('dl_select');
+
+ if(!$this->uri->segment(3))
+ $kat = 2;
+ else
+ $kat = $this->uri->segment(3);
+
+ $data['objects']=$this->mobjects->get_bykat($kat);
+
+ //$nyelv = $this->muser->user['lang'];
+
+ $data['kategoriak'] = $this->muser->get_kategoriak('object');
+
+ $data['aktiv']=$kat;
+ $this->load->view('site',$data);
+
+ }
+
+ function kategoria(){
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Objektumok';
+ else
+ $data['title'] = 'ARCHLine.XP Objects';
+
+ $data['tartalom']='objects/kat';
+ $data['csik']=array('home','objects');
+ $data['javascript']=array('dl_select','objfeltoltes');
+
+ if( !$this->uri->segment(3) || !( $this->muser->letezokategoria($this->uri->segment(3),'object') ))
+ $kat = 26;
+ else
+ $kat = $this->uri->segment(3);
+
+
+ redirect("/collection/kategoria/".$kat);
+
+ $data['objects']=$this->mobjects->get_bykategoria($kat);
+
+
+ $kategoriak = $this->muser->get_kategoriak('object');
+ $kategoriak = $this->mobjects->get_darab($kategoriak);
+
+ $data['kategoriak'] = $kategoriak;
+ //$data['kategoriak'] = $this->muser->get_kategoriak('object');
+
+ $data['aktiv']=$kat;
+ $data['title'] .= " - " . $this->muser->get_katName($kat);
+
+ $this->load->view('site',$data);
+ }
+
+ function get()
+ {
+ $download_id = $this->uri->segment(3);
+ if(!$download_id || !is_numeric($download_id))
+ {
+ show_404();
+ }
+
+ $record = $this->mobjects->get_row($download_id);
+ if(!$record)
+ {
+ show_404();
+ }
+
+ redirect($record->object);
+ }
+
+ function submit(){
+ $lang = $this->muser->user['lang'];
+ $tempFolder = "/home/vendeg/"; //ide másolja az FTP applet a fájlt
+ $storeFolder = "/home/cadline/public_html/website/public/objects/".$lang."/"; //mi itt szeretnénk tárolni
+ $error = "";
+ $kep = "";
+ $link = "public/objects/".$lang."/";
+
+ // ha java-val:
+ if( isset($_POST["tempFilenameField"]) ){
+ $tempFilename = $_POST["tempFilenameField"]; //ezen a néven kerül feltöltésre a fájl (pl. 123456.file)
+ $originalFilename = $_POST["originalFilenameField"]; //ez volt az eredeti neve (pl. szoveg.doc)
+ $storeFilename = time()."_".$originalFilename; //ezen a neven taroljuk mi (pl. 2347686323_szoveg.doc)
+
+
+ $storePath = $storeFolder.$storeFilename;
+ $tempPath = $tempFolder.$tempFilename;
+
+ if ((strlen($tempFilename) < 3) || (strlen($originalFilename) < 3)){
+ die ("Hibás fáljnevek!");
+ $error .= "hiba";
+ }
+
+ //chmod($tempPath,0777);
+ if (!copy($tempPath,$storePath)){
+ //if (!rename($tempPath,$storePath)){
+ // print "Nem sikerül a helyére másolni a feltöltött fájlt!
";
+ $error .= "hiba";
+ }else{
+ // print "Sikeres feltöltés ($originalFilename)
";
+ //$storeFilename = $storePath;
+ $link .= $storeFilename;
+ $prSize = 6500;
+ $prSize = filesize($storePath); //??
+ $this->kep(&$kep);
+ }
+
+ }
+ // ha egyszerusitve:
+ else if ($_FILES["originalFilenameField"]["error"]==0){
+
+ $storeFolder = "public/objects/".$lang."/";
+ $storeFilename= $storeFolder.time()."_". $_FILES["originalFilenameField"]["name"];
+
+ $tempFilename = $_FILES["originalFilenameField"]["tmp_name"];
+
+ if (copy($_FILES["originalFilenameField"]["tmp_name"],$storeFilename)){
+ $prFile = $storeFilename;
+ $prSize = $_FILES['originalFilenameField']['size'];
+ }else{
+ $prFile = "NULL";
+ $error .= "hiba..";
+ }
+ $originalFilename = $_FILES["originalFilenameField"]["name"];
+ $storePath = $storeFilename;
+
+ $this->kep(&$kep);
+
+ $link = $storeFilename;
+
+ }else{
+ $error = "nincs objektum fajl";
+ }
+
+
+ // Felvétel az adatbázisba
+ 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 = $link;
+ $ujpr->szerzo = $_POST["SzerzoField"];
+ $ujpr->kat_id = $_POST["kategoria"];
+
+ $this->mobjects->newobject($ujpr);
+
+ //print "
Új projekt felvéve";
+ }else{
+ //print "
Nem került adat az adatbázisba";
+ }
+
+ //ha nem volt print:
+ redirect('objects/kategoria/'.$_POST["kategoria"]);
+ }
+
+ function submitnew(){
+ $lang = $this->muser->user['lang'];
+ $tempFolder = "/home/vendeg/"; //ide másolja az FTP applet a fájlt
+ $storeFolder = "/home/cadline/public_html/website/public/objects/".$lang."/"; //mi itt szeretnénk tárolni
+ $error = "";
+ $kep = "";
+
+ $fajlnev = $_POST["originalFilenameField"]; // ez van a vendegnel
+ $fajlnev2 = $_POST["eredetinev"]; // ez legyen a publicban
+ $fajl = $tempFolder.$fajlnev;
+
+ $ido = time();
+
+ $storeFilename= $storeFolder.$ido."_".$fajlnev2;
+
+
+ if (copy($fajl,$storeFilename)){
+ $prFile = $storeFilename;
+ $prSize = filesize($storeFilename);
+ }else{
+ $prFile = "NULL";
+ $error .= "Nem másoltam át a fájlt
vendegben: ".$fajlnev." publicba: ".$fajlnev2;
+ }
+
+ $link = "public/objects/".$lang."/".$ido."_".$fajlnev2;
+
+ $kep = $_POST["kepalap"];
+ $this->kep(&$kep);
+
+
+ // ú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('object',$nevhun,$neveng);
+ }else{
+ $kat_id = $_POST["kategoria"];
+ }
+
+
+ // Felvétel az adatbázisba
+ 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 = $link;
+ $ujpr->szerzo = $_POST["SzerzoField"];
+ $ujpr->kat_id = $kat_id;
+
+ $this->mobjects->newobject($ujpr);
+
+ //print "
Új projekt felvéve";
+ }else{
+ //print "
Nem került adat az adatbázisba";
+ //print $error;
+ }
+
+ //ha nem volt print:
+ redirect('objects/kategoria/'.$kat_id);
+ }
+
+ function kep(&$kep){
+ if ($_FILES["kep"]["error"]==0){
+ $lang = $this->muser->user['lang'];
+ $kepnev = time()."_". $_FILES["kep"]["name"];
+ $ide= "public/img/objects/".$lang."/".$kepnev;
+ if (copy($_FILES["kep"]["tmp_name"],$ide)){
+ $kep = $ide;
+ $prSize = $_FILES['kep']['size'];
+ //print " Sikerült a képmásolás! ";
+ }else{
+ $prFile = "NULL";
+ //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/objects.php.evidence.json b/var/www/hosting/archlinexp.com/partners/application/controllers/objects.php.evidence.json
new file mode 100644
index 0000000..57e0792
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/application/controllers/objects.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "5311",
+ "log_excerpt": "[quarantine] partners.archlinexp.com:application/controllers/objects.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/archlinexp.com/partners/application/controllers/objects.php)",
+ "original_sha256": "b6f11c4b3be5f7f0a5a2e18c82cf8861937fdbc3ee9b317d03ec4ec923cdaf5f",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1396359078,
+ "size": 11000,
+ "uid": 11669
+ },
+ "rel_path": "application/controllers/objects.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "partners.archlinexp.com"
+}
diff --git a/var/www/hosting/archlinexp.com/partners/application/controllers/projects.php b/var/www/hosting/archlinexp.com/partners/application/controllers/projects.php
new file mode 100644
index 0000000..a5a6381
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/application/controllers/projects.php
@@ -0,0 +1,445 @@
+lang->load('site', $this->muser->user['lang']);
+
+ $this->load->model('mprojects');
+ }
+
+ function index()
+ {
+ $this->kategoria();
+ }
+
+ function supportupload(){
+ include('application/helpers/sajatfeltolto.php');
+
+ $guid = $this->uri->segment(4);
+ $sorozatszam = $this->uri->segment(3);
+
+ print_r($this->uri->segments);
+
+ print "guid: ".$guid."
sorozatszam: ".$sorozatszam;
+
+ if( !$guid || !$sorozatszam ){
+ $record->osztaly = "projects";
+ $record->fv = "supportupload";
+ $record->hiba = "Hiányzó guid vagy sorozatszám:\n".$guid."\n".$sorozatszam;
+ $record->datum = date('Y-m-d H:i:s',time());
+ $this->db->insert('a_hibak',$record);
+
+ return;
+ }
+
+ $honnan = '/home/vendeg/support/'.$guid;
+ $hova = 'public/ugyfelupload/'.$sorozatszam;
+
+ if( !file_exists($honnan) && file_exists($honnan."=") )
+ $honnan .= "=";
+ elseif( !file_exists($honnan) && file_exists($honnan."==") )
+ $honnan .= "==";
+
+
+ if(!is_dir($hova)){
+ mkdir($hova,0777);
+ exec("chmod 777 /var/www/hosting/cadline.hu/www/".$hova);
+ }
+ $hova .= "/".trim(base64_decode($guid),"=");;
+
+ if( athelyez($honnan,$hova) ){
+ exec("chmod 777 /var/www/hosting/cadline.hu/www/".$hova);
+ }
+ else{
+ // sikertelen masolas
+
+ $record->osztaly = "projects";
+ $record->fv = "supportupload";
+ $record->hiba = "Másolás hiba, honnan:".$honnan."\nhova: ".$hova;
+ $record->datum = date('Y-m-d H:i:s',time());
+ $this->db->insert('a_hibak',$record);
+ }
+
+ }
+
+ function upload(){
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Új Projekt';
+ else
+ $data['title'] = 'ARCHLine.XP New Project';
+
+ if($this->uri->segment(3)=="java"){
+ $data['tartalom']='projects/java';
+ }
+ else if($this->uri->segment(3)=="simple"){
+ $data['tartalom']='projects/simple';
+ }
+ else{
+ $data['tartalom']='projects/upload';
+ }
+
+ $data['kategoriak'] = $this->muser->get_kategoriak('project');
+
+ $data['csik']=array('home','projects');
+ $data['javascript'] = array('onUploadFinished');
+
+ $this->load->view('site',$data);
+ }
+
+ function uploadnew(){
+ redirect('/collection/upload/'.$this->uri->segment(3).'/project');
+
+ if(hun()){
+ $data['title'] = 'ARCHLine.XP Új Projekt';
+ $data['feltetel'] = $this->mpages->get_row(572);
+ }
+ else{
+ $data['title'] = 'ARCHLine.XP New Project';
+ $data['feltetel'] = $this->mpages->get_row(571);
+ }
+
+
+ if($this->uri->segment(3)!=""){
+ $data["fajl"] = $this->uri->segment(3);
+ $data["eredeti"] = $this->uri->segment(4);
+
+
+ $fajlnev = '/home/vendeg/'.$this->uri->segment(3);
+ $fa = fopen( $fajlnev, "r" ) or die("Upload error");
+ $ol = fgets( $fa, 1024);
+ $adatok = explode("#",$ol);
+ // if( count($adatok) == 5){
+ $lang = $this->muser->user['lang'];
+ $honnan = "/home/vendeg/".$adatok[2];
+ $kepnev = time()."_".$adatok[3];
+ $ide= "public/img/projects/".$lang."/".$kepnev;
+ //$ide= "public/img/projects/temp/".$kepnev;
+ if( 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];
+
+ // }
+ fclose($fa);
+
+
+ $data['tartalom']='projects/uploadnew';
+ }else{
+ redirect('projects/upload');
+ }
+
+ $data['kategoriak'] = $this->muser->get_kategoriak('project');
+
+ $data['javascript'] = array('objfeltoltes');
+
+ $this->load->view('site_upload',$data);
+ }
+
+ function simple(){
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Új Projekt';
+ else
+ $data['title'] = 'ARCHLine.XP New Project';
+ $data['tartalom']='projects/simple';
+ $data['csik']=array('home','projects');
+
+ $this->load->view('site',$data);
+ }
+
+ function cadline(){
+ $data['title'] = 'ARCHLine.XP Projektek szerkesztése';
+ $data['tartalom']='projects/cadline';
+ $data['csik']=array('home','projects');
+
+ //$projects = $this->mprojects->get_all();
+ //$data['projects'] = $projects;
+
+ $this->load->view('site',$data);
+ }
+
+ function kat(){
+
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Projektek';
+ else
+ $data['title'] = 'ARCHLine.XP Projects';
+
+ $data['tartalom']='projects/kat';
+ $data['csik']=array('home','projects');
+ $data['javascript']=array('dl_select');
+
+ if(!$this->uri->segment(3) || !is_numeric($this->uri->segment(3)))
+ $kat = 6;
+ else
+ $kat = $this->uri->segment(3);
+
+ $projektek = $this->mprojects->get_bykat($kat);
+ $data['projects']=$projektek;
+
+ $data['kategoriak'] = $this->muser->get_kategoriak('project');
+
+ $data['aktiv']=$kat;
+ $this->load->view('site',$data);
+ }
+
+ function kategoria(){
+ redirect("/collection/kategoria/1");
+
+
+
+
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Projektek';
+ else
+ $data['title'] = 'ARCHLine.XP Projects';
+
+ $data['tartalom']='projects/kat';
+ $data['csik']=array('home','projects');
+ $data['javascript']=array('dl_select','objfeltoltes');
+
+ if(!$this->uri->segment(3) || !( $this->muser->letezokategoria($this->uri->segment(3),'project') ) )
+ $kat = 1;
+ else
+ $kat = $this->uri->segment(3);
+
+
+ $data['projects']=$this->mprojects->get_bykategoria($kat);
+
+ $kategoriak = $this->muser->get_kategoriak('project');
+ $kategoriak = $this->mprojects->get_darab($kategoriak);
+
+ $data['kategoriak'] = $kategoriak;
+
+ $data['aktiv']=$kat;
+
+ $data['title'] .= " - " . $this->muser->get_katName($kat);
+
+ $this->load->view('site',$data);
+ }
+
+ function get()
+ {
+ $download_id = $this->uri->segment(3);
+ if(!$download_id || !is_numeric($download_id))
+ {
+ show_404();
+ }
+
+ $record = $this->mprojects->get_row($download_id);
+ if(!$record)
+ {
+ show_404();
+ }
+
+ redirect($record->project);
+ }
+
+ function submit(){
+ $lang = $this->muser->user['lang'];
+ $tempFolder = "/home/vendeg/"; //ide másolja az FTP applet a fájlt
+ $storeFolder = "/home/cadline/public_html/website/public/projects/".$lang."/"; //mi itt szeretnénk tárolni
+ $error = "";
+ $kep = "";
+ $link = "public/projects/".$lang."/";
+
+ // ha java-val:
+ if( isset($_POST["tempFilenameField"]) ){
+ $tempFilename = $_POST["tempFilenameField"]; //ezen a néven kerül feltöltésre a fájl (pl. 123456.file)
+ $originalFilename = $_POST["originalFilenameField"]; //ez volt az eredeti neve (pl. szoveg.doc)
+ $storeFilename = time()."_".$originalFilename; //ezen a neven taroljuk mi (pl. 2347686323_szoveg.doc)
+
+
+ $storePath = $storeFolder.$storeFilename;
+ $tempPath = $tempFolder.$tempFilename;
+
+ if ((strlen($tempFilename) < 3) || (strlen($originalFilename) < 3)){
+ die ("Hibás fáljnevek!");
+ $error .= "hiba";
+ }
+
+ //chmod($tempPath,0777);
+ if (!copy($tempPath,$storePath)){
+ //if (!rename($tempPath,$storePath)){
+ // print "Nem sikerül a helyére másolni a feltöltött fájlt!
";
+ $error .= "hiba";
+ }else{
+ // print "Sikeres feltöltés ($originalFilename)
";
+ //$storeFilename = $storePath;
+ $link .= $storeFilename;
+ $prSize = 6500;
+ $prSize = filesize($storePath); //??
+ $this->kep(&$kep);
+ }
+
+ }
+ // ha egyszerűsítve:
+ else if ($_FILES["originalFilenameField"]["error"]==0){
+
+ $storeFolder = "public/projects/".$lang."/";
+ $storeFilename= $storeFolder.time()."_". $_FILES["originalFilenameField"]["name"];
+
+ $tempFilename = $_FILES["originalFilenameField"]["tmp_name"];
+
+ if (copy($_FILES["originalFilenameField"]["tmp_name"],$storeFilename)){
+ $prFile = $storeFilename;
+ $prSize = $_FILES['originalFilenameField']['size'];
+ }else{
+ $prFile = "NULL";
+ $error .= "hiba..";
+ }
+ $originalFilename = $_FILES["originalFilenameField"]["name"];
+ $storePath = $storeFilename;
+
+ $this->kep(&$kep);
+
+ $link = $storeFilename;
+
+ }else{
+ $error = "nincs projekt fajl";
+ }
+
+
+ // Felvétel az adatbázisba
+ 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 = $link;
+ $ujpr->szerzo = $_POST["SzerzoField"];
+ $ujpr->kat_id = $_POST["kategoria"];
+
+ $this->mprojects->newproject($ujpr);
+
+ //print "
Új projekt felvéve";
+ }else{
+ //print "
Nem került adat az adatbázisba";
+ }
+
+ //ha nem volt print:
+ redirect('projects/kategoria/'.$_POST["kategoria"]);
+ }
+
+
+ function submitnew(){
+ $lang = $this->muser->user['lang'];
+ $tempFolder = "/home/vendeg/"; //ide másolja a program a fájlt
+ $storeFolder = "/home/cadline/public_html/website/public/projects/".$lang."/"; //mi itt szeretnénk tárolni
+ $error = "";
+ $kep = "";
+
+
+ $fajlnev = $_POST["originalFilenameField"]; // ez van a vendegnel
+ //$fajlnev2 = $_POST["eredetinev"]; // ez legyen a publicban
+ //$fajlnev2 = $this->ekezet($_POST["eredetinev"]); // ez legyen a publicban
+
+
+ $fajlnev2 = $_POST["originalFilenameField"]; // ez legyen a publicban
+ $parameterbe = $_POST["eredetinev"]; // ez a név jelenik meg a letöltéskor az url-ben, paraméterként
+
+
+ $fajl = $tempFolder.$fajlnev;
+
+ $link = "public/projects/".$lang."/".$fajl;
+
+ $storeFolder = "public/projects/".$lang."/";
+ $storeFilename= $storeFolder.time()."_".$fajlnev2;
+
+ if (copy($fajl,$storeFilename)){
+ $prFile = $storeFilename;
+ $prSize = filesize($storeFilename);
+ $kep = $_POST["kepalap"];
+ $this->kep(&$kep);
+ }else{
+ $prFile = "NULL";
+ $error .= "Nem másoltam át a fájlt
vendegben: ".$fajlnev." publicba: ".$fajlnev2;
+ }
+ $originalFilename = $_FILES["originalFilenameField"]["name"];
+ $storePath = $storeFilename;
+
+
+ $link = $storeFilename;
+
+
+
+ // ú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('project',$nevhun,$neveng);
+ }else{
+ $kat_id = $_POST["kategoria"];
+ }
+
+
+ // Felvétel az adatbázisba
+ 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 = $kat_id;
+ $ujpr->text = $_POST["projectDescriptionField"];
+ $ujpr->project = $link;
+ $ujpr->eredeti = $parameterbe;
+ $ujpr->szerzo = $_POST["SzerzoField"];
+ $ujpr->kat_id = $kat_id;
+
+ $this->mprojects->newproject($ujpr);
+
+ // print "
Új projekt felvéve";
+ // print_r($ujpr);
+ }else{
+ //print "
Nem került adat az adatbázisba";
+ //print $error;
+ }
+
+ //ha nem volt print:
+ redirect('projects/kategoria/'.$kat_id);
+ }
+
+ 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 kep(&$kep){
+ if ($_FILES["kep"]["error"]==0){
+ $lang = $this->muser->user['lang'];
+ $kepnev = time()."_". $_FILES["kep"]["name"];
+ $ide= "public/img/projects/".$lang."/".$kepnev;
+ if (copy($_FILES["kep"]["tmp_name"],$ide)){
+ $kep = $ide;
+ }
+ }
+ }
+
+
+}
+
+?>
\ No newline at end of file
diff --git a/var/www/hosting/archlinexp.com/partners/application/controllers/projects.php.evidence.json b/var/www/hosting/archlinexp.com/partners/application/controllers/projects.php.evidence.json
new file mode 100644
index 0000000..1b47c35
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/application/controllers/projects.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "5314",
+ "log_excerpt": "[quarantine] partners.archlinexp.com:application/controllers/projects.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/archlinexp.com/partners/application/controllers/projects.php)",
+ "original_sha256": "b42c1a5d2f1fefe1598248fc7213915e840173c5196c1022ec40dde2d01446a6",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1396359078,
+ "size": 11689,
+ "uid": 11669
+ },
+ "rel_path": "application/controllers/projects.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "partners.archlinexp.com"
+}
diff --git a/var/www/hosting/archlinexp.com/partners/application/controllers/testforum.php b/var/www/hosting/archlinexp.com/partners/application/controllers/testforum.php
new file mode 100644
index 0000000..8dbf5b0
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/application/controllers/testforum.php
@@ -0,0 +1,2367 @@
+userekoldal = 30;
+
+ $user = $this->phpsession->get('fuser');
+ if(!$user){
+
+ }else{
+ $this->fuser = $user;
+ }
+
+ $this->lang->load('site', $this->muser->user['lang']);
+ $this->load->model('mforum');
+
+ define( "BENTIIP", "84.3.20.66aaaaaaaaaaaa");
+ define( "UBUNTU", "o33333333333");
+ define( "MEHET", "igen");
+
+ }
+
+ function index()
+ {
+ $this->temakorok();
+ }
+
+ function temakorok(){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='testforum/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']='testforum/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);
+
+ $temak = $this->mforum->get_alap2($temakor, $temaoldal);
+ foreach( $temak as $tema ){
+ $cim = $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['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'));
+
+ 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']='testforum/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']='testforum/ujtemakor';
+ $data['csik']=array('home','forum');
+
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ $this->index();
+ }
+ }
+
+ function csere($input){
+ $mit[0]="/>/";
+ $mit[1]="/";
+ $mit[2]="/\n/";
+ $mit[3]="/'/";
+ $mit[4]="/=/";
+ $mit[5]="/\"/";
+ $mit[6]="/;/";
+ $mire[0]=">";
+ $mire[1]="<";
+ $mire[2]="
";
+ $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');
+
+
+ if(!$this->input->post('valasz'))
+ $valasz = $this->phpsession->get('valasz');
+ else
+ $valasz = $this->input->post('valasz');
+
+
+
+ if($hszszoveg == "" || $hszszoveg == "
")
+ $error .= "Üres hozzászólás!
";
+
+
+ if ($_FILES["fkep"]["error"]==0 && ($error == "") ){
+ $login = $tomb['name'];
+ $user_id = $this->mforum->get_userid($login);
+ //ha nincs mappája
+ if(hun())
+ $hova = $this->kepek_utvonal.$user_id;
+ elseif(eng())
+ $hova = $this->kepek_utvonal_eng.$user_id;
+
+ if(!is_dir($hova)){
+ //akkor hozza létre
+ mkdir($hova,0644);
+ chmod($hova,0777);
+ }
+ $feltolt_konyvtar = $hova."/";
+ //ha több fájl lenne ugyanazon a néven
+ $rand = rand(100,999);
+ $feltolt_fajlnev=$feltolt_konyvtar . $rand . "__" . $this->ekezet($_FILES["fkep"]["name"]);
+
+ $error = "";
+ $mi = $_FILES['fkep']['name']."$";
+
+ $mire = "\.bmp|\.jpg|\.jpeg|\.png|\.gif|\.tif|\.BMP|\.JPG|\.PNG|\.GIF";
+ if( !(ereg( $mire , $mi )) ){
+ $error .= "Hibás fájl kiterjesztés, elfogadott kiterjesztések: .bmp, .jpg, .png, .gif
";
+ }
+ if( $_FILES['fkep']['size'] > 1024 * 1024 * 10 ){
+ $error .= "A kép mérete nagyobb 10 MB-nál.
";
+ }
+ else if( $hszszoveg != "" && !$error){
+ if (copy($_FILES["fkep"]["tmp_name"], $feltolt_fajlnev)){
+ $kep = $rand . "__". $this->ekezet($_FILES["fkep"]["name"]);
+ $mit = $hova."/".$kep;
+ chmod($mit,0777);
+ }else{
+ $kep = "NULL";
+ }
+ }
+ }
+
+ if(!$error){
+ $this->mforum->hszbeszur($hszszoveg,$tema_id,$valasz,$kep);
+
+ $this->load->library('email');
+ $this->email->initialize();
+ // ertesitesek kikuldese
+ $kiknek = $this->mforum->ertesites($tema_id);
+ foreach($kiknek as $kinek){
+ $alap = $this->mforum->default_mail($kinek->email);
+ if(!$alap)
+ $alap = $kinek->email;
+
+ $mail_data['tema'] = $this->mforum->get_cim($tema_id)->cim;
+ $mail_data['hsz'] = $hszszoveg;
+
+ $this->email->from('info@cadline.hu', 'Cadline Weboldal');
+ $this->email->subject('ARCHLine.XP Fórum - Új hozzászólás');
+ $this->email->message($this->load->view('mail/forum_ujhsz', $mail_data, true));
+
+ $this->email->send($alap, 'smtp');
+ $this->email->clear();
+ }
+ // end ertesitesek kikuldese
+
+
+ $temaid = $this->phpsession->get('tema_id');
+ header("Location: listaz/$temaid");
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='testforum/ujhsz';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+ $data['error']=$error;
+ $data['hsz']=$this->input->post('hsz');
+
+ $this->load->view('site_forum',$data);
+ }
+ }else if( $this->phpsession->get('temaid') ){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='testforum/ujhsz';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('../editor/fckeditor');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ $this->index();
+ }
+ }
+
+ function valasz(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->uri->segment(3) ){
+ $this->phpsession->save('valasz',$this->uri->segment(3));
+ $id = $this->uri->segment(3);
+ $temaid = $this->mforum->get_temaidByHszid($id);
+ $this->phpsession->save('temaid',$temaid);
+ }
+ if( $tomb ){
+ if( $this->phpsession->get('temaid') ){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='testforum/ujhsz';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('../editor/fckeditor');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ $this->index();
+ }
+ }
+
+ function listaz(){
+ $this->phpsession->save('valasz',false);
+ if( !($this->phpsession->get('oldal')) ) $this->phpsession->save('oldal',0);
+ if( $this->uri->segment(3) == 'kov' ) $this->kovetkezo();
+ if( $this->uri->segment(3) == 'elozo' ) $this->elozo();
+
+ if( is_numeric($this->uri->segment(3)) ){
+ $tema_id = $this->uri->segment(3);
+ $this->phpsession->save('temaid',$tema_id);
+// redirect('forum/listaz');
+ }else if($this->phpsession->get('temaid')){
+ $tema_id = $this->phpsession->get('temaid');
+ }else{
+ $tema_id = 0;
+ }
+
+ if(!($tema_id) || !is_numeric($tema_id) || !$this->mforum->is_temaid($tema_id)){
+ redirect('forum');
+ }else{
+ $data['tartalom']='testforum/temamutat';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ if( !is_numeric($this->uri->segment(4)) )
+ $oldal = $this->phpsession->get('oldal');
+ else{
+ $oldal = $this->uri->segment(4);
+ $this->phpsession->save('oldal',$oldal);
+ }
+ $hszek = $this->mforum->get_lista($tema_id,$oldal);
+ foreach( $hszek as $hsz){
+ if( !($hsz->valasz == "0" || $hsz->valasz == "NULL") ){
+ $vszid = $hsz->valasz;
+ $elozo = $this->mforum->get_hsz($vszid);
+ if( $elozo->user == "" )
+ $elozo = $this->mforum->get_hsz2($vszid);
+ if( isset($elozo->user) && $elozo->user != "0" && $elozo->user != "" ){
+ $hsz->valasz = $elozo->user . ", (" . $elozo->datum . ")";
+ if( $elozo->user == 586 )
+ $hsz->valasz = "Németh Kálmán, (" . $elozo->datum . ")";
+ elseif( $elozo->user == 270 )
+ $hsz->valasz = "Tóth M.Levente, Mészáros Marcel, (" . $elozo->datum . ")";
+ }
+ elseif( $elozo )
+ $hsz->valasz = "[Törölt felhasználó], (" . $elozo->datum . ")";
+ else
+ $hsz->valasz = "-";
+ }
+ //if(!eng()) $hsz->szoveg = $this->csere2($hsz->szoveg);
+ if( strtotime($hsz->datum) < 1282039000) $hsz->szoveg = $this->csere2($hsz->szoveg);
+
+ if( $hsz->user_id == 586 ){
+ $hsz->user = "Németh Kálmán";
+ }elseif( $hsz->user_id == 270 ){
+ $hsz->user = "Tóth M.Levente, Mészáros Marcel";
+ }
+ }
+
+ if( !$hszek ){
+ $data['infok'] = array("2");
+ }else{
+ if( $this->mforum->vanmegoldal($tema_id,$this->phpsession->get('oldal')))
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('oldal') > 0 )
+ $data['elozo'] = true;
+ }
+
+ $data['hszek_json'] = json_encode($hszek);
+
+ $user = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($user['name']) )
+ $data['szerk']=true;
+ $data['temacim'] = $this->mforum->get_cim($tema_id)->cim;
+ $temakor_id = $this->mforum->get_tema1($tema_id)->temakor_id;
+ $data['temakorcim'] = $this->mforum->get_temakor1($temakor_id)->cim;
+ $data['temakorid'] = $temakor_id;
+ $data['tema_id'] = $tema_id;
+ $data['oldalak_szama'] = (int)$this->mforum->get_temaoldal($tema_id);
+ $data['akt_oldal'] = $oldal;
+
+ $data['hozzaszolasok'] = $hszek;
+
+ $data['meta']['keyw'] = $data['temacim'].', ';
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['title'] .= ' - ' . $data['temacim'];
+
+ $data['aktmenu'] = "1";
+ $data['style'] = array('jquery.ui'/*,'fancybox2'*/);
+ $data['javascript'] = array('../editor/fckeditor','jquery_ui'/*,'fancybox/jquery-1.3.2.min','fancybox/jquery.easing.1.3','fancybox/jquery.fancybox-1.2.1.pack','fancybox/fancy'*/);
+ $this->load->view('site_forum',$data);
+ }
+ }
+
+ function kovetkezo(){
+ $oldalszam = $this->phpsession->get('oldal');
+ if( $this->mforum->vanmegoldal($this->phpsession->get('temaid'),$oldalszam)){
+ $oldalszam++;
+ }
+ $this->phpsession->save('oldal',$oldalszam);
+ }
+
+ function elozo(){
+ $oldalszam = $this->phpsession->get('oldal');
+ if( $oldalszam > 0 )
+ $oldalszam--;
+ $this->phpsession->save('oldal',$oldalszam);
+ }
+
+ 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 login(){
+ $name = $this->input->post('name');
+ $passwd = $this->input->post('passwd');
+
+ $name = $this->csere($name);
+
+ if(!$passwd || !$name)
+ {
+ $this->belephiba(9);
+ }
+ else
+ {
+ $name2 = $this->ekezet($name);
+ $vanaktiv = $this->mforum->vanaktivprog($name);
+
+ if( ($this->mforum->belep($name,$passwd) || $this->mforum->belep($name2,$passwd))
+ && $vanaktiv )
+ {
+ $uid = $this->mforum->get_userid($name);
+ if( !$uid || !is_numeric($uid) ){
+ $this->belephiba(6);
+ }else{
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$name;
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+ $fuser['rang'] = $this->mforum->get_rang($uid);
+ $rang = $fuser['rang'];
+ }
+
+
+
+
+ // ha csak feltolto
+ if( $rang != "user" && $rang != "moderator" ){
+ $fuser['user_id'] = $uid;
+ $this->phpsession->save('feltolto',$fuser);
+ $this->belephiba(8);
+ }
+ //ha még nem fogadta el a szabályzatot:
+ elseif( !($this->mforum->szabalyzat($uid) ) ){
+ if(hun())
+ $lap = $this->mpages->get_row(454);
+ else
+ $lap = $this->mpages->get_row(559);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum szabályzat' : $data['title'] = 'ARCHLine.XP Forum Rules';
+ $data['tartalom'] = '/forum/szabalyzat';
+ $data['lap'] = $lap;
+ //$user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($name))
+ $data['moderator']=true;
+
+ //ha még nem fogadta el a szabályzatot:
+ if( !($this->mforum->szabalyzat($uid) ) ){
+ $data['uid'] = $uid;
+ $data['login'] = $name2;
+ $data['pw'] = md5($passwd);
+ $data['nemelfogad'] = true;
+ $data['infok'] = array("0");
+ }
+
+ $this->load->view('site_forum',$data);
+ }
+ else{
+ $fuser['user_id'] = $uid;
+ $this->phpsession->save('fuser',$fuser);
+ redirect('forum');
+ }
+ }else{
+ if( $name == "moderator" ){
+ $szam = date(W);
+ $this->mforum->jelszovaltmod($szam);
+ if( $this->mforum->belep($name,$passwd) ){
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$name;
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+ $uid = $this->mforum->get_userid($name);
+ $fuser['user_id'] = $uid;
+ $this->phpsession->save('fuser',$fuser);
+ redirect('forum');
+ }
+ }
+
+ if( !$vanaktiv )
+ $this->belephiba(7);
+ else{
+ $this->belephiba(6);
+ }
+ }
+ }
+ }
+
+ function belephiba($szoveg){
+ $data['tartalom']='testforum/temakorok';
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['csik']=array('home','forum');
+
+ if( !is_numeric($szoveg) ){
+ $data['error'] = $szoveg;
+ }
+ else{
+ $data['error'] = array($szoveg);
+ }
+
+ $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;
+ $tema->rov_cim = $tema->cim;
+
+ /*if(strlen($tema->cim) > 26){
+ $ut26 = array($cim[26]);
+ $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")
+ $tema->utolsouser = $this->mforum->get_userUid($xx->user)->nev;
+ 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'] = 1;
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function logout(){
+ unset($_SESSION['default']['fuser']);
+ unset($_SESSION['default']['feltolto']);
+ redirect('forum');
+ }
+
+ function szerkeszt(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->uri->segment(3) != "")
+ $hszid = $this->uri->segment(3);
+ else
+ //$hszid = $this->phpsession->get('hszid');
+ $hszid = $this->input->post('hszid');
+
+ if( $this->mforum->moderator($tomb['name']) || $this->mforum->get_sajathsz($tomb['user_id'], $hszid) ){
+ if($this->input->post('szerk')!=false){
+ //$hszid = $this->phpsession->get('hszid');
+ $hszid = $this->input->post('hszid');
+ $this->mforum->hszszerk($this->input->post('hsz'),$hszid);
+ $user_id = $this->mforum->get_hsz($hszid)->user_id;
+
+ if( $this->input->post('kepki')=='on' ){
+ if(hun())
+ $kep = $this->kepek_utvonal . $user_id ."/". $this->mforum->get_Kep($hszid)->kep;
+ elseif(eng())
+ $kep = $this->kepek_utvonal_eng . $user_id ."/". $this->mforum->get_Kep($hszid)->kep;
+
+ chmod($kep, 777);
+ unlink($kep);
+ $this->mforum->kepki($hszid);
+ }
+
+ $temaid = $this->phpsession->get('tema_id');
+ header("Location: listaz/$temaid");
+ }else if( $this->uri->segment(3) != "" ){
+ $this->phpsession->save('hszid',$this->uri->segment(3));
+
+ $data['szoveg']=$this->mforum->get_Text($this->phpsession->get('hszid'))->szoveg;
+ $kep = $this->mforum->get_Kep($this->phpsession->get('hszid'))->kep;
+ if( $kep != "" && $kep != "NULL" ){
+ $user_id = $this->mforum->get_hsz($this->phpsession->get('hszid'))->user_id;
+ if(hun())
+ $data['kep'] = "/".$this->kepek_utvonal. $user_id . "/".$kep;
+ elseif(eng())
+ $data['kep'] = "/".$this->kepek_utvonal_eng. $user_id . "/".$kep;
+ }
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['javascript'] = array('../editor/fckeditor');
+ $data['tartalom']='testforum/szerkeszt';
+ $data['csik']=array('home','forum');
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function torles(){
+ $tomb = $this->phpsession->get('fuser');
+ $hszid = $this->uri->segment(3);
+ if( $this->mforum->moderator($tomb['name']) || $this->mforum->get_sajathsz($tomb['user_id'], $hszid) ){
+ if( $this->uri->segment(3) != "" ){
+ $hszid = $this->uri->segment(3);
+ $uid = $this->mforum->torol($hszid);
+
+ //ha nincs kep a mappajaban:
+ if(hun())
+ $mappa = $this->kepek_utvonal . $uid;
+ elseif(eng())
+ $mappa = $this->kepek_utvonal_eng . $uid;
+
+ $handle = opendir($mappa);
+ //ha nincs fajl a konyvtarban, akkor toroljuk a mappat
+ chmod($mappa,0777);
+ $fajl = readdir($handle);
+ $fajl = readdir($handle);
+ $fajl = readdir($handle);
+ if(!($fajl)){
+ //closedir($mappa);
+ rmdir($mappa);
+ }
+
+ $tema_id = $this->phpsession->get('temaid');
+ if( is_int($this->mforum->get_temaoldal($tema_id)) && ($this->phpsession->get('oldal') == $this->mforum->get_temaoldal($tema_id)) ){
+ $this->elozo();
+ }
+ redirect('forum/listaz');
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tatnevez(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" && ($this->input->post('atnevez')==false) ){
+ $tid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='testforum/temaatnevez';
+ $data['csik']=array('home','forum');
+ $data['tema_id'] = $tid;
+ $data['temacim'] = $this->mforum->get_cim($tid)->cim;
+ $data['moderator'] = true;
+
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('atnevez')!=false){
+ $this->mforum->tatnevez($this->input->post('tid'),$this->input->post('ujnev'));
+
+ header("Location: index");
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tkatnevez(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" && ($this->input->post('atnevez')==false) ){
+ $tid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='testforum/tkatnevez';
+ $data['csik']=array('home','forum');
+ $data['tema_id'] = $tid;
+ $data['temacim'] = $this->mforum->get_tkcim($tid)->cim;
+ $data['moderator'] = true;
+
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('atnevez')!=false){
+ $this->mforum->tkatnevez($this->input->post('tid'),$this->input->post('ujnev'));
+
+ header("Location: index");
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tematorol(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $tomb && $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" ){
+ $tid = $this->uri->segment(3);
+ $this->mforum->tematorol($tid);
+
+ redirect('forum');
+ }else{
+ redirect('forum');
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function temakortorol(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $tomb && $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" ){
+ $tid = $this->uri->segment(3);
+ $this->mforum->temakortorol($tid);
+
+ redirect('forum');
+ }else{
+ redirect('forum');
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function mypost(){
+ $this->phpsession->save('valasz',false);
+
+ $data['tartalom']='testforum/mypost';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('forum');
+ $user = $this->phpsession->get('fuser');
+
+ if(!$user)
+ redirect('forum');
+
+ $hszek = $this->mforum->get_mypost($user['user_id']);
+ foreach( $hszek as $hsz){
+ $elo = $hsz->valasz;
+ $hsz->valasz = $this->mforum->get_valaszok($hsz->hsz_id);
+ $hsz->valaszdb = count($hsz->valasz);
+ $hsz->elozo = $this->mforum->get_hsz($elo);
+ $tema = $this->mforum->get_tema1($hsz->tema_id);
+ $hsz->tema = $this->mforum->get_tema1($hsz->tema_id);
+ $temakor = $this->mforum->get_temakor1($tema->temakor_id);
+ $hsz->temakor = $temakor->cim;
+
+ //print_r($hsz->elozo);
+ }
+
+ $data['hozzaszolasok'] = $hszek;
+ $data['hszdb'] = count($hszek);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+
+ $this->load->view('site_forum',$data);
+ }
+
+
+ function myuser(){
+ $user = $this->phpsession->get('fuser');
+ if($user){
+ $tomb = $this->phpsession->get('fuser');
+ $login = $tomb['name'];
+ $this->user($login);
+ }else
+ redirect('forum');
+ }
+
+ function user($login){
+ if(!$login)
+ redirect('forum');
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='testforum/user';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['user']=$login;
+ $data['adatok'] = $this->mforum->get_user($login);
+ $szemadatok = $this->mforum->get_user_szem($login);
+ $emailek = $szemadatok[0]->email;
+ $emailek = explode(";",$emailek);
+ $szemadatok[0]->email = "";
+ foreach( $emailek as $email ){
+ $szemadatok[0]->email .= $email . "
";
+ }
+ $van = $szemadatok[0]->nev;
+ if($van)
+ $data['szemadatok'] = $szemadatok;
+ else
+ $data['szemadatok'] = $this->mforum->get_user_alap($login);
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+
+ $kulcsok[$key_kulcs]->programok = $programs;
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }
+
+ function users(){
+ $user = $this->phpsession->get('fuser');
+ if( $user && $this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='testforum/users';
+ $data['csik']=array('home','forum');
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+ $this->phpsession->save('belep',"");
+
+ if( !($this->phpsession->get('uoldal')) ){
+ $this->phpsession->save('uoldal',0);
+ $oldal = 0;
+ }else{
+ $oldal = $this->phpsession->get('uoldal');
+ }
+
+ if( $this->uri->segment(3) == kov ){
+ $oldal++;
+ $this->phpsession->save('uoldal',$oldal);
+ }else if( $this->uri->segment(3) == elozo && $oldal > 0 ){
+ $oldal--;
+ $this->phpsession->save('uoldal',$oldal);
+ }
+ else if( is_numeric($this->uri->segment(3))){
+ $oldal = $this->uri->segment(3);
+ $this->phpsession->save('uoldal',$oldal);
+ }
+
+ if( $this->uri->segment(3) == "rendez" ){
+ $ord = $this->uri->segment(4);
+
+
+ $vissza = $this->phpsession->get('rendezvissza');
+ if($this->phpsession->get('rendez') == $ord){
+ $vissza = !$vissza;
+ }
+ $this->phpsession->save('rendezvissza',$vissza);
+
+
+ $this->phpsession->save('rendez',$ord);
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ }else if( $this->phpsession->get('rendez') ){
+ $ord = $this->phpsession->get('rendez');
+ $vissza = $this->phpsession->get('rendezvissza');
+ }else{
+ $ord = "nev";
+ $vissza = false;
+ }
+
+ $data['users']=$this->mforum->get_users($oldal,$ord,$vissza);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ukeres(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='testforum/users';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+ if( !($this->phpsession->get('ukoldal')) ){
+ $this->phpsession->save('ukoldal',0);
+ $oldal = 0;
+ }else{
+ $oldal = $this->phpsession->get('ukoldal');
+ }
+
+ if( is_numeric($this->uri->segment(3))){
+ $oldal = $this->uri->segment(3);
+ $this->phpsession->save('ukoldal',$oldal);
+ }
+
+ if( $this->uri->segment(3) == "rendez" ){
+ $ord = $this->uri->segment(4);
+
+ $vissza = $this->phpsession->get('rendezvissza');
+ if($this->phpsession->get('rendez') == $ord){
+ $vissza = !$vissza;
+ }
+ $this->phpsession->save('rendezvissza',$vissza);
+
+ $this->phpsession->save('rendez',$ord);
+ $oldal = 0;
+ $this->phpsession->save('ukoldal',0);
+ }else if( $this->phpsession->get('rendez') ){
+ $ord = $this->phpsession->get('rendez');
+ $vissza = $this->phpsession->get('rendezvissza');
+ }else{
+ $ord = "nev";
+ $vissza = false;
+ }
+
+ if( $this->input->post('klogin') || $this->input->post('knev') || $this->input->post('kemail') || $this->input->post('kulcssz') || ($this->input->post('belep') != -1 && $this->input->post('belep') != "" ) ){
+ $oldal = 0;
+ $this->phpsession->save('ukoldal',$oldal);
+ $klog = $this->input->post('klogin');
+ $this->phpsession->save('klogin',$this->input->post('klogin'));
+ $knev = $this->input->post('knev');
+ $this->phpsession->save('knev',$knev);
+ $kmail = $this->input->post('kemail');
+ $this->phpsession->save('kemail',$this->input->post('kemail'));
+ $kulcs = $this->input->post('kulcssz');
+ $this->phpsession->save('kulcssz',$this->input->post('kulcssz'));
+ $belep = $this->input->post('belep');
+ $this->phpsession->save('belep',$this->input->post('belep'));
+ }else{
+ $klog = $this->phpsession->get('klogin');
+ $knev = $this->phpsession->get('knev');
+ $kmail = $this->phpsession->get('kemail');
+ $kulcs = $this->phpsession->get('kulcssz');
+ $belep = $this->phpsession->get('belep');
+ }
+ $users = $this->mforum->get_kusers($oldal,$klog,$knev,$kmail,$belep,$kulcs,$ord,$vissza);
+ $data['users'] = $users;
+
+ if( $this->mforum->vanmegkuser($this->phpsession->get('ukoldal'),$klog,$knev,$kmail,$belep,$kulcs) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('ukoldal') > 0 )
+ $data['elozo'] = true;
+
+
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_kusersdb($klog,$knev,$kmail,$belep,$kulcs);
+ $data['akt_oldal'] = $oldal;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function edit_user(){
+ $user = $this->phpsession->get('fuser');
+ if($user && $this->mforum->moderator($user['name'])){
+ if( $this->uri->segment(3) != "" && ($this->input->post('edituser')==false) ){
+ $uid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználó szerkesztése' : $data['title'] = 'ARCHLine.XP Forum Edit User';
+ $data['tartalom']='testforum/edit_user';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+ $login = $this->mforum->get_login($uid);
+ $data['adatok'] = $this->mforum->get_user($login);
+
+ $szemadatok = $this->mforum->get_user_szem($login);
+
+ if($szemadatok[0])
+ $data['szemadat'] = $szemadatok[0];
+ else{
+ $cucc = $this->mforum->get_user_alap($login);
+ $data['szemadat'] = $cucc[0];
+ }
+
+ //$data['kulcsok'] = $this->mforum->get_user_kulcsok($login);
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+
+ $i=0;
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $i++;
+
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+
+ $kulcsok[$key_kulcs]->programok = $programs;
+
+
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('edituser')!=false){
+
+ $error = "";
+ $langerror = array();
+ if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') != $this->input->post('jelszo2') ){
+ $error .= "A megadott két jelszó nem egyezik.
";
+ array_push($langerror,0);
+ }else if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') == $this->input->post('jelszo2') && strlen($this->input->post('jelszo1') ) < 5 ){
+ $error .= "A megadott jelszó 5 karakternél rövidebb.
";
+ array_push($langerror,1);
+ }
+
+ $user = $tomb['name'];
+ //$myid = $this->mforum->get_userid($user);
+
+ if( $this->input->post('login') == "" ){
+ $error .= "A login mező értéke nem lehet üres.
";
+ array_push($langerror,4);
+ }
+
+ if( $this->input->post('login') != "" && !$this->mforum->szabadlogin($this->input->post('login'),$this->input->post('uid')) ){
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+ array_push($langerror,2);
+ }
+ elseif( strlen($this->input->post('login') ) < 5 ){
+ $error .= "A megadott login 5 karakternél rövidebb.
";
+ array_push($langerror,3);
+ }
+
+ if( $this->input->post('login') != $this->ekezet($this->input->post('login')) ){
+ $error .= "A felhasználó névben nem szerepelhet ékezet vagy szóköz!
";
+ array_push($langerror,5);
+ }
+
+
+ $uid = $this->input->post('uid');
+
+ if( !$error ){
+
+ $this->mforum->set_user($this->input->post('uid'),$this->input->post('nev'),$this->input->post('email'),$this->input->post('jelszo1'),$this->input->post('login'),$this->input->post('rang'));
+
+ redirect("forum/users");
+ }else{
+
+
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználó szerkesztése' : $data['title'] = 'ARCHLine.XP Forum Edit User';
+ $data['tartalom']='testforum/edit_user';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+
+ $login = $this->mforum->get_login($uid);
+ $data['adatok'] = $this->mforum->get_user($login);
+
+ $szemadatok = $this->mforum->get_user_szem($login);
+
+ if($szemadatok[0])
+ $data['szemadat'] = $szemadatok[0];
+ else{
+ $cucc = $this->mforum->get_user_alap($login);
+ $data['szemadat'] = $cucc[0];
+ }
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+
+ $i=0;
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $i++;
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+ $kulcsok[$key_kulcs]->programok = $programs;
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+ $data['error'] = $error;
+ $data['hibak2'] = $langerror;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+
+ print " ";
+ }
+
+ $ezt = "edit_user/".$uid;
+ header("Location: ".$ezt);
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujuser(){
+ $user = $this->phpsession->get('fuser');
+ if($user && $this->mforum->moderator($user['name'])){
+ if($this->input->post('do')!=false){
+ $login = $this->input->post('login');
+ $nev = $this->input->post('nev');
+ $jsz1 = $this->input->post('jelszo1');
+ $jsz2 = $this->input->post('jelszo2');
+ $email = $this->input->post('email');
+ $kulcs = $this->input->post('kulcs');
+ $rang = $this->input->post('rang');
+
+ if($kulcs)
+ $nUserID = $this->mforum->get_nUserID($kulcs);
+ else
+ $nUserID = "NULL";
+
+ $error = "";
+ $langerror = array();
+
+ if( $login == "" )
+ $error .= "Nincs login megadva.
";
+
+ if( $login != $this->ekezet($login) )
+ $error .= "A felhasználó névben nem lehet ékezet vagy szóköz.
";
+ elseif( !$this->mforum->szabadlogin($login,10000) )
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+
+ if( $jsz1 == "" || $jsz2 == "" || $jsz1 != $jsz2 )
+ $error .= "A két jelszó nem egyezik vagy nincsenek megadva.
";
+
+ if( $this->mforum->is_email($email) )
+ $error .= "A megadott e-mail-cím már szerepel az adatbázisban.
";
+
+ if(!$error){
+ $this->mforum->ujuser($login,$nev,$jsz1,$email,$nUserID,$rang);
+
+ redirect('forum/users');
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új felhasználó' : $data['title'] = 'ARCHLine.XP Forum new user';
+ $data['tartalom']='testforum/ujuser';
+ $data['csik']=array('home','forum');
+ $data['error2'] = $error;
+ $data['moderator']=true;
+ $data['javascript']=array('forum');
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }
+
+ }else{
+ $data['title'] = 'ARCHLine.XP Fórum új felhasználó';
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Új Felhasználó' : $data['title'] = 'ARCHLine.XP Forum New User';
+ $data['tartalom']='testforum/ujuser';
+ $data['csik']=array('home','forum');
+ $data['javascript']=array('forum');
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function del_user(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ $id = $this->uri->segment(3);
+ $this->mforum->del_user($this->uri->segment(3));
+ redirect("forum/users");
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujuserdb(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='testforum/users';
+ $data['csik']=array('home','forum');
+
+
+
+
+ $this->access_id = 36;
+
+ $this->load->model('mpartners');
+ $this->keydb = $this->load->database('clusers',true);
+ $search = false;//$this->input->post('search');
+
+ $from = 0;
+ $to = 999999;
+ $limit = 2000;
+
+ $this->keydb->query("SET NAMES utf8");
+ $result = $this->keydb->from('cl_fo_hardlock')->join('cl_users','cl_fo_hardlock.hlUser=cl_users.nUserID','left')->orderby('hlNum','desc')->where("hlCtrID ='".$this->access_id."'")->where('hlStat',1)->where("hlNum >= '".$from."' AND hlNum <= '".$to."'")->limit(99999)->get();
+
+ //$sorok = $result->result();
+
+
+
+
+
+ $query = $this->keydb->from('cl_fo_hardlock')->join('cl_users','cl_fo_hardlock.hlUser=cl_users.nUserID','left')->join('cl_users_emails','cl_users.nUserID=cl_users_emails.nUserID','left')->orderby('hlNum','desc')->where("hlCtrID ='".$this->access_id."'")->where('hlStat',1)->where('default',1)->where("hlNum >= '".$from."' AND hlNum <= '".$to."'")->limit(99999)->get();
+ $sorok = $query->result();
+
+
+ //$this->keydb->query("SET NAMES latin2");
+
+
+
+
+ if($result->num_rows()==0)
+ {
+ $data['sorok'] = false;
+ }
+ else
+ {
+ $data['sorok'] = $sorok;
+ $data['found'] = $result->num_rows();
+ }
+
+ $sorok2 = $sorok;
+ $i = 0;
+ $j = 0;
+ $db = 0;
+ foreach($sorok2 as $sor){
+ $mailek = $sor->email;
+ $mailek = explode(";",$mailek);
+
+ foreach( $mailek as $mail ){
+ $mail = trim($mail);
+
+ //megnezzuk hogy benne van-e az adatbázisban és aktív-e
+ if( $mail != "" && $sor->hlStat == 1 && !$this->mforum->is_email(strtolower($mail)) ){
+ $mailresz = explode('@',$mail);
+ $login = $mail;
+ $nev = $sor->strName;
+ $nev = trim($nev);
+ $jsz1 = $mailresz[0];
+ $nUserID = $sor->nUserID;
+ $rang = "user";
+
+ // eladási dátum 0000-00-00 -e
+ $datum = $this->keydb->from('cl_fo_programs')->where("prHlNum",$sor->hlNum)->select('prSellDate')->get()->row();
+ if($datum->prSellDate != '0000-00-00'){
+ $this->mforum->ujuser($login,$nev,$jsz1,strtolower($mail),$nUserID,$rang);
+ $db++;
+ $kik[$j]->Nev = $nev;
+ $kik[$j]->Login = $login;
+ $kik[$j]->Email = $mail;
+ $kik[$j]->Datum = $datum->prSellDate;
+ }
+ $j++;
+ }
+ }
+ $i++;
+ }
+ $data['darab'] = $db;
+ $data['kik'] = $kik;
+
+
+
+ $data['sorok2'] = $sorok2;
+
+
+
+
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $this->load->view('site_forum',$data);
+ }else
+ redirect('forum');
+ }
+
+ function myedit(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $tomb ){
+ if($this->input->post('mysave')!=false){
+
+ $error = "";
+ $langerror = array();
+ if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') != $this->input->post('jelszo2') ){
+ $error .= "A megadott két jelszó nem egyezik.
";
+ array_push($langerror,0);
+ }else if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') == $this->input->post('jelszo2') && strlen($this->input->post('jelszo1') ) < 5 ){
+ $error .= "A megadott jelszó 5 karakternél rövidebb.
";
+ array_push($langerror,1);
+ }
+
+ $user = $tomb['name'];
+ $myid = $this->mforum->get_userid($user);
+
+ if( $this->input->post('login') == "" ){
+ $error .= "A login mező értéke nem lehet üres.
";
+ array_push($langerror,4);
+ }
+
+ if( $this->input->post('login') != "" && !$this->mforum->szabadlogin($this->input->post('login'),$myid) ){
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+ array_push($langerror,2);
+ }
+ elseif( strlen($this->input->post('login') ) < 5 ){
+ $error .= "A megadott login 5 karakternél rövidebb.
";
+ array_push($langerror,3);
+ }
+
+ if( $this->input->post('login') != $this->ekezet($this->input->post('login')) ){
+ $error .= "A felhasználó névben nem szerepelhet ékezet vagy szóköz!
";
+ array_push($langerror,5);
+ }
+
+
+ $ertesitesek = $this->input->post('temak');
+ if(count($ertesitesek) == 0 || (count($ertesitesek) == 1 && $ertesitesek[0] == "") )
+ $ertesit = NULL;
+ elseif( count($ertesitesek) == count($this->mforum->get_temak()) )
+ $ertesit = "mind";
+ else
+ $ertesit = ";".implode(";", $ertesitesek).";";
+
+
+ if($error){
+ hun() ? $data['title'] = 'ARCHLine.XP Adatok változtatása' : $data['title'] = 'ARCHLine.XP Edit Data';
+ $data['tartalom']='testforum/myedit';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+ $data['error2'] = $error;
+ $data['hibak2'] = $langerror;
+
+ $user = $tomb['name'];
+ $user_id = $this->mforum->get_userid($user);
+ $data['user_id'] = $user_id;
+ $data['cucc'] = $this->mforum->get_user_alap($user);
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }else{
+ $plogin = $this->input->post('login');
+ $pnev = $this->input->post('nev');
+ $pjelszo = $this->input->post('jelszo1');
+
+ $this->mforum->myedit($plogin, $pnev, $pjelszo, $myid, $ertesit);
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['t_nev'] = $this->mforum->get_nev($plogin);
+ $fuser['name'] = $this->input->post('login');
+ $this->phpsession->save('fuser',$fuser);
+ $this->myuser();
+ }
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Adatok változtatása' : $data['title'] = 'ARCHLine.XP Edit Data';
+ $data['tartalom']='testforum/myedit';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ if(hun())
+ $nyelv = "hun";
+ else
+ $nyelv = "eng";
+
+ $user = $tomb['name'];
+ $user_id = $this->mforum->get_userid($user);
+ $data['user_id'] = $user_id;
+ $data['temak'] = $this->mforum->get_temak($nyelv);
+ $data['cucc'] = $this->mforum->get_user_alap($user);
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujjelszo(){
+ if($this->input->post('kuld')!=false){
+ $email = $this->input->post('email');
+ $uzenet = "A megadott e-mail-cím: " . $email;
+ //$uzenet = $email;
+
+ $ujjelszo = $this->mforum->ujjelszo($email);
+
+ if($ujjelszo){
+
+ $this->load->library('email');
+ $this->load->helper('email');
+ $this->email->initialize();
+ $this->email->addOfficialImages();
+
+ $mailnek->ujjsz = $ujjelszo;
+ $mailnek->login = $this->mforum->get_login2($email);
+
+
+ /* Akarmilyem mailcimet is adott meg, a default emailre kuldjuk a levelet */
+ $email2 = $this->mforum->default_mail($email);
+ if($email2 != "")
+ $email = $email2;
+
+
+ $this->email->from('info@cadline.hu', 'Cadline Weboldal');
+ if(hun())
+ $this->email->subject('Uj jelszo');
+ else
+ $this->email->subject('New Password');
+ $this->email->message($this->load->view('mail_ujjelszo',$mailnek,true));
+ $this->email->send($email,'smtp');
+
+ $uzenet = $email." -re kiküldtük az Ön új jelszavát.
";
+
+ }else{
+ $uzenet .= " nincs a felhasználók között.
";
+ }
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új jelszó' : $data['title'] = 'ARCHLine.XP Forum new password';
+
+ $data['uzenet']=$uzenet;
+ $this->phpsession->save('fuzenet',$uzenet);
+
+ if( isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'],'/collection/') ){
+ $data['tartalom']='collection/ujjelszo_valasz';
+ $data['style'] = array('temp/style_new');
+ $this->load->view('site_upload',$data);
+ }
+ else{
+ $data['tartalom']='testforum/temakorok';
+ $data['csik']=array('home','forum');
+ $this->load->view('site_forum',$data);
+ }
+
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új jelszó' : $data['title'] = 'ARCHLine.XP Forum new password';
+
+ $data['tartalom']='testforum/ujjelszo';
+ $data['csik']=array('home','forum');
+
+ if( strstr($_SERVER['HTTP_REFERER'],'collection/upload') || strstr($_SERVER['HTTP_REFERER'],'collection/submit') ){
+ $data['style'] = array('temp/style_new');
+ $this->load->view('site_upload',$data);
+ }
+ else{
+ $this->load->view('site_new',$data);
+ }
+ }
+ }
+
+ function szabalyzat(){
+ if(hun())
+ $lap = $this->mpages->get_row(454);
+ else
+ $lap = $this->mpages->get_row(559);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum szabályzat' : $data['title'] = 'ARCHLine.XP Forum Rules';
+ $data['tartalom'] = '/forum/szabalyzat';
+ $data['lap'] = $lap;
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $uid = $this->mforum->get_userid($user['name']);
+ //ha még nem fogadta el a szabályzatot:
+ if( !($this->mforum->szabalyzat($uid) ) ){
+ $data['uid'] = $uid;
+ $data['nemelfogad'] = true;
+ }
+
+ $data['aktmenu'] = "2";
+ $this->load->view('site_forum',$data);
+ }
+
+ function elfogad(){
+ if($this->input->post('el')=="igen"){
+
+ $uid = $this->input->post('uid');
+ $name = $this->input->post('fnev');
+ $passwd = $this->input->post('jelszo');
+ if( $this->mforum->belep($name,$passwd,false) ){
+ $this->mforum->elfogad($uid);
+
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$this->mforum->get_login($uid);
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+
+ $fuser['user_id'] = $uid;
+
+
+ $this->phpsession->save('fuser',$fuser);
+ $Date = date('Y-m-d',time());
+
+ $nUserID = $this->mforum->get_nUserID2($uid);
+ }
+
+ redirect('forum');
+
+ }else{
+ $this->logout();
+ }
+ }
+
+ function ido(){
+ die(date('Y-m-d H:i:s', time()));
+ }
+
+ function emailjavitas(){
+ $tomb = $this->phpsession->get('fuser');
+ if(!$tomb)
+ redirect('forum');
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='testforum/users';
+ $data['csik']=array('home','forum');
+
+ $cl_users = $this->mforum->get_cl_users();
+
+ $db = 0;
+ $cserek = "";
+ foreach($cl_users as $user){
+ $nUserID = $user->nUserID;
+ //print $user->strName;
+ $x = $this->mforum->cseremail($nUserID);
+ if( $x ){
+ $cserek .= $x;
+ $db++;
+ }
+ }
+
+ $data['email']=$db;
+ $data['cserek']=$cserek;
+
+
+
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function ujuserdb_eng(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='testforum/users';
+ $data['csik']=array('home','forum');
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $sorok = $this->mforum->get_cl_users_eng();
+
+ $i = 0;
+ $j = 0;
+ $db = 0;
+ foreach($sorok as $sor){
+ $mailek = $sor->strEMail;
+ $mailek = explode(";",$mailek);
+
+ foreach( $mailek as $mail ){
+ /* csak az elso email cimet veszi fel */
+ $mail = trim($mailek[0]);
+
+
+ //megnezzuk hogy benne van-e az adatbázisban és aktív-e
+ if( $mail != "" && $sor->hlStat == 1 && !$this->mforum->is_email(strtolower($mail)) ){
+ $mailresz = explode('@',$mail);
+ $login = $mail;
+ $nev = $sor->strName;
+ $nev = trim($nev);
+ $jsz1 = $mailresz[0];
+ $nUserID = $sor->nUserID;
+ $rang = "user";
+
+
+ // eladási dátum 0000-00-00 -e
+ $datum = $this->db->from('`clusers_eng`.`cl_fo_programs`')->where("prHlNum",$sor->hlNum)->select('prSellDate')->get()->row();
+
+ $prog = $this->db->query(" SELECT * FROM `clusers_eng`.`cl_fo_programs` WHERE prHlNum = '".$sor->hlNum."'")->result();
+
+ if($datum->prSellDate != '0000-00-00' && $this->mforum->szabadlogin($login) ){
+ $this->mforum->ujuser_eng($login,$nev,$jsz1,strtolower($mail),$nUserID,$rang);
+
+ // print "
Felvenném: ".$login.$nev.$jsz1.strtolower($mail).$nUserID.$rang;
+
+ $db++;
+ $kik[$j]->Nev = $nev;
+ $kik[$j]->Login = $login;
+ $kik[$j]->Email = $mail;
+ $kik[$j]->Datum = $datum->prSellDate;
+ }
+ $j++;
+ }
+ }
+ $i++;
+ }
+ $data['darab'] = $db;
+ $data['kik'] = $kik;
+
+ $data['sorok2'] = $sorok;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function info($info){
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/kiir';
+ $data['info'] = $info;
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function galeria(){
+ $user = $this->phpsession->get('fuser');
+
+ if( is_numeric($this->uri->segment(3)) ){
+ $this->galeriamutat();
+ }elseif($user){
+ $this->sajatgaleria();
+ }else{
+ redirect("forum");
+ }
+ }
+
+ function galeriamutat(){
+ $user_id = $this->uri->segment(3);
+ $lang = $this->muser->user['lang'];
+
+ $fajlok = $this->mforum->get_galeria($user_id,$lang);
+
+ $data["fajlok"] = $fajlok;
+ if(hun())
+ $data['utvonal'] = $this->galeria_utvonal.$user_id;
+ else
+ $data['utvonal'] = $this->galeria_utvonal_eng.$user_id;
+
+ $data['tartalom'] = '/forum/galeria';
+ $data['javascript'] = array(
+ 'interior_menu',
+ 'fancybox/jquery-1.3.2.min',
+ 'fancybox/jquery.easing.1.3',
+ 'fancybox/jquery.fancybox-1.2.1.pack',
+ 'fancybox/fancy'
+ );
+
+ $data['style'] = array('fancybox');
+
+ $this->load->view('site_forum',$data);
+
+ }
+
+ function sajatgaleria(){
+ $this->load->model('mrender');
+ $user = $this->phpsession->get('fuser');
+
+ if($user){
+ hun() ? $data['title'] = 'ARCHLine.XP Saját Galéria' : $data['title'] = 'ARCHLine.XP My Gallery';
+ $data['tartalom'] = '/forum/sajatgaleria';
+
+ $uid = $user['user_id'];
+ $data['uid'] = $uid;
+
+ $data['fajlok'] = $this->mforum->fajlok($uid);
+ $data['szabad_hely'] = (200 * 1024 * 1024) - $this->foglalt_hely($uid);
+
+ // $data['renderek'] = $this->mrender->get_byuserid($uid);
+
+ $data['javascript'] = array('fancybox/jquery-1.3.2.min','fancybox/jquery.easing.1.3','fancybox/jquery.fancybox-1.2.1.pack','fancybox/fancy','jquery','jquery_ui');
+ $data['style'] = array('fancybox2','jquery.ui');
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "5";
+ $this->load->view('site_forum',$data);
+ }else
+ redirect("forum");
+ }
+
+ function foglalt_hely($user_id){
+ if(hun())
+ $fajlok = $this->galeria_utvonal.$user_id."/";
+ else
+ $fajlok = $this->galeria_utvonal_eng.$user_id."/";
+
+ $total = 0;
+
+ $handle = opendir($fajlok);
+ while($file = readdir($handle)){
+ $total += filesize ($fajlok.$file);
+ if((is_dir($fajlok.$file.'/')) &&($file != '..')&&($file != '.'))
+ {
+ $total = $total + $this->foglalt_hely($fajlok.$file.'/');
+ }
+ }
+
+ return $total;
+ }
+
+ function feltolt(){
+ $user = $this->phpsession->get('fuser');
+ $uid = $user['user_id'];
+
+ if($uid && $_FILES["fajl"]["error"]==0){
+
+ $fajl = "";
+ $meret = 0;
+
+ if(hun())
+ $hova = $this->galeria_utvonal.$uid;
+ elseif(eng())
+ $hova = $this->galeria_utvonal_eng.$uid;
+
+ if(!is_dir($hova)){
+ mkdir($hova,0644);
+ chmod($hova,0777);
+ }
+
+
+ $feltolt_konyvtar = $hova."/";
+ //ha több fájl lenne ugyanazon a néven
+ $elotag = substr(time(),-6);
+ $fajlnev = $this->ekezet($_FILES["fajl"]["name"]);
+ $feltolt_fajlnev=$feltolt_konyvtar . $elotag . "__" . $fajlnev;
+
+ $error = "";
+ $mi = $_FILES['fajl']['name']."$";
+
+ $mire = "\.exe|\.EXE|\.php|\.PHP|\.sh|\.SH";
+ if( (ereg( $mire , $mi )) ){
+ $error .= "Hibás fájl kiterjesztés
";
+ }
+ if( $_FILES['fajl']['size'] > 1024 * 1024 * 10 ){
+ $error .= "A fájl mérete nagyobb 10 MB-nál.
";
+ }
+ else if( !$error){
+ if (copy($_FILES["fajl"]["tmp_name"], $feltolt_fajlnev)){
+ $fajl = $elotag . "__". $fajlnev;
+ $meret = $_FILES["fajl"]["size"];
+ $mit = $hova."/".$fajl;
+ chmod($mit,0777);
+
+
+ // elonezeti kep elkeszitese 150x113-ban
+ include('application/helpers/myimg_helper.php');
+ kepmeretezesvagas($feltolt_fajlnev,$hova,"elo_".$fajl,"150","113");
+
+ }else{
+ $fajl = "NULL";
+ $error = "Fájl másolás hiba.
";
+ }
+ }
+
+ if( !$error ){
+ $szamla = $this->input->post('szamla');
+ $info = $this->input->post('leiras');
+ $megoszt = 1;
+
+ if( $this->input->post('megosztas') != "on" ){
+ $megoszt = 0;
+ }
+
+ $this->mforum->feltolt($uid,$fajl,$meret,$szamla,$megoszt,$info);
+
+ redirect("forum/galeria/".$uid);
+ }else{
+ $this->info($error);
+ }
+
+
+ }else{
+ if( $_FILES['fajl']['error'] != 0 )
+ $this->info("Hiba a fájl feltöltésekor!");
+ else
+ redirect("forum");
+ }
+
+ }
+
+ function delfajl(){
+ $fajl_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ $user_id = $user['user_id'];
+
+ if(!$user)
+ redirect('forum');
+
+ if( is_numeric($fajl_id) && $this->mforum->sajatfajl($fajl_id, $user_id) ){
+ $this->load->model('mrender');
+
+ $fajl = $this->mforum->delfajl($fajl_id);
+
+ if(hun())
+ $mit = "public/forum-galeria/hun/".$user_id."/elo_".$fajl;
+ else
+ $mit = "public/forum-galeria/eng/".$user_id."/elo_".$fajl;
+
+ // elonezeti kep torlese ha van
+ if( file_exists( $mit ) ){
+ chmod($mit, 777);
+ unlink($mit);
+ }
+
+ // A fájlhoz tartozó rendereknél törölni a galériás fájl id-t.
+ $renderek = $this->mrender->get_rowBygforumgalid($fajl_id);
+ if( $renderek ){
+ foreach($renderek as $render){
+ $ertek = NULL;
+ $this->db->update('render_img',array('forumgal_id'=>$ertek),"render_id='".$render->render_id."'");
+ }
+ }
+ }
+ redirect("forum/galeria");
+ }
+
+ function editgaleria(){
+ $fajl_id = $this->input->post('fajl_id');
+ // $fajl_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ $user_id = $user['user_id'];
+
+ if(!$user)
+ redirect('forum');
+
+
+ if( is_numeric($fajl_id) && $this->mforum->sajatfajl($fajl_id, $user_id) ){
+ if( $this->input->post('do') ){
+ $leiras = $this->input->post('leiras');
+ $megoszt = 1;
+
+ if( $this->input->post('megosztas') != "on" ){
+ $megoszt = 0;
+ }
+
+ $this->mforum->editgaleria($fajl_id,$leiras,$megoszt);
+
+ redirect("forum/galeria");
+
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Saját Galéria' : $data['title'] = 'ARCHLine.XP My Gallery';
+ $data['tartalom'] = '/forum/editgaleria';
+
+ $data['uid'] = $user_id;
+ $data['fajlinfo'] = $this->mforum->fajlinfo($fajl_id);
+ if(hun())
+ $data['utvonal'] = $this->galeria_utvonal;
+ else
+ $data['utvonal'] = $this->galeria_utvonal_eng;
+
+ $data['utvonal'] .= "/".$user_id;
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "5";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect("forum");
+ }
+ }
+
+ function regisztracio(){
+ if($this->input->post('do') != ""){
+ $nev = $this->input->post('regnev');
+ $login = $this->input->post('email');
+ $email = $login;
+ $jelszo = $this->input->post('jelszo1');
+
+ $szabad = $this->mforum->szabadlogin($login,999999);
+ if( $szabad ){
+ //$this->mforum->ujuser($login,$nev,$jelszo,$email,"","feltolto");
+
+
+ $kod = md5($jelszo.time().$nev);
+
+ $record['login'] = $email;
+ $record['jelszo'] = md5($jelszo);
+ $record['nev'] = $nev;
+ $record['email'] = $email;
+ $record['rang'] = "guest";
+ $record['kod'] = $kod;
+ $record['datum'] = date("Y-m-d H:i:s",time());
+ $record['nyelv'] = $this->muser->user['lang'];
+
+ $this->db->insert('forum_user_temp',$record);
+
+
+ $this->load->helper('email');
+
+ //sending the e-mail
+ $mail_vars['kod'] = $kod;
+ $mail_vars['email'] = $email;
+ $mail_vars['first'] = $nev;
+
+ //set the authenticating link
+ $mail_vars['link'] = hun() ? 'http://archline.hu/forum/confirm/' . $kod : 'http://www.archlinexp.com/forum/confirm/' . $kod;
+
+ //setting and sending the email
+ $this->load->library('email');
+ $this->email->initialize();
+ $this->email->addOfficialImages();
+
+ $this->email->setFrom('info@cadline.hu', 'CadLine');
+
+ if(hun())
+ {
+ $mail_vars['mailcontent'] = 'mail/confirm_forum_hun';
+ $this->email->subject('ARCHLine.XP regisztráció');
+ }
+ else
+ {
+ $mail_vars['mailcontent'] = 'mail/confirm_forum_eng';
+ $this->email->subject('ARCHLine.XP registration');
+ }
+
+ $this->email->message($this->load->view('mail',$mail_vars,true));
+ $this->email->send($mail_vars['email'],'smtp');
+
+ redirect('forum/sentconf');
+ }
+ else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/regisztracio';
+ $data['javascript'] = array('forum');
+ $data['style'] = array('temp/style_interior');
+ $data['foglalt'] = "igen";
+
+ $this->load->view('site_upload',$data);
+ }
+ }else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/regisztracio';
+ $data['javascript'] = array('forum');
+ $data['style'] = array('temp/style_interior');
+
+ $this->load->view('site_upload',$data);
+ }
+ }
+
+ function sentconf(){
+ $data['tartalom']='testforum/sentconf';
+ $data['lang']=$this->muser->user['lang'];
+ $data['style'] = array('temp/style_new');
+
+ $this->load->view('site_upload',$data);
+ }
+
+ function confirm(){
+ $kod = $this->uri->segment(3);
+
+ $data['style'] = array('temp/style_new');
+
+ if( $this->mforum->confirm($kod) ){
+
+ /* a felhasználóhoz új eseményt felvenni, ha szerepel az adatbázisban */
+ $adatok = $this->mforum->get_userByKod($kod);
+ $nUserID = $this->mforum->get_nUserID30($adatok->email);
+ if( $nUserID ){
+ $this->load->model('mclusers');
+ $this->mclusers->addEvent($nUserID, 114, "Regisztráció");
+ }
+
+ $data['tartalom']='testforum/confirm_ok';
+ $data['lang']=$this->muser->user['lang'];
+ }else{
+ $data['tartalom']='testforum/confirm_hiba';
+ $data['lang']=$this->muser->user['lang'];
+ }
+
+ $this->load->view('site_upload',$data);
+ }
+
+ function belepfeltolto(){
+ if( $this->input->post("do") != "" ){
+ $login = $this->input->post("email");
+ $jelszo = $this->input->post("jelszo");
+
+ if( $this->mforum->belep($login,$jelszo) ){
+ print "ok";
+ }else
+ print "nem ok";
+
+ }else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/belepfeltolto';
+ $data['javascript'] = array('forum');
+
+ $this->load->view('site',$data);
+ }
+ }
+
+ function renderek(){
+ $this->load->model('mrender');
+ $user = $this->phpsession->get('fuser');
+ $feltolto = $this->phpsession->get('feltolto');
+
+ if($user){
+ $uid = $user['user_id'];
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ }elseif($feltolto){
+ $uid = $feltolto['user_id'];
+ }
+ else
+ redirect("forum");
+
+ hun() ? $data['title'] = 'ARCHLine.XP Renderek' : $data['title'] = 'ARCHLine.XP Renders';
+ $data['tartalom'] = '/forum/renderek';
+
+ $data['uid'] = $uid;
+
+ $renderek = $this->mrender->get_byuserid($uid);
+
+ foreach($renderek as $render){
+ if($render->allapot=='1' && file_exists($render->keszkep)){
+ list($width, $height) = getimagesize($render->keszkep);
+ $render->kepmeret = $width . " x ". $height;
+ }
+ else{
+ $render->kepmeret = '-';
+ }
+
+ }
+
+ $data['renderek'] = $renderek;
+
+ $data['onload'] = "betolt()";
+
+ $data['javascript'] = array('fancybox/jquery-1.3.2.min','fancybox/jquery.easing.1.3','fancybox/jquery.fancybox-1.2.1.pack','fancybox/fancy','jquery_ui');
+ $data['style'] = array('fancybox2','jquery.ui');
+ $data['aktmenu'] = "6";
+ $this->load->view('site_forum',$data);
+ }
+
+ function delrender(){
+ $this->load->model('mrender');
+
+ $render_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ if(!$user)
+ $user = $this->phpsession->get('feltolto');
+
+ if(!$user)
+ redirect('forum');
+
+ $render = $this->mrender->get_row($render_id);
+
+ if( is_numeric($this->uri->segment(3)) && $render->user_id == $user['user_id'] ){
+ $this->mrender->del($render_id);
+ }
+
+ header("Location: ".$_SERVER["HTTP_REFERER"]);
+ }
+
+ function rendercopy(){
+ $this->load->model('mrender');
+
+ $guid = $this->uri->segment(3);
+ $render = $this->mrender->get_rowByguid($guid);
+
+ if( is_numeric($render->render_id) ){
+ if( $this->muser->user['lang'] == "hun" )
+ $almappa = "hun";
+ else
+ $almappa = "eng";
+
+ $uid = $render->user_id;
+
+ $helye = "public/forum-galeria/".$almappa."/".$uid;
+
+ if(!is_dir($helye)){
+ mkdir($helye,0644);
+ chmod($helye,0777);
+ }
+
+ $fajluj = basename($render->keszkep);
+
+ $honnan = $render->keszkep;
+ $hova = $helye."/".$fajluj;
+
+ if( copy($honnan,$hova) ){
+ $meret = filesize($hova);
+ $this->mforum->feltolt($render->user_id,$fajluj,$meret,"","1",$render->render_name,$render->nyelv);
+ $fajl_id = mysql_insert_id();
+ $this->db->update('render_img',array('forumgal_id'=>$fajl_id),"render_id='".$render->render_id."'");
+
+ $uzenet = array(4);
+ $this->phpsession->save('fuzenet',$uzenet);
+
+ // elonezeti kep masolasa is ha van
+ $fajlnev = basename($render->keszkep);
+ $mappak = substr( $render->keszkep,0,(-1*(strlen($fajlnev))) );
+ $elokep = $mappak."elo_".$fajlnev;
+ if(file_exists($elokep)){
+ $ujelokep = $helye."/elo_".$fajlnev;
+ copy($elokep,$ujelokep);
+ }
+ }else{
+ $uzenet = array(14);
+ $this->phpsession->save('fhiba',$uzenet);
+ }
+
+ redirect('forum/renderek');
+ }else{
+ $uzenet = array(14);
+ $this->phpsession->save('fhiba',$uzenet);
+ redirect('forum/renderek');
+ }
+ }
+
+ function renderletolt(){
+ $this->load->model('mrender');
+ $render_id = $this->uri->segment(3);
+ $render = $this->mrender->get_row($render_id);
+ if( isset($render->keszkep) && $render->keszkep != "" && file_exists($render->keszkep) ){
+ $path_parts = pathinfo($render->keszkep);
+ $ext = strtolower($path_parts["extension"]);
+
+ if($render->render_name == "")
+ $render->render_name = "Image";
+
+ header("Content-type: application-download");
+ header('Content-Disposition: attachment; filename="'.$render->render_name.'.'.$ext.'"');
+ readfile($render->keszkep);
+ }else{
+ print "hiba a letoltes kozben";
+ }
+ }
+
+ function szerver(){
+ print "";
+ print_r($_SERVER);
+ print "
";
+ }
+}
+
+function hasonlito( $a, $b ){
+ if ( $a->datum == $b->datum )
+ return 0;
+ if ( $a->datum > $b->datum )
+ return -1;
+ return 1;
+}
+
+?>
\ No newline at end of file
diff --git a/var/www/hosting/archlinexp.com/partners/application/controllers/testforum.php.evidence.json b/var/www/hosting/archlinexp.com/partners/application/controllers/testforum.php.evidence.json
new file mode 100644
index 0000000..ffad676
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/application/controllers/testforum.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "5317",
+ "log_excerpt": "[quarantine] partners.archlinexp.com:application/controllers/testforum.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/archlinexp.com/partners/application/controllers/testforum.php)",
+ "original_sha256": "b56e2ebdd92c705cfee85f13a961ad4cc6a3811524f511e5f65b6bc0d7218fa2",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1396359078,
+ "size": 69757,
+ "uid": 11669
+ },
+ "rel_path": "application/controllers/testforum.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "partners.archlinexp.com"
+}
diff --git a/var/www/hosting/archlinexp.com/partners/application/helpers/sajatfeltolto.php b/var/www/hosting/archlinexp.com/partners/application/helpers/sajatfeltolto.php
new file mode 100644
index 0000000..4c9e7ee
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/application/helpers/sajatfeltolto.php
@@ -0,0 +1,102 @@
+
\ No newline at end of file
diff --git a/var/www/hosting/archlinexp.com/partners/application/helpers/sajatfeltolto.php.evidence.json b/var/www/hosting/archlinexp.com/partners/application/helpers/sajatfeltolto.php.evidence.json
new file mode 100644
index 0000000..1255819
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/application/helpers/sajatfeltolto.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "5375",
+ "log_excerpt": "[quarantine] partners.archlinexp.com:application/helpers/sajatfeltolto.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/archlinexp.com/partners/application/helpers/sajatfeltolto.php)",
+ "original_sha256": "75359fbae41809f21d9fb056c84ae525b579ad78f2e688033c3ac583b9dba833",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1403182246,
+ "size": 2184,
+ "uid": 11669
+ },
+ "rel_path": "application/helpers/sajatfeltolto.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "partners.archlinexp.com"
+}
diff --git a/var/www/hosting/archlinexp.com/partners/application/views/objects/submit.php b/var/www/hosting/archlinexp.com/partners/application/views/objects/submit.php
new file mode 100644
index 0000000..a7ae519
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/application/views/objects/submit.php
@@ -0,0 +1,69 @@
+";
+ }*/
+
+ else if( $this->input->post('hsz') != "" && !$error){
+ if (copy($_FILES["originalFilenameField"]["tmp_name"],$storeFilename)){
+ $prFile = $storeFilename;
+ $mit = $storeFolder."/".$kep;
+ chmod($mit,0777);
+ $prSize = $_FILES['originalFilenameField']['size'];
+ $tempFilename = $_FILES["originalFilenameField"]["tmp_name"];
+ }else{
+ $prFile = "NULL";
+ }
+ }
+}
+
+
+$tempPath= $tempFolder.$tempFilename;
+$storePath = $storeFolder.$storeFilename;
+
+
+
+ //DEBUG:
+ print "";
+ print_r ($_POST);
+ print "tempFilename: $tempFilename\n";
+ print "originalFilename: $originalFilename\n";
+ print "storedFilename: $storedFilename\n";
+ print "tempFolder: $tempFolder\n";
+ print "storeFolder: $storeFolder\n";
+ print "tempPath: $tempPath\n";
+ print "storePath: $storePath\n";
+
+ print "
";
+
+ if ((strlen($tempFilename) < 3) || (strlen($originalFilename) < 3))
+ die ("Hibás fáljnevek!");
+
+ if (!rename($tempPath,$storePath))
+ die ("Nem sikerül a helyére másolni a feltöltött fájlt!");
+
+ print "Sikeres feltöltés ($originalFilename)
";
+
+?>
\ No newline at end of file
diff --git a/var/www/hosting/archlinexp.com/partners/application/views/objects/submit.php.evidence.json b/var/www/hosting/archlinexp.com/partners/application/views/objects/submit.php.evidence.json
new file mode 100644
index 0000000..afb7f64
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/application/views/objects/submit.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "5345",
+ "log_excerpt": "[quarantine] partners.archlinexp.com:application/views/objects/submit.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/archlinexp.com/partners/application/views/objects/submit.php)",
+ "original_sha256": "79a5a4a225083fadcdbfd71ac01d201e386ec1aa5535726917d9c555dc8534d0",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1396359082,
+ "size": 2174,
+ "uid": 11669
+ },
+ "rel_path": "application/views/objects/submit.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "partners.archlinexp.com"
+}
diff --git a/var/www/hosting/archlinexp.com/partners/application/views/projects/submit.php b/var/www/hosting/archlinexp.com/partners/application/views/projects/submit.php
new file mode 100644
index 0000000..b5a8962
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/application/views/projects/submit.php
@@ -0,0 +1,69 @@
+";
+ }*/
+
+ else if( $this->input->post('hsz') != "" && !$error){
+ if (copy($_FILES["originalFilenameField"]["tmp_name"],$storeFilename)){
+ $prFile = $storeFilename;
+ $mit = $storeFolder."/".$kep;
+ chmod($mit,0777);
+ $prSize = $_FILES['originalFilenameField']['size'];
+ $tempFilename = $_FILES["originalFilenameField"]["tmp_name"];
+ }else{
+ $prFile = "NULL";
+ }
+ }
+}
+
+
+$tempPath= $tempFolder.$tempFilename;
+$storePath = $storeFolder.$storeFilename;
+
+
+
+ //DEBUG:
+ print "";
+ print_r ($_POST);
+ print "tempFilename: $tempFilename\n";
+ print "originalFilename: $originalFilename\n";
+ print "storedFilename: $storedFilename\n";
+ print "tempFolder: $tempFolder\n";
+ print "storeFolder: $storeFolder\n";
+ print "tempPath: $tempPath\n";
+ print "storePath: $storePath\n";
+
+ print "
";
+
+ if ((strlen($tempFilename) < 3) || (strlen($originalFilename) < 3))
+ die ("Hibás fáljnevek!");
+
+ if (!rename($tempPath,$storePath))
+ die ("Nem sikerül a helyére másolni a feltöltött fájlt!");
+
+ print "Sikeres feltöltés ($originalFilename)
";
+
+?>
\ No newline at end of file
diff --git a/var/www/hosting/archlinexp.com/partners/application/views/projects/submit.php.evidence.json b/var/www/hosting/archlinexp.com/partners/application/views/projects/submit.php.evidence.json
new file mode 100644
index 0000000..bba07a4
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/application/views/projects/submit.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "5346",
+ "log_excerpt": "[quarantine] partners.archlinexp.com:application/views/projects/submit.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/archlinexp.com/partners/application/views/projects/submit.php)",
+ "original_sha256": "26abc82bae9ad062f66a6fc78021fdb126eebc56d1b77527148c2773cf5c0c44",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1396359083,
+ "size": 2173,
+ "uid": 11669
+ },
+ "rel_path": "application/views/projects/submit.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "partners.archlinexp.com"
+}
diff --git a/var/www/hosting/archlinexp.com/partners/public/order/nonpro.php b/var/www/hosting/archlinexp.com/partners/public/order/nonpro.php
new file mode 100644
index 0000000..3713957
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/public/order/nonpro.php
@@ -0,0 +1,120 @@
+init($config['db_host'], $config['db_name'], $config['db_user'], $config['db_pass']);
+ $cntry = $_POST['orszag'];
+
+
+ //Utolsó order Number
+ $msh->query("SELECT `order` FROM `o_orders` WHERE `country` = '{$cntry}' ORDER BY `id` DESC limit 1");
+ $order=$msh->fetchNext();
+ $orderNumber = $order['order'];
+ // Majd a rákövetkező, ez kerül be adatbázisba
+ $kezdo = strpos($orderNumber, "-")+1;
+ $veg = strpos($orderNumber, "/")-2;
+ $szam = (int)substr($orderNumber, $kezdo, $veg)+1;
+ $prOrderNumber = "E-".$szam."/".date("Y");
+
+ $msh->query("SELECT `ctrNameEng` FROM `countries` WHERE `ctrID` = '{$cntry}'");
+ $ctryName = $msh->fetchNext();
+ $orszagNev = $ctryName['ctrNameEng'];
+
+
+
+ //Fájlnév
+ // $temp = explode(".", $_FILES["file"]["name"]); <-- Ha megváltozik a fájl neve, akkor a kiterjesztés itt lesz
+ // $fileName = $fajlNev.'.'.end($temp);
+
+ $fileName = $_FILES["file"]["name"];
+
+ //Célmappa
+ $targetDir = "../../";
+ $targetFilePath = $targetDir.$fileName;
+
+ // Engedélyezett fájlkiterjesztések
+ $fileType = pathinfo($targetFilePath,PATHINFO_EXTENSION);
+ $allowTypes = array('jpg', 'png', 'jpeg', 'gif', 'pdf', 'docx', 'doc', 'txt', 'bmp');
+
+ if (in_array($fileType, $allowTypes)) {
+ // Feltöltés a szerverre
+ if (move_uploaded_file($_FILES["file"]["tmp_name"], $targetFilePath)) {
+ // $eredmeny['sikeres'] = "Sikeres felöltés";
+ }
+ else {
+ $eredmeny['hiba'] = "Error in file uploading";
+ echo json_encode($eredmeny);
+ return false;
+ }
+ }
+ else {
+ $eredmeny['hiba'] = "Unknown file extension";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+
+ //recipient
+ $to = 'office@cadline.hu';
+ //sender
+ $from = 'partnering@archlinexp.com';
+ $fromName = 'ARCHLineXP Retail Store Enrollment Certification';
+
+ //email subject
+ $subject = 'Attachment for order: '.$orszagNev.' '.$prOrderNumber.' Non-profit';
+
+ //attachment file path
+ $file = $targetFilePath;
+
+ //email body content
+ $htmlContent = 'Enrollment Certification
';
+
+ //header for sender info
+ $headers = "From: $fromName"." <".$from.">";
+
+ //boundary
+ $semi_rand = md5(time());
+ $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
+
+ //headers for attachment
+ $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\"";
+
+ //multipart boundary
+ $message = "--{$mime_boundary}\n" . "Content-Type: text/html; charset=\"UTF-8\"\n" .
+ "Content-Transfer-Encoding: 7bit\n\n" . $htmlContent . "\n\n";
+
+ //preparing attachment
+ if(!empty($file) > 0){
+ if(is_file($file)){
+ $message .= "--{$mime_boundary}\n";
+ $fp = @fopen($file,"rb");
+ $data = @fread($fp,filesize($file));
+
+ @fclose($fp);
+ $data = chunk_split(base64_encode($data));
+ $message .= "Content-Type: application/octet-stream; name=\"".basename($file)."\"\n" .
+ "Content-Description: ".basename($files[$i])."\n" .
+ "Content-Disposition: attachment;\n" . " filename=\"".basename($file)."\"; size=".filesize($file).";\n" .
+ "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n";
+ }
+ }
+ // $message .= "--{$mime_boundary}--";
+ $returnpath = "-f" . $from;
+
+ //send email
+ if ($cntry != '37')
+ $mail = @mail($to, $subject, $message, $headers, $returnpath);
+
+ //email sending status
+ // echo $mail?"Mail sent.
":"Mail sending failed.
";
+
+ unlink($targetFilePath);
+
+}
+?>
diff --git a/var/www/hosting/archlinexp.com/partners/public/order/nonpro.php.evidence.json b/var/www/hosting/archlinexp.com/partners/public/order/nonpro.php.evidence.json
new file mode 100644
index 0000000..164584d
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/public/order/nonpro.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "5431",
+ "log_excerpt": "[quarantine] partners.archlinexp.com:public/order/nonpro.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/archlinexp.com/partners/public/order/nonpro.php)",
+ "original_sha256": "ced4101b56c89a10905dec6c040e30953f093bea56cbbe66c970826ce31c9411",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1639468483,
+ "size": 4119,
+ "uid": 11669
+ },
+ "rel_path": "public/order/nonpro.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "partners.archlinexp.com"
+}
diff --git a/var/www/hosting/archlinexp.com/partners/public/order/szerver.php b/var/www/hosting/archlinexp.com/partners/public/order/szerver.php
new file mode 100644
index 0000000..575cc7f
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/public/order/szerver.php
@@ -0,0 +1,2255 @@
+init($config['db_host'], $config['db_name'], $config['db_user'], $config['db_pass']);
+$conn = new mysqli($config['db_host'], $config['db_user'], $config['db_pass'], $config['db_name']);
+
+$ip = $_SERVER['REMOTE_ADDR'];
+$eredmeny = [];
+$sesion_id = bin2hex(openssl_random_pseudo_bytes(10));
+
+if (mysqli_real_escape_string($conn, $_GET['bizt']) != mysqli_real_escape_string($conn, $_GET['biztonsagi']) || mysqli_real_escape_string($conn, $_GET['confirm']) != "Y" || mysqli_real_escape_string($conn, $_GET['confirm_2']) != "Y") {
+ $eredmeny["hiba"] = "Your security answer was wrong or you forgot the confirm checkbox!
+
+ Continue.";
+} else {
+ $query = "SELECT ip, COUNT(ip) as szam FROM o_orders WHERE ip='" . $ip . "' AND DATE=CURDATE()";
+ $msh->query($query);
+ $limit = $msh->fetchNext();
+
+ $msh->query("SELECT `limit` FROM `o_products` limit 1");
+ $max_limit = $msh->fetchNext();
+
+ if ($limit['szam'] < $max_limit['limit']) { // Napi limit
+ define('PATH_CODEGEN', "/usr/local/sbin/codegen");
+
+ $kategoria = mysqli_real_escape_string($conn, $_GET['kategoria']); // Lehet: perp, upgrade, akcio, nonprofit, hardlock, module
+ $hl_prot = mysqli_real_escape_string($conn, $_GET['hl_prot']);
+ $program = mysqli_real_escape_string($conn, $_GET['prg']);
+ $cntry2 = mysqli_real_escape_string($conn, $_GET['cntry']);
+ $cntry = substr($cntry2, 0, 2); // 1 orszagon belul tobb viszontelado lehetseges, ezert 3 jegyu koddal jelentkeznek be
+ $ma = date("Y-m-d");
+ $email = mysqli_real_escape_string($conn, $_GET['email']);
+ $u_name = mysqli_real_escape_string($conn, $_GET['name']);
+ $info = mysqli_real_escape_string($conn, $_GET['info']);
+ $prodID = mysqli_real_escape_string($conn, $_GET['prodID']);
+ $needCredit = false;
+
+ $query = "SELECT DISTINCT `email`, `sub_email` FROM `o_products` WHERE `lang` = '{$cntry2}'";
+ $msh->query($query);
+ $kapcsolat = $msh->fetchNext();
+
+ if ($kapcsolat['email'] == "") {
+ $eredmeny["hiba"] = "Access denied
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ if (isset($prodID) && $prodID != '') {
+ $osszeg = "SELECT * FROM `o_products` WHERE `id` = '" . $prodID . "'";
+ $msh->query($osszeg);
+ $ertek2 = $msh->fetchNext();
+
+ $program = $ertek2['termek'];
+ } else {
+ $osszeg = "SELECT * FROM `o_products` WHERE `termek` = '" . $program . "' AND `lang` = '" . $cntry2 . "' AND `kategoria` = '" . $kategoria . "'";
+ $msh->query($osszeg);
+ $ertek2 = $msh->fetchNext();
+ }
+
+ $price = $cntry == 11 ? $ertek2["usd"] : $ertek2["euro"];
+ $akcio = $ertek2["akcio"];
+
+ if ($akcio != '' && $akcio != null && date('Y-m-d') <= $ertek2['ackio_date']) $price = $akcio;
+
+ if (mysqli_real_escape_string($conn, $_GET['credit']) == "Y") {
+ if ($price > $ertek2['credit'])
+ $credit = $ertek2['credit'];
+ else
+ $credit = $price;
+
+ $price -= $credit;
+ $deducted_credit = $ertek2['credit'] - $credit;
+
+ $query = "UPDATE o_products SET credit = {$deducted_credit} WHERE lang = '{$cntry2}'";
+ $msh->query($query);
+
+ $needCredit = true;
+ }
+
+ // TODO: spanyoloknak nem mukodik
+ /*if ($ertek2["is_invoice"] == 0) {
+ $eredmeny['hiba'] = "You have invoice(s) more than 14 days overdue.
+
+ The web-order system is temporary not available for attempts to create a new order.
+
+ Please advise as to whether payment has been scheduled.
+
+ If you require any further information from us, please contact us at office@cadline.hu
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }*/
+
+ $isInvoice = false;
+ $tax = TaxPayer::TAXPAYER_HAS_TAXNUMBER;
+ $curr = "EUR";
+ $cur = Currency::CURRENCY_EUR;
+ $lang = Language::LANGUAGE_EN;
+ $prod_prefix = "EU";
+ $inv_prefix = "EUR";
+ switch ($cntry) {
+ case '39': // Olaszorszag
+ $lang = Language::LANGUAGE_IT;
+ break;
+ case '43': // Ausztria
+ $lang = Language::LANGUAGE_DE;
+ break;
+ case '49': // Nemetorszag
+ $lang = Language::LANGUAGE_DE;
+ $isInvoice = true;
+ break;
+ case '38': // Horvatorszag
+ $lang = Language::LANGUAGE_HR;
+ $isInvoice = true;
+ break;
+ case '33': // Franciaorszag
+ $lang = Language::LANGUAGE_FR;
+ $isInvoice = true;
+ break;
+ case '42': // Csehorszag
+ $lang = Language::LANGUAGE_CZ;
+ $isInvoice = true;
+ break;
+ case '48': // Lengyelorszag
+ $lang = Language::LANGUAGE_PL;
+ $isInvoice = true;
+ break;
+ case '34': // Spanyolorszag
+ $lang = Language::LANGUAGE_ES;
+ $isInvoice = true;
+ break;
+ case '37': // TESZT
+ $tax = TaxPayer::TAXPAYER_NO_TAXNUMBER;
+ $isInvoice = false;
+ break;
+ case '82': //Korea
+ $prod_prefix = "Non-EU";
+ $isInvoice = true;
+ break;
+ case '61': //Ausztralia
+ $prod_prefix = "Non-EU";
+ $isInvoice = true;
+ break;
+ case '88': //Tajvan
+ $prod_prefix = "Non-EU";
+ $isInvoice = true;
+ break;
+ case '44': //UK
+ $prod_prefix = "Non-EU";
+ $isInvoice = true;
+ break;
+ case '84': //Vietnam
+ $prod_prefix = "Non-EU";
+ break;
+ case '52': //Mexiko
+ $prod_prefix = "Non-EU";
+ break;
+ case '60': //Malajzia
+ $prod_prefix = "Non-EU";
+ $isInvoice = true;
+ break;
+ case '60': //Szingapur
+ $prod_prefix = "Non-EU";
+ $isInvoice = false;
+ break;
+ case '65': //Szingapur
+ $prod_prefix = "Non-EU";
+ $isInvoice = true;
+ break;
+ case '30': //Gorogorszag
+ $isInvoice = true;
+ break;
+ case '51': //Portugalia
+ $isInvoice = true;
+ break;
+ case '11': // USA
+ $curr = "USD";
+ $cur = Currency::CURRENCY_USD;
+ $prod_prefix = "Non-EU";
+ $inv_prefix = "USD";
+ $isInvoice = true;
+ break;
+ case '71': // Lettorszag
+ $isInvoice = true;
+ break;
+ case '86': // Szlovenia
+ $isInvoice = true;
+ break;
+ case '55': // Brazilia
+ $prod_prefix = "Non-EU";
+ $isInvoice = true;
+ break;
+ case '90':
+ $isInvoice = true;
+ break;
+ default: // Minden mas
+ $tax = TaxPayer::TAXPAYER_NO_TAXNUMBER;
+ $eredmeny['hiba'] = "Not valid country code.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ break;
+ }
+
+ if (mysqli_real_escape_string($conn, $_GET['user']) == "ismeretlen") {
+ if ($kategoria == 'nonp') {
+ $status = '4';
+ $userType = 2;
+ } else {
+ $status = '11';
+ $userType = 1;
+ }
+
+ $query = "SELECT id FROM distributors WHERE ctrID = {$cntry2}";
+ $msh->query($query);
+ $dist = $msh->fetchNext();
+
+ if (!empty($dist)) $distID = $dist['id'];
+ else $distID = 0;
+
+ $insert = $msh->insert('users', array(
+ 'strName' => $u_name,
+ 'nManagerID' => '36',
+ 'nSchoolID' => '0',
+ 'strLease' => '',
+ 'deleted' => '0',
+ 'old_db' => 'clusers_eng',
+ 'bNewsletter' => 'N',
+ 'strEMail' => $email,
+ 'strCurrency' => $curr,
+ 'nCtrID' => $cntry,
+ 'nUserStatus' => $status,
+ 'nDistID' => $distID,
+ 'nUserType' => $userType
+ ));
+
+ require_once 'PasswordHash.php';
+
+ $query = "SELECT `nUserID` FROM `users` WHERE `strEMail` = '" . $email . "' limit 1";
+ $msh->query($query);
+ $usr = $msh->fetchNext();
+
+ $exploded_email = explode("@", $email);
+
+ $phpass = new PasswordHash(10, true);
+ $password = $phpass->HashPassword($exploded_email[0]);
+
+ $jml_user = array(
+ 'name' => $u_name,
+ 'username' => $email,
+ 'email' => $email,
+ 'password' => $password,
+ 'registerDate' => date('Y-m-d'),
+ 'nUserID' => $usr['nUserID']
+ );
+
+ $insert = $msh->insert('www_archline_hu.jml_users', $jml_user);
+
+ $msh->query("SELECT id FROM www_archline_hu.jml_users WHERE email = '$email' limit 1");
+ $foundedUser = $msh->fetchNext();
+
+ $insert = $msh->insert("www_archline_hu.jml_user_usergroup_map", array("user_id" => $foundedUser['id'], "group_id" => 2));
+
+ $insert = $msh->insert('u_history', array(
+ 'nUserID' => $usr['nUserID'],
+ 'nTopicID' => 382,
+ 'dateEvent' => date('Y-m-d'),
+ 'strPlace' => 'Weborder',
+ 'strInfo' => 'Weborderen regisztrált',
+ 'nManagerID' => 36,
+ 'insertDate' => date('Y-m-d H:i:s')
+ ));
+ }
+
+ $felhasznalo = "SELECT `nUserID` FROM `users` WHERE `strEMail` = '" . $email . "' limit 1";
+ $msh->query($felhasznalo);
+ $felh = $msh->fetchNext();
+ $user = $felh['nUserID'];
+
+ if (mysqli_real_escape_string($conn, $_GET['user']) == "ismeretlen") {
+ $insert = $msh->insert('u_emails', array(
+ 'email' => $email,
+ 'nUserID' => $user,
+ 'default' => '1',
+ 'active' => '1',
+ 'deleted' => '0',
+ 'newsletter' => '1'
+ ));
+ }
+
+ $query = "SELECT DISTINCT `email`, `sub_email` FROM `o_products` WHERE `lang` = '{$cntry}'";
+ $msh->query($query);
+ $kapcsolat = $msh->fetchNext();
+
+ $query = "SELECT `ctrNameEng` FROM `countries` WHERE `ctrID` = '{$cntry}'";
+ $msh->query($query);
+ $ctryName = $msh->fetchNext();
+
+ //Utolso order Number
+ $msh->query("SELECT `order` FROM `o_orders` WHERE `country` = '{$cntry2}' ORDER BY `id` DESC limit 1");
+ $order = $msh->fetchNext();
+ $orderNumber = $order['order'];
+ $kezdo = strpos($orderNumber, "-") + 1; // Majd a rakovetkezo, ez kerul be adatbazisba
+ $veg = strpos($orderNumber, "/") - 2;
+ $szam = (int)substr($orderNumber, $kezdo, $veg) + 1;
+ $prOrderNumber = "E-" . $szam . "/" . date("Y");
+ $brut = $cntry == 11 ? $ertek2["usd"] : $ertek2["euro"];
+
+ if ($needCredit) {
+ $creditMsg = "
+ Price: {$brut}
+
+ Credit: -{$credit}";
+ }
+
+ if ($isInvoice && $brut != 0) {
+ $partners = "SELECT * FROM szamla_agent.partnerek WHERE active = 1 AND ország = " . $cntry2;
+ $msh->query($partners);
+ $partner = $msh->fetchNext();
+
+ if ($cntry == 55) {
+ $date = new DateTime(date('Y-m'));
+ $date->modify('+ 1 month');
+ $paymentDue = $date->format('Y-m') . '-15';
+ } else {
+ $date = new DateTime(date('Y-m-d'));
+ $date->modify('+' . $partner["fizetési_határidő"] . " day");
+ $paymentDue = $date->format('Y-m-d');
+ }
+
+ $agent = SzamlaAgentAPI::create('3i73vj72wt7h3ig78wrawt7h3ik5batswt7h3inhzw', false, Log::LOG_LEVEL_ERROR); // Szamla Agent CADLine kulcs
+ //$agent = SzamlaAgentAPI::create('c9k2ydfs2c2sa29c2uti9msiehc3b6zrr48qbvsqbs', false, Log::LOG_LEVEL_OFF); // Teszt Kulcs
+
+ $agent->setCertificationPath($_SERVER['DOCUMENT_ROOT'] . '/certs');
+
+ $invoice = new Invoice(Invoice::INVOICE_TYPE_E_INVOICE);
+ //$invoice = new Invoice(Invoice::INVOICE_TYPE_P_INVOICE); //Teszt Szamla
+
+ $header = $invoice->getHeader();
+ $header->setPaymentMethod(Invoice::PAYMENT_METHOD_TRANSFER);
+ $header->setCurrency($cur);
+ $header->setLanguage($lang);
+ $header->setPaymentDue($paymentDue);
+ $header->setComment("*Please use the invoice number (E-EUR-2022-xxx) as a reference number to identify your payment.
+
+ Banktransfer info:
+ K&H BANK Hungary
+ IBAN: HU89 1040 0951 4955 4949 4954 1028
+ SWIFT CODE: OKHBHUHB");
+ $header->setPrefix($inv_prefix);
+
+ if ($partner["közösségi_adószám"] == '' && $partner["adószám"] == "") {
+ $tax = TaxPayer::TAXPAYER_NO_TAXNUMBER;
+ }
+
+ $seller = new Seller('K&H Bank EUR', 'IBAN: HU89 1040 0951 4955 4949 4954 1028');
+ $seller->setEmailReplyTo('office@cadline.hu');
+ $seller->setEmailSubject('Számlaértesítő / Invoice - CadLine Kft.');
+ $seller->setEmailContent('Tisztelt/Dear ' . $partner["kapcsolattartó_neve"] . ',
+
+
+ Mellékelten küldjük aktuális számláját.
+ Kérjük, utaláskor a közlemény rovatban KIZÁRÓLAG a számlaszámot tüntesse fel! (pl.: E-HUF-2022-xxxx)
+
+ Amennyiben ezzel kapcsolatban bármilyen kérdése merülne fel, kérjük hívja Ügyfélszolgálatunkat, ahol munkatársaink készséggel állnak ügyfeleink rendelkezésére.
+
+ Cadline Ltd invoice is attached. Please use the invoice number (E-EUR-2022-xxx) as a reference number to identify your payment. Payment made via wire transfer must be made in full including any fees/charges for the wire transfer, which are your responsibility. (If your bank uses an intermediary bank, there may be additional charges.) If payment is not received in full, you will be invoiced for any balance due on the account.
+ Payment must be completed by the "due date" of the invoice date.
+
+
+ Üdvözlettel / Sincerely:
+ CadLine Office');
+ $invoice->setSeller($seller);
+
+ $buyer = new Buyer($partner["partner"], $partner["irányítószám"], $partner["település"], $partner["utca_házszám"]);
+ $buyer->setTaxPayer($tax);
+
+ if ($partner["közösségi_adószám"] != "") $buyer->setTaxNumberEU($partner["közösségi_adószám"]);
+ elseif ($partner["adószám"] != "") $buyer->setTaxNumber($partner["adószám"]);
+
+ if ($prod_prefix == 'Non-EU') $afa_key = 'EUK'; // Ha non-eu-s a prod prefix, akkor eun kivuli
+ if ($prod_prefix == 'EU') $afa_key = 'EU';
+
+ $buyer->setEmail($partner["email"]);
+ $buyer->setSendEmail(true);
+ $invoice->setBuyer($buyer);
+
+ $product = "SELECT product_id FROM szamla_agent.web_product WHERE `web_id` = '" . $ertek2['id'] . "'";
+ $msh->query($product);
+ $product_id = $msh->fetchNext();
+
+ $termekek = "SELECT * FROM szamla_agent.termekek WHERE id='" . $product_id["product_id"] . "'";
+ $msh->query($termekek);
+ $termek = $msh->fetchNext();
+ }
+
+ $hardlock = "SELECT megnevezés, nettó FROM szamla_agent.termekek WHERE id='30'";
+ $msh->query($hardlock);
+ $hardlock_price = $msh->fetchNext();
+
+ $verz = "SELECT `verCode`, verID, year FROM `p_versions` WHERE `verActual` = 'Y'";
+ $msh->query($verz);
+ $verzi = $msh->fetchNext();
+ $version = /*$verzi['verCode']*/ 79;
+ $prg_product_id = 1;
+ $generate_prev_program = false;
+ $ev = GetYearFromVerCode($version);
+ $elozoEv = $ev - 1;
+
+ $sellDate = date("Y-m-d H:i:s");
+ $actDate = date("Y-m-d H:i:s");
+ $fizetve = '2050-01-01';
+ $time = date("Y-m-d H:i:s");
+ $lastMod = date("Y-m-d H:i:s");
+ $stat = 0;
+ $invoiceDateFrom = date('Y-m', time());
+ $contact = 0;
+ $regi_kulcs = '';
+ $actCode = '';
+ $u_info = '';
+ $u_topic = '';
+
+ $query = "SELECT * FROM `p_versions` WHERE currentVer = 0 OR currentVer = 2";
+ $msh->query($query);
+ $curr_ver = $msh->fetchNext();
+ $version_live = $curr_ver['verCode'];
+ $liveEv = GetYearFromVerCode($version_live);
+ $elozoLiveEv = $liveEv - 1;
+
+ switch ($kategoria) {
+ case 'perp':
+ if (mysqli_real_escape_string($conn, $_GET['reszlet']) == "Y") {
+ switch ($cntry) {
+ case '43':
+ $reszlet = '3';
+ $payment = 'Instalments: 4 Period: quarterly';
+ $fizHatIdo = date('Y-m', strtotime($ma . '+365 days'));
+ if (strstr($program, "Professional") || strstr($program, "Prof.")) {
+ $payment = 'Instalments: 4 Period: monthly';
+ }
+
+ if ($prodID == '191') {
+ $payment = 'Instalments: 4 Period: monthly';
+ }
+ break;
+
+ case '39':
+ $reszlet = "12";
+ $payment = 'Instalments: 2 Period: yearly';
+ $fizHatIdo = date('Y-m', strtotime($ma . '+365 days'));
+ break;
+
+ case '48':
+ $reszlet = "1";
+ $payment = 'Instalments: 4 Period: monthly';
+ $fizHatIdo = date('Y-m', strtotime($ma . '+120 days'));
+ break;
+
+ case '42':
+ if (strpos($program, "Interior")) {
+ $reszlet = "";
+ $payment = 'pay in full';
+ $fizHatIdo = date('Y-m', strtotime($ma . '+365 days'));
+ } else {
+ $reszlet = "1";
+ $payment = 'Instalments: 6 Period: monthly';
+ $fizHatIdo = date('Y-m', strtotime($ma . '+180 days'));
+ }
+ break;
+ }
+ } else {
+ $reszlet = "";
+ $payment = 'pay in full';
+ $fizHatIdo = date('Y-m', strtotime($ma . '+365 days'));
+ }
+
+ $type = $ertek2['type'];
+
+ $keres = "SELECT `verID` FROM `p_versions` ORDER BY `verCode` DESC limit 1";
+ $msh->query($keres);
+ $limit = $msh->fetchNext();
+
+ $alap_ar = $price; // $alap_ar megszunik!!!!
+ $lan = "0";
+ $ertek = $price;
+ $ev2 = date("Y");
+ $elozoEv1 = $ev2 - 1;
+ $elozoEv2 = $ev2 - 2;
+ $elozoEv3 = $ev2 - 3;
+ $elozoEv4 = $ev2 - 4;
+ $msg = "";
+ $msg2 = "";
+ $msg3 = "";
+ $msg4 = "";
+
+ if ($hl_prot == "Y") { // Ker hardlockot
+ $kulcs = mysqli_real_escape_string($conn, $_GET['hl_num']);
+ $hardlockPrice = $hardlock_price["nettó"];
+ $ertek = $price + $hardlockPrice;
+ $hardlock_id = $cntry;
+
+ if ($cntry == "43" || $cntry == "39") $ertek = $price;
+ }
+
+ if ($hl_prot == "N") { // Nem ker hardlockot -> szoftveres kulcs
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '95%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $kulcsok = $msh->fetchNext();
+ $kulcs = $kulcsok['hlNum'] + 1;
+ $hardlock_id = "95";
+ }
+
+ $number = substr($kulcs, 2, 4);
+
+ if ((mysqli_real_escape_string($conn, $_GET['code_prev_version']) == "Y" && $generate_prev_program == false) || mysqli_real_escape_string($conn, $_GET['ver_2']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_3']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_4']) == "Y") {
+ if ($cntry == '37' || $cntry == '43') $ertek += 150;
+ }
+
+ $live = $alap_ar;
+ if (mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y") {
+ if ($cntry == '48') {
+ $live += 200;
+ $ertek += 200;
+ } else {
+ $live += 150;
+ $ertek += 150;
+ }
+ }
+
+ $subtotal = $price;
+ if ((strpos($program, "Interior") || strpos($program, "Professional")) && strpos($program, "LIVE")) {
+ $subtotal -= 100;
+ $live_item = "Subtotal: 100";
+ }
+
+ if (((strpos($program, "Interior") || strpos($program, "Professional")) && strpos($program, "LIVE") && strpos($program, "option") == FALSE) || mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y") {
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '$cntry%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $live_kulcsok = $msh->fetchNext();
+
+ $kulcs_live = $live_kulcsok['hlNum'] + 2;
+ $number_live = substr($kulcs_live, 2, 4);
+ $lan_live = "0";
+ $type_live = "L";
+ $command = PATH_CODEGEN . " -Password " . $cntry . $number_live . $version_live . $lan_live . $type_live;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $serial_live = fgets($ph, 1024);
+ pclose($ph);
+
+ if (mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y") {
+ if ($cntry == '48') {
+ $item_live = "
+ Item: Live
+
+ Subtotal: 200";
+ } else {
+ $item_live = "
+ Item: Live
+
+ Subtotal: 150";
+ }
+ }
+
+ $live_msg = "Serial code " . $liveEv . " Live: " . $serial_live . "
";
+
+ $insert = $msh->insert('hardlock', array(
+ 'hlNum' => $kulcs_live,
+ 'hlLan' => '0',
+ 'hlStat' => '1',
+ 'hlDateIssue' => $ma,
+ 'hlUser' => $user,
+ 'hlManID' => '36',
+ 'hlCtrID' => $cntry,
+ 'old_db' => 'clusers_eng',
+ 'hlTime' => date("Y-m-d H:i:s"),
+ 'product_id' => 2
+ ));
+
+ if ($generate_prev_program) {
+ $version_livePrev = $version_live - 1;
+ $command = PATH_CODEGEN . " -Password " . $cntry . $number_live . $version_livePrev . $lan_live . $type_live;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $serial_livePrev = fgets($ph, 1024);
+ pclose($ph);
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => 76,
+ 'prVerID' => $curr_ver['verID'] - 1,
+ 'prLan' => '0',
+ 'prPass' => $serial_livePrev,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs_live,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '1',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $live_msg .= " Serial code " . $elozoLiveEv . " Live: " . $serial_livePrev . "";
+ }
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => 76,
+ 'prVerID' => $curr_ver['verID'],
+ 'prLan' => '0',
+ 'prPass' => $serial_live,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs_live,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $insert = $msh->insert('h_history', array(
+ 'hiHlNum' => $kulcs_live,
+ 'hiDate' => date('Y-m-d'),
+ 'hiManID' => 36,
+ 'hiTypeID' => 3,
+ 'hiTime' => date("Y-m-d H:i:s"),
+ 'hiInfo' => "Web order, Aktiválás érvényessége: 2050-01-01",
+ ));
+ }
+
+ // 1 evvel ezelotti kulcs generalas
+ if (mysqli_real_escape_string($conn, $_GET['code_prev_version']) == "Y") $generate_prev_program = true;
+
+ // 2 evvel ezelotti kulcs generalas
+ if (mysqli_real_escape_string($conn, $_GET['ver_2']) == "Y") {
+ $version2 = $verzi['verCode'] - 2;
+ $command = PATH_CODEGEN . " -Password " . $hardlock_id . $number . $version2 . $lan . $type;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $serial17_2 = fgets($ph, 1024);
+ pclose($ph);
+
+ $msg2 = "Serial code $elozoEv2: $serial17_2
";
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $verzi['verID'] - 2,
+ 'prLan' => '0',
+ 'prPass' => $serial17_2,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+ }
+
+ // 3 evvel ezelotti kulcs generalas
+ if (mysqli_real_escape_string($conn, $_GET['ver_3']) == "Y") {
+ $version3 = $verzi['verCode'] - 3;
+ $command = PATH_CODEGEN . " -Password " . $hardlock_id . $number . $version3 . $lan . $type;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $serial16 = fgets($ph, 1024);
+ pclose($ph);
+
+ $msg3 = "Serial code $elozoEv3: $serial16
";
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $verzi['verID'] - 3,
+ 'prLan' => '0',
+ 'prPass' => $serial16,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+ }
+
+ // 4 evvel ezelotti kulcs generalas
+ if (mysqli_real_escape_string($conn, $_GET['ver_4']) == "Y") {
+ $version4 = $verzi['verCode'] - 4;
+ $command = PATH_CODEGEN . " -Password " . $hardlock_id . $number . $version4 . $lan . $type;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $serial15 = fgets($ph, 1024);
+ pclose($ph);
+
+ $msg4 = "Serial code $elozoEv4: $serial15
";
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $verzi['verID'] - 4,
+ 'prLan' => '0',
+ 'prPass' => $serial15,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+ }
+
+ if (strstr($program, "Professional") || strstr($program, "Prof.")) $prod = "Professional";
+ if (strstr($program, "Interior")) $prod = "Interior";
+ if (strstr($program, "Studio")) $prod = "Studio";
+ break;
+
+ case 'live':
+ $generate_prev_program = false;
+
+ $kulcs = substr((string)tryToAlloc(($cntry * 10000) + 1, ($cntry * 10000) + 9999), 0, 6);
+ $voucher = mysqli_real_escape_string($conn, $_GET['voucher']);
+
+ if ($kulcs == 0) $kulcs = ($cntry * 10000) + 1;
+
+ $query = "SELECT * FROM `p_versions` WHERE currentVer = 0 OR currentVer = 2";
+ $msh->query($query);
+ $curr_ver = $msh->fetchNext();
+
+ $version = $curr_ver['verCode'];
+ $ev = GetYearFromVerCode($version);;
+ $lan = "0";
+ $type = "L";
+ $hardlock_id = $cntry;
+ $ertek = $price;
+ $alap_ar = $price;
+ $prod = 'ARCHLINE.XP LIVE';
+ $prg_product_id = 2;
+
+ if (isset($voucher) && $voucher != '') {
+ $sql = "SELECT * FROM vouchers WHERE voucher = '{$voucher}'";
+ $msh->query($sql);
+ $result = $msh->fetchNext();
+
+ if (!empty($result) && $result['used'] == 0) {
+ $alap_ar -= 50;
+ $price -= 50;
+ $ertek -= 50;
+
+ $query = "UPDATE vouchers SET used = 1 WHERE voucher = '{$voucher}'";
+ $msh->query($query);
+ }
+ }
+
+ if ($ertek2['until'] != '' && $ertek2['until'] != NULL && $akcio != '' && $akcio != NULL) $fizetve = $ertek2['until'];
+ break;
+
+ case 'lt':
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '$cntry%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $kulcs = $msh->fetchNext();
+ if (empty($kulcs)) $kulcs = ($cntry * 10000) + 1;
+ else $kulcs = $kulcs['hlNum'] + 1;
+
+ $type = 4;
+ $lan = 0;
+ $hardlock_id = $cntry;
+ $ertek = $price;
+ $alap_ar = $price;
+ $prod = "ARCHLINE.XP LT";
+
+ if ($ertek2['id'] == 688 || $ertek2['id'] == 689 || $ertek2['id'] == 690) {
+ $generate_prev_program = false;
+ $version = 77;
+ $ev = '2020';
+ }
+
+ if ($ertek2['id'] == 548) {
+ $generate_prev_program = false;
+ $version = 78;
+ $ev = '2021';
+ }
+
+ if ((strpos($program, "LT") && strpos($program, "LIVE")) || mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y") {
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '$cntry%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $kulcs2 = $msh->fetchNext();
+ $kulcs_live = $kulcs2['hlNum'] + 2;
+
+ $number_live = substr($kulcs_live, 2, 4);
+ $lan_live = "0";
+ $type_live = "L";
+ $command = PATH_CODEGEN . " -Password " . $cntry . $number_live . $version_live . $lan_live . $type_live;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $serial_live = fgets($ph, 1024);
+ pclose($ph);
+
+ $insert = $msh->insert('hardlock', array(
+ 'hlNum' => $kulcs_live,
+ 'hlLan' => '0',
+ 'hlStat' => '1',
+ 'hlDateIssue' => $ma,
+ 'hlUser' => $user,
+ 'hlManID' => '36',
+ 'hlCtrID' => $cntry,
+ 'old_db' => 'clusers_eng',
+ 'hlTime' => date("Y-m-d H:i:s"),
+ 'product_id' => 2
+ ));
+
+ $live_msg = "Serial code " . $liveEv . " LIVE: " . $serial_live . "
";
+
+ if ($generate_prev_program) {
+ $version_livePrev = $version_live - 1;
+ $command = PATH_CODEGEN . " -Password " . $cntry . $number_live . $version_livePrev . $lan_live . $type_live;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $serial_livePrev = fgets($ph, 1024);
+ pclose($ph);
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => 76,
+ 'prVerID' => $curr_ver['verID'] - 1,
+ 'prLan' => '0',
+ 'prPass' => $serial_livePrev,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs_live,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '1',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $live_msg .= " Serial code " . $elozoLiveEv . " Live: " . $serial_livePrev . "";
+ }
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => 76,
+ 'prVerID' => $curr_ver['verID'],
+ 'prLan' => '0',
+ 'prPass' => $serial_live,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs_live,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $insert = $msh->insert('h_history', array(
+ 'hiHlNum' => $kulcs_live,
+ 'hiDate' => date('Y-m-d'),
+ 'hiManID' => 36,
+ 'hiTypeID' => 3,
+ 'hiTime' => date("Y-m-d H:i:s"),
+ 'hiInfo' => "Web order, Aktiválás érvényessége: 2050-01-01",
+ ));
+
+ if (mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y") {
+ $live = $alap_ar;
+
+ if ($cntry == '48') {
+ $live += 200;
+ $ertek += 200;
+
+ $item_live = "
+ Item: Live
+
+ Subtotal: 200";
+ } else {
+ $live += 150;
+ $ertek += 150;
+
+ $item_live = "
+ Item: Live
+
+ Subtotal: 150";
+ }
+
+ $alap_ar = $ertek;
+ }
+ }
+ break;
+
+ case 'upgrade':
+ $old_serial = mysqli_real_escape_string($conn, $_GET['old_hlNum']);
+
+ // interior, lt, studio, nova, professional
+ $upgrade_array = array(2, 4, 6, 7, 8, 'L');
+
+ if (strstr($program, "LIVE") && (strstr($program, "upgrade") || strstr($program, "Upgrade"))) {
+ if (substr($old_serial, 6, 1) != 'L') {
+ $eredmeny['hiba'] = "Its not a LIVE serial.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ if (substr($old_serial, 7, 2) == $verzi['verPassword8and9']) {
+ $eredmeny['hiba'] = "You can't upgrade this software
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+ }
+
+ if (strstr($program, "LT") && (strstr($program, "upgrade") || strstr($program, "Upgrade"))) {
+ if (substr($old_serial, 6, 1) != '4') {
+ $eredmeny['hiba'] = "Its not an LT serial.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+ }
+
+ if ($tomb['seq'] == '1') {
+ if (strstr($program, "Professional") && (strstr($program, "upgrade") || strstr($program, "Upgrade"))) {
+ if (substr($old_serial, 6, 1) != '8' && substr($old_serial, 6, 1) != '7') {
+ $eredmeny['hiba'] = "Its not a Professional serial.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+ }
+
+ if (strstr($program, "Studio") && (strstr($program, "upgrade") || strstr($program, "Upgrade"))) {
+ if (substr($old_serial, 6, 1) != '6') {
+ $eredmeny['hiba'] = "Its not a Studio serial.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+ }
+ }
+
+ if (strlen($old_serial) == "16") { //Update esete
+ if (!in_array(substr($old_serial, 6, 1), $upgrade_array)) {
+ $eredmeny['hiba'] = "Its not a Pro or a Studio serial.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ } else {
+ if (substr($old_serial, 6, 1) == "8" && (substr($old_serial, 7, 2) == $verzi['verPassword8and9'])) {
+ $eredmeny['hiba'] = "You can't upgrade this software
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $query = "SELECT * FROM `h_programs` WHERE `prPass` = '{$old_serial}'";
+ $msh->query($query);
+ $hl = $msh->fetchNext();
+
+ if (empty($hl)) {
+ $eredmeny['hiba'] = "Unknown serial number
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $ertek = $price;
+ $kulcs = substr($old_serial, 0, 6);
+ $hardlock_id = substr($old_serial, 0, 2);
+ $number = substr($old_serial, 2, 4);
+
+ $query = "SELECT `hlLan` FROM `hardlock` WHERE `hlNum`='" . $kulcs . "' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $hlLan = $msh->fetchNext();
+ $lan = $hlLan['hlLan'];
+
+ $msh->query("SELECT `termek`, `euro`, `usd`, `seq` FROM `o_products` WHERE `termek` = '{$program}' AND `lang` = '{$cntry}'");
+ $tomb = $msh->fetchNext();
+
+ // Ha NOVA, vagy Professional akkor professionalt kap
+ if (substr($old_serial, 6, 1) == 7 || substr($old_serial, 6, 1) == 8) $type = 8;
+ elseif (substr($old_serial, 6, 1) == 4) $type = 4; // LT upgrade
+ elseif (substr($old_serial, 6, 1) == 2) $type = 2; // Interior upgrade
+ elseif (substr($old_serial, 6, 1) == 'L') { // LIVE upgrade
+ $type = 'L';
+ $prg_product_id = 2;
+ } else {
+ if ($tomb['seq'] == "30" || $tomb['seq'] == "31") $type = 6; // Update Studio Studio-ra
+ else $type = 8; // Update Studio 2017 Prof-ra vagy Update Studio 2016 vagy korabbi Prof-ra
+ }
+
+ if ($tomb['seq'] == '32') $type = 8; // Update Interior -> Professional
+ if ($tomb['seq'] == '33') $type = 2; // Update Studio -> Interior
+
+ $lan2 = 0;
+
+ if ($lan == 0) $lan2 = 0;
+ elseif ($lan == 1) $lan2 = 0;
+ elseif ($lan == 2) $lan2 = 2;
+ elseif ($lan == 3) $lan2 = 3;
+ elseif ($lan == 4) $lan2 = 4;
+ elseif ($lan == 5) $lan2 = 5;
+ elseif ($lan == 10) $lan2 = 6;
+ elseif ($lan == 15) $lan2 = 7;
+ elseif ($lan == 20) $lan2 = 8;
+ elseif ($lan <= 49) $lan2 = 9;
+
+ $lan = $lan2;
+ $command = PATH_CODEGEN . " -Password " . $hardlock_id . $number . $version . $lan . $type;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $serial = fgets($ph, 1024);
+ $password = $serial;
+ pclose($ph);
+
+ $query = "SELECT * FROM `h_programs` WHERE `prPass`='" . $serial . "'";
+ $msh->query($query);
+ $prg = $msh->fetchNext();
+
+ if (empty($prg) == false) {
+ $eredmeny['hiba'] = "You already upgraded this serial number.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ } else {
+ // Ha studio, akkor meg kell allapítani hogy volt-e hozzatartozo module, ha igen, akkor ott az mdPrID-t, es a mdPrHlNum-ot kell modositani az uj programhoz
+ if (substr($serial, 6, 1) == "6") {
+ // Regi programhoz tartozo modul(ok)
+ $msh->query("SELECT * FROM `p_modules` WHERE `mdPrHlNum` = '{$kulcs}'");
+ $modules = $msh->fetchAssoc();
+ $uj_kulcs = $kulcs;
+ }
+
+ $prod = "Upgrade";
+ }
+
+ $query = "SELECT * FROM `p_versions` WHERE verPassword8and9 = '{$version}'";
+ $msh->query($query);
+ $prVer = $msh->fetchNext();
+ $prev_ver = $prVer['verID'] - 1;
+
+ $query = "SELECT * FROM `h_programs` WHERE `prHlNum` = '{$kulcs}' AND prVerID = " . $prev_ver;
+ $msh->query($query);
+ $prevProgram = $msh->fetchNext();
+
+ if (!empty($prevProgram)) $generate_prev_program = false;
+
+ if (mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y") {
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '$cntry%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $kulcs2 = $msh->fetchNext();
+ $kulcs_live = $kulcs2['hlNum'] + 2;
+
+ $number_live = substr($kulcs_live, 2, 4);
+ $lan_live = "0";
+ $type_live = "L";
+ $command = PATH_CODEGEN . " -Password " . $cntry . $number_live . $version_live . $lan_live . $type_live;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $serial_live = fgets($ph, 1024);
+ pclose($ph);
+
+ $insert = $msh->insert('hardlock', array(
+ 'hlNum' => $kulcs_live,
+ 'hlLan' => '0',
+ 'hlStat' => '1',
+ 'hlDateIssue' => $ma,
+ 'hlUser' => $user,
+ 'hlManID' => '36',
+ 'hlCtrID' => $cntry,
+ 'old_db' => 'clusers_eng',
+ 'hlTime' => date("Y-m-d H:i:s"),
+ 'product_id' => 2
+ ));
+
+ $live_msg = "Serial code " . $liveEv . " LIVE: " . $serial_live . "
";
+
+ if ($generate_prev_program) {
+ $version_livePrev = $version_live - 1;
+ $command = PATH_CODEGEN . " -Password " . $cntry . $number_live . $version_livePrev . $lan_live . $type_live;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $serial_livePrev = fgets($ph, 1024);
+ pclose($ph);
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => 76,
+ 'prVerID' => $curr_ver['verID'] - 1,
+ 'prLan' => '0',
+ 'prPass' => $serial_livePrev,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs_live,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '1',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $live_msg .= " Serial code " . $elozoLiveEv . " Live: " . $serial_livePrev . "";
+ }
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => 76,
+ 'prVerID' => $curr_ver['verID'],
+ 'prLan' => '0',
+ 'prPass' => $serial_live,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs_live,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $insert = $msh->insert('h_history', array(
+ 'hiHlNum' => $kulcs_live,
+ 'hiDate' => date('Y-m-d'),
+ 'hiManID' => 36,
+ 'hiTypeID' => 3,
+ 'hiTime' => date("Y-m-d H:i:s"),
+ 'hiInfo' => "Web order, Aktiválás érvényessége: 2050-01-01",
+ ));
+
+ $live = $alap_ar;
+
+ if ($cntry == '48') {
+ $live += 200;
+ $ertek += 200;
+
+ $item_live = "
+ Item: Live
+
+ Subtotal: 200";
+ } else {
+ $live += 150;
+ $ertek += 150;
+
+ $item_live = "
+ Item: Live
+
+ Subtotal: 150";
+ }
+
+ $alap_ar = $ertek;
+ }
+ }
+ } else {
+ $eredmeny['hiba'] = "Wrong serial.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $query = "UPDATE cl_hlusers.h_programs SET prStat = 2 WHERE prPass = '{$old_serial}'";
+ $msh->query($query);
+ break;
+
+ case 'crossgrade':
+ $generate_prev_program = false;
+ $old_serial = mysqli_real_escape_string($conn, $_GET['old_hlNum']);
+
+ if (substr($old_serial, 6, 1) != "4") {
+ $eredmeny['hiba'] = "Its not an LT serial.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $verz = "SELECT `verCode` FROM `p_versions` WHERE `verPassword8and9` = '" . substr($old_serial, 7, 2) . "'";
+ $msh->query($verz);
+ $verzi = $msh->fetchNext();
+
+ $query = "SELECT hlNum FROM hardlock WHERE hlNum LIKE '95%' AND hlStat = 0 AND (hlDealer = '' OR hlDealer IS NULL) AND (hlUser = '' OR hlUser IS NULL) AND (hlInfo = '' OR hlInfo IS NULL) limit 1";
+ $msh->query($query);
+ $hlnum = $msh->fetchNext();
+ $kulcs = $hlnum['hlNum'];
+ $prod = "Crossgrade";
+ $old_hlnum = substr($old_serial, 0, 6);
+ $hardlock_id = 95;
+ $version = $verzi['verCode'];
+ $type = 8;
+ $ertek = $price;
+ $lan = 0;
+ $ev = GetYearFromVerCode($version);
+
+ $update = $msh->update("hardlock", array("hlStat" => 2), "hlNum = {$old_hlnum}");
+ $update = $msh->update("h_programs", array("prStat" => 1), "prPass = {$old_serial}");
+
+ $msh->query("SELECT * FROM `p_modules` WHERE `mdPrHlNum` = '{$old_hlnum}'");
+ $modules = $msh->fetchAssoc();
+ $uj_kulcs = $kulcs;
+
+ if (mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y") {
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '$cntry%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $kulcs2 = $msh->fetchNext();
+ $kulcs_live = $kulcs2['hlNum'] + 2;
+
+ $number_live = substr($kulcs_live, 2, 4);
+ $lan_live = "0";
+ $type_live = "L";
+ $command = PATH_CODEGEN . " -Password " . $cntry . $number_live . $version_live . $lan_live . $type_live;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $serial_live = fgets($ph, 1024);
+ pclose($ph);
+
+ $insert = $msh->insert('hardlock', array(
+ 'hlNum' => $kulcs_live,
+ 'hlLan' => '0',
+ 'hlStat' => '1',
+ 'hlDateIssue' => $ma,
+ 'hlUser' => $user,
+ 'hlManID' => '36',
+ 'hlCtrID' => $cntry,
+ 'old_db' => 'clusers_eng',
+ 'hlTime' => date("Y-m-d H:i:s"),
+ 'product_id' => 2
+ ));
+
+ $live_msg = "Serial code " . $liveEv . " LIVE: " . $serial_live . "
";
+
+ if ($generate_prev_program) {
+ $version_livePrev = $version_live - 1;
+ $command = PATH_CODEGEN . " -Password " . $cntry . $number_live . $version_livePrev . $lan_live . $type_live;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $serial_livePrev = fgets($ph, 1024);
+ pclose($ph);
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => 76,
+ 'prVerID' => $curr_ver['verID'] - 1,
+ 'prLan' => '0',
+ 'prPass' => $serial_livePrev,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs_live,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '1',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $live_msg .= " Serial code " . $elozoLiveEv . " Live: " . $serial_livePrev . "";
+ }
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => 76,
+ 'prVerID' => $curr_ver['verID'],
+ 'prLan' => '0',
+ 'prPass' => $serial_live,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs_live,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $insert = $msh->insert('h_history', array(
+ 'hiHlNum' => $kulcs_live,
+ 'hiDate' => date('Y-m-d'),
+ 'hiManID' => 36,
+ 'hiTypeID' => 3,
+ 'hiTime' => date("Y-m-d H:i:s"),
+ 'hiInfo' => "Web order, Aktiválás érvényessége: 2050-01-01",
+ ));
+
+ $live = $alap_ar;
+
+ if ($cntry == '48') {
+ $live += 200;
+ $ertek += 200;
+
+ $item_live = "
+Item: Live
+
+Subtotal: 200";
+ } else {
+ $live += 150;
+ $ertek += 150;
+
+ $item_live = "
+Item: Live
+
+Subtotal: 150";
+ }
+
+ $alap_ar = $ertek;
+ }
+ break;
+
+ case 'module':
+ $hl_num = mysqli_real_escape_string($conn, $_GET['old_hlNum']);
+ $query = "SELECT `prId`, `prPass` FROM `h_programs` WHERE `prHlNum` = '{$hl_num}' ORDER BY `prID` DESC limit 1";
+ $msh->query($query);
+ $program_adatok = $msh->fetchNext();
+
+ // Csak Studio-hoz lehet kiadni modulokat
+ if (substr($program_adatok['prPass'], 6, 1) != "6") {
+ $eredmeny['hiba'] = "You can buy modules only for Studio
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $prId = $program_adatok['prId'];
+ $prHlNum = $hl_num;
+
+ if (strpos($program, "Terrain")) $verz = "2";
+ else $verz = "22";
+
+ // A hozzatartozo program serialja
+ $password = $program_adatok['prPass'];
+ $command = PATH_CODEGEN . " -Module " . $password . " " . $verz;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $modcode = fgets($ph, 1024);
+ pclose($ph);
+
+ // Ha mar van ilyen module az adott programhoz
+ $query = "SELECT `ID` FROM `p_modules` WHERE `mdPrID` = '{$prId}' AND `mdID` = '{$verz}' AND `mdPrHlNum` = '{$prHlNum}'";
+ $msh->query($query);
+ $module = $msh->fetchNext();
+
+ if ($module['ID']) {
+ $eredmeny['hiba'] = "You already have this module
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $insert = $msh->insert('p_modules', array(
+ 'mdID' => $verz,
+ 'mdPrID' => $prId,
+ 'mdPrHlNum' => $prHlNum,
+ 'mdCode' => $modcode,
+ 'mdDate' => $ma,
+ 'mdPrice' => '0',
+ 'mdInvNum' => '',
+ 'mdOrdNum' => $prOrderNumber,
+ 'mdIsPurchase' => '0',
+ ));
+
+ $ertek = $price;
+ $serial = $modcode;
+ $prod = "Module";
+ break;
+
+ case 'nonp':
+ //Ha mar volt nala ebben az evben?
+ $nonpr = mysqli_real_escape_string($conn, $_GET['nonpro_ev']);
+ $datum = mysqli_real_escape_string($conn, $_GET['datum']); // Ezt kérte speciálisan a partner. Attól függetlenül nem ez a dátum kerül be az adatbázisba
+ $date = date_create($datum);
+ $datum = date_format($date, "d/m/Y");
+ $expire = date_format($date, "Y-m-d");
+
+ $ev = substr($nonpr, 3, 4);
+ $generate_prev_program = false;
+
+ $query = "SELECT `verID`, `verCode`, `verPassword8and9`, `year` FROM `p_versions` WHERE `verName` = '{$nonpr}'";
+ $msh->query($query);
+ $vcode = $msh->fetchNext();
+
+ if (strpos($program, "LIVE")) {
+ $prg_product_id = 2;
+ $type = "L";
+ } elseif (strpos($program, "LT")) {
+ $prg_product_id = 1;
+ $type = "4";
+ } else {
+ $prg_product_id = 1;
+ $type = "8";
+ }
+
+ $prType = strpos($program, "LIVE") ? 76 : $type;
+
+ $query = "SELECT SUBSTRING(`prPass`, 8, 2) AS `prPass` FROM `h_programs` WHERE `prHlNum` IN (SELECT `hlNum` FROM `hardlock` WHERE `hlUser` = '{$user}' AND product_id = '{$prg_product_id}') AND `prHlNum` LIKE '99%' AND prTypeID = '{$prType}'";
+ $msh->query($query);
+ $nonprofit_kulcsok_evben = $msh->fetchAssoc();
+
+ $evek = array();
+ foreach ($nonprofit_kulcsok_evben as $v) {
+ $b = (object)$v;
+ $evek[] = $b->prPass;
+ }
+
+ // Ha mar volt nonprofit kulcsa az adott evben akkor nem enged tovább
+ if (!empty($evek)) {
+ if (in_array($vcode['verPassword8and9'], $evek) !== FALSE) {
+ $eredmeny['hiba'] = "You already have a non-profit key for this product
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+ }
+
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '99%' AND `hlStat` = 0 AND `hlLan` = 0 ORDER BY `hlNum` ASC limit 1";
+ $msh->query($query);
+ $nonprofitok = $msh->fetchNext();
+ $kulcs = $nonprofitok['hlNum'];
+
+ // Ha nincs mar, akkor letre kell hozni!!!
+ if (empty($nonprofitok['hlNum'])) {
+ $eredmeny['hiba'] = "There are no free nonprofit keys yet, please contact us.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $msh->update("hardlock", array("hlStat" => '1', "hlUser" => $user, "old_hlID" => '', "old_db" => 'clusers_eng', "hlDateIssue" => $ma, "product_id" => 2, "hlCtrID" => $cntry), "hlNum = {$kulcs}");
+
+ $version = $vcode['verCode'];
+ $hardlock_id = substr($kulcs, 0, 2);
+ $lan = 0;
+ $contact = 5;
+ $fizetve = date('Y-m-d', strtotime($ma . '+60 days'));
+
+ if ($expire <= $fizetve) $fizetve = $expire;
+
+ if ($ertek2['id'] == 700 || $ertek2['id'] == 701 || $ertek2['id'] == 702) {
+ $date = new DateTime("+12 months");
+ $fizetve = $date->format("Y-m-d");
+ }
+
+ if (($cntry == 61 /*|| $cntry == 37*/) && strpos($program, "LIVE") == FALSE) {
+ $query_live = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '99%' AND `hlStat` = 0 AND `hlLan` = 0 ORDER BY `hlNum` ASC limit 1";
+ $msh->query($query_live);
+ $nonprofitok_live = $msh->fetchNext();
+
+ $kulcs_live = $nonprofitok_live['hlNum'];
+ $number_live = substr($kulcs_live, 2, 4);
+ $lan_live = "0";
+ $type_live = "L";
+
+ $command = PATH_CODEGEN . " -Password " . 99 . $number_live . $version_live . $lan_live . $type_live;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $serial_live = fgets($ph, 1024);
+ pclose($ph);
+
+ $msh->update("hardlock", array("hlStat" => '1', "hlUser" => $user, "old_hlID" => '', "old_db" => 'clusers_eng', "hlDateIssue" => $ma, "product_id" => 2, "hlCtrID" => $cntry), "hlNum = {$kulcs_live}");
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => "76",
+ 'prVerID' => $curr_ver['verID'],
+ 'prLan' => '0',
+ 'prPass' => $serial_live,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => date('Y-m-d', strtotime($ma . '+60 days')),
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '5',
+ 'prHlNum' => $kulcs_live,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => '',
+ 'prInvoiceRecurrence' => '',
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $insert = $msh->insert('h_history', array(
+ 'hiHlNum' => $kulcs_live,
+ 'hiDate' => date('Y-m-d'),
+ 'hiManID' => 36,
+ 'hiTypeID' => 3,
+ 'hiTime' => date("Y-m-d H:i:s"),
+ 'hiInfo' => "Web order, Aktiválás érvényessége: " . date('Y-m-d', strtotime($ma . '+60 days')),
+ ));
+
+ $live_nonp = "Serial code " . $liveEv . " LIVE: {$serial_live}";
+ }
+
+ if ($cntry == '82') $ertek = $price; // Koreaban a Non-Profit fizetos
+ else $ertek = 0;
+
+ if ($_FILES) {
+ user_error(print_r($_FILES, true));
+ $uploads_dir = 'tmpl/';
+ $target_path = $uploads_dir . basename($_FILES['file']['name']);
+ if (move_uploaded_file($_FILES['file']['tmp_name'], $target_path))
+ echo 'File uploaded';
+ else {
+ $eredmeny['hiba'] = 'Error in uploading file ';
+ echo json_encode($eredmeny);
+ return false;
+ }
+ }
+
+ $prod = "Non-profit " . $vcode['year'];
+ $u_info = $kulcs;
+ $u_topic = 302;
+
+ $insert = $msh->insert('u_history', array(
+ 'nUserID' => $user,
+ 'nTopicID' => $u_topic,
+ 'strInfo' => $u_info,
+ 'dateEvent' => date('Y-m-d'),
+ 'nManagerID' => 36,
+ 'strPlace' => 'Weborder',
+ 'insertDate' => date('Y-m-d H:i:s')
+ ));
+ break;
+
+ case 'hardlock':
+ $regi_kulcs = substr(mysqli_real_escape_string($conn, $_GET['old_hlNum']), 0, 6);
+ $kulcs = mysqli_real_escape_string($conn, $_GET['hl_num']);
+ $old_serial = mysqli_real_escape_string($conn, $_GET['old_hlNum']);
+
+ // megadtak-e, letezik-e uj kulcs
+ if (!$regi_kulcs || empty($regi_kulcs) || strlen($regi_kulcs) != 6) {
+ $eredmeny['hiba'] = "There is a problem with the hardlock key
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ } else {
+ $oldHlNum = "SELECT * FROM `hardlock` WHERE hlNum = '" . $regi_kulcs . "'";
+ $msh->query($oldHlNum);
+ $talalat = $msh->fetchNext();
+ if (!$talalat['hlNum']) {
+ $eredmeny['hiba'] = "There is a problem with the hardlock key
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ } else {
+ // regi kulcshoz az ujat beallitani
+ // uj kulcsot aktivalni, regi kulcsat beallítani
+ // usert atvinni
+ $update = $msh->update("hardlock", array("hlNewHlNum" => $kulcs), "hlNum = {$regi_kulcs}");
+ $update = $msh->update("hardlock", array('hlDatePro' => date('Y-m-d', time()), 'hlStat' => 2), "hlNum = {$regi_kulcs}");
+ $update = $msh->update("h_programs", array('prStat' => 1), "prHlNum = {$regi_kulcs}");
+
+ $insert = $msh->insert("h_history", array(
+ "hiHlNum" => $regi_kulcs,
+ "hiDate" => date('Y-m-d', time()),
+ "hiManID" => 36,
+ "hiTypeID" => 5,
+ "hiTime" => date('Y-m-d H:i:s', time()),
+ "hiInfo" => "Web order: Új kulcs"
+ ));
+
+ $update = $msh->update("hardlock", array("hlOldHlNum" => $regi_kulcs), "hlNum = {$kulcs}");
+ $update = $msh->update("hardlock", array("hlStat" => '1', "hlDateIssue" => $ma, "hlManID" => '36', "hlTime" => date("Y-m-d H:i:s"), "hlUser" => $user), "hlNum = {$kulcs}");
+
+ $query = "SELECT * FROM `h_programs` WHERE `prHlNum` = '" . $regi_kulcs . "' ORDER BY `prID` DESC limit 1";
+ $msh->query($query);
+ $utolsoProgram = $msh->fetchNext();
+
+ $eddigi_ver_id = $utolsoProgram['prVerID'];
+
+ $verz = "SELECT `verCode` FROM `p_versions` WHERE `verID` = '" . $eddigi_ver_id . "'";
+ $msh->query($verz);
+ $verzi = $msh->fetchNext();
+ $version = $verzi['verCode'];
+ $type = $utolsoProgram['prTypeID'];
+ $ertek = $price;
+ }
+ }
+
+ $hardlock_msg = "Old hardlock: {$regi_kulcs}
";
+ $hardlock_msg .= "New hardlock: {$kulcs}";
+ $sellDate = $utolsoProgram['prSellDate'];
+ $actDate = $utolsoProgram['prActDate'];
+ $fizetve = $utolsoProgram['prFizetve'];
+ $time = $utolsoProgram['prTime'];
+ $lastMod = $utolsoProgram['prLastMod'];
+ $contact = $utolsoProgram['prContact'];
+ $stat = 0;
+ $cntry = $utolsoProgram['prCtrID'];
+ $invoiceDateFrom = $utolsoProgram['prInvoiceDateFrom'];
+ $fizHatIdo = $utolsoProgram['prInvoiceDateto'];
+ $reszlet = $utolsoProgram['prInvoiceRecurrence'];
+ $lan = $talalat["hlLan"];
+ $ertek = $price;
+ $prod = "Hardlock";
+ $hardlock_id = substr($kulcs, 0, 2);
+
+ $msh->query("SELECT * FROM `p_modules` WHERE `mdPrHlNum` = '{$regi_kulcs}'");
+ $modules = $msh->fetchAssoc();
+ $uj_kulcs = $kulcs;
+ break;
+ }
+
+ $number = substr($kulcs, 2, 4);
+
+ if ($kategoria != "module") {
+ $command = PATH_CODEGEN . " -Password " . $hardlock_id . $number . $version . $lan . $type;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $serial = fgets($ph, 1024);
+ $password = $serial;
+ pclose($ph);
+ }
+
+ if (!IsSoftwareKey($password) && $password != '') { // Ker hardlockot
+ $isid = GetIsidFromPasswordForHardwareKeys($password);
+ $numOfDays = 3583; // NFF kod
+ $actCode = GenerateTimeCode($password, $isid, $numOfDays);
+ }
+
+ if ($kategoria != "module") {
+ // hardlock tablaban benne van mar a kulcs? Akkor update. Ha nincs, akkor insert
+ $van = "SELECT * FROM `hardlock` WHERE `hlNum` = '" . $kulcs . "'";
+ $msh->query($van);
+ $result = $msh->fetchNext();
+ if (!empty($result)) {
+ $update = $msh->update("hardlock", array("hlStat" => '1', "hlLan" => '0', "hlDateIssue" => $ma, "hlManID" => '36', "hlCtrID" => $cntry, "product_id" => $prg_product_id, "hlTime" => date("Y-m-d H:i:s"), "hlUser" => $user), "hlNum = {$kulcs}");
+ } else {
+ $insert = $msh->insert('hardlock', array(
+ 'hlNum' => $kulcs,
+ 'hlLan' => '0',
+ 'hlStat' => '1',
+ 'hlDateIssue' => $ma,
+ 'hlUser' => $user,
+ 'hlManID' => '36',
+ 'hlCtrID' => $cntry,
+ 'old_db' => 'clusers_eng',
+ 'hlTime' => date("Y-m-d H:i:s"),
+ 'product_id' => $prg_product_id
+ ));
+ }
+ }
+
+ //o_ordersbe bekerules
+ $orders_insert = $msh->insert('o_orders', array(
+ 'ip' => $ip,
+ 'country' => $cntry2,
+ 'date' => $ma,
+ 'software' => $program,
+ 'user_name' => $u_name,
+ 'user_email' => $email,
+ 'order' => $prOrderNumber,
+ 'input_key' => $old_serial,
+ 'output_key' => $serial,
+ 'price' => $ertek,
+ 'info' => $info,
+ 'instalments' => $payment,
+ 'live_key' => $serial_live
+ ));
+
+ // verID meghatarozasa -> mindig az aktualis evhez tartozot valasztja ki
+ $query = "SELECT `verID` FROM `p_versions` WHERE `verCode` = '" . $version . "'";
+ $msh->query($query);
+ $tomb = $msh->fetchNext();
+
+ $userNumber = $lan == 0 || IsSoftwareKey($serial) == false ? 1 : $lan;
+
+ if ($generate_prev_program) {
+ // Jelenleg meg 2019-es programot is adunk!
+ $ev2 = date("Y");
+ $elozoEv1 = $ev2 - 1;
+ $ver_prev = $version - 1;
+ $command = PATH_CODEGEN . " -Password " . $hardlock_id . $number . $ver_prev . $lan . $type;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $serial_prev = fgets($ph, 1024);
+ pclose($ph);
+
+ $lt_message = "Serial code $elozoEv1: " . $serial_prev . "";
+ $msg_2019 = "Serial $elozoEv1: " . $serial_prev . "";
+ $msg = "Serial code $elozoEv1: $serial_prev
";
+ }
+
+ if ($type == "L") $type = 76;
+
+ if ($kategoria != "module") {
+ for ($i = 1; $i <= $userNumber; $i++) {
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $tomb['verID'],
+ 'prLan' => $lan,
+ 'prPass' => $serial,
+ 'prSellDate' => $sellDate,
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => $actDate,
+ 'prFizetve' => $fizetve,
+ 'prTime' => $time,
+ 'prLastMod' => $lastMod,
+ 'prPrice' => $ertek,
+ 'prContact' => $contact,
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => substr($cntry, 0, 2),
+ 'prStat' => $stat,
+ 'prActCode' => $actCode,
+ 'prInvoiceDateFrom' => $invoiceDateFrom,
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ 'twtw' => '1'
+ ));
+ }
+ }
+
+ if ($generate_prev_program) {
+ $actCodePrev = '';
+ $twtwPrev = $ver_prev < 77 ? 0 : 1;
+
+ if (!IsSoftwareKey($serial_prev) && $serial_prev != '') {
+ $isidPrev = GetIsidFromPasswordForHardwareKeys($serial_prev);
+ $numOfDaysPrev = 3583; // NFF kod
+ $actCodePrev = GenerateTimeCode($serial_prev, $isidPrev, $numOfDaysPrev);
+ }
+ // Jelenleg meg 2019-es programot is adunk!
+ for ($i = 1; $i <= $userNumber; $i++) {
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $tomb['verID'] - 1,
+ 'prLan' => $lan,
+ 'prPass' => $serial_prev,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prPrice' => $alap_ar,
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '1',
+ 'prActCode' => $actCodePrev,
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ 'twtw' => $twtwPrev
+ ));
+ }
+ }
+
+ if ($kategoria == 'hardlock') // Eddig programokat tiltani
+ $update = $msh->update("h_programs", array("prStat" => '1'), "prHlNum = {$regi_kulcs}");
+
+ if (($kategoria == "upgrade" || $kategoria == "crossgrade" || $kategoria == "hardlock") && !empty($modules)) {
+ // Ha van a module, akkor uj modulok generalasa kulccsal egyutt
+ if (!empty($modules)) {
+ $query = "SELECT `prHlNum`, `prID`, `prPass` FROM `h_programs` WHERE `prHlNum` = '{$kulcs}' ORDER BY `prID` DESC limit 1";
+ $msh->query($query);
+ $program_adatok = $msh->fetchNext();
+
+ $prId = $program_adatok['prID'];
+ $password = $program_adatok['prPass'];
+
+ $msh->query("SELECT `mdID` FROM `p_modules` WHERE `mdPrHlNum` = '" . $kulcs . "'");
+ $b = $msh->fetchAssoc();
+
+ $email_m1_nev = "";
+ $email_m1_kulcs = "";
+ $email_m2_nev = "";
+ $email_m2_kulcs = "";
+
+ $e = 0;
+
+ foreach ($b as $b) {
+ $r = (object)$b;
+ $e++;
+ $verz = $r->mdID;
+ $command = PATH_CODEGEN . " -Module " . $password . " " . $verz;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $modcode = fgets($ph, 1024);
+ pclose($ph);
+
+ $insert = $msh->insert('p_modules', array(
+ 'mdID' => $verz,
+ 'mdPrID' => $prId,
+ 'mdPrHlNum' => $uj_kulcs,
+ 'mdCode' => $modcode,
+ 'mdDate' => $ma,
+ 'mdPrice' => '0',
+ 'mdInvNum' => '',
+ 'mdOrdNum' => $prOrderNumber,
+ 'mdIsPurchase' => '0',
+ ));
+
+ if ($verz == "2") $mod_nev = "Module - Terrain";
+ else $mod_nev = "Module - Rendering";
+
+ if ($e == 1) {
+ $email_m1_nev = $mod_nev;
+ $email_m1_kulcs = $modcode;
+ } elseif ($e == 2) {
+ $email_m2_nev = $mod_nev;
+ $email_m2_kulcs = $modcode;
+ } else {
+ $email_m1_nev = "";
+ $email_m1_kulcs = "";
+ $email_m2_nev = "";
+ $email_m2_kulcs = "";
+ }
+ }
+ }
+ }
+
+ $insert = $msh->insert('h_history', array(
+ 'hiHlNum' => $kulcs,
+ 'hiDate' => date('Y-m-d'),
+ 'hiManID' => 36,
+ 'hiTypeID' => 3,
+ 'hiTime' => date("Y-m-d H:i:s"),
+ 'hiInfo' => "Web order, Aktiválás érvényessége: 2050-01-01",
+ ));
+
+ require_once("messages.php");
+ switch ($kategoria) {
+ case 'perp':
+ if ($hl_prot == "Y") { // Ezt marciusban vissza kell kommentezni !!!!!! Ez az elozo evi programot is legeneralja!!! Eredeti: mysqli_real_escape_string($conn, $_GET['code_prev_version']) == "Y"
+ if (($serial_prev != "" && $serial_prev != null) || mysqli_real_escape_string($conn, $_GET['ver_2']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_3']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_4']) == "Y") {
+ if ($cntry == "43" || $cntry == "39" /*|| $cntry == "37"*/) $message = $message['teljes_hl17_np'];
+ else $message = $message['teljes_hl17'];
+ } else {
+ if ($cntry == "43" || $cntry == "39") $message = $message['teljes_hl_np'];
+ else $message = $message['teljes_hl'];
+ }
+ }
+
+ if ($hl_prot == "N") { // Ezt marciusban vissza kell kommentezni !!!!!! Ez az elozo evi programot is legeneralja!!! Eredeti: mysqli_real_escape_string($conn, $_GET['code_prev_version']) == "Y"
+ if (($serial_prev != "" && $serial_prev != null) || mysqli_real_escape_string($conn, $_GET['ver_2']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_3']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_4']) == "Y")
+ $message = $message['teljes_sw17'];
+ else
+ $message = $message['teljes_sw'];
+ }
+ break;
+
+ case 'live':
+ $message = $message['teljes_live'];
+ break;
+
+ case 'lt':
+ $message = $message['teljes_live'];
+ break;
+
+ case 'upgrade':
+ if ($email_m1_nev != "") $message = $message['upgrade_modulokkal'];
+ else $message = $message['upgrade'];
+ break;
+
+ case 'crossgrade':
+ $message = $message['upgrade'];
+ break;
+
+ case 'module':
+ $message = $message['module'];
+ break;
+
+ case 'nonp':
+ $message = $message['nonprofit'];
+ break;
+
+ case 'hardlock':
+ if ($email_m1_nev != "") $message = $message['hardlock_modulokkal'];
+ else $message = $message['hardlock'];
+ break;
+ }
+
+ $to = $kapcsolat['email'];
+ $subject = 'ARCHLine.XP order: ' . $ctryName['ctrNameEng'] . ' ' . $prOrderNumber . ' ' . $prod;
+ $headers = "Content-Type: text/html; charset=utf-8\r\n";
+
+ if ($cntry == "37" || $cntry == "371") $headers .= 'Cc: mate.nagy@cadline.hu' . "\r\n";
+ else $headers .= 'Cc: office@cadline.hu, partnering@archlinexp.com' . "\r\n";
+
+ if ($kapcsolat['sub_email'] != null && $kapcsolat['sub_email'] != "") $headers .= 'Bcc: ' . $kapcsolat['sub_email'] . "\r\n";
+
+ mail($to, $subject, $message, $headers);
+
+ $eredmeny['sikeres'] = "Thank You for Your Order.
+ We have accepted your online purchase order.
+ Once processed, invoice will be sent for your e-mail address.
+ Please allow 1 working day for your order to be processed.
+
+ Continue.";
+
+ if ($akcio != '' && $akcio != null && date('Y-m-d') <= $ertek2['ackio_date']) $brut = $akcio;
+
+ if ($isInvoice && $brut != 0) { // Non-profit programnal nem kell szamlat generalni
+ $live_price = 100;
+ if (mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y") {
+ if ($cntry == '48') {
+ $live_price = 200;
+ } else {
+ $live_price = 150;
+ }
+ }
+
+ if (strpos($program, "Including LIVE"))
+ $brut = $brut - $live_price;
+
+ if (is_numeric($afa_key) && $afa_key > 0) { // Default afa
+ $vat_amount_live = $live_price * $afa; //csak Afa osszege
+ $brut_amount_live = $live_price * ($afa + 1); // Brutto teljes ar
+ $vat_amount_otheritem = $brut * $afa;
+ $brut_amount_otheritem = $brut * ($afa + 1);
+ $vat_amount_hardlock = $hardlock_price["nettó"] * $afa;
+ $brut_amount_hardlock = $hardlock_price["nettó"] * ($afa + 1);
+ } else {
+ $vat_amount_live = 0; //csak Afa osszege
+ $brut_amount_live = $live_price; // Brutto teljes ar
+ $vat_amount_otheritem = 0;
+ $brut_amount_otheritem = $brut;
+ $vat_amount_hardlock = 0;
+ $brut_amount_hardlock = $hardlock_price["nettó"];
+ }
+
+ if ($cntry == 33)
+ $comment = "Client: " . $u_name . " - " . " Serial: " . $kulcs . " order " . $prOrderNumber;
+ else
+ $comment = $kulcs . " order " . $prOrderNumber;
+
+ if ($cntry == 61 && $info != '') $comment .= "PO number: " . $info;
+
+ $item = new InvoiceItem($termek["megnevezés"], $brut, 1.0, $termek["egység"], $afa_key);
+ $item->setNetPrice($brut);
+ $item->setVatAmount($vat_amount_otheritem);
+ $item->setGrossAmount($brut_amount_otheritem);
+ $item->setComment($comment);
+
+ $itemLedger = new InvoiceItemLedger('', '', strval($termek["árbevétel_főkönyvi_szám"]), '');
+ $item->setLedgerData($itemLedger);
+
+ $invoice->addItem($item);
+
+ if ($hl_prot == "Y") {
+ if ($afa_key == "EUK")
+ $revenueLedgerNumber = 931;
+ else
+ $revenueLedgerNumber = 9313;
+
+ $item = new InvoiceItem($prod_prefix . " ARCHLine.XP Hardlock", $hardlock_price["nettó"], 1.0, $termek["egység"], $afa_key);
+ $item->setComment($kulcs . " order " . $prOrderNumber);
+ $item->setNetPrice($hardlock_price["nettó"]);
+ $item->setVatAmount($vat_amount_hardlock);
+ $item->setGrossAmount($brut_amount_hardlock);
+
+ $itemLedger = new InvoiceItemLedger('', '', strval($revenueLedgerNumber), '');
+ $item->setLedgerData($itemLedger);
+
+ $invoice->addItem($item);
+ }
+
+ if (mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y" || strpos($program, "Including LIVE") == TRUE) {
+ if ($afa_key == "EUK")
+ $revenueLedgerNumber = 931;
+ else
+ $revenueLedgerNumber = 9312;
+
+ $item = new InvoiceItem($prod_prefix . " ARCHLine.XP LIVE License", $live_price, 1.0, $termek["egység"], $afa_key);
+ $item->setComment($kulcs_live . " order " . $prOrderNumber);
+ $item->setNetPrice($live_price);
+ $item->setVatAmount($vat_amount_live);
+ $item->setGrossAmount($brut_amount_live);
+
+ $itemLedger = new InvoiceItemLedger('', '', strval($revenueLedgerNumber), '');
+ $item->setLedgerData($itemLedger);
+
+ $invoice->addItem($item);
+ }
+
+ if ($needCredit) {
+ $item = new InvoiceItem("Non Recurring Discount", -$credit, 1.0, $termek["egység"], $afa_key);
+ $item->setNetPrice(-$credit);
+ $item->setVatAmount(0);
+ $item->setGrossAmount(-$credit);
+
+ $invoice->addItem($item);
+ }
+
+ $result = $agent->generateInvoice($invoice);
+
+ if ($result->isSuccess()) { // Az invoice mezo alapertelmezetten 0, ha sikeres a szamla generalas, updateljuk 1-re
+ $query = "UPDATE o_orders SET invoice = 1 WHERE country = {$cntry2} AND o_orders.order = '{$prOrderNumber}'";
+ $msh->query($query);
+ }
+ }
+
+ $query = "SELECT invoice FROM o_orders WHERE country = {$cntry2} AND o_orders.order = '{$prOrderNumber}' ORDER BY id desc";
+ $msh->query($query);
+ $inv = $msh->fetchNext();
+
+ if ($isInvoice && $brut != 0 && $inv['invoice'] != 1) { // Nem sikerult a szamlat legeneralni, emailt kuldunk az office-nak
+ $message = "Számla generálás hiba (Weborder)
";
+ $message .= "Email: " . $kapcsolat['email'] . "
";
+ $message .= "Orders:
";
+ $message .= "Order number: {$prOrderNumber}
";
+ $message .= "Program: {$program}";
+
+ $to = "office@cadline.hu";
+ $subject = "Számlagenerálás hiba";
+ $headers = "Content-Type: text/html; charset=utf-8\r\n";
+ mail($to, $subject, $message, $headers);
+
+ $eredmeny['hiba'] = "Order accepted, but error at making invoice! Please contact office@cadline.hu.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+ } else {
+ $eredmeny['hiba'] = "You've reached your daily limit for orders. Please try it again tomorrow or contact office@cadline.hu
+
+ Continue.";
+ }
+}
+echo json_encode($eredmeny);
+
+function IsSoftwareKey($serial = "")
+{
+ if ($serial == "") return false;
+
+ $ph = popen(PATH_CODEGEN . " -IsSoftwareKey " . $serial, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $szoftveres = fgets($ph, 1024);
+ pclose($ph);
+
+ return ($szoftveres == 'true');
+}
+
+function tryToAlloc($min = 990001, $max = 997000)
+{
+ $config['db_host'] = 'localhost';
+ $config['db_user'] = 'cadline';
+ $config['db_pass'] = 'Shea6hoo';
+ $config['db_name'] = 'cl_hlusers';
+
+ $msh = new hivasok();
+ $msh->init($config['db_host'], $config['db_name'], $config['db_user'], $config['db_pass']);
+ $conn = new mysqli($config['db_host'], $config['db_user'], $config['db_pass'], $config['db_name']);
+
+ $ret = 0;
+ if ((int)$min == 0 || (int)$max == 0) return $ret;
+
+ $msh->query("SELECT LEFT(hlNum, 6) AS hlNum FROM hardlock WHERE hlNum >= " . (int)$min . " AND hlNum < " . (int)$max . " ORDER BY hlNum;");
+ $res = $msh->fetchAssoc();
+
+ if (count($res)) {
+ $keszlet = range($min, $max);
+ foreach ($res as $r) $kulcsok[] = $r['hlNum'];
+
+ $diff = array_diff($keszlet, $kulcsok);
+ reset($diff);
+ $ret = current($diff);
+ }
+ return $ret;
+}
+
+function GetYearFromVerCode($verCode)
+{
+ $config['db_host'] = 'localhost';
+ $config['db_user'] = 'cadline';
+ $config['db_pass'] = 'Shea6hoo';
+ $config['db_name'] = 'cl_hlusers';
+
+ $msh = new hivasok();
+ $msh->init($config['db_host'], $config['db_name'], $config['db_user'], $config['db_pass']);
+ $conn = new mysqli($config['db_host'], $config['db_user'], $config['db_pass'], $config['db_name']);
+
+ $msh->query("SELECT * FROM cl_hlusers.p_versions WHERE verCode = " . $verCode);
+ $res = $msh->fetchNext();
+
+ return $res['year'];
+}
+
+function DeactivateHardlock($hlNum, $hlManID, $hlInfo, $hlDatePro)
+{
+ $config['db_host'] = 'localhost';
+ $config['db_user'] = 'cadline';
+ $config['db_pass'] = 'Shea6hoo';
+ $config['db_name'] = 'cl_hlusers';
+
+ $msh = new hivasok();
+ $msh->init($config['db_host'], $config['db_name'], $config['db_user'], $config['db_pass']);
+ $conn = new mysqli($config['db_host'], $config['db_user'], $config['db_pass'], $config['db_name']);
+
+ $update = $msh->update("hardlock", array('hlDatePro' => $hlDatePro, 'hlStat' => '2'), "hlNum = {$hlNum}");
+ $update = $msh->update("h_programs", array('prStat' => 1), "prHlNum = {$hlNum}");
+
+ $insert = $msh->insert("h_history", array(
+ "hiHlNum" => $hlNum,
+ "hiDate" => date('Y-m-d', time()),
+ "hiManID" => $hlManID,
+ "hiTypeID" => 5,
+ "hiTime" => date('Y-m-d H:i:s', time()),
+ "hiInfo" => $hlInfo
+ ));
+}
+
+function GetCountryFromPassword($password)
+{
+ return substr($password, 0, 2);
+}
+
+function GetVer8And9FromPassword($password)
+{
+ return substr($password, 7, 2);
+}
+
+function GetIsidFromPasswordForHardwareKeys($password)
+{
+ return substr($password, 0, 2) . substr($password, 7, 2);
+}
+
+function GenerateTimeCode($password, $isid, $numOfDays)
+{
+ if (!IsSoftwareKey($password)) $isid = GetCountryFromPassword($password) . GetVer8And9FromPassword($password);
+
+ $nVersion = intval(substr($password, 7, 2));
+ if ($nVersion > 29) $command = PATH_CODEGEN . " -GenerateTimeCode " . $password . " " . $isid . " " . $numOfDays;
+ else $command = PATH_CODEGEN . " -XDay " . $password . " " . $numOfDays;
+
+ $command = PATH_CODEGEN . " -GenerateTimeCode " . $password . " " . $isid . " " . $numOfDays;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $aktkod = fgets($ph, 1024);
+ pclose($ph);
+
+ return $aktkod;
+}
diff --git a/var/www/hosting/archlinexp.com/partners/public/order/szerver.php.evidence.json b/var/www/hosting/archlinexp.com/partners/public/order/szerver.php.evidence.json
new file mode 100644
index 0000000..aa91e1b
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/public/order/szerver.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "5432",
+ "log_excerpt": "[quarantine] partners.archlinexp.com:public/order/szerver.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/archlinexp.com/partners/public/order/szerver.php)",
+ "original_sha256": "7b8dee9c5d3bc7610ae0983b64bf14ed45468a114c644cee34849d503c6dc9d7",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1649056601,
+ "size": 110825,
+ "uid": 12425
+ },
+ "rel_path": "public/order/szerver.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "partners.archlinexp.com"
+}
diff --git a/var/www/hosting/archlinexp.com/partners/public/order/szerver2.php b/var/www/hosting/archlinexp.com/partners/public/order/szerver2.php
new file mode 100644
index 0000000..4e2c542
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/public/order/szerver2.php
@@ -0,0 +1,1553 @@
+setBuyer(new Buyer('Nagy Máté', '6750', 'Algyő', 'Szüret utca 44.'));
+
+ $item = new InvoiceItem("Test", 10000.0, 1, 'db', 'EU');
+ $item->setNetPrice(1);
+ $item->setVatAmount(0);
+ $item->setGrossAmount(1);
+
+ $invoice->addItem($item);
+
+ $creditNote = new InvoiceCreditNote(SzamlaAgentUtil::getTodayStr(), 10000.0, Document::PAYMENT_METHOD_BANKCARD, 'TESZT');
+ // Jóváírás hozzáadása a számlához
+ $invoice->addCreditNote($creditNote);
+
+ print_r($invoice);
+ die();
+
+ $result = $agent->generateInvoice($invoice);
+ if ($result->isSuccess()) {
+ echo 'A számla sikeresen elkészült. Számlaszám: ' . $result->getDocumentNumber();
+ var_dump($result->getDataObj());
+ }
+} catch (\Exception $e) {
+ $agent->logError($e->getMessage());
+}
+
+die();
+
+$config['db_host'] = 'localhost';
+$config['db_user'] = 'cadline';
+$config['db_pass'] = 'Shea6hoo';
+$config['db_name'] = 'cl_hlusers';
+
+$msh = new hivasok();
+$msh->init($config['db_host'], $config['db_name'], $config['db_user'], $config['db_pass']);
+$conn = new mysqli($config['db_host'], $config['db_user'], $config['db_pass'], $config['db_name']);
+
+$ip = $_SERVER['REMOTE_ADDR'];
+$eredmeny = [];
+$sesion_id = bin2hex(openssl_random_pseudo_bytes(10));
+
+if (mysqli_real_escape_string($conn, $_GET['bizt']) != mysqli_real_escape_string($conn, $_GET['biztonsagi']) || mysqli_real_escape_string($conn, $_GET['confirm']) != "Y") {
+ $eredmeny["hiba"] = "Your security answer was wrong or you forgot the confirm checkbox!
+
+ Continue.";
+} else {
+ $query = "SELECT ip, COUNT(ip) as szam FROM o_orders WHERE ip = '".$ip."' AND DATE=CURDATE()";
+ $msh->query($query);
+ $limit = $msh->fetchNext();
+
+ $msh->query("SELECT `limit` FROM `o_products` limit 1");
+ $max_limit = $msh->fetchNext();
+
+ if ($limit['szam'] < $max_limit['limit']) { // Napi limit
+ define('PATH_CODEGEN', "/usr/local/sbin/codegen");
+
+ $kategoria = mysqli_real_escape_string($conn, $_GET['kategoria']); // Lehet: perp, upgrade, akcio, nonprofit, hardlock, module
+ $hl_prot = mysqli_real_escape_string($conn, $_GET['hl_prot']);
+ $program = mysqli_real_escape_string($conn, $_GET['prg']);
+ $cntry = mysqli_real_escape_string($conn, $_GET['cntry']);
+ $ma = date("Y-m-d");
+ $email = mysqli_real_escape_string($conn, $_GET['email']);
+ $u_name = mysqli_real_escape_string($conn, $_GET['name']);
+ $info = mysqli_real_escape_string($conn, $_GET['info']);
+
+ $query = "SELECT DISTINCT `email`, `sub_email` FROM `o_products` WHERE `lang` = '{$cntry}'";
+ $msh->query($query);
+ $kapcsolat = $msh->fetchNext();
+
+ if ($kapcsolat['email'] == "") {
+ $eredmeny["hiba"] = "Access denied
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $osszeg = "SELECT * FROM `o_products` WHERE `termek` = '".$program."' AND `lang` = '".$cntry."' AND `kategoria` = '".$kategoria."'";
+ $msh->query($osszeg);
+ $ertek2 = $msh->fetchNext();
+ $price = $cntry == 11 ? $ertek2["usd"] : $ertek2["euro"];
+ $akcio = $ertek2["akcio"];
+
+ if ($akcio != '' && $akcio != null && date('Y-m-d') <= $ertek2['ackio_date']) $price = $akcio;
+
+ // TODO: spanyoloknak nem mukodik
+ /*if ($ertek2["is_invoice"] == 0) {
+ $eredmeny['hiba'] = "You have invoice(s) more than 14 days overdue.
+
+ The web-order system is temporary not available for attempts to create a new order.
+
+ Please advise as to whether payment has been scheduled.
+
+ If you require any further information from us, please contact us at office@cadline.hu
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }*/
+
+ $isInvoice = false;
+ $tax = TaxPayer::TAXPAYER_HAS_TAXNUMBER;
+ $curr = "EUR";
+ $cur = Currency::CURRENCY_EUR;
+ $lang = Language::LANGUAGE_EN;
+ $prod_prefix = "EU";
+ $inv_prefix = "EUR";
+ switch ($cntry)
+ {
+ case '39': // Olaszorszag
+ $lang = Language::LANGUAGE_IT;
+ break;
+ case '43': // Ausztria
+ $lang = Language::LANGUAGE_DE;
+ break;
+ case '49': // Nemetorszag
+ $lang = Language::LANGUAGE_DE;
+ break;
+ case '38': // Horvatorszag
+ $lang = Language::LANGUAGE_HR;
+ break;
+ case '33': // Franciaorszag
+ $lang = Language::LANGUAGE_FR;
+ break;
+ case '42': // Csehorszag
+ $lang = Language::LANGUAGE_CZ;
+ break;
+ case '48': // Lengyelorszag
+ $lang = Language::LANGUAGE_PL;
+ break;
+ case '34': // Spanyolorszag
+ $lang = Language::LANGUAGE_ES;
+ break;
+ case '37': // TESZT
+ $tax = TaxPayer::TAXPAYER_NO_TAXNUMBER;
+ $isInvoice = true;
+ break;
+ case '82': //Korea
+ $prod_prefix = "Non-EU";
+ break;
+ case '61': //Ausztralia
+ $prod_prefix = "Non-EU";
+ break;
+ case '88': //Tajvan
+ $prod_prefix = "Non-EU";
+ break;
+ case '44': //UK
+ $prod_prefix = "Non-EU";
+ break;
+ case '84': //Vietnam
+ $prod_prefix = "Non-EU";
+ break;
+ case '52': //Mexiko
+ $prod_prefix = "Non-EU";
+ break;
+ case '60': //Malajzia
+ $prod_prefix = "Non-EU";
+ break;
+ case '30': //Gorogorszag
+ break;
+ case '51': //Portugalia
+ break;
+ case '11': // USA
+ $curr = "USD";
+ $cur = Currency::CURRENCY_USD;
+ $prod_prefix = "Non-EU";
+ $inv_prefix = "USD";
+ break;
+ case '71': // Lettorszag
+ break;
+ default: // Minden mas
+ $tax = TaxPayer::TAXPAYER_NO_TAXNUMBER;
+ break;
+ }
+
+ if (mysqli_real_escape_string($conn, $_GET['user']) == "ismeretlen") {
+ if ($kategoria == 'nonp') $status = '4';
+ else $status = '11';
+
+ $query = "SELECT id FROM distributors WHERE ctrID = {$cntry}";
+ $msh->query($query);
+ $dist = $msh->fetchNext();
+
+ if (!empty($dist)) $distID = $dist['id'];
+ else $distID = 0;
+
+ $insert = $msh->insert('users', array(
+ 'strName' => $u_name,
+ 'nManagerID' => '36',
+ 'nSchoolID' => '0',
+ 'strLease' => '',
+ 'deleted' => '0',
+ 'old_db' => 'clusers_eng',
+ 'bNewsletter' => 'N',
+ 'strEMail' => $email,
+ 'strCurrency' => $curr,
+ 'nCtrID' => $cntry,
+ 'nUserStatus' => $status,
+ 'nDistID' => $distID
+ ));
+ }
+
+ $felhasznalo = "SELECT `nUserID` FROM `users` WHERE `strEMail` = '".$email."' limit 1";
+ $msh->query($felhasznalo);
+ $felh = $msh->fetchNext();
+ $user = $felh['nUserID'];
+
+ if (mysqli_real_escape_string($conn, $_GET['user']) == "ismeretlen") {
+ $insert = $msh->insert('u_emails', array(
+ 'email' => $email,
+ 'nUserID' => $user,
+ 'default' => '1',
+ 'active' => '1',
+ 'deleted' => '0',
+ 'newsletter' => '0'
+ ));
+ }
+
+ $query = "SELECT `ctrNameEng` FROM `countries` WHERE `ctrID` = '{$cntry}'";
+ $msh->query($query);
+ $ctryName = $msh->fetchNext();
+
+ //Utolso order Number
+ $msh->query("SELECT `order` FROM `o_orders` WHERE `country` = '{$cntry}' ORDER BY `id` DESC limit 1");
+ $order = $msh->fetchNext();
+ $orderNumber = $order['order'];
+ $kezdo = strpos($orderNumber, "-")+1; // Majd a rakovetkezo, ez kerul be adatbazisba
+ $veg = strpos($orderNumber, "/")-2;
+ $szam = (int)substr($orderNumber, $kezdo, $veg)+1;
+ $prOrderNumber = "E-".$szam."/".date("Y");
+
+ if ($isInvoice && $price != 0) {
+ $partners = "SELECT * FROM szamla_agent.partnerek WHERE ország = ".$cntry;
+ $msh->query($partners);
+ $partner = $msh->fetchNext();
+
+ if ($cntry == 37) {
+ $date = new DateTime(date('Y-m'));
+ $date->modify('+ 1 month');
+ $paymentDue = $date->format('Y-m').'-15';
+ } else {
+ $date = new DateTime(date('Y-m-d'));
+ $date->modify('+'.$partner["fizetési_határidő"]." day");
+ $paymentDue = $date->format('Y-m-d');
+ }
+
+ //$agent = SzamlaAgentAPI::create('3i73vj72wt7h3ig78wrawt7h3ik5batswt7h3inhzw', false, Log::LOG_LEVEL_ERROR); // Szamla Agent CADLine kulcs
+ $agent = SzamlaAgentAPI::create('97039xbwy2gws4iv7yn4xk8cniuird56tyamat6gy3', false, Log::LOG_LEVEL_DEBUG); // Teszt Kulcs
+
+ //$invoice = new Invoice(Invoice::INVOICE_TYPE_E_INVOICE);
+ $invoice = new Invoice(Invoice::INVOICE_TYPE_P_INVOICE); //Teszt Szamla
+
+ $header = $invoice->getHeader();
+ $header->setPaymentMethod(Invoice::PAYMENT_METHOD_TRANSFER);
+ $header->setCurrency($cur);
+ $header->setLanguage($lang);
+ $header->setPaymentDue($paymentDue);
+ $header->setComment("*Please use the invoice number (E-EUR-2020-xxx) as a reference number to identify your payment.
+
+ Banktransfer info:
+ K&H BANK Hungary
+ IBAN: HU89 1040 0951 4955 4949 4954 1028
+ SWIFT CODE: OKHBHUHB");
+ //$header->setPrefix($inv_prefix);
+
+ /*$seller = new Seller('K&H Bank EUR', 'IBAN: HU89 1040 0951 4955 4949 4954 1028');
+ $seller->setEmailReplyTo('office@cadline.hu');
+ $seller->setEmailSubject('Számlaértesítő / Invoice - CadLine Kft.');
+ $seller->setEmailContent('Tisztelt/Dear '.$partner["kapcsolattartó_neve"].',
+
+
+ Mellékelten küldjük aktuális számláját.
+ Kérjük, utaláskor a közlemény rovatban KIZÁRÓLAG a számlaszámot tüntesse fel! (pl.: E-HUF-2020-xxxx)
+
+ Amennyiben ezzel kapcsolatban bármilyen kérdése merülne fel, kérjük hívja Ügyfélszolgálatunkat, ahol munkatársaink készséggel állnak ügyfeleink rendelkezésére.
+
+ Cadline Ltd invoice is attached. Please use the invoice number (E-EUR-2020-xxx) as a reference number to identify your payment. Payment made via wire transfer must be made in full including any fees/charges for the wire transfer, which are your responsibility. (If your bank uses an intermediary bank, there may be additional charges.) If payment is not received in full, you will be invoiced for any balance due on the account.
+ Payment must be completed by the "due date" of the invoice date.
+
+
+ Üdvözlettel / Sincerely:
+ CadLine Office');
+ $invoice->setSeller($seller);*/
+
+ $buyer = new Buyer($partner["partner"], $partner["irányítószám"], $partner["település"], $partner["utca_házszám"]);
+ $buyer->setTaxPayer($tax);
+
+ if ($partner["közösségi_adószám"] != "") $buyer->setTaxNumberEU($partner["közösségi_adószám"]);
+ elseif ($partner["adószám"] != "") $buyer->setTaxNumber($partner["adószám"]);
+
+ if ($prod_prefix == 'Non-EU') $afa_key = 'EUK'; // Ha non-eu-s a prod prefix, akkor eun kivuli
+ if ($prod_prefix == 'EU') $afa_key = 'EU';
+
+ $buyer->setEmail($partner["email"]);
+ $buyer->setSendEmail(true);
+ $invoice->setBuyer($buyer);
+
+ $product = "SELECT product_id FROM szamla_agent.web_product WHERE web_id = ".$ertek2['id'];
+ $msh->query($product);
+ $product_id = $msh->fetchNext();
+
+ $termekek = "SELECT * FROM szamla_agent.termekek WHERE id = ".$product_id["product_id"];
+ $msh->query($termekek);
+ $termek = $msh->fetchNext();
+ }
+
+ $hardlock = "SELECT megnevezés, nettó FROM szamla_agent.termekek WHERE id = 30";
+ $msh->query($hardlock);
+ $hardlock_price = $msh->fetchNext();
+
+ $verz = "SELECT `verCode`, verID FROM `p_versions` WHERE `verActual` = 'Y'";
+ $msh->query($verz);
+ $verzi = $msh->fetchNext();
+ $version = $verzi['verCode'];
+ $prg_product_id = 1;
+ $generate_prev_program = false;
+
+ $sellDate = date("Y-m-d H:i:s");
+ $actDate = date("Y-m-d H:i:s");
+ $fizetve = '2050-01-01';
+ $time = date("Y-m-d H:i:s");
+ $lastMod = date("Y-m-d H:i:s");
+ $stat = 0;
+ $invoiceDateFrom = date('Y-m', time());
+ $contact = 0;
+ $hiType = 1;
+
+
+ // TODO: Adatbazisba bevezetni az o_product tablaba + a szerver.php-ba atvezetni!!!
+
+ $o_types = "SELECT * FROM `o_types` WHERE `id` = ".$ertek2['o_type'];
+ $msh->query($o_types);
+ $o_type = $msh->fetchNext();
+
+ $type = $o_type['to'];
+ $typeNames = array(
+ 2 => 'Interior',
+ 4 => 'LT',
+ 6 => 'Studio',
+ 8 => 'Professional',
+ 'L' => 'LIVE'
+ );
+
+ switch ($kategoria) {
+ case 'perp':
+ if (mysqli_real_escape_string($conn, $_GET['reszlet']) == "Y") {
+ switch ($cntry) {
+ case '43':
+ $reszlet = 3;
+ $payment = 'Instalments: 4 Period: quarterly';
+ $fizHatIdo = date('Y-m', strtotime($ma. '+365 days'));
+ if (strstr($program, "Professional") || strstr($program, "Prof.")) $payment = 'Instalments: 4 Period: monthly';
+ break;
+
+ case '39':
+ $reszlet = 12;
+ $payment = 'Instalments: 2 Period: yearly';
+ $fizHatIdo = date('Y-m', strtotime($ma. '+365 days'));
+ break;
+
+ case '48':
+ $reszlet = 1;
+ $payment = 'Instalments: 4 Period: monthly';
+ $fizHatIdo = date('Y-m', strtotime($ma. '+120 days'));
+ break;
+
+ case '42':
+ $reszlet = 1;
+ $payment = 'Instalments: 6 Period: monthly';
+ $fizHatIdo = date('Y-m', strtotime($ma. '+180 days'));
+ break;
+ }
+ } else {
+ $reszlet = '';
+ $payment = 'pay in full';
+ $fizHatIdo = date('Y-m', strtotime($ma. '+365 days'));
+ }
+
+ $keres = "SELECT `verID` FROM `p_versions` ORDER BY `verCode` DESC limit 1";
+ $msh->query($keres);
+ $limit = $msh->fetchNext();
+
+ $alap_ar = $price; // $alap_ar megszunik!!!!
+ $lan = "0";
+ $ertek = $price;
+ $ev2 = date("Y");
+ $elozoEv1 = $ev2-1;
+ $elozoEv2 = $ev2-2;
+ $elozoEv3 = $ev2-3;
+ $elozoEv4 = $ev2-4;
+ $msg = "";
+ $msg2 = "";
+ $msg3 = "";
+ $msg4 = "";
+
+ if ($hl_prot == "Y") { // Ker hardlockot
+ $kulcs = mysqli_real_escape_string($conn, $_GET['hl_num']);
+ $hardlockPrice = $hardlock_price["nettó"];
+ $ertek = $price + $hardlockPrice;
+ $hardlock_id = $cntry;
+
+ if ($cntry == "43" || $cntry == "39") $ertek = $price;
+ }
+
+ if ($hl_prot == "N") { // Nem ker hardlockot -> szoftveres kulcs
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '95%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $kulcsok = $msh->fetchNext();
+ $kulcs = $kulcsok['hlNum']+1;
+ $hardlock_id = "95";
+ }
+
+ $number = substr($kulcs, 2, 4);
+
+ if ((mysqli_real_escape_string($conn, $_GET['code_prev_version']) == "Y" && $generate_prev_program == false) || mysqli_real_escape_string($conn, $_GET['ver_2']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_3']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_4']) == "Y") {
+ if ($cntry == '37' || $cntry == '43') $ertek += 150;
+ }
+
+ $live = $alap_ar;
+ if(mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y") {
+ $live += 100;
+ $ertek += 100;
+ }
+
+ $subtotal = $price;
+ if ((strpos($program, "Interior") || strpos($program, "Professional")) && strpos($program, "LIVE")) {
+ $subtotal -= 100;
+ $live_item = "Subtotal: 100";
+ }
+
+ if (((strpos($program, "Interior") || strpos($program, "Professional")) && strpos($program, "LIVE") && strpos($program, "option") == FALSE) || mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y") {
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '$cntry%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $live_kulcsok = $msh->fetchNext();
+
+ $query = "SELECT * FROM `p_versions` WHERE currentVer = 0 OR currentVer = 2";
+ $msh->query($query);
+ $curr_ver = $msh->fetchNext();
+
+ $kulcs_live = $live_kulcsok['hlNum']+2;
+ $number_live = substr($kulcs_live, 2,4);
+ $version_live = $curr_ver['verCode'];
+ $lan_live = "0";
+ $type_live = "L";
+ $command = PATH_CODEGEN." -Password " . $cntry . $number_live . $version_live . $lan_live . $type_live;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial_live = fgets($ph, 1024);
+ pclose($ph);
+
+ if(mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y") {
+ $item_live = "
+ Item: Live
+
+ Subtotal: 100";
+ }
+
+ $live_msg = "Serial code 2019 Live: ".$serial_live."";
+
+ $insert = $msh->insert('hardlock', array(
+ 'hlNum' => $kulcs_live,
+ 'hlLan' => '0',
+ 'hlStat' => '1',
+ 'hlDateIssue' => $ma,
+ 'hlUser' => $user,
+ 'hlManID' => '36',
+ 'hlCtrID' => $cntry,
+ 'old_db' => 'clusers_eng',
+ 'hlTime' => date("Y-m-d H:i:s"),
+ 'product_id' => 2
+ ));
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => 76,
+ 'prVerID' => $curr_ver['verID'],
+ 'prLan' => '0',
+ 'prPass' => $serial_live,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' =>date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs_live,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $insert = $msh->insert('h_history', array(
+ 'hiHlNum' => $kulcs_live,
+ 'hiDate' => date('Y-m-d'),
+ 'hiManID' => 36,
+ 'hiTypeID' => 3,
+ 'hiTime' => date("Y-m-d H:i:s"),
+ 'hiInfo' => "Web order, Aktiválás érvényessége: 2050-01-01",
+ ));
+ }
+
+ // 1 evvel ezelotti kulcs generalas
+ if (mysqli_real_escape_string($conn, $_GET['code_prev_version']) == "Y") $generate_prev_program = true;
+
+ // 2 evvel ezelotti kulcs generalas
+ if (mysqli_real_escape_string($conn, $_GET['ver_2']) == "Y") {
+ $version2 = $verzi['verCode']-2;
+ $command = PATH_CODEGEN." -Password " . $hardlock_id . $number . $version2 . $lan . $type;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial17_2 = fgets($ph, 1024);
+ pclose($ph);
+
+ $msg2 = "Serial code $elozoEv2: $serial17_2
";
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $verzi['verID']-2,
+ 'prLan' => '0',
+ 'prPass' => $serial17_2,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+ }
+
+ // 3 evvel ezelotti kulcs generalas
+ if (mysqli_real_escape_string($conn, $_GET['ver_3']) == "Y") {
+ $version3 = $verzi['verCode']-3;
+ $command = PATH_CODEGEN." -Password " . $hardlock_id . $number . $version3 . $lan . $type;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial16 = fgets($ph, 1024);
+ pclose($ph);
+
+ $msg3 = "Serial code $elozoEv3: $serial16
";
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $verzi['verID']-3,
+ 'prLan' => '0',
+ 'prPass' => $serial16,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+ }
+
+ // 4 evvel ezelotti kulcs generalas
+ if (mysqli_real_escape_string($conn, $_GET['ver_4']) == "Y") {
+ $version4 = $verzi['verCode']-4;
+ $command = PATH_CODEGEN." -Password " . $hardlock_id . $number . $version4 . $lan . $type;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial15 = fgets($ph, 1024);
+ pclose($ph);
+
+ $msg4 = "Serial code $elozoEv4: $serial15
";
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $verzi['verID']-4,
+ 'prLan' => '0',
+ 'prPass' => $serial15,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+ }
+
+ if (strstr($program, "Professional") || strstr($program, "Prof.")) $prod = "Professional";
+ if (strstr($program, "Interior")) $prod = "Interior";
+ if (strstr($program, "Studio")) $prod = "Studio";
+ break;
+
+ case 'live':
+ $kulcs = substr((string)tryToAlloc(($cntry*10000)+1, ($cntry*10000)+9999), 0, 6);
+
+ $query = "SELECT * FROM `p_versions` WHERE currentVer = 0 OR currentVer = 2";
+ $msh->query($query);
+ $curr_ver = $msh->fetchNext();
+
+ $version = $curr_ver['verCode'];
+ $lan = 0;
+ $hardlock_id = $cntry;
+ $ertek = $price;
+ $alap_ar = $price;
+ $prod = 'ARCHLINE.XP LIVE';
+ $prg_product_id = 2;
+
+ break;
+
+ case 'lt':
+ $kulcs = substr((string)tryToAlloc(($cntry*10000)+1, ($cntry*10000)+9999), 0, 6);
+
+ $lan = 0;
+ $hardlock_id = $cntry;
+ $ertek = $price;
+ $alap_ar = $price;
+ $prod = "ARCHLINE.XP LT";
+
+ if (strpos($program, "LT") && strpos($program, "LIVE")) {
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '$cntry%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $kulcs2 = $msh->fetchNext();
+ $kulcs_live = $kulcs2['hlNum']+2;
+
+ $query = "SELECT * FROM `p_versions` WHERE currentVer = 0 OR currentVer = 2";
+ $msh->query($query);
+ $curr_ver = $msh->fetchNext();
+
+ $number_live = substr($kulcs_live, 2, 4);
+ $version_live = $curr_ver['verCode'];
+ $lan_live = 0;
+ $type_live = "L";
+ $command = PATH_CODEGEN." -Password " . $cntry . $number_live . $version_live . $lan_live . $type_live;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial_live = fgets($ph, 1024);
+ pclose($ph);
+
+ $insert = $msh->insert('hardlock', array(
+ 'hlNum' => $kulcs_live,
+ 'hlLan' => '0',
+ 'hlStat' => '1',
+ 'hlDateIssue' => $ma,
+ 'hlUser' => $user,
+ 'hlManID' => '36',
+ 'hlCtrID' => $cntry,
+ 'old_db' => 'clusers_eng',
+ 'hlTime' => date("Y-m-d H:i:s"),
+ 'product_id' => 2
+ ));
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => 76,
+ 'prVerID' => $curr_ver['verID'],
+ 'prLan' => '0',
+ 'prPass' => $serial_live,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs_live,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $insert = $msh->insert('h_history', array(
+ 'hiHlNum' => $kulcs_live,
+ 'hiDate' => date('Y-m-d'),
+ 'hiManID' => 36,
+ 'hiTypeID' => 3,
+ 'hiTime' => date("Y-m-d H:i:s"),
+ 'hiInfo' => "Web order, Aktiválás érvényessége: 2050-01-01",
+ ));
+
+ $live_msg = "Serial code 2019 LIVE: ".$serial_live."";
+ }
+ break;
+
+ case 'upgrade':
+ $old_serial = mysqli_real_escape_string($conn, $_GET['old_hlNum']);
+
+ if (strlen($old_serial) == "16") { //Update esete
+ if (substr($old_serial, 6, 1) != $o_type['from'] || substr($old_serial, 6, 1) != 7) {
+ $eredmeny['hiba'] = "Its not a ".$typeNames[$o_type['from']]." serial.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ if (substr($old_serial, 6, 1) == "8" && (substr($old_serial, 7, 2) == $verzi['verPassword8and9'])) {
+ $eredmeny['hiba'] = "You can't upgrade this software
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $query = "SELECT * FROM `h_programs` WHERE `prPass` = {$old_serial}";
+ $msh->query($query);
+ $hl = $msh->fetchNext();
+ $hl_num = $hl['prHlNum'];
+
+ $ertek = $price;
+ $kulcs = substr($old_serial, 0, 6);
+ $hardlock_id = substr($old_serial, 0, 2);
+ $number = substr($old_serial, 2,4);
+
+ $query = "SELECT `hlLan` FROM `hardlock` WHERE `hlNum`='".$kulcs."' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $hlLan = $msh->fetchNext();
+ $lan = $hlLan['hlLan'];
+
+ // Ha NOVA, akkor professionalt kap
+ if (substr($old_serial, 6, 1) == 7) $type = 8;
+
+ $lan2 = 0;
+
+ if ($lan == 0) $lan2 = 0;
+ elseif ($lan == 1) $lan2 = 0;
+ elseif ($lan == 2) $lan2 = 2;
+ elseif ($lan == 3) $lan2 = 3;
+ elseif ($lan == 4) $lan2 = 4;
+ elseif ($lan == 5) $lan2 = 5;
+ elseif ($lan == 10) $lan2 = 6;
+ elseif ($lan == 15) $lan2 = 7;
+ elseif ($lan == 20) $lan2 = 8;
+ elseif ($lan <= 49) $lan2 = 9;
+
+ $lan = $lan2;
+ $command = PATH_CODEGEN." -Password " . $hardlock_id . $number . $version . $lan . $type;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial = fgets($ph, 1024);
+ $password = $serial;
+ pclose($ph);
+
+ $query = "SELECT * FROM `h_programs` WHERE `prPass`='".$serial."'";
+ $msh->query($query);
+ $prg = $msh->fetchNext();
+
+ if (empty($prg) == false) {
+ $eredmeny['hiba'] = "You already upgraded this serial number.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ // Ha studio, akkor meg kell allapítani hogy volt-e hozzatartozo module, ha igen, akkor ott az mdPrID-t, es a mdPrHlNum-ot kell modositani az uj programhoz
+ if (substr($serial, 6, 1) == "6") {
+ // Regi programhoz tartozo modul(ok)
+ $msh->query("SELECT * FROM `p_modules` WHERE `mdPrHlNum` = '{$kulcs}'");
+ $modules = $msh->fetchAssoc();
+ $uj_kulcs = $kulcs;
+ }
+
+ $prod = "Upgrade";
+ if ($o_type['from'] != $o_type['to']) $hiType = 2;
+ if ($o_type['from'] == $o_type['to']) $hiType = 3;
+
+ $msh->update("h_programs", array("prStat" => 1),"prPass = '{$old_serial}'");
+ } else {
+ $eredmeny['hiba'] = "Wrong serial.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+ break;
+
+ case 'crossgrade':
+ $old_serial = mysqli_real_escape_string($conn, $_GET['old_hlNum']);
+
+ if (substr($old_serial, 6, 1) != $o_type['from']) {
+ $eredmeny['hiba'] = "Its not a ".$typeNames[$o_type['from']]." serial.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $verz = "SELECT `verCode` FROM `p_versions` WHERE `verPassword8and9` = '".substr($old_serial, 7, 2)."'";
+ $msh->query($verz);
+ $verzi = $msh->fetchNext();
+
+ $query = "SELECT hlNum FROM hardlock WHERE hlNum LIKE '95%' AND hlStat = 0 AND (hlDealer = '' OR hlDealer IS NULL) AND (hlUser = '' OR hlUser IS NULL) AND (hlInfo = '' OR hlInfo IS NULL) limit 1";
+ $msh->query($query);
+ $hlnum = $msh->fetchNext();
+ $kulcs = $hlnum['hlNum'];
+ $prod = "Crossgrade";
+ $regi_kulcs = substr($old_serial, 0, 6);
+ $hardlock_id = 95;
+ $version = $verzi['verCode'];
+ $ertek = $price;
+ $lan = 0;
+ $hiType = 2;
+
+ $msh->query("SELECT * FROM `p_modules` WHERE `mdPrHlNum` = '{$regi_kulcs}'");
+ $modules = $msh->fetchAssoc();
+ $uj_kulcs = $kulcs;
+ break;
+
+ case 'module':
+ $hl_num = mysqli_real_escape_string($conn, $_GET['old_hlNum']);
+ $query = "SELECT `prId`, `prPass` FROM `h_programs` WHERE `prHlNum` = '{$hl_num}' ORDER BY `prID` DESC limit 1";
+ $msh->query($query);
+ $program_adatok = $msh->fetchNext();
+
+ // Csak Studio-hoz lehet kiadni modulokat
+ if (substr($program_adatok['prPass'], 6,1) != "6") {
+ $eredmeny['hiba'] = "You can buy modules only for Studio
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $prId = $program_adatok['prId'];
+ $prHlNum = $hl_num;
+
+ if (strpos($program, "Terrain")) $verz = "2";
+ else $verz = "22";
+
+ // A hozzatartozo program serialja
+ $password = $program_adatok['prPass'];
+ $command = PATH_CODEGEN." -Module " . $password . " " . $verz;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $modcode = fgets($ph, 1024);
+ pclose($ph);
+
+ // Ha mar van ilyen module az adott programhoz
+ $query = "SELECT `ID` FROM `p_modules` WHERE `mdPrID` = '{$prId}' AND `mdID` = '{$verz}' AND `mdPrHlNum` = '{$prHlNum}'";
+ $msh->query($query);
+ $module = $msh->fetchNext();
+
+ if ($module['ID']) {
+ $eredmeny['hiba'] = "You already have this module
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $insert = $msh->insert('p_modules', array(
+ 'mdID' => $verz,
+ 'mdPrID' => $prId,
+ 'mdPrHlNum' => $prHlNum,
+ 'mdCode' => $modcode,
+ 'mdDate' => $ma,
+ 'mdPrice' => '0',
+ 'mdInvNum' => '',
+ 'mdOrdNum' => $prOrderNumber,
+ 'mdIsPurchase' => '0',
+ ));
+
+ $ertek = $price;
+ $serial = $modcode;
+ $prod = "Module";
+ break;
+
+ case 'nonp':
+ //Ha mar volt nala ebben az evben?
+ $nonpr = mysqli_real_escape_string($conn, $_GET['nonpro_ev']);
+ $datum = mysqli_real_escape_string($conn, $_GET['datum']); // Ezt kérte speciálisan a partner. Attól függetlenül nem ez a dátum kerül be az adatbázisba
+ $date = date_create($datum);
+ $datum = date_format($date, "d/m/Y");
+ $expire = date_format($date, "Y-m-d");
+
+ $ev = substr($nonpr, 3, 4);
+
+ $query = "SELECT `verID`, `verCode`, `verPassword8and9` FROM `p_versions` WHERE `verName` = '{$nonpr}'";
+ $msh->query($query);
+ $vcode = $msh->fetchNext();
+
+ if (strpos($program, "LIVE")) {
+ $prg_product_id = 2;
+ $type = "L";
+ }
+
+ $query = "SELECT SUBSTRING(`prPass`, 8, 2) AS `prPass` FROM `h_programs` WHERE `prHlNum` IN (SELECT `hlNum` FROM `hardlock` WHERE `hlUser` = '{$user}' AND product_id = '{$prg_product_id}') AND `prHlNum` LIKE '99%'";
+ $msh->query($query);
+ $nonprofit_kulcsok_evben = $msh->fetchAssoc();
+
+ $evek = array();
+ foreach ($nonprofit_kulcsok_evben as $v) {
+ $b = (object)$v;
+ $evek[] = $b->prPass;
+ }
+
+ // Ha mar volt nonprofit kulcsa az adott evben akkor nem enged tovább
+ if (!empty($evek)) {
+ if (in_array($vcode['verPassword8and9'], $evek) !== FALSE) {
+ $eredmeny['hiba'] = "You already have a non-profit key for this product
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+ }
+
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '99%' AND `hlStat` = 0 AND `hlLan` = 0 ORDER BY `hlNum` ASC limit 1";
+ $msh->query($query);
+ $nonprofitok = $msh->fetchNext();
+ $kulcs = $nonprofitok['hlNum'];
+
+ // Ha nincs mar, akkor letre kell hozni!!!
+ if (empty($nonprofitok['hlNum'])) {
+ $eredmeny['hiba'] = "There are no free nonprofit keys yet, please contact us.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $msh->update("hardlock", array("hlStat"=>'1', "hlUser"=>$user, "old_hlID"=>'', "old_db"=>'clusers_eng', "hlDateIssue"=>$ma, "product_id"=>2, "hlCtrID"=>$cntry),"hlNum = {$kulcs}");
+
+ $version = $vcode['verCode'];
+ $hardlock_id = substr($kulcs, 0, 2);
+ $lan = 0;
+ $contact = 5;
+ $fizetve = date('Y-m-d', strtotime($ma. '+60 days'));
+
+ if ($expire < $fizetve) $fizetve = $expire;
+
+ if (($cntry == 61 || $cntry == 37) && strpos($program, "LIVE") == FALSE) {
+ $query_live = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '99%' AND `hlStat` = 0 AND `hlLan` = 0 ORDER BY `hlNum` ASC limit 1";
+ $msh->query($query_live);
+ $nonprofitok_live = $msh->fetchNext();
+
+ $query = "SELECT * FROM `p_versions` WHERE currentVer = 0 OR currentVer = 2";
+ $msh->query($query);
+ $curr_ver = $msh->fetchNext();
+
+ $kulcs_live = $nonprofitok_live['hlNum'];
+ $number_live = substr($kulcs_live, 2,4);
+ $version_live = $curr_ver['verCode'];
+ $lan_live = 0;
+ $type_live = "L";
+
+ $command = PATH_CODEGEN." -Password " . 99 . $number_live . $version_live . $lan_live . $type_live;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial_live = fgets($ph, 1024);
+ pclose($ph);
+
+ $msh->update("hardlock", array("hlStat"=>'1', "hlUser"=>$user, "old_hlID"=>'', "old_db"=>'clusers_eng', "hlDateIssue"=>$ma, "product_id"=>2, "hlCtrID"=>$cntry),"hlNum = {$kulcs_live}");
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => 76,
+ 'prVerID' => $curr_ver['verID'],
+ 'prLan' => 0,
+ 'prPass' => $serial_live,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => date('Y-m-d', strtotime($ma. '+60 days')),
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '5',
+ 'prHlNum' => $kulcs_live,
+ 'prManID' => 36,
+ 'prCtrID' => $cntry,
+ 'prStat' => 0,
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => '',
+ 'prInvoiceRecurrence' => '',
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => 0,
+ ));
+
+ $insert = $msh->insert('h_history', array(
+ 'hiHlNum' => $kulcs_live,
+ 'hiDate' => date('Y-m-d'),
+ 'hiManID' => 36,
+ 'hiTypeID' => 3,
+ 'hiTime' => date("Y-m-d H:i:s"),
+ 'hiInfo' => "Web order, Aktiválás érvényessége: ".date('Y-m-d', strtotime($ma. '+60 days')),
+ ));
+
+ $live_nonp = "Activation key Live: $serial_live
";
+ }
+
+ if ($cntry == 82) $ertek = $price; // Koreaban a Non-Profit fizetos
+ else $ertek = 0;
+
+ if ($_FILES) {
+ user_error(print_r($_FILES, true));
+ $uploads_dir = 'tmpl/';
+ $target_path = $uploads_dir.basename($_FILES['file']['name'] );
+ if (move_uploaded_file($_FILES['file']['tmp_name'], $target_path))
+ echo 'File uploaded';
+ else {
+ $eredmeny['hiba'] = 'Error in uploading file ';
+ echo json_encode($eredmeny);
+ return false;
+ }
+ }
+
+ $prod = "Non-profit";
+ break;
+
+ case 'hardlock':
+ $regi_kulcs = substr(mysqli_real_escape_string($conn, $_GET['old_hlNum']),0,6);
+ $kulcs = mysqli_real_escape_string($conn, $_GET['hl_num']);
+
+ // megadtak-e, letezik-e uj kulcs
+ if (!$regi_kulcs || empty($regi_kulcs) || strlen($regi_kulcs) != 6) {
+ $eredmeny['hiba'] = "There is a problem with the hardlock key
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ } else {
+ $oldHlNum = "SELECT * FROM `hardlock` WHERE hlNum = '".$regi_kulcs."'";
+ $msh->query($oldHlNum);
+ $talalat = $msh->fetchNext();
+ if (!$talalat['hlNum']) {
+ $eredmeny['hiba'] = "There is a problem with the hardlock key
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ } else {
+ $query = "SELECT * FROM `h_programs` WHERE `prHlNum` = '".$regi_kulcs."' ORDER BY `prID` DESC limit 1";
+ $msh->query($query);
+ $utolsoProgram = $msh->fetchNext();
+
+ $eddigi_ver_id = $utolsoProgram['prVerID'];
+
+ $verz = "SELECT `verCode` FROM `p_versions` WHERE `verID` = '".$eddigi_ver_id."'";
+ $msh->query($verz);
+ $verzi = $msh->fetchNext();
+ $version = $verzi['verCode'];
+ $type = $utolsoProgram['prTypeID'];
+ $ertek = $price;
+ }
+ }
+
+ $hardlock_msg = "Old hardlock: {$regi_kulcs}";
+ $hardlock_msg .= "New hardlock: {$$kulcs}";
+ $sellDate = $utolsoProgram['prSellDate'];
+ $actDate = $utolsoProgram['prActDate'];
+ $fizetve = $utolsoProgram['prFizetve'];
+ $time = $utolsoProgram['prTime'];
+ $lastMod = $utolsoProgram['prLastMod'];
+ $contact = $utolsoProgram['prContact'];
+ $stat = 0;
+ $cntry = $utolsoProgram['prCtrID'];
+ $invoiceDateFrom = $utolsoProgram['prInvoiceDateFrom'];
+ $fizHatIdo = $utolsoProgram['prInvoiceDateto'];
+ $reszlet = $utolsoProgram['prInvoiceRecurrence'];
+ $lan = $talalat["hlLan"];
+ $ertek = $price;
+ $prod = "Hardlock";
+ $hardlock_id = substr($kulcs, 0, 2);
+
+ $msh->query("SELECT * FROM `p_modules` WHERE `mdPrHlNum` = '{$regi_kulcs}'");
+ $modules = $msh->fetchAssoc();
+ $uj_kulcs = $kulcs;
+ break;
+ }
+
+ if ($ertek2['until'] != '' && $ertek2['until'] != NULL) $fizetve = $ertek2['until'];
+ $number = substr($kulcs, 2,4);
+
+ if ($kategoria != "module") {
+ $command = PATH_CODEGEN." -Password " . $hardlock_id . $number . $version . $lan . $type;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial = fgets($ph, 1024);
+ $password = $serial;
+ pclose($ph);
+ }
+
+ if ($kategoria != "module") {
+ // hardlock tablaban benne van mar a kulcs? Akkor update. Ha nincs, akkor insert
+ $van = "SELECT * FROM `hardlock` WHERE `hlNum` = '".$kulcs."'";
+ $msh->query($van);
+ $result = $msh->fetchNext();
+ /*if (!empty($result)) {
+ $update = $msh->update("hardlock", array("hlStat"=>'1', "hlLan"=>'0', "hlDateIssue"=>$ma, "hlManID"=>'36', "hlCtrID"=>$cntry, "product_id"=>$prg_product_id, "hlTime"=>date("Y-m-d H:i:s"), "hlUser"=>$user), "hlNum = {$kulcs}");
+ } else {
+ $insert = $msh->insert('hardlock', array(
+ 'hlNum' => $kulcs,
+ 'hlLan' => '0',
+ 'hlStat' => '1',
+ 'hlDateIssue' => $ma,
+ 'hlUser' => $user,
+ 'hlManID' => '36',
+ 'hlCtrID' => $cntry,
+ 'old_db' => 'clusers_eng',
+ 'hlTime' => date("Y-m-d H:i:s"),
+ 'product_id' => $prg_product_id
+ ));
+ }*/
+ }
+
+ //o_ordersbe bekerules
+ /*$orders_insert = $msh->insert('o_orders', array(
+ 'ip' => $ip,
+ 'country' => $cntry,
+ 'date' => $ma,
+ 'software' => $program,
+ 'user_name' => $u_name,
+ 'user_email' => $email,
+ 'order' => $prOrderNumber,
+ 'input_key' => $regi_kulcs,
+ 'output_key' => $serial,
+ 'price' => $ertek,
+ 'info' => $info,
+ 'instalments' => $payment
+ ));*/
+
+ // verID meghatarozasa -> mindig az aktualis evhez tartozot valasztja ki
+ $query = "SELECT `verID` FROM `p_versions` WHERE `verCode` = '".$version."'";
+ $msh->query($query);
+ $tomb = $msh->fetchNext();
+
+ $userNumber = $lan == 0 || IsSoftwareKey($serial) == false ? 1 : $lan;
+
+ if ($generate_prev_program) {
+ // Jelenleg meg 2019-es programot is adunk!
+ $ev2 = date("Y");
+ $elozoEv1 = $ev2-1;
+ $ver_prev = $verzi['verCode']-1;
+ $command = PATH_CODEGEN." -Password " . $hardlock_id . $number . $ver_prev . $lan . $type;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial_prev = fgets($ph, 1024);
+ pclose($ph);
+
+ $lt_message = "Serial code $elozoEv1: ".$serial_prev."";
+ $msg_2019 = "Serial $elozoEv1: ".$serial_prev."";
+ $msg = "Serial code $elozoEv1: $serial_prev
";
+ }
+
+ if ($type == "L") $type = 76;
+
+ /*if ($kategoria != "module") {
+ for ($i = 1; $i <= $userNumber; $i++) {
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $tomb['verID'],
+ 'prLan' => $lan,
+ 'prPass' => $serial,
+ 'prSellDate' => $sellDate,
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => $actDate,
+ 'prFizetve' => $fizetve,
+ 'prTime' => $time,
+ 'prLastMod' => $lastMod,
+ 'prPrice' => $ertek,
+ 'prContact' => $contact,
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => $stat,
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => $invoiceDateFrom,
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ 'prHiType' => $hiType
+ ));
+ }
+ }*/
+
+ if ($generate_prev_program) {
+ // Jelenleg meg 2019-es programot is adunk!
+ for ($i = 1; $i <= $userNumber; $i++) {
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $tomb['verID']-1,
+ 'prLan' => $lan,
+ 'prPass' => $serial_prev,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prPrice' => $alap_ar,
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '1',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+ }
+ }
+
+ if ($kategoria == 'hardlock' || $kategoria == 'crossgrade') { // Eddig programokat tiltani
+ $update = $msh->update("h_programs",array("prStat"=>'1'),"prHlNum = {$regi_kulcs}");
+ $update = $msh->update("hardlock", array("hlNewHlNum"=>$kulcs), "hlNum = {$regi_kulcs}");
+ $update = $msh->update("hardlock", array('hlDatePro' => date('Y-m-d', time()), 'hlStat' => 2), "hlNum = {$regi_kulcs}");
+ $update = $msh->update("h_programs", array('prStat' => 1), "prHlNum = {$regi_kulcs}");
+ $update = $msh->update("hardlock", array("hlOldHlNum"=>$regi_kulcs), "hlNum = {$kulcs}");
+ $update = $msh->update("hardlock", array("hlStat"=>'1', "hlLan"=>'0', "hlDateIssue"=>$ma, "hlManID"=>'36', "hlCtrID"=>$cntry, "hlTime"=>date("Y-m-d H:i:s"), "hlUser"=>$user), "hlNum = {$kulcs}");
+
+ $insert = $msh->insert("h_history", array(
+ "hiHlNum" => $regi_kulcs,
+ "hiDate" => date('Y-m-d', time()),
+ "hiManID" => 36,
+ "hiTypeID" => 5,
+ "hiTime" => date('Y-m-d H:i:s', time()),
+ "hiInfo" => "Web order: Új kulcs"
+ ));
+ }
+
+ if (($kategoria == "upgrade" || $kategoria == "crossgrade" || $kategoria == "hardlock") && !empty($modules)) {
+ // Ha van a module, akkor uj modulok generalasa kulccsal egyutt
+ if (!empty($modules)) {
+ $query = "SELECT `prHlNum`, `prID`, `prPass` FROM `h_programs` WHERE `prHlNum` = '{$kulcs}' ORDER BY `prID` DESC limit 1";
+ $msh->query($query);
+ $program_adatok = $msh->fetchNext();
+
+ $prId = $program_adatok['prID'];
+ $password = $program_adatok['prPass'];
+
+ $msh->query("SELECT `mdID` FROM `p_modules` WHERE `mdPrHlNum` = '".$kulcs."'");
+ $b = $msh->fetchAssoc();
+
+ $email_m1_nev = "";
+ $email_m1_kulcs = "";
+ $email_m2_nev = "";
+ $email_m2_kulcs = "";
+
+ $e = 0;
+
+ foreach ($b as $b) {
+ $r = (object)$b;
+ $e++;
+ $verz = $r->mdID;
+ $command = PATH_CODEGEN." -Module " . $password . " " . $verz;
+ $ph = popen( $command, "r" ) or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $modcode = fgets( $ph, 1024 );
+ pclose($ph);
+
+ $insert = $msh->insert('p_modules', array(
+ 'mdID' => $verz,
+ 'mdPrID' => $prId,
+ 'mdPrHlNum' => $uj_kulcs,
+ 'mdCode' => $modcode,
+ 'mdDate' => $ma,
+ 'mdPrice' => '0',
+ 'mdInvNum' => '',
+ 'mdOrdNum' => $prOrderNumber,
+ 'mdIsPurchase' =>'0',
+ ));
+
+ if ($verz == "2") $mod_nev = "Module - Terrain";
+ else $mod_nev = "Module - Rendering";
+
+ if ($e == 1) {
+ $email_m1_nev = $mod_nev;
+ $email_m1_kulcs = $modcode;
+ } elseif ($e == 2){
+ $email_m2_nev = $mod_nev;
+ $email_m2_kulcs = $modcode;
+ } else {
+ $email_m1_nev = "";
+ $email_m1_kulcs = "";
+ $email_m2_nev = "";
+ $email_m2_kulcs = "";
+ }
+ }
+ }
+ }
+
+ /*$insert = $msh->insert('h_history', array(
+ 'hiHlNum' => $kulcs,
+ 'hiDate' => date('Y-m-d'),
+ 'hiManID' => 36,
+ 'hiTypeID' => 3,
+ 'hiTime' => date("Y-m-d H:i:s"),
+ 'hiInfo' => "Web order, Aktiválás érvényessége: 2050-01-01",
+ ));*/
+
+ require_once("messages.php");
+ switch ($kategoria) {
+ case 'perp':
+ if ($hl_prot == "Y") { // Ezt marciusban vissza kell kommentezni !!!!!! Ez az elozo evi programot is legeneralja!!! Eredeti: mysqli_real_escape_string($conn, $_GET['code_prev_version']) == "Y"
+ if (($serial_prev != "" && $serial_prev != null) || mysqli_real_escape_string($conn, $_GET['ver_2']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_3']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_4']) == "Y") {
+ if ($cntry == "43" || $cntry == "39" || $cntry == "37") $message = $message['teljes_hl17_np'];
+ else $message = $message['teljes_hl17'];
+ } else {
+ if ($cntry == "43" || $cntry == "39") $message = $message['teljes_hl_np'];
+ else $message = $message['teljes_hl'];
+ }
+ }
+
+ if ($hl_prot == "N") { // Ezt marciusban vissza kell kommentezni !!!!!! Ez az elozo evi programot is legeneralja!!! Eredeti: mysqli_real_escape_string($conn, $_GET['code_prev_version']) == "Y"
+ if (($serial_prev != "" && $serial_prev != null) || mysqli_real_escape_string($conn, $_GET['ver_2']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_3']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_4']) == "Y")
+ $message = $message['teljes_sw17'];
+ else
+ $message = $message['teljes_sw'];
+ }
+ break;
+
+ case 'live':
+ $message = $message['teljes_live'];
+ break;
+
+ case 'lt':
+ $message = $message['teljes_live'];
+ break;
+
+ case 'upgrade':
+ if ($email_m1_nev != "") $message = $message['upgrade_modulokkal'];
+ else $message = $message['upgrade'];
+ break;
+
+ case 'crossgrade':
+ $message = $message['upgrade'];
+ break;
+
+ case 'module':
+ $message = $message['module'];
+ break;
+
+ case 'nonp':
+ $message = $message['nonprofit'];
+ break;
+
+ case 'hardlock':
+ if ($email_m1_nev != "") $message = $message['hardlock_modulokkal'];
+ else $message = $message['hardlock'];
+ break;
+ }
+
+ $to = $kapcsolat['email'];
+ $subject = 'ARCHLine.XP order: '.$ctryName['ctrNameEng'].' '.$prOrderNumber.' '.$prod;
+ $headers = "Content-Type: text/html; charset=utf-8\r\n";
+
+ if ($cntry == "37") $headers .= 'Cc: mate.nagy@cadline.hu' . "\r\n";
+ else $headers .= 'Cc: office@cadline.hu' . "\r\n";
+
+ if ($kapcsolat['sub_email'] != null && $kapcsolat['sub_email'] != "") $headers .= 'Bcc: '.$kapcsolat['sub_email'] . "\r\n";
+
+ mail($to, $subject, $message, $headers);
+
+ $eredmeny['sikeres'] = "Thank You for Your Order.
+ We have accepted your online purchase order.
+ Once processed, invoice will be sent for your e-mail address.
+ Please allow 1 working day for your order to be processed.
+
+ Continue.";
+
+ if ($isInvoice && $price != 0) { // Non-profit programnal nem kell szamlat generalni
+ $live_price = 100;
+ if (strpos($program, "Including LIVE")) $price = $price - $live_price;
+
+ if (is_numeric($afa_key) && $afa_key > 0) { // Default afa
+ $vat_amount_live = $live_price * $afa; //csak Afa osszege
+ $brut_amount_live = $live_price * ($afa+1); // Brutto teljes ar
+ $vat_amount_otheritem = $price * $afa;
+ $brut_amount_otheritem = $price * ($afa+1);
+ $vat_amount_hardlock = $hardlock_price["nettó"] * $afa;
+ $brut_amount_hardlock = $hardlock_price["nettó"] * ($afa+1);
+ } else {
+ $vat_amount_live = 0; //csak Afa osszege
+ $brut_amount_live = $live_price; // Brutto teljes ar
+ $vat_amount_otheritem = 0;
+ $brut_amount_otheritem = $price;
+ $vat_amount_hardlock = 0;
+ $brut_amount_hardlock = $hardlock_price["nettó"];
+ }
+
+ if ($cntry == 33) $comment = "Client: ".$u_name." - "." Serial: ".$kulcs." order ".$prOrderNumber;
+ else $comment = $kulcs." order ".$prOrderNumber;
+
+ $item = new InvoiceItem($termek["megnevezés"], $price, 1.0, $termek["egység"], $afa_key);
+ $item->setNetPrice($price);
+ $item->setVatAmount($vat_amount_otheritem);
+ $item->setGrossAmount($brut_amount_otheritem);
+ $item->setComment($comment);
+
+ $itemLedger = new InvoiceItemLedger('', '', strval($termek["árbevétel_főkönyvi_szám"]), '');
+ $item->setLedgerData($itemLedger);
+
+ $invoice->addItem($item);
+
+ if ($hl_prot == "Y") {
+ if ($afa_key == "EUK") $revenueLedgerNumber = 931;
+ else $revenueLedgerNumber = 9313;
+
+ $item = new InvoiceItem($prod_prefix." ARCHLine.XP Hardlock", $hardlock_price["nettó"], 1.0, $termek["egység"], $afa_key);
+ $item->setComment($kulcs." order ".$prOrderNumber);
+ $item->setNetPrice($hardlock_price["nettó"]);
+ $item->setVatAmount($vat_amount_hardlock);
+ $item->setGrossAmount($brut_amount_hardlock);
+
+ $itemLedger = new InvoiceItemLedger('', '', strval($revenueLedgerNumber), '');
+ $item->setLedgerData($itemLedger);
+
+ $invoice->addItem($item);
+ }
+
+ if (mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y" || strpos($program, "Including LIVE") == TRUE) {
+ if ($afa_key == "EUK") $revenueLedgerNumber = 931;
+ else $revenueLedgerNumber = 9312;
+
+ $item = new InvoiceItem($prod_prefix." ARCHLine.XP LIVE License", $live_price, 1.0, $termek["egység"], $afa_key);
+ $item->setComment($kulcs_live." order ".$prOrderNumber);
+ $item->setNetPrice($live_price);
+ $item->setVatAmount($vat_amount_live);
+ $item->setGrossAmount($brut_amount_live);
+
+ $itemLedger = new InvoiceItemLedger('', '', strval($revenueLedgerNumber), '');
+ $item->setLedgerData($itemLedger);
+
+ $invoice->addItem($item);
+ }
+
+ $result = $agent->generateInvoice($invoice);
+
+ if ($result->isSuccess()) { // Az invoice mezo alapertelmezetten 0, ha sikeres a szamla generalas, updateljuk 1-re
+ $query = "UPDATE o_orders SET invoice = 1 WHERE country = {$cntry} AND o_orders.order = '{$prOrderNumber}'";
+ $msh->query($query);
+ }
+ }
+
+ $query = "SELECT invoice FROM o_orders WHERE country = {$cntry} AND o_orders.order = '{$prOrderNumber}' ORDER BY id desc";
+ $msh->query($query);
+ $inv = $msh->fetchNext();
+
+ if ($isInvoice && $price != 0 && $inv['invoice'] != 1) { // Nem sikerult a szamlat legeneralni, emailt kuldunk az office-nak
+ $message = "";
+ $message .= "Email: ".$kapcsolat['email']."
";
+ $message .= "Orders:
";
+ $message .= "Order number: {$prOrderNumber}
";
+ $message .= "Program: {$program}";
+
+ $to = "office@cadline.hu";
+ $subject = "Számlagenerálás hiba";
+ $headers = "Content-Type: text/html; charset=utf-8\r\n";
+ mail($to, $subject, $message, $headers);
+
+ $eredmeny['hiba'] = "Order accepted, but error at making invoice! Please contact office@cadline.hu.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+ } else {
+ $eredmeny['hiba'] = "You've reached your daily limit for orders. Please try it again tomorrow or contact office@cadline.hu
+
+ Continue.";
+ }
+}
+echo json_encode($eredmeny);
+
+function IsSoftwareKey($serial = "")
+{
+ if ($serial == "") return false;
+
+ $ph = popen(PATH_CODEGEN." -IsSoftwareKey ".$serial, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $szoftveres = fgets($ph, 1024);
+ pclose($ph);
+
+ return ($szoftveres == 'true');
+}
+
+function tryToAlloc($min = 990001, $max = 997000)
+{
+ $config['db_host'] = 'localhost';
+ $config['db_user'] = 'cadline';
+ $config['db_pass'] = 'Shea6hoo';
+ $config['db_name'] = 'cl_hlusers';
+
+ $msh = new hivasok();
+ $msh->init($config['db_host'], $config['db_name'], $config['db_user'], $config['db_pass']);
+ $conn = new mysqli($config['db_host'], $config['db_user'], $config['db_pass'], $config['db_name']);
+
+ $ret = 0;
+ if ((int)$min == 0 || (int)$max == 0) return $ret;
+
+ $msh->query("SELECT LEFT(hlNum, 6) AS hlNum FROM hardlock WHERE hlNum >= ".(int)$min." AND hlNum < ".(int)$max." ORDER BY hlNum;");
+ $res = $msh->fetchAssoc();
+
+ if (count($res)) {
+ $keszlet = range($min, $max);
+ foreach ($res as $r) $kulcsok[] = $r['hlNum'];
+
+ $diff = array_diff($keszlet, $kulcsok);
+ reset($diff);
+ $ret = current($diff);
+ }
+ return $ret;
+}
diff --git a/var/www/hosting/archlinexp.com/partners/public/order/szerver2.php.evidence.json b/var/www/hosting/archlinexp.com/partners/public/order/szerver2.php.evidence.json
new file mode 100644
index 0000000..cd2e709
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/public/order/szerver2.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "5430",
+ "log_excerpt": "[quarantine] partners.archlinexp.com:public/order/szerver2.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/archlinexp.com/partners/public/order/szerver2.php)",
+ "original_sha256": "e719641444395e6412e4bbe9a2c485ebfa20efc84d340c4b6ae2f6561a1f7464",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1643362537,
+ "size": 75233,
+ "uid": 12425
+ },
+ "rel_path": "public/order/szerver2.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "partners.archlinexp.com"
+}
diff --git a/var/www/hosting/archlinexp.com/partners/public/order/uploadDocument.php b/var/www/hosting/archlinexp.com/partners/public/order/uploadDocument.php
new file mode 100644
index 0000000..b671102
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/public/order/uploadDocument.php
@@ -0,0 +1,123 @@
+init($config['db_host'], $config['db_name'], $config['db_user'], $config['db_pass']);
+
+ $cntry = $_POST['orszag'];
+ $email = $_POST['email'];
+
+ $felhasznalo = "SELECT `nUserID` FROM `u_emails` WHERE `email` = '".$email."' limit 1";
+ $msh->query($felhasznalo);
+ $felh = $msh->fetchNext();
+ $user = $felh['nUserID'];
+
+ $msh->query("SELECT `order` FROM `o_orders` WHERE `country` = '{$cntry}' ORDER BY `id` DESC limit 1");
+ $order=$msh->fetchNext();
+ $orderNumber = $order['order'];
+
+ $kezdo = strpos($orderNumber, "-")+1;
+ $veg = strpos($orderNumber, "/")-2;
+ $szam = (int)substr($orderNumber, $kezdo, $veg);
+ $prOrderNumber = "E-".$szam."/".date("Y");
+
+ $msh->query("SELECT `ctrNameEng` FROM `countries` WHERE `ctrID` = '{$cntry}'");
+ $ctryName = $msh->fetchNext();
+ $orszagNev = $ctryName['ctrNameEng'];
+
+ $fileName = $_FILES["file"]["name"];
+ $targetDir = "../../";
+ $targetFilePath = $targetDir.$fileName;
+
+ $fileType = pathinfo($targetFilePath, PATHINFO_EXTENSION);
+ $allowTypes = array('jpg', 'png', 'jpeg', 'gif', 'pdf', 'docx', 'doc', 'txt', 'bmp');
+
+ if (in_array($fileType, $allowTypes)) {
+ if (!move_uploaded_file($_FILES["file"]["tmp_name"], $targetFilePath)) {
+ $eredmeny['hiba'] = "Error in file uploading";
+ echo json_encode($eredmeny);
+ return false;
+ }
+ } else {
+ $eredmeny['hiba'] = "Unknown file extension";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $to = 'office@cadline.hu';
+ $from = 'partnering@archlinexp.com';
+ $fromName = 'ARCHLineXP Retail Store';
+ $subject = 'Attachment for order: '.$orszagNev.' '.$prOrderNumber;
+ $file = $targetFilePath;
+ $htmlContent = ''.$_POST['file_info'].'
';
+ $headers = "From: $fromName"." <".$from.">";
+ $semi_rand = md5(time());
+ $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
+
+ $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\"";
+ $message = "--{$mime_boundary}\n" . "Content-Type: text/html; charset=\"UTF-8\"\n" .
+ "Content-Transfer-Encoding: 7bit\n\n" . $htmlContent . "\n\n";
+
+ if (!empty($file) > 0){
+ if(is_file($file)){
+ $message .= "--{$mime_boundary}\n";
+ $fp = @fopen($file,"rb");
+ $data = @fread($fp,filesize($file));
+
+ @fclose($fp);
+ $data = chunk_split(base64_encode($data));
+ $message .= "Content-Type: application/octet-stream; name=\"".basename($file)."\"\n" .
+ "Content-Description: ".basename($files[$i])."\n" .
+ "Content-Disposition: attachment;\n" . " filename=\"".basename($file)."\"; size=".filesize($file).";\n" .
+ "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n";
+ }
+ }
+
+ $returnpath = "-f" . $from;
+
+ if ($cntry != '37') {
+ $mail = @mail($to, $subject, $message, $headers, $returnpath);
+ }
+
+ if (function_exists('curl_file_create')) {
+ $cFile = curl_file_create($file, $_FILES[$name]['type'], basename($file));
+
+ $post = [
+ 'file_content' => $cFile,
+ 'action' => 'uploadFile',
+ 'nUserID' => $user,
+ 'file_info' => $_POST['file_info']
+ ];
+
+ $login = 'mate.nagy@cadline.hu';
+ $password = 'Mng67otf';
+ $url = 'https://crm.cadline.hu/imre.php';
+ $ch = curl_init();
+
+ curl_setopt($ch, CURLOPT_URL,$url);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
+ curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
+ curl_setopt($ch, CURLOPT_USERPWD, "$login:$password");
+
+ $result = curl_exec($ch);
+
+ curl_close($ch);
+
+
+ $eredmeny['sikeres'] = 'true';
+ }
+
+ unlink($targetFilePath);
+
+ echo json_encode($eredmeny);
+}
+?>
\ No newline at end of file
diff --git a/var/www/hosting/archlinexp.com/partners/public/order/uploadDocument.php.evidence.json b/var/www/hosting/archlinexp.com/partners/public/order/uploadDocument.php.evidence.json
new file mode 100644
index 0000000..11a4bd5
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/public/order/uploadDocument.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "5429",
+ "log_excerpt": "[quarantine] partners.archlinexp.com:public/order/uploadDocument.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/archlinexp.com/partners/public/order/uploadDocument.php)",
+ "original_sha256": "caff146c66537fbbb7dbafe119045537ba0005db4a102c720ad6b5ff674b0eb6",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1639492644,
+ "size": 4443,
+ "uid": 12425
+ },
+ "rel_path": "public/order/uploadDocument.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "partners.archlinexp.com"
+}
diff --git a/var/www/hosting/archlinexp.com/partners/public/resourcemanager/uploader.php b/var/www/hosting/archlinexp.com/partners/public/resourcemanager/uploader.php
new file mode 100644
index 0000000..660be3e
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/public/resourcemanager/uploader.php
@@ -0,0 +1,31 @@
+';
+ $output .= 'Here you can upload your translation files: ';
+ $output .= '';
+ $output .= '';
+ return $output;
+}
+
+function processUpload($dir) {
+ if (!isset ($_FILES['uploaded_file']))
+ return "";
+
+ $path_parts = pathinfo($_FILES['uploaded_file']['name']);
+ /*if (($path_parts['filename'] != "TranslatPopMenu") && ($path_parts['filename'] != "TranslatMapMenu")
+ && ($path_parts['filename'] != "TranslatInterface") && ($path_parts['filename'] != "TranslatStamp"))
+ return "";
+ */
+
+ if ($path_parts['filename'] != "Translat_Int" && $path_parts['filename'] != "TranslatePG")
+ return "";
+
+ $targetpath = $dir ."/". basename( $_FILES['uploaded_file']['name']) ;
+
+ if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $targetpath))
+ return "The file ". basename( $_FILES['uploaded_file']['name']). " has been uploaded";
+ else
+ return "Sorry, there was a problem uploading your file.";
+}
+?>
\ No newline at end of file
diff --git a/var/www/hosting/archlinexp.com/partners/public/resourcemanager/uploader.php.evidence.json b/var/www/hosting/archlinexp.com/partners/public/resourcemanager/uploader.php.evidence.json
new file mode 100644
index 0000000..620b5cb
--- /dev/null
+++ b/var/www/hosting/archlinexp.com/partners/public/resourcemanager/uploader.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "5428",
+ "log_excerpt": "[quarantine] partners.archlinexp.com:public/resourcemanager/uploader.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/archlinexp.com/partners/public/resourcemanager/uploader.php)",
+ "original_sha256": "fdf26f52fcd52019b8c9a16ea80bbd34be04fb1ab65aa63ecae7c11cb53e0c80",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1460976582,
+ "size": 1572,
+ "uid": 11669
+ },
+ "rel_path": "public/resourcemanager/uploader.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "partners.archlinexp.com"
+}
diff --git a/var/www/hosting/cadline.hu/clusers/clusers/.svn/text-base/user_new_submit.php.svn-base b/var/www/hosting/cadline.hu/clusers/clusers/.svn/text-base/user_new_submit.php.svn-base
new file mode 100644
index 0000000..87b83dd
--- /dev/null
+++ b/var/www/hosting/cadline.hu/clusers/clusers/.svn/text-base/user_new_submit.php.svn-base
@@ -0,0 +1,97 @@
+
+
+
+
+ $p)
+ $$key = $p;
+
+ if($_FILES['Picture']['name']!='' && move_uploaded_file($_FILES['Picture']['tmp_name'], $target_path))
+ $Picture = $target_path;
+ else
+ $Picture = '';
+
+ if( !isset($Save) ){
+ if( isset( $in_nUserID )&& $in_nUserID>0)
+ cl_redirect("user_detail.php?in_nUserID=$in_nUserID");
+ exit;
+ }
+
+ $connection = cl_connect();
+ cl_select($connection);
+ // @ Modify?
+ if( $in_nUserID != NULL ){
+ if( strcmp($County,$lang_automata)==0)
+ $County = cl_get_state($City);
+
+ $EMail = str_replace(',', ';', $EMail);
+
+ $query = "UPDATE $g_table_users SET
+ strName='$Name',
+ strCompany='$Company',
+ strTel='$Tel',
+ strMobil='$Mobil',
+ strFax='$Fax',
+ strEMail='$EMail',
+ strCounty='$County',
+ strZip='$Zip',
+ strCity='$City',
+ strStreet='$Street',
+ strInfo='$Info',
+ strWeb='$Web',
+ strSkype='$Skype',";
+
+ if($Picture_del != 1)
+ $Picture == '' ? '' : $query .= "strPicture='$Picture',";
+ else
+ $query .= 'strPicture=null,';
+
+ $query .= "nManagerID='$NManagerID',
+ nIsCommendatory='$NIsCommendatory',
+ nCommendatoryID='$NCommendatoryID',
+ strInvoiceAddress='$StrInvoiceAddress',
+ strTaxNumber='$StrTaxNumber',
+ strCompanyNumber='$StrCompanyNumber',
+ strBankNumber='$StrBankNumber',
+ nUserProf='$Profession'
+ WHERE nUserID=$in_nUserID";
+ cl_query($query);
+ cl_redirect("user_detail.php?in_nUserID=$in_nUserID");
+ }else{
+ $nUserID = cl_get_user_id($Name,$City,$Street);
+
+ if( $nUserID>0 ){
+ echo $exists_user."
";
+ cl_redirect("users_page.php",false);
+ }else{
+ if( strcmp($County,$lang_automata)==0)
+ $County = cl_get_state($City);
+
+ $EMail = str_replace(',', ';', $EMail);
+
+ $query = "INSERT INTO $g_table_users
+ (strName, strCompany, strTel, strMobil, strFax, strEMail, strCounty, strZip, strCity, strStreet, strInfo, strWeb, strSkype, nManagerID,
+ nIsCommendatory,nCommendatoryID,strInvoiceAddress,strTaxNumber,strCompanyNumber,strBankNumber,nUserProf";
+ $Picture == '' ? '' : $query .= ',strPicture';
+ $query .= ")";
+
+ $query .= " VALUES('$Name','$Company','$Tel','$Mobil','$Fax','$EMail','$County','$Zip','$City','$Street','$Info','$Web','$Skype','$NManagerID','$NIsCommendatory','$NCommendatoryID','$StrInvoiceAddress','$StrTaxNumber','$StrCompanyNumber','$StrBankNumber', '$Profession'";
+
+ $Picture == '' ? '' : $query .= ",'$Picture'";
+
+ $query .= ")";
+ cl_query($query);
+ $UserID=mysql_insert_id();
+ cl_redirect("user_detail.php?in_nUserID=$UserID");
+ }
+ }
+ cl_close( $connection );
+ exit;
+?>
diff --git a/var/www/hosting/cadline.hu/clusers/clusers/.svn/text-base/user_new_submit.php.svn-base.evidence.json b/var/www/hosting/cadline.hu/clusers/clusers/.svn/text-base/user_new_submit.php.svn-base.evidence.json
new file mode 100644
index 0000000..13bca76
--- /dev/null
+++ b/var/www/hosting/cadline.hu/clusers/clusers/.svn/text-base/user_new_submit.php.svn-base.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6508",
+ "log_excerpt": "[quarantine] clusers.cadline.hu:clusers/.svn/text-base/user_new_submit.php.svn-base -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/clusers/clusers/.svn/text-base/user_new_submit.php.svn-base)",
+ "original_sha256": "6967d992a9ea9a197dc185dbf43a0d871dba4c5a5c5224ed9b4841f4f11080aa",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1265662389,
+ "size": 3080,
+ "uid": 11669
+ },
+ "rel_path": "clusers/.svn/text-base/user_new_submit.php.svn-base",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "clusers.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/clusers/clusers/user_new_submit.php b/var/www/hosting/cadline.hu/clusers/clusers/user_new_submit.php
new file mode 100644
index 0000000..538c5b1
--- /dev/null
+++ b/var/www/hosting/cadline.hu/clusers/clusers/user_new_submit.php
@@ -0,0 +1,208 @@
+
+
+
+
+ $p)
+ $$key = $p;
+
+ if($_FILES['Picture']['name']!='' && move_uploaded_file($_FILES['Picture']['tmp_name'], $target_path))
+ $Picture = $target_path;
+ else
+ $Picture = '';
+
+ if( !isset($Save) ){
+ if( isset( $in_nUserID )&& $in_nUserID>0)
+ cl_redirect("user_detail.php?in_nUserID=$in_nUserID");
+ else
+ cl_redirect("users_page.php");
+ exit;
+ }
+
+ $connection = cl_connect();
+ cl_select($connection);
+ // @ Modify?
+ if( $in_nUserID != NULL ){
+ if( strcmp($County,$lang_automata)==0)
+ $County = cl_get_state($City);
+
+ $emails = $_POST['EMail'];
+
+ $old_default_email = trim(getDefaultEmail($in_nUserID));
+
+ // nem trljk az eddig hasznlt logint ...
+ /* if(check_forum_existance($old_default_email) && $emails[0] != $old_default_email){
+ //UpdateForumUser($in_nUserID, $old_default_email, $emails[0]);
+ }
+ */
+
+ $old_login = trim(getForumLogin($in_nUserID));
+
+
+ /*
+ if(check_forum_existance_by_nUserID($in_nUserID) && trim($emails[0]) != $old_default_email && trim($emails[0]) != ""){
+ //UpdateForumUserByNUserID($in_nUserID, $old_login, $emails[0]);
+ $mailresz = explode('@',$emails[0]);
+ $jelszo = trim($mailresz[0]);
+ InsertUserToForum2($in_nUserID, md5($jelszo), trim($emails[0]), $Name, trim($emails[0]));
+ }*/
+
+ // minden e-mail cmmel be lehessen lpni ..
+ if(check_forum_existance_by_nUserID($in_nUserID) && trim($emails[0]) != ""){
+ foreach($emails as $email){
+ if( !check_forum_login_existance($email) && trim($email) != ""){
+ $mailresz = explode('@',$email);
+ $jelszo = trim($mailresz[0]);
+ InsertUserToForum2($in_nUserID, md5($jelszo), trim($email), $Name, trim($email));
+ }
+ }
+ }
+
+ UpdateForumName($in_nUserID, $Name);
+
+ DeleteUserEmails($in_nUserID);
+ UpdateUserEmails($emails, $in_nUserID);
+
+ $Web = webcimme($Web);
+ if($Esely == ""){
+ $Esely = 'NULL';
+ }
+
+ $query = "UPDATE $g_table_users SET
+ strName = '$Name',
+ strCompany = '$Company',
+ strTel = '$Tel',
+ strMobil = '$Mobil',
+ strFax = '$Fax',
+ strCounty = '$County',
+ nCtrID = {$nCtrID},
+ strZip = '$Zip',
+ strCity = '$City',
+ strStreet = '$Street',
+ strInfo = '$Info',
+ nEsely = {$Esely},
+ strWeb = '$Web',
+ strSkype = '$Skype',";
+
+ if($Picture_del != 1)
+ $Picture == '' ? '' : $query .= "strPicture='$Picture',";
+ else
+ $query .= 'strPicture = NULL,';
+
+ $query .= "nManagerID = {$NManagerID},";
+ $query .= !is_numeric($NIsCommendatory) ? "nIsCommendatory = NULL," : "nIsCommendatory = {$NIsCommendatory},";
+ $query .= "nCommendatoryID = {$NCommendatoryID},
+ strInvoiceAddress = '$StrInvoiceAddress',
+ strTaxNumber = '$StrTaxNumber',
+ strCompanyNumber = '$StrCompanyNumber',
+ strBankNumber = '$StrBankNumber',
+ nUserProf = {$Profession}
+ WHERE nUserID = $in_nUserID";
+ //die($query);
+ cl_query($query);
+
+
+ $elozoertekesites = cl_query(" SELECT * FROM cl_ertekesites WHERE nUserID=$in_nUserID");
+ $elozoertekesitesrow = mysql_fetch_array($elozoertekesites, MYSQL_ASSOC);
+
+ if( $elozoertekesitesrow['nUserID'] == "" && ($leiras!="" || $kezzel!="" || $vasarlas!="") ){
+ $query4 = "INSERT INTO `cl_ertekesites` (`nUserID`, `leiras`, `kezzel`, `vasarlas`) VALUES ";
+ $query4 .= "({$in_nUserID}, '{$leiras}', '{$kezzel}', '{$vasarlas}')";
+
+ cl_query($query4);
+ }elseif( $elozoertekesitesrow['nUserID'] != "" ){
+ $query2 = "UPDATE cl_ertekesites SET
+ leiras = '".$leiras."',
+ kezzel = '".$kezzel."',
+ vasarlas = '".$vasarlas."'";
+ $query2 .= " WHERE nUserID=$in_nUserID";
+
+ cl_query($query2);
+ }
+
+ // j esemny ha vltozott a vsrlsi ido
+ if( ($elozoertekesitesrow['vasarlas'] == "" || $elozoertekesitesrow['vasarlas'] != $vasarlas ) && ( $vasarlas != 0 && $vasarlas != "") ){
+ $idopont = date("Y-m-d",time()+(60*60*24*30*$vasarlas));
+ $query3 = "INSERT INTO `cl_Messages` (`nUserID`, `nManagerID`, `dateSend`, `strTopic`, `strMsg`, `bFlag`) VALUES ";
+ $query3 .= "({$in_nUserID}, '{$NManagerID}', '{$idopont}', 'Program vasarlasi terv', 'Program vasarlasi terv, az ertekesitesi adatok alapjan', '0')";
+
+ cl_query($query3);
+ }
+
+
+ cl_redirect("user_detail.php?in_nUserID=$in_nUserID");
+ }else{
+ // $nUserID = cl_get_user_id($Name,$/*$City,$Street*/);
+ foreach($_POST['EMail'] as $email){
+ $nUserID = cl_get_user_id($Name,$email);
+ if( $nUserID>0 && is_numeric($nUserID) )
+ break;
+ }
+
+ if( $nUserID>0 && is_numeric($nUserID) ){
+ echo $exists_user."
Felhasznl: ".$nUserID."
";
+ cl_redirect("users_page.php",false);
+ }else{
+ if( strcmp($County,$lang_automata)==0)
+ $County = cl_get_state($City);
+
+ $EMails = $_POST['EMail'];
+ if($Esely == ""){
+ $Esely = 'NULL';
+ }
+
+ $query = "INSERT INTO $g_table_users
+ (strName, strCompany, strTel, strMobil, strFax, strCounty, strZip, strCity, strStreet, strInfo, strWeb, strSkype, nManagerID,
+ nIsCommendatory,nCommendatoryID,strInvoiceAddress,strTaxNumber,strCompanyNumber,strBankNumber,nUserProf,nEsely";
+ $Picture == '' ? '' : $query .= ',strPicture';
+ $query .= ")";
+
+ $query .= " VALUES('$Name','$Company','$Tel','$Mobil','$Fax','$County','$Zip','$City','$Street','$Info','$Web','$Skype','$NManagerID','$NIsCommendatory','$NCommendatoryID','$StrInvoiceAddress','$StrTaxNumber','$StrCompanyNumber','$StrBankNumber', '$Profession', $Esely";
+
+ $Picture == '' ? '' : $query .= ",'$Picture'";
+
+ $query .= ")";
+ cl_query($query);
+ $UserID=mysql_insert_id();
+
+ $query = "INSERT INTO `cl_users_emails` (`nUserID`, `email`, `default`) VALUES ";
+
+ $default = 1;
+ foreach($EMails as $email){
+ $query .= "({$UserID}, '{$email}', {$default}),";
+ $default = 0;
+ }
+
+ $query = rtrim($query, ',');
+
+ cl_query($query);
+
+
+ $query4 = "INSERT INTO `cl_ertekesites` (`nUserID`, `leiras`, `kezzel`, `vasarlas`) VALUES ";
+ $query4 .= "({$UserID}, '{$leiras}', '{$kezzel}', '{$vasarlas}')";
+
+ cl_query($query4);
+
+ // j esemny ha van vsrlsi ido
+ if( $vasarlas != 0 && $vasarlas != "" ){
+ $idopont = date("Y-m-d",time()+(60*60*24*30*$vasarlas));
+ $query3 = "INSERT INTO `cl_Messages` (`nUserID`, `nManagerID`, `dateSend`, `strTopic`, `strMsg`, `bFlag`) VALUES ";
+ $query3 .= "({$in_nUserID}, '{$NManagerID}', '{$idopont}', 'Program vasarlasi terv', 'Program vasarlasi terv (ertekesitesi adatok alapjan)', '0')";
+
+ cl_query($query3);
+ }
+
+
+ cl_redirect("user_detail.php?in_nUserID=$UserID");
+ }
+ }
+ cl_close( $connection );
+ exit;
+?>
diff --git a/var/www/hosting/cadline.hu/clusers/clusers/user_new_submit.php.evidence.json b/var/www/hosting/cadline.hu/clusers/clusers/user_new_submit.php.evidence.json
new file mode 100644
index 0000000..d385f61
--- /dev/null
+++ b/var/www/hosting/cadline.hu/clusers/clusers/user_new_submit.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6332",
+ "log_excerpt": "[quarantine] clusers.cadline.hu:clusers/user_new_submit.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/clusers/clusers/user_new_submit.php)",
+ "original_sha256": "c854211bdbab6a57eb1562aabaa7db338500c4ca11e6dcb72da03358512ec67c",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1326097782,
+ "size": 7645,
+ "uid": 11669
+ },
+ "rel_path": "clusers/user_new_submit.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "clusers.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/clusers/clusers_eng/.svn/text-base/user_new_submit.php.svn-base b/var/www/hosting/cadline.hu/clusers/clusers_eng/.svn/text-base/user_new_submit.php.svn-base
new file mode 100644
index 0000000..6fb4cb0
--- /dev/null
+++ b/var/www/hosting/cadline.hu/clusers/clusers_eng/.svn/text-base/user_new_submit.php.svn-base
@@ -0,0 +1,100 @@
+
+
+
+
+ $p)
+ $$key = $p;
+
+ if($_FILES['Picture']['name']!='' && move_uploaded_file($_FILES['Picture']['tmp_name'], $target_path))
+ $Picture = $target_path;
+ else
+ $Picture = '';
+
+ if( !isset($Save) ){
+ if( isset( $in_nUserID )&& $in_nUserID>0)
+ cl_redirect("user_detail.php?in_nUserID=$in_nUserID");
+ exit;
+ }
+
+ $connection = cl_connect();
+ cl_select($connection);
+
+ // @ Modify?
+ if( $in_nUserID != NULL ){
+
+ $EMail = str_replace(',', ';', $EMail);
+
+ $query = "UPDATE $g_table_users SET
+ strName='$Name',
+ strCompany='$Company',
+ strTel='$Tel',
+ strMobil='$Mobil',
+ strFax='$Fax',
+ strEMail='$EMail',
+ nCtrID='$Country',
+ nRegionID='$Region',
+ nOrgID='$Organization',
+ strZip='$Zip',
+ strCity='$City',
+ strStreet='$Street',
+ strInfo='$Info',
+ strWeb='$Web',
+ strSkype='$Skype',
+ nManagerID='$NManagerID',
+ nIsCommendatory='$NIsCommendatory',
+ nCommendatoryID='$NCommendatoryID',
+ strInvoiceAddress='$StrInvoiceAddress',
+ strTaxNumber='$StrTaxNumber',
+ strCompanyNumber='$StrCompanyNumber',
+ strBankNumber='$StrBankNumber',
+ nUserProf='$Profession'";
+
+ if($Picture_del != 1)
+ $Picture == '' ? '' : $query .= ", strPicture='$Picture'";
+ else
+ $query .= ', strPicture=null';
+
+ $query .= " WHERE nUserID=$in_nUserID";
+
+ cl_query($query);
+ cl_redirect("user_detail.php?in_nUserID=$in_nUserID");
+ }else{
+ $nUserID = cl_get_user_id($Name,$City,$Street);
+
+ if( $nUserID>0 ){
+ echo $exists_user."
";
+ cl_redirect("users_page.php",false);
+ }else{
+
+ $EMail = str_replace(',', ';', $EMail);
+
+ $query = "INSERT INTO $g_table_users
+ (strName, strCompany, strTel, strMobil, strFax, strEMail, nCtrID, nRegionID, nOrgID, strZip, strCity, strStreet, strInfo, strWeb, strSkype, nManagerID,
+ nIsCommendatory,nCommendatoryID,strInvoiceAddress,strTaxNumber,strCompanyNumber,strBankNumber,nUserProf";
+ $Picture == '' ? '' : $query .= ',strPicture';
+
+ $query .= ")";
+
+ $query .= " VALUES('$Name','$Company','$Tel','$Mobil','$Fax','$EMail','$Country','$Region','$Organization','$Zip','$City','$Street','$Info','$Web','$Skype','$NManagerID',
+ '$NIsCommendatory','$NCommendatoryID','$StrInvoiceAddress','$StrTaxNumber','$StrCompanyNumber','$StrBankNumber', '$Profession'";
+
+ $Picture == '' ? '' : $query .= ",'$Picture'";
+
+ $query .= ")";
+
+ cl_query($query);
+ $UserID=mysql_insert_id();
+ cl_redirect("user_detail.php?in_nUserID=$UserID");
+ }
+ }
+ cl_close( $connection );
+ exit;
+?>
diff --git a/var/www/hosting/cadline.hu/clusers/clusers_eng/.svn/text-base/user_new_submit.php.svn-base.evidence.json b/var/www/hosting/cadline.hu/clusers/clusers_eng/.svn/text-base/user_new_submit.php.svn-base.evidence.json
new file mode 100644
index 0000000..0d42c60
--- /dev/null
+++ b/var/www/hosting/cadline.hu/clusers/clusers_eng/.svn/text-base/user_new_submit.php.svn-base.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6285",
+ "log_excerpt": "[quarantine] clusers.cadline.hu:clusers_eng/.svn/text-base/user_new_submit.php.svn-base -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/clusers/clusers_eng/.svn/text-base/user_new_submit.php.svn-base)",
+ "original_sha256": "501b60e0a1a8e89628300b2cf2d62f9523647767288e0b9deb24269bb8f5ecd8",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1265662473,
+ "size": 3081,
+ "uid": 11669
+ },
+ "rel_path": "clusers_eng/.svn/text-base/user_new_submit.php.svn-base",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "clusers.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/clusers/clusers_eng/user_new_submit.php b/var/www/hosting/cadline.hu/clusers/clusers_eng/user_new_submit.php
new file mode 100644
index 0000000..6d37e88
--- /dev/null
+++ b/var/www/hosting/cadline.hu/clusers/clusers_eng/user_new_submit.php
@@ -0,0 +1,198 @@
+
+
+
+
+ $p)
+ $$key = $p;
+
+ if($_FILES['Picture']['name']!='' && move_uploaded_file($_FILES['Picture']['tmp_name'], $target_path))
+ $Picture = $target_path;
+ else
+ $Picture = '';
+
+ if( !isset($Save) ){
+ if( isset( $in_nUserID )&& $in_nUserID>0)
+ cl_redirect("user_detail.php?in_nUserID=$in_nUserID");
+ exit;
+ }
+
+ $connection = cl_connect();
+ cl_select($connection);
+
+ // @ Modify?
+ if( $in_nUserID != NULL ){
+
+ //$EMail = str_replace(',', ';', $EMail);
+ $emails = $_POST['EMail'];
+
+ $old_default_email = getDefaultEmail($in_nUserID);
+
+
+ if(check_forum_existance($old_default_email) && $emails[0] != $old_default_email){
+ // UpdateForumUser($in_nUserID, $old_default_email, $emails[0]);
+ }
+
+ $old_login = getForumLogin($in_nUserID);
+
+ /* if(check_forum_existance_by_nUserID($in_nUserID) && $emails[0] != $old_login && trim($emails[0]) != ""){
+ // UpdateForumUserByNUserID($in_nUserID, $old_login, $emails[0]);
+ $mailresz = explode('@',$emails[0]);
+ $jelszo = $mailresz[0];
+ InsertUserToForum2($in_nUserID, md5($jelszo), $emails[0], $Name, $emails[0]);
+ }*/
+
+ // minden e-mail cmmel be lehessen lpni ..
+ if(check_forum_existance_by_nUserID($in_nUserID) && trim($emails[0]) != ""){
+ foreach($emails as $email){
+ if( !check_forum_existance($email) && trim($email) != ""){
+ $mailresz = explode('@',$email);
+ $jelszo = trim($mailresz[0]);
+ InsertUserToForum2($in_nUserID, md5($jelszo), trim($email), $Name, trim($email));
+ }
+ }
+ }
+
+ UpdateForumName($in_nUserID, $Name);
+
+ DeleteUserEmails($in_nUserID);
+ UpdateUserEmails($emails, $in_nUserID);
+
+ if($Esely == ""){
+ $Esely = 'NULL';
+ }
+
+ $query = "UPDATE $g_table_users SET
+ strName='$Name',
+ strCompany='$Company',
+ strTel='$Tel',
+ strMobil='$Mobil',
+ strFax='$Fax',
+ strEMail='$EMail',
+ nCtrID='$Country',
+ nRegionID='$Region',
+ nOrgID='$Organization',
+ strZip='$Zip',
+ strCity='$City',
+ strStreet='$Street',
+ strInfo='$Info',
+ nEsely = {$Esely},
+ strWeb='$Web',
+ strSkype='$Skype',
+ nManagerID='$NManagerID',
+ nIsCommendatory='$NIsCommendatory',
+ nCommendatoryID='$NCommendatoryID',
+ strInvoiceAddress='$StrInvoiceAddress',
+ strTaxNumber='$StrTaxNumber',
+ strCompanyNumber='$StrCompanyNumber',
+ strBankNumber='$StrBankNumber',
+ nUserProf='$Profession'";
+
+ if($Picture_del != 1)
+ $Picture == '' ? '' : $query .= ", strPicture='$Picture'";
+ else
+ $query .= ', strPicture=null';
+
+ $query .= " WHERE nUserID=$in_nUserID";
+
+
+ $elozoertekesites = cl_query(" SELECT * FROM cl_ertekesites WHERE nUserID=$in_nUserID");
+ $elozoertekesitesrow = mysql_fetch_array($elozoertekesites, MYSQL_ASSOC);
+
+ if( $elozoertekesitesrow['nUserID'] == "" && ($leiras!="" || $kezzel!="" || $vasarlas!="") ){
+ $query4 = "INSERT INTO `cl_ertekesites` (`nUserID`, `leiras`, `kezzel`, `vasarlas`) VALUES ";
+ $query4 .= "({$in_nUserID}, '{$leiras}', '{$kezzel}', '{$vasarlas}')";
+
+ cl_query($query4);
+ }elseif( $elozoertekesitesrow['nUserID'] != "" ){
+ $query2 = "UPDATE cl_ertekesites SET
+ leiras = '".$leiras."',
+ kezzel = '".$kezzel."',
+ vasarlas = '".$vasarlas."'";
+ $query2 .= " WHERE nUserID=$in_nUserID";
+
+ cl_query($query2);
+ }
+
+ // j zenet ha vltozott a vsrlsi ido
+ if( ($elozoertekesitesrow['vasarlas'] == "" || $elozoertekesitesrow['vasarlas'] != $vasarlas ) && ( $vasarlas != 0 && $vasarlas != "") ){
+ $idopont = date("Y-m-d",time()+(60*60*24*30*$vasarlas));
+ $query3 = "INSERT INTO `cl_Messages` (`nUserID`, `nManagerID`, `dateSend`, `strTopic`, `strMsg`, `bFlag`) VALUES ";
+ $query3 .= "({$in_nUserID}, '{$NManagerID}', '{$idopont}', 'Program vasarlasi terv', 'Program vasarlasi terv, az ertekesitesi adatok alapjan', '0')";
+
+ cl_query($query3);
+ }
+
+ cl_query($query);
+
+ cl_redirect("user_detail.php?in_nUserID=$in_nUserID");
+ }else{
+ $nUserID = cl_get_user_id($Name,$City,$Street);
+
+ if( $nUserID>0 ){
+ echo $exists_user."
";
+ cl_redirect("users_page.php",false);
+ }else{
+
+ $EMail = str_replace(',', ';', $EMail);
+ $EMails = $_POST['EMail'];
+
+ $query = "INSERT INTO $g_table_users
+ (strName, strCompany, strTel, strMobil, strFax, strEMail, nCtrID, nRegionID, nOrgID, strZip, strCity, strStreet, strInfo, strWeb, strSkype, nManagerID,
+ nIsCommendatory,nCommendatoryID,strInvoiceAddress,strTaxNumber,strCompanyNumber,strBankNumber,nUserProf";
+ $Picture == '' ? '' : $query .= ',strPicture';
+
+ $query .= ")";
+
+ $query .= " VALUES('$Name','$Company','$Tel','$Mobil','$Fax','$EMail','$Country','$Region','$Organization','$Zip','$City','$Street','$Info','$Web','$Skype','$NManagerID',
+ '$NIsCommendatory','$NCommendatoryID','$StrInvoiceAddress','$StrTaxNumber','$StrCompanyNumber','$StrBankNumber', '$Profession'";
+
+ $Picture == '' ? '' : $query .= ",'$Picture'";
+
+ $query .= ")";
+
+ cl_query($query);
+
+ $UserID=mysql_insert_id();
+
+ $query = "INSERT INTO `cl_users_emails` (`nUserID`, `email`, `default`) VALUES ";
+
+ $default = 1;
+ foreach($EMails as $email){
+ $query .= "({$UserID}, '{$email}', {$default}),";
+ $default = 0;
+ }
+
+ $query = rtrim($query, ',');
+
+ cl_query($query);
+
+
+ $query4 = "INSERT INTO `cl_ertekesites` (`nUserID`, `leiras`, `kezzel`, `vasarlas`) VALUES ";
+ $query4 .= "({$UserID}, '{$leiras}', '{$kezzel}', '{$vasarlas}')";
+
+ cl_query($query4);
+
+ // j esemny ha vltozott a vsrlsi ido
+ if( $vasarlas != 0 && $vasarlas != "" ){
+ $idopont = date("Y-m-d",time()+(60*60*24*30*$vasarlas));
+ $query3 = "INSERT INTO `cl_Messages` (`nUserID`, `nManagerID`, `dateSend`, `strTopic`, `strMsg`, `bFlag`) VALUES ";
+ $query3 .= "({$in_nUserID}, '{$NManagerID}', '{$idopont}', 'Program vasarlasi terv', 'Program vasarlasi terv (ertekesitesi adatok alapjan)', '0')";
+
+ cl_query($query3);
+ }
+
+
+ cl_redirect("user_detail.php?in_nUserID=$UserID");
+ }
+ }
+ cl_close( $connection );
+ exit;
+?>
diff --git a/var/www/hosting/cadline.hu/clusers/clusers_eng/user_new_submit.php.evidence.json b/var/www/hosting/cadline.hu/clusers/clusers_eng/user_new_submit.php.evidence.json
new file mode 100644
index 0000000..a5e3a64
--- /dev/null
+++ b/var/www/hosting/cadline.hu/clusers/clusers_eng/user_new_submit.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6116",
+ "log_excerpt": "[quarantine] clusers.cadline.hu:clusers_eng/user_new_submit.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/clusers/clusers_eng/user_new_submit.php)",
+ "original_sha256": "c40d074909d6576b4de42a69c47ad3d0a5ab0d303ce9eb5636d3eeee294d072e",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1358760970,
+ "size": 7036,
+ "uid": 11669
+ },
+ "rel_path": "clusers_eng/user_new_submit.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "clusers.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/clusers/clusers_spa/user_new_submit.php b/var/www/hosting/cadline.hu/clusers/clusers_spa/user_new_submit.php
new file mode 100644
index 0000000..e8a9690
--- /dev/null
+++ b/var/www/hosting/cadline.hu/clusers/clusers_spa/user_new_submit.php
@@ -0,0 +1,104 @@
+
+
+
+
+ $p)
+ $$key = $p;
+
+ if($_FILES['Picture']['name']!='' && move_uploaded_file($_FILES['Picture']['tmp_name'], $target_path))
+ $Picture = $target_path;
+ else
+ $Picture = '';
+
+ if( !isset($Save) ){
+ if( isset( $in_nUserID )&& $in_nUserID>0)
+ cl_redirect("user_detail.php?in_nUserID=$in_nUserID");
+ exit;
+ }
+
+ $connection = cl_connect();
+ cl_select($connection);
+
+ // @ Modify?
+ if( $in_nUserID != NULL ){
+
+ $EMail = str_replace(',', ';', $EMail);
+ if($Esely == ""){
+ $Esely = 'NULL';
+ }
+
+ $query = "UPDATE $g_table_users SET
+ strName='$Name',
+ strCompany='$Company',
+ strTel='$Tel',
+ strMobil='$Mobil',
+ strFax='$Fax',
+ strEMail='$EMail',
+ nCtrID='$Country',
+ nRegionID='$Region',
+ nOrgID='$Organization',
+ strZip='$Zip',
+ strCity='$City',
+ strStreet='$Street',
+ strInfo='$Info',
+ nEsely = {$Esely},
+ strWeb='$Web',
+ strSkype='$Skype',
+ nManagerID='$NManagerID',
+ nIsCommendatory='$NIsCommendatory',
+ nCommendatoryID='$NCommendatoryID',
+ strInvoiceAddress='$StrInvoiceAddress',
+ strTaxNumber='$StrTaxNumber',
+ strCompanyNumber='$StrCompanyNumber',
+ strBankNumber='$StrBankNumber',
+ nUserProf='$Profession'";
+
+ if($Picture_del != 1)
+ $Picture == '' ? '' : $query .= ", strPicture='$Picture'";
+ else
+ $query .= ', strPicture=null';
+
+ $query .= " WHERE nUserID=$in_nUserID";
+
+ cl_query($query);
+ cl_redirect("user_detail.php?in_nUserID=$in_nUserID");
+ }else{
+ $nUserID = cl_get_user_id($Name,$City,$Street);
+
+ if( $nUserID>0 ){
+ echo $exists_user."
";
+ cl_redirect("users_page.php",false);
+ }else{
+
+ $EMail = str_replace(',', ';', $EMail);
+
+ $query = "INSERT INTO $g_table_users
+ (strName, strCompany, strTel, strMobil, strFax, strEMail, nCtrID, nRegionID, nOrgID, strZip, strCity, strStreet, strInfo, strWeb, strSkype, nManagerID,
+ nIsCommendatory,nCommendatoryID,strInvoiceAddress,strTaxNumber,strCompanyNumber,strBankNumber,nUserProf";
+ $Picture == '' ? '' : $query .= ',strPicture';
+
+ $query .= ")";
+
+ $query .= " VALUES('$Name','$Company','$Tel','$Mobil','$Fax','$EMail','$Country','$Region','$Organization','$Zip','$City','$Street','$Info','$Web','$Skype','$NManagerID',
+ '$NIsCommendatory','$NCommendatoryID','$StrInvoiceAddress','$StrTaxNumber','$StrCompanyNumber','$StrBankNumber', '$Profession'";
+
+ $Picture == '' ? '' : $query .= ",'$Picture'";
+
+ $query .= ")";
+
+ cl_query($query);
+ $UserID=mysql_insert_id();
+ cl_redirect("user_detail.php?in_nUserID=$UserID");
+ }
+ }
+ cl_close( $connection );
+ exit;
+?>
diff --git a/var/www/hosting/cadline.hu/clusers/clusers_spa/user_new_submit.php.evidence.json b/var/www/hosting/cadline.hu/clusers/clusers_spa/user_new_submit.php.evidence.json
new file mode 100644
index 0000000..8114039
--- /dev/null
+++ b/var/www/hosting/cadline.hu/clusers/clusers_spa/user_new_submit.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "5931",
+ "log_excerpt": "[quarantine] clusers.cadline.hu:clusers_spa/user_new_submit.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/clusers/clusers_spa/user_new_submit.php)",
+ "original_sha256": "b64f6aad0a0107ce36748f719ccf5e7ce36e35a80375b51b2c490d46f5c930bc",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1321522580,
+ "size": 3160,
+ "uid": 11669
+ },
+ "rel_path": "clusers_spa/user_new_submit.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "clusers.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/clusers/editcrm/user_new_submit.php b/var/www/hosting/cadline.hu/clusers/editcrm/user_new_submit.php
new file mode 100644
index 0000000..e8a9690
--- /dev/null
+++ b/var/www/hosting/cadline.hu/clusers/editcrm/user_new_submit.php
@@ -0,0 +1,104 @@
+
+
+
+
+ $p)
+ $$key = $p;
+
+ if($_FILES['Picture']['name']!='' && move_uploaded_file($_FILES['Picture']['tmp_name'], $target_path))
+ $Picture = $target_path;
+ else
+ $Picture = '';
+
+ if( !isset($Save) ){
+ if( isset( $in_nUserID )&& $in_nUserID>0)
+ cl_redirect("user_detail.php?in_nUserID=$in_nUserID");
+ exit;
+ }
+
+ $connection = cl_connect();
+ cl_select($connection);
+
+ // @ Modify?
+ if( $in_nUserID != NULL ){
+
+ $EMail = str_replace(',', ';', $EMail);
+ if($Esely == ""){
+ $Esely = 'NULL';
+ }
+
+ $query = "UPDATE $g_table_users SET
+ strName='$Name',
+ strCompany='$Company',
+ strTel='$Tel',
+ strMobil='$Mobil',
+ strFax='$Fax',
+ strEMail='$EMail',
+ nCtrID='$Country',
+ nRegionID='$Region',
+ nOrgID='$Organization',
+ strZip='$Zip',
+ strCity='$City',
+ strStreet='$Street',
+ strInfo='$Info',
+ nEsely = {$Esely},
+ strWeb='$Web',
+ strSkype='$Skype',
+ nManagerID='$NManagerID',
+ nIsCommendatory='$NIsCommendatory',
+ nCommendatoryID='$NCommendatoryID',
+ strInvoiceAddress='$StrInvoiceAddress',
+ strTaxNumber='$StrTaxNumber',
+ strCompanyNumber='$StrCompanyNumber',
+ strBankNumber='$StrBankNumber',
+ nUserProf='$Profession'";
+
+ if($Picture_del != 1)
+ $Picture == '' ? '' : $query .= ", strPicture='$Picture'";
+ else
+ $query .= ', strPicture=null';
+
+ $query .= " WHERE nUserID=$in_nUserID";
+
+ cl_query($query);
+ cl_redirect("user_detail.php?in_nUserID=$in_nUserID");
+ }else{
+ $nUserID = cl_get_user_id($Name,$City,$Street);
+
+ if( $nUserID>0 ){
+ echo $exists_user."
";
+ cl_redirect("users_page.php",false);
+ }else{
+
+ $EMail = str_replace(',', ';', $EMail);
+
+ $query = "INSERT INTO $g_table_users
+ (strName, strCompany, strTel, strMobil, strFax, strEMail, nCtrID, nRegionID, nOrgID, strZip, strCity, strStreet, strInfo, strWeb, strSkype, nManagerID,
+ nIsCommendatory,nCommendatoryID,strInvoiceAddress,strTaxNumber,strCompanyNumber,strBankNumber,nUserProf";
+ $Picture == '' ? '' : $query .= ',strPicture';
+
+ $query .= ")";
+
+ $query .= " VALUES('$Name','$Company','$Tel','$Mobil','$Fax','$EMail','$Country','$Region','$Organization','$Zip','$City','$Street','$Info','$Web','$Skype','$NManagerID',
+ '$NIsCommendatory','$NCommendatoryID','$StrInvoiceAddress','$StrTaxNumber','$StrCompanyNumber','$StrBankNumber', '$Profession'";
+
+ $Picture == '' ? '' : $query .= ",'$Picture'";
+
+ $query .= ")";
+
+ cl_query($query);
+ $UserID=mysql_insert_id();
+ cl_redirect("user_detail.php?in_nUserID=$UserID");
+ }
+ }
+ cl_close( $connection );
+ exit;
+?>
diff --git a/var/www/hosting/cadline.hu/clusers/editcrm/user_new_submit.php.evidence.json b/var/www/hosting/cadline.hu/clusers/editcrm/user_new_submit.php.evidence.json
new file mode 100644
index 0000000..6effa24
--- /dev/null
+++ b/var/www/hosting/cadline.hu/clusers/editcrm/user_new_submit.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6103",
+ "log_excerpt": "[quarantine] clusers.cadline.hu:editcrm/user_new_submit.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/clusers/editcrm/user_new_submit.php)",
+ "original_sha256": "b64f6aad0a0107ce36748f719ccf5e7ce36e35a80375b51b2c490d46f5c930bc",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1326726740,
+ "size": 3160,
+ "uid": 11669
+ },
+ "rel_path": "editcrm/user_new_submit.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "clusers.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/crm/public/application/helpers/sajatfeltolto.php b/var/www/hosting/cadline.hu/crm/public/application/helpers/sajatfeltolto.php
new file mode 100644
index 0000000..0fa98d6
--- /dev/null
+++ b/var/www/hosting/cadline.hu/crm/public/application/helpers/sajatfeltolto.php
@@ -0,0 +1,84 @@
+
diff --git a/var/www/hosting/cadline.hu/crm/public/application/helpers/sajatfeltolto.php.evidence.json b/var/www/hosting/cadline.hu/crm/public/application/helpers/sajatfeltolto.php.evidence.json
new file mode 100644
index 0000000..d2a0af6
--- /dev/null
+++ b/var/www/hosting/cadline.hu/crm/public/application/helpers/sajatfeltolto.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "5913",
+ "log_excerpt": "[quarantine] crm.cadline.hu:public/application/helpers/sajatfeltolto.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/crm/public/application/helpers/sajatfeltolto.php)",
+ "original_sha256": "4b99ac9759922b713dde14d6d6968d578f2bf1f464ca5f92d99f880954981808",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1592828664,
+ "size": 1901,
+ "uid": 11669
+ },
+ "rel_path": "public/application/helpers/sajatfeltolto.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "crm.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/crm.cadline.hu/application/helpers/sajatfeltolto.php b/var/www/hosting/cadline.hu/dev/php7_update/crm.cadline.hu/application/helpers/sajatfeltolto.php
new file mode 100644
index 0000000..0fa98d6
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/crm.cadline.hu/application/helpers/sajatfeltolto.php
@@ -0,0 +1,84 @@
+
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/crm.cadline.hu/application/helpers/sajatfeltolto.php.evidence.json b/var/www/hosting/cadline.hu/dev/php7_update/crm.cadline.hu/application/helpers/sajatfeltolto.php.evidence.json
new file mode 100644
index 0000000..c709bed
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/crm.cadline.hu/application/helpers/sajatfeltolto.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6761",
+ "log_excerpt": "[quarantine] dev.cadline.hu:php7_update/crm.cadline.hu/application/helpers/sajatfeltolto.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/dev/php7_update/crm.cadline.hu/application/helpers/sajatfeltolto.php)",
+ "original_sha256": "4b99ac9759922b713dde14d6d6968d578f2bf1f464ca5f92d99f880954981808",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1593413345,
+ "size": 1901,
+ "uid": 12425
+ },
+ "rel_path": "php7_update/crm.cadline.hu/application/helpers/sajatfeltolto.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "dev.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/admin.php b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/admin.php
new file mode 100644
index 0000000..cf55c37
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/admin.php
@@ -0,0 +1,4757 @@
+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'] = '"; 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 = $this->db->escape_str($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 "
+
+ }
+ else{
+ if( substr($utvonal,-1) != "/" )
+ $utvonal .= "/";
+
+ if( !is_dir($utvonal) ){
+ print "A megadott mappa nem letezik: ".$utvonal;
+ exit();
+ }
+
+ $utvonalthumbs = $utvonal."thumbs/";
+
+ if( !is_dir($utvonalthumbs) ){
+ mkdir($utvonalthumbs,0644);
+ chmod($utvonalthumbs,0777);
+ }
+
+ $nagykepek = scandir($utvonal);
+ $letrehozva= "";
+
+ include('application/helpers/myimg_helper.php');
+ foreach( $nagykepek as $nagy ){
+ $nagykep = $utvonal.$nagy;
+ // ha letezik a thumb kep akkor ne irja felul
+ if( $nagy!="." && $nagy!=".." && !is_dir($nagykep) && !file_exists($utvonalthumbs.$nagy) ){
+ $ujkiskep = $utvonalthumbs.$nagy;
+ kemeretezesvagassh($nagykep,$ujkiskep,68,68);
+ chmod($ujkiskep,0777);
+ $letrehozva .= $ujkiskep."
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 ){
+ ?>
+
";
+ print "
ok: ".$ujkiskep;
+ }
+ }
+ print "Letrehozva: ".$letrehozva;
+ exit();
+ }
+ }
+
+ function creategallerylink(){
+ $utvonal = $this->input->post('utvonal');
+
+
+ if( !$utvonal ){
+ ?>
+
+
+ }
+ else{
+ if( substr($utvonal,-1) != "/" )
+ $utvonal .= "/";
+
+ if( !is_dir($utvonal) ){
+ print "A megadott mappa nem letezik: ".$utvonal;
+ exit();
+ }
+
+ print $utvonal." : ".base64_encode($utvonal);
+ exit();
+ }
+ }
+
+ function workshop(){
+ $this->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('";
+ // 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 "
";
+ }
+
+
+ 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;
+}
+
+?>
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/admin.php.evidence.json b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/admin.php.evidence.json
new file mode 100644
index 0000000..ccd9092
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/admin.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6772",
+ "log_excerpt": "[quarantine] dev.cadline.hu:php7_update/partners.archlinexp.com/application/controllers/admin.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/admin.php)",
+ "original_sha256": "6478891d9ef465846f47f196bec45855da4d86e3d617207348b2549de69ca732",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1595502767,
+ "size": 148157,
+ "uid": 12425
+ },
+ "rel_path": "php7_update/partners.archlinexp.com/application/controllers/admin.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "dev.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/collection.php b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/collection.php
new file mode 100644
index 0000000..872e8ee
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/collection.php
@@ -0,0 +1,1385 @@
+'ita', 'itc'=>'ger');
+
+ function __construct()
+ {
+ 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'] = " ";
+ }
+ print "".$v->nev.": ".$v->db." db elem
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 = $this->db->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 = $this->db->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 = $this->db->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! ";
+ }
+ }
+ }
+
+
+}
+
+?>
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/collection.php.evidence.json b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/collection.php.evidence.json
new file mode 100644
index 0000000..5d2e8d2
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/collection.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6765",
+ "log_excerpt": "[quarantine] dev.cadline.hu:php7_update/partners.archlinexp.com/application/controllers/collection.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/collection.php)",
+ "original_sha256": "623c2d631d8e875f065612f01001082802e2cd4c3088640d3d6c393dec3782dd",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1595502744,
+ "size": 41801,
+ "uid": 12425
+ },
+ "rel_path": "php7_update/partners.archlinexp.com/application/controllers/collection.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "dev.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/forum.php b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/forum.php
new file mode 100644
index 0000000..49e064e
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/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]="/";
+ $mit[2]="/\n/";
+ $mit[3]="/'/";
+ $mit[4]="/=/";
+ $mit[5]="/\"/";
+ $mit[6]="/;/";
+ $mire[0]=">";
+ $mire[1]="<";
+ $mire[2]="
";
+ $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, '
")
+ $error .= "Üres hozzászólás!
";
+
+
+ if ($_FILES["fkep"]["error"]==0 && ($error == "") ){
+ $login = $tomb['name'];
+ $user_id = $this->mforum->get_userid($login);
+ //ha nincs mappája
+ if(hun())
+ $hova = $this->kepek_utvonal.$user_id;
+ elseif(eng())
+ $hova = $this->kepek_utvonal_eng.$user_id;
+
+ if(!is_dir($hova)){
+ //akkor hozza létre
+ mkdir($hova,0644);
+ chmod($hova,0777);
+ }
+ $feltolt_konyvtar = $hova."/";
+ //ha több fájl lenne ugyanazon a néven
+ $rand = rand(100,999);
+ $basefilename = $rand . "__" .$this->ekezet($_FILES["fkep"]["name"]);
+ $feltolt_fajlnev=$feltolt_konyvtar . $basefilename;
+
+ $error = "";
+ $mi = $_FILES['fkep']['name']."$";
+
+ $mire = "\.bmp|\.jpg|\.jpeg|\.png|\.gif|\.tif|\.BMP|\.JPG|\.PNG|\.GIF";
+ if( !(ereg( $mire , $mi )) ){
+ $error .= "Hibás fájl kiterjesztés, elfogadott kiterjesztések: .bmp, .jpg, .png, .gif
";
+ }
+ if( $_FILES['fkep']['size'] > 1024 * 1024 * 10 ){
+ $error .= "A kép mérete nagyobb 10 MB-nál.
";
+ }
+ else if( $hszszoveg != "" && !$error){
+ if (copy($_FILES["fkep"]["tmp_name"], $feltolt_fajlnev)){
+ $kep = $rand . "__". $this->ekezet($_FILES["fkep"]["name"]);
+ $mit = $hova."/".$kep;
+ chmod($mit,0777);
+
+ // elonezeti kep elkeszitese 200x150-ben
+ // include('application/helpers/myimg_helper.php');
+ // @kepmeretezesvagasmax($feltolt_fajlnev,$hova,"elo_".$basefilename,300,300);
+ }else{
+ $kep = "NULL";
+ }
+ }
+ }
+
+ if(!$error){
+ $this->mforum->hszbeszur($hszszoveg,$tema_id,$valasz,$kep);
+
+
+ // ertesitesek kikuldese
+ $this->load->library('email');
+ $this->email->initialize();
+
+ $mail_data['tema'] = $this->mforum->get_cim($tema_id)->cim;
+ $mail_data['user'] = $tomb['name'];
+ $mail_data['hsz'] = $hszszoveg;
+
+ $this->email->message($this->load->view('mail/forum_ujhsz', $mail_data, true));
+ $this->email->from('info@cadline.hu', 'Cadline Weboldal');
+ $this->email->subject('ARCHLine.XP Fórum - Új hozzászólás');
+
+ $kiknek = $this->mforum->ertesites($tema_id);
+ foreach($kiknek as $kinek){
+ $alap = $this->mforum->default_mail($kinek->email);
+ if(!$alap)
+ $alap = $kinek->email;
+
+ if($alap)
+ $this->email->send($alap, 'smtp');
+ }
+ // end ertesitesek kikuldese
+
+
+ $temaid = $this->phpsession->get('tema_id');
+ header("Location: listaz/$temaid");
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='forum/ujhsz';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+ $data['error']=$error;
+ $data['hsz']=$this->input->post('hsz');
+
+ $this->load->view('site_forum',$data);
+ }
+ }else if( $this->phpsession->get('temaid') ){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='forum/ujhsz';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('../editor/fckeditor');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ $this->index();
+ }
+ }
+
+ function valasz(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->uri->segment(3) ){
+ $this->phpsession->save('valasz',$this->uri->segment(3));
+ $id = $this->uri->segment(3);
+ $temaid = $this->mforum->get_temaidByHszid($id);
+ $this->phpsession->save('temaid',$temaid);
+ }
+ if( $tomb ){
+ if( $this->phpsession->get('temaid') ){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='forum/ujhsz';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('../editor/fckeditor');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ $this->index();
+ }
+ }
+
+ function listaz(){
+ $this->phpsession->save('valasz',false);
+ if( !($this->phpsession->get('oldal')) ) $this->phpsession->save('oldal',0);
+ if( $this->uri->segment(3) == 'kov' ) $this->kovetkezo();
+ if( $this->uri->segment(3) == 'elozo' ) $this->elozo();
+
+ if( is_numeric($this->uri->segment(3)) ){
+ $tema_id = $this->uri->segment(3);
+ $this->phpsession->save('temaid',$tema_id);
+// redirect('forum/listaz');
+ }else if($this->phpsession->get('temaid')){
+ $tema_id = $this->phpsession->get('temaid');
+ }else{
+ $tema_id = 0;
+ }
+
+ if(!($tema_id) || !is_numeric($tema_id) || !$this->mforum->is_temaid($tema_id)){
+ redirect('forum');
+ }else{
+ $data['tartalom']='forum/temamutat';
+ $data['csik']=array('home','forum');
+
+
+ if( in_array($tema_id,$this->noindextemak) )
+ $data["noindex"] = true;
+
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ if( !is_numeric($this->uri->segment(4)) )
+ $oldal = $this->phpsession->get('oldal');
+ else{
+ $oldal = $this->uri->segment(4);
+ $this->phpsession->save('oldal',$oldal);
+ }
+ $hszek = $this->mforum->get_lista($tema_id,$oldal);
+ foreach( $hszek as $hsz){
+ if( !($hsz->valasz == "0" || $hsz->valasz == "NULL") ){
+ $vszid = $hsz->valasz;
+ $elozo = $this->mforum->get_hsz($vszid);
+ if( $elozo->user == "" )
+ $elozo = $this->mforum->get_hsz2($vszid);
+ if( isset($elozo->user) && $elozo->user != "0" && $elozo->user != "" ){
+ $hsz->valasz = $elozo->user . ", (" . $elozo->datum . ")";
+ if( $elozo->user == 586 )
+ $hsz->valasz = "Németh Kálmán, (" . $elozo->datum . ")";
+ elseif( $elozo->user == 270 )
+ $hsz->valasz = "Tóth M.Levente, Mészáros Marcel, (" . $elozo->datum . ")";
+ }
+ elseif( $elozo )
+ $hsz->valasz = "[Törölt felhasználó], (" . $elozo->datum . ")";
+ else
+ $hsz->valasz = "-";
+ }
+ //if(!eng()) $hsz->szoveg = $this->csere2($hsz->szoveg);
+ if( strtotime($hsz->datum) < 1282039000) $hsz->szoveg = $this->csere2($hsz->szoveg);
+
+ if( $hsz->user_id == 586 ){
+ $hsz->user = "Németh Kálmán";
+ }elseif( $hsz->user_id == 270 ){
+ $hsz->user = "Tóth M.Levente, Mészáros Marcel";
+ }
+ }
+
+ if( !$hszek ){
+ $data['infok'] = array("2");
+ }else{
+ if( $this->mforum->vanmegoldal($tema_id,$this->phpsession->get('oldal')))
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('oldal') > 0 )
+ $data['elozo'] = true;
+ }
+
+ $data['hszek_json'] = json_encode($hszek);
+
+ $user = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($user['name']) )
+ $data['szerk']=true;
+ $data['temacim'] = $this->mforum->get_cim($tema_id)->cim;
+ $temakor_id = $this->mforum->get_tema1($tema_id)->temakor_id;
+ $data['temakorcim'] = $this->mforum->get_temakor1($temakor_id)->cim;
+ $data['temakorid'] = $temakor_id;
+ $data['tema_id'] = $tema_id;
+ $data['oldalak_szama'] = (int)$this->mforum->get_temaoldal($tema_id);
+ $data['akt_oldal'] = $oldal;
+
+ $data['hozzaszolasok'] = $hszek;
+
+ $data['meta']['keyw'] = $data['temacim'].', ';
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['title'] .= ' - ' . $data['temacim'];
+ $data['meta']['desc'] = hun() ? "ARCHLine.XP fórum, ".$data['temakorcim']." > ".$data['temacim']." téma hozzászólásai, ".($oldal+1).". oldal" : "ARCHLine.XP forum, posts of ".$data['temacim']." topic, ".($oldal+1).". page";
+
+ $data['aktmenu'] = "1";
+ $data['style'] = array('jquery.ui','fancybox2');
+ $data['javascript'] = array('../editor/fckeditor','jquery_ui'/*,'fancybox/jquery-1.3.2.min','fancybox/jquery.easing.1.3'*/,'fancybox/jquery.fancybox-1.2.1.pack','fancybox/fancy');
+ $this->load->view('site_forum',$data);
+ }
+
+ }
+
+ function kovetkezo(){
+ $oldalszam = $this->phpsession->get('oldal');
+ if( $this->mforum->vanmegoldal($this->phpsession->get('temaid'),$oldalszam)){
+ $oldalszam++;
+ }
+ $this->phpsession->save('oldal',$oldalszam);
+ }
+
+ function elozo(){
+ $oldalszam = $this->phpsession->get('oldal');
+ if( $oldalszam > 0 )
+ $oldalszam--;
+ $this->phpsession->save('oldal',$oldalszam);
+ }
+
+ 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 login(){
+ $name = $this->input->post('name');
+ $passwd = $this->input->post('passwd');
+
+ $name = $this->db->escape_str($name);//$this->csere($name);
+
+ if(!$passwd || !$name)
+ {
+ $this->belephiba(9);
+ }
+ else
+ {
+ $name2 = $this->ekezet($name);
+ $vanaktiv = $this->mforum->vanaktivprog($name);
+
+ if( ($this->mforum->belep($name,$passwd) || $this->mforum->belep($name2,$passwd))
+ && $vanaktiv )
+ {
+ $uid = $this->mforum->get_userid($name);
+ if( !$uid || !is_numeric($uid) ){
+ $this->belephiba(6);
+ }else{
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$name;
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+ $fuser['rang'] = $this->mforum->get_rang($uid);
+ $rang = $fuser['rang'];
+ }
+
+
+
+
+ // ha csak feltolto
+ if( $rang != "user" && $rang != "moderator" ){
+ $fuser['user_id'] = $uid;
+
+ // webrenderbe is beléptetni
+ $sessid=md5($name.time());
+ $hash=md5($name . $this->pw . $sessid);
+ setcookie("sessid",$sessid,time()+$this->ervenydesseg,"/");
+ setcookie("azonosito", $name, time()+$this->ervenydesseg,"/");
+ setcookie("hash",$hash,time()+$this->ervenydesseg,"/");
+
+ $this->phpsession->save('feltolto',$fuser);
+ $this->belephiba(8);
+ }
+ //ha még nem fogadta el a szabályzatot:
+ elseif( !($this->mforum->szabalyzat($uid) ) ){
+ if(hun())
+ $lap = $this->mpages->get_row(454);
+ else
+ $lap = $this->mpages->get_row(559);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum szabályzat' : $data['title'] = 'ARCHLine.XP Forum Rules';
+ $data['tartalom'] = '/forum/szabalyzat';
+ $data['lap'] = $lap;
+ //$user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($name))
+ $data['moderator']=true;
+
+ //ha még nem fogadta el a szabályzatot:
+ if( !($this->mforum->szabalyzat($uid) ) ){
+ $data['uid'] = $uid;
+ $data['login'] = $name2;
+ $data['pw'] = md5($passwd);
+ $data['nemelfogad'] = true;
+ $data['infok'] = array("0");
+ }
+
+ $this->load->view('site_forum',$data);
+ }
+ else{
+ $fuser['user_id'] = $uid;
+ $this->phpsession->save('fuser',$fuser);
+
+
+ // webrenderbe is beléptetni
+ $sessid=md5($name.time());
+ $hash=md5($name . $this->pw . $sessid);
+ setcookie("sessid",$sessid,time()+$this->ervenydesseg,"/");
+ setcookie("azonosito", $name, time()+$this->ervenydesseg,"/");
+ setcookie("hash",$hash,time()+$this->ervenydesseg,"/");
+
+ redirect('forum');
+ }
+ }else{
+ if( $name == "moderator" ){
+ $szam = date(W);
+ $this->mforum->jelszovaltmod($szam);
+ if( $this->mforum->belep($name,$passwd) ){
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$name;
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+ $uid = $this->mforum->get_userid($name);
+ $fuser['user_id'] = $uid;
+ $this->phpsession->save('fuser',$fuser);
+ redirect('forum');
+ }
+ }
+
+ if( !$vanaktiv )
+ $this->belephiba(7);
+ else{
+ $this->belephiba(6);
+ }
+ }
+ }
+ }
+
+ function belephiba($szoveg){
+ $data['tartalom']='forum/temakorok';
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['csik']=array('home','forum');
+
+ if( !is_numeric($szoveg) ){
+ $data['error'] = $szoveg;
+ }
+ else{
+ $data['error'] = array($szoveg);
+ }
+
+ $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;
+ $tema->rov_cim = $tema->cim;
+
+ /*if(strlen($tema->cim) > 26){
+ $ut26 = array($cim[26]);
+ $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")
+ $tema->utolsouser = $this->mforum->get_userUid($xx->user)->nev;
+ 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'] = 1;
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function logout(){
+ unset($_SESSION['default']['fuser']);
+ unset($_SESSION['default']['feltolto']);
+ redirect('forum');
+ }
+
+ function szerkeszt(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->uri->segment(3) != "")
+ $hszid = $this->uri->segment(3);
+ else
+ //$hszid = $this->phpsession->get('hszid');
+ $hszid = $this->input->post('hszid');
+
+ if( $this->mforum->moderator($tomb['name']) || $this->mforum->get_sajathsz($tomb['user_id'], $hszid) ){
+ if($this->input->post('szerk')!=false){
+ //$hszid = $this->phpsession->get('hszid');
+ $hszid = $this->input->post('hszid');
+ $this->mforum->hszszerk($this->input->post('hsz'),$hszid);
+ $user_id = $this->mforum->get_hsz($hszid)->user_id;
+
+ if( $this->input->post('kepki')=='on' ){
+ if(hun())
+ $kep = $this->kepek_utvonal . $user_id ."/". $this->mforum->get_Kep($hszid)->kep;
+ elseif(eng())
+ $kep = $this->kepek_utvonal_eng . $user_id ."/". $this->mforum->get_Kep($hszid)->kep;
+
+ chmod($kep, 777);
+ unlink($kep);
+ $this->mforum->kepki($hszid);
+ }
+
+ $temaid = $this->phpsession->get('tema_id');
+ header("Location: listaz/$temaid");
+ }else if( $this->uri->segment(3) != "" ){
+ $this->phpsession->save('hszid',$this->uri->segment(3));
+
+ $data['szoveg']=$this->mforum->get_Text($this->phpsession->get('hszid'))->szoveg;
+ $kep = $this->mforum->get_Kep($this->phpsession->get('hszid'))->kep;
+ if( $kep != "" && $kep != "NULL" ){
+ $user_id = $this->mforum->get_hsz($this->phpsession->get('hszid'))->user_id;
+ if(hun())
+ $data['kep'] = "/".$this->kepek_utvonal. $user_id . "/".$kep;
+ elseif(eng())
+ $data['kep'] = "/".$this->kepek_utvonal_eng. $user_id . "/".$kep;
+ }
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['javascript'] = array('../editor/fckeditor');
+ $data['tartalom']='forum/szerkeszt';
+ $data['csik']=array('home','forum');
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function torles(){
+ $tomb = $this->phpsession->get('fuser');
+ $hszid = $this->uri->segment(3);
+ if( $this->mforum->moderator($tomb['name']) || $this->mforum->get_sajathsz($tomb['user_id'], $hszid) ){
+ if( $this->uri->segment(3) != "" ){
+ $hszid = $this->uri->segment(3);
+ $uid = $this->mforum->torol($hszid);
+
+ //ha nincs kep a mappajaban:
+ if(hun())
+ $mappa = $this->kepek_utvonal . $uid;
+ elseif(eng())
+ $mappa = $this->kepek_utvonal_eng . $uid;
+
+ $handle = opendir($mappa);
+ //ha nincs fajl a konyvtarban, akkor toroljuk a mappat
+ chmod($mappa,0777);
+ $fajl = readdir($handle);
+ $fajl = readdir($handle);
+ $fajl = readdir($handle);
+ if(!($fajl)){
+ //closedir($mappa);
+ rmdir($mappa);
+ }
+
+ $tema_id = $this->phpsession->get('temaid');
+ if( is_int($this->mforum->get_temaoldal($tema_id)) && ($this->phpsession->get('oldal') == $this->mforum->get_temaoldal($tema_id)) ){
+ $this->elozo();
+ }
+ redirect('forum/listaz');
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tatnevez(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" && ($this->input->post('atnevez')==false) ){
+ $tid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='forum/temaatnevez';
+ $data['csik']=array('home','forum');
+ $data['tema_id'] = $tid;
+ $data['temacim'] = $this->mforum->get_cim($tid)->cim;
+ $data['moderator'] = true;
+
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('atnevez')!=false){
+ $this->mforum->tatnevez($this->input->post('tid'),$this->input->post('ujnev'));
+
+ header("Location: index");
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tkatnevez(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" && ($this->input->post('atnevez')==false) ){
+ $tid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='forum/tkatnevez';
+ $data['csik']=array('home','forum');
+ $data['tema_id'] = $tid;
+ $data['temacim'] = $this->mforum->get_tkcim($tid)->cim;
+ $data['moderator'] = true;
+
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('atnevez')!=false){
+ $this->mforum->tkatnevez($this->input->post('tid'),$this->input->post('ujnev'));
+
+ header("Location: index");
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tematorol(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $tomb && $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" ){
+ $tid = $this->uri->segment(3);
+ $this->mforum->tematorol($tid);
+
+ redirect('forum');
+ }else{
+ redirect('forum');
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function temakortorol(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $tomb && $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" ){
+ $tid = $this->uri->segment(3);
+ $this->mforum->temakortorol($tid);
+
+ redirect('forum');
+ }else{
+ redirect('forum');
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function mypost(){
+ $this->phpsession->save('valasz',false);
+
+ $data['tartalom']='forum/mypost';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('forum');
+ $data['style'] = array('forum_2011');
+ $user = $this->phpsession->get('fuser');
+
+ if(!$user)
+ redirect('forum');
+
+ $hszek = $this->mforum->get_mypost($user['user_id']);
+ foreach( $hszek as $hsz){
+ $elo = $hsz->valasz;
+ $hsz->valasz = $this->mforum->get_valaszok($hsz->hsz_id);
+ $hsz->valaszdb = count($hsz->valasz);
+ $hsz->elozo = $this->mforum->get_hsz($elo);
+ $tema = $this->mforum->get_tema1($hsz->tema_id);
+ $hsz->tema = $this->mforum->get_tema1($hsz->tema_id);
+ $temakor = $this->mforum->get_temakor1($tema->temakor_id);
+ $hsz->temakor = $temakor->cim;
+
+ //print_r($hsz->elozo);
+ }
+
+ $data['hozzaszolasok'] = $hszek;
+ $data['hszdb'] = count($hszek);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+
+ $this->load->view('site_forum',$data);
+ }
+
+
+ function myuser(){
+ $user = $this->phpsession->get('fuser');
+
+ if(!$user)
+ $user = $this->phpsession->get('feltolto');
+
+ if($user){
+ /*$tomb = $this->phpsession->get('fuser');*/
+ $login = $user['name'];
+ $this->user($login);
+ }else
+ redirect('forum');
+ }
+
+ function user($login){
+ if(!$login)
+ redirect('forum');
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='forum/user';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['user']=$login;
+ $data['adatok'] = $this->mforum->get_user($login);
+ $szemadatok = $this->mforum->get_user_szem($login);
+ $emailek = $szemadatok[0]->email;
+ $emailek = explode(";",$emailek);
+ $szemadatok[0]->email = "";
+ foreach( $emailek as $email ){
+ $szemadatok[0]->email .= $email . "
";
+ }
+ $van = $szemadatok[0]->nev;
+ if($van)
+ $data['szemadatok'] = $szemadatok;
+ else
+ $data['szemadatok'] = $this->mforum->get_user_alap($login);
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+
+ $kulcsok[$key_kulcs]->programok = $programs;
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }
+
+ function users(){
+ $user = $this->phpsession->get('fuser');
+
+ if( $user && $this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+ $this->phpsession->save('belep',"");
+
+ if( !($this->phpsession->get('uoldal')) ){
+ $this->phpsession->save('uoldal',0);
+ $oldal = 0;
+ }else{
+ $oldal = $this->phpsession->get('uoldal');
+ }
+
+ if( $this->uri->segment(3) == "kov" ){
+ $oldal++;
+ $this->phpsession->save('uoldal',$oldal);
+ }else if( $this->uri->segment(3) == "elozo" && $oldal > 0 ){
+ $oldal--;
+ $this->phpsession->save('uoldal',$oldal);
+ }
+ else if( is_numeric($this->uri->segment(3))){
+ $oldal = $this->uri->segment(3);
+ $this->phpsession->save('uoldal',$oldal);
+ }
+
+ if( $this->uri->segment(3) == "rendez" ){
+ $ord = $this->uri->segment(4);
+
+
+ $vissza = $this->phpsession->get('rendezvissza');
+ if($this->phpsession->get('rendez') == $ord){
+ $vissza = !$vissza;
+ }
+ $this->phpsession->save('rendezvissza',$vissza);
+
+
+ $this->phpsession->save('rendez',$ord);
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ }else if( $this->phpsession->get('rendez') ){
+ $ord = $this->phpsession->get('rendez');
+ $vissza = $this->phpsession->get('rendezvissza');
+ }else{
+ $ord = "nev";
+ $vissza = false;
+ }
+
+ $data['users']=$this->mforum->get_users($oldal,$ord,$vissza);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ukeres(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+ if( !($this->phpsession->get('ukoldal')) ){
+ $this->phpsession->save('ukoldal',0);
+ $oldal = 0;
+ }else{
+ $oldal = $this->phpsession->get('ukoldal');
+ }
+
+ if( is_numeric($this->uri->segment(3))){
+ $oldal = $this->uri->segment(3);
+ $this->phpsession->save('ukoldal',$oldal);
+ }
+
+ if( $this->uri->segment(3) == "rendez" ){
+ $ord = $this->uri->segment(4);
+
+ $vissza = $this->phpsession->get('rendezvissza');
+ if($this->phpsession->get('rendez') == $ord){
+ $vissza = !$vissza;
+ }
+ $this->phpsession->save('rendezvissza',$vissza);
+
+ $this->phpsession->save('rendez',$ord);
+ $oldal = 0;
+ $this->phpsession->save('ukoldal',0);
+ }else if( $this->phpsession->get('rendez') ){
+ $ord = $this->phpsession->get('rendez');
+ $vissza = $this->phpsession->get('rendezvissza');
+ }else{
+ $ord = "nev";
+ $vissza = false;
+ }
+
+ if( $this->input->post('klogin') || $this->input->post('knev') || $this->input->post('kemail') || $this->input->post('kulcssz') || ($this->input->post('belep') != -1 && $this->input->post('belep') != "" ) ){
+ $oldal = 0;
+ $this->phpsession->save('ukoldal',$oldal);
+ $klog = $this->input->post('klogin');
+ $this->phpsession->save('klogin',$this->input->post('klogin'));
+ $knev = $this->input->post('knev');
+ $this->phpsession->save('knev',$knev);
+ $kmail = $this->input->post('kemail');
+ $this->phpsession->save('kemail',$this->input->post('kemail'));
+ $kulcs = $this->input->post('kulcssz');
+ $this->phpsession->save('kulcssz',$this->input->post('kulcssz'));
+ $belep = $this->input->post('belep');
+ $this->phpsession->save('belep',$this->input->post('belep'));
+ }else{
+ $klog = $this->phpsession->get('klogin');
+ $knev = $this->phpsession->get('knev');
+ $kmail = $this->phpsession->get('kemail');
+ $kulcs = $this->phpsession->get('kulcssz');
+ $belep = $this->phpsession->get('belep');
+ }
+
+ if(UJUGYFELKEZELO===true)
+ $users = $this->mforum->get_kusersujcrm($oldal,$klog,$knev,$kmail,$belep,$kulcs,$ord,$vissza);
+ else
+ $users = $this->mforum->get_kusers($oldal,$klog,$knev,$kmail,$belep,$kulcs,$ord,$vissza);
+ $data['users'] = $users;
+
+ if(UJUGYFELKEZELO===true){
+ if( $this->mforum->vanmegkuserujcrm($this->phpsession->get('ukoldal'),$klog,$knev,$kmail,$belep,$kulcs) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('ukoldal') > 0 )
+ $data['elozo'] = true;
+ }
+ else{
+ if( $this->mforum->vanmegkuser($this->phpsession->get('ukoldal'),$klog,$knev,$kmail,$belep,$kulcs) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('ukoldal') > 0 )
+ $data['elozo'] = true;
+ }
+
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_kusersdb($klog,$knev,$kmail,$belep,$kulcs);
+ $data['akt_oldal'] = $oldal;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function edit_user(){
+ $user = $this->phpsession->get('fuser');
+ if($user && $this->mforum->moderator($user['name'])){
+ if( $this->uri->segment(3) != "" && ($this->input->post('edituser')==false) ){
+ $uid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználó szerkesztése' : $data['title'] = 'ARCHLine.XP Forum Edit User';
+ $data['tartalom']='forum/edit_user';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+ $login = $this->mforum->get_login($uid);
+ $data['adatok'] = $this->mforum->get_user($login);
+
+ $szemadatok = $this->mforum->get_user_szem($login);
+
+ if($szemadatok[0])
+ $data['szemadat'] = $szemadatok[0];
+ else{
+ $cucc = $this->mforum->get_user_alap($login);
+ $data['szemadat'] = $cucc[0];
+ }
+
+ //$data['kulcsok'] = $this->mforum->get_user_kulcsok($login);
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+
+ $i=0;
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $i++;
+
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+
+ $kulcsok[$key_kulcs]->programok = $programs;
+
+
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('edituser')!=false){
+
+ $error = "";
+ $langerror = array();
+ if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') != $this->input->post('jelszo2') ){
+ $error .= "A megadott két jelszó nem egyezik.
";
+ array_push($langerror,0);
+ }else if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') == $this->input->post('jelszo2') && strlen($this->input->post('jelszo1') ) < 5 ){
+ $error .= "A megadott jelszó 5 karakternél rövidebb.
";
+ array_push($langerror,1);
+ }
+
+ $user = $tomb['name'];
+ //$myid = $this->mforum->get_userid($user);
+
+ if( $this->input->post('login') == "" ){
+ $error .= "A login mező értéke nem lehet üres.
";
+ array_push($langerror,4);
+ }
+
+ if( $this->input->post('login') != "" && !$this->mforum->szabadlogin($this->input->post('login'),$this->input->post('uid')) ){
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+ array_push($langerror,2);
+ }
+ elseif( strlen($this->input->post('login') ) < 5 ){
+ $error .= "A megadott login 5 karakternél rövidebb.
";
+ array_push($langerror,3);
+ }
+
+ if( $this->input->post('login') != $this->ekezet($this->input->post('login')) ){
+ $error .= "A felhasználó névben nem szerepelhet ékezet vagy szóköz!
";
+ array_push($langerror,5);
+ }
+
+
+ $uid = $this->input->post('uid');
+
+ if( !$error ){
+ // frissítés
+ $mod['nev'] = $this->input->post('nev');
+ $mod['login'] = $this->input->post('login');
+ $mod['rang'] = $this->input->post('rang');
+ if($this->input->post('jelszo1') != "")
+ $mod['jelszo'] = md5($this->input->post('jelszo1'));
+ $mod['viewsub'] = ($this->input->post('viewsub') == "on") ? 1 : 0;
+
+ $this->db->update('forum_user',$mod,"user_id={$uid}");
+ //$this->mforum->set_user($this->input->post('uid'),$this->input->post('nev'),$this->input->post('email'),$this->input->post('jelszo1'),$this->input->post('login'),$this->input->post('rang'));
+
+ redirect("forum/users");
+ }else{
+
+
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználó szerkesztése' : $data['title'] = 'ARCHLine.XP Forum Edit User';
+ $data['tartalom']='forum/edit_user';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+
+ $login = $this->mforum->get_login($uid);
+ $data['adatok'] = $this->mforum->get_user($login);
+
+ $szemadatok = $this->mforum->get_user_szem($login);
+
+ if($szemadatok[0])
+ $data['szemadat'] = $szemadatok[0];
+ else{
+ $cucc = $this->mforum->get_user_alap($login);
+ $data['szemadat'] = $cucc[0];
+ }
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+
+ $i=0;
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $i++;
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+ $kulcsok[$key_kulcs]->programok = $programs;
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+ $data['error'] = $error;
+ $data['hibak2'] = $langerror;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+
+ print " ";
+ }
+
+ $ezt = "edit_user/".$uid;
+ header("Location: ".$ezt);
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujuser(){
+ $user = $this->phpsession->get('fuser');
+ if($user && $this->mforum->moderator($user['name'])){
+ if($this->input->post('do')!=false){
+ $login = $this->input->post('login');
+ $nev = $this->input->post('nev');
+ $jsz1 = $this->input->post('jelszo1');
+ $jsz2 = $this->input->post('jelszo2');
+ $email = $this->input->post('email');
+ $kulcs = $this->input->post('kulcs');
+ $rang = $this->input->post('rang');
+
+ if($kulcs)
+ $nUserID = $this->mforum->get_nUserID($kulcs);
+ else
+ $nUserID = "NULL";
+
+ $error = "";
+ $langerror = array();
+
+ if( $login == "" )
+ $error .= "Nincs login megadva.
";
+
+ if( $login != $this->ekezet($login) )
+ $error .= "A felhasználó névben nem lehet ékezet vagy szóköz.
";
+ elseif( !$this->mforum->szabadlogin($login,10000) )
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+
+ if( $jsz1 == "" || $jsz2 == "" || $jsz1 != $jsz2 )
+ $error .= "A két jelszó nem egyezik vagy nincsenek megadva.
";
+
+ if( $this->mforum->is_email($email) )
+ $error .= "A megadott e-mail-cím már szerepel az adatbázisban.
";
+
+ if(!$error){
+ $this->mforum->ujuser($login,$nev,$jsz1,$email,$nUserID,$rang);
+
+ redirect('forum/users');
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új felhasználó' : $data['title'] = 'ARCHLine.XP Forum new user';
+ $data['tartalom']='forum/ujuser';
+ $data['csik']=array('home','forum');
+ $data['error2'] = $error;
+ $data['moderator']=true;
+ $data['javascript']=array('forum');
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }
+
+ }else{
+ $data['title'] = 'ARCHLine.XP Fórum új felhasználó';
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Új Felhasználó' : $data['title'] = 'ARCHLine.XP Forum New User';
+ $data['tartalom']='forum/ujuser';
+ $data['csik']=array('home','forum');
+ $data['javascript']=array('forum');
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function del_user(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ $id = $this->uri->segment(3);
+ $this->mforum->del_user($this->uri->segment(3));
+ redirect("forum/users");
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujuserdb(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+
+
+
+
+ $this->access_id = 36;
+
+ $this->load->model('mpartners');
+ $this->keydb = $this->load->database('clusers',true);
+ $search = false;//$this->input->post('search');
+
+ $from = 0;
+ $to = 999999;
+ $limit = 2000;
+
+ $this->keydb->query("SET NAMES utf8");
+ $result = $this->keydb->from('cl_fo_hardlock')->join('cl_users','cl_fo_hardlock.hlUser=cl_users.nUserID','left')->orderby('hlNum','desc')->where("hlCtrID ='".$this->access_id."'")->where('hlStat',1)->where("hlNum >= '".$from."' AND hlNum <= '".$to."'")->limit(99999)->get();
+
+ //$sorok = $result->result();
+
+
+
+
+
+ $query = $this->keydb->from('cl_fo_hardlock')->join('cl_users','cl_fo_hardlock.hlUser=cl_users.nUserID','left')->join('cl_users_emails','cl_users.nUserID=cl_users_emails.nUserID','left')->orderby('hlNum','desc')->where("hlCtrID ='".$this->access_id."'")->where('hlStat',1)->where('default',1)->where("hlNum >= '".$from."' AND hlNum <= '".$to."'")->limit(99999)->get();
+ $sorok = $query->result();
+
+
+ //$this->keydb->query("SET NAMES latin2");
+
+
+
+
+ if($result->num_rows()==0)
+ {
+ $data['sorok'] = false;
+ }
+ else
+ {
+ $data['sorok'] = $sorok;
+ $data['found'] = $result->num_rows();
+ }
+
+ $sorok2 = $sorok;
+ $i = 0;
+ $j = 0;
+ $db = 0;
+ foreach($sorok2 as $sor){
+ $mailek = $sor->email;
+ $mailek = explode(";",$mailek);
+
+ foreach( $mailek as $mail ){
+ $mail = trim($mail);
+
+ //megnezzuk hogy benne van-e az adatbázisban és aktív-e
+ if( $mail != "" && $sor->hlStat == 1 && !$this->mforum->is_email(strtolower($mail)) ){
+ $mailresz = explode('@',$mail);
+ $login = $mail;
+ $nev = $sor->strName;
+ $nev = trim($nev);
+ $jsz1 = $mailresz[0];
+ $nUserID = $sor->nUserID;
+ $rang = "user";
+
+ // eladási dátum 0000-00-00 -e
+ $datum = $this->keydb->from('cl_fo_programs')->where("prHlNum",$sor->hlNum)->select('prSellDate')->get()->row();
+ if($datum->prSellDate != '0000-00-00'){
+ $this->mforum->ujuser($login,$nev,$jsz1,strtolower($mail),$nUserID,$rang);
+ $db++;
+ $kik[$j]->Nev = $nev;
+ $kik[$j]->Login = $login;
+ $kik[$j]->Email = $mail;
+ $kik[$j]->Datum = $datum->prSellDate;
+ }
+ $j++;
+ }
+ }
+ $i++;
+ }
+ $data['darab'] = $db;
+ $data['kik'] = $kik;
+
+
+
+ $data['sorok2'] = $sorok2;
+
+
+
+
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $this->load->view('site_forum',$data);
+ }else
+ redirect('forum');
+ }
+
+ function myedit(){
+ $tomb = $this->phpsession->get('fuser');
+
+ if(!$tomb) $tomb = $this->phpsession->get('feltolto');
+
+ if( $tomb ){
+ if($this->input->post('mysave')!=false){
+
+ $error = "";
+ $langerror = array();
+ if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') != $this->input->post('jelszo2') ){
+ $error .= "A megadott két jelszó nem egyezik.
";
+ array_push($langerror,0);
+ }else if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') == $this->input->post('jelszo2') && strlen($this->input->post('jelszo1') ) < 5 ){
+ $error .= "A megadott jelszó 5 karakternél rövidebb.
";
+ array_push($langerror,1);
+ }
+
+ $user = $tomb['name'];
+ $myid = $this->mforum->get_userid($user);
+
+ if( $this->input->post('login') == "" ){
+ $error .= "A login mező értéke nem lehet üres.
";
+ array_push($langerror,4);
+ }
+
+ if( $this->input->post('login') != "" && !$this->mforum->szabadlogin($this->input->post('login'),$myid) ){
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+ array_push($langerror,2);
+ }
+ elseif( strlen($this->input->post('login') ) < 5 ){
+ $error .= "A megadott login 5 karakternél rövidebb.
";
+ array_push($langerror,3);
+ }
+
+ if( $this->input->post('login') != $this->ekezet($this->input->post('login')) ){
+ $error .= "A felhasználó névben nem szerepelhet ékezet vagy szóköz!
";
+ array_push($langerror,5);
+ }
+
+
+ $ertesitesek = $this->input->post('temak');
+ if(count($ertesitesek) == 0 || (count($ertesitesek) == 1 && $ertesitesek[0] == "") )
+ $ertesit = NULL;
+ elseif( count($ertesitesek) == count($this->mforum->get_temak()) )
+ $ertesit = "mind";
+ else
+ $ertesit = ";".implode(";", $ertesitesek).";";
+
+
+ if($error){
+ hun() ? $data['title'] = 'ARCHLine.XP Adatok változtatása' : $data['title'] = 'ARCHLine.XP Edit Data';
+ $data['tartalom']='forum/myedit';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+ $data['error2'] = $error;
+ $data['hibak2'] = $langerror;
+
+ $user = $tomb['name'];
+ $user_id = $this->mforum->get_userid($user);
+ $data['user_id'] = $user_id;
+ $data['cucc'] = $this->mforum->get_user_alap($user);
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }else{
+ $plogin = $this->input->post('login');
+ $pnev = $this->input->post('nev');
+ $pjelszo = $this->input->post('jelszo1');
+
+ $this->mforum->myedit($plogin, $pnev, $pjelszo, $myid, $ertesit);
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['t_nev'] = $this->mforum->get_nev($plogin);
+ $fuser['name'] = $this->input->post('login');
+ $this->phpsession->save('fuser',$fuser);
+ $this->myuser();
+ }
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Adatok változtatása' : $data['title'] = 'ARCHLine.XP Edit Data';
+ $data['tartalom']='forum/myedit';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ if(hun())
+ $nyelv = "hun";
+ else
+ $nyelv = "eng";
+
+ $user = $tomb['name'];
+ $user_id = $this->mforum->get_userid($user);
+ $data['user_id'] = $user_id;
+ $data['temak'] = $this->mforum->get_temak($nyelv);
+ $data['cucc'] = $this->mforum->get_user_alap($user);
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujjelszo(){
+ if($this->input->post('kuld')!=false){
+ $email = $this->input->post('email');
+ if(hun()) $uzenet = "A megadott e-mail-cím: " . $email;
+ //$uzenet = $email;
+
+ $ujjelszo = $this->mforum->ujjelszo($email);
+
+ if($ujjelszo){
+
+ $this->load->library('email');
+ $this->load->helper('email');
+ $this->email->initialize();
+ $this->email->addOfficialImages();
+
+ $mailnek->ujjsz = $ujjelszo;
+ $mailnek->login = $this->mforum->get_login2($email);
+
+
+ /* Akarmilyem mailcimet is adott meg, a default emailre kuldjuk a levelet */
+ $email2 = $this->mforum->default_mail($email);
+ if($email2 != "")
+ $email = $email2;
+
+
+ $this->email->from('info@cadline.hu', 'Cadline Weboldal');
+ if(hun())
+ $this->email->subject('Uj jelszo');
+ else
+ $this->email->subject('New Password');
+ $this->email->message($this->load->view('mail_ujjelszo',$mailnek,true));
+ $this->email->send($email,'smtp');
+
+ if(hun())
+ $uzenet = $email." -ra kiküldtük az Ön új jelszavát.
";
+ else
+ $uzenet = "New password sent to ".$email;
+
+ }else{
+ if(hun()) $uzenet .= " nincs a felhasználók között.
";
+ else $uzenet = "E-mail error: ".$email;
+ }
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új jelszó' : $data['title'] = 'ARCHLine.XP Forum new password';
+
+ $data['uzenet']=$uzenet;
+ $this->phpsession->save('fuzenet',$uzenet);
+
+ if( isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'],'/collection/') ){
+ $data['tartalom']='collection/ujjelszo_valasz';
+ $data['style'] = array('temp/style_new');
+ $this->load->view('site_upload',$data);
+ }
+ else{
+ /*$data['tartalom']='forum/temakorok';
+ $data['csik']=array('home','forum');
+ $this->load->view('site_forum',$data);*/
+ redirect('forum');
+ }
+
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új jelszó' : $data['title'] = 'ARCHLine.XP Forum new password';
+
+ $data['tartalom']='forum/ujjelszo';
+ $data['csik']=array('home','forum');
+
+ if( isset($_SERVER['HTTP_REFERER']) && (strstr($_SERVER['HTTP_REFERER'],'collection/upload') || strstr($_SERVER['HTTP_REFERER'],'collection/submit')) ){
+ $data['style'] = array('temp/style_new');
+ $this->load->view('site_upload',$data);
+ }
+ else{
+ $this->load->view('site_new',$data);
+ }
+ }
+ }
+
+ function szabalyzat(){
+ if(hun())
+ $lap = $this->mpages->get_row(454);
+ else
+ $lap = $this->mpages->get_row(559);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum szabályzat' : $data['title'] = 'ARCHLine.XP Forum Rules';
+ $data['tartalom'] = '/forum/szabalyzat';
+ $data['lap'] = $lap;
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $uid = $this->mforum->get_userid($user['name']);
+ //ha még nem fogadta el a szabályzatot:
+ if( !($this->mforum->szabalyzat($uid) ) ){
+ $data['uid'] = $uid;
+ $data['nemelfogad'] = true;
+ }
+
+ $data['aktmenu'] = "2";
+ $this->load->view('site_forum',$data);
+ }
+
+ function elfogad(){
+ if($this->input->post('el')=="igen"){
+ $this->load->model('mclusers');
+
+ $uid = $this->input->post('uid');
+ $name = $this->input->post('fnev');
+ $passwd = $this->input->post('jelszo');
+ if( $this->mforum->belep($name,$passwd,false) ){
+ $this->mforum->elfogad($uid);
+
+ $felhasznalo = $this->mforum->getrow($uid);
+ if($felhasznalo->nUserID > 0 && $felhasznalo->nyelv == "hun")
+ $this->mclusers->addEvent($felhasznalo->nUserID, 109, 'Elso bejelentkezes a forumba.', "hun");
+ elseif( $felhasznalo->nUserID > 0 && $felhasznalo->nyelv == "eng" )
+ $this->mclusers->addEvent($felhasznalo->nUserID, 148, 'Elso bejelentkezes a forumba.', "eng");
+
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$this->mforum->get_login($uid);
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+
+ $fuser['user_id'] = $uid;
+
+ $this->phpsession->save('fuser',$fuser);
+ $Date = date('Y-m-d',time());
+
+ $nUserID = $this->mforum->get_nUserID2($uid);
+ }
+
+ redirect('forum');
+
+ }else{
+ $this->logout();
+ }
+ }
+
+ function ido(){
+ die(date('Y-m-d H:i:s', time()));
+ }
+
+ function emailjavitas(){
+ $tomb = $this->phpsession->get('fuser');
+ if(!$tomb)
+ redirect('forum');
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+
+ $cl_users = $this->mforum->get_cl_users();
+
+ $db = 0;
+ $cserek = "";
+ foreach($cl_users as $user){
+ $nUserID = $user->nUserID;
+ //print $user->strName;
+ $x = $this->mforum->cseremail($nUserID);
+ if( $x ){
+ $cserek .= $x;
+ $db++;
+ }
+ }
+
+ $data['email']=$db;
+ $data['cserek']=$cserek;
+
+
+
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function ujuserdb_eng(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $sorok = $this->mforum->get_cl_users_eng();
+
+ $i = 0;
+ $j = 0;
+ $db = 0;
+ foreach($sorok as $sor){
+ $mailek = $sor->strEMail;
+ $mailek = explode(";",$mailek);
+
+ foreach( $mailek as $mail ){
+ /* csak az elso email cimet veszi fel */
+ $mail = trim($mailek[0]);
+
+
+ //megnezzuk hogy benne van-e az adatbázisban és aktív-e
+ if( $mail != "" && $sor->hlStat == 1 && !$this->mforum->is_email(strtolower($mail)) ){
+ $mailresz = explode('@',$mail);
+ $login = $mail;
+ $nev = $sor->strName;
+ $nev = trim($nev);
+ $jsz1 = $mailresz[0];
+ $nUserID = $sor->nUserID;
+ $rang = "user";
+
+
+ // eladási dátum 0000-00-00 -e
+ $datum = $this->db->from('`clusers_eng`.`cl_fo_programs`')->where("prHlNum",$sor->hlNum)->select('prSellDate')->get()->row();
+
+ $prog = $this->db->query(" SELECT * FROM `clusers_eng`.`cl_fo_programs` WHERE prHlNum = '".$sor->hlNum."'")->result();
+
+ if($datum->prSellDate != '0000-00-00' && $this->mforum->szabadlogin($login) ){
+ $this->mforum->ujuser_eng($login,$nev,$jsz1,strtolower($mail),$nUserID,$rang);
+
+ // print "
Felvenném: ".$login.$nev.$jsz1.strtolower($mail).$nUserID.$rang;
+
+ $db++;
+ $kik[$j]->Nev = $nev;
+ $kik[$j]->Login = $login;
+ $kik[$j]->Email = $mail;
+ $kik[$j]->Datum = $datum->prSellDate;
+ }
+ $j++;
+ }
+ }
+ $i++;
+ }
+ $data['darab'] = $db;
+ $data['kik'] = $kik;
+
+ $data['sorok2'] = $sorok;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function info($info){
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/kiir';
+ $data['info'] = $info;
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function galeria(){
+ $user = $this->phpsession->get('fuser');
+
+ if( is_numeric($this->uri->segment(3)) ){
+ $this->galeriamutat();
+ }elseif($user){
+ $this->sajatgaleria();
+ }else{
+ redirect("forum");
+ }
+ }
+
+ function galeriamutat(){
+ $user_id = $this->uri->segment(3);
+ $lang = $this->muser->user['lang'];
+
+ $fajlok = $this->mforum->get_galeria($user_id,$lang);
+
+ $data["fajlok"] = $fajlok;
+ if(hun())
+ $data['utvonal'] = $this->galeria_utvonal.$user_id;
+ else
+ $data['utvonal'] = $this->galeria_utvonal_eng.$user_id;
+
+ $data['tartalom'] = '/forum/galeria';
+ $data['javascript'] = array(
+ 'interior_menu',
+ 'fancybox/jquery-1.3.2.min',
+ 'fancybox/jquery.easing.1.3',
+ 'fancybox/jquery.fancybox-1.2.1.pack',
+ 'fancybox/fancy'
+ );
+
+ $data['style'] = array('fancybox');
+
+ $this->load->view('site_forum',$data);
+
+ }
+
+ function sajatgaleria(){
+ $this->load->model('mrender');
+ $user = $this->phpsession->get('fuser');
+
+ if($user){
+ hun() ? $data['title'] = 'ARCHLine.XP Saját Galéria' : $data['title'] = 'ARCHLine.XP My Gallery';
+ $data['tartalom'] = '/forum/sajatgaleria';
+
+ $uid = $user['user_id'];
+ $data['uid'] = $uid;
+
+ $data['fajlok'] = $this->mforum->fajlok($uid);
+ $data['szabad_hely'] = (200 * 1024 * 1024) - $this->foglalt_hely($uid);
+
+ // $data['renderek'] = $this->mrender->get_byuserid($uid);
+
+ $data['javascript'] = array('fancybox/jquery-1.3.2.min','fancybox/jquery.easing.1.3','fancybox/jquery.fancybox-1.2.1.pack','fancybox/fancy','jquery','jquery_ui');
+ $data['style'] = array('fancybox2','jquery.ui');
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "5";
+ $this->load->view('site_forum',$data);
+ }else
+ redirect("forum");
+ }
+
+ function foglalt_hely($user_id){
+ if(hun())
+ $fajlok = $this->galeria_utvonal.$user_id."/";
+ else
+ $fajlok = $this->galeria_utvonal_eng.$user_id."/";
+
+ $total = 0;
+
+ if( is_dir($fajlok) ){
+ $handle = opendir($fajlok);
+ while($file = readdir($handle)){
+ $total += filesize($fajlok.$file);
+ if((is_dir($fajlok.$file.'/')) &&($file != '..')&&($file != '.'))
+ {
+ $total = $total + $this->foglalt_hely($fajlok.$file.'/');
+ }
+ }
+ }
+
+ return $total;
+ }
+
+ function feltolt(){
+ $user = $this->phpsession->get('fuser');
+ $uid = $user['user_id'];
+
+ if($uid && $_FILES["fajl"]["error"]==0){
+
+ $fajl = "";
+ $meret = 0;
+
+ if(hun())
+ $hova = $this->galeria_utvonal.$uid;
+ elseif(eng())
+ $hova = $this->galeria_utvonal_eng.$uid;
+
+ if(!is_dir($hova)){
+ mkdir($hova,0644);
+ chmod($hova,0777);
+ }
+
+
+ $feltolt_konyvtar = $hova."/";
+ //ha több fájl lenne ugyanazon a néven
+ $elotag = substr(time(),-6);
+ $fajlnev = $this->ekezet($_FILES["fajl"]["name"]);
+ $feltolt_fajlnev=$feltolt_konyvtar . $elotag . "__" . $fajlnev;
+
+ $error = "";
+ $mi = $_FILES['fajl']['name']."$";
+
+ $mire = "\.exe|\.EXE|\.php|\.PHP|\.sh|\.SH";
+ if( (ereg( $mire , $mi )) ){
+ $error .= "Hibás fájl kiterjesztés
";
+ }
+ if( $_FILES['fajl']['size'] > 1024 * 1024 * 10 ){
+ $error .= "A fájl mérete nagyobb 10 MB-nál.
";
+ }
+ else if( !$error){
+ if (copy($_FILES["fajl"]["tmp_name"], $feltolt_fajlnev)){
+ $fajl = $elotag . "__". $fajlnev;
+ $meret = $_FILES["fajl"]["size"];
+ $mit = $hova."/".$fajl;
+ chmod($mit,0777);
+
+
+ // elonezeti kep elkeszitese 150x113-ban
+ include('application/helpers/myimg_helper.php');
+ kepmeretezesvagas($feltolt_fajlnev,$hova,"elo_".$fajl,"150","113");
+
+ }else{
+ $fajl = "NULL";
+ $error = "Fájl másolás hiba.
";
+ }
+ }
+
+ if( !$error ){
+ $szamla = $this->input->post('szamla');
+ $info = $this->input->post('leiras');
+ $megoszt = 1;
+
+ if( $this->input->post('megosztas') != "on" ){
+ $megoszt = 0;
+ }
+
+ $this->mforum->feltolt($uid,$fajl,$meret,$szamla,$megoszt,$info);
+
+ redirect("forum/galeria/".$uid);
+ }else{
+ $this->info($error);
+ }
+
+
+ }else{
+ if( $_FILES['fajl']['error'] != 0 )
+ $this->info("Hiba a fájl feltöltésekor!");
+ else
+ redirect("forum");
+ }
+
+ }
+
+ function delfajl(){
+ $fajl_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ $user_id = $user['user_id'];
+
+ if(!$user)
+ redirect('forum');
+
+ if( is_numeric($fajl_id) && $this->mforum->sajatfajl($fajl_id, $user_id) ){
+ $this->load->model('mrender');
+
+ $fajl = $this->mforum->delfajl($fajl_id);
+
+ if(hun())
+ $mit = "public/forum-galeria/hun/".$user_id."/elo_".$fajl;
+ else
+ $mit = "public/forum-galeria/eng/".$user_id."/elo_".$fajl;
+
+ // elonezeti kep torlese ha van
+ if( file_exists( $mit ) ){
+ chmod($mit, 777);
+ unlink($mit);
+ }
+
+ // A fájlhoz tartozó rendereknél törölni a galériás fájl id-t.
+ $renderek = $this->mrender->get_rowBygforumgalid($fajl_id);
+ if( $renderek ){
+ foreach($renderek as $render){
+ $ertek = NULL;
+ $this->db->update('render_img',array('forumgal_id'=>$ertek),"render_id='".$render->render_id."'");
+ }
+ }
+ }
+ redirect("forum/galeria");
+ }
+
+ function editgaleria(){
+ $fajl_id = $this->input->post('fajl_id');
+ // $fajl_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ $user_id = $user['user_id'];
+
+ if(!$user)
+ redirect('forum');
+
+
+ if( is_numeric($fajl_id) && $this->mforum->sajatfajl($fajl_id, $user_id) ){
+ if( $this->input->post('do') ){
+ $leiras = $this->input->post('leiras');
+ $megoszt = 1;
+
+ if( $this->input->post('megosztas') != "on" ){
+ $megoszt = 0;
+ }
+
+ $this->mforum->editgaleria($fajl_id,$leiras,$megoszt);
+
+ redirect("forum/galeria");
+
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Saját Galéria' : $data['title'] = 'ARCHLine.XP My Gallery';
+ $data['tartalom'] = '/forum/editgaleria';
+
+ $data['uid'] = $user_id;
+ $data['fajlinfo'] = $this->mforum->fajlinfo($fajl_id);
+ if(hun())
+ $data['utvonal'] = $this->galeria_utvonal;
+ else
+ $data['utvonal'] = $this->galeria_utvonal_eng;
+
+ $data['utvonal'] .= "/".$user_id;
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "5";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect("forum");
+ }
+ }
+
+ function regisztracio(){
+ if($this->input->post('do') != ""){
+ $nev = $this->input->post('regnev');
+ $login = $this->input->post('email');
+ $email = $login;
+ $jelszo = $this->input->post('jelszo1');
+
+ $szabad = $this->mforum->szabadlogin($login,999999);
+ if( $szabad ){
+ //$this->mforum->ujuser($login,$nev,$jelszo,$email,"","feltolto");
+
+
+ $kod = md5($jelszo.time().$nev);
+
+ $record['login'] = $email;
+ $record['jelszo'] = md5($jelszo);
+ $record['nev'] = $nev;
+ $record['email'] = $email;
+ $record['rang'] = "guest";
+ $record['kod'] = $kod;
+ $record['datum'] = date("Y-m-d H:i:s",time());
+ $record['nyelv'] = $this->muser->user['lang'];
+
+ $this->db->insert('forum_user_temp',$record);
+
+
+ $this->load->helper('email');
+
+ //sending the e-mail
+ $mail_vars['kod'] = $kod;
+ $mail_vars['email'] = $email;
+ $mail_vars['first'] = $nev;
+
+ //set the authenticating link
+ $mail_vars['link'] = hun() ? 'http://archline.hu/forum/confirm/' . $kod : 'http://www.archlinexp.com/forum/confirm/' . $kod;
+
+ //setting and sending the email
+ $this->load->library('email');
+ $this->email->initialize();
+ $this->email->addOfficialImages();
+
+ $this->email->setFrom('info@cadline.hu', 'CadLine');
+
+ if(hun())
+ {
+ $mail_vars['mailcontent'] = 'mail/confirm_forum_hun';
+ $this->email->subject('ARCHLine.XP regisztráció');
+ }
+ else
+ {
+ $mail_vars['mailcontent'] = 'mail/confirm_forum_eng';
+ $this->email->subject('ARCHLine.XP registration');
+ }
+
+ $this->email->message($this->load->view('mail',$mail_vars,true));
+ $this->email->send($mail_vars['email'],'smtp');
+
+ redirect('forum/sentconf');
+ }
+ else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/regisztracio';
+ $data['javascript'] = array('forum');
+ $data['style'] = array('temp/style_interior');
+ $data['foglalt'] = "igen";
+
+ $this->load->view('site_upload',$data);
+ }
+ }else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/regisztracio';
+ $data['javascript'] = array('forum');
+ $data['style'] = array('temp/style_interior');
+
+ $this->load->view('site_upload',$data);
+ }
+ }
+
+ function sentconf(){
+ $data['tartalom']='forum/sentconf';
+ $data['lang']=$this->muser->user['lang'];
+ $data['style'] = array('temp/style_new');
+
+ $this->load->view('site_upload',$data);
+ }
+
+ function confirm(){
+ $kod = $this->uri->segment(3);
+
+ $data['style'] = array('temp/style_new');
+
+ if( $this->mforum->confirm($kod) ){
+
+ /* a felhasználóhoz új eseményt felvenni, ha szerepel az adatbázisban */
+ $adatok = $this->mforum->get_userByKod($kod);
+ $nUserID = $this->mforum->get_nUserID30($adatok->email);
+ if( $nUserID ){
+ $this->load->model('mclusers');
+ $this->mclusers->addEvent($nUserID, 114, "Regisztráció");
+ }
+
+ $data['tartalom']='forum/confirm_ok';
+ $data['lang']=$this->muser->user['lang'];
+ }else{
+ $data['tartalom']='forum/confirm_hiba';
+ $data['lang']=$this->muser->user['lang'];
+ }
+
+ $this->load->view('site_upload',$data);
+ }
+
+ function belepfeltolto(){
+ if( $this->input->post("do") != "" ){
+ $login = $this->input->post("email");
+ $jelszo = $this->input->post("jelszo");
+
+ if( $this->mforum->belep($login,$jelszo) ){
+ print "ok";
+ }else
+ print "nem ok";
+
+ }else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/belepfeltolto';
+ $data['javascript'] = array('forum');
+
+ $this->load->view('site',$data);
+ }
+ }
+
+ function renderek(){
+ $this->load->model('mrender');
+ $user = $this->phpsession->get('fuser');
+ $feltolto = $this->phpsession->get('feltolto');
+
+ if($user){
+ $uid = $user['user_id'];
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ }elseif($feltolto){
+ $uid = $feltolto['user_id'];
+ }
+ else
+ redirect("forum");
+
+ hun() ? $data['title'] = 'ARCHLine.XP Renderek' : $data['title'] = 'ARCHLine.XP Renders';
+ $data['tartalom'] = '/forum/renderek';
+
+ $data['uid'] = $uid;
+
+ $renderek = $this->mrender->get_byuserid($uid);
+
+ if($renderek){
+ foreach($renderek as $render){
+ if($render->allapot=='1' && file_exists($render->keszkep)){
+ list($width, $height) = getimagesize($render->keszkep);
+ $render->kepmeret = $width . " x ". $height;
+ }
+ else{
+ $render->kepmeret = '-';
+ }
+ }
+ }
+
+ $data['renderek'] = $renderek;
+
+ $data['onload'] = "betolt()";
+
+ $data['javascript'] = array('fancybox-1.3.4/fancybox/jquery-1.4.3.min','fancybox/jquery.easing.1.3','fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack','jquery_ui','plugin/jquery.maskedinput-1.2.2','plugin/jquery.maskedinput-1.2.2.min');
+ $data['style'] = array('jquery.fancybox-1.3.4','jquery.ui');
+ $data['aktmenu'] = "6";
+ $this->load->view('site_forum',$data);
+
+ unset($_SESSION['webrender']); // ne legyenek meg a render beallitasanal a default ertekek
+ }
+
+ function delrender(){
+ $this->load->model('mrender');
+
+ $render_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ if(!$user)
+ $user = $this->phpsession->get('feltolto');
+
+ if(!$user)
+ redirect('forum');
+
+ $render = $this->mrender->get_row($render_id);
+
+ if( is_numeric($render_id) && $render->user_id == $user['user_id'] ){
+ $this->mrender->del($render_id);
+ }
+
+ header("Location: ".$_SERVER["HTTP_REFERER"]);
+ }
+
+ function rendercopy(){
+ $this->load->model('mrender');
+
+ $guid = $this->uri->segment(3);
+ $render = $this->mrender->get_rowByguid($guid);
+
+ if( is_numeric($render->render_id) ){
+ if( $this->muser->user['lang'] == "hun" )
+ $almappa = "hun";
+ else
+ $almappa = "eng";
+
+ $uid = $render->user_id;
+
+ $helye = "public/forum-galeria/".$almappa."/".$uid;
+
+ if(!is_dir($helye)){
+ mkdir($helye,0644);
+ chmod($helye,0777);
+ }
+
+ $fajluj = basename($render->keszkep);
+
+ $honnan = $render->keszkep;
+ $hova = $helye."/".$fajluj;
+
+ if( copy($honnan,$hova) ){
+ $meret = filesize($hova);
+ $this->mforum->feltolt($render->user_id,$fajluj,$meret,"","1",$render->render_name,$render->nyelv);
+ $fajl_id = $this->db->insert_id();
+ $this->db->update('render_img',array('forumgal_id'=>$fajl_id),"render_id='".$render->render_id."'");
+
+ $uzenet = array(4);
+ $this->phpsession->save('fuzenet',$uzenet);
+
+ // elonezeti kep masolasa is ha van
+ $fajlnev = basename($render->keszkep);
+ $mappak = substr( $render->keszkep,0,(-1*(strlen($fajlnev))) );
+ $elokep = $mappak."elo_".$fajlnev;
+ if(file_exists($elokep)){
+ $ujelokep = $helye."/elo_".$fajlnev;
+ copy($elokep,$ujelokep);
+ }
+ }else{
+ $uzenet = array(14);
+ $this->phpsession->save('fhiba',$uzenet);
+ }
+
+ redirect('forum/renderek');
+ }else{
+ $uzenet = array(14);
+ $this->phpsession->save('fhiba',$uzenet);
+ redirect('forum/renderek');
+ }
+ }
+
+ function renderletolt(){
+ $this->load->model('mrender');
+ $render_id = $this->uri->segment(3);
+ $render = $this->mrender->get_row($render_id);
+
+ $user = $this->phpsession->get('fuser');
+ $feltolto = $this->phpsession->get('feltolto');
+
+ if( isset($render->keszkep) && $render->keszkep != "" && file_exists($render->keszkep) && ( $render->user_id == $user['user_id'] || $render->user_id == $feltolto['user_id'] ) ){
+ $path_parts = pathinfo($render->keszkep);
+ $ext = strtolower($path_parts["extension"]);
+
+ if($render->render_name == "")
+ $render->render_name = "Image";
+
+ header("Content-type: application-download");
+ header('Content-Disposition: attachment; filename="'.$render->render_name.'.'.$ext.'"');
+ readfile($render->keszkep);
+ }else{
+ print "hiba a letoltes kozben";
+ }
+ }
+
+ function myshowroom(){
+ $user = $this->phpsession->get('fuser');
+ $feltolto = $this->phpsession->get('feltolto');
+ if(!$user && !$feltolto)
+ redirect('forum');
+
+ if(!$user)
+ $user = $feltolto;
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['tartalom'] = 'forum/myshowroom';
+
+ $data['title'] = hun() ? 'ARCHLine.XP Saját Bemutatóterem' : 'ARCHLine.XP My Showroom';
+ $uid = $user['user_id'];
+ $data['uid'] = $uid;
+ $data['elemek'] = $this->db->query("SELECT * FROM collection_user WHERE userid={$uid} AND deleted=0")->result();
+
+ $data['aktmenu'] = "5";
+
+ $data['javascript'] = array('fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack','fancybox/fancy');
+ $data['style'] = array('../js/fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4v2');
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function szerver(){
+ print "";
+ print_r($_SERVER);
+ print "\n\n";
+ // print_r($GLOBALS);
+ print "
";
+ }
+
+
+ function downloadbeta32(){
+ $user = $this->fuser;
+ $login = $user['name'];
+ $email = $this->mforum->get_user_alap($login);
+ redirect('events/click/betaletoltes32/'.$email[0]->email);
+ }
+
+ function downloadbeta64(){
+ $user = $this->phpsession->get('fuser');
+ $login = $user['name'];
+ $email = $this->mforum->get_user_alap($login);
+ redirect('events/click/betaletoltes64/'.$email[0]->email);
+ }
+
+
+ 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->ervenydessegazon,"/");
+ setcookie("hash",$_COOKIE['hash'] ,time()+$this->ervenydesseg,"/");
+
+ return true;
+
+ }else{
+ return false;
+ }
+ }
+
+
+}
+
+function hasonlito( $a, $b ){
+ if ( $a->datum == $b->datum )
+ return 0;
+ if ( $a->datum > $b->datum )
+ return -1;
+ return 1;
+}
+
+?>
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/forum.php.evidence.json b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/forum.php.evidence.json
new file mode 100644
index 0000000..5171ded
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/forum.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6769",
+ "log_excerpt": "[quarantine] dev.cadline.hu:php7_update/partners.archlinexp.com/application/controllers/forum.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/forum.php)",
+ "original_sha256": "3412487058a8a6bf79254df2d86f5cbf06b8c96adc9b26e645dd537b80ff13db",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1595506267,
+ "size": 77534,
+ "uid": 12425
+ },
+ "rel_path": "php7_update/partners.archlinexp.com/application/controllers/forum.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "dev.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/forum.php~ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/forum.php~
new file mode 100644
index 0000000..56ebaa6
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/forum.php~
@@ -0,0 +1,2602 @@
+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]="/";
+ $mit[2]="/\n/";
+ $mit[3]="/'/";
+ $mit[4]="/=/";
+ $mit[5]="/\"/";
+ $mit[6]="/;/";
+ $mire[0]=">";
+ $mire[1]="<";
+ $mire[2]="
";
+ $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, '
")
+ $error .= "Üres hozzászólás!
";
+
+
+ if ($_FILES["fkep"]["error"]==0 && ($error == "") ){
+ $login = $tomb['name'];
+ $user_id = $this->mforum->get_userid($login);
+ //ha nincs mappája
+ if(hun())
+ $hova = $this->kepek_utvonal.$user_id;
+ elseif(eng())
+ $hova = $this->kepek_utvonal_eng.$user_id;
+
+ if(!is_dir($hova)){
+ //akkor hozza létre
+ mkdir($hova,0644);
+ chmod($hova,0777);
+ }
+ $feltolt_konyvtar = $hova."/";
+ //ha több fájl lenne ugyanazon a néven
+ $rand = rand(100,999);
+ $basefilename = $rand . "__" .$this->ekezet($_FILES["fkep"]["name"]);
+ $feltolt_fajlnev=$feltolt_konyvtar . $basefilename;
+
+ $error = "";
+ $mi = $_FILES['fkep']['name']."$";
+
+ $mire = "\.bmp|\.jpg|\.jpeg|\.png|\.gif|\.tif|\.BMP|\.JPG|\.PNG|\.GIF";
+ if( !(ereg( $mire , $mi )) ){
+ $error .= "Hibás fájl kiterjesztés, elfogadott kiterjesztések: .bmp, .jpg, .png, .gif
";
+ }
+ if( $_FILES['fkep']['size'] > 1024 * 1024 * 10 ){
+ $error .= "A kép mérete nagyobb 10 MB-nál.
";
+ }
+ else if( $hszszoveg != "" && !$error){
+ if (copy($_FILES["fkep"]["tmp_name"], $feltolt_fajlnev)){
+ $kep = $rand . "__". $this->ekezet($_FILES["fkep"]["name"]);
+ $mit = $hova."/".$kep;
+ chmod($mit,0777);
+
+ // elonezeti kep elkeszitese 200x150-ben
+ // include('application/helpers/myimg_helper.php');
+ // @kepmeretezesvagasmax($feltolt_fajlnev,$hova,"elo_".$basefilename,300,300);
+ }else{
+ $kep = "NULL";
+ }
+ }
+ }
+
+ if(!$error){
+ $this->mforum->hszbeszur($hszszoveg,$tema_id,$valasz,$kep);
+
+
+ // ertesitesek kikuldese
+ $this->load->library('email');
+ $this->email->initialize();
+
+ $mail_data['tema'] = $this->mforum->get_cim($tema_id)->cim;
+ $mail_data['user'] = $tomb['name'];
+ $mail_data['hsz'] = $hszszoveg;
+
+ $this->email->message($this->load->view('mail/forum_ujhsz', $mail_data, true));
+ $this->email->from('info@cadline.hu', 'Cadline Weboldal');
+ $this->email->subject('ARCHLine.XP Fórum - Új hozzászólás');
+
+ $kiknek = $this->mforum->ertesites($tema_id);
+ foreach($kiknek as $kinek){
+ $alap = $this->mforum->default_mail($kinek->email);
+ if(!$alap)
+ $alap = $kinek->email;
+
+ if($alap)
+ $this->email->send($alap, 'smtp');
+ }
+ // end ertesitesek kikuldese
+
+
+ $temaid = $this->phpsession->get('tema_id');
+ header("Location: listaz/$temaid");
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='forum/ujhsz';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+ $data['error']=$error;
+ $data['hsz']=$this->input->post('hsz');
+
+ $this->load->view('site_forum',$data);
+ }
+ }else if( $this->phpsession->get('temaid') ){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='forum/ujhsz';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('../editor/fckeditor');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ $this->index();
+ }
+ }
+
+ function valasz(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->uri->segment(3) ){
+ $this->phpsession->save('valasz',$this->uri->segment(3));
+ $id = $this->uri->segment(3);
+ $temaid = $this->mforum->get_temaidByHszid($id);
+ $this->phpsession->save('temaid',$temaid);
+ }
+ if( $tomb ){
+ if( $this->phpsession->get('temaid') ){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='forum/ujhsz';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('../editor/fckeditor');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ $this->index();
+ }
+ }
+
+ function listaz(){
+ $this->phpsession->save('valasz',false);
+ if( !($this->phpsession->get('oldal')) ) $this->phpsession->save('oldal',0);
+ if( $this->uri->segment(3) == 'kov' ) $this->kovetkezo();
+ if( $this->uri->segment(3) == 'elozo' ) $this->elozo();
+
+ if( is_numeric($this->uri->segment(3)) ){
+ $tema_id = $this->uri->segment(3);
+ $this->phpsession->save('temaid',$tema_id);
+// redirect('forum/listaz');
+ }else if($this->phpsession->get('temaid')){
+ $tema_id = $this->phpsession->get('temaid');
+ }else{
+ $tema_id = 0;
+ }
+
+ if(!($tema_id) || !is_numeric($tema_id) || !$this->mforum->is_temaid($tema_id)){
+ redirect('forum');
+ }else{
+ $data['tartalom']='forum/temamutat';
+ $data['csik']=array('home','forum');
+
+
+ if( in_array($tema_id,$this->noindextemak) )
+ $data["noindex"] = true;
+
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ if( !is_numeric($this->uri->segment(4)) )
+ $oldal = $this->phpsession->get('oldal');
+ else{
+ $oldal = $this->uri->segment(4);
+ $this->phpsession->save('oldal',$oldal);
+ }
+ $hszek = $this->mforum->get_lista($tema_id,$oldal);
+ foreach( $hszek as $hsz){
+ if( !($hsz->valasz == "0" || $hsz->valasz == "NULL") ){
+ $vszid = $hsz->valasz;
+ $elozo = $this->mforum->get_hsz($vszid);
+ if( $elozo->user == "" )
+ $elozo = $this->mforum->get_hsz2($vszid);
+ if( isset($elozo->user) && $elozo->user != "0" && $elozo->user != "" ){
+ $hsz->valasz = $elozo->user . ", (" . $elozo->datum . ")";
+ if( $elozo->user == 586 )
+ $hsz->valasz = "Németh Kálmán, (" . $elozo->datum . ")";
+ elseif( $elozo->user == 270 )
+ $hsz->valasz = "Tóth M.Levente, Mészáros Marcel, (" . $elozo->datum . ")";
+ }
+ elseif( $elozo )
+ $hsz->valasz = "[Törölt felhasználó], (" . $elozo->datum . ")";
+ else
+ $hsz->valasz = "-";
+ }
+ //if(!eng()) $hsz->szoveg = $this->csere2($hsz->szoveg);
+ if( strtotime($hsz->datum) < 1282039000) $hsz->szoveg = $this->csere2($hsz->szoveg);
+
+ if( $hsz->user_id == 586 ){
+ $hsz->user = "Németh Kálmán";
+ }elseif( $hsz->user_id == 270 ){
+ $hsz->user = "Tóth M.Levente, Mészáros Marcel";
+ }
+ }
+
+ if( !$hszek ){
+ $data['infok'] = array("2");
+ }else{
+ if( $this->mforum->vanmegoldal($tema_id,$this->phpsession->get('oldal')))
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('oldal') > 0 )
+ $data['elozo'] = true;
+ }
+
+ $data['hszek_json'] = json_encode($hszek);
+
+ $user = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($user['name']) )
+ $data['szerk']=true;
+ $data['temacim'] = $this->mforum->get_cim($tema_id)->cim;
+ $temakor_id = $this->mforum->get_tema1($tema_id)->temakor_id;
+ $data['temakorcim'] = $this->mforum->get_temakor1($temakor_id)->cim;
+ $data['temakorid'] = $temakor_id;
+ $data['tema_id'] = $tema_id;
+ $data['oldalak_szama'] = (int)$this->mforum->get_temaoldal($tema_id);
+ $data['akt_oldal'] = $oldal;
+
+ $data['hozzaszolasok'] = $hszek;
+
+ $data['meta']['keyw'] = $data['temacim'].', ';
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['title'] .= ' - ' . $data['temacim'];
+ $data['meta']['desc'] = hun() ? "ARCHLine.XP fórum, ".$data['temakorcim']." > ".$data['temacim']." téma hozzászólásai, ".($oldal+1).". oldal" : "ARCHLine.XP forum, posts of ".$data['temacim']." topic, ".($oldal+1).". page";
+
+ $data['aktmenu'] = "1";
+ $data['style'] = array('jquery.ui','fancybox2');
+ $data['javascript'] = array('../editor/fckeditor','jquery_ui'/*,'fancybox/jquery-1.3.2.min','fancybox/jquery.easing.1.3'*/,'fancybox/jquery.fancybox-1.2.1.pack','fancybox/fancy');
+ $this->load->view('site_forum',$data);
+ }
+
+ }
+
+ function kovetkezo(){
+ $oldalszam = $this->phpsession->get('oldal');
+ if( $this->mforum->vanmegoldal($this->phpsession->get('temaid'),$oldalszam)){
+ $oldalszam++;
+ }
+ $this->phpsession->save('oldal',$oldalszam);
+ }
+
+ function elozo(){
+ $oldalszam = $this->phpsession->get('oldal');
+ if( $oldalszam > 0 )
+ $oldalszam--;
+ $this->phpsession->save('oldal',$oldalszam);
+ }
+
+ 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 login(){
+ $name = $this->input->post('name');
+ $passwd = $this->input->post('passwd');
+
+ $name = mysql_escape_string($name);//$this->csere($name);
+
+ if(!$passwd || !$name)
+ {
+ $this->belephiba(9);
+ }
+ else
+ {
+ $name2 = $this->ekezet($name);
+ $vanaktiv = $this->mforum->vanaktivprog($name);
+
+ if( ($this->mforum->belep($name,$passwd) || $this->mforum->belep($name2,$passwd))
+ && $vanaktiv )
+ {
+ $uid = $this->mforum->get_userid($name);
+ if( !$uid || !is_numeric($uid) ){
+ $this->belephiba(6);
+ }else{
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$name;
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+ $fuser['rang'] = $this->mforum->get_rang($uid);
+ $rang = $fuser['rang'];
+ }
+
+
+
+
+ // ha csak feltolto
+ if( $rang != "user" && $rang != "moderator" ){
+ $fuser['user_id'] = $uid;
+
+ // webrenderbe is beléptetni
+ $sessid=md5($name.time());
+ $hash=md5($name . $this->pw . $sessid);
+ setcookie("sessid",$sessid,time()+$this->ervenydesseg,"/");
+ setcookie("azonosito", $name, time()+$this->ervenydesseg,"/");
+ setcookie("hash",$hash,time()+$this->ervenydesseg,"/");
+
+ $this->phpsession->save('feltolto',$fuser);
+ $this->belephiba(8);
+ }
+ //ha még nem fogadta el a szabályzatot:
+ elseif( !($this->mforum->szabalyzat($uid) ) ){
+ if(hun())
+ $lap = $this->mpages->get_row(454);
+ else
+ $lap = $this->mpages->get_row(559);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum szabályzat' : $data['title'] = 'ARCHLine.XP Forum Rules';
+ $data['tartalom'] = '/forum/szabalyzat';
+ $data['lap'] = $lap;
+ //$user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($name))
+ $data['moderator']=true;
+
+ //ha még nem fogadta el a szabályzatot:
+ if( !($this->mforum->szabalyzat($uid) ) ){
+ $data['uid'] = $uid;
+ $data['login'] = $name2;
+ $data['pw'] = md5($passwd);
+ $data['nemelfogad'] = true;
+ $data['infok'] = array("0");
+ }
+
+ $this->load->view('site_forum',$data);
+ }
+ else{
+ $fuser['user_id'] = $uid;
+ $this->phpsession->save('fuser',$fuser);
+
+
+ // webrenderbe is beléptetni
+ $sessid=md5($name.time());
+ $hash=md5($name . $this->pw . $sessid);
+ setcookie("sessid",$sessid,time()+$this->ervenydesseg,"/");
+ setcookie("azonosito", $name, time()+$this->ervenydesseg,"/");
+ setcookie("hash",$hash,time()+$this->ervenydesseg,"/");
+
+ redirect('forum');
+ }
+ }else{
+ if( $name == "moderator" ){
+ $szam = date(W);
+ $this->mforum->jelszovaltmod($szam);
+ if( $this->mforum->belep($name,$passwd) ){
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$name;
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+ $uid = $this->mforum->get_userid($name);
+ $fuser['user_id'] = $uid;
+ $this->phpsession->save('fuser',$fuser);
+ redirect('forum');
+ }
+ }
+
+ if( !$vanaktiv )
+ $this->belephiba(7);
+ else{
+ $this->belephiba(6);
+ }
+ }
+ }
+ }
+
+ function belephiba($szoveg){
+ $data['tartalom']='forum/temakorok';
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['csik']=array('home','forum');
+
+ if( !is_numeric($szoveg) ){
+ $data['error'] = $szoveg;
+ }
+ else{
+ $data['error'] = array($szoveg);
+ }
+
+ $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;
+ $tema->rov_cim = $tema->cim;
+
+ /*if(strlen($tema->cim) > 26){
+ $ut26 = array($cim[26]);
+ $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")
+ $tema->utolsouser = $this->mforum->get_userUid($xx->user)->nev;
+ 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'] = 1;
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function logout(){
+ unset($_SESSION['default']['fuser']);
+ unset($_SESSION['default']['feltolto']);
+ redirect('forum');
+ }
+
+ function szerkeszt(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->uri->segment(3) != "")
+ $hszid = $this->uri->segment(3);
+ else
+ //$hszid = $this->phpsession->get('hszid');
+ $hszid = $this->input->post('hszid');
+
+ if( $this->mforum->moderator($tomb['name']) || $this->mforum->get_sajathsz($tomb['user_id'], $hszid) ){
+ if($this->input->post('szerk')!=false){
+ //$hszid = $this->phpsession->get('hszid');
+ $hszid = $this->input->post('hszid');
+ $this->mforum->hszszerk($this->input->post('hsz'),$hszid);
+ $user_id = $this->mforum->get_hsz($hszid)->user_id;
+
+ if( $this->input->post('kepki')=='on' ){
+ if(hun())
+ $kep = $this->kepek_utvonal . $user_id ."/". $this->mforum->get_Kep($hszid)->kep;
+ elseif(eng())
+ $kep = $this->kepek_utvonal_eng . $user_id ."/". $this->mforum->get_Kep($hszid)->kep;
+
+ chmod($kep, 777);
+ unlink($kep);
+ $this->mforum->kepki($hszid);
+ }
+
+ $temaid = $this->phpsession->get('tema_id');
+ header("Location: listaz/$temaid");
+ }else if( $this->uri->segment(3) != "" ){
+ $this->phpsession->save('hszid',$this->uri->segment(3));
+
+ $data['szoveg']=$this->mforum->get_Text($this->phpsession->get('hszid'))->szoveg;
+ $kep = $this->mforum->get_Kep($this->phpsession->get('hszid'))->kep;
+ if( $kep != "" && $kep != "NULL" ){
+ $user_id = $this->mforum->get_hsz($this->phpsession->get('hszid'))->user_id;
+ if(hun())
+ $data['kep'] = "/".$this->kepek_utvonal. $user_id . "/".$kep;
+ elseif(eng())
+ $data['kep'] = "/".$this->kepek_utvonal_eng. $user_id . "/".$kep;
+ }
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['javascript'] = array('../editor/fckeditor');
+ $data['tartalom']='forum/szerkeszt';
+ $data['csik']=array('home','forum');
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function torles(){
+ $tomb = $this->phpsession->get('fuser');
+ $hszid = $this->uri->segment(3);
+ if( $this->mforum->moderator($tomb['name']) || $this->mforum->get_sajathsz($tomb['user_id'], $hszid) ){
+ if( $this->uri->segment(3) != "" ){
+ $hszid = $this->uri->segment(3);
+ $uid = $this->mforum->torol($hszid);
+
+ //ha nincs kep a mappajaban:
+ if(hun())
+ $mappa = $this->kepek_utvonal . $uid;
+ elseif(eng())
+ $mappa = $this->kepek_utvonal_eng . $uid;
+
+ $handle = opendir($mappa);
+ //ha nincs fajl a konyvtarban, akkor toroljuk a mappat
+ chmod($mappa,0777);
+ $fajl = readdir($handle);
+ $fajl = readdir($handle);
+ $fajl = readdir($handle);
+ if(!($fajl)){
+ //closedir($mappa);
+ rmdir($mappa);
+ }
+
+ $tema_id = $this->phpsession->get('temaid');
+ if( is_int($this->mforum->get_temaoldal($tema_id)) && ($this->phpsession->get('oldal') == $this->mforum->get_temaoldal($tema_id)) ){
+ $this->elozo();
+ }
+ redirect('forum/listaz');
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tatnevez(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" && ($this->input->post('atnevez')==false) ){
+ $tid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='forum/temaatnevez';
+ $data['csik']=array('home','forum');
+ $data['tema_id'] = $tid;
+ $data['temacim'] = $this->mforum->get_cim($tid)->cim;
+ $data['moderator'] = true;
+
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('atnevez')!=false){
+ $this->mforum->tatnevez($this->input->post('tid'),$this->input->post('ujnev'));
+
+ header("Location: index");
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tkatnevez(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" && ($this->input->post('atnevez')==false) ){
+ $tid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='forum/tkatnevez';
+ $data['csik']=array('home','forum');
+ $data['tema_id'] = $tid;
+ $data['temacim'] = $this->mforum->get_tkcim($tid)->cim;
+ $data['moderator'] = true;
+
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('atnevez')!=false){
+ $this->mforum->tkatnevez($this->input->post('tid'),$this->input->post('ujnev'));
+
+ header("Location: index");
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tematorol(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $tomb && $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" ){
+ $tid = $this->uri->segment(3);
+ $this->mforum->tematorol($tid);
+
+ redirect('forum');
+ }else{
+ redirect('forum');
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function temakortorol(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $tomb && $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" ){
+ $tid = $this->uri->segment(3);
+ $this->mforum->temakortorol($tid);
+
+ redirect('forum');
+ }else{
+ redirect('forum');
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function mypost(){
+ $this->phpsession->save('valasz',false);
+
+ $data['tartalom']='forum/mypost';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('forum');
+ $data['style'] = array('forum_2011');
+ $user = $this->phpsession->get('fuser');
+
+ if(!$user)
+ redirect('forum');
+
+ $hszek = $this->mforum->get_mypost($user['user_id']);
+ foreach( $hszek as $hsz){
+ $elo = $hsz->valasz;
+ $hsz->valasz = $this->mforum->get_valaszok($hsz->hsz_id);
+ $hsz->valaszdb = count($hsz->valasz);
+ $hsz->elozo = $this->mforum->get_hsz($elo);
+ $tema = $this->mforum->get_tema1($hsz->tema_id);
+ $hsz->tema = $this->mforum->get_tema1($hsz->tema_id);
+ $temakor = $this->mforum->get_temakor1($tema->temakor_id);
+ $hsz->temakor = $temakor->cim;
+
+ //print_r($hsz->elozo);
+ }
+
+ $data['hozzaszolasok'] = $hszek;
+ $data['hszdb'] = count($hszek);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+
+ $this->load->view('site_forum',$data);
+ }
+
+
+ function myuser(){
+ $user = $this->phpsession->get('fuser');
+
+ if(!$user)
+ $user = $this->phpsession->get('feltolto');
+
+ if($user){
+ /*$tomb = $this->phpsession->get('fuser');*/
+ $login = $user['name'];
+ $this->user($login);
+ }else
+ redirect('forum');
+ }
+
+ function user($login){
+ if(!$login)
+ redirect('forum');
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='forum/user';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['user']=$login;
+ $data['adatok'] = $this->mforum->get_user($login);
+ $szemadatok = $this->mforum->get_user_szem($login);
+ $emailek = $szemadatok[0]->email;
+ $emailek = explode(";",$emailek);
+ $szemadatok[0]->email = "";
+ foreach( $emailek as $email ){
+ $szemadatok[0]->email .= $email . "
";
+ }
+ $van = $szemadatok[0]->nev;
+ if($van)
+ $data['szemadatok'] = $szemadatok;
+ else
+ $data['szemadatok'] = $this->mforum->get_user_alap($login);
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+
+ $kulcsok[$key_kulcs]->programok = $programs;
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }
+
+ function users(){
+ $user = $this->phpsession->get('fuser');
+
+ if( $user && $this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+ $this->phpsession->save('belep',"");
+
+ if( !($this->phpsession->get('uoldal')) ){
+ $this->phpsession->save('uoldal',0);
+ $oldal = 0;
+ }else{
+ $oldal = $this->phpsession->get('uoldal');
+ }
+
+ if( $this->uri->segment(3) == "kov" ){
+ $oldal++;
+ $this->phpsession->save('uoldal',$oldal);
+ }else if( $this->uri->segment(3) == "elozo" && $oldal > 0 ){
+ $oldal--;
+ $this->phpsession->save('uoldal',$oldal);
+ }
+ else if( is_numeric($this->uri->segment(3))){
+ $oldal = $this->uri->segment(3);
+ $this->phpsession->save('uoldal',$oldal);
+ }
+
+ if( $this->uri->segment(3) == "rendez" ){
+ $ord = $this->uri->segment(4);
+
+
+ $vissza = $this->phpsession->get('rendezvissza');
+ if($this->phpsession->get('rendez') == $ord){
+ $vissza = !$vissza;
+ }
+ $this->phpsession->save('rendezvissza',$vissza);
+
+
+ $this->phpsession->save('rendez',$ord);
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ }else if( $this->phpsession->get('rendez') ){
+ $ord = $this->phpsession->get('rendez');
+ $vissza = $this->phpsession->get('rendezvissza');
+ }else{
+ $ord = "nev";
+ $vissza = false;
+ }
+
+ $data['users']=$this->mforum->get_users($oldal,$ord,$vissza);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ukeres(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+ if( !($this->phpsession->get('ukoldal')) ){
+ $this->phpsession->save('ukoldal',0);
+ $oldal = 0;
+ }else{
+ $oldal = $this->phpsession->get('ukoldal');
+ }
+
+ if( is_numeric($this->uri->segment(3))){
+ $oldal = $this->uri->segment(3);
+ $this->phpsession->save('ukoldal',$oldal);
+ }
+
+ if( $this->uri->segment(3) == "rendez" ){
+ $ord = $this->uri->segment(4);
+
+ $vissza = $this->phpsession->get('rendezvissza');
+ if($this->phpsession->get('rendez') == $ord){
+ $vissza = !$vissza;
+ }
+ $this->phpsession->save('rendezvissza',$vissza);
+
+ $this->phpsession->save('rendez',$ord);
+ $oldal = 0;
+ $this->phpsession->save('ukoldal',0);
+ }else if( $this->phpsession->get('rendez') ){
+ $ord = $this->phpsession->get('rendez');
+ $vissza = $this->phpsession->get('rendezvissza');
+ }else{
+ $ord = "nev";
+ $vissza = false;
+ }
+
+ if( $this->input->post('klogin') || $this->input->post('knev') || $this->input->post('kemail') || $this->input->post('kulcssz') || ($this->input->post('belep') != -1 && $this->input->post('belep') != "" ) ){
+ $oldal = 0;
+ $this->phpsession->save('ukoldal',$oldal);
+ $klog = $this->input->post('klogin');
+ $this->phpsession->save('klogin',$this->input->post('klogin'));
+ $knev = $this->input->post('knev');
+ $this->phpsession->save('knev',$knev);
+ $kmail = $this->input->post('kemail');
+ $this->phpsession->save('kemail',$this->input->post('kemail'));
+ $kulcs = $this->input->post('kulcssz');
+ $this->phpsession->save('kulcssz',$this->input->post('kulcssz'));
+ $belep = $this->input->post('belep');
+ $this->phpsession->save('belep',$this->input->post('belep'));
+ }else{
+ $klog = $this->phpsession->get('klogin');
+ $knev = $this->phpsession->get('knev');
+ $kmail = $this->phpsession->get('kemail');
+ $kulcs = $this->phpsession->get('kulcssz');
+ $belep = $this->phpsession->get('belep');
+ }
+
+ if(UJUGYFELKEZELO===true)
+ $users = $this->mforum->get_kusersujcrm($oldal,$klog,$knev,$kmail,$belep,$kulcs,$ord,$vissza);
+ else
+ $users = $this->mforum->get_kusers($oldal,$klog,$knev,$kmail,$belep,$kulcs,$ord,$vissza);
+ $data['users'] = $users;
+
+ if(UJUGYFELKEZELO===true){
+ if( $this->mforum->vanmegkuserujcrm($this->phpsession->get('ukoldal'),$klog,$knev,$kmail,$belep,$kulcs) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('ukoldal') > 0 )
+ $data['elozo'] = true;
+ }
+ else{
+ if( $this->mforum->vanmegkuser($this->phpsession->get('ukoldal'),$klog,$knev,$kmail,$belep,$kulcs) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('ukoldal') > 0 )
+ $data['elozo'] = true;
+ }
+
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_kusersdb($klog,$knev,$kmail,$belep,$kulcs);
+ $data['akt_oldal'] = $oldal;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function edit_user(){
+ $user = $this->phpsession->get('fuser');
+ if($user && $this->mforum->moderator($user['name'])){
+ if( $this->uri->segment(3) != "" && ($this->input->post('edituser')==false) ){
+ $uid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználó szerkesztése' : $data['title'] = 'ARCHLine.XP Forum Edit User';
+ $data['tartalom']='forum/edit_user';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+ $login = $this->mforum->get_login($uid);
+ $data['adatok'] = $this->mforum->get_user($login);
+
+ $szemadatok = $this->mforum->get_user_szem($login);
+
+ if($szemadatok[0])
+ $data['szemadat'] = $szemadatok[0];
+ else{
+ $cucc = $this->mforum->get_user_alap($login);
+ $data['szemadat'] = $cucc[0];
+ }
+
+ //$data['kulcsok'] = $this->mforum->get_user_kulcsok($login);
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+
+ $i=0;
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $i++;
+
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+
+ $kulcsok[$key_kulcs]->programok = $programs;
+
+
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('edituser')!=false){
+
+ $error = "";
+ $langerror = array();
+ if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') != $this->input->post('jelszo2') ){
+ $error .= "A megadott két jelszó nem egyezik.
";
+ array_push($langerror,0);
+ }else if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') == $this->input->post('jelszo2') && strlen($this->input->post('jelszo1') ) < 5 ){
+ $error .= "A megadott jelszó 5 karakternél rövidebb.
";
+ array_push($langerror,1);
+ }
+
+ $user = $tomb['name'];
+ //$myid = $this->mforum->get_userid($user);
+
+ if( $this->input->post('login') == "" ){
+ $error .= "A login mező értéke nem lehet üres.
";
+ array_push($langerror,4);
+ }
+
+ if( $this->input->post('login') != "" && !$this->mforum->szabadlogin($this->input->post('login'),$this->input->post('uid')) ){
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+ array_push($langerror,2);
+ }
+ elseif( strlen($this->input->post('login') ) < 5 ){
+ $error .= "A megadott login 5 karakternél rövidebb.
";
+ array_push($langerror,3);
+ }
+
+ if( $this->input->post('login') != $this->ekezet($this->input->post('login')) ){
+ $error .= "A felhasználó névben nem szerepelhet ékezet vagy szóköz!
";
+ array_push($langerror,5);
+ }
+
+
+ $uid = $this->input->post('uid');
+
+ if( !$error ){
+ // frissítés
+ $mod['nev'] = $this->input->post('nev');
+ $mod['login'] = $this->input->post('login');
+ $mod['rang'] = $this->input->post('rang');
+ if($this->input->post('jelszo1') != "")
+ $mod['jelszo'] = md5($this->input->post('jelszo1'));
+ $mod['viewsub'] = ($this->input->post('viewsub') == "on") ? 1 : 0;
+
+ $this->db->update('forum_user',$mod,"user_id={$uid}");
+ //$this->mforum->set_user($this->input->post('uid'),$this->input->post('nev'),$this->input->post('email'),$this->input->post('jelszo1'),$this->input->post('login'),$this->input->post('rang'));
+
+ redirect("forum/users");
+ }else{
+
+
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználó szerkesztése' : $data['title'] = 'ARCHLine.XP Forum Edit User';
+ $data['tartalom']='forum/edit_user';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+
+ $login = $this->mforum->get_login($uid);
+ $data['adatok'] = $this->mforum->get_user($login);
+
+ $szemadatok = $this->mforum->get_user_szem($login);
+
+ if($szemadatok[0])
+ $data['szemadat'] = $szemadatok[0];
+ else{
+ $cucc = $this->mforum->get_user_alap($login);
+ $data['szemadat'] = $cucc[0];
+ }
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+
+ $i=0;
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $i++;
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+ $kulcsok[$key_kulcs]->programok = $programs;
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+ $data['error'] = $error;
+ $data['hibak2'] = $langerror;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+
+ print " ";
+ }
+
+ $ezt = "edit_user/".$uid;
+ header("Location: ".$ezt);
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujuser(){
+ $user = $this->phpsession->get('fuser');
+ if($user && $this->mforum->moderator($user['name'])){
+ if($this->input->post('do')!=false){
+ $login = $this->input->post('login');
+ $nev = $this->input->post('nev');
+ $jsz1 = $this->input->post('jelszo1');
+ $jsz2 = $this->input->post('jelszo2');
+ $email = $this->input->post('email');
+ $kulcs = $this->input->post('kulcs');
+ $rang = $this->input->post('rang');
+
+ if($kulcs)
+ $nUserID = $this->mforum->get_nUserID($kulcs);
+ else
+ $nUserID = "NULL";
+
+ $error = "";
+ $langerror = array();
+
+ if( $login == "" )
+ $error .= "Nincs login megadva.
";
+
+ if( $login != $this->ekezet($login) )
+ $error .= "A felhasználó névben nem lehet ékezet vagy szóköz.
";
+ elseif( !$this->mforum->szabadlogin($login,10000) )
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+
+ if( $jsz1 == "" || $jsz2 == "" || $jsz1 != $jsz2 )
+ $error .= "A két jelszó nem egyezik vagy nincsenek megadva.
";
+
+ if( $this->mforum->is_email($email) )
+ $error .= "A megadott e-mail-cím már szerepel az adatbázisban.
";
+
+ if(!$error){
+ $this->mforum->ujuser($login,$nev,$jsz1,$email,$nUserID,$rang);
+
+ redirect('forum/users');
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új felhasználó' : $data['title'] = 'ARCHLine.XP Forum new user';
+ $data['tartalom']='forum/ujuser';
+ $data['csik']=array('home','forum');
+ $data['error2'] = $error;
+ $data['moderator']=true;
+ $data['javascript']=array('forum');
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }
+
+ }else{
+ $data['title'] = 'ARCHLine.XP Fórum új felhasználó';
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Új Felhasználó' : $data['title'] = 'ARCHLine.XP Forum New User';
+ $data['tartalom']='forum/ujuser';
+ $data['csik']=array('home','forum');
+ $data['javascript']=array('forum');
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function del_user(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ $id = $this->uri->segment(3);
+ $this->mforum->del_user($this->uri->segment(3));
+ redirect("forum/users");
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujuserdb(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+
+
+
+
+ $this->access_id = 36;
+
+ $this->load->model('mpartners');
+ $this->keydb = $this->load->database('clusers',true);
+ $search = false;//$this->input->post('search');
+
+ $from = 0;
+ $to = 999999;
+ $limit = 2000;
+
+ $this->keydb->query("SET NAMES utf8");
+ $result = $this->keydb->from('cl_fo_hardlock')->join('cl_users','cl_fo_hardlock.hlUser=cl_users.nUserID','left')->orderby('hlNum','desc')->where("hlCtrID ='".$this->access_id."'")->where('hlStat',1)->where("hlNum >= '".$from."' AND hlNum <= '".$to."'")->limit(99999)->get();
+
+ //$sorok = $result->result();
+
+
+
+
+
+ $query = $this->keydb->from('cl_fo_hardlock')->join('cl_users','cl_fo_hardlock.hlUser=cl_users.nUserID','left')->join('cl_users_emails','cl_users.nUserID=cl_users_emails.nUserID','left')->orderby('hlNum','desc')->where("hlCtrID ='".$this->access_id."'")->where('hlStat',1)->where('default',1)->where("hlNum >= '".$from."' AND hlNum <= '".$to."'")->limit(99999)->get();
+ $sorok = $query->result();
+
+
+ //$this->keydb->query("SET NAMES latin2");
+
+
+
+
+ if($result->num_rows()==0)
+ {
+ $data['sorok'] = false;
+ }
+ else
+ {
+ $data['sorok'] = $sorok;
+ $data['found'] = $result->num_rows();
+ }
+
+ $sorok2 = $sorok;
+ $i = 0;
+ $j = 0;
+ $db = 0;
+ foreach($sorok2 as $sor){
+ $mailek = $sor->email;
+ $mailek = explode(";",$mailek);
+
+ foreach( $mailek as $mail ){
+ $mail = trim($mail);
+
+ //megnezzuk hogy benne van-e az adatbázisban és aktív-e
+ if( $mail != "" && $sor->hlStat == 1 && !$this->mforum->is_email(strtolower($mail)) ){
+ $mailresz = explode('@',$mail);
+ $login = $mail;
+ $nev = $sor->strName;
+ $nev = trim($nev);
+ $jsz1 = $mailresz[0];
+ $nUserID = $sor->nUserID;
+ $rang = "user";
+
+ // eladási dátum 0000-00-00 -e
+ $datum = $this->keydb->from('cl_fo_programs')->where("prHlNum",$sor->hlNum)->select('prSellDate')->get()->row();
+ if($datum->prSellDate != '0000-00-00'){
+ $this->mforum->ujuser($login,$nev,$jsz1,strtolower($mail),$nUserID,$rang);
+ $db++;
+ $kik[$j]->Nev = $nev;
+ $kik[$j]->Login = $login;
+ $kik[$j]->Email = $mail;
+ $kik[$j]->Datum = $datum->prSellDate;
+ }
+ $j++;
+ }
+ }
+ $i++;
+ }
+ $data['darab'] = $db;
+ $data['kik'] = $kik;
+
+
+
+ $data['sorok2'] = $sorok2;
+
+
+
+
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $this->load->view('site_forum',$data);
+ }else
+ redirect('forum');
+ }
+
+ function listVMData()
+ {
+ $azureVMID = $this->uri->segment(3);
+ $txt = "SELECT * FROM cl_hlusers.AzureVM WHERE VMID = '".$azureVMID."'";
+ $vm = $this->db->query($txt)->result();
+ if( count($vm) != 1 )
+ return false;
+
+ $vmGrp = $this->db->query("SELECT * FROM cl_hlusers.AzureGroups WHERE ID = '".$vm[0]->GROUPID."'")->result();
+ if( count($vmGrp) != 1 )
+ return false;
+
+ $data['tartalom']='forum/azurevm';
+ //$data['csik']=array('home','forum');
+ $data['vm'] = $vm;
+ $data['vmGrp'] = $vmGrp;
+ $data['azureVMID'] = $azureVMID;
+ $this->load->view('site_simple',$data);
+ }
+
+ function myStart(){
+ //$output = array();
+ //exec("pwd", $output);
+ //$res = shell_exec("azure");
+ //exec("azure vm list > /home/hosting/cadline.hu/battila/www.cadline.hu/teszt.out");
+
+
+ chdir('/var/tmp');
+ $command = "/usr/bin/azure account import /var/www/hosting/cadline.hu/www/public/downloads/cadlineazurecertificate.publishsettings";
+ #$command = "pwd";
+ $ph = popen( $command, "r" )
+ or die( "Hiba" );
+ while(!feof($fp))
+ {
+ // send the current file part to the browser
+ print fread($fp, 1024);
+ // flush the content to the browser
+ flush();
+ }
+ pclose($fp);
+ //$kamu = fgets( $ph, 20490 );
+ //print "Output: ".$kamu;
+ //pclose( $ph );
+ //print $res;
+ }
+
+ function myedit(){
+ $tomb = $this->phpsession->get('fuser');
+
+ if(!$tomb) $tomb = $this->phpsession->get('feltolto');
+
+ if( $tomb ){
+ if($this->input->post('mysave')!=false){
+
+ $error = "";
+ $langerror = array();
+ if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') != $this->input->post('jelszo2') ){
+ $error .= "A megadott két jelszó nem egyezik.
";
+ array_push($langerror,0);
+ }else if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') == $this->input->post('jelszo2') && strlen($this->input->post('jelszo1') ) < 5 ){
+ $error .= "A megadott jelszó 5 karakternél rövidebb.
";
+ array_push($langerror,1);
+ }
+
+ $user = $tomb['name'];
+ $myid = $this->mforum->get_userid($user);
+
+ if( $this->input->post('login') == "" ){
+ $error .= "A login mező értéke nem lehet üres.
";
+ array_push($langerror,4);
+ }
+
+ if( $this->input->post('login') != "" && !$this->mforum->szabadlogin($this->input->post('login'),$myid) ){
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+ array_push($langerror,2);
+ }
+ elseif( strlen($this->input->post('login') ) < 5 ){
+ $error .= "A megadott login 5 karakternél rövidebb.
";
+ array_push($langerror,3);
+ }
+
+ if( $this->input->post('login') != $this->ekezet($this->input->post('login')) ){
+ $error .= "A felhasználó névben nem szerepelhet ékezet vagy szóköz!
";
+ array_push($langerror,5);
+ }
+
+
+ $ertesitesek = $this->input->post('temak');
+ if(count($ertesitesek) == 0 || (count($ertesitesek) == 1 && $ertesitesek[0] == "") )
+ $ertesit = NULL;
+ elseif( count($ertesitesek) == count($this->mforum->get_temak()) )
+ $ertesit = "mind";
+ else
+ $ertesit = ";".implode(";", $ertesitesek).";";
+
+
+ if($error){
+ hun() ? $data['title'] = 'ARCHLine.XP Adatok változtatása' : $data['title'] = 'ARCHLine.XP Edit Data';
+ $data['tartalom']='forum/myedit';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+ $data['error2'] = $error;
+ $data['hibak2'] = $langerror;
+
+ $user = $tomb['name'];
+ $user_id = $this->mforum->get_userid($user);
+ $data['user_id'] = $user_id;
+ $data['cucc'] = $this->mforum->get_user_alap($user);
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }else{
+ $plogin = $this->input->post('login');
+ $pnev = $this->input->post('nev');
+ $pjelszo = $this->input->post('jelszo1');
+
+ $this->mforum->myedit($plogin, $pnev, $pjelszo, $myid, $ertesit);
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['t_nev'] = $this->mforum->get_nev($plogin);
+ $fuser['name'] = $this->input->post('login');
+ $this->phpsession->save('fuser',$fuser);
+ $this->myuser();
+ }
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Adatok változtatása' : $data['title'] = 'ARCHLine.XP Edit Data';
+ $data['tartalom']='forum/myedit';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ if(hun())
+ $nyelv = "hun";
+ else
+ $nyelv = "eng";
+
+ $user = $tomb['name'];
+ $user_id = $this->mforum->get_userid($user);
+ $data['user_id'] = $user_id;
+ $data['temak'] = $this->mforum->get_temak($nyelv);
+ $data['cucc'] = $this->mforum->get_user_alap($user);
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujjelszo(){
+ if($this->input->post('kuld')!=false){
+ $email = $this->input->post('email');
+ if(hun()) $uzenet = "A megadott e-mail-cím: " . $email;
+ //$uzenet = $email;
+
+ $ujjelszo = $this->mforum->ujjelszo($email);
+
+ if($ujjelszo){
+
+ $this->load->library('email');
+ $this->load->helper('email');
+ $this->email->initialize();
+ $this->email->addOfficialImages();
+
+ $mailnek->ujjsz = $ujjelszo;
+ $mailnek->login = $this->mforum->get_login2($email);
+
+
+ /* Akarmilyem mailcimet is adott meg, a default emailre kuldjuk a levelet */
+ $email2 = $this->mforum->default_mail($email);
+ if($email2 != "")
+ $email = $email2;
+
+
+ $this->email->from('info@cadline.hu', 'Cadline Weboldal');
+ if(hun())
+ $this->email->subject('Uj jelszo');
+ else
+ $this->email->subject('New Password');
+ $this->email->message($this->load->view('mail_ujjelszo',$mailnek,true));
+ $this->email->send($email,'smtp');
+
+ if(hun())
+ $uzenet = $email." -ra kiküldtük az Ön új jelszavát.
";
+ else
+ $uzenet = "New password sent to ".$email;
+
+ }else{
+ if(hun()) $uzenet .= " nincs a felhasználók között.
";
+ else $uzenet = "E-mail error: ".$email;
+ }
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új jelszó' : $data['title'] = 'ARCHLine.XP Forum new password';
+
+ $data['uzenet']=$uzenet;
+ $this->phpsession->save('fuzenet',$uzenet);
+
+ if( isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'],'/collection/') ){
+ $data['tartalom']='collection/ujjelszo_valasz';
+ $data['style'] = array('temp/style_new');
+ $this->load->view('site_upload',$data);
+ }
+ else{
+ /*$data['tartalom']='forum/temakorok';
+ $data['csik']=array('home','forum');
+ $this->load->view('site_forum',$data);*/
+ redirect('forum');
+ }
+
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új jelszó' : $data['title'] = 'ARCHLine.XP Forum new password';
+
+ $data['tartalom']='forum/ujjelszo';
+ $data['csik']=array('home','forum');
+
+ if( isset($_SERVER['HTTP_REFERER']) && (strstr($_SERVER['HTTP_REFERER'],'collection/upload') || strstr($_SERVER['HTTP_REFERER'],'collection/submit')) ){
+ $data['style'] = array('temp/style_new');
+ $this->load->view('site_upload',$data);
+ }
+ else{
+ $this->load->view('site_new',$data);
+ }
+ }
+ }
+
+ function szabalyzat(){
+ if(hun())
+ $lap = $this->mpages->get_row(454);
+ else
+ $lap = $this->mpages->get_row(559);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum szabályzat' : $data['title'] = 'ARCHLine.XP Forum Rules';
+ $data['tartalom'] = '/forum/szabalyzat';
+ $data['lap'] = $lap;
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $uid = $this->mforum->get_userid($user['name']);
+ //ha még nem fogadta el a szabályzatot:
+ if( !($this->mforum->szabalyzat($uid) ) ){
+ $data['uid'] = $uid;
+ $data['nemelfogad'] = true;
+ }
+
+ $data['aktmenu'] = "2";
+ $this->load->view('site_forum',$data);
+ }
+
+ function elfogad(){
+ if($this->input->post('el')=="igen"){
+ $this->load->model('mclusers');
+
+ $uid = $this->input->post('uid');
+ $name = $this->input->post('fnev');
+ $passwd = $this->input->post('jelszo');
+ if( $this->mforum->belep($name,$passwd,false) ){
+ $this->mforum->elfogad($uid);
+
+ $felhasznalo = $this->mforum->getrow($uid);
+ if($felhasznalo->nUserID > 0 && $felhasznalo->nyelv == "hun")
+ $this->mclusers->addEvent($felhasznalo->nUserID, 109, 'Elso bejelentkezes a forumba.', "hun");
+ elseif( $felhasznalo->nUserID > 0 && $felhasznalo->nyelv == "eng" )
+ $this->mclusers->addEvent($felhasznalo->nUserID, 148, 'Elso bejelentkezes a forumba.', "eng");
+
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$this->mforum->get_login($uid);
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+
+ $fuser['user_id'] = $uid;
+
+ $this->phpsession->save('fuser',$fuser);
+ $Date = date('Y-m-d',time());
+
+ $nUserID = $this->mforum->get_nUserID2($uid);
+ }
+
+ redirect('forum');
+
+ }else{
+ $this->logout();
+ }
+ }
+
+ function ido(){
+ die(date('Y-m-d H:i:s', time()));
+ }
+
+ function emailjavitas(){
+ $tomb = $this->phpsession->get('fuser');
+ if(!$tomb)
+ redirect('forum');
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+
+ $cl_users = $this->mforum->get_cl_users();
+
+ $db = 0;
+ $cserek = "";
+ foreach($cl_users as $user){
+ $nUserID = $user->nUserID;
+ //print $user->strName;
+ $x = $this->mforum->cseremail($nUserID);
+ if( $x ){
+ $cserek .= $x;
+ $db++;
+ }
+ }
+
+ $data['email']=$db;
+ $data['cserek']=$cserek;
+
+
+
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function ujuserdb_eng(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $sorok = $this->mforum->get_cl_users_eng();
+
+ $i = 0;
+ $j = 0;
+ $db = 0;
+ foreach($sorok as $sor){
+ $mailek = $sor->strEMail;
+ $mailek = explode(";",$mailek);
+
+ foreach( $mailek as $mail ){
+ /* csak az elso email cimet veszi fel */
+ $mail = trim($mailek[0]);
+
+
+ //megnezzuk hogy benne van-e az adatbázisban és aktív-e
+ if( $mail != "" && $sor->hlStat == 1 && !$this->mforum->is_email(strtolower($mail)) ){
+ $mailresz = explode('@',$mail);
+ $login = $mail;
+ $nev = $sor->strName;
+ $nev = trim($nev);
+ $jsz1 = $mailresz[0];
+ $nUserID = $sor->nUserID;
+ $rang = "user";
+
+
+ // eladási dátum 0000-00-00 -e
+ $datum = $this->db->from('`clusers_eng`.`cl_fo_programs`')->where("prHlNum",$sor->hlNum)->select('prSellDate')->get()->row();
+
+ $prog = $this->db->query(" SELECT * FROM `clusers_eng`.`cl_fo_programs` WHERE prHlNum = '".$sor->hlNum."'")->result();
+
+ if($datum->prSellDate != '0000-00-00' && $this->mforum->szabadlogin($login) ){
+ $this->mforum->ujuser_eng($login,$nev,$jsz1,strtolower($mail),$nUserID,$rang);
+
+ // print "
Felvenném: ".$login.$nev.$jsz1.strtolower($mail).$nUserID.$rang;
+
+ $db++;
+ $kik[$j]->Nev = $nev;
+ $kik[$j]->Login = $login;
+ $kik[$j]->Email = $mail;
+ $kik[$j]->Datum = $datum->prSellDate;
+ }
+ $j++;
+ }
+ }
+ $i++;
+ }
+ $data['darab'] = $db;
+ $data['kik'] = $kik;
+
+ $data['sorok2'] = $sorok;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function info($info){
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/kiir';
+ $data['info'] = $info;
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function galeria(){
+ $user = $this->phpsession->get('fuser');
+
+ if( is_numeric($this->uri->segment(3)) ){
+ $this->galeriamutat();
+ }elseif($user){
+ $this->sajatgaleria();
+ }else{
+ redirect("forum");
+ }
+ }
+
+ function galeriamutat(){
+ $user_id = $this->uri->segment(3);
+ $lang = $this->muser->user['lang'];
+
+ $fajlok = $this->mforum->get_galeria($user_id,$lang);
+
+ $data["fajlok"] = $fajlok;
+ if(hun())
+ $data['utvonal'] = $this->galeria_utvonal.$user_id;
+ else
+ $data['utvonal'] = $this->galeria_utvonal_eng.$user_id;
+
+ $data['tartalom'] = '/forum/galeria';
+ $data['javascript'] = array(
+ 'interior_menu',
+ 'fancybox/jquery-1.3.2.min',
+ 'fancybox/jquery.easing.1.3',
+ 'fancybox/jquery.fancybox-1.2.1.pack',
+ 'fancybox/fancy'
+ );
+
+ $data['style'] = array('fancybox');
+
+ $this->load->view('site_forum',$data);
+
+ }
+
+ function sajatgaleria(){
+ $this->load->model('mrender');
+ $user = $this->phpsession->get('fuser');
+
+ if($user){
+ hun() ? $data['title'] = 'ARCHLine.XP Saját Galéria' : $data['title'] = 'ARCHLine.XP My Gallery';
+ $data['tartalom'] = '/forum/sajatgaleria';
+
+ $uid = $user['user_id'];
+ $data['uid'] = $uid;
+
+ $data['fajlok'] = $this->mforum->fajlok($uid);
+ $data['szabad_hely'] = (200 * 1024 * 1024) - $this->foglalt_hely($uid);
+
+ // $data['renderek'] = $this->mrender->get_byuserid($uid);
+
+ $data['javascript'] = array('fancybox/jquery-1.3.2.min','fancybox/jquery.easing.1.3','fancybox/jquery.fancybox-1.2.1.pack','fancybox/fancy','jquery','jquery_ui');
+ $data['style'] = array('fancybox2','jquery.ui');
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "5";
+ $this->load->view('site_forum',$data);
+ }else
+ redirect("forum");
+ }
+
+ function foglalt_hely($user_id){
+ if(hun())
+ $fajlok = $this->galeria_utvonal.$user_id."/";
+ else
+ $fajlok = $this->galeria_utvonal_eng.$user_id."/";
+
+ $total = 0;
+
+ if( is_dir($fajlok) ){
+ $handle = opendir($fajlok);
+ while($file = readdir($handle)){
+ $total += filesize($fajlok.$file);
+ if((is_dir($fajlok.$file.'/')) &&($file != '..')&&($file != '.'))
+ {
+ $total = $total + $this->foglalt_hely($fajlok.$file.'/');
+ }
+ }
+ }
+
+ return $total;
+ }
+
+ function feltolt(){
+ $user = $this->phpsession->get('fuser');
+ $uid = $user['user_id'];
+
+ if($uid && $_FILES["fajl"]["error"]==0){
+
+ $fajl = "";
+ $meret = 0;
+
+ if(hun())
+ $hova = $this->galeria_utvonal.$uid;
+ elseif(eng())
+ $hova = $this->galeria_utvonal_eng.$uid;
+
+ if(!is_dir($hova)){
+ mkdir($hova,0644);
+ chmod($hova,0777);
+ }
+
+
+ $feltolt_konyvtar = $hova."/";
+ //ha több fájl lenne ugyanazon a néven
+ $elotag = substr(time(),-6);
+ $fajlnev = $this->ekezet($_FILES["fajl"]["name"]);
+ $feltolt_fajlnev=$feltolt_konyvtar . $elotag . "__" . $fajlnev;
+
+ $error = "";
+ $mi = $_FILES['fajl']['name']."$";
+
+ $mire = "\.exe|\.EXE|\.php|\.PHP|\.sh|\.SH";
+ if( (ereg( $mire , $mi )) ){
+ $error .= "Hibás fájl kiterjesztés
";
+ }
+ if( $_FILES['fajl']['size'] > 1024 * 1024 * 10 ){
+ $error .= "A fájl mérete nagyobb 10 MB-nál.
";
+ }
+ else if( !$error){
+ if (copy($_FILES["fajl"]["tmp_name"], $feltolt_fajlnev)){
+ $fajl = $elotag . "__". $fajlnev;
+ $meret = $_FILES["fajl"]["size"];
+ $mit = $hova."/".$fajl;
+ chmod($mit,0777);
+
+
+ // elonezeti kep elkeszitese 150x113-ban
+ include('application/helpers/myimg_helper.php');
+ kepmeretezesvagas($feltolt_fajlnev,$hova,"elo_".$fajl,"150","113");
+
+ }else{
+ $fajl = "NULL";
+ $error = "Fájl másolás hiba.
";
+ }
+ }
+
+ if( !$error ){
+ $szamla = $this->input->post('szamla');
+ $info = $this->input->post('leiras');
+ $megoszt = 1;
+
+ if( $this->input->post('megosztas') != "on" ){
+ $megoszt = 0;
+ }
+
+ $this->mforum->feltolt($uid,$fajl,$meret,$szamla,$megoszt,$info);
+
+ redirect("forum/galeria/".$uid);
+ }else{
+ $this->info($error);
+ }
+
+
+ }else{
+ if( $_FILES['fajl']['error'] != 0 )
+ $this->info("Hiba a fájl feltöltésekor!");
+ else
+ redirect("forum");
+ }
+
+ }
+
+ function delfajl(){
+ $fajl_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ $user_id = $user['user_id'];
+
+ if(!$user)
+ redirect('forum');
+
+ if( is_numeric($fajl_id) && $this->mforum->sajatfajl($fajl_id, $user_id) ){
+ $this->load->model('mrender');
+
+ $fajl = $this->mforum->delfajl($fajl_id);
+
+ if(hun())
+ $mit = "public/forum-galeria/hun/".$user_id."/elo_".$fajl;
+ else
+ $mit = "public/forum-galeria/eng/".$user_id."/elo_".$fajl;
+
+ // elonezeti kep torlese ha van
+ if( file_exists( $mit ) ){
+ chmod($mit, 777);
+ unlink($mit);
+ }
+
+ // A fájlhoz tartozó rendereknél törölni a galériás fájl id-t.
+ $renderek = $this->mrender->get_rowBygforumgalid($fajl_id);
+ if( $renderek ){
+ foreach($renderek as $render){
+ $ertek = NULL;
+ $this->db->update('render_img',array('forumgal_id'=>$ertek),"render_id='".$render->render_id."'");
+ }
+ }
+ }
+ redirect("forum/galeria");
+ }
+
+ function editgaleria(){
+ $fajl_id = $this->input->post('fajl_id');
+ // $fajl_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ $user_id = $user['user_id'];
+
+ if(!$user)
+ redirect('forum');
+
+
+ if( is_numeric($fajl_id) && $this->mforum->sajatfajl($fajl_id, $user_id) ){
+ if( $this->input->post('do') ){
+ $leiras = $this->input->post('leiras');
+ $megoszt = 1;
+
+ if( $this->input->post('megosztas') != "on" ){
+ $megoszt = 0;
+ }
+
+ $this->mforum->editgaleria($fajl_id,$leiras,$megoszt);
+
+ redirect("forum/galeria");
+
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Saját Galéria' : $data['title'] = 'ARCHLine.XP My Gallery';
+ $data['tartalom'] = '/forum/editgaleria';
+
+ $data['uid'] = $user_id;
+ $data['fajlinfo'] = $this->mforum->fajlinfo($fajl_id);
+ if(hun())
+ $data['utvonal'] = $this->galeria_utvonal;
+ else
+ $data['utvonal'] = $this->galeria_utvonal_eng;
+
+ $data['utvonal'] .= "/".$user_id;
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "5";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect("forum");
+ }
+ }
+
+ function regisztracio(){
+ if($this->input->post('do') != ""){
+ $nev = $this->input->post('regnev');
+ $login = $this->input->post('email');
+ $email = $login;
+ $jelszo = $this->input->post('jelszo1');
+
+ $szabad = $this->mforum->szabadlogin($login,999999);
+ if( $szabad ){
+ //$this->mforum->ujuser($login,$nev,$jelszo,$email,"","feltolto");
+
+
+ $kod = md5($jelszo.time().$nev);
+
+ $record['login'] = $email;
+ $record['jelszo'] = md5($jelszo);
+ $record['nev'] = $nev;
+ $record['email'] = $email;
+ $record['rang'] = "guest";
+ $record['kod'] = $kod;
+ $record['datum'] = date("Y-m-d H:i:s",time());
+ $record['nyelv'] = $this->muser->user['lang'];
+
+ $this->db->insert('forum_user_temp',$record);
+
+
+ $this->load->helper('email');
+
+ //sending the e-mail
+ $mail_vars['kod'] = $kod;
+ $mail_vars['email'] = $email;
+ $mail_vars['first'] = $nev;
+
+ //set the authenticating link
+ $mail_vars['link'] = hun() ? 'http://archline.hu/forum/confirm/' . $kod : 'http://www.archlinexp.com/forum/confirm/' . $kod;
+
+ //setting and sending the email
+ $this->load->library('email');
+ $this->email->initialize();
+ $this->email->addOfficialImages();
+
+ $this->email->setFrom('info@cadline.hu', 'CadLine');
+
+ if(hun())
+ {
+ $mail_vars['mailcontent'] = 'mail/confirm_forum_hun';
+ $this->email->subject('ARCHLine.XP regisztráció');
+ }
+ else
+ {
+ $mail_vars['mailcontent'] = 'mail/confirm_forum_eng';
+ $this->email->subject('ARCHLine.XP registration');
+ }
+
+ $this->email->message($this->load->view('mail',$mail_vars,true));
+ $this->email->send($mail_vars['email'],'smtp');
+
+ redirect('forum/sentconf');
+ }
+ else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/regisztracio';
+ $data['javascript'] = array('forum');
+ $data['style'] = array('temp/style_interior');
+ $data['foglalt'] = "igen";
+
+ $this->load->view('site_upload',$data);
+ }
+ }else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/regisztracio';
+ $data['javascript'] = array('forum');
+ $data['style'] = array('temp/style_interior');
+
+ $this->load->view('site_upload',$data);
+ }
+ }
+
+ function sentconf(){
+ $data['tartalom']='forum/sentconf';
+ $data['lang']=$this->muser->user['lang'];
+ $data['style'] = array('temp/style_new');
+
+ $this->load->view('site_upload',$data);
+ }
+
+ function confirm(){
+ $kod = $this->uri->segment(3);
+
+ $data['style'] = array('temp/style_new');
+
+ if( $this->mforum->confirm($kod) ){
+
+ /* a felhasználóhoz új eseményt felvenni, ha szerepel az adatbázisban */
+ $adatok = $this->mforum->get_userByKod($kod);
+ $nUserID = $this->mforum->get_nUserID30($adatok->email);
+ if( $nUserID ){
+ $this->load->model('mclusers');
+ $this->mclusers->addEvent($nUserID, 114, "Regisztráció");
+ }
+
+ $data['tartalom']='forum/confirm_ok';
+ $data['lang']=$this->muser->user['lang'];
+ }else{
+ $data['tartalom']='forum/confirm_hiba';
+ $data['lang']=$this->muser->user['lang'];
+ }
+
+ $this->load->view('site_upload',$data);
+ }
+
+ function belepfeltolto(){
+ if( $this->input->post("do") != "" ){
+ $login = $this->input->post("email");
+ $jelszo = $this->input->post("jelszo");
+
+ if( $this->mforum->belep($login,$jelszo) ){
+ print "ok";
+ }else
+ print "nem ok";
+
+ }else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/belepfeltolto';
+ $data['javascript'] = array('forum');
+
+ $this->load->view('site',$data);
+ }
+ }
+
+ function renderek(){
+ $this->load->model('mrender');
+ $user = $this->phpsession->get('fuser');
+ $feltolto = $this->phpsession->get('feltolto');
+
+ if($user){
+ $uid = $user['user_id'];
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ }elseif($feltolto){
+ $uid = $feltolto['user_id'];
+ }
+ else
+ redirect("forum");
+
+ hun() ? $data['title'] = 'ARCHLine.XP Renderek' : $data['title'] = 'ARCHLine.XP Renders';
+ $data['tartalom'] = '/forum/renderek';
+
+ $data['uid'] = $uid;
+
+ $renderek = $this->mrender->get_byuserid($uid);
+
+ if($renderek){
+ foreach($renderek as $render){
+ if($render->allapot=='1' && file_exists($render->keszkep)){
+ list($width, $height) = getimagesize($render->keszkep);
+ $render->kepmeret = $width . " x ". $height;
+ }
+ else{
+ $render->kepmeret = '-';
+ }
+ }
+ }
+
+ $data['renderek'] = $renderek;
+
+ $data['onload'] = "betolt()";
+
+ $data['javascript'] = array('fancybox-1.3.4/fancybox/jquery-1.4.3.min','fancybox/jquery.easing.1.3','fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack','jquery_ui','plugin/jquery.maskedinput-1.2.2','plugin/jquery.maskedinput-1.2.2.min');
+ $data['style'] = array('jquery.fancybox-1.3.4','jquery.ui');
+ $data['aktmenu'] = "6";
+ $this->load->view('site_forum',$data);
+
+ unset($_SESSION['webrender']); // ne legyenek meg a render beallitasanal a default ertekek
+ }
+
+ function delrender(){
+ $this->load->model('mrender');
+
+ $render_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ if(!$user)
+ $user = $this->phpsession->get('feltolto');
+
+ if(!$user)
+ redirect('forum');
+
+ $render = $this->mrender->get_row($render_id);
+
+ if( is_numeric($render_id) && $render->user_id == $user['user_id'] ){
+ $this->mrender->del($render_id);
+ }
+
+ header("Location: ".$_SERVER["HTTP_REFERER"]);
+ }
+
+ function rendercopy(){
+ $this->load->model('mrender');
+
+ $guid = $this->uri->segment(3);
+ $render = $this->mrender->get_rowByguid($guid);
+
+ if( is_numeric($render->render_id) ){
+ if( $this->muser->user['lang'] == "hun" )
+ $almappa = "hun";
+ else
+ $almappa = "eng";
+
+ $uid = $render->user_id;
+
+ $helye = "public/forum-galeria/".$almappa."/".$uid;
+
+ if(!is_dir($helye)){
+ mkdir($helye,0644);
+ chmod($helye,0777);
+ }
+
+ $fajluj = basename($render->keszkep);
+
+ $honnan = $render->keszkep;
+ $hova = $helye."/".$fajluj;
+
+ if( copy($honnan,$hova) ){
+ $meret = filesize($hova);
+ $this->mforum->feltolt($render->user_id,$fajluj,$meret,"","1",$render->render_name,$render->nyelv);
+ $fajl_id = mysql_insert_id();
+ $this->db->update('render_img',array('forumgal_id'=>$fajl_id),"render_id='".$render->render_id."'");
+
+ $uzenet = array(4);
+ $this->phpsession->save('fuzenet',$uzenet);
+
+ // elonezeti kep masolasa is ha van
+ $fajlnev = basename($render->keszkep);
+ $mappak = substr( $render->keszkep,0,(-1*(strlen($fajlnev))) );
+ $elokep = $mappak."elo_".$fajlnev;
+ if(file_exists($elokep)){
+ $ujelokep = $helye."/elo_".$fajlnev;
+ copy($elokep,$ujelokep);
+ }
+ }else{
+ $uzenet = array(14);
+ $this->phpsession->save('fhiba',$uzenet);
+ }
+
+ redirect('forum/renderek');
+ }else{
+ $uzenet = array(14);
+ $this->phpsession->save('fhiba',$uzenet);
+ redirect('forum/renderek');
+ }
+ }
+
+ function renderletolt(){
+ $this->load->model('mrender');
+ $render_id = $this->uri->segment(3);
+ $render = $this->mrender->get_row($render_id);
+
+ $user = $this->phpsession->get('fuser');
+ $feltolto = $this->phpsession->get('feltolto');
+
+ if( isset($render->keszkep) && $render->keszkep != "" && file_exists($render->keszkep) && ( $render->user_id == $user['user_id'] || $render->user_id == $feltolto['user_id'] ) ){
+ $path_parts = pathinfo($render->keszkep);
+ $ext = strtolower($path_parts["extension"]);
+
+ if($render->render_name == "")
+ $render->render_name = "Image";
+
+ header("Content-type: application-download");
+ header('Content-Disposition: attachment; filename="'.$render->render_name.'.'.$ext.'"');
+ readfile($render->keszkep);
+ }else{
+ print "hiba a letoltes kozben";
+ }
+ }
+
+ function myshowroom(){
+ $user = $this->phpsession->get('fuser');
+ $feltolto = $this->phpsession->get('feltolto');
+ if(!$user && !$feltolto)
+ redirect('forum');
+
+ if(!$user)
+ $user = $feltolto;
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['tartalom'] = 'forum/myshowroom';
+
+ $data['title'] = hun() ? 'ARCHLine.XP Saját Bemutatóterem' : 'ARCHLine.XP My Showroom';
+ $uid = $user['user_id'];
+ $data['uid'] = $uid;
+ $data['elemek'] = $this->db->query("SELECT * FROM collection_user WHERE userid={$uid} AND deleted=0")->result();
+
+ $data['aktmenu'] = "5";
+
+ $data['javascript'] = array('fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack','fancybox/fancy');
+ $data['style'] = array('../js/fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4v2');
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function szerver(){
+ print "";
+ print_r($_SERVER);
+ print "\n\n";
+ // print_r($GLOBALS);
+ print "
";
+ }
+
+
+ function downloadbeta32(){
+ $user = $this->fuser;
+ $login = $user['name'];
+ $email = $this->mforum->get_user_alap($login);
+ redirect('events/click/betaletoltes32/'.$email[0]->email);
+ }
+
+ function downloadbeta64(){
+ $user = $this->phpsession->get('fuser');
+ $login = $user['name'];
+ $email = $this->mforum->get_user_alap($login);
+ redirect('events/click/betaletoltes64/'.$email[0]->email);
+ }
+
+
+ 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->ervenydessegazon,"/");
+ setcookie("hash",$_COOKIE['hash'] ,time()+$this->ervenydesseg,"/");
+
+ return true;
+
+ }else{
+ return false;
+ }
+ }
+
+
+}
+
+function hasonlito( $a, $b ){
+ if ( $a->datum == $b->datum )
+ return 0;
+ if ( $a->datum > $b->datum )
+ return -1;
+ return 1;
+}
+
+?>
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/forum.php~.evidence.json b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/forum.php~.evidence.json
new file mode 100644
index 0000000..931ea03
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/forum.php~.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6766",
+ "log_excerpt": "[quarantine] dev.cadline.hu:php7_update/partners.archlinexp.com/application/controllers/forum.php~ -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/forum.php~)",
+ "original_sha256": "8a8870bd25fea815ae45a267b82e968b5bbafafac66a0b2bc83b949439403312",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1595501926,
+ "size": 78866,
+ "uid": 12425
+ },
+ "rel_path": "php7_update/partners.archlinexp.com/application/controllers/forum.php~",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "dev.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/groups.php b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/groups.php
new file mode 100644
index 0000000..52cff16
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/groups.php
@@ -0,0 +1,340 @@
+lang->load('site', $this->muser->user['lang']);
+ $this->load->model('mgroups');
+ }
+
+
+ function index()
+ {
+ $this->kategoria();
+ }
+
+ function upload(){
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Új Csoport';
+ else
+ $data['title'] = 'ARCHLine.XP New Group';
+
+ if($this->uri->segment(3)=="java"){
+ $data['tartalom']='groups/java';
+ }
+ else if($this->uri->segment(3)=="simple"){
+ $data['tartalom']='groups/simple';
+ }
+ else{
+ $data['tartalom']='groups/upload';
+ }
+ $data['csik']=array('home','groups');
+ $data['javascript'] = array('onUploadFinished','dl_select');
+ $data['kategoriak'] = $this->muser->get_kategoriak('group');
+
+ $this->load->view('site',$data);
+ }
+
+ function uploadnew(){
+ redirect('/collection/upload/'.$this->uri->segment(3).'/group');
+
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Új Csoport';
+ else
+ $data['title'] = 'ARCHLine.XP New Group';
+
+ if($this->uri->segment(3)!=""/* && $this->uri->segment(4)!=""*/){
+ $data["fajl"] = $this->uri->segment(3);
+
+ $data["eredeti"] = $this->uri->segment(4);
+
+
+ $fajlnev = '/home/vendeg/'.$this->uri->segment(3);
+ $fa = fopen( $fajlnev, "r" ) or die("Upload error"); //or die("$fajlnev nem nyithato meg");
+ $ol = fgets( $fa, 1024);
+ $adatok = explode("#",$ol);
+ // if( count($adatok) == 5){
+ $lang = $this->muser->user['lang'];
+ $honnan = "/home/vendeg/".$adatok[2];
+ $kepnev = time()."_".$adatok[3];
+ $ide= "public/img/groups/".$lang."/".$kepnev;
+ //$ide= "public/img/groups/temp/".$kepnev;
+ if( 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];
+
+
+ // $kepresz = substr($data["kepalap"],0,18);
+ // print "rész: ".$kepresz.$lang."/".$data["kepalap"];
+
+ // }
+ fclose($fa);
+
+
+
+ $data['tartalom']='groups/uploadnew';
+ }else{
+ redirect('groups/upload');
+ }
+
+ $data['csik']=array('home','groups');
+ $data['javascript'] = array('objfeltoltes');
+
+ $data['kategoriak'] = $this->muser->get_kategoriak('group');
+
+ $this->load->view('site',$data);
+ }
+
+ function simple(){
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Új Csoport';
+ else
+ $data['title'] = 'ARCHLine.XP New Group';
+ $data['tartalom']='groups/simple';
+ $data['csik']=array('home','groups');
+
+ $this->load->view('site',$data);
+ }
+
+ function kat(){
+
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Csoportok';
+ else
+ $data['title'] = 'ARCHLine.XP Groups';
+
+ $data['tartalom']='groups/kat';
+ $data['csik']=array('home','groups');
+ $data['javascript']=array('dl_select');
+
+ if(!$this->uri->segment(3))
+ $kat = 2;
+ else
+ $kat = $this->uri->segment(3);
+ $csoportok = $this->mgroups->get_bykat($kat);
+ $data['groups']=$csoportok;
+
+ $data['kategoriak'] = $this->muser->get_kategoriak('group');
+
+ $data['aktiv']=$kat;
+ $this->load->view('site',$data);
+ }
+
+ function kategoria(){
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Csoportok';
+ else
+ $data['title'] = 'ARCHLine.XP Groups';
+
+ $data['tartalom']='groups/kat';
+ $data['csik']=array('home','groups');
+ $data['javascript']=array('dl_select');
+
+ if(!$this->uri->segment(3) || !( $this->muser->letezokategoria($this->uri->segment(3),'group') ) )
+ $kat = 20;
+ else
+ $kat = $this->uri->segment(3);
+
+ redirect("/collection/kategoria/".$kat);
+
+ $data['groups']=$this->mgroups->get_bykategoria($kat);
+
+ $kategoriak = $this->muser->get_kategoriak('group');
+ $kategoriak = $this->mgroups->get_darab($kategoriak);
+
+ $data['kategoriak'] = $kategoriak;
+
+ $data['aktiv']=$kat;
+
+ $data['title'] .= " - " . $this->muser->get_katName($kat);
+
+ $this->load->view('site',$data);
+ }
+
+ function submit(){
+ $lang = $this->muser->user['lang'];
+ $tempFolder = "/home/vendeg/"; //ide másolja az FTP applet a fájlt
+ $storeFolder = "/home/cadline/public_html/website/public/groups/".$lang."/"; //mi itt szeretnénk tárolni
+ $error = "";
+ $kep = "";
+ $link = "public/groups/".$lang."/";
+
+ // ha java-val:
+ if( isset($_POST["tempFilenameField"]) ){
+ $tempFilename = $_POST["tempFilenameField"]; //ezen a néven kerül feltöltésre a fájl (pl. 123456.file)
+ $originalFilename = $_POST["originalFilenameField"]; //ez volt az eredeti neve (pl. szoveg.doc)
+ $storeFilename = time()."_".$originalFilename; //ezen a neven taroljuk mi (pl. 2347686323_szoveg.doc)
+
+
+ $storePath = $storeFolder.$storeFilename;
+ $tempPath = $tempFolder.$tempFilename;
+
+ if ((strlen($tempFilename) < 3) || (strlen($originalFilename) < 3)){
+ die ("Hibás fáljnevek!");
+ $error .= "hiba";
+ }
+
+ if (!copy($tempPath,$storePath)){
+ $error .= "nem másoltam.
mit: ".$tempPath.", hova: ".$storePath;
+ }else{
+ $link .= $storeFilename;
+ $prSize = 6500;
+ $prSize = filesize($storePath); //??
+ $this->kep($kep);
+ }
+
+ }
+ // ha egyszerusitve:
+ else if ($_FILES["originalFilenameField"]["error"]==0){
+
+ $storeFolder = "public/groups/".$lang."/";
+ $storeFilename= $storeFolder.time()."_". $_FILES["originalFilenameField"]["name"];
+
+ $tempFilename = $_FILES["originalFilenameField"]["tmp_name"];
+
+ if (copy($_FILES["originalFilenameField"]["tmp_name"],$storeFilename)){
+ $prFile = $storeFilename;
+ $prSize = $_FILES['originalFilenameField']['size'];
+ }else{
+ $prFile = "NULL";
+ $error .= "
nem másoltam.
ezt: ".$_FILES["originalFilenameField"]["tmp_name"].", ide: ".$storeFilename;
+ }
+ $originalFilename = $_FILES["originalFilenameField"]["name"];
+ $storePath = $storeFilename;
+
+ $this->kep($kep);
+
+ $link = $storeFilename;
+
+ }else{
+ $error = "nincs csoport fajl";
+ }
+
+
+
+ // Felvétel az adatbázisba
+ if(!$error){
+ $ujgr->email = $_POST["projectEmailField"];
+ $ujgr->title = $_POST["projhectNameField"];
+ $ujgr->meret = $prSize;
+ $ujgr->datum = date('Y-m-d H:i:s',time());
+ $ujgr->nyelv = $lang;
+ $ujgr->kep = $kep;
+ $ujgr->kategoria = $_POST["kategoria"];
+ $ujgr->text = $_POST["projectDescriptionField"];
+ $ujgr->group = $link;
+ $ujgr->szerzo = $_POST["SzerzoField"];
+
+ if( $_POST["kategoria"] > 20 )
+ $ujgr->kat_id = $_POST["kategoria"];
+ else
+ $ujgr->kat_id = "";
+
+ $this->mgroups->newgroup($ujgr);
+
+ //print "
Új csoport felvéve!";
+ }else{
+ //print "
Nem került új csoport az adatbázisba!";
+ //print $error;
+ }
+
+ //ha nem volt print:
+ redirect('groups/kategoria/'.$_POST["kategoria"]);
+ }
+
+ function submitnew(){
+ $lang = $this->muser->user['lang'];
+ $tempFolder = "/home/vendeg/"; //ide másolja az FTP applet a fájlt
+ $storeFolder = "/home/cadline/public_html/website/public/groups/".$lang."/"; //mi itt szeretnénk tárolni
+ $error = "";
+ $kep = "";
+
+ $fajlnev = $_POST["originalFilenameField"]; // ez van a vendegnel
+ $fajlnev2 = $_POST["eredetinev"]; // ez legyen a publicban
+ $fajl = $tempFolder.$fajlnev;
+
+ $ido = time();
+
+ $storeFilename= $storeFolder.$ido."_".$fajlnev2;
+
+
+ if (copy($fajl,$storeFilename)){
+ $prFile = $storeFilename;
+ $prSize = filesize($storeFilename);
+ // print " Sikerült a másolás! ";
+ }else{
+ $prFile = "NULL";
+ $error .= "Nem másoltam át a fájlt.
Mit: ".$fajlnev.", Hova: ".$fajlnev2;
+ }
+
+ $link = "public/groups/".$lang."/".$ido."_".$fajlnev2;
+
+ $kep = $_POST["kepalap"];
+ $this->kep($kep);
+
+
+ // ú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('group',$nevhun,$neveng);
+ }else{
+ $kat_id = $_POST["kategoria"];
+ }
+
+
+ // Felvétel az adatbázisba
+ if(!$error){
+ $ujgr->email = $_POST["projectEmailField"];
+ $ujgr->title = $_POST["projhectNameField"];
+ $ujgr->meret = $prSize;
+ $ujgr->datum = date('Y-m-d H:i:s',time());
+ $ujgr->nyelv = $lang;
+ $ujgr->kep = $kep;
+ $ujgr->kategoria = $_POST["kategoria"];
+ $ujgr->text = $_POST["projectDescriptionField"];
+ $ujgr->group = $link;
+ $ujgr->szerzo = $_POST["SzerzoField"];
+ $ujgr->kat_id = $kat_id;
+
+ $this->mgroups->newgroup($ujgr);
+
+ }
+
+ //ha nem volt print:
+ redirect('groups/kategoria/'.$kat_id);
+ }
+
+ function kep(&$kep){
+ if ($_FILES["kep"]["error"]==0){
+ $lang = $this->muser->user['lang'];
+ $kepnev = time()."_". $_FILES["kep"]["name"];
+ $ide= "public/img/groups/".$lang."/".$kepnev;
+ if (copy($_FILES["kep"]["tmp_name"],$ide)){
+ $kep = $ide;
+ $prSize = $_FILES['kep']['size'];
+ }else{
+ $prFile = "NULL";
+ }
+ }
+ }
+
+}
+
+?>
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/groups.php.evidence.json b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/groups.php.evidence.json
new file mode 100644
index 0000000..faf3294
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/groups.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6774",
+ "log_excerpt": "[quarantine] dev.cadline.hu:php7_update/partners.archlinexp.com/application/controllers/groups.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/groups.php)",
+ "original_sha256": "cce23a7e4244cfd82817f25ec0dbb697c22cb1c92425334ee2d163d0e290d921",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1595502796,
+ "size": 8688,
+ "uid": 12425
+ },
+ "rel_path": "php7_update/partners.archlinexp.com/application/controllers/groups.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "dev.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/objects.php b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/objects.php
new file mode 100644
index 0000000..6b0c325
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/objects.php
@@ -0,0 +1,429 @@
+lang->load('site', $this->muser->user['lang']);
+ $this->load->model('mobjects');
+ }
+
+ function index()
+ {
+ $this->kategoria();
+ }
+
+ function upload(){
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Új Objektum';
+ else
+ $data['title'] = 'ARCHLine.XP New Object';
+
+ if($this->uri->segment(3)=="java"){
+ $data['tartalom']='objects/java';
+ }
+ else if($this->uri->segment(3)=="simple"){
+ $data['tartalom']='objects/simple';
+ }
+ else{
+ $data['tartalom']='objects/upload';
+ }
+ $data['csik']=array('home','objects');
+ $data['javascript'] = array('onUploadFinished');
+ $data['kategoriak'] = $this->muser->get_kategoriak('object');
+
+ $this->load->view('site',$data);
+ }
+
+ function uploadnew(){
+ redirect('/collection/upload/'.$this->uri->segment(3).'/object');
+
+ if(hun()){
+ $data['title'] = 'ARCHLine.XP Új Objektum';
+ $data['feltetel'] = $this->mpages->get_row(572);
+ }
+ else{
+ $data['title'] = 'ARCHLine.XP New Object';
+ $data['feltetel'] = $this->mpages->get_row(571);
+ }
+
+ if($this->uri->segment(3)!=""/* && $this->uri->segment(4)!=""*/){
+ $data["fajl"] = $this->uri->segment(3);
+ $data["eredeti"] = $this->uri->segment(4);
+
+ /* szövegfájl átadással */
+ if(/*eng()*/true){
+ $fajlnev = '/home/vendeg/'.$this->uri->segment(3);
+ $fa = fopen( $fajlnev, "r" ) or die("Upload error");
+ $ol = fgets( $fa, 1024);
+ $adatok = explode("#",$ol);
+ // if( count($adatok) == 5){
+ $lang = $this->muser->user['lang'];
+ $honnan = "/home/vendeg/".$adatok[2];
+ $kepnev = time()."_".$adatok[3];
+ $ide= "public/img/objects/".$lang."/".$kepnev;
+ //$ide= "public/img/objects/temp/".$kepnev;
+ if( 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];
+
+ // echo(unicode_encode($data["fajl"], 'UTF-8'));
+ //print_r($data);
+ // }
+ fclose($fa);
+ }
+
+ }else{
+ redirect('objects/upload');
+ }
+
+ $data['tartalom']='objects/uploadnew';
+ $data['csik']=array('home','objects');
+ $data['javascript'] = array('objfeltoltes');
+ $data['kategoriak'] = $this->muser->get_kategoriak('object');
+
+ //print_r($data);
+
+ $this->load->view('site_upload',$data);
+ }
+
+
+
+
+
+
+ function upload2(){
+ redirect("collection/upload/".$this->uri->segment(3)."/object");
+
+ /*if(hun()){
+ $data['title'] = 'ARCHLine.XP Új Objektum';
+ $data['feltetel'] = $this->mpages->get_row(572);
+ }
+ else{
+ $data['title'] = 'ARCHLine.XP New Object';
+ $data['feltetel'] = $this->mpages->get_row(571);
+ }
+
+ if($this->uri->segment(3)!=""){
+ $data["fajl"] = $this->uri->segment(3);
+ $data["eredeti"] = $this->uri->segment(4);
+
+ /* szövegfájl átadással */
+ /*$fajlnev = '/home/vendeg/'.$this->uri->segment(3);
+ $fa = fopen( $fajlnev, "r" ) or die("Upload error");
+ $ol = fgets( $fa, 1024);
+ $adatok = explode("#",$ol);
+ $lang = $this->muser->user['lang'];
+ $honnan = "/home/vendeg/".$adatok[2];
+ $kepnev = time()."_".$adatok[3];
+ $ide= "public/img/objects/".$lang."/".$kepnev;
+ if( 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];
+
+ fclose($fa);
+
+ }else{
+ redirect('objects/upload');
+ }
+
+ $data['tartalom']='objects/uploadnew';
+ $data['javascript'] = array('objfeltoltes');
+ $data['kategoriak'] = $this->muser->get_kategoriak('object');
+
+ $this->load->view('site_upload',$data);*/
+ }
+
+
+
+
+
+
+
+ function simple(){
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Új Objektum';
+ else
+ $data['title'] = 'ARCHLine.XP New Object';
+ $data['tartalom']='objects/simple';
+ $data['csik']=array('home','objects');
+
+ $this->load->view('site',$data);
+ }
+
+ function kat(){
+
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Objektumok';
+ else
+ $data['title'] = 'ARCHLine.XP Objects';
+
+ $data['tartalom']='objects/kat';
+ $data['csik']=array('home','objects');
+ $data['javascript']=array('dl_select');
+
+ if(!$this->uri->segment(3))
+ $kat = 2;
+ else
+ $kat = $this->uri->segment(3);
+
+ $data['objects']=$this->mobjects->get_bykat($kat);
+
+ //$nyelv = $this->muser->user['lang'];
+
+ $data['kategoriak'] = $this->muser->get_kategoriak('object');
+
+ $data['aktiv']=$kat;
+ $this->load->view('site',$data);
+
+ }
+
+ function kategoria(){
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Objektumok';
+ else
+ $data['title'] = 'ARCHLine.XP Objects';
+
+ $data['tartalom']='objects/kat';
+ $data['csik']=array('home','objects');
+ $data['javascript']=array('dl_select','objfeltoltes');
+
+ if( !$this->uri->segment(3) || !( $this->muser->letezokategoria($this->uri->segment(3),'object') ))
+ $kat = 26;
+ else
+ $kat = $this->uri->segment(3);
+
+
+ redirect("/collection/kategoria/".$kat);
+
+ $data['objects']=$this->mobjects->get_bykategoria($kat);
+
+
+ $kategoriak = $this->muser->get_kategoriak('object');
+ $kategoriak = $this->mobjects->get_darab($kategoriak);
+
+ $data['kategoriak'] = $kategoriak;
+ //$data['kategoriak'] = $this->muser->get_kategoriak('object');
+
+ $data['aktiv']=$kat;
+ $data['title'] .= " - " . $this->muser->get_katName($kat);
+
+ $this->load->view('site',$data);
+ }
+
+ function get()
+ {
+ $download_id = $this->uri->segment(3);
+ if(!$download_id || !is_numeric($download_id))
+ {
+ show_404();
+ }
+
+ $record = $this->mobjects->get_row($download_id);
+ if(!$record)
+ {
+ show_404();
+ }
+
+ redirect($record->object);
+ }
+
+ function submit(){
+ $lang = $this->muser->user['lang'];
+ $tempFolder = "/home/vendeg/"; //ide másolja az FTP applet a fájlt
+ $storeFolder = "/home/cadline/public_html/website/public/objects/".$lang."/"; //mi itt szeretnénk tárolni
+ $error = "";
+ $kep = "";
+ $link = "public/objects/".$lang."/";
+
+ // ha java-val:
+ if( isset($_POST["tempFilenameField"]) ){
+ $tempFilename = $_POST["tempFilenameField"]; //ezen a néven kerül feltöltésre a fájl (pl. 123456.file)
+ $originalFilename = $_POST["originalFilenameField"]; //ez volt az eredeti neve (pl. szoveg.doc)
+ $storeFilename = time()."_".$originalFilename; //ezen a neven taroljuk mi (pl. 2347686323_szoveg.doc)
+
+
+ $storePath = $storeFolder.$storeFilename;
+ $tempPath = $tempFolder.$tempFilename;
+
+ if ((strlen($tempFilename) < 3) || (strlen($originalFilename) < 3)){
+ die ("Hibás fáljnevek!");
+ $error .= "hiba";
+ }
+
+ //chmod($tempPath,0777);
+ if (!copy($tempPath,$storePath)){
+ //if (!rename($tempPath,$storePath)){
+ // print "Nem sikerül a helyére másolni a feltöltött fájlt!
";
+ $error .= "hiba";
+ }else{
+ // print "Sikeres feltöltés ($originalFilename)
";
+ //$storeFilename = $storePath;
+ $link .= $storeFilename;
+ $prSize = 6500;
+ $prSize = filesize($storePath); //??
+ $this->kep($kep);
+ }
+
+ }
+ // ha egyszerusitve:
+ else if ($_FILES["originalFilenameField"]["error"]==0){
+
+ $storeFolder = "public/objects/".$lang."/";
+ $storeFilename= $storeFolder.time()."_". $_FILES["originalFilenameField"]["name"];
+
+ $tempFilename = $_FILES["originalFilenameField"]["tmp_name"];
+
+ if (copy($_FILES["originalFilenameField"]["tmp_name"],$storeFilename)){
+ $prFile = $storeFilename;
+ $prSize = $_FILES['originalFilenameField']['size'];
+ }else{
+ $prFile = "NULL";
+ $error .= "hiba..";
+ }
+ $originalFilename = $_FILES["originalFilenameField"]["name"];
+ $storePath = $storeFilename;
+
+ $this->kep($kep);
+
+ $link = $storeFilename;
+
+ }else{
+ $error = "nincs objektum fajl";
+ }
+
+
+ // Felvétel az adatbázisba
+ 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 = $link;
+ $ujpr->szerzo = $_POST["SzerzoField"];
+ $ujpr->kat_id = $_POST["kategoria"];
+
+ $this->mobjects->newobject($ujpr);
+
+ //print "
Új projekt felvéve";
+ }else{
+ //print "
Nem került adat az adatbázisba";
+ }
+
+ //ha nem volt print:
+ redirect('objects/kategoria/'.$_POST["kategoria"]);
+ }
+
+ function submitnew(){
+ $lang = $this->muser->user['lang'];
+ $tempFolder = "/home/vendeg/"; //ide másolja az FTP applet a fájlt
+ $storeFolder = "/home/cadline/public_html/website/public/objects/".$lang."/"; //mi itt szeretnénk tárolni
+ $error = "";
+ $kep = "";
+
+ $fajlnev = $_POST["originalFilenameField"]; // ez van a vendegnel
+ $fajlnev2 = $_POST["eredetinev"]; // ez legyen a publicban
+ $fajl = $tempFolder.$fajlnev;
+
+ $ido = time();
+
+ $storeFilename= $storeFolder.$ido."_".$fajlnev2;
+
+
+ if (copy($fajl,$storeFilename)){
+ $prFile = $storeFilename;
+ $prSize = filesize($storeFilename);
+ }else{
+ $prFile = "NULL";
+ $error .= "Nem másoltam át a fájlt
vendegben: ".$fajlnev." publicba: ".$fajlnev2;
+ }
+
+ $link = "public/objects/".$lang."/".$ido."_".$fajlnev2;
+
+ $kep = $_POST["kepalap"];
+ $this->kep($kep);
+
+
+ // ú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('object',$nevhun,$neveng);
+ }else{
+ $kat_id = $_POST["kategoria"];
+ }
+
+
+ // Felvétel az adatbázisba
+ 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 = $link;
+ $ujpr->szerzo = $_POST["SzerzoField"];
+ $ujpr->kat_id = $kat_id;
+
+ $this->mobjects->newobject($ujpr);
+
+ //print "
Új projekt felvéve";
+ }else{
+ //print "
Nem került adat az adatbázisba";
+ //print $error;
+ }
+
+ //ha nem volt print:
+ redirect('objects/kategoria/'.$kat_id);
+ }
+
+ function kep(&$kep){
+ if ($_FILES["kep"]["error"]==0){
+ $lang = $this->muser->user['lang'];
+ $kepnev = time()."_". $_FILES["kep"]["name"];
+ $ide= "public/img/objects/".$lang."/".$kepnev;
+ if (copy($_FILES["kep"]["tmp_name"],$ide)){
+ $kep = $ide;
+ $prSize = $_FILES['kep']['size'];
+ //print " Sikerült a képmásolás! ";
+ }else{
+ $prFile = "NULL";
+ //print " Nem sikerült a képet felmásolni! ";
+ }
+ }
+ }
+
+}
+
+?>
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/objects.php.evidence.json b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/objects.php.evidence.json
new file mode 100644
index 0000000..0fe61f4
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/objects.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6767",
+ "log_excerpt": "[quarantine] dev.cadline.hu:php7_update/partners.archlinexp.com/application/controllers/objects.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/objects.php)",
+ "original_sha256": "38a24706801b0127273d0776f59e480f1d75b681cbd700038140fef397226303",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1595502815,
+ "size": 10787,
+ "uid": 12425
+ },
+ "rel_path": "php7_update/partners.archlinexp.com/application/controllers/objects.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "dev.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/projects.php b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/projects.php
new file mode 100644
index 0000000..122770c
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/projects.php
@@ -0,0 +1,445 @@
+lang->load('site', $this->muser->user['lang']);
+
+ $this->load->model('mprojects');
+ }
+
+ function index()
+ {
+ $this->kategoria();
+ }
+
+ function supportupload(){
+ include('application/helpers/sajatfeltolto.php');
+
+ $guid = $this->uri->segment(4);
+ $sorozatszam = $this->uri->segment(3);
+
+ print_r($this->uri->segments);
+
+ print "guid: ".$guid."
sorozatszam: ".$sorozatszam;
+
+ if( !$guid || !$sorozatszam ){
+ $record->osztaly = "projects";
+ $record->fv = "supportupload";
+ $record->hiba = "Hiányzó guid vagy sorozatszám:\n".$guid."\n".$sorozatszam;
+ $record->datum = date('Y-m-d H:i:s',time());
+ $this->db->insert('a_hibak',$record);
+
+ return;
+ }
+
+ $honnan = '/home/vendeg/support/'.$guid;
+ $hova = 'public/ugyfelupload/'.$sorozatszam;
+
+ if( !file_exists($honnan) && file_exists($honnan."=") )
+ $honnan .= "=";
+ elseif( !file_exists($honnan) && file_exists($honnan."==") )
+ $honnan .= "==";
+
+
+ if(!is_dir($hova)){
+ mkdir($hova,0777);
+ exec("chmod 777 /var/www/hosting/cadline.hu/www/".$hova);
+ }
+ $hova .= "/".trim(base64_decode($guid),"=");;
+
+ if( athelyez($honnan,$hova) ){
+ exec("chmod 777 /var/www/hosting/cadline.hu/www/".$hova);
+ }
+ else{
+ // sikertelen masolas
+
+ $record->osztaly = "projects";
+ $record->fv = "supportupload";
+ $record->hiba = "Másolás hiba, honnan:".$honnan."\nhova: ".$hova;
+ $record->datum = date('Y-m-d H:i:s',time());
+ $this->db->insert('a_hibak',$record);
+ }
+
+ }
+
+ function upload(){
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Új Projekt';
+ else
+ $data['title'] = 'ARCHLine.XP New Project';
+
+ if($this->uri->segment(3)=="java"){
+ $data['tartalom']='projects/java';
+ }
+ else if($this->uri->segment(3)=="simple"){
+ $data['tartalom']='projects/simple';
+ }
+ else{
+ $data['tartalom']='projects/upload';
+ }
+
+ $data['kategoriak'] = $this->muser->get_kategoriak('project');
+
+ $data['csik']=array('home','projects');
+ $data['javascript'] = array('onUploadFinished');
+
+ $this->load->view('site',$data);
+ }
+
+ function uploadnew(){
+ redirect('/collection/upload/'.$this->uri->segment(3).'/project');
+
+ if(hun()){
+ $data['title'] = 'ARCHLine.XP Új Projekt';
+ $data['feltetel'] = $this->mpages->get_row(572);
+ }
+ else{
+ $data['title'] = 'ARCHLine.XP New Project';
+ $data['feltetel'] = $this->mpages->get_row(571);
+ }
+
+
+ if($this->uri->segment(3)!=""){
+ $data["fajl"] = $this->uri->segment(3);
+ $data["eredeti"] = $this->uri->segment(4);
+
+
+ $fajlnev = '/home/vendeg/'.$this->uri->segment(3);
+ $fa = fopen( $fajlnev, "r" ) or die("Upload error");
+ $ol = fgets( $fa, 1024);
+ $adatok = explode("#",$ol);
+ // if( count($adatok) == 5){
+ $lang = $this->muser->user['lang'];
+ $honnan = "/home/vendeg/".$adatok[2];
+ $kepnev = time()."_".$adatok[3];
+ $ide= "public/img/projects/".$lang."/".$kepnev;
+ //$ide= "public/img/projects/temp/".$kepnev;
+ if( 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];
+
+ // }
+ fclose($fa);
+
+
+ $data['tartalom']='projects/uploadnew';
+ }else{
+ redirect('projects/upload');
+ }
+
+ $data['kategoriak'] = $this->muser->get_kategoriak('project');
+
+ $data['javascript'] = array('objfeltoltes');
+
+ $this->load->view('site_upload',$data);
+ }
+
+ function simple(){
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Új Projekt';
+ else
+ $data['title'] = 'ARCHLine.XP New Project';
+ $data['tartalom']='projects/simple';
+ $data['csik']=array('home','projects');
+
+ $this->load->view('site',$data);
+ }
+
+ function cadline(){
+ $data['title'] = 'ARCHLine.XP Projektek szerkesztése';
+ $data['tartalom']='projects/cadline';
+ $data['csik']=array('home','projects');
+
+ //$projects = $this->mprojects->get_all();
+ //$data['projects'] = $projects;
+
+ $this->load->view('site',$data);
+ }
+
+ function kat(){
+
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Projektek';
+ else
+ $data['title'] = 'ARCHLine.XP Projects';
+
+ $data['tartalom']='projects/kat';
+ $data['csik']=array('home','projects');
+ $data['javascript']=array('dl_select');
+
+ if(!$this->uri->segment(3) || !is_numeric($this->uri->segment(3)))
+ $kat = 6;
+ else
+ $kat = $this->uri->segment(3);
+
+ $projektek = $this->mprojects->get_bykat($kat);
+ $data['projects']=$projektek;
+
+ $data['kategoriak'] = $this->muser->get_kategoriak('project');
+
+ $data['aktiv']=$kat;
+ $this->load->view('site',$data);
+ }
+
+ function kategoria(){
+ redirect("/collection/kategoria/1");
+
+
+
+
+ if(hun())
+ $data['title'] = 'ARCHLine.XP Projektek';
+ else
+ $data['title'] = 'ARCHLine.XP Projects';
+
+ $data['tartalom']='projects/kat';
+ $data['csik']=array('home','projects');
+ $data['javascript']=array('dl_select','objfeltoltes');
+
+ if(!$this->uri->segment(3) || !( $this->muser->letezokategoria($this->uri->segment(3),'project') ) )
+ $kat = 1;
+ else
+ $kat = $this->uri->segment(3);
+
+
+ $data['projects']=$this->mprojects->get_bykategoria($kat);
+
+ $kategoriak = $this->muser->get_kategoriak('project');
+ $kategoriak = $this->mprojects->get_darab($kategoriak);
+
+ $data['kategoriak'] = $kategoriak;
+
+ $data['aktiv']=$kat;
+
+ $data['title'] .= " - " . $this->muser->get_katName($kat);
+
+ $this->load->view('site',$data);
+ }
+
+ function get()
+ {
+ $download_id = $this->uri->segment(3);
+ if(!$download_id || !is_numeric($download_id))
+ {
+ show_404();
+ }
+
+ $record = $this->mprojects->get_row($download_id);
+ if(!$record)
+ {
+ show_404();
+ }
+
+ redirect($record->project);
+ }
+
+ function submit(){
+ $lang = $this->muser->user['lang'];
+ $tempFolder = "/home/vendeg/"; //ide másolja az FTP applet a fájlt
+ $storeFolder = "/home/cadline/public_html/website/public/projects/".$lang."/"; //mi itt szeretnénk tárolni
+ $error = "";
+ $kep = "";
+ $link = "public/projects/".$lang."/";
+
+ // ha java-val:
+ if( isset($_POST["tempFilenameField"]) ){
+ $tempFilename = $_POST["tempFilenameField"]; //ezen a néven kerül feltöltésre a fájl (pl. 123456.file)
+ $originalFilename = $_POST["originalFilenameField"]; //ez volt az eredeti neve (pl. szoveg.doc)
+ $storeFilename = time()."_".$originalFilename; //ezen a neven taroljuk mi (pl. 2347686323_szoveg.doc)
+
+
+ $storePath = $storeFolder.$storeFilename;
+ $tempPath = $tempFolder.$tempFilename;
+
+ if ((strlen($tempFilename) < 3) || (strlen($originalFilename) < 3)){
+ die ("Hibás fáljnevek!");
+ $error .= "hiba";
+ }
+
+ //chmod($tempPath,0777);
+ if (!copy($tempPath,$storePath)){
+ //if (!rename($tempPath,$storePath)){
+ // print "Nem sikerül a helyére másolni a feltöltött fájlt!
";
+ $error .= "hiba";
+ }else{
+ // print "Sikeres feltöltés ($originalFilename)
";
+ //$storeFilename = $storePath;
+ $link .= $storeFilename;
+ $prSize = 6500;
+ $prSize = filesize($storePath); //??
+ $this->kep($kep);
+ }
+
+ }
+ // ha egyszerűsítve:
+ else if ($_FILES["originalFilenameField"]["error"]==0){
+
+ $storeFolder = "public/projects/".$lang."/";
+ $storeFilename= $storeFolder.time()."_". $_FILES["originalFilenameField"]["name"];
+
+ $tempFilename = $_FILES["originalFilenameField"]["tmp_name"];
+
+ if (copy($_FILES["originalFilenameField"]["tmp_name"],$storeFilename)){
+ $prFile = $storeFilename;
+ $prSize = $_FILES['originalFilenameField']['size'];
+ }else{
+ $prFile = "NULL";
+ $error .= "hiba..";
+ }
+ $originalFilename = $_FILES["originalFilenameField"]["name"];
+ $storePath = $storeFilename;
+
+ $this->kep($kep);
+
+ $link = $storeFilename;
+
+ }else{
+ $error = "nincs projekt fajl";
+ }
+
+
+ // Felvétel az adatbázisba
+ 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 = $link;
+ $ujpr->szerzo = $_POST["SzerzoField"];
+ $ujpr->kat_id = $_POST["kategoria"];
+
+ $this->mprojects->newproject($ujpr);
+
+ //print "
Új projekt felvéve";
+ }else{
+ //print "
Nem került adat az adatbázisba";
+ }
+
+ //ha nem volt print:
+ redirect('projects/kategoria/'.$_POST["kategoria"]);
+ }
+
+
+ function submitnew(){
+ $lang = $this->muser->user['lang'];
+ $tempFolder = "/home/vendeg/"; //ide másolja a program a fájlt
+ $storeFolder = "/home/cadline/public_html/website/public/projects/".$lang."/"; //mi itt szeretnénk tárolni
+ $error = "";
+ $kep = "";
+
+
+ $fajlnev = $_POST["originalFilenameField"]; // ez van a vendegnel
+ //$fajlnev2 = $_POST["eredetinev"]; // ez legyen a publicban
+ //$fajlnev2 = $this->ekezet($_POST["eredetinev"]); // ez legyen a publicban
+
+
+ $fajlnev2 = $_POST["originalFilenameField"]; // ez legyen a publicban
+ $parameterbe = $_POST["eredetinev"]; // ez a név jelenik meg a letöltéskor az url-ben, paraméterként
+
+
+ $fajl = $tempFolder.$fajlnev;
+
+ $link = "public/projects/".$lang."/".$fajl;
+
+ $storeFolder = "public/projects/".$lang."/";
+ $storeFilename= $storeFolder.time()."_".$fajlnev2;
+
+ if (copy($fajl,$storeFilename)){
+ $prFile = $storeFilename;
+ $prSize = filesize($storeFilename);
+ $kep = $_POST["kepalap"];
+ $this->kep($kep);
+ }else{
+ $prFile = "NULL";
+ $error .= "Nem másoltam át a fájlt
vendegben: ".$fajlnev." publicba: ".$fajlnev2;
+ }
+ $originalFilename = $_FILES["originalFilenameField"]["name"];
+ $storePath = $storeFilename;
+
+
+ $link = $storeFilename;
+
+
+
+ // ú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('project',$nevhun,$neveng);
+ }else{
+ $kat_id = $_POST["kategoria"];
+ }
+
+
+ // Felvétel az adatbázisba
+ 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 = $kat_id;
+ $ujpr->text = $_POST["projectDescriptionField"];
+ $ujpr->project = $link;
+ $ujpr->eredeti = $parameterbe;
+ $ujpr->szerzo = $_POST["SzerzoField"];
+ $ujpr->kat_id = $kat_id;
+
+ $this->mprojects->newproject($ujpr);
+
+ // print "
Új projekt felvéve";
+ // print_r($ujpr);
+ }else{
+ //print "
Nem került adat az adatbázisba";
+ //print $error;
+ }
+
+ //ha nem volt print:
+ redirect('projects/kategoria/'.$kat_id);
+ }
+
+ 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 kep(&$kep){
+ if ($_FILES["kep"]["error"]==0){
+ $lang = $this->muser->user['lang'];
+ $kepnev = time()."_". $_FILES["kep"]["name"];
+ $ide= "public/img/projects/".$lang."/".$kepnev;
+ if (copy($_FILES["kep"]["tmp_name"],$ide)){
+ $kep = $ide;
+ }
+ }
+ }
+
+
+}
+
+?>
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/projects.php.evidence.json b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/projects.php.evidence.json
new file mode 100644
index 0000000..2efdc0a
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/projects.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6770",
+ "log_excerpt": "[quarantine] dev.cadline.hu:php7_update/partners.archlinexp.com/application/controllers/projects.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/projects.php)",
+ "original_sha256": "2860e757380bcee28db11d0edb77d54d6a4940c76661d6c71f5ebddfd22f6616",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1595502831,
+ "size": 11456,
+ "uid": 12425
+ },
+ "rel_path": "php7_update/partners.archlinexp.com/application/controllers/projects.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "dev.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/testforum.php b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/testforum.php
new file mode 100644
index 0000000..ffc296d
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/testforum.php
@@ -0,0 +1,2367 @@
+userekoldal = 30;
+
+ $user = $this->phpsession->get('fuser');
+ if(!$user){
+
+ }else{
+ $this->fuser = $user;
+ }
+
+ $this->lang->load('site', $this->muser->user['lang']);
+ $this->load->model('mforum');
+
+ define( "BENTIIP", "84.3.20.66aaaaaaaaaaaa");
+ define( "UBUNTU", "o33333333333");
+ define( "MEHET", "igen");
+
+ }
+
+ function index()
+ {
+ $this->temakorok();
+ }
+
+ function temakorok(){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='testforum/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']='testforum/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);
+
+ $temak = $this->mforum->get_alap2($temakor, $temaoldal);
+ foreach( $temak as $tema ){
+ $cim = $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['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'));
+
+ 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']='testforum/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']='testforum/ujtemakor';
+ $data['csik']=array('home','forum');
+
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ $this->index();
+ }
+ }
+
+ function csere($input){
+ $mit[0]="/>/";
+ $mit[1]="/";
+ $mit[2]="/\n/";
+ $mit[3]="/'/";
+ $mit[4]="/=/";
+ $mit[5]="/\"/";
+ $mit[6]="/;/";
+ $mire[0]=">";
+ $mire[1]="<";
+ $mire[2]="
";
+ $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');
+
+
+ if(!$this->input->post('valasz'))
+ $valasz = $this->phpsession->get('valasz');
+ else
+ $valasz = $this->input->post('valasz');
+
+
+
+ if($hszszoveg == "" || $hszszoveg == "
")
+ $error .= "Üres hozzászólás!
";
+
+
+ if ($_FILES["fkep"]["error"]==0 && ($error == "") ){
+ $login = $tomb['name'];
+ $user_id = $this->mforum->get_userid($login);
+ //ha nincs mappája
+ if(hun())
+ $hova = $this->kepek_utvonal.$user_id;
+ elseif(eng())
+ $hova = $this->kepek_utvonal_eng.$user_id;
+
+ if(!is_dir($hova)){
+ //akkor hozza létre
+ mkdir($hova,0644);
+ chmod($hova,0777);
+ }
+ $feltolt_konyvtar = $hova."/";
+ //ha több fájl lenne ugyanazon a néven
+ $rand = rand(100,999);
+ $feltolt_fajlnev=$feltolt_konyvtar . $rand . "__" . $this->ekezet($_FILES["fkep"]["name"]);
+
+ $error = "";
+ $mi = $_FILES['fkep']['name']."$";
+
+ $mire = "\.bmp|\.jpg|\.jpeg|\.png|\.gif|\.tif|\.BMP|\.JPG|\.PNG|\.GIF";
+ if( !(ereg( $mire , $mi )) ){
+ $error .= "Hibás fájl kiterjesztés, elfogadott kiterjesztések: .bmp, .jpg, .png, .gif
";
+ }
+ if( $_FILES['fkep']['size'] > 1024 * 1024 * 10 ){
+ $error .= "A kép mérete nagyobb 10 MB-nál.
";
+ }
+ else if( $hszszoveg != "" && !$error){
+ if (copy($_FILES["fkep"]["tmp_name"], $feltolt_fajlnev)){
+ $kep = $rand . "__". $this->ekezet($_FILES["fkep"]["name"]);
+ $mit = $hova."/".$kep;
+ chmod($mit,0777);
+ }else{
+ $kep = "NULL";
+ }
+ }
+ }
+
+ if(!$error){
+ $this->mforum->hszbeszur($hszszoveg,$tema_id,$valasz,$kep);
+
+ $this->load->library('email');
+ $this->email->initialize();
+ // ertesitesek kikuldese
+ $kiknek = $this->mforum->ertesites($tema_id);
+ foreach($kiknek as $kinek){
+ $alap = $this->mforum->default_mail($kinek->email);
+ if(!$alap)
+ $alap = $kinek->email;
+
+ $mail_data['tema'] = $this->mforum->get_cim($tema_id)->cim;
+ $mail_data['hsz'] = $hszszoveg;
+
+ $this->email->from('info@cadline.hu', 'Cadline Weboldal');
+ $this->email->subject('ARCHLine.XP Fórum - Új hozzászólás');
+ $this->email->message($this->load->view('mail/forum_ujhsz', $mail_data, true));
+
+ $this->email->send($alap, 'smtp');
+ $this->email->clear();
+ }
+ // end ertesitesek kikuldese
+
+
+ $temaid = $this->phpsession->get('tema_id');
+ header("Location: listaz/$temaid");
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='testforum/ujhsz';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+ $data['error']=$error;
+ $data['hsz']=$this->input->post('hsz');
+
+ $this->load->view('site_forum',$data);
+ }
+ }else if( $this->phpsession->get('temaid') ){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='testforum/ujhsz';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('../editor/fckeditor');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ $this->index();
+ }
+ }
+
+ function valasz(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->uri->segment(3) ){
+ $this->phpsession->save('valasz',$this->uri->segment(3));
+ $id = $this->uri->segment(3);
+ $temaid = $this->mforum->get_temaidByHszid($id);
+ $this->phpsession->save('temaid',$temaid);
+ }
+ if( $tomb ){
+ if( $this->phpsession->get('temaid') ){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='testforum/ujhsz';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('../editor/fckeditor');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ $this->index();
+ }
+ }
+
+ function listaz(){
+ $this->phpsession->save('valasz',false);
+ if( !($this->phpsession->get('oldal')) ) $this->phpsession->save('oldal',0);
+ if( $this->uri->segment(3) == 'kov' ) $this->kovetkezo();
+ if( $this->uri->segment(3) == 'elozo' ) $this->elozo();
+
+ if( is_numeric($this->uri->segment(3)) ){
+ $tema_id = $this->uri->segment(3);
+ $this->phpsession->save('temaid',$tema_id);
+// redirect('forum/listaz');
+ }else if($this->phpsession->get('temaid')){
+ $tema_id = $this->phpsession->get('temaid');
+ }else{
+ $tema_id = 0;
+ }
+
+ if(!($tema_id) || !is_numeric($tema_id) || !$this->mforum->is_temaid($tema_id)){
+ redirect('forum');
+ }else{
+ $data['tartalom']='testforum/temamutat';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ if( !is_numeric($this->uri->segment(4)) )
+ $oldal = $this->phpsession->get('oldal');
+ else{
+ $oldal = $this->uri->segment(4);
+ $this->phpsession->save('oldal',$oldal);
+ }
+ $hszek = $this->mforum->get_lista($tema_id,$oldal);
+ foreach( $hszek as $hsz){
+ if( !($hsz->valasz == "0" || $hsz->valasz == "NULL") ){
+ $vszid = $hsz->valasz;
+ $elozo = $this->mforum->get_hsz($vszid);
+ if( $elozo->user == "" )
+ $elozo = $this->mforum->get_hsz2($vszid);
+ if( isset($elozo->user) && $elozo->user != "0" && $elozo->user != "" ){
+ $hsz->valasz = $elozo->user . ", (" . $elozo->datum . ")";
+ if( $elozo->user == 586 )
+ $hsz->valasz = "Németh Kálmán, (" . $elozo->datum . ")";
+ elseif( $elozo->user == 270 )
+ $hsz->valasz = "Tóth M.Levente, Mészáros Marcel, (" . $elozo->datum . ")";
+ }
+ elseif( $elozo )
+ $hsz->valasz = "[Törölt felhasználó], (" . $elozo->datum . ")";
+ else
+ $hsz->valasz = "-";
+ }
+ //if(!eng()) $hsz->szoveg = $this->csere2($hsz->szoveg);
+ if( strtotime($hsz->datum) < 1282039000) $hsz->szoveg = $this->csere2($hsz->szoveg);
+
+ if( $hsz->user_id == 586 ){
+ $hsz->user = "Németh Kálmán";
+ }elseif( $hsz->user_id == 270 ){
+ $hsz->user = "Tóth M.Levente, Mészáros Marcel";
+ }
+ }
+
+ if( !$hszek ){
+ $data['infok'] = array("2");
+ }else{
+ if( $this->mforum->vanmegoldal($tema_id,$this->phpsession->get('oldal')))
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('oldal') > 0 )
+ $data['elozo'] = true;
+ }
+
+ $data['hszek_json'] = json_encode($hszek);
+
+ $user = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($user['name']) )
+ $data['szerk']=true;
+ $data['temacim'] = $this->mforum->get_cim($tema_id)->cim;
+ $temakor_id = $this->mforum->get_tema1($tema_id)->temakor_id;
+ $data['temakorcim'] = $this->mforum->get_temakor1($temakor_id)->cim;
+ $data['temakorid'] = $temakor_id;
+ $data['tema_id'] = $tema_id;
+ $data['oldalak_szama'] = (int)$this->mforum->get_temaoldal($tema_id);
+ $data['akt_oldal'] = $oldal;
+
+ $data['hozzaszolasok'] = $hszek;
+
+ $data['meta']['keyw'] = $data['temacim'].', ';
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['title'] .= ' - ' . $data['temacim'];
+
+ $data['aktmenu'] = "1";
+ $data['style'] = array('jquery.ui'/*,'fancybox2'*/);
+ $data['javascript'] = array('../editor/fckeditor','jquery_ui'/*,'fancybox/jquery-1.3.2.min','fancybox/jquery.easing.1.3','fancybox/jquery.fancybox-1.2.1.pack','fancybox/fancy'*/);
+ $this->load->view('site_forum',$data);
+ }
+ }
+
+ function kovetkezo(){
+ $oldalszam = $this->phpsession->get('oldal');
+ if( $this->mforum->vanmegoldal($this->phpsession->get('temaid'),$oldalszam)){
+ $oldalszam++;
+ }
+ $this->phpsession->save('oldal',$oldalszam);
+ }
+
+ function elozo(){
+ $oldalszam = $this->phpsession->get('oldal');
+ if( $oldalszam > 0 )
+ $oldalszam--;
+ $this->phpsession->save('oldal',$oldalszam);
+ }
+
+ 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 login(){
+ $name = $this->input->post('name');
+ $passwd = $this->input->post('passwd');
+
+ $name = $this->csere($name);
+
+ if(!$passwd || !$name)
+ {
+ $this->belephiba(9);
+ }
+ else
+ {
+ $name2 = $this->ekezet($name);
+ $vanaktiv = $this->mforum->vanaktivprog($name);
+
+ if( ($this->mforum->belep($name,$passwd) || $this->mforum->belep($name2,$passwd))
+ && $vanaktiv )
+ {
+ $uid = $this->mforum->get_userid($name);
+ if( !$uid || !is_numeric($uid) ){
+ $this->belephiba(6);
+ }else{
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$name;
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+ $fuser['rang'] = $this->mforum->get_rang($uid);
+ $rang = $fuser['rang'];
+ }
+
+
+
+
+ // ha csak feltolto
+ if( $rang != "user" && $rang != "moderator" ){
+ $fuser['user_id'] = $uid;
+ $this->phpsession->save('feltolto',$fuser);
+ $this->belephiba(8);
+ }
+ //ha még nem fogadta el a szabályzatot:
+ elseif( !($this->mforum->szabalyzat($uid) ) ){
+ if(hun())
+ $lap = $this->mpages->get_row(454);
+ else
+ $lap = $this->mpages->get_row(559);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum szabályzat' : $data['title'] = 'ARCHLine.XP Forum Rules';
+ $data['tartalom'] = '/forum/szabalyzat';
+ $data['lap'] = $lap;
+ //$user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($name))
+ $data['moderator']=true;
+
+ //ha még nem fogadta el a szabályzatot:
+ if( !($this->mforum->szabalyzat($uid) ) ){
+ $data['uid'] = $uid;
+ $data['login'] = $name2;
+ $data['pw'] = md5($passwd);
+ $data['nemelfogad'] = true;
+ $data['infok'] = array("0");
+ }
+
+ $this->load->view('site_forum',$data);
+ }
+ else{
+ $fuser['user_id'] = $uid;
+ $this->phpsession->save('fuser',$fuser);
+ redirect('forum');
+ }
+ }else{
+ if( $name == "moderator" ){
+ $szam = date(W);
+ $this->mforum->jelszovaltmod($szam);
+ if( $this->mforum->belep($name,$passwd) ){
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$name;
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+ $uid = $this->mforum->get_userid($name);
+ $fuser['user_id'] = $uid;
+ $this->phpsession->save('fuser',$fuser);
+ redirect('forum');
+ }
+ }
+
+ if( !$vanaktiv )
+ $this->belephiba(7);
+ else{
+ $this->belephiba(6);
+ }
+ }
+ }
+ }
+
+ function belephiba($szoveg){
+ $data['tartalom']='testforum/temakorok';
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['csik']=array('home','forum');
+
+ if( !is_numeric($szoveg) ){
+ $data['error'] = $szoveg;
+ }
+ else{
+ $data['error'] = array($szoveg);
+ }
+
+ $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;
+ $tema->rov_cim = $tema->cim;
+
+ /*if(strlen($tema->cim) > 26){
+ $ut26 = array($cim[26]);
+ $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")
+ $tema->utolsouser = $this->mforum->get_userUid($xx->user)->nev;
+ 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'] = 1;
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function logout(){
+ unset($_SESSION['default']['fuser']);
+ unset($_SESSION['default']['feltolto']);
+ redirect('forum');
+ }
+
+ function szerkeszt(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->uri->segment(3) != "")
+ $hszid = $this->uri->segment(3);
+ else
+ //$hszid = $this->phpsession->get('hszid');
+ $hszid = $this->input->post('hszid');
+
+ if( $this->mforum->moderator($tomb['name']) || $this->mforum->get_sajathsz($tomb['user_id'], $hszid) ){
+ if($this->input->post('szerk')!=false){
+ //$hszid = $this->phpsession->get('hszid');
+ $hszid = $this->input->post('hszid');
+ $this->mforum->hszszerk($this->input->post('hsz'),$hszid);
+ $user_id = $this->mforum->get_hsz($hszid)->user_id;
+
+ if( $this->input->post('kepki')=='on' ){
+ if(hun())
+ $kep = $this->kepek_utvonal . $user_id ."/". $this->mforum->get_Kep($hszid)->kep;
+ elseif(eng())
+ $kep = $this->kepek_utvonal_eng . $user_id ."/". $this->mforum->get_Kep($hszid)->kep;
+
+ chmod($kep, 777);
+ unlink($kep);
+ $this->mforum->kepki($hszid);
+ }
+
+ $temaid = $this->phpsession->get('tema_id');
+ header("Location: listaz/$temaid");
+ }else if( $this->uri->segment(3) != "" ){
+ $this->phpsession->save('hszid',$this->uri->segment(3));
+
+ $data['szoveg']=$this->mforum->get_Text($this->phpsession->get('hszid'))->szoveg;
+ $kep = $this->mforum->get_Kep($this->phpsession->get('hszid'))->kep;
+ if( $kep != "" && $kep != "NULL" ){
+ $user_id = $this->mforum->get_hsz($this->phpsession->get('hszid'))->user_id;
+ if(hun())
+ $data['kep'] = "/".$this->kepek_utvonal. $user_id . "/".$kep;
+ elseif(eng())
+ $data['kep'] = "/".$this->kepek_utvonal_eng. $user_id . "/".$kep;
+ }
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['javascript'] = array('../editor/fckeditor');
+ $data['tartalom']='testforum/szerkeszt';
+ $data['csik']=array('home','forum');
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function torles(){
+ $tomb = $this->phpsession->get('fuser');
+ $hszid = $this->uri->segment(3);
+ if( $this->mforum->moderator($tomb['name']) || $this->mforum->get_sajathsz($tomb['user_id'], $hszid) ){
+ if( $this->uri->segment(3) != "" ){
+ $hszid = $this->uri->segment(3);
+ $uid = $this->mforum->torol($hszid);
+
+ //ha nincs kep a mappajaban:
+ if(hun())
+ $mappa = $this->kepek_utvonal . $uid;
+ elseif(eng())
+ $mappa = $this->kepek_utvonal_eng . $uid;
+
+ $handle = opendir($mappa);
+ //ha nincs fajl a konyvtarban, akkor toroljuk a mappat
+ chmod($mappa,0777);
+ $fajl = readdir($handle);
+ $fajl = readdir($handle);
+ $fajl = readdir($handle);
+ if(!($fajl)){
+ //closedir($mappa);
+ rmdir($mappa);
+ }
+
+ $tema_id = $this->phpsession->get('temaid');
+ if( is_int($this->mforum->get_temaoldal($tema_id)) && ($this->phpsession->get('oldal') == $this->mforum->get_temaoldal($tema_id)) ){
+ $this->elozo();
+ }
+ redirect('forum/listaz');
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tatnevez(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" && ($this->input->post('atnevez')==false) ){
+ $tid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='testforum/temaatnevez';
+ $data['csik']=array('home','forum');
+ $data['tema_id'] = $tid;
+ $data['temacim'] = $this->mforum->get_cim($tid)->cim;
+ $data['moderator'] = true;
+
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('atnevez')!=false){
+ $this->mforum->tatnevez($this->input->post('tid'),$this->input->post('ujnev'));
+
+ header("Location: index");
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tkatnevez(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" && ($this->input->post('atnevez')==false) ){
+ $tid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='testforum/tkatnevez';
+ $data['csik']=array('home','forum');
+ $data['tema_id'] = $tid;
+ $data['temacim'] = $this->mforum->get_tkcim($tid)->cim;
+ $data['moderator'] = true;
+
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('atnevez')!=false){
+ $this->mforum->tkatnevez($this->input->post('tid'),$this->input->post('ujnev'));
+
+ header("Location: index");
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tematorol(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $tomb && $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" ){
+ $tid = $this->uri->segment(3);
+ $this->mforum->tematorol($tid);
+
+ redirect('forum');
+ }else{
+ redirect('forum');
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function temakortorol(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $tomb && $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" ){
+ $tid = $this->uri->segment(3);
+ $this->mforum->temakortorol($tid);
+
+ redirect('forum');
+ }else{
+ redirect('forum');
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function mypost(){
+ $this->phpsession->save('valasz',false);
+
+ $data['tartalom']='testforum/mypost';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('forum');
+ $user = $this->phpsession->get('fuser');
+
+ if(!$user)
+ redirect('forum');
+
+ $hszek = $this->mforum->get_mypost($user['user_id']);
+ foreach( $hszek as $hsz){
+ $elo = $hsz->valasz;
+ $hsz->valasz = $this->mforum->get_valaszok($hsz->hsz_id);
+ $hsz->valaszdb = count($hsz->valasz);
+ $hsz->elozo = $this->mforum->get_hsz($elo);
+ $tema = $this->mforum->get_tema1($hsz->tema_id);
+ $hsz->tema = $this->mforum->get_tema1($hsz->tema_id);
+ $temakor = $this->mforum->get_temakor1($tema->temakor_id);
+ $hsz->temakor = $temakor->cim;
+
+ //print_r($hsz->elozo);
+ }
+
+ $data['hozzaszolasok'] = $hszek;
+ $data['hszdb'] = count($hszek);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+
+ $this->load->view('site_forum',$data);
+ }
+
+
+ function myuser(){
+ $user = $this->phpsession->get('fuser');
+ if($user){
+ $tomb = $this->phpsession->get('fuser');
+ $login = $tomb['name'];
+ $this->user($login);
+ }else
+ redirect('forum');
+ }
+
+ function user($login){
+ if(!$login)
+ redirect('forum');
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='testforum/user';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['user']=$login;
+ $data['adatok'] = $this->mforum->get_user($login);
+ $szemadatok = $this->mforum->get_user_szem($login);
+ $emailek = $szemadatok[0]->email;
+ $emailek = explode(";",$emailek);
+ $szemadatok[0]->email = "";
+ foreach( $emailek as $email ){
+ $szemadatok[0]->email .= $email . "
";
+ }
+ $van = $szemadatok[0]->nev;
+ if($van)
+ $data['szemadatok'] = $szemadatok;
+ else
+ $data['szemadatok'] = $this->mforum->get_user_alap($login);
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+
+ $kulcsok[$key_kulcs]->programok = $programs;
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }
+
+ function users(){
+ $user = $this->phpsession->get('fuser');
+ if( $user && $this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='testforum/users';
+ $data['csik']=array('home','forum');
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+ $this->phpsession->save('belep',"");
+
+ if( !($this->phpsession->get('uoldal')) ){
+ $this->phpsession->save('uoldal',0);
+ $oldal = 0;
+ }else{
+ $oldal = $this->phpsession->get('uoldal');
+ }
+
+ if( $this->uri->segment(3) == kov ){
+ $oldal++;
+ $this->phpsession->save('uoldal',$oldal);
+ }else if( $this->uri->segment(3) == elozo && $oldal > 0 ){
+ $oldal--;
+ $this->phpsession->save('uoldal',$oldal);
+ }
+ else if( is_numeric($this->uri->segment(3))){
+ $oldal = $this->uri->segment(3);
+ $this->phpsession->save('uoldal',$oldal);
+ }
+
+ if( $this->uri->segment(3) == "rendez" ){
+ $ord = $this->uri->segment(4);
+
+
+ $vissza = $this->phpsession->get('rendezvissza');
+ if($this->phpsession->get('rendez') == $ord){
+ $vissza = !$vissza;
+ }
+ $this->phpsession->save('rendezvissza',$vissza);
+
+
+ $this->phpsession->save('rendez',$ord);
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ }else if( $this->phpsession->get('rendez') ){
+ $ord = $this->phpsession->get('rendez');
+ $vissza = $this->phpsession->get('rendezvissza');
+ }else{
+ $ord = "nev";
+ $vissza = false;
+ }
+
+ $data['users']=$this->mforum->get_users($oldal,$ord,$vissza);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ukeres(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='testforum/users';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+ if( !($this->phpsession->get('ukoldal')) ){
+ $this->phpsession->save('ukoldal',0);
+ $oldal = 0;
+ }else{
+ $oldal = $this->phpsession->get('ukoldal');
+ }
+
+ if( is_numeric($this->uri->segment(3))){
+ $oldal = $this->uri->segment(3);
+ $this->phpsession->save('ukoldal',$oldal);
+ }
+
+ if( $this->uri->segment(3) == "rendez" ){
+ $ord = $this->uri->segment(4);
+
+ $vissza = $this->phpsession->get('rendezvissza');
+ if($this->phpsession->get('rendez') == $ord){
+ $vissza = !$vissza;
+ }
+ $this->phpsession->save('rendezvissza',$vissza);
+
+ $this->phpsession->save('rendez',$ord);
+ $oldal = 0;
+ $this->phpsession->save('ukoldal',0);
+ }else if( $this->phpsession->get('rendez') ){
+ $ord = $this->phpsession->get('rendez');
+ $vissza = $this->phpsession->get('rendezvissza');
+ }else{
+ $ord = "nev";
+ $vissza = false;
+ }
+
+ if( $this->input->post('klogin') || $this->input->post('knev') || $this->input->post('kemail') || $this->input->post('kulcssz') || ($this->input->post('belep') != -1 && $this->input->post('belep') != "" ) ){
+ $oldal = 0;
+ $this->phpsession->save('ukoldal',$oldal);
+ $klog = $this->input->post('klogin');
+ $this->phpsession->save('klogin',$this->input->post('klogin'));
+ $knev = $this->input->post('knev');
+ $this->phpsession->save('knev',$knev);
+ $kmail = $this->input->post('kemail');
+ $this->phpsession->save('kemail',$this->input->post('kemail'));
+ $kulcs = $this->input->post('kulcssz');
+ $this->phpsession->save('kulcssz',$this->input->post('kulcssz'));
+ $belep = $this->input->post('belep');
+ $this->phpsession->save('belep',$this->input->post('belep'));
+ }else{
+ $klog = $this->phpsession->get('klogin');
+ $knev = $this->phpsession->get('knev');
+ $kmail = $this->phpsession->get('kemail');
+ $kulcs = $this->phpsession->get('kulcssz');
+ $belep = $this->phpsession->get('belep');
+ }
+ $users = $this->mforum->get_kusers($oldal,$klog,$knev,$kmail,$belep,$kulcs,$ord,$vissza);
+ $data['users'] = $users;
+
+ if( $this->mforum->vanmegkuser($this->phpsession->get('ukoldal'),$klog,$knev,$kmail,$belep,$kulcs) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('ukoldal') > 0 )
+ $data['elozo'] = true;
+
+
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_kusersdb($klog,$knev,$kmail,$belep,$kulcs);
+ $data['akt_oldal'] = $oldal;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function edit_user(){
+ $user = $this->phpsession->get('fuser');
+ if($user && $this->mforum->moderator($user['name'])){
+ if( $this->uri->segment(3) != "" && ($this->input->post('edituser')==false) ){
+ $uid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználó szerkesztése' : $data['title'] = 'ARCHLine.XP Forum Edit User';
+ $data['tartalom']='testforum/edit_user';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+ $login = $this->mforum->get_login($uid);
+ $data['adatok'] = $this->mforum->get_user($login);
+
+ $szemadatok = $this->mforum->get_user_szem($login);
+
+ if($szemadatok[0])
+ $data['szemadat'] = $szemadatok[0];
+ else{
+ $cucc = $this->mforum->get_user_alap($login);
+ $data['szemadat'] = $cucc[0];
+ }
+
+ //$data['kulcsok'] = $this->mforum->get_user_kulcsok($login);
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+
+ $i=0;
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $i++;
+
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+
+ $kulcsok[$key_kulcs]->programok = $programs;
+
+
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('edituser')!=false){
+
+ $error = "";
+ $langerror = array();
+ if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') != $this->input->post('jelszo2') ){
+ $error .= "A megadott két jelszó nem egyezik.
";
+ array_push($langerror,0);
+ }else if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') == $this->input->post('jelszo2') && strlen($this->input->post('jelszo1') ) < 5 ){
+ $error .= "A megadott jelszó 5 karakternél rövidebb.
";
+ array_push($langerror,1);
+ }
+
+ $user = $tomb['name'];
+ //$myid = $this->mforum->get_userid($user);
+
+ if( $this->input->post('login') == "" ){
+ $error .= "A login mező értéke nem lehet üres.
";
+ array_push($langerror,4);
+ }
+
+ if( $this->input->post('login') != "" && !$this->mforum->szabadlogin($this->input->post('login'),$this->input->post('uid')) ){
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+ array_push($langerror,2);
+ }
+ elseif( strlen($this->input->post('login') ) < 5 ){
+ $error .= "A megadott login 5 karakternél rövidebb.
";
+ array_push($langerror,3);
+ }
+
+ if( $this->input->post('login') != $this->ekezet($this->input->post('login')) ){
+ $error .= "A felhasználó névben nem szerepelhet ékezet vagy szóköz!
";
+ array_push($langerror,5);
+ }
+
+
+ $uid = $this->input->post('uid');
+
+ if( !$error ){
+
+ $this->mforum->set_user($this->input->post('uid'),$this->input->post('nev'),$this->input->post('email'),$this->input->post('jelszo1'),$this->input->post('login'),$this->input->post('rang'));
+
+ redirect("forum/users");
+ }else{
+
+
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználó szerkesztése' : $data['title'] = 'ARCHLine.XP Forum Edit User';
+ $data['tartalom']='testforum/edit_user';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+
+ $login = $this->mforum->get_login($uid);
+ $data['adatok'] = $this->mforum->get_user($login);
+
+ $szemadatok = $this->mforum->get_user_szem($login);
+
+ if($szemadatok[0])
+ $data['szemadat'] = $szemadatok[0];
+ else{
+ $cucc = $this->mforum->get_user_alap($login);
+ $data['szemadat'] = $cucc[0];
+ }
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+
+ $i=0;
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $i++;
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+ $kulcsok[$key_kulcs]->programok = $programs;
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+ $data['error'] = $error;
+ $data['hibak2'] = $langerror;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+
+ print " ";
+ }
+
+ $ezt = "edit_user/".$uid;
+ header("Location: ".$ezt);
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujuser(){
+ $user = $this->phpsession->get('fuser');
+ if($user && $this->mforum->moderator($user['name'])){
+ if($this->input->post('do')!=false){
+ $login = $this->input->post('login');
+ $nev = $this->input->post('nev');
+ $jsz1 = $this->input->post('jelszo1');
+ $jsz2 = $this->input->post('jelszo2');
+ $email = $this->input->post('email');
+ $kulcs = $this->input->post('kulcs');
+ $rang = $this->input->post('rang');
+
+ if($kulcs)
+ $nUserID = $this->mforum->get_nUserID($kulcs);
+ else
+ $nUserID = "NULL";
+
+ $error = "";
+ $langerror = array();
+
+ if( $login == "" )
+ $error .= "Nincs login megadva.
";
+
+ if( $login != $this->ekezet($login) )
+ $error .= "A felhasználó névben nem lehet ékezet vagy szóköz.
";
+ elseif( !$this->mforum->szabadlogin($login,10000) )
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+
+ if( $jsz1 == "" || $jsz2 == "" || $jsz1 != $jsz2 )
+ $error .= "A két jelszó nem egyezik vagy nincsenek megadva.
";
+
+ if( $this->mforum->is_email($email) )
+ $error .= "A megadott e-mail-cím már szerepel az adatbázisban.
";
+
+ if(!$error){
+ $this->mforum->ujuser($login,$nev,$jsz1,$email,$nUserID,$rang);
+
+ redirect('forum/users');
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új felhasználó' : $data['title'] = 'ARCHLine.XP Forum new user';
+ $data['tartalom']='testforum/ujuser';
+ $data['csik']=array('home','forum');
+ $data['error2'] = $error;
+ $data['moderator']=true;
+ $data['javascript']=array('forum');
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }
+
+ }else{
+ $data['title'] = 'ARCHLine.XP Fórum új felhasználó';
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Új Felhasználó' : $data['title'] = 'ARCHLine.XP Forum New User';
+ $data['tartalom']='testforum/ujuser';
+ $data['csik']=array('home','forum');
+ $data['javascript']=array('forum');
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function del_user(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ $id = $this->uri->segment(3);
+ $this->mforum->del_user($this->uri->segment(3));
+ redirect("forum/users");
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujuserdb(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='testforum/users';
+ $data['csik']=array('home','forum');
+
+
+
+
+ $this->access_id = 36;
+
+ $this->load->model('mpartners');
+ $this->keydb = $this->load->database('clusers',true);
+ $search = false;//$this->input->post('search');
+
+ $from = 0;
+ $to = 999999;
+ $limit = 2000;
+
+ $this->keydb->query("SET NAMES utf8");
+ $result = $this->keydb->from('cl_fo_hardlock')->join('cl_users','cl_fo_hardlock.hlUser=cl_users.nUserID','left')->orderby('hlNum','desc')->where("hlCtrID ='".$this->access_id."'")->where('hlStat',1)->where("hlNum >= '".$from."' AND hlNum <= '".$to."'")->limit(99999)->get();
+
+ //$sorok = $result->result();
+
+
+
+
+
+ $query = $this->keydb->from('cl_fo_hardlock')->join('cl_users','cl_fo_hardlock.hlUser=cl_users.nUserID','left')->join('cl_users_emails','cl_users.nUserID=cl_users_emails.nUserID','left')->orderby('hlNum','desc')->where("hlCtrID ='".$this->access_id."'")->where('hlStat',1)->where('default',1)->where("hlNum >= '".$from."' AND hlNum <= '".$to."'")->limit(99999)->get();
+ $sorok = $query->result();
+
+
+ //$this->keydb->query("SET NAMES latin2");
+
+
+
+
+ if($result->num_rows()==0)
+ {
+ $data['sorok'] = false;
+ }
+ else
+ {
+ $data['sorok'] = $sorok;
+ $data['found'] = $result->num_rows();
+ }
+
+ $sorok2 = $sorok;
+ $i = 0;
+ $j = 0;
+ $db = 0;
+ foreach($sorok2 as $sor){
+ $mailek = $sor->email;
+ $mailek = explode(";",$mailek);
+
+ foreach( $mailek as $mail ){
+ $mail = trim($mail);
+
+ //megnezzuk hogy benne van-e az adatbázisban és aktív-e
+ if( $mail != "" && $sor->hlStat == 1 && !$this->mforum->is_email(strtolower($mail)) ){
+ $mailresz = explode('@',$mail);
+ $login = $mail;
+ $nev = $sor->strName;
+ $nev = trim($nev);
+ $jsz1 = $mailresz[0];
+ $nUserID = $sor->nUserID;
+ $rang = "user";
+
+ // eladási dátum 0000-00-00 -e
+ $datum = $this->keydb->from('cl_fo_programs')->where("prHlNum",$sor->hlNum)->select('prSellDate')->get()->row();
+ if($datum->prSellDate != '0000-00-00'){
+ $this->mforum->ujuser($login,$nev,$jsz1,strtolower($mail),$nUserID,$rang);
+ $db++;
+ $kik[$j]->Nev = $nev;
+ $kik[$j]->Login = $login;
+ $kik[$j]->Email = $mail;
+ $kik[$j]->Datum = $datum->prSellDate;
+ }
+ $j++;
+ }
+ }
+ $i++;
+ }
+ $data['darab'] = $db;
+ $data['kik'] = $kik;
+
+
+
+ $data['sorok2'] = $sorok2;
+
+
+
+
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $this->load->view('site_forum',$data);
+ }else
+ redirect('forum');
+ }
+
+ function myedit(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $tomb ){
+ if($this->input->post('mysave')!=false){
+
+ $error = "";
+ $langerror = array();
+ if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') != $this->input->post('jelszo2') ){
+ $error .= "A megadott két jelszó nem egyezik.
";
+ array_push($langerror,0);
+ }else if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') == $this->input->post('jelszo2') && strlen($this->input->post('jelszo1') ) < 5 ){
+ $error .= "A megadott jelszó 5 karakternél rövidebb.
";
+ array_push($langerror,1);
+ }
+
+ $user = $tomb['name'];
+ $myid = $this->mforum->get_userid($user);
+
+ if( $this->input->post('login') == "" ){
+ $error .= "A login mező értéke nem lehet üres.
";
+ array_push($langerror,4);
+ }
+
+ if( $this->input->post('login') != "" && !$this->mforum->szabadlogin($this->input->post('login'),$myid) ){
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+ array_push($langerror,2);
+ }
+ elseif( strlen($this->input->post('login') ) < 5 ){
+ $error .= "A megadott login 5 karakternél rövidebb.
";
+ array_push($langerror,3);
+ }
+
+ if( $this->input->post('login') != $this->ekezet($this->input->post('login')) ){
+ $error .= "A felhasználó névben nem szerepelhet ékezet vagy szóköz!
";
+ array_push($langerror,5);
+ }
+
+
+ $ertesitesek = $this->input->post('temak');
+ if(count($ertesitesek) == 0 || (count($ertesitesek) == 1 && $ertesitesek[0] == "") )
+ $ertesit = NULL;
+ elseif( count($ertesitesek) == count($this->mforum->get_temak()) )
+ $ertesit = "mind";
+ else
+ $ertesit = ";".implode(";", $ertesitesek).";";
+
+
+ if($error){
+ hun() ? $data['title'] = 'ARCHLine.XP Adatok változtatása' : $data['title'] = 'ARCHLine.XP Edit Data';
+ $data['tartalom']='testforum/myedit';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+ $data['error2'] = $error;
+ $data['hibak2'] = $langerror;
+
+ $user = $tomb['name'];
+ $user_id = $this->mforum->get_userid($user);
+ $data['user_id'] = $user_id;
+ $data['cucc'] = $this->mforum->get_user_alap($user);
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }else{
+ $plogin = $this->input->post('login');
+ $pnev = $this->input->post('nev');
+ $pjelszo = $this->input->post('jelszo1');
+
+ $this->mforum->myedit($plogin, $pnev, $pjelszo, $myid, $ertesit);
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['t_nev'] = $this->mforum->get_nev($plogin);
+ $fuser['name'] = $this->input->post('login');
+ $this->phpsession->save('fuser',$fuser);
+ $this->myuser();
+ }
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Adatok változtatása' : $data['title'] = 'ARCHLine.XP Edit Data';
+ $data['tartalom']='testforum/myedit';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ if(hun())
+ $nyelv = "hun";
+ else
+ $nyelv = "eng";
+
+ $user = $tomb['name'];
+ $user_id = $this->mforum->get_userid($user);
+ $data['user_id'] = $user_id;
+ $data['temak'] = $this->mforum->get_temak($nyelv);
+ $data['cucc'] = $this->mforum->get_user_alap($user);
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujjelszo(){
+ if($this->input->post('kuld')!=false){
+ $email = $this->input->post('email');
+ $uzenet = "A megadott e-mail-cím: " . $email;
+ //$uzenet = $email;
+
+ $ujjelszo = $this->mforum->ujjelszo($email);
+
+ if($ujjelszo){
+
+ $this->load->library('email');
+ $this->load->helper('email');
+ $this->email->initialize();
+ $this->email->addOfficialImages();
+
+ $mailnek->ujjsz = $ujjelszo;
+ $mailnek->login = $this->mforum->get_login2($email);
+
+
+ /* Akarmilyem mailcimet is adott meg, a default emailre kuldjuk a levelet */
+ $email2 = $this->mforum->default_mail($email);
+ if($email2 != "")
+ $email = $email2;
+
+
+ $this->email->from('info@cadline.hu', 'Cadline Weboldal');
+ if(hun())
+ $this->email->subject('Uj jelszo');
+ else
+ $this->email->subject('New Password');
+ $this->email->message($this->load->view('mail_ujjelszo',$mailnek,true));
+ $this->email->send($email,'smtp');
+
+ $uzenet = $email." -re kiküldtük az Ön új jelszavát.
";
+
+ }else{
+ $uzenet .= " nincs a felhasználók között.
";
+ }
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új jelszó' : $data['title'] = 'ARCHLine.XP Forum new password';
+
+ $data['uzenet']=$uzenet;
+ $this->phpsession->save('fuzenet',$uzenet);
+
+ if( isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'],'/collection/') ){
+ $data['tartalom']='collection/ujjelszo_valasz';
+ $data['style'] = array('temp/style_new');
+ $this->load->view('site_upload',$data);
+ }
+ else{
+ $data['tartalom']='testforum/temakorok';
+ $data['csik']=array('home','forum');
+ $this->load->view('site_forum',$data);
+ }
+
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új jelszó' : $data['title'] = 'ARCHLine.XP Forum new password';
+
+ $data['tartalom']='testforum/ujjelszo';
+ $data['csik']=array('home','forum');
+
+ if( strstr($_SERVER['HTTP_REFERER'],'collection/upload') || strstr($_SERVER['HTTP_REFERER'],'collection/submit') ){
+ $data['style'] = array('temp/style_new');
+ $this->load->view('site_upload',$data);
+ }
+ else{
+ $this->load->view('site_new',$data);
+ }
+ }
+ }
+
+ function szabalyzat(){
+ if(hun())
+ $lap = $this->mpages->get_row(454);
+ else
+ $lap = $this->mpages->get_row(559);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum szabályzat' : $data['title'] = 'ARCHLine.XP Forum Rules';
+ $data['tartalom'] = '/forum/szabalyzat';
+ $data['lap'] = $lap;
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $uid = $this->mforum->get_userid($user['name']);
+ //ha még nem fogadta el a szabályzatot:
+ if( !($this->mforum->szabalyzat($uid) ) ){
+ $data['uid'] = $uid;
+ $data['nemelfogad'] = true;
+ }
+
+ $data['aktmenu'] = "2";
+ $this->load->view('site_forum',$data);
+ }
+
+ function elfogad(){
+ if($this->input->post('el')=="igen"){
+
+ $uid = $this->input->post('uid');
+ $name = $this->input->post('fnev');
+ $passwd = $this->input->post('jelszo');
+ if( $this->mforum->belep($name,$passwd,false) ){
+ $this->mforum->elfogad($uid);
+
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$this->mforum->get_login($uid);
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+
+ $fuser['user_id'] = $uid;
+
+
+ $this->phpsession->save('fuser',$fuser);
+ $Date = date('Y-m-d',time());
+
+ $nUserID = $this->mforum->get_nUserID2($uid);
+ }
+
+ redirect('forum');
+
+ }else{
+ $this->logout();
+ }
+ }
+
+ function ido(){
+ die(date('Y-m-d H:i:s', time()));
+ }
+
+ function emailjavitas(){
+ $tomb = $this->phpsession->get('fuser');
+ if(!$tomb)
+ redirect('forum');
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='testforum/users';
+ $data['csik']=array('home','forum');
+
+ $cl_users = $this->mforum->get_cl_users();
+
+ $db = 0;
+ $cserek = "";
+ foreach($cl_users as $user){
+ $nUserID = $user->nUserID;
+ //print $user->strName;
+ $x = $this->mforum->cseremail($nUserID);
+ if( $x ){
+ $cserek .= $x;
+ $db++;
+ }
+ }
+
+ $data['email']=$db;
+ $data['cserek']=$cserek;
+
+
+
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function ujuserdb_eng(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='testforum/users';
+ $data['csik']=array('home','forum');
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $sorok = $this->mforum->get_cl_users_eng();
+
+ $i = 0;
+ $j = 0;
+ $db = 0;
+ foreach($sorok as $sor){
+ $mailek = $sor->strEMail;
+ $mailek = explode(";",$mailek);
+
+ foreach( $mailek as $mail ){
+ /* csak az elso email cimet veszi fel */
+ $mail = trim($mailek[0]);
+
+
+ //megnezzuk hogy benne van-e az adatbázisban és aktív-e
+ if( $mail != "" && $sor->hlStat == 1 && !$this->mforum->is_email(strtolower($mail)) ){
+ $mailresz = explode('@',$mail);
+ $login = $mail;
+ $nev = $sor->strName;
+ $nev = trim($nev);
+ $jsz1 = $mailresz[0];
+ $nUserID = $sor->nUserID;
+ $rang = "user";
+
+
+ // eladási dátum 0000-00-00 -e
+ $datum = $this->db->from('`clusers_eng`.`cl_fo_programs`')->where("prHlNum",$sor->hlNum)->select('prSellDate')->get()->row();
+
+ $prog = $this->db->query(" SELECT * FROM `clusers_eng`.`cl_fo_programs` WHERE prHlNum = '".$sor->hlNum."'")->result();
+
+ if($datum->prSellDate != '0000-00-00' && $this->mforum->szabadlogin($login) ){
+ $this->mforum->ujuser_eng($login,$nev,$jsz1,strtolower($mail),$nUserID,$rang);
+
+ // print "
Felvenném: ".$login.$nev.$jsz1.strtolower($mail).$nUserID.$rang;
+
+ $db++;
+ $kik[$j]->Nev = $nev;
+ $kik[$j]->Login = $login;
+ $kik[$j]->Email = $mail;
+ $kik[$j]->Datum = $datum->prSellDate;
+ }
+ $j++;
+ }
+ }
+ $i++;
+ }
+ $data['darab'] = $db;
+ $data['kik'] = $kik;
+
+ $data['sorok2'] = $sorok;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function info($info){
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/kiir';
+ $data['info'] = $info;
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function galeria(){
+ $user = $this->phpsession->get('fuser');
+
+ if( is_numeric($this->uri->segment(3)) ){
+ $this->galeriamutat();
+ }elseif($user){
+ $this->sajatgaleria();
+ }else{
+ redirect("forum");
+ }
+ }
+
+ function galeriamutat(){
+ $user_id = $this->uri->segment(3);
+ $lang = $this->muser->user['lang'];
+
+ $fajlok = $this->mforum->get_galeria($user_id,$lang);
+
+ $data["fajlok"] = $fajlok;
+ if(hun())
+ $data['utvonal'] = $this->galeria_utvonal.$user_id;
+ else
+ $data['utvonal'] = $this->galeria_utvonal_eng.$user_id;
+
+ $data['tartalom'] = '/forum/galeria';
+ $data['javascript'] = array(
+ 'interior_menu',
+ 'fancybox/jquery-1.3.2.min',
+ 'fancybox/jquery.easing.1.3',
+ 'fancybox/jquery.fancybox-1.2.1.pack',
+ 'fancybox/fancy'
+ );
+
+ $data['style'] = array('fancybox');
+
+ $this->load->view('site_forum',$data);
+
+ }
+
+ function sajatgaleria(){
+ $this->load->model('mrender');
+ $user = $this->phpsession->get('fuser');
+
+ if($user){
+ hun() ? $data['title'] = 'ARCHLine.XP Saját Galéria' : $data['title'] = 'ARCHLine.XP My Gallery';
+ $data['tartalom'] = '/forum/sajatgaleria';
+
+ $uid = $user['user_id'];
+ $data['uid'] = $uid;
+
+ $data['fajlok'] = $this->mforum->fajlok($uid);
+ $data['szabad_hely'] = (200 * 1024 * 1024) - $this->foglalt_hely($uid);
+
+ // $data['renderek'] = $this->mrender->get_byuserid($uid);
+
+ $data['javascript'] = array('fancybox/jquery-1.3.2.min','fancybox/jquery.easing.1.3','fancybox/jquery.fancybox-1.2.1.pack','fancybox/fancy','jquery','jquery_ui');
+ $data['style'] = array('fancybox2','jquery.ui');
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "5";
+ $this->load->view('site_forum',$data);
+ }else
+ redirect("forum");
+ }
+
+ function foglalt_hely($user_id){
+ if(hun())
+ $fajlok = $this->galeria_utvonal.$user_id."/";
+ else
+ $fajlok = $this->galeria_utvonal_eng.$user_id."/";
+
+ $total = 0;
+
+ $handle = opendir($fajlok);
+ while($file = readdir($handle)){
+ $total += filesize ($fajlok.$file);
+ if((is_dir($fajlok.$file.'/')) &&($file != '..')&&($file != '.'))
+ {
+ $total = $total + $this->foglalt_hely($fajlok.$file.'/');
+ }
+ }
+
+ return $total;
+ }
+
+ function feltolt(){
+ $user = $this->phpsession->get('fuser');
+ $uid = $user['user_id'];
+
+ if($uid && $_FILES["fajl"]["error"]==0){
+
+ $fajl = "";
+ $meret = 0;
+
+ if(hun())
+ $hova = $this->galeria_utvonal.$uid;
+ elseif(eng())
+ $hova = $this->galeria_utvonal_eng.$uid;
+
+ if(!is_dir($hova)){
+ mkdir($hova,0644);
+ chmod($hova,0777);
+ }
+
+
+ $feltolt_konyvtar = $hova."/";
+ //ha több fájl lenne ugyanazon a néven
+ $elotag = substr(time(),-6);
+ $fajlnev = $this->ekezet($_FILES["fajl"]["name"]);
+ $feltolt_fajlnev=$feltolt_konyvtar . $elotag . "__" . $fajlnev;
+
+ $error = "";
+ $mi = $_FILES['fajl']['name']."$";
+
+ $mire = "\.exe|\.EXE|\.php|\.PHP|\.sh|\.SH";
+ if( (ereg( $mire , $mi )) ){
+ $error .= "Hibás fájl kiterjesztés
";
+ }
+ if( $_FILES['fajl']['size'] > 1024 * 1024 * 10 ){
+ $error .= "A fájl mérete nagyobb 10 MB-nál.
";
+ }
+ else if( !$error){
+ if (copy($_FILES["fajl"]["tmp_name"], $feltolt_fajlnev)){
+ $fajl = $elotag . "__". $fajlnev;
+ $meret = $_FILES["fajl"]["size"];
+ $mit = $hova."/".$fajl;
+ chmod($mit,0777);
+
+
+ // elonezeti kep elkeszitese 150x113-ban
+ include('application/helpers/myimg_helper.php');
+ kepmeretezesvagas($feltolt_fajlnev,$hova,"elo_".$fajl,"150","113");
+
+ }else{
+ $fajl = "NULL";
+ $error = "Fájl másolás hiba.
";
+ }
+ }
+
+ if( !$error ){
+ $szamla = $this->input->post('szamla');
+ $info = $this->input->post('leiras');
+ $megoszt = 1;
+
+ if( $this->input->post('megosztas') != "on" ){
+ $megoszt = 0;
+ }
+
+ $this->mforum->feltolt($uid,$fajl,$meret,$szamla,$megoszt,$info);
+
+ redirect("forum/galeria/".$uid);
+ }else{
+ $this->info($error);
+ }
+
+
+ }else{
+ if( $_FILES['fajl']['error'] != 0 )
+ $this->info("Hiba a fájl feltöltésekor!");
+ else
+ redirect("forum");
+ }
+
+ }
+
+ function delfajl(){
+ $fajl_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ $user_id = $user['user_id'];
+
+ if(!$user)
+ redirect('forum');
+
+ if( is_numeric($fajl_id) && $this->mforum->sajatfajl($fajl_id, $user_id) ){
+ $this->load->model('mrender');
+
+ $fajl = $this->mforum->delfajl($fajl_id);
+
+ if(hun())
+ $mit = "public/forum-galeria/hun/".$user_id."/elo_".$fajl;
+ else
+ $mit = "public/forum-galeria/eng/".$user_id."/elo_".$fajl;
+
+ // elonezeti kep torlese ha van
+ if( file_exists( $mit ) ){
+ chmod($mit, 777);
+ unlink($mit);
+ }
+
+ // A fájlhoz tartozó rendereknél törölni a galériás fájl id-t.
+ $renderek = $this->mrender->get_rowBygforumgalid($fajl_id);
+ if( $renderek ){
+ foreach($renderek as $render){
+ $ertek = NULL;
+ $this->db->update('render_img',array('forumgal_id'=>$ertek),"render_id='".$render->render_id."'");
+ }
+ }
+ }
+ redirect("forum/galeria");
+ }
+
+ function editgaleria(){
+ $fajl_id = $this->input->post('fajl_id');
+ // $fajl_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ $user_id = $user['user_id'];
+
+ if(!$user)
+ redirect('forum');
+
+
+ if( is_numeric($fajl_id) && $this->mforum->sajatfajl($fajl_id, $user_id) ){
+ if( $this->input->post('do') ){
+ $leiras = $this->input->post('leiras');
+ $megoszt = 1;
+
+ if( $this->input->post('megosztas') != "on" ){
+ $megoszt = 0;
+ }
+
+ $this->mforum->editgaleria($fajl_id,$leiras,$megoszt);
+
+ redirect("forum/galeria");
+
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Saját Galéria' : $data['title'] = 'ARCHLine.XP My Gallery';
+ $data['tartalom'] = '/forum/editgaleria';
+
+ $data['uid'] = $user_id;
+ $data['fajlinfo'] = $this->mforum->fajlinfo($fajl_id);
+ if(hun())
+ $data['utvonal'] = $this->galeria_utvonal;
+ else
+ $data['utvonal'] = $this->galeria_utvonal_eng;
+
+ $data['utvonal'] .= "/".$user_id;
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "5";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect("forum");
+ }
+ }
+
+ function regisztracio(){
+ if($this->input->post('do') != ""){
+ $nev = $this->input->post('regnev');
+ $login = $this->input->post('email');
+ $email = $login;
+ $jelszo = $this->input->post('jelszo1');
+
+ $szabad = $this->mforum->szabadlogin($login,999999);
+ if( $szabad ){
+ //$this->mforum->ujuser($login,$nev,$jelszo,$email,"","feltolto");
+
+
+ $kod = md5($jelszo.time().$nev);
+
+ $record['login'] = $email;
+ $record['jelszo'] = md5($jelszo);
+ $record['nev'] = $nev;
+ $record['email'] = $email;
+ $record['rang'] = "guest";
+ $record['kod'] = $kod;
+ $record['datum'] = date("Y-m-d H:i:s",time());
+ $record['nyelv'] = $this->muser->user['lang'];
+
+ $this->db->insert('forum_user_temp',$record);
+
+
+ $this->load->helper('email');
+
+ //sending the e-mail
+ $mail_vars['kod'] = $kod;
+ $mail_vars['email'] = $email;
+ $mail_vars['first'] = $nev;
+
+ //set the authenticating link
+ $mail_vars['link'] = hun() ? 'http://archline.hu/forum/confirm/' . $kod : 'http://www.archlinexp.com/forum/confirm/' . $kod;
+
+ //setting and sending the email
+ $this->load->library('email');
+ $this->email->initialize();
+ $this->email->addOfficialImages();
+
+ $this->email->setFrom('info@cadline.hu', 'CadLine');
+
+ if(hun())
+ {
+ $mail_vars['mailcontent'] = 'mail/confirm_forum_hun';
+ $this->email->subject('ARCHLine.XP regisztráció');
+ }
+ else
+ {
+ $mail_vars['mailcontent'] = 'mail/confirm_forum_eng';
+ $this->email->subject('ARCHLine.XP registration');
+ }
+
+ $this->email->message($this->load->view('mail',$mail_vars,true));
+ $this->email->send($mail_vars['email'],'smtp');
+
+ redirect('forum/sentconf');
+ }
+ else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/regisztracio';
+ $data['javascript'] = array('forum');
+ $data['style'] = array('temp/style_interior');
+ $data['foglalt'] = "igen";
+
+ $this->load->view('site_upload',$data);
+ }
+ }else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/regisztracio';
+ $data['javascript'] = array('forum');
+ $data['style'] = array('temp/style_interior');
+
+ $this->load->view('site_upload',$data);
+ }
+ }
+
+ function sentconf(){
+ $data['tartalom']='testforum/sentconf';
+ $data['lang']=$this->muser->user['lang'];
+ $data['style'] = array('temp/style_new');
+
+ $this->load->view('site_upload',$data);
+ }
+
+ function confirm(){
+ $kod = $this->uri->segment(3);
+
+ $data['style'] = array('temp/style_new');
+
+ if( $this->mforum->confirm($kod) ){
+
+ /* a felhasználóhoz új eseményt felvenni, ha szerepel az adatbázisban */
+ $adatok = $this->mforum->get_userByKod($kod);
+ $nUserID = $this->mforum->get_nUserID30($adatok->email);
+ if( $nUserID ){
+ $this->load->model('mclusers');
+ $this->mclusers->addEvent($nUserID, 114, "Regisztráció");
+ }
+
+ $data['tartalom']='testforum/confirm_ok';
+ $data['lang']=$this->muser->user['lang'];
+ }else{
+ $data['tartalom']='testforum/confirm_hiba';
+ $data['lang']=$this->muser->user['lang'];
+ }
+
+ $this->load->view('site_upload',$data);
+ }
+
+ function belepfeltolto(){
+ if( $this->input->post("do") != "" ){
+ $login = $this->input->post("email");
+ $jelszo = $this->input->post("jelszo");
+
+ if( $this->mforum->belep($login,$jelszo) ){
+ print "ok";
+ }else
+ print "nem ok";
+
+ }else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/belepfeltolto';
+ $data['javascript'] = array('forum');
+
+ $this->load->view('site',$data);
+ }
+ }
+
+ function renderek(){
+ $this->load->model('mrender');
+ $user = $this->phpsession->get('fuser');
+ $feltolto = $this->phpsession->get('feltolto');
+
+ if($user){
+ $uid = $user['user_id'];
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ }elseif($feltolto){
+ $uid = $feltolto['user_id'];
+ }
+ else
+ redirect("forum");
+
+ hun() ? $data['title'] = 'ARCHLine.XP Renderek' : $data['title'] = 'ARCHLine.XP Renders';
+ $data['tartalom'] = '/forum/renderek';
+
+ $data['uid'] = $uid;
+
+ $renderek = $this->mrender->get_byuserid($uid);
+
+ foreach($renderek as $render){
+ if($render->allapot=='1' && file_exists($render->keszkep)){
+ list($width, $height) = getimagesize($render->keszkep);
+ $render->kepmeret = $width . " x ". $height;
+ }
+ else{
+ $render->kepmeret = '-';
+ }
+
+ }
+
+ $data['renderek'] = $renderek;
+
+ $data['onload'] = "betolt()";
+
+ $data['javascript'] = array('fancybox/jquery-1.3.2.min','fancybox/jquery.easing.1.3','fancybox/jquery.fancybox-1.2.1.pack','fancybox/fancy','jquery_ui');
+ $data['style'] = array('fancybox2','jquery.ui');
+ $data['aktmenu'] = "6";
+ $this->load->view('site_forum',$data);
+ }
+
+ function delrender(){
+ $this->load->model('mrender');
+
+ $render_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ if(!$user)
+ $user = $this->phpsession->get('feltolto');
+
+ if(!$user)
+ redirect('forum');
+
+ $render = $this->mrender->get_row($render_id);
+
+ if( is_numeric($this->uri->segment(3)) && $render->user_id == $user['user_id'] ){
+ $this->mrender->del($render_id);
+ }
+
+ header("Location: ".$_SERVER["HTTP_REFERER"]);
+ }
+
+ function rendercopy(){
+ $this->load->model('mrender');
+
+ $guid = $this->uri->segment(3);
+ $render = $this->mrender->get_rowByguid($guid);
+
+ if( is_numeric($render->render_id) ){
+ if( $this->muser->user['lang'] == "hun" )
+ $almappa = "hun";
+ else
+ $almappa = "eng";
+
+ $uid = $render->user_id;
+
+ $helye = "public/forum-galeria/".$almappa."/".$uid;
+
+ if(!is_dir($helye)){
+ mkdir($helye,0644);
+ chmod($helye,0777);
+ }
+
+ $fajluj = basename($render->keszkep);
+
+ $honnan = $render->keszkep;
+ $hova = $helye."/".$fajluj;
+
+ if( copy($honnan,$hova) ){
+ $meret = filesize($hova);
+ $this->mforum->feltolt($render->user_id,$fajluj,$meret,"","1",$render->render_name,$render->nyelv);
+ $fajl_id = $this->db->insert_id();
+ $this->db->update('render_img',array('forumgal_id'=>$fajl_id),"render_id='".$render->render_id."'");
+
+ $uzenet = array(4);
+ $this->phpsession->save('fuzenet',$uzenet);
+
+ // elonezeti kep masolasa is ha van
+ $fajlnev = basename($render->keszkep);
+ $mappak = substr( $render->keszkep,0,(-1*(strlen($fajlnev))) );
+ $elokep = $mappak."elo_".$fajlnev;
+ if(file_exists($elokep)){
+ $ujelokep = $helye."/elo_".$fajlnev;
+ copy($elokep,$ujelokep);
+ }
+ }else{
+ $uzenet = array(14);
+ $this->phpsession->save('fhiba',$uzenet);
+ }
+
+ redirect('forum/renderek');
+ }else{
+ $uzenet = array(14);
+ $this->phpsession->save('fhiba',$uzenet);
+ redirect('forum/renderek');
+ }
+ }
+
+ function renderletolt(){
+ $this->load->model('mrender');
+ $render_id = $this->uri->segment(3);
+ $render = $this->mrender->get_row($render_id);
+ if( isset($render->keszkep) && $render->keszkep != "" && file_exists($render->keszkep) ){
+ $path_parts = pathinfo($render->keszkep);
+ $ext = strtolower($path_parts["extension"]);
+
+ if($render->render_name == "")
+ $render->render_name = "Image";
+
+ header("Content-type: application-download");
+ header('Content-Disposition: attachment; filename="'.$render->render_name.'.'.$ext.'"');
+ readfile($render->keszkep);
+ }else{
+ print "hiba a letoltes kozben";
+ }
+ }
+
+ function szerver(){
+ print "";
+ print_r($_SERVER);
+ print "
";
+ }
+}
+
+function hasonlito( $a, $b ){
+ if ( $a->datum == $b->datum )
+ return 0;
+ if ( $a->datum > $b->datum )
+ return -1;
+ return 1;
+}
+
+?>
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/testforum.php.evidence.json b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/testforum.php.evidence.json
new file mode 100644
index 0000000..c518dbd
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/testforum.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6773",
+ "log_excerpt": "[quarantine] dev.cadline.hu:php7_update/partners.archlinexp.com/application/controllers/testforum.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/controllers/testforum.php)",
+ "original_sha256": "6eb44fd9b69b4cf5a4b0cb71210bb47fab65e8d04ad69b568c640e878cd52986",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1595503925,
+ "size": 68322,
+ "uid": 12425
+ },
+ "rel_path": "php7_update/partners.archlinexp.com/application/controllers/testforum.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "dev.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/helpers/sajatfeltolto.php b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/helpers/sajatfeltolto.php
new file mode 100644
index 0000000..4c9e7ee
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/helpers/sajatfeltolto.php
@@ -0,0 +1,102 @@
+
\ No newline at end of file
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/helpers/sajatfeltolto.php.evidence.json b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/helpers/sajatfeltolto.php.evidence.json
new file mode 100644
index 0000000..86c7f99
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/helpers/sajatfeltolto.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6831",
+ "log_excerpt": "[quarantine] dev.cadline.hu:php7_update/partners.archlinexp.com/application/helpers/sajatfeltolto.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/helpers/sajatfeltolto.php)",
+ "original_sha256": "75359fbae41809f21d9fb056c84ae525b579ad78f2e688033c3ac583b9dba833",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1403182246,
+ "size": 2184,
+ "uid": 12425
+ },
+ "rel_path": "php7_update/partners.archlinexp.com/application/helpers/sajatfeltolto.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "dev.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/views/objects/submit.php b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/views/objects/submit.php
new file mode 100644
index 0000000..6cdd0bb
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/views/objects/submit.php
@@ -0,0 +1,69 @@
+";
+ }*/
+
+}elseif( $this->input->post('hsz') != "" && !$error){
+ if (copy($_FILES["originalFilenameField"]["tmp_name"],$storeFilename)){
+ $prFile = $storeFilename;
+ $mit = $storeFolder."/".$kep;
+ chmod($mit,0777);
+ $prSize = $_FILES['originalFilenameField']['size'];
+ $tempFilename = $_FILES["originalFilenameField"]["tmp_name"];
+ }else{
+ $prFile = "NULL";
+ }
+ }
+
+
+
+$tempPath= $tempFolder.$tempFilename;
+$storePath = $storeFolder.$storeFilename;
+
+
+
+ //DEBUG:
+ print "";
+ print_r ($_POST);
+ print "tempFilename: $tempFilename\n";
+ print "originalFilename: $originalFilename\n";
+ print "storedFilename: $storedFilename\n";
+ print "tempFolder: $tempFolder\n";
+ print "storeFolder: $storeFolder\n";
+ print "tempPath: $tempPath\n";
+ print "storePath: $storePath\n";
+
+ print "
";
+
+ if ((strlen($tempFilename) < 3) || (strlen($originalFilename) < 3))
+ die ("Hibás fáljnevek!");
+
+ if (!rename($tempPath,$storePath))
+ die ("Nem sikerül a helyére másolni a feltöltött fájlt!");
+
+ print "Sikeres feltöltés ($originalFilename)
";
+
+?>
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/views/objects/submit.php.evidence.json b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/views/objects/submit.php.evidence.json
new file mode 100644
index 0000000..81f6d10
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/views/objects/submit.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6801",
+ "log_excerpt": "[quarantine] dev.cadline.hu:php7_update/partners.archlinexp.com/application/views/objects/submit.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/views/objects/submit.php)",
+ "original_sha256": "2cc8c8932a3a8f6e5137226df6e6b6e04836874f611f9b1ca366a0c3b96915ff",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1595503557,
+ "size": 2155,
+ "uid": 12425
+ },
+ "rel_path": "php7_update/partners.archlinexp.com/application/views/objects/submit.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "dev.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/views/projects/submit.php b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/views/projects/submit.php
new file mode 100644
index 0000000..9ecb0d5
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/views/projects/submit.php
@@ -0,0 +1,68 @@
+";
+ }*/
+
+}elseif( $this->input->post('hsz') != "" && !$error){
+ if (copy($_FILES["originalFilenameField"]["tmp_name"],$storeFilename)){
+ $prFile = $storeFilename;
+ $mit = $storeFolder."/".$kep;
+ chmod($mit,0777);
+ $prSize = $_FILES['originalFilenameField']['size'];
+ $tempFilename = $_FILES["originalFilenameField"]["tmp_name"];
+ }else{
+ $prFile = "NULL";
+ }
+ }
+
+
+$tempPath= $tempFolder.$tempFilename;
+$storePath = $storeFolder.$storeFilename;
+
+
+
+ //DEBUG:
+ print "";
+ print_r ($_POST);
+ print "tempFilename: $tempFilename\n";
+ print "originalFilename: $originalFilename\n";
+ print "storedFilename: $storedFilename\n";
+ print "tempFolder: $tempFolder\n";
+ print "storeFolder: $storeFolder\n";
+ print "tempPath: $tempPath\n";
+ print "storePath: $storePath\n";
+
+ print "
";
+
+ if ((strlen($tempFilename) < 3) || (strlen($originalFilename) < 3))
+ die ("Hibás fáljnevek!");
+
+ if (!rename($tempPath,$storePath))
+ die ("Nem sikerül a helyére másolni a feltöltött fájlt!");
+
+ print "Sikeres feltöltés ($originalFilename)
";
+
+?>
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/views/projects/submit.php.evidence.json b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/views/projects/submit.php.evidence.json
new file mode 100644
index 0000000..846a74d
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/views/projects/submit.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6802",
+ "log_excerpt": "[quarantine] dev.cadline.hu:php7_update/partners.archlinexp.com/application/views/projects/submit.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/application/views/projects/submit.php)",
+ "original_sha256": "a60aa86f2aafb6a1fbfab05e06f158279b701126547b74e6c4d96599a487c7dc",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1595503586,
+ "size": 2155,
+ "uid": 12425
+ },
+ "rel_path": "php7_update/partners.archlinexp.com/application/views/projects/submit.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "dev.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/nonpro.php b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/nonpro.php
new file mode 100644
index 0000000..7c8b198
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/nonpro.php
@@ -0,0 +1,119 @@
+init($config['db_host'], $config['db_name'], $config['db_user'], $config['db_pass']);
+ $cntry = $_POST['orszag'];
+
+
+ //Utolsó order Number
+ $msh->query("SELECT `order` FROM `o_orders` WHERE `country` = '{$cntry}' ORDER BY `id` DESC limit 1");
+ $order=$msh->fetchNext();
+ $orderNumber = $order['order'];
+ // Majd a rákövetkező, ez kerül be adatbázisba
+ $kezdo = strpos($orderNumber, "-")+1;
+ $veg = strpos($orderNumber, "/")-2;
+ $szam = (int)substr($orderNumber, $kezdo, $veg)+1;
+ $prOrderNumber = "E-".$szam."/".date("Y");
+
+ $msh->query("SELECT `ctrNameEng` FROM `countries` WHERE `ctrID` = '{$cntry}'");
+ $ctryName = $msh->fetchNext();
+ $orszagNev = $ctryName['ctrNameEng'];
+
+
+
+ //Fájlnév
+ // $temp = explode(".", $_FILES["file"]["name"]); <-- Ha megváltozik a fájl neve, akkor a kiterjesztés itt lesz
+ // $fileName = $fajlNev.'.'.end($temp);
+
+ $fileName = $_FILES["file"]["name"];
+
+ //Célmappa
+ $targetDir = "../../";
+ $targetFilePath = $targetDir.$fileName;
+
+ // Engedélyezett fájlkiterjesztések
+ $fileType = pathinfo($targetFilePath,PATHINFO_EXTENSION);
+ $allowTypes = array('jpg', 'png', 'jpeg', 'gif', 'pdf', 'docx', 'doc', 'txt', 'bmp');
+
+ if (in_array($fileType, $allowTypes)) {
+ // Feltöltés a szerverre
+ if (move_uploaded_file($_FILES["file"]["tmp_name"], $targetFilePath)) {
+ // $eredmeny['sikeres'] = "Sikeres felöltés";
+ }
+ else {
+ $eredmeny['hiba'] = "Error in file uploading";
+ echo json_encode($eredmeny);
+ return false;
+ }
+ }
+ else {
+ $eredmeny['hiba'] = "Unknown file extension";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+
+ //recipient
+ $to = 'office@cadline.hu';
+ //sender
+ $from = 'partnering@archlinexp.com';
+ $fromName = 'ARCHLineXP Retail Store Enrollment Certification';
+
+ //email subject
+ $subject = 'Attachment for order: '.$orszagNev.' '.$prOrderNumber.' Non-profit';
+
+ //attachment file path
+ $file = $targetFilePath;
+
+ //email body content
+ $htmlContent = 'Enrollment Certification
';
+
+ //header for sender info
+ $headers = "From: $fromName"." <".$from.">";
+
+ //boundary
+ $semi_rand = md5(time());
+ $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
+
+ //headers for attachment
+ $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\"";
+
+ //multipart boundary
+ $message = "--{$mime_boundary}\n" . "Content-Type: text/html; charset=\"UTF-8\"\n" .
+ "Content-Transfer-Encoding: 7bit\n\n" . $htmlContent . "\n\n";
+
+ //preparing attachment
+ if(!empty($file) > 0){
+ if(is_file($file)){
+ $message .= "--{$mime_boundary}\n";
+ $fp = @fopen($file,"rb");
+ $data = @fread($fp,filesize($file));
+
+ @fclose($fp);
+ $data = chunk_split(base64_encode($data));
+ $message .= "Content-Type: application/octet-stream; name=\"".basename($file)."\"\n" .
+ "Content-Description: ".basename($files[$i])."\n" .
+ "Content-Disposition: attachment;\n" . " filename=\"".basename($file)."\"; size=".filesize($file).";\n" .
+ "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n";
+ }
+ }
+ // $message .= "--{$mime_boundary}--";
+ $returnpath = "-f" . $from;
+
+ //send email
+ $mail = @mail($to, $subject, $message, $headers, $returnpath);
+
+ //email sending status
+ // echo $mail?"Mail sent.
":"Mail sending failed.
";
+
+ unlink($targetFilePath);
+
+}
+?>
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/nonpro.php.evidence.json b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/nonpro.php.evidence.json
new file mode 100644
index 0000000..18d76ab
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/nonpro.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6884",
+ "log_excerpt": "[quarantine] dev.cadline.hu:php7_update/partners.archlinexp.com/public/order/nonpro.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/nonpro.php)",
+ "original_sha256": "c1a490b958a2c4c3b108788f5a11b1d2271539b2a3127ed3af5c04b1032f72a7",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1593607276,
+ "size": 4090,
+ "uid": 12425
+ },
+ "rel_path": "php7_update/partners.archlinexp.com/public/order/nonpro.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "dev.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/szerver.php b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/szerver.php
new file mode 100644
index 0000000..68e2108
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/szerver.php
@@ -0,0 +1,1855 @@
+init($config['db_host'], $config['db_name'], $config['db_user'], $config['db_pass']);
+$conn = new mysqli($config['db_host'], $config['db_user'], $config['db_pass'], $config['db_name']);
+
+$ip = $_SERVER['REMOTE_ADDR'];
+$eredmeny = [];
+$sesion_id = bin2hex(openssl_random_pseudo_bytes(10));
+
+if (mysqli_real_escape_string($conn, $_GET['bizt']) != mysqli_real_escape_string($conn, $_GET['biztonsagi']) || mysqli_real_escape_string($conn, $_GET['confirm']) != "Y") {
+ $eredmeny["hiba"] = "Your security answer was wrong or you forgot the confirm checkbox!
+
+ Continue.";
+} else {
+ $query = "SELECT ip, COUNT(ip) as szam FROM o_orders WHERE ip='".$ip."' AND DATE=CURDATE()";
+ $msh->query($query);
+ $limit = $msh->fetchNext();
+
+ $msh->query("SELECT `limit` FROM `o_products` limit 1");
+ $max_limit = $msh->fetchNext();
+
+ if ($limit['szam'] < $max_limit['limit']) { // Napi limit
+ define('PATH_CODEGEN', "/usr/local/sbin/codegen");
+
+ $kategoria = mysqli_real_escape_string($conn, $_GET['kategoria']); // Lehet: perp, upgrade, akcio, nonprofit, hardlock, module
+ $hl_prot = mysqli_real_escape_string($conn, $_GET['hl_prot']);
+ $program = mysqli_real_escape_string($conn, $_GET['prg']);
+ $cntry2 = mysqli_real_escape_string($conn, $_GET['cntry']);
+ $cntry = substr($cntry2, 0, 2); // 1 orszagon belul tobb viszontelado lehetseges, ezert 3 jegyu koddal jelentkeznek be
+ $ma = date("Y-m-d");
+ $email = mysqli_real_escape_string($conn, $_GET['email']);
+ $u_name = mysqli_real_escape_string($conn, $_GET['name']);
+ $info = mysqli_real_escape_string($conn, $_GET['info']);
+
+ $query = "SELECT DISTINCT `email`, `sub_email` FROM `o_products` WHERE `lang` = '{$cntry2}'";
+ $msh->query($query);
+ $kapcsolat = $msh->fetchNext();
+
+ if ($kapcsolat['email'] == "") {
+ $eredmeny["hiba"] = "Access denied
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $osszeg = "SELECT * FROM `o_products` WHERE `termek` = '".$program."' AND `lang` = '".$cntry2."' AND `kategoria` = '".$kategoria."'";
+ $msh->query($osszeg);
+ $ertek2 = $msh->fetchNext();
+ $price = $cntry == 11 ? $ertek2["usd"] : $ertek2["euro"];
+ $akcio = $ertek2["akcio"];
+
+ if ($akcio != '' && $akcio != null && date('Y-m-d') <= $ertek2['ackio_date']) $price = $akcio;
+
+ // TODO: spanyoloknak nem mukodik
+ /*if ($ertek2["is_invoice"] == 0) {
+ $eredmeny['hiba'] = "You have invoice(s) more than 14 days overdue.
+
+ The web-order system is temporary not available for attempts to create a new order.
+
+ Please advise as to whether payment has been scheduled.
+
+ If you require any further information from us, please contact us at office@cadline.hu
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }*/
+
+ $isInvoice = false;
+ $tax = TaxPayer::TAXPAYER_HAS_TAXNUMBER;
+ $curr = "EUR";
+ $cur = Currency::CURRENCY_EUR;
+ $lang = Language::LANGUAGE_EN;
+ $prod_prefix = "EU";
+ $inv_prefix = "EUR";
+ switch ($cntry)
+ {
+ case '39': // Olaszorszag
+ $lang = Language::LANGUAGE_IT;
+ break;
+ case '43': // Ausztria
+ $lang = Language::LANGUAGE_DE;
+ break;
+ case '49': // Nemetorszag
+ $lang = Language::LANGUAGE_DE;
+ break;
+ case '38': // Horvatorszag
+ $lang = Language::LANGUAGE_HR;
+ $isInvoice = true;
+ break;
+ case '33': // Franciaorszag
+ $lang = Language::LANGUAGE_FR;
+ $isInvoice = true;
+ break;
+ case '42': // Csehorszag
+ $lang = Language::LANGUAGE_CZ;
+ $isInvoice = true;
+ break;
+ case '48': // Lengyelorszag
+ $lang = Language::LANGUAGE_PL;
+ $isInvoice = true;
+ break;
+ case '34': // Spanyolorszag
+ $lang = Language::LANGUAGE_ES;
+ $isInvoice = true;
+ break;
+ case '37': // TESZT
+ $tax = TaxPayer::TAXPAYER_NO_TAXNUMBER;
+ $isInvoice = false;
+ break;
+ case '82': //Korea
+ $prod_prefix = "Non-EU";
+ $isInvoice = true;
+ break;
+ case '61': //Ausztralia
+ $prod_prefix = "Non-EU";
+ $isInvoice = true;
+ break;
+ case '88': //Tajvan
+ $prod_prefix = "Non-EU";
+ break;
+ case '44': //UK
+ $prod_prefix = "Non-EU";
+ break;
+ case '84': //Vietnam
+ $prod_prefix = "Non-EU";
+ break;
+ case '52': //Mexiko
+ $prod_prefix = "Non-EU";
+ break;
+ case '60': //Malajzia
+ $prod_prefix = "Non-EU";
+ break;
+ case '30': //Gorogorszag
+ $isInvoice = true;
+ break;
+ case '51': //Portugalia
+ $isInvoice = true;
+ break;
+ case '11': // USA
+ $curr = "USD";
+ $cur = Currency::CURRENCY_USD;
+ $prod_prefix = "Non-EU";
+ $inv_prefix = "USD";
+ $isInvoice = true;
+ break;
+ case '71': // Lettorszag
+ $isInvoice = true;
+ break;
+ case '86': // Szlovenia
+ $isInvoice = true;
+ break;
+ default: // Minden mas
+ $tax = TaxPayer::TAXPAYER_NO_TAXNUMBER;
+ break;
+ }
+
+ if (mysqli_real_escape_string($conn, $_GET['user']) == "ismeretlen") {
+ if ($kategoria == 'nonp') $status = '4';
+ else $status = '11';
+
+ $query = "SELECT id FROM distributors WHERE ctrID = {$cntry}";
+ $msh->query($query);
+ $dist = $msh->fetchNext();
+
+ if (!empty($dist)) $distID = $dist['id'];
+ else $distID = 0;
+
+ $insert = $msh->insert('users', array(
+ 'strName' => $u_name,
+ 'nManagerID' => '36',
+ 'nSchoolID' => '0',
+ 'strLease' => '',
+ 'deleted' => '0',
+ 'old_db' => 'clusers_eng',
+ 'bNewsletter' => 'N',
+ 'strEMail' => $email,
+ 'strCurrency' => $curr,
+ 'nCtrID' => $cntry,
+ 'nUserStatus' => $status,
+ 'nDistID' => $distID
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ }
+
+ if ($isInvoice) {
+ $actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
+
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $actual_link,
+ 'session_id' => $cntry,
+ 'insert_date' => date('Y-m-d h:i:s')
+ ));
+ }
+
+ $felhasznalo = "SELECT `nUserID` FROM `users` WHERE `strEMail` = '".$email."' limit 1";
+ $msh->query($felhasznalo);
+ $felh = $msh->fetchNext();
+ $user = $felh['nUserID'];
+
+ if (mysqli_real_escape_string($conn, $_GET['user']) == "ismeretlen") {
+ $insert = $msh->insert('u_emails', array(
+ 'email' => $email,
+ 'nUserID' => $user,
+ 'default' => '1',
+ 'active' => '1',
+ 'deleted' => '0',
+ 'newsletter' => '0'
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ }
+
+ $query = "SELECT DISTINCT `email`, `sub_email` FROM `o_products` WHERE `lang` = '{$cntry}'";
+ $msh->query($query);
+ $kapcsolat = $msh->fetchNext();
+
+ $query = "SELECT `ctrNameEng` FROM `countries` WHERE `ctrID` = '{$cntry}'";
+ $msh->query($query);
+ $ctryName = $msh->fetchNext();
+
+ //Utolso order Number
+ $msh->query("SELECT `order` FROM `o_orders` WHERE `country` = '{$cntry2}' ORDER BY `id` DESC limit 1");
+ $order = $msh->fetchNext();
+ $orderNumber = $order['order'];
+ $kezdo = strpos($orderNumber, "-")+1; // Majd a rakovetkezo, ez kerul be adatbazisba
+ $veg = strpos($orderNumber, "/")-2;
+ $szam = (int)substr($orderNumber, $kezdo, $veg)+1;
+ $prOrderNumber = "E-".$szam."/".date("Y");
+
+ if ($isInvoice && $price != 0) {
+ $partners = "SELECT * FROM szamla_agent.partnerek WHERE ország = ".$cntry2;
+ $msh->query($partners);
+ $partner = $msh->fetchNext();
+
+ $date = new DateTime(date('Y-m-d'));
+ $date->modify('+'.$partner["fizetési_határidő"]." day");
+
+ $agent = SzamlaAgentAPI::create('3i73vj72wt7h3ig78wrawt7h3ik5batswt7h3inhzw', false, Log::LOG_LEVEL_ERROR); // Szamla Agent CADLine kulcs
+ //$agent = SzamlaAgentAPI::create('c9k2ydfs2c2sa29c2uti9msiehc3b6zrr48qbvsqbs', false, Log::LOG_LEVEL_OFF); // Teszt Kulcs
+
+ $invoice = new Invoice(Invoice::INVOICE_TYPE_E_INVOICE);
+ //$invoice = new Invoice(Invoice::INVOICE_TYPE_P_INVOICE); //Teszt Szamla
+
+ $header = $invoice->getHeader();
+ $header->setPaymentMethod(Invoice::PAYMENT_METHOD_TRANSFER);
+ $header->setCurrency($cur);
+ $header->setLanguage($lang);
+ $header->setPaymentDue($date->format('Y-m-d'));
+ $header->setComment("*Please use the invoice number (E-EUR-2020-xxx) as a reference number to identify your payment.
+
+ Banktransfer info:
+ K&H BANK Hungary
+ IBAN: HU89 1040 0951 4955 4949 4954 1028
+ SWIFT CODE: OKHBHUHB");
+ $header->setPrefix($inv_prefix);
+
+ $seller = new Seller('K&H Bank EUR', 'IBAN: HU89 1040 0951 4955 4949 4954 1028');
+ $seller->setEmailReplyTo('office@cadline.hu');
+ $seller->setEmailSubject('Számlaértesítő / Invoice - CadLine Kft.');
+ $seller->setEmailContent('Tisztelt/Dear '.$partner["kapcsolattartó_neve"].',
+
+
+ Mellékelten küldjük aktuális számláját.
+ Kérjük, utaláskor a közlemény rovatban KIZÁRÓLAG a számlaszámot tüntesse fel! (pl.: E-HUF-2020-xxxx)
+
+ Amennyiben ezzel kapcsolatban bármilyen kérdése merülne fel, kérjük hívja Ügyfélszolgálatunkat, ahol munkatársaink készséggel állnak ügyfeleink rendelkezésére.
+
+ Cadline Ltd invoice is attached. Please use the invoice number (E-EUR-2020-xxx) as a reference number to identify your payment. Payment made via wire transfer must be made in full including any fees/charges for the wire transfer, which are your responsibility. (If your bank uses an intermediary bank, there may be additional charges.) If payment is not received in full, you will be invoiced for any balance due on the account.
+ Payment must be completed by the "due date" of the invoice date.
+
+
+ Üdvözlettel / Sincerely:
+ CadLine Office');
+ $invoice->setSeller($seller);
+
+ $buyer = new Buyer($partner["partner"], $partner["irányítószám"], $partner["település"], $partner["utca_házszám"]);
+ $buyer->setTaxPayer($tax);
+
+ if ($partner["közösségi_adószám"] != "") {
+ $buyer->setTaxNumberEU($partner["közösségi_adószám"]);
+ $afa_key = "EU";
+ } elseif ($partner["adószám"] != "") {
+ $buyer->setTaxNumber($partner["adószám"]);
+ $afa_key = "EUK";
+ } elseif ($partner["ország"] == 61) {
+ $afa_key = "EUK";
+ } else {
+ $afa_key = "27"; // Item::DEFAULT_VAT
+ $afa = $afa_key / 100;
+ }
+
+ $buyer->setEmail($partner["email"]);
+ $buyer->setSendEmail(true);
+ $invoice->setBuyer($buyer);
+
+ $product = "SELECT product_id FROM szamla_agent.web_product WHERE `web_id` = '".$ertek2['id']."'";
+ $msh->query($product);
+ $product_id = $msh->fetchNext();
+
+ $termekek = "SELECT * FROM szamla_agent.termekek WHERE id='".$product_id["product_id"]."'";
+ $msh->query($termekek);
+ $termek = $msh->fetchNext();
+ }
+
+ $hardlock = "SELECT megnevezés, nettó FROM szamla_agent.termekek WHERE id='30'";
+ $msh->query($hardlock);
+ $hardlock_price = $msh->fetchNext();
+
+ $verz = "SELECT `verCode`, verID FROM `p_versions` WHERE `verActual` = 'Y'";
+ $msh->query($verz);
+ $verzi = $msh->fetchNext();
+ $version = $verzi['verCode'];
+ $prg_product_id = 1;
+ $generate_prev_program = false;
+
+ $sellDate = date("Y-m-d H:i:s");
+ $actDate = date("Y-m-d H:i:s");
+ $fizetve = '2050-01-01';
+ $time = date("Y-m-d H:i:s");
+ $lastMod = date("Y-m-d H:i:s");
+ $stat = 0;
+ $invoiceDateFrom = date('Y-m', time());
+ $contact = 0;
+ $regi_kulcs = '';
+
+ switch ($kategoria) {
+ case 'perp':
+ if (mysqli_real_escape_string($conn, $_GET['reszlet']) == "Y") {
+ switch ($cntry) {
+ case '43':
+ $reszlet = '3';
+ $payment = 'Instalments: 4 Period: quarterly';
+ $fizHatIdo = date('Y-m', strtotime($ma. '+365 days'));
+ if (strstr($program, "Professional") || strstr($program, "Prof.")) {
+ $payment = 'Instalments: 4 Period: monthly';
+ }
+ break;
+
+ case '39':
+ $reszlet = "12";
+ $payment = 'Instalments: 2 Period: yearly';
+ $fizHatIdo = date('Y-m', strtotime($ma. '+365 days'));
+ break;
+
+ case '48':
+ $reszlet = "1";
+ $payment = 'Instalments: 4 Period: monthly';
+ $fizHatIdo = date('Y-m', strtotime($ma. '+120 days'));
+ break;
+
+ case '42':
+ $reszlet = "1";
+ $payment = 'Instalments: 6 Period: monthly';
+ $fizHatIdo = date('Y-m', strtotime($ma. '+180 days'));
+ break;
+ }
+ } else {
+ $reszlet = "";
+ $payment = 'pay in full';
+ $fizHatIdo = date('Y-m', strtotime($ma. '+365 days'));
+ }
+
+ $type = $ertek2['type'];
+
+ $keres = "SELECT `verID` FROM `p_versions` ORDER BY `verCode` DESC limit 1";
+ $msh->query($keres);
+ $limit = $msh->fetchNext();
+
+ $alap_ar = $price; // $alap_ar megszunik!!!!
+ $lan = "0";
+ $ertek = $price;
+ $ev2 = date("Y");
+ $elozoEv1 = $ev2-1;
+ $elozoEv2 = $ev2-2;
+ $elozoEv3 = $ev2-3;
+ $elozoEv4 = $ev2-4;
+ $msg = "";
+ $msg2 = "";
+ $msg3 = "";
+ $msg4 = "";
+
+ if ($hl_prot == "Y") { // Ker hardlockot
+ $kulcs = mysqli_real_escape_string($conn, $_GET['hl_num']);
+ $hardlockPrice = $hardlock_price["nettó"];
+ $ertek = $price + $hardlockPrice;
+ $hardlock_id = $cntry;
+
+ if ($cntry == "43" || $cntry == "39") $ertek = $price;
+ }
+
+ if ($hl_prot == "N") { // Nem ker hardlockot -> szoftveres kulcs
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '95%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $kulcsok = $msh->fetchNext();
+ $kulcs = $kulcsok['hlNum']+1;
+ $hardlock_id = "95";
+ }
+
+ $number = substr($kulcs, 2, 4);
+
+ if ((mysqli_real_escape_string($conn, $_GET['code_prev_version']) == "Y" && $generate_prev_program == false) || mysqli_real_escape_string($conn, $_GET['ver_2']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_3']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_4']) == "Y") {
+ if ($cntry == '37' || $cntry == '43') $ertek += 150;
+ }
+
+ $live = $alap_ar;
+ if(mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y") {
+ $live += 100;
+ $ertek += 100;
+ }
+
+ $subtotal = $price;
+ if ((strpos($program, "Interior") || strpos($program, "Professional")) && strpos($program, "LIVE")) {
+ $subtotal -= 100;
+ $live_item = "Subtotal: 100";
+ }
+
+ if (((strpos($program, "Interior") || strpos($program, "Professional")) && strpos($program, "LIVE") && strpos($program, "option") == FALSE) || mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y") {
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '$cntry%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $live_kulcsok = $msh->fetchNext();
+
+ $query = "SELECT * FROM `p_versions` WHERE currentVer = 0 OR currentVer = 2";
+ $msh->query($query);
+ $curr_ver = $msh->fetchNext();
+
+ $kulcs_live = $live_kulcsok['hlNum']+2;
+ $number_live = substr($kulcs_live, 2,4);
+ $version_live = $curr_ver['verCode'];
+ $lan_live = "0";
+ $type_live = "L";
+ $command = PATH_CODEGEN." -Password " . $cntry . $number_live . $version_live . $lan_live . $type_live;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial_live = fgets($ph, 1024);
+ pclose($ph);
+
+ if(mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y") {
+ $item_live = "
+ Item: Live
+
+ Subtotal: 100";
+ }
+
+ $live_msg = "Serial code 2019 Live: ".$serial_live."";
+
+ $insert = $msh->insert('hardlock', array(
+ 'hlNum' => $kulcs_live,
+ 'hlLan' => '0',
+ 'hlStat' => '1',
+ 'hlDateIssue' => $ma,
+ 'hlUser' =>$user,
+ 'hlManID' => '36',
+ 'hlCtrID' => $cntry,
+ 'old_db' => 'clusers_eng',
+ 'hlTime' => date("Y-m-d H:i:s"),
+ 'product_id' => 2
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => 76,
+ 'prVerID' => $curr_ver['verID'],
+ 'prLan' => '0',
+ 'prPass' => $serial_live,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' =>date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs_live,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $insert = $msh->insert('h_history', array(
+ 'hiHlNum' => $kulcs_live,
+ 'hiDate' => date('Y-m-d'),
+ 'hiManID' => 36,
+ 'hiTypeID' => 3,
+ 'hiTime' => date("Y-m-d H:i:s"),
+ 'hiInfo' => "Web order, Aktiválás érvényessége: 2050-01-01",
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ }
+
+ // 1 evvel ezelotti kulcs generalas
+ if (mysqli_real_escape_string($conn, $_GET['code_prev_version']) == "Y") $generate_prev_program = true;
+
+ // 2 evvel ezelotti kulcs generalas
+ if (mysqli_real_escape_string($conn, $_GET['ver_2']) == "Y") {
+ $version2 = $verzi['verCode']-2;
+ $command = PATH_CODEGEN." -Password " . $hardlock_id . $number . $version2 . $lan . $type;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial17_2 = fgets($ph, 1024);
+ pclose($ph);
+
+ $msg2 = "Serial code $elozoEv2: $serial17_2
";
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $verzi['verID']-2,
+ 'prLan' => '0',
+ 'prPass' => $serial17_2,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ }
+
+ // 3 evvel ezelotti kulcs generalas
+ if (mysqli_real_escape_string($conn, $_GET['ver_3']) == "Y") {
+ $version3 = $verzi['verCode']-3;
+ $command = PATH_CODEGEN." -Password " . $hardlock_id . $number . $version3 . $lan . $type;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial16 = fgets($ph, 1024);
+ pclose($ph);
+
+ $msg3 = "Serial code $elozoEv3: $serial16
";
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $verzi['verID']-3,
+ 'prLan' => '0',
+ 'prPass' => $serial16,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ }
+
+ // 4 evvel ezelotti kulcs generalas
+ if (mysqli_real_escape_string($conn, $_GET['ver_4']) == "Y") {
+ $version4 = $verzi['verCode']-4;
+ $command = PATH_CODEGEN." -Password " . $hardlock_id . $number . $version4 . $lan . $type;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial15 = fgets($ph, 1024);
+ pclose($ph);
+
+ $msg4 = "Serial code $elozoEv4: $serial15
";
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $verzi['verID']-4,
+ 'prLan' => '0',
+ 'prPass' => $serial15,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ }
+
+ if (strstr($program, "Professional") || strstr($program, "Prof.")) $prod = "Professional";
+ if (strstr($program, "Interior")) $prod = "Interior";
+ if (strstr($program, "Studio")) $prod = "Studio";
+ break;
+
+ case 'live':
+ $kulcs = substr((string)tryToAlloc(($cntry*10000)+1, ($cntry*10000)+9999), 0, 6);
+
+ $query = "SELECT * FROM `p_versions` WHERE currentVer = 0 OR currentVer = 2";
+ $msh->query($query);
+ $curr_ver = $msh->fetchNext();
+
+ $version = $curr_ver['verCode'];
+ $lan = "0";
+ $type = "L";
+ $hardlock_id = $cntry;
+ $ertek = $price;
+ $alap_ar = $price;
+ $prod = 'ARCHLINE.XP LIVE';
+ $prg_product_id = 2;
+
+ if ($ertek2['until'] != '' && $ertek2['until'] != NULL) $fizetve = $ertek2['until'];
+ break;
+
+ case 'lt':
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '$cntry%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $kulcs = $msh->fetchNext();
+ $kulcs = $kulcs['hlNum']+1;
+
+ $type = 4;
+ $lan = 0;
+ $hardlock_id = $cntry;
+ $ertek = $price;
+ $alap_ar = $price;
+ $prod = "ARCHLINE.XP LT";
+
+ if (strpos($program, "LT") && strpos($program, "LIVE")) {
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '$cntry%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $kulcs2 = $msh->fetchNext();
+ $kulcs_live = $kulcs2['hlNum']+2;
+
+ $query = "SELECT * FROM `p_versions` WHERE currentVer = 0 OR currentVer = 2";
+ $msh->query($query);
+ $curr_ver = $msh->fetchNext();
+
+ $number_live = substr($kulcs_live, 2,4);
+ $version_live = $curr_ver['verCode'];
+ $lan_live = "0";
+ $type_live = "L";
+ $command = PATH_CODEGEN." -Password " . $cntry . $number_live . $version_live . $lan_live . $type_live;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial_live = fgets($ph, 1024);
+ pclose($ph);
+
+ $insert = $msh->insert('hardlock', array(
+ 'hlNum' => $kulcs_live,
+ 'hlLan' => '0',
+ 'hlStat' => '1',
+ 'hlDateIssue' => $ma,
+ 'hlUser' => $user,
+ 'hlManID' => '36',
+ 'hlCtrID' => $cntry,
+ 'old_db' => 'clusers_eng',
+ 'hlTime' => date("Y-m-d H:i:s"),
+ 'product_id' => 2
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => 76,
+ 'prVerID' => $curr_ver['verID'],
+ 'prLan' => '0',
+ 'prPass' => $serial_live,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs_live,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $insert = $msh->insert('h_history', array(
+ 'hiHlNum' => $kulcs_live,
+ 'hiDate' => date('Y-m-d'),
+ 'hiManID' => 36,
+ 'hiTypeID' => 3,
+ 'hiTime' => date("Y-m-d H:i:s"),
+ 'hiInfo' => "Web order, Aktiválás érvényessége: 2050-01-01",
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $live_msg = "Serial code 2019 LIVE: ".$serial_live."";
+ }
+ break;
+
+ case 'upgrade':
+ $old_serial = mysqli_real_escape_string($conn, $_GET['old_hlNum']);
+
+ // interior, lt, studio, nova, professional
+ $upgrade_array = array(2, 4, 6, 7, 8, 'L');
+
+ if (strstr($program, "LIVE") && strstr($program, "Upgrade")) {
+ if (substr($old_serial, 6, 1) != 'L') {
+ $eredmeny['hiba'] = "Its not a LIVE serial.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ if (substr($old_serial, 7, 2) == $verzi['verPassword8and9']) {
+ $eredmeny['hiba'] = "You can't upgrade this software
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+ }
+
+ if (strlen($old_serial) == "16") { //Update esete
+ if (!in_array(substr($old_serial, 6, 1), $upgrade_array)) {
+ $eredmeny['hiba'] = "Its not a Pro or a Studio serial.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ } else {
+ if (substr($old_serial, 6, 1) == "8" && (substr($old_serial, 7, 2) == $verzi['verPassword8and9'])) {
+ $eredmeny['hiba'] = "You can't upgrade this software
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $query = "SELECT * FROM `h_programs` WHERE `prPass` = {$old_serial}";
+ $msh->query($query);
+ $hl = $msh->fetchNext();
+ $hl_num = $hl['prHlNum'];
+
+ $ertek = $price;
+
+ if (substr($old_serial, 0, 2) == "95") {
+ // A hardlockhoz uj program beszurasa, de olyan verziot kell ami egyezik az eddigivel, + kulcs
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '95%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $hl_kulcs = $msh->fetchNext();
+ $hl_kulcs = $hl_kulcs['hlNum']+1;
+ } else {
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '".$cntry."%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $hl_kulcs = $msh->fetchNext();
+ $hl_kulcs = $hl_kulcs['hlNum']+1;
+ }
+
+ $kulcs = substr($old_serial, 0, 6);
+ $hardlock_id = substr($old_serial, 0, 2);
+ $number = substr($old_serial, 2,4);
+
+ $query = "SELECT `hlLan` FROM `hardlock` WHERE `hlNum`='".$kulcs."' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $hlLan = $msh->fetchNext();
+ $lan = $hlLan['hlLan'];
+
+ $msh->query("SELECT `termek`, `euro`, `usd`, `seq` FROM `o_products` WHERE `termek` = '{$program}' AND `lang` = '{$cntry}'");
+ $tomb = $msh->fetchNext();
+
+ // Ha NOVA, vagy Professional akkor professionalt kap
+ if (substr($old_serial, 6, 1) == 7 || substr($old_serial, 6, 1) == 8) $type = 8;
+ elseif (substr($old_serial, 6, 1) == 4) $type = 4; // LT upgrade
+ elseif (substr($old_serial, 6, 1) == 2) $type = 2; // Interior upgrade
+ elseif (substr($old_serial, 6, 1) == 'L') { // LIVE upgrade
+ $type = 'L';
+ $prg_product_id = 2;
+ } else {
+ if ($tomb['seq'] == "30" || $tomb['seq'] == "31") $type = 6; // Update Studio Studio-ra
+ else $type = 8; // Update Studio 2017 Prof-ra vagy Update Studio 2016 vagy korabbi Prof-ra
+ }
+
+ $lan2 = 0;
+
+ if ($lan == 0) $lan2 = 0;
+ elseif ($lan == 1) $lan2 = 0;
+ elseif ($lan == 2) $lan2 = 2;
+ elseif ($lan == 3) $lan2 = 3;
+ elseif ($lan == 4) $lan2 = 4;
+ elseif ($lan == 5) $lan2 = 5;
+ elseif ($lan == 10) $lan2 = 6;
+ elseif ($lan == 15) $lan2 = 7;
+ elseif ($lan == 20) $lan2 = 8;
+ elseif ($lan <= 49) $lan2 = 9;
+
+ $lan = $lan2;
+ $command = PATH_CODEGEN." -Password " . $hardlock_id . $number . $version . $lan . $type;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial = fgets($ph, 1024);
+ $password = $serial;
+ pclose($ph);
+
+ $query = "SELECT * FROM `h_programs` WHERE `prPass`='".$serial."'";
+ $msh->query($query);
+ $prg = $msh->fetchNext();
+
+ if (empty($prg) == false) {
+ $eredmeny['hiba'] = "You already upgraded this serial number.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ } else {
+ // Ha studio, akkor meg kell allapítani hogy volt-e hozzatartozo module, ha igen, akkor ott az mdPrID-t, es a mdPrHlNum-ot kell modositani az uj programhoz
+ if (substr($serial, 6, 1) == "6") {
+ // Regi programhoz tartozo modul(ok)
+ $msh->query("SELECT * FROM `p_modules` WHERE `mdPrHlNum` = '{$kulcs}'");
+ $modules = $msh->fetchAssoc();
+ $uj_kulcs = $kulcs;
+ }
+
+ $prod = "Upgrade";
+ }
+ }
+ } else {
+ $eredmeny['hiba'] = "Wrong serial.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $query = "UPDATE cl_hlusers.h_programs SET prStat = 2 WHERE prPass = '{$old_serial}'";
+ $msh->query($query);
+ break;
+
+ case 'crossgrade':
+ $old_serial = mysqli_real_escape_string($conn, $_GET['old_hlNum']);
+
+ if (substr($old_serial, 6, 1) != "4") {
+ $eredmeny['hiba'] = "Its not an LT serial.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $verz = "SELECT `verCode` FROM `p_versions` WHERE `verPassword8and9` = '".substr($old_serial, 7, 2)."'";
+ $msh->query($verz);
+ $verzi = $msh->fetchNext();
+
+ $query = "SELECT hlNum FROM hardlock WHERE hlNum LIKE '95%' AND hlStat = 0 AND (hlDealer = '' OR hlDealer IS NULL) AND (hlUser = '' OR hlUser IS NULL) AND (hlInfo = '' OR hlInfo IS NULL) limit 1";
+ $msh->query($query);
+ $hlnum = $msh->fetchNext();
+ $kulcs = $hlnum['hlNum'];
+ $prod = "Crossgrade";
+ $old_hlnum = substr($old_serial, 0, 6);
+ $hardlock_id = 95;
+ $version = $verzi['verCode'];
+ $type = 8;
+ $ertek = $price;
+ $lan = 0;
+
+ $msh->query("SELECT * FROM `p_modules` WHERE `mdPrHlNum` = '{$old_hlnum}'");
+ $modules = $msh->fetchAssoc();
+ $uj_kulcs = $kulcs;
+ break;
+
+ case 'module':
+ $hl_num = mysqli_real_escape_string($conn, $_GET['old_hlNum']);
+ $query = "SELECT `prId`, `prPass` FROM `h_programs` WHERE `prHlNum` = '{$hl_num}' ORDER BY `prID` DESC limit 1";
+ $msh->query($query);
+ $program_adatok = $msh->fetchNext();
+
+ // Csak Studio-hoz lehet kiadni modulokat
+ if (substr($program_adatok['prPass'], 6,1) != "6") {
+ $eredmeny['hiba'] = "You can buy modules only for Studio
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $prId = $program_adatok['prId'];
+ $prHlNum = $hl_num;
+
+ if (strpos($program, "Terrain")) $verz = "2";
+ else $verz = "22";
+
+ // A hozzatartozo program serialja
+ $password = $program_adatok['prPass'];
+ $command = PATH_CODEGEN." -Module " . $password . " " . $verz;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $modcode = fgets($ph, 1024);
+ pclose($ph);
+
+ // Ha mar van ilyen module az adott programhoz
+ $query = "SELECT `ID` FROM `p_modules` WHERE `mdPrID` = '{$prId}' AND `mdID` = '{$verz}' AND `mdPrHlNum` = '{$prHlNum}'";
+ $msh->query($query);
+ $module = $msh->fetchNext();
+
+ if ($module['ID']) {
+ $eredmeny['hiba'] = "You already have this module
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $insert = $msh->insert('p_modules', array(
+ 'mdID' => $verz,
+ 'mdPrID' => $prId,
+ 'mdPrHlNum' => $prHlNum,
+ 'mdCode' => $modcode,
+ 'mdDate' => $ma,
+ 'mdPrice' => '0',
+ 'mdInvNum' => '',
+ 'mdOrdNum' => $prOrderNumber,
+ 'mdIsPurchase' => '0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $ertek = $price;
+ $serial = $modcode;
+ $prod = "Module";
+ break;
+
+ case 'nonp':
+ //Ha mar volt nala ebben az evben?
+ $nonpr = mysqli_real_escape_string($conn, $_GET['nonpro_ev']);
+ $datum = mysqli_real_escape_string($conn, $_GET['datum']); // Ezt kérte speciálisan a partner. Attól függetlenül nem ez a dátum kerül be az adatbázisba
+ $date = date_create($datum);
+ $datum = date_format($date, "d/m/Y");
+ $expire = date_format($date, "Y-m-d");
+
+ $ev = substr($nonpr, 3,4);
+
+ $query = "SELECT `verID`, `verCode`, `verPassword8and9` FROM `p_versions` WHERE `verName` = '{$nonpr}'";
+ $msh->query($query);
+ $vcode = $msh->fetchNext();
+
+ if (strpos($program, "LIVE")) {
+ $prg_product_id = 2;
+ $type = "L";
+ } else {
+ $prg_product_id = 1;
+ $type = "8";
+ }
+
+ $query = "SELECT SUBSTRING(`prPass`, 8, 2) AS `prPass` FROM `h_programs` WHERE `prHlNum` IN (SELECT `hlNum` FROM `hardlock` WHERE `hlUser` = '{$user}' AND product_id = '{$prg_product_id}') AND `prHlNum` LIKE '99%'";
+ $msh->query($query);
+ $nonprofit_kulcsok_evben = $msh->fetchAssoc();
+
+ $evek = array();
+ foreach ($nonprofit_kulcsok_evben as $v) {
+ $b = (object)$v;
+ $evek[] = $b->prPass;
+ }
+
+ // Ha mar volt nonprofit kulcsa az adott evben akkor nem enged tovább
+ if (!empty($evek)) {
+ if (in_array($vcode['verPassword8and9'], $evek) !== FALSE) {
+ $eredmeny['hiba'] = "You already have a non-profit key for this product
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+ }
+
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '99%' AND `hlStat` = 0 AND `hlLan` = 0 ORDER BY `hlNum` ASC limit 1";
+ $msh->query($query);
+ $nonprofitok = $msh->fetchNext();
+ $kulcs = $nonprofitok['hlNum'];
+
+ // Ha nincs mar, akkor letre kell hozni!!!
+ if (empty($nonprofitok['hlNum'])) {
+ $eredmeny['hiba'] = "There are no free nonprofit keys yet, please contact us.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $msh->update("hardlock", array("hlStat"=>'1', "hlUser"=>$user, "old_hlID"=>'', "old_db"=>'clusers_eng', "hlDateIssue"=>$ma, "product_id"=>2, "hlCtrID"=>$cntry),"hlNum = {$kulcs}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $version = $vcode['verCode'];
+ $hardlock_id = substr($kulcs, 0, 2);
+ $lan = 0;
+ $contact = 5;
+ $fizetve = date('Y-m-d', strtotime($ma. '+60 days'));
+
+ if ($expire < $fizetve) $fizetve = $expire;
+
+ if (($cntry == 61 || $cntry == 37) && strpos($program, "LIVE") == FALSE) {
+ $query_live = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '99%' AND `hlStat` = 0 AND `hlLan` = 0 ORDER BY `hlNum` ASC limit 1";
+ $msh->query($query_live);
+ $nonprofitok_live = $msh->fetchNext();
+
+ $query = "SELECT * FROM `p_versions` WHERE currentVer = 0 OR currentVer = 2";
+ $msh->query($query);
+ $curr_ver = $msh->fetchNext();
+
+ $kulcs_live = $nonprofitok_live['hlNum'];
+ $number_live = substr($kulcs_live, 2,4);
+ $version_live = $curr_ver['verCode'];
+ $lan_live = "0";
+ $type_live = "L";
+
+ $command = PATH_CODEGEN." -Password " . 99 . $number_live . $version_live . $lan_live . $type_live;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial_live = fgets($ph, 1024);
+ pclose($ph);
+
+ $msh->update("hardlock", array("hlStat"=>'1', "hlUser"=>$user, "old_hlID"=>'', "old_db"=>'clusers_eng', "hlDateIssue"=>$ma, "product_id"=>2, "hlCtrID"=>$cntry),"hlNum = {$kulcs_live}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => "76",
+ 'prVerID' => $curr_ver['verID'],
+ 'prLan' => '0',
+ 'prPass' => $serial_live,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => date('Y-m-d', strtotime($ma. '+60 days')),
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '5',
+ 'prHlNum' => $kulcs_live,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => '',
+ 'prInvoiceRecurrence' => '',
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $insert = $msh->insert('h_history', array(
+ 'hiHlNum' => $kulcs_live,
+ 'hiDate' => date('Y-m-d'),
+ 'hiManID' => 36,
+ 'hiTypeID' => 3,
+ 'hiTime' => date("Y-m-d H:i:s"),
+ 'hiInfo' => "Web order, Aktiválás érvényessége: ".date('Y-m-d', strtotime($ma. '+60 days')),
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $live_nonp = "Activation key Live: $serial_live
";
+ }
+
+ if ($cntry == '82') $ertek = $price; // Koreaban a Non-Profit fizetos
+ else $ertek = 0;
+
+ if ($_FILES) {
+ user_error(print_r($_FILES, true));
+ $uploads_dir = 'tmpl/';
+ $target_path = $uploads_dir.basename($_FILES['file']['name'] );
+ if (move_uploaded_file($_FILES['file']['tmp_name'], $target_path))
+ echo 'File uploaded';
+ else {
+ $eredmeny['hiba'] = 'Error in uploading file ';
+ echo json_encode($eredmeny);
+ return false;
+ }
+ }
+
+ $prod = "Non-profit";
+ break;
+
+ case 'hardlock':
+ $regi_kulcs = substr(mysqli_real_escape_string($conn, $_GET['old_hlNum']),0,6);
+ $kulcs = mysqli_real_escape_string($conn, $_GET['hl_num']);
+
+ // megadtak-e, letezik-e uj kulcs
+ if (!$regi_kulcs || empty($regi_kulcs) || strlen($regi_kulcs) != 6) {
+ $eredmeny['hiba'] = "There is a problem with the hardlock key
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ } else {
+ $oldHlNum = "SELECT * FROM `hardlock` WHERE hlNum = '".$regi_kulcs."'";
+ $msh->query($oldHlNum);
+ $talalat = $msh->fetchNext();
+ if (!$talalat['hlNum']) {
+ $eredmeny['hiba'] = "There is a problem with the hardlock key
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ } else {
+ // regi kulcshoz az ujat beallitani
+ // uj kulcsot aktivalni, regi kulcsat beallítani
+ // usert atvinni
+ $update = $msh->update("hardlock", array("hlNewHlNum"=>$kulcs), "hlNum = {$regi_kulcs}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $update = $msh->update("hardlock", array('hlDatePro' => date('Y-m-d', time()), 'hlStat' => 2), "hlNum = {$regi_kulcs}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $update = $msh->update("h_programs", array('prStat' => 1), "prHlNum = {$regi_kulcs}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $insert = $msh->insert("h_history", array(
+ "hiHlNum" => $regi_kulcs,
+ "hiDate" => date('Y-m-d', time()),
+ "hiManID" => 36,
+ "hiTypeID" => 5,
+ "hiTime" => date('Y-m-d H:i:s', time()),
+ "hiInfo" => "Web order: Új kulcs"
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ $update = $msh->update("hardlock", array("hlOldHlNum"=>$regi_kulcs), "hlNum = {$kulcs}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $update = $msh->update("hardlock", array("hlStat"=>'1', "hlDateIssue"=>$ma, "hlManID"=>'36', "hlTime"=>date("Y-m-d H:i:s"), "hlUser"=>$user), "hlNum = {$kulcs}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $query = "SELECT * FROM `h_programs` WHERE `prHlNum` = '".$regi_kulcs."' ORDER BY `prID` DESC limit 1";
+ $msh->query($query);
+ $utolsoProgram = $msh->fetchNext();
+
+ $eddigi_ver_id = $utolsoProgram['prVerID'];
+
+ $verz = "SELECT `verCode` FROM `p_versions` WHERE `verID` = '".$eddigi_ver_id."'";
+ $msh->query($verz);
+ $verzi = $msh->fetchNext();
+ $version = $verzi['verCode'];
+ $type = $utolsoProgram['prTypeID'];
+ $ertek = $price;
+ }
+ }
+
+ $hardlock_msg = "Old hardlock: {$regi_kulcs}
";
+ $hardlock_msg .= "New hardlock: {$kulcs}";
+ $sellDate = $utolsoProgram['prSellDate'];
+ $actDate = $utolsoProgram['prActDate'];
+ $fizetve = $utolsoProgram['prFizetve'];
+ $time = $utolsoProgram['prTime'];
+ $lastMod = $utolsoProgram['prLastMod'];
+ $contact = $utolsoProgram['prContact'];
+ $stat = 0;
+ $cntry = $utolsoProgram['prCtrID'];
+ $invoiceDateFrom = $utolsoProgram['prInvoiceDateFrom'];
+ $fizHatIdo = $utolsoProgram['prInvoiceDateto'];
+ $reszlet = $utolsoProgram['prInvoiceRecurrence'];
+ $lan = $talalat["hlLan"];
+ $ertek = $price;
+ $prod = "Hardlock";
+ $hardlock_id = substr($kulcs, 0, 2);
+
+ $msh->query("SELECT * FROM `p_modules` WHERE `mdPrHlNum` = '{$regi_kulcs}'");
+ $modules = $msh->fetchAssoc();
+ $uj_kulcs = $kulcs;
+ break;
+ }
+
+ $number = substr($kulcs, 2,4);
+
+ if ($kategoria != "module") {
+ $command = PATH_CODEGEN." -Password " . $hardlock_id . $number . $version . $lan . $type;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial = fgets($ph, 1024);
+ $password = $serial;
+ pclose($ph);
+
+ $insert = $msh->insert('debug_table', array(
+ 'data' => "hardlock_id: {$hardlock_id} || number: {$number} || version: {$version} || lan: {$lan} || type: {$type}",
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => 37
+ ));
+ }
+
+ if ($kategoria != "module") {
+ // hardlock tablaban benne van mar a kulcs? Akkor update. Ha nincs, akkor insert
+ $van = "SELECT * FROM `hardlock` WHERE `hlNum` = '".$kulcs."'";
+ $msh->query($van);
+ $result = $msh->fetchNext();
+ if (!empty($result)) {
+ $update = $msh->update("hardlock", array("hlStat"=>'1', "hlLan"=>'0', "hlDateIssue"=>$ma, "hlManID"=>'36', "hlCtrID"=>$cntry, "product_id"=>$prg_product_id, "hlTime"=>date("Y-m-d H:i:s"), "hlUser"=>$user), "hlNum = {$kulcs}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ } else {
+ $insert = $msh->insert('hardlock', array(
+ 'hlNum' => $kulcs,
+ 'hlLan' => '0',
+ 'hlStat' => '1',
+ 'hlDateIssue' => $ma,
+ 'hlUser' => $user,
+ 'hlManID' => '36',
+ 'hlCtrID' => $cntry,
+ 'old_db' => 'clusers_eng',
+ 'hlTime' => date("Y-m-d H:i:s"),
+ 'product_id' => $prg_product_id
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ }
+ }
+
+ //o_ordersbe bekerules
+ $orders_insert = $msh->insert('o_orders', array(
+ 'ip' => $ip,
+ 'country' => $cntry,
+ 'date' => $ma,
+ 'software' => $program,
+ 'user_name' => $u_name,
+ 'user_email' => $email,
+ 'order' => $prOrderNumber,
+ 'input_key' => $regi_kulcs,
+ 'output_key' => $serial,
+ 'price' => $ertek,
+ 'info' => $info,
+ 'instalments' => $payment
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ // verID meghatarozasa -> mindig az aktualis evhez tartozot valasztja ki
+ $query = "SELECT `verID` FROM `p_versions` WHERE `verCode` = '".$version."'";
+ $msh->query($query);
+ $tomb = $msh->fetchNext();
+
+ $userNumber = $lan == 0 || IsSoftwareKey($serial) == false ? 1 : $lan;
+
+ if ($generate_prev_program) {
+ // Jelenleg meg 2019-es programot is adunk!
+ $ev2 = date("Y");
+ $elozoEv1 = $ev2-1;
+ $ver_prev = $verzi['verCode']-1;
+ $command = PATH_CODEGEN." -Password " . $hardlock_id . $number . $ver_prev . $lan . $type;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial_prev = fgets($ph, 1024);
+ pclose($ph);
+
+ $lt_message = "Serial code $elozoEv1: ".$serial_prev."";
+ $msg_2019 = "Serial $elozoEv1: ".$serial_prev."";
+ $msg = "Serial code $elozoEv1: $serial_prev
";
+ }
+
+ if ($type == "L") $type = 76;
+
+ if ($kategoria != "module") {
+ for ($i = 1; $i <= $userNumber; $i++) {
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $tomb['verID'],
+ 'prLan' => $lan,
+ 'prPass' => $serial,
+ 'prSellDate' => $sellDate,
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => $actDate,
+ 'prFizetve' => $fizetve,
+ 'prTime' => $time,
+ 'prLastMod' => $lastMod,
+ 'prPrice' => $ertek,
+ 'prContact' => $contact,
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => substr($cntry, 0, 2),
+ 'prStat' => $stat,
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => $invoiceDateFrom,
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ }
+ }
+
+ if ($generate_prev_program) {
+ // Jelenleg meg 2019-es programot is adunk!
+ for ($i = 1; $i <= $userNumber; $i++) {
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $tomb['verID']-1,
+ 'prLan' => $lan,
+ 'prPass' => $serial_prev,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prPrice' => $alap_ar,
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '1',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ }
+ }
+
+ if ($kategoria == 'hardlock') // Eddig programokat tiltani
+ $update = $msh->update("h_programs",array("prStat"=>'1'),"prHlNum = {$regi_kulcs}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ if (($kategoria == "upgrade" || $kategoria == "crossgrade" || $kategoria == "hardlock") && !empty($modules)) {
+ // Ha van a module, akkor uj modulok generalasa kulccsal egyutt
+ if (!empty($modules)) {
+ $query = "SELECT `prHlNum`, `prID`, `prPass` FROM `h_programs` WHERE `prHlNum` = '{$kulcs}' ORDER BY `prID` DESC limit 1";
+ $msh->query($query);
+ $program_adatok = $msh->fetchNext();
+
+ $prId = $program_adatok['prID'];
+ $password = $program_adatok['prPass'];
+
+ $msh->query("SELECT `mdID` FROM `p_modules` WHERE `mdPrHlNum` = '".$kulcs."'");
+ $b = $msh->fetchAssoc();
+
+ $email_m1_nev = "";
+ $email_m1_kulcs = "";
+ $email_m2_nev = "";
+ $email_m2_kulcs = "";
+
+ $e = 0;
+
+ foreach ($b as $b) {
+ $r = (object)$b;
+ $e++;
+ $verz = $r->mdID;
+ $command = PATH_CODEGEN." -Module " . $password . " " . $verz;
+ $ph = popen( $command, "r" ) or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $modcode = fgets( $ph, 1024 );
+ pclose($ph);
+
+ $insert = $msh->insert('p_modules', array(
+ 'mdID' => $verz,
+ 'mdPrID' => $prId,
+ 'mdPrHlNum' => $uj_kulcs,
+ 'mdCode' => $modcode,
+ 'mdDate' => $ma,
+ 'mdPrice' => '0',
+ 'mdInvNum' => '',
+ 'mdOrdNum' => $prOrderNumber,
+ 'mdIsPurchase' =>'0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ if ($verz == "2") $mod_nev = "Module - Terrain";
+ else $mod_nev = "Module - Rendering";
+
+ if ($e == 1) {
+ $email_m1_nev = $mod_nev;
+ $email_m1_kulcs = $modcode;
+ } elseif ($e == 2){
+ $email_m2_nev = $mod_nev;
+ $email_m2_kulcs = $modcode;
+ } else {
+ $email_m1_nev = "";
+ $email_m1_kulcs = "";
+ $email_m2_nev = "";
+ $email_m2_kulcs = "";
+ }
+ }
+ }
+ }
+
+ $insert = $msh->insert('h_history', array(
+ 'hiHlNum' => $kulcs,
+ 'hiDate' => date('Y-m-d'),
+ 'hiManID' => 36,
+ 'hiTypeID' => 3,
+ 'hiTime' => date("Y-m-d H:i:s"),
+ 'hiInfo' => "Web order, Aktiválás érvényessége: 2050-01-01",
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ require_once("messages.php");
+ switch ($kategoria) {
+ case 'perp':
+ if ($hl_prot == "Y") { // Ezt marciusban vissza kell kommentezni !!!!!! Ez az elozo evi programot is legeneralja!!! Eredeti: mysqli_real_escape_string($conn, $_GET['code_prev_version']) == "Y"
+ if (($serial_prev != "" && $serial_prev != null) || mysqli_real_escape_string($conn, $_GET['ver_2']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_3']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_4']) == "Y") {
+ if ($cntry == "43" || $cntry == "39" || $cntry == "37") $message = $message['teljes_hl17_np'];
+ else $message = $message['teljes_hl17'];
+ } else {
+ if ($cntry == "43" || $cntry == "39") $message = $message['teljes_hl_np'];
+ else $message = $message['teljes_hl'];
+ }
+ }
+
+ if ($hl_prot == "N") { // Ezt marciusban vissza kell kommentezni !!!!!! Ez az elozo evi programot is legeneralja!!! Eredeti: mysqli_real_escape_string($conn, $_GET['code_prev_version']) == "Y"
+ if (($serial_prev != "" && $serial_prev != null) || mysqli_real_escape_string($conn, $_GET['ver_2']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_3']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_4']) == "Y")
+ $message = $message['teljes_sw17'];
+ else
+ $message = $message['teljes_sw'];
+ }
+ break;
+
+ case 'live':
+ $message = $message['teljes_live'];
+ break;
+
+ case 'lt':
+ $message = $message['teljes_live'];
+ break;
+
+ case 'upgrade':
+ if ($email_m1_nev != "") $message = $message['upgrade_modulokkal'];
+ else $message = $message['upgrade'];
+ break;
+
+ case 'crossgrade':
+ $message = $message['upgrade'];
+ break;
+
+ case 'module':
+ $message = $message['module'];
+ break;
+
+ case 'nonp':
+ $message = $message['nonprofit'];
+ break;
+
+ case 'hardlock':
+ if ($email_m1_nev != "") $message = $message['hardlock_modulokkal'];
+ else $message = $message['hardlock'];
+ break;
+ }
+
+ $to = $kapcsolat['email'];
+ $subject = 'ARCHLine.XP order: '.$ctryName['ctrNameEng'].' '.$prOrderNumber.' '.$prod;
+ $headers = "Content-Type: text/html; charset=utf-8\r\n";
+
+ if ($cntry == "37" || $cntry == "371") $headers .= 'Cc: mate.nagy@cadline.hu' . "\r\n";
+ else $headers .= 'Cc: office@cadline.hu' . "\r\n";
+
+ if($kapcsolat['sub_email'] != null && $kapcsolat['sub_email'] != "") $headers .= 'Bcc: '.$kapcsolat['sub_email'] . "\r\n";
+
+ mail($to, $subject, $message, $headers);
+
+ $eredmeny['sikeres'] = "Thank You for Your Order.
+ We have accepted your online purchase order.
+ Once processed, invoice will be sent for your e-mail address.
+ Please allow 1 working day for your order to be processed.
+
+ Continue.";
+
+ if($isInvoice && $price != 0) { // Non-profit programnal nem kell szamlat generalni
+ $live_price = 100;
+ if(strpos($program, "Including LIVE")) $price = $price - $live_price;
+
+ if(is_numeric($afa_key) && $afa_key > 0) { // Default afa
+ $vat_amount_live = $live_price * $afa; //csak Afa osszege
+ $brut_amount_live = $live_price * ($afa+1); // Brutto teljes ar
+ $vat_amount_otheritem = $price * $afa;
+ $brut_amount_otheritem = $price * ($afa+1);
+ $vat_amount_hardlock = $hardlock_price["nettó"] * $afa;
+ $brut_amount_hardlock = $hardlock_price["nettó"] * ($afa+1);
+ } else {
+ $vat_amount_live = 0; //csak Afa osszege
+ $brut_amount_live = $live_price; // Brutto teljes ar
+ $vat_amount_otheritem = 0;
+ $brut_amount_otheritem = $price;
+ $vat_amount_hardlock = 0;
+ $brut_amount_hardlock = $hardlock_price["nettó"];
+ }
+
+ if ($cntry == 33) $comment = "Client: ".$u_name." - "." Serial: ".$kulcs." order ".$prOrderNumber;
+ else $comment = $kulcs." order ".$prOrderNumber;
+
+ $item = new InvoiceItem($termek["megnevezés"], $price, 1.0, $termek["egység"], $afa_key);
+ $item->setNetPrice($price);
+ $item->setVatAmount($vat_amount_otheritem);
+ $item->setGrossAmount($brut_amount_otheritem);
+ $item->setComment($comment);
+
+ $itemLedger = new InvoiceItemLedger('', '', strval($termek["árbevétel_főkönyvi_szám"]), '');
+ $item->setLedgerData($itemLedger);
+
+ $invoice->addItem($item);
+
+ if ($hl_prot == "Y") {
+ if ($afa_key == "EUK") $revenueLedgerNumber = 931;
+ else $revenueLedgerNumber = 9313;
+
+ $item = new InvoiceItem($prod_prefix." ARCHLine.XP Hardlock", $hardlock_price["nettó"], 1.0, $termek["egység"], $afa_key);
+ $item->setComment($kulcs." order ".$prOrderNumber);
+ $item->setNetPrice($hardlock_price["nettó"]);
+ $item->setVatAmount($vat_amount_hardlock);
+ $item->setGrossAmount($brut_amount_hardlock);
+
+ $itemLedger = new InvoiceItemLedger('', '', strval($revenueLedgerNumber), '');
+ $item->setLedgerData($itemLedger);
+
+ $invoice->addItem($item);
+ }
+
+ if (mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y" || strpos($program, "Including LIVE") == TRUE) {
+ if ($afa_key == "EUK") $revenueLedgerNumber = 931;
+ else $revenueLedgerNumber = 9312;
+
+ $item = new InvoiceItem($prod_prefix." ARCHLine.XP LIVE License", $live_price, 1.0, $termek["egység"], $afa_key);
+ $item->setComment($kulcs_live." order ".$prOrderNumber);
+ $item->setNetPrice($live_price);
+ $item->setVatAmount($vat_amount_live);
+ $item->setGrossAmount($brut_amount_live);
+
+ $itemLedger = new InvoiceItemLedger('', '', strval($revenueLedgerNumber), '');
+ $item->setLedgerData($itemLedger);
+
+ $invoice->addItem($item);
+ }
+
+ $result = $agent->generateInvoice($invoice);
+
+ if($result->isSuccess()) { // Az invoice mezo alapertelmezetten 0, ha sikeres a szamla generalas, updateljuk 1-re
+ $query = "UPDATE o_orders SET invoice = 1 WHERE country = {$cntry} AND o_orders.order = '{$prOrderNumber}'";
+ $msh->query($query);
+ }
+ }
+
+ $query = "SELECT invoice FROM o_orders WHERE country = {$cntry} AND o_orders.order = '{$prOrderNumber}' ORDER BY id desc";
+ $msh->query($query);
+ $inv = $msh->fetchNext();
+
+ if ($isInvoice && $price != 0 && $inv['invoice'] != 1) { // Nem sikerult a szamlat legeneralni, emailt kuldunk az office-nak
+ $message = "";
+ $message .= "Email: ".$kapcsolat['email']."
";
+ $message .= "Orders:
";
+ $message .= "Order number: {$prOrderNumber}
";
+ $message .= "Program: {$program}";
+
+ $to = "office@cadline.hu";
+ $subject = "Számlagenerálás hiba";
+ $headers = "Content-Type: text/html; charset=utf-8\r\n";
+ mail($to, $subject, $message, $headers);
+
+ $eredmeny['hiba'] = "Order accepted, but error at making invoice! Please contact office@cadline.hu.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+ } else {
+ $eredmeny['hiba'] = "You've reached your daily limit for orders. Please try it again tomorrow or contact office@cadline.hu
+
+ Continue.";
+ }
+}
+echo json_encode($eredmeny);
+
+function IsSoftwareKey($serial = "")
+{
+ if ($serial == "") return false;
+
+ $ph = popen(PATH_CODEGEN." -IsSoftwareKey ".$serial, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $szoftveres = fgets($ph, 1024);
+ pclose($ph);
+
+ return ($szoftveres == 'true');
+}
+
+function tryToAlloc($min = 990001, $max = 997000)
+{
+ $config['db_host'] = 'localhost';
+ $config['db_user'] = 'cadline';
+ $config['db_pass'] = 'Shea6hoo';
+ $config['db_name'] = 'cl_hlusers';
+
+ $msh = new hivasok();
+ $msh->init($config['db_host'], $config['db_name'], $config['db_user'], $config['db_pass']);
+ $conn = new mysqli($config['db_host'], $config['db_user'], $config['db_pass'], $config['db_name']);
+
+ $ret = 0;
+ if ((int)$min == 0 || (int)$max == 0) return $ret;
+
+ $msh->query("SELECT LEFT(hlNum, 6) AS hlNum FROM hardlock WHERE hlNum >= ".(int)$min." AND hlNum < ".(int)$max." ORDER BY hlNum;");
+ $res = $msh->fetchAssoc();
+
+ if (count($res)) {
+ $keszlet = range($min, $max);
+ foreach ($res as $r) $kulcsok[]=$r['hlNum'];
+
+ $diff = array_diff($keszlet, $kulcsok);
+ reset($diff);
+ $ret = current($diff);
+ }
+ return $ret;
+}
+
+function DeactivateHardlock($hlNum, $hlManID, $hlInfo, $hlDatePro)
+{
+ $config['db_host'] = 'localhost';
+ $config['db_user'] = 'cadline';
+ $config['db_pass'] = 'Shea6hoo';
+ $config['db_name'] = 'cl_hlusers';
+
+ $msh = new hivasok();
+ $msh->init($config['db_host'], $config['db_name'], $config['db_user'], $config['db_pass']);
+ $conn = new mysqli($config['db_host'], $config['db_user'], $config['db_pass'], $config['db_name']);
+
+ $update = $msh->update("hardlock", array('hlDatePro' => $hlDatePro, 'hlStat' => '2'), "hlNum = {$hlNum}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $update = $msh->update("h_programs", array('prStat' => 1), "prHlNum = {$hlNum}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $insert = $msh->insert("h_history", array(
+ "hiHlNum" => $hlNum,
+ "hiDate" => date('Y-m-d', time()),
+ "hiManID" => $hlManID,
+ "hiTypeID" => 5,
+ "hiTime" => date('Y-m-d H:i:s', time()),
+ "hiInfo" => $hlInfo
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+}
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/szerver.php.evidence.json b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/szerver.php.evidence.json
new file mode 100644
index 0000000..57f1868
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/szerver.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6885",
+ "log_excerpt": "[quarantine] dev.cadline.hu:php7_update/partners.archlinexp.com/public/order/szerver.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/szerver.php)",
+ "original_sha256": "b86dc1faaa6db4787cd84016f05a9789aa2fe331c0dc9f5c1110fc49faba4187",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1595243060,
+ "size": 89792,
+ "uid": 12425
+ },
+ "rel_path": "php7_update/partners.archlinexp.com/public/order/szerver.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "dev.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/szerver2.php b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/szerver2.php
new file mode 100644
index 0000000..bc71fc9
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/szerver2.php
@@ -0,0 +1,1830 @@
+init($config['db_host'], $config['db_name'], $config['db_user'], $config['db_pass']);
+$conn = new mysqli($config['db_host'], $config['db_user'], $config['db_pass'], $config['db_name']);
+
+$ip = $_SERVER['REMOTE_ADDR'];
+$eredmeny = [];
+$sesion_id = bin2hex(openssl_random_pseudo_bytes(10));
+
+if (mysqli_real_escape_string($conn, $_GET['bizt']) != mysqli_real_escape_string($conn, $_GET['biztonsagi']) || mysqli_real_escape_string($conn, $_GET['confirm']) != "Y") {
+ $eredmeny["hiba"] = "Your security answer was wrong or you forgot the confirm checkbox!
+
+ Continue.";
+} else {
+ $query = "SELECT ip, COUNT(ip) as szam FROM o_orders WHERE ip='".$ip."' AND DATE=CURDATE()";
+ $msh->query($query);
+ $limit = $msh->fetchNext();
+
+ $msh->query("SELECT `limit` FROM `o_products` limit 1");
+ $max_limit = $msh->fetchNext();
+
+ if ($limit['szam'] < $max_limit['limit']) { // Napi limit
+ define('PATH_CODEGEN', "/usr/local/sbin/codegen");
+
+ $kategoria = mysqli_real_escape_string($conn, $_GET['kategoria']); // Lehet: perp, upgrade, akcio, nonprofit, hardlock, module
+ $hl_prot = mysqli_real_escape_string($conn, $_GET['hl_prot']);
+ $program = mysqli_real_escape_string($conn, $_GET['prg']);
+ $cntry = mysqli_real_escape_string($conn, $_GET['cntry']);
+ $ma = date("Y-m-d");
+ $email = mysqli_real_escape_string($conn, $_GET['email']);
+ $u_name = mysqli_real_escape_string($conn, $_GET['name']);
+ $info = mysqli_real_escape_string($conn, $_GET['info']);
+
+ $query = "SELECT DISTINCT `email`, `sub_email` FROM `o_products` WHERE `lang` = '{$cntry}'";
+ $msh->query($query);
+ $kapcsolat = $msh->fetchNext();
+
+ if ($kapcsolat['email'] == "") {
+ $eredmeny["hiba"] = "Access denied
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $osszeg = "SELECT * FROM `o_products` WHERE `termek` = '".$program."' AND `lang` = '".$cntry."' AND `kategoria` = '".$kategoria."'";
+ $msh->query($osszeg);
+ $ertek2 = $msh->fetchNext();
+ $price = $cntry == 11 ? $ertek2["usd"] : $ertek2["euro"];
+ $akcio = $ertek2["akcio"];
+
+ if ($akcio != '' && $akcio != null && date('Y-m-d') <= $ertek2['ackio_date']) $price = $akcio;
+
+ // TODO: spanyoloknak nem mukodik
+ /*if ($ertek2["is_invoice"] == 0) {
+ $eredmeny['hiba'] = "You have invoice(s) more than 14 days overdue.
+
+ The web-order system is temporary not available for attempts to create a new order.
+
+ Please advise as to whether payment has been scheduled.
+
+ If you require any further information from us, please contact us at office@cadline.hu
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }*/
+
+ $isInvoice = false;
+ $tax = TaxPayer::TAXPAYER_HAS_TAXNUMBER;
+ $curr = "EUR";
+ $cur = Currency::CURRENCY_EUR;
+ $lang = Language::LANGUAGE_EN;
+ $prod_prefix = "EU";
+ $inv_prefix = "EUR";
+ switch ($cntry)
+ {
+ case '39': // Olaszorszag
+ $lang = Language::LANGUAGE_IT;
+ break;
+ case '43': // Ausztria
+ $lang = Language::LANGUAGE_DE;
+ break;
+ case '49': // Nemetorszag
+ $lang = Language::LANGUAGE_DE;
+ break;
+ case '38': // Horvatorszag
+ $lang = Language::LANGUAGE_HR;
+ break;
+ case '33': // Franciaorszag
+ $lang = Language::LANGUAGE_FR;
+ break;
+ case '42': // Csehorszag
+ $lang = Language::LANGUAGE_CZ;
+ break;
+ case '48': // Lengyelorszag
+ $lang = Language::LANGUAGE_PL;
+ break;
+ case '34': // Spanyolorszag
+ $lang = Language::LANGUAGE_ES;
+ break;
+ case '37': // TESZT
+ $tax = TaxPayer::TAXPAYER_NO_TAXNUMBER;
+ $isInvoice = true;
+ break;
+ case '82': //Korea
+ $prod_prefix = "Non-EU";
+ break;
+ case '61': //Ausztralia
+ $prod_prefix = "Non-EU";
+ break;
+ case '88': //Tajvan
+ $prod_prefix = "Non-EU";
+ break;
+ case '44': //UK
+ $prod_prefix = "Non-EU";
+ break;
+ case '84': //Vietnam
+ $prod_prefix = "Non-EU";
+ break;
+ case '52': //Mexiko
+ $prod_prefix = "Non-EU";
+ break;
+ case '60': //Malajzia
+ $prod_prefix = "Non-EU";
+ break;
+ case '30': //Gorogorszag
+ break;
+ case '51': //Portugalia
+ break;
+ case '11': // USA
+ $curr = "USD";
+ $cur = Currency::CURRENCY_USD;
+ $prod_prefix = "Non-EU";
+ $inv_prefix = "USD";
+ break;
+ case '71': // Lettorszag
+ break;
+ default: // Minden mas
+ $tax = TaxPayer::TAXPAYER_NO_TAXNUMBER;
+ break;
+ }
+
+ if (mysqli_real_escape_string($conn, $_GET['user']) == "ismeretlen") {
+ if ($kategoria == 'nonp') $status = '4';
+ else $status = '11';
+
+ $query = "SELECT id FROM distributors WHERE ctrID = {$cntry}";
+ $msh->query($query);
+ $dist = $msh->fetchNext();
+
+ if (!empty($dist)) $distID = $dist['id'];
+ else $distID = 0;
+
+ $insert = $msh->insert('users', array(
+ 'strName' => $u_name,
+ 'nManagerID' => '36',
+ 'nSchoolID' => '0',
+ 'strLease' => '',
+ 'deleted' => '0',
+ 'old_db' => 'clusers_eng',
+ 'bNewsletter' => 'N',
+ 'strEMail' => $email,
+ 'strCurrency' => $curr,
+ 'nCtrID' => $cntry,
+ 'nUserStatus' => $status,
+ 'nDistID' => $distID
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ }
+
+ if ($isInvoice) {
+ $actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
+
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $actual_link,
+ 'session_id' => $cntry,
+ 'insert_date' => date('Y-m-d h:i:s')
+ ));
+ }
+
+ $felhasznalo = "SELECT `nUserID` FROM `users` WHERE `strEMail` = '".$email."' limit 1";
+ $msh->query($felhasznalo);
+ $felh = $msh->fetchNext();
+ $user = $felh['nUserID'];
+
+ if (mysqli_real_escape_string($conn, $_GET['user']) == "ismeretlen") {
+ $insert = $msh->insert('u_emails', array(
+ 'email' => $email,
+ 'nUserID' => $user,
+ 'default' => '1',
+ 'active' => '1',
+ 'deleted' => '0',
+ 'newsletter' => '0'
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ }
+
+ $query = "SELECT DISTINCT `email`, `sub_email` FROM `o_products` WHERE `lang` = '{$cntry}'";
+ $msh->query($query);
+ $kapcsolat = $msh->fetchNext();
+
+ $query = "SELECT `ctrNameEng` FROM `countries` WHERE `ctrID` = '{$cntry}'";
+ $msh->query($query);
+ $ctryName = $msh->fetchNext();
+
+ //Utolso order Number
+ $msh->query("SELECT `order` FROM `o_orders` WHERE `country` = '{$cntry}' ORDER BY `id` DESC limit 1");
+ $order = $msh->fetchNext();
+ $orderNumber = $order['order'];
+ $kezdo = strpos($orderNumber, "-")+1; // Majd a rakovetkezo, ez kerul be adatbazisba
+ $veg = strpos($orderNumber, "/")-2;
+ $szam = (int)substr($orderNumber, $kezdo, $veg)+1;
+ $prOrderNumber = "E-".$szam."/".date("Y");
+
+ if ($isInvoice && $price != 0) {
+ $partners = "SELECT * FROM szamla_agent.partnerek WHERE ország = ".$cntry;
+ $msh->query($partners);
+ $partner = $msh->fetchNext();
+
+ $date = new DateTime(date('Y-m-d'));
+ $date->modify('+'.$partner["fizetési_határidő"]." day");
+
+ //$agent = SzamlaAgentAPI::create('3i73vj72wt7h3ig78wrawt7h3ik5batswt7h3inhzw', false, Log::LOG_LEVEL_ERROR); // Szamla Agent CADLine kulcs
+ $agent = SzamlaAgentAPI::create('c9k2ydfs2c2sa29c2uti9msiehc3b6zrr48qbvsqbs', false, Log::LOG_LEVEL_OFF); // Teszt Kulcs
+
+ //$invoice = new Invoice(Invoice::INVOICE_TYPE_E_INVOICE);
+ $invoice = new Invoice(Invoice::INVOICE_TYPE_P_INVOICE); //Teszt Szamla
+
+ $header = $invoice->getHeader();
+ $header->setPaymentMethod(Invoice::PAYMENT_METHOD_TRANSFER);
+ $header->setCurrency($cur);
+ $header->setLanguage($lang);
+ $header->setPaymentDue($date->format('Y-m-d'));
+ $header->setComment("*Please use the invoice number (E-EUR-2020-xxx) as a reference number to identify your payment.
+
+ Banktransfer info:
+ K&H BANK Hungary
+ IBAN: HU89 1040 0951 4955 4949 4954 1028
+ SWIFT CODE: OKHBHUHB");
+ //$header->setPrefix($inv_prefix);
+
+ /*$seller = new Seller('K&H Bank EUR', 'IBAN: HU89 1040 0951 4955 4949 4954 1028');
+ $seller->setEmailReplyTo('office@cadline.hu');
+ $seller->setEmailSubject('Számlaértesítő / Invoice - CadLine Kft.');
+ $seller->setEmailContent('Tisztelt/Dear '.$partner["kapcsolattartó_neve"].',
+
+
+ Mellékelten küldjük aktuális számláját.
+ Kérjük, utaláskor a közlemény rovatban KIZÁRÓLAG a számlaszámot tüntesse fel! (pl.: E-HUF-2020-xxxx)
+
+ Amennyiben ezzel kapcsolatban bármilyen kérdése merülne fel, kérjük hívja Ügyfélszolgálatunkat, ahol munkatársaink készséggel állnak ügyfeleink rendelkezésére.
+
+ Cadline Ltd invoice is attached. Please use the invoice number (E-EUR-2020-xxx) as a reference number to identify your payment. Payment made via wire transfer must be made in full including any fees/charges for the wire transfer, which are your responsibility. (If your bank uses an intermediary bank, there may be additional charges.) If payment is not received in full, you will be invoiced for any balance due on the account.
+ Payment must be completed by the "due date" of the invoice date.
+
+
+ Üdvözlettel / Sincerely:
+ CadLine Office');
+ $invoice->setSeller($seller);*/
+
+ $buyer = new Buyer($partner["partner"], $partner["irányítószám"], $partner["település"], $partner["utca_házszám"]);
+ $buyer->setTaxPayer($tax);
+
+ if ($partner["közösségi_adószám"] != "") {
+ $buyer->setTaxNumberEU($partner["közösségi_adószám"]);
+ $afa_key = "EU";
+ } elseif ($partner["adószám"] != "") {
+ $buyer->setTaxNumber($partner["adószám"]);
+ $afa_key = "EUK";
+ } elseif ($partner["ország"] == 61) {
+ $afa_key = "EUK";
+ } else {
+ $afa_key = "27"; // Item::DEFAULT_VAT
+ $afa = $afa_key / 100;
+ }
+
+ $buyer->setEmail($partner["email"]);
+ $buyer->setSendEmail(true);
+ $invoice->setBuyer($buyer);
+
+ $product = "SELECT product_id FROM szamla_agent.web_product WHERE `web_id` = '".$ertek2['id']."'";
+ $msh->query($product);
+ $product_id = $msh->fetchNext();
+
+ $termekek = "SELECT * FROM szamla_agent.termekek WHERE id='".$product_id["product_id"]."'";
+ $msh->query($termekek);
+ $termek = $msh->fetchNext();
+ }
+
+ $hardlock = "SELECT megnevezés, nettó FROM szamla_agent.termekek WHERE id='30'";
+ $msh->query($hardlock);
+ $hardlock_price = $msh->fetchNext();
+
+ $verz = "SELECT `verCode`, verID FROM `p_versions` WHERE `verActual` = 'Y'";
+ $msh->query($verz);
+ $verzi = $msh->fetchNext();
+ $version = $verzi['verCode'];
+ $prg_product_id = 1;
+ $generate_prev_program = false;
+
+ $sellDate = date("Y-m-d H:i:s");
+ $actDate = date("Y-m-d H:i:s");
+ $fizetve = '2050-01-01';
+ $time = date("Y-m-d H:i:s");
+ $lastMod = date("Y-m-d H:i:s");
+ $stat = 0;
+ $invoiceDateFrom = date('Y-m', time());
+ $contact = 0;
+
+ switch ($kategoria) {
+ case 'perp':
+ if (mysqli_real_escape_string($conn, $_GET['reszlet']) == "Y") {
+ switch ($cntry) {
+ case '43':
+ $reszlet = '3';
+ $payment = 'Instalments: 4 Period: quarterly';
+ $fizHatIdo = date('Y-m', strtotime($ma. '+365 days'));
+ if (strstr($program, "Professional") || strstr($program, "Prof.")) {
+ $payment = 'Instalments: 4 Period: monthly';
+ }
+ break;
+
+ case '39':
+ $reszlet = "12";
+ $payment = 'Instalments: 2 Period: yearly';
+ $fizHatIdo = date('Y-m', strtotime($ma. '+365 days'));
+ break;
+
+ case '48':
+ $reszlet = "1";
+ $payment = 'Instalments: 4 Period: monthly';
+ $fizHatIdo = date('Y-m', strtotime($ma. '+120 days'));
+ break;
+
+ case '42':
+ $reszlet = "1";
+ $payment = 'Instalments: 6 Period: monthly';
+ $fizHatIdo = date('Y-m', strtotime($ma. '+180 days'));
+ break;
+ }
+ } else {
+ $reszlet = "";
+ $payment = 'pay in full';
+ $fizHatIdo = date('Y-m', strtotime($ma. '+365 days'));
+ }
+
+ $type = $ertek2['type'];
+
+ $keres = "SELECT `verID` FROM `p_versions` ORDER BY `verCode` DESC limit 1";
+ $msh->query($keres);
+ $limit = $msh->fetchNext();
+
+ $alap_ar = $price; // $alap_ar megszunik!!!!
+ $lan = "0";
+ $ertek = $price;
+ $ev2 = date("Y");
+ $elozoEv1 = $ev2-1;
+ $elozoEv2 = $ev2-2;
+ $elozoEv3 = $ev2-3;
+ $elozoEv4 = $ev2-4;
+ $msg = "";
+ $msg2 = "";
+ $msg3 = "";
+ $msg4 = "";
+
+ if ($hl_prot == "Y") { // Ker hardlockot
+ $kulcs = mysqli_real_escape_string($conn, $_GET['hl_num']);
+ $hardlockPrice = $hardlock_price["nettó"];
+ $ertek = $price + $hardlockPrice;
+ $hardlock_id = $cntry;
+
+ if ($cntry == "43" || $cntry == "39") $ertek = $price;
+ }
+
+ if ($hl_prot == "N") { // Nem ker hardlockot -> szoftveres kulcs
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '95%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $kulcsok = $msh->fetchNext();
+ $kulcs = $kulcsok['hlNum']+1;
+ $hardlock_id = "95";
+ }
+
+ $number = substr($kulcs, 2, 4);
+
+ if ((mysqli_real_escape_string($conn, $_GET['code_prev_version']) == "Y" && $generate_prev_program == false) || mysqli_real_escape_string($conn, $_GET['ver_2']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_3']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_4']) == "Y") {
+ if ($cntry == '37' || $cntry == '43') $ertek += 150;
+ }
+
+ $live = $alap_ar;
+ if(mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y") {
+ $live += 100;
+ $ertek += 100;
+ }
+
+ $subtotal = $price;
+ if ((strpos($program, "Interior") || strpos($program, "Professional")) && strpos($program, "LIVE")) {
+ $subtotal -= 100;
+ $live_item = "Subtotal: 100";
+ }
+
+ if (((strpos($program, "Interior") || strpos($program, "Professional")) && strpos($program, "LIVE") && strpos($program, "option") == FALSE) || mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y") {
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '$cntry%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $live_kulcsok = $msh->fetchNext();
+
+ $query = "SELECT * FROM `p_versions` WHERE currentVer = 0 OR currentVer = 2";
+ $msh->query($query);
+ $curr_ver = $msh->fetchNext();
+
+ $kulcs_live = $live_kulcsok['hlNum']+2;
+ $number_live = substr($kulcs_live, 2,4);
+ $version_live = $curr_ver['verCode'];
+ $lan_live = "0";
+ $type_live = "L";
+ $command = PATH_CODEGEN." -Password " . $cntry . $number_live . $version_live . $lan_live . $type_live;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial_live = fgets($ph, 1024);
+ pclose($ph);
+
+ if(mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y") {
+ $item_live = "
+ Item: Live
+
+ Subtotal: 100";
+ }
+
+ $live_msg = "Serial code 2019 Live: ".$serial_live."";
+
+ $insert = $msh->insert('hardlock', array(
+ 'hlNum' => $kulcs_live,
+ 'hlLan' => '0',
+ 'hlStat' => '1',
+ 'hlDateIssue' => $ma,
+ 'hlUser' =>$user,
+ 'hlManID' => '36',
+ 'hlCtrID' => $cntry,
+ 'old_db' => 'clusers_eng',
+ 'hlTime' => date("Y-m-d H:i:s"),
+ 'product_id' => 2
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => 76,
+ 'prVerID' => $curr_ver['verID'],
+ 'prLan' => '0',
+ 'prPass' => $serial_live,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' =>date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs_live,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $insert = $msh->insert('h_history', array(
+ 'hiHlNum' => $kulcs_live,
+ 'hiDate' => date('Y-m-d'),
+ 'hiManID' => 36,
+ 'hiTypeID' => 3,
+ 'hiTime' => date("Y-m-d H:i:s"),
+ 'hiInfo' => "Web order, Aktiválás érvényessége: 2050-01-01",
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ }
+
+ // 1 evvel ezelotti kulcs generalas
+ if (mysqli_real_escape_string($conn, $_GET['code_prev_version']) == "Y") $generate_prev_program = true;
+
+ // 2 evvel ezelotti kulcs generalas
+ if (mysqli_real_escape_string($conn, $_GET['ver_2']) == "Y") {
+ $version2 = $verzi['verCode']-2;
+ $command = PATH_CODEGEN." -Password " . $hardlock_id . $number . $version2 . $lan . $type;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial17_2 = fgets($ph, 1024);
+ pclose($ph);
+
+ $msg2 = "Serial code $elozoEv2: $serial17_2
";
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $verzi['verID']-2,
+ 'prLan' => '0',
+ 'prPass' => $serial17_2,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ }
+
+ // 3 evvel ezelotti kulcs generalas
+ if (mysqli_real_escape_string($conn, $_GET['ver_3']) == "Y") {
+ $version3 = $verzi['verCode']-3;
+ $command = PATH_CODEGEN." -Password " . $hardlock_id . $number . $version3 . $lan . $type;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial16 = fgets($ph, 1024);
+ pclose($ph);
+
+ $msg3 = "Serial code $elozoEv3: $serial16
";
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $verzi['verID']-3,
+ 'prLan' => '0',
+ 'prPass' => $serial16,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ }
+
+ // 4 evvel ezelotti kulcs generalas
+ if (mysqli_real_escape_string($conn, $_GET['ver_4']) == "Y") {
+ $version4 = $verzi['verCode']-4;
+ $command = PATH_CODEGEN." -Password " . $hardlock_id . $number . $version4 . $lan . $type;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial15 = fgets($ph, 1024);
+ pclose($ph);
+
+ $msg4 = "Serial code $elozoEv4: $serial15
";
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $verzi['verID']-4,
+ 'prLan' => '0',
+ 'prPass' => $serial15,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ }
+
+ if (strstr($program, "Professional") || strstr($program, "Prof.")) $prod = "Professional";
+ if (strstr($program, "Interior")) $prod = "Interior";
+ if (strstr($program, "Studio")) $prod = "Studio";
+ break;
+
+ case 'live':
+ $kulcs = substr((string)tryToAlloc(($cntry*10000)+1, ($cntry*10000)+9999), 0, 6);
+
+ $query = "SELECT * FROM `p_versions` WHERE currentVer = 0 OR currentVer = 2";
+ $msh->query($query);
+ $curr_ver = $msh->fetchNext();
+
+ $version = $curr_ver['verCode'];
+ $lan = "0";
+ $type = "L";
+ $hardlock_id = $cntry;
+ $ertek = $price;
+ $alap_ar = $price;
+ $prod = 'ARCHLINE.XP LIVE';
+ $prg_product_id = 2;
+
+ if ($ertek2['until'] != '' && $ertek2['until'] != NULL) $fizetve = $ertek2['until'];
+ break;
+
+ case 'lt':
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '$cntry%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $kulcs = $msh->fetchNext();
+ $kulcs = $kulcs['hlNum']+1;
+
+ $type = 4;
+ $lan = 0;
+ $hardlock_id = $cntry;
+ $ertek = $price;
+ $alap_ar = $price;
+ $prod = "ARCHLINE.XP LT";
+
+ if (strpos($program, "LT") && strpos($program, "LIVE")) {
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '$cntry%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $kulcs2 = $msh->fetchNext();
+ $kulcs_live = $kulcs2['hlNum']+2;
+
+ $query = "SELECT * FROM `p_versions` WHERE currentVer = 0 OR currentVer = 2";
+ $msh->query($query);
+ $curr_ver = $msh->fetchNext();
+
+ $number_live = substr($kulcs_live, 2,4);
+ $version_live = $curr_ver['verCode'];
+ $lan_live = "0";
+ $type_live = "L";
+ $command = PATH_CODEGEN." -Password " . $cntry . $number_live . $version_live . $lan_live . $type_live;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial_live = fgets($ph, 1024);
+ pclose($ph);
+
+ $insert = $msh->insert('hardlock', array(
+ 'hlNum' => $kulcs_live,
+ 'hlLan' => '0',
+ 'hlStat' => '1',
+ 'hlDateIssue' => $ma,
+ 'hlUser' => $user,
+ 'hlManID' => '36',
+ 'hlCtrID' => $cntry,
+ 'old_db' => 'clusers_eng',
+ 'hlTime' => date("Y-m-d H:i:s"),
+ 'product_id' => 2
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => 76,
+ 'prVerID' => $curr_ver['verID'],
+ 'prLan' => '0',
+ 'prPass' => $serial_live,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs_live,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $insert = $msh->insert('h_history', array(
+ 'hiHlNum' => $kulcs_live,
+ 'hiDate' => date('Y-m-d'),
+ 'hiManID' => 36,
+ 'hiTypeID' => 3,
+ 'hiTime' => date("Y-m-d H:i:s"),
+ 'hiInfo' => "Web order, Aktiválás érvényessége: 2050-01-01",
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $live_msg = "Serial code 2019 LIVE: ".$serial_live."";
+ }
+ break;
+
+ case 'upgrade':
+ $old_serial = mysqli_real_escape_string($conn, $_GET['old_hlNum']);
+
+ // interior, lt, studio, nova, professional
+ $upgrade_array = array(2, 4, 6, 7, 8, 'L');
+
+ if (strstr($program, "LIVE") && strstr($program, "Upgrade")) {
+ if (substr($old_serial, 6, 1) != 'L') {
+ $eredmeny['hiba'] = "Its not a LIVE serial.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ if (substr($old_serial, 7, 2) == $verzi['verPassword8and9']) {
+ $eredmeny['hiba'] = "You can't upgrade this software
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+ }
+
+ if (strlen($old_serial) == "16") { //Update esete
+ if (!in_array(substr($old_serial, 6, 1), $upgrade_array)) {
+ $eredmeny['hiba'] = "Its not a Pro or a Studio serial.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ } else {
+ if (substr($old_serial, 6, 1) == "8" && (substr($old_serial, 7, 2) == $verzi['verPassword8and9'])) {
+ $eredmeny['hiba'] = "You can't upgrade this software
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $query = "SELECT * FROM `h_programs` WHERE `prPass` = {$old_serial}";
+ $msh->query($query);
+ $hl = $msh->fetchNext();
+ $hl_num = $hl['prHlNum'];
+
+ $ertek = $price;
+
+ if (substr($old_serial, 0, 2) == "95") {
+ // A hardlockhoz uj program beszurasa, de olyan verziot kell ami egyezik az eddigivel, + kulcs
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '95%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $hl_kulcs = $msh->fetchNext();
+ $hl_kulcs = $hl_kulcs['hlNum']+1;
+ } else {
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '".$cntry."%' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $hl_kulcs = $msh->fetchNext();
+ $hl_kulcs = $hl_kulcs['hlNum']+1;
+ }
+
+ $kulcs = substr($old_serial, 0, 6);
+ $hardlock_id = substr($old_serial, 0, 2);
+ $number = substr($old_serial, 2,4);
+
+ $query = "SELECT `hlLan` FROM `hardlock` WHERE `hlNum`='".$kulcs."' ORDER BY `hlNum` DESC limit 1";
+ $msh->query($query);
+ $hlLan = $msh->fetchNext();
+ $lan = $hlLan['hlLan'];
+
+ $msh->query("SELECT `termek`, `euro`, `usd`, `seq` FROM `o_products` WHERE `termek` = '{$program}' AND `lang` = '{$cntry}'");
+ $tomb = $msh->fetchNext();
+
+ // Ha NOVA, vagy Professional akkor professionalt kap
+ if (substr($old_serial, 6, 1) == 7 || substr($old_serial, 6, 1) == 8) $type = 8;
+ elseif (substr($old_serial, 6, 1) == 4) $type = 4; // LT upgrade
+ elseif (substr($old_serial, 6, 1) == 2) $type = 2; // Interior upgrade
+ elseif (substr($old_serial, 6, 1) == 'L') { // LIVE upgrade
+ $type = 'L';
+ $prg_product_id = 2;
+ } else {
+ if ($tomb['seq'] == "30" || $tomb['seq'] == "31") $type = 6; // Update Studio Studio-ra
+ else $type = 8; // Update Studio 2017 Prof-ra vagy Update Studio 2016 vagy korabbi Prof-ra
+ }
+
+ $lan2 = 0;
+
+ if ($lan == 0) $lan2 = 0;
+ elseif ($lan == 1) $lan2 = 0;
+ elseif ($lan == 2) $lan2 = 2;
+ elseif ($lan == 3) $lan2 = 3;
+ elseif ($lan == 4) $lan2 = 4;
+ elseif ($lan == 5) $lan2 = 5;
+ elseif ($lan == 10) $lan2 = 6;
+ elseif ($lan == 15) $lan2 = 7;
+ elseif ($lan == 20) $lan2 = 8;
+ elseif ($lan <= 49) $lan2 = 9;
+
+ $lan = $lan2;
+ $command = PATH_CODEGEN." -Password " . $hardlock_id . $number . $version . $lan . $type;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial = fgets($ph, 1024);
+ $password = $serial;
+ pclose($ph);
+
+ $query = "SELECT * FROM `h_programs` WHERE `prPass`='".$serial."'";
+ $msh->query($query);
+ $prg = $msh->fetchNext();
+
+ if (empty($prg) == false) {
+ $eredmeny['hiba'] = "You already upgraded this serial number.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ } else {
+ // Ha studio, akkor meg kell allapítani hogy volt-e hozzatartozo module, ha igen, akkor ott az mdPrID-t, es a mdPrHlNum-ot kell modositani az uj programhoz
+ if (substr($serial, 6, 1) == "6") {
+ // Regi programhoz tartozo modul(ok)
+ $msh->query("SELECT * FROM `p_modules` WHERE `mdPrHlNum` = '{$kulcs}'");
+ $modules = $msh->fetchAssoc();
+ $uj_kulcs = $kulcs;
+ }
+
+ $prod = "Upgrade";
+ }
+ }
+ } else {
+ $eredmeny['hiba'] = "Wrong serial.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+ break;
+
+ case 'crossgrade':
+ $old_serial = mysqli_real_escape_string($conn, $_GET['old_hlNum']);
+
+ if (substr($old_serial, 6, 1) != "4") {
+ $eredmeny['hiba'] = "Its not an LT serial.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $verz = "SELECT `verCode` FROM `p_versions` WHERE `verPassword8and9` = '".substr($old_serial, 7, 2)."'";
+ $msh->query($verz);
+ $verzi = $msh->fetchNext();
+
+ $query = "SELECT hlNum FROM hardlock WHERE hlNum LIKE '95%' AND hlStat = 0 AND (hlDealer = '' OR hlDealer IS NULL) AND (hlUser = '' OR hlUser IS NULL) AND (hlInfo = '' OR hlInfo IS NULL) limit 1";
+ $msh->query($query);
+ $hlnum = $msh->fetchNext();
+ $kulcs = $hlnum['hlNum'];
+ $prod = "Crossgrade";
+ $old_hlnum = substr($old_serial, 0, 6);
+ $hardlock_id = 95;
+ $version = $verzi['verCode'];
+ $type = 8;
+ $ertek = $price;
+ $lan = 0;
+
+ $msh->query("SELECT * FROM `p_modules` WHERE `mdPrHlNum` = '{$old_hlnum}'");
+ $modules = $msh->fetchAssoc();
+ $uj_kulcs = $kulcs;
+ break;
+
+ case 'module':
+ $hl_num = mysqli_real_escape_string($conn, $_GET['old_hlNum']);
+ $query = "SELECT `prId`, `prPass` FROM `h_programs` WHERE `prHlNum` = '{$hl_num}' ORDER BY `prID` DESC limit 1";
+ $msh->query($query);
+ $program_adatok = $msh->fetchNext();
+
+ // Csak Studio-hoz lehet kiadni modulokat
+ if (substr($program_adatok['prPass'], 6,1) != "6") {
+ $eredmeny['hiba'] = "You can buy modules only for Studio
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $prId = $program_adatok['prId'];
+ $prHlNum = $hl_num;
+
+ if (strpos($program, "Terrain")) $verz = "2";
+ else $verz = "22";
+
+ // A hozzatartozo program serialja
+ $password = $program_adatok['prPass'];
+ $command = PATH_CODEGEN." -Module " . $password . " " . $verz;
+ $ph = popen($command, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $modcode = fgets($ph, 1024);
+ pclose($ph);
+
+ // Ha mar van ilyen module az adott programhoz
+ $query = "SELECT `ID` FROM `p_modules` WHERE `mdPrID` = '{$prId}' AND `mdID` = '{$verz}' AND `mdPrHlNum` = '{$prHlNum}'";
+ $msh->query($query);
+ $module = $msh->fetchNext();
+
+ if ($module['ID']) {
+ $eredmeny['hiba'] = "You already have this module
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $insert = $msh->insert('p_modules', array(
+ 'mdID' => $verz,
+ 'mdPrID' => $prId,
+ 'mdPrHlNum' => $prHlNum,
+ 'mdCode' => $modcode,
+ 'mdDate' => $ma,
+ 'mdPrice' => '0',
+ 'mdInvNum' => '',
+ 'mdOrdNum' => $prOrderNumber,
+ 'mdIsPurchase' => '0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $ertek = $price;
+ $serial = $modcode;
+ $prod = "Module";
+ break;
+
+ case 'nonp':
+ //Ha mar volt nala ebben az evben?
+ $nonpr = mysqli_real_escape_string($conn, $_GET['nonpro_ev']);
+ $datum = mysqli_real_escape_string($conn, $_GET['datum']); // Ezt kérte speciálisan a partner. Attól függetlenül nem ez a dátum kerül be az adatbázisba
+ $date = date_create($datum);
+ $datum = date_format($date, "d/m/Y");
+ $expire = date_format($date, "Y-m-d");
+
+ $ev = substr($nonpr, 3,4);
+
+ $query = "SELECT `verID`, `verCode`, `verPassword8and9` FROM `p_versions` WHERE `verName` = '{$nonpr}'";
+ $msh->query($query);
+ $vcode = $msh->fetchNext();
+
+ if (strpos($program, "LIVE")) {
+ $prg_product_id = 2;
+ $type = "L";
+ } else {
+ $prg_product_id = 1;
+ $type = "8";
+ }
+
+ $query = "SELECT SUBSTRING(`prPass`, 8, 2) AS `prPass` FROM `h_programs` WHERE `prHlNum` IN (SELECT `hlNum` FROM `hardlock` WHERE `hlUser` = '{$user}' AND product_id = '{$prg_product_id}') AND `prHlNum` LIKE '99%'";
+ $msh->query($query);
+ $nonprofit_kulcsok_evben = $msh->fetchAssoc();
+
+ $evek = array();
+ foreach ($nonprofit_kulcsok_evben as $v) {
+ $b = (object)$v;
+ $evek[] = $b->prPass;
+ }
+
+ // Ha mar volt nonprofit kulcsa az adott evben akkor nem enged tovább
+ if (!empty($evek)) {
+ if (in_array($vcode['verPassword8and9'], $evek) !== FALSE) {
+ $eredmeny['hiba'] = "You already have a non-profit key for this product
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+ }
+
+ $query = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '99%' AND `hlStat` = 0 AND `hlLan` = 0 ORDER BY `hlNum` ASC limit 1";
+ $msh->query($query);
+ $nonprofitok = $msh->fetchNext();
+ $kulcs = $nonprofitok['hlNum'];
+
+ // Ha nincs mar, akkor letre kell hozni!!!
+ if (empty($nonprofitok['hlNum'])) {
+ $eredmeny['hiba'] = "There are no free nonprofit keys yet, please contact us.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+
+ $msh->update("hardlock", array("hlStat"=>'1', "hlUser"=>$user, "old_hlID"=>'', "old_db"=>'clusers_eng', "hlDateIssue"=>$ma, "product_id"=>2, "hlCtrID"=>$cntry),"hlNum = {$kulcs}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $version = $vcode['verCode'];
+ $hardlock_id = substr($kulcs, 0, 2);
+ $lan = 0;
+ $contact = 5;
+ $fizetve = date('Y-m-d', strtotime($ma. '+60 days'));
+
+ if ($expire < $fizetve) $fizetve = $expire;
+
+ if (($cntry == 61 || $cntry == 37) && strpos($program, "LIVE") == FALSE) {
+ $query_live = "SELECT `hlNum` FROM `hardlock` WHERE `hlNum` LIKE '99%' AND `hlStat` = 0 AND `hlLan` = 0 ORDER BY `hlNum` ASC limit 1";
+ $msh->query($query_live);
+ $nonprofitok_live = $msh->fetchNext();
+
+ $query = "SELECT * FROM `p_versions` WHERE currentVer = 0 OR currentVer = 2";
+ $msh->query($query);
+ $curr_ver = $msh->fetchNext();
+
+ $kulcs_live = $nonprofitok_live['hlNum'];
+ $number_live = substr($kulcs_live, 2,4);
+ $version_live = $curr_ver['verCode'];
+ $lan_live = "0";
+ $type_live = "L";
+
+ $command = PATH_CODEGEN." -Password " . 99 . $number_live . $version_live . $lan_live . $type_live;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial_live = fgets($ph, 1024);
+ pclose($ph);
+
+ $msh->update("hardlock", array("hlStat"=>'1', "hlUser"=>$user, "old_hlID"=>'', "old_db"=>'clusers_eng', "hlDateIssue"=>$ma, "product_id"=>2, "hlCtrID"=>$cntry),"hlNum = {$kulcs_live}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => "76",
+ 'prVerID' => $curr_ver['verID'],
+ 'prLan' => '0',
+ 'prPass' => $serial_live,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => date('Y-m-d', strtotime($ma. '+60 days')),
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prContact' => '5',
+ 'prHlNum' => $kulcs_live,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '0',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => '',
+ 'prInvoiceRecurrence' => '',
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $insert = $msh->insert('h_history', array(
+ 'hiHlNum' => $kulcs_live,
+ 'hiDate' => date('Y-m-d'),
+ 'hiManID' => 36,
+ 'hiTypeID' => 3,
+ 'hiTime' => date("Y-m-d H:i:s"),
+ 'hiInfo' => "Web order, Aktiválás érvényessége: ".date('Y-m-d', strtotime($ma. '+60 days')),
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $live_nonp = "Activation key Live: $serial_live
";
+ }
+
+ if ($cntry == '82') $ertek = $price; // Koreaban a Non-Profit fizetos
+ else $ertek = 0;
+
+ if ($_FILES) {
+ user_error(print_r($_FILES, true));
+ $uploads_dir = 'tmpl/';
+ $target_path = $uploads_dir.basename($_FILES['file']['name'] );
+ if (move_uploaded_file($_FILES['file']['tmp_name'], $target_path))
+ echo 'File uploaded';
+ else {
+ $eredmeny['hiba'] = 'Error in uploading file ';
+ echo json_encode($eredmeny);
+ return false;
+ }
+ }
+
+ $prod = "Non-profit";
+ break;
+
+ case 'hardlock':
+ $regi_kulcs = substr(mysqli_real_escape_string($conn, $_GET['old_hlNum']),0,6);
+ $kulcs = mysqli_real_escape_string($conn, $_GET['hl_num']);
+
+ // megadtak-e, letezik-e uj kulcs
+ if (!$regi_kulcs || empty($regi_kulcs) || strlen($regi_kulcs) != 6) {
+ $eredmeny['hiba'] = "There is a problem with the hardlock key
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ } else {
+ $oldHlNum = "SELECT * FROM `hardlock` WHERE hlNum = '".$regi_kulcs."'";
+ $msh->query($oldHlNum);
+ $talalat = $msh->fetchNext();
+ if (!$talalat['hlNum']) {
+ $eredmeny['hiba'] = "There is a problem with the hardlock key
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ } else {
+ // regi kulcshoz az ujat beallitani
+ // uj kulcsot aktivalni, regi kulcsat beallítani
+ // usert atvinni
+ $update = $msh->update("hardlock", array("hlNewHlNum"=>$kulcs), "hlNum = {$regi_kulcs}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $update = $msh->update("hardlock", array('hlDatePro' => date('Y-m-d', time()), 'hlStat' => 2), "hlNum = {$regi_kulcs}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $update = $msh->update("h_programs", array('prStat' => 1), "prHlNum = {$regi_kulcs}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $insert = $msh->insert("h_history", array(
+ "hiHlNum" => $regi_kulcs,
+ "hiDate" => date('Y-m-d', time()),
+ "hiManID" => 36,
+ "hiTypeID" => 5,
+ "hiTime" => date('Y-m-d H:i:s', time()),
+ "hiInfo" => "Web order: Új kulcs"
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ $update = $msh->update("hardlock", array("hlOldHlNum"=>$regi_kulcs), "hlNum = {$kulcs}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $update = $msh->update("hardlock", array("hlStat"=>'1', "hlLan"=>'0', "hlDateIssue"=>$ma, "hlManID"=>'36', "hlCtrID"=>$cntry, "hlTime"=>date("Y-m-d H:i:s"), "hlUser"=>$user), "hlNum = {$kulcs}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $query = "SELECT * FROM `h_programs` WHERE `prHlNum` = '".$regi_kulcs."' ORDER BY `prID` DESC limit 1";
+ $msh->query($query);
+ $utolsoProgram = $msh->fetchNext();
+
+ $eddigi_ver_id = $utolsoProgram['prVerID'];
+
+ $verz = "SELECT `verCode` FROM `p_versions` WHERE `verID` = '".$eddigi_ver_id."'";
+ $msh->query($verz);
+ $verzi = $msh->fetchNext();
+ $version = $verzi['verCode'];
+ $type = $utolsoProgram['prTypeID'];
+ $ertek = $price;
+ }
+ }
+
+ $hardlock_msg = "Old hardlock: {$regi_kulcs}";
+ $hardlock_msg .= "New hardlock: {$$kulcs}";
+ $sellDate = $utolsoProgram['prSellDate'];
+ $actDate = $utolsoProgram['prActDate'];
+ $fizetve = $utolsoProgram['prFizetve'];
+ $time = $utolsoProgram['prTime'];
+ $lastMod = $utolsoProgram['prLastMod'];
+ $contact = $utolsoProgram['prContact'];
+ $stat = 0;
+ $cntry = $utolsoProgram['prCtrID'];
+ $invoiceDateFrom = $utolsoProgram['prInvoiceDateFrom'];
+ $fizHatIdo = $utolsoProgram['prInvoiceDateto'];
+ $reszlet = $utolsoProgram['prInvoiceRecurrence'];
+ $lan = $talalat["hlLan"];
+ $ertek = $price;
+ $prod = "Hardlock";
+ $hardlock_id = substr($kulcs, 0, 2);
+
+ $msh->query("SELECT * FROM `p_modules` WHERE `mdPrHlNum` = '{$regi_kulcs}'");
+ $modules = $msh->fetchAssoc();
+ $uj_kulcs = $kulcs;
+ break;
+ }
+
+ $number = substr($kulcs, 2,4);
+
+ if ($kategoria != "module") {
+ $command = PATH_CODEGEN." -Password " . $hardlock_id . $number . $version . $lan . $type;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial = fgets($ph, 1024);
+ $password = $serial;
+ pclose($ph);
+ }
+
+ if ($kategoria != "module") {
+ // hardlock tablaban benne van mar a kulcs? Akkor update. Ha nincs, akkor insert
+ $van = "SELECT * FROM `hardlock` WHERE `hlNum` = '".$kulcs."'";
+ $msh->query($van);
+ $result = $msh->fetchNext();
+ if (!empty($result)) {
+ $update = $msh->update("hardlock", array("hlStat"=>'1', "hlLan"=>'0', "hlDateIssue"=>$ma, "hlManID"=>'36', "hlCtrID"=>$cntry, "product_id"=>$prg_product_id, "hlTime"=>date("Y-m-d H:i:s"), "hlUser"=>$user), "hlNum = {$kulcs}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ } else {
+ $insert = $msh->insert('hardlock', array(
+ 'hlNum' => $kulcs,
+ 'hlLan' => '0',
+ 'hlStat' => '1',
+ 'hlDateIssue' => $ma,
+ 'hlUser' => $user,
+ 'hlManID' => '36',
+ 'hlCtrID' => $cntry,
+ 'old_db' => 'clusers_eng',
+ 'hlTime' => date("Y-m-d H:i:s"),
+ 'product_id' => $prg_product_id
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ }
+ }
+
+ //o_ordersbe bekerules
+ $orders_insert = $msh->insert('o_orders', array(
+ 'ip' => $ip,
+ 'country' => $cntry,
+ 'date' => $ma,
+ 'software' => $program,
+ 'user_name' => $u_name,
+ 'user_email' => $email,
+ 'order' => $prOrderNumber,
+ 'input_key' => $regi_kulcs,
+ 'output_key' => $serial,
+ 'price' => $ertek,
+ 'info' => $info,
+ 'instalments' => $payment
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ // verID meghatarozasa -> mindig az aktualis evhez tartozot valasztja ki
+ $query = "SELECT `verID` FROM `p_versions` WHERE `verCode` = '".$version."'";
+ $msh->query($query);
+ $tomb = $msh->fetchNext();
+
+ $userNumber = $lan == 0 || IsSoftwareKey($serial) == false ? 1 : $lan;
+
+ if ($generate_prev_program) {
+ // Jelenleg meg 2019-es programot is adunk!
+ $ev2 = date("Y");
+ $elozoEv1 = $ev2-1;
+ $ver_prev = $verzi['verCode']-1;
+ $command = PATH_CODEGEN." -Password " . $hardlock_id . $number . $ver_prev . $lan . $type;
+ $ph = popen($command, "r") or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $serial_prev = fgets($ph, 1024);
+ pclose($ph);
+
+ $lt_message = "Serial code $elozoEv1: ".$serial_prev."";
+ $msg_2019 = "Serial $elozoEv1: ".$serial_prev."";
+ $msg = "Serial code $elozoEv1: $serial_prev
";
+ }
+
+ if ($type == "L") $type = 76;
+
+ if ($kategoria != "module") {
+ for ($i = 1; $i <= $userNumber; $i++) {
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $tomb['verID'],
+ 'prLan' => $lan,
+ 'prPass' => $serial,
+ 'prSellDate' => $sellDate,
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => $actDate,
+ 'prFizetve' => $fizetve,
+ 'prTime' => $time,
+ 'prLastMod' => $lastMod,
+ 'prPrice' => $ertek,
+ 'prContact' => $contact,
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => $stat,
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => $invoiceDateFrom,
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ }
+ }
+
+ if ($generate_prev_program) {
+ // Jelenleg meg 2019-es programot is adunk!
+ for ($i = 1; $i <= $userNumber; $i++) {
+ $insert = $msh->insert('h_programs', array(
+ 'prTypeID' => $type,
+ 'prVerID' => $tomb['verID']-1,
+ 'prLan' => $lan,
+ 'prPass' => $serial_prev,
+ 'prSellDate' => date("Y-m-d H:i:s"),
+ 'prOrdNum' => $prOrderNumber,
+ 'prActDate' => date("Y-m-d H:i:s"),
+ 'prFizetve' => '2050-01-01',
+ 'prTime' => date("Y-m-d H:i:s"),
+ 'prLastMod' => date("Y-m-d H:i:s"),
+ 'prPrice' => $alap_ar,
+ 'prContact' => '0',
+ 'prHlNum' => $kulcs,
+ 'prManID' => '36',
+ 'prCtrID' => $cntry,
+ 'prStat' => '1',
+ 'prActCode' => '',
+ 'prInvoiceDateFrom' => date('Y-m', time()),
+ 'prInvoiceDateto' => $fizHatIdo,
+ 'prInvoiceRecurrence' => $reszlet,
+ 'old_db' => 'clusers_eng',
+ 'old_prID' => '0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+ }
+ }
+
+ if ($kategoria == 'hardlock') // Eddig programokat tiltani
+ $update = $msh->update("h_programs",array("prStat"=>'1'),"prHlNum = {$regi_kulcs}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ if (($kategoria == "upgrade" || $kategoria == "crossgrade" || $kategoria == "hardlock") && !empty($modules)) {
+ // Ha van a module, akkor uj modulok generalasa kulccsal egyutt
+ if (!empty($modules)) {
+ $query = "SELECT `prHlNum`, `prID`, `prPass` FROM `h_programs` WHERE `prHlNum` = '{$kulcs}' ORDER BY `prID` DESC limit 1";
+ $msh->query($query);
+ $program_adatok = $msh->fetchNext();
+
+ $prId = $program_adatok['prID'];
+ $password = $program_adatok['prPass'];
+
+ $msh->query("SELECT `mdID` FROM `p_modules` WHERE `mdPrHlNum` = '".$kulcs."'");
+ $b = $msh->fetchAssoc();
+
+ $email_m1_nev = "";
+ $email_m1_kulcs = "";
+ $email_m2_nev = "";
+ $email_m2_kulcs = "";
+
+ $e = 0;
+
+ foreach ($b as $b) {
+ $r = (object)$b;
+ $e++;
+ $verz = $r->mdID;
+ $command = PATH_CODEGEN." -Module " . $password . " " . $verz;
+ $ph = popen( $command, "r" ) or die( "A 'codegen' paranccsal nem veheto fel kapcsolat" );
+ $modcode = fgets( $ph, 1024 );
+ pclose($ph);
+
+ $insert = $msh->insert('p_modules', array(
+ 'mdID' => $verz,
+ 'mdPrID' => $prId,
+ 'mdPrHlNum' => $uj_kulcs,
+ 'mdCode' => $modcode,
+ 'mdDate' => $ma,
+ 'mdPrice' => '0',
+ 'mdInvNum' => '',
+ 'mdOrdNum' => $prOrderNumber,
+ 'mdIsPurchase' =>'0',
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ if ($verz == "2") $mod_nev = "Module - Terrain";
+ else $mod_nev = "Module - Rendering";
+
+ if ($e == 1) {
+ $email_m1_nev = $mod_nev;
+ $email_m1_kulcs = $modcode;
+ } elseif ($e == 2){
+ $email_m2_nev = $mod_nev;
+ $email_m2_kulcs = $modcode;
+ } else {
+ $email_m1_nev = "";
+ $email_m1_kulcs = "";
+ $email_m2_nev = "";
+ $email_m2_kulcs = "";
+ }
+ }
+ }
+ }
+
+ $insert = $msh->insert('h_history', array(
+ 'hiHlNum' => $kulcs,
+ 'hiDate' => date('Y-m-d'),
+ 'hiManID' => 36,
+ 'hiTypeID' => 3,
+ 'hiTime' => date("Y-m-d H:i:s"),
+ 'hiInfo' => "Web order, Aktiválás érvényessége: 2050-01-01",
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ require_once("messages.php");
+ switch ($kategoria) {
+ case 'perp':
+ if ($hl_prot == "Y") { // Ezt marciusban vissza kell kommentezni !!!!!! Ez az elozo evi programot is legeneralja!!! Eredeti: mysqli_real_escape_string($conn, $_GET['code_prev_version']) == "Y"
+ if (($serial_prev != "" && $serial_prev != null) || mysqli_real_escape_string($conn, $_GET['ver_2']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_3']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_4']) == "Y") {
+ if ($cntry == "43" || $cntry == "39" || $cntry == "37") $message = $message['teljes_hl17_np'];
+ else $message = $message['teljes_hl17'];
+ } else {
+ if ($cntry == "43" || $cntry == "39") $message = $message['teljes_hl_np'];
+ else $message = $message['teljes_hl'];
+ }
+ }
+
+ if ($hl_prot == "N") { // Ezt marciusban vissza kell kommentezni !!!!!! Ez az elozo evi programot is legeneralja!!! Eredeti: mysqli_real_escape_string($conn, $_GET['code_prev_version']) == "Y"
+ if (($serial_prev != "" && $serial_prev != null) || mysqli_real_escape_string($conn, $_GET['ver_2']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_3']) == "Y" || mysqli_real_escape_string($conn, $_GET['ver_4']) == "Y")
+ $message = $message['teljes_sw17'];
+ else
+ $message = $message['teljes_sw'];
+ }
+ break;
+
+ case 'live':
+ $message = $message['teljes_live'];
+ break;
+
+ case 'lt':
+ $message = $message['teljes_live'];
+ break;
+
+ case 'upgrade':
+ if ($email_m1_nev != "") $message = $message['upgrade_modulokkal'];
+ else $message = $message['upgrade'];
+ break;
+
+ case 'crossgrade':
+ $message = $message['upgrade'];
+ break;
+
+ case 'module':
+ $message = $message['module'];
+ break;
+
+ case 'nonp':
+ $message = $message['nonprofit'];
+ break;
+
+ case 'hardlock':
+ if ($email_m1_nev != "") $message = $message['hardlock_modulokkal'];
+ else $message = $message['hardlock'];
+ break;
+ }
+
+ $to = $kapcsolat['email'];
+ $subject = 'ARCHLine.XP order: '.$ctryName['ctrNameEng'].' '.$prOrderNumber.' '.$prod;
+ $headers = "Content-Type: text/html; charset=utf-8\r\n";
+
+ if ($cntry == "37") $headers .= 'Cc: mate.nagy@cadline.hu' . "\r\n";
+ else $headers .= 'Cc: office@cadline.hu' . "\r\n";
+
+ if($kapcsolat['sub_email'] != null && $kapcsolat['sub_email'] != "") $headers .= 'Bcc: '.$kapcsolat['sub_email'] . "\r\n";
+
+ mail($to, $subject, $message, $headers);
+
+ $eredmeny['sikeres'] = "Thank You for Your Order.
+ We have accepted your online purchase order.
+ Once processed, invoice will be sent for your e-mail address.
+ Please allow 1 working day for your order to be processed.
+
+ Continue.";
+
+ if($isInvoice && $price != 0) { // Non-profit programnal nem kell szamlat generalni
+ $live_price = 100;
+ if(strpos($program, "Including LIVE")) $price = $price - $live_price;
+
+ if(is_numeric($afa_key) && $afa_key > 0) { // Default afa
+ $vat_amount_live = $live_price * $afa; //csak Afa osszege
+ $brut_amount_live = $live_price * ($afa+1); // Brutto teljes ar
+ $vat_amount_otheritem = $price * $afa;
+ $brut_amount_otheritem = $price * ($afa+1);
+ $vat_amount_hardlock = $hardlock_price["nettó"] * $afa;
+ $brut_amount_hardlock = $hardlock_price["nettó"] * ($afa+1);
+ } else {
+ $vat_amount_live = 0; //csak Afa osszege
+ $brut_amount_live = $live_price; // Brutto teljes ar
+ $vat_amount_otheritem = 0;
+ $brut_amount_otheritem = $price;
+ $vat_amount_hardlock = 0;
+ $brut_amount_hardlock = $hardlock_price["nettó"];
+ }
+
+ if ($cntry == 33) $comment = "Client: ".$u_name." - "." Serial: ".$kulcs." order ".$prOrderNumber;
+ else $comment = $kulcs." order ".$prOrderNumber;
+
+ $item = new InvoiceItem($termek["megnevezés"], $price, 1.0, $termek["egység"], $afa_key);
+ $item->setNetPrice($price);
+ $item->setVatAmount($vat_amount_otheritem);
+ $item->setGrossAmount($brut_amount_otheritem);
+ $item->setComment($comment);
+
+ $itemLedger = new InvoiceItemLedger('', '', strval($termek["árbevétel_főkönyvi_szám"]), '');
+ $item->setLedgerData($itemLedger);
+
+ $invoice->addItem($item);
+
+ if ($hl_prot == "Y") {
+ if ($afa_key == "EUK") $revenueLedgerNumber = 931;
+ else $revenueLedgerNumber = 9313;
+
+ $item = new InvoiceItem($prod_prefix." ARCHLine.XP Hardlock", $hardlock_price["nettó"], 1.0, $termek["egység"], $afa_key);
+ $item->setComment($kulcs." order ".$prOrderNumber);
+ $item->setNetPrice($hardlock_price["nettó"]);
+ $item->setVatAmount($vat_amount_hardlock);
+ $item->setGrossAmount($brut_amount_hardlock);
+
+ $itemLedger = new InvoiceItemLedger('', '', strval($revenueLedgerNumber), '');
+ $item->setLedgerData($itemLedger);
+
+ $invoice->addItem($item);
+ }
+
+ if (mysqli_real_escape_string($conn, $_GET['inclLive']) == "Y" || strpos($program, "Including LIVE") == TRUE) {
+ if ($afa_key == "EUK") $revenueLedgerNumber = 931;
+ else $revenueLedgerNumber = 9312;
+
+ $item = new InvoiceItem($prod_prefix." ARCHLine.XP LIVE License", $live_price, 1.0, $termek["egység"], $afa_key);
+ $item->setComment($kulcs_live." order ".$prOrderNumber);
+ $item->setNetPrice($live_price);
+ $item->setVatAmount($vat_amount_live);
+ $item->setGrossAmount($brut_amount_live);
+
+ $itemLedger = new InvoiceItemLedger('', '', strval($revenueLedgerNumber), '');
+ $item->setLedgerData($itemLedger);
+
+ $invoice->addItem($item);
+ }
+
+ $result = $agent->generateInvoice($invoice);
+
+ if($result->isSuccess()) { // Az invoice mezo alapertelmezetten 0, ha sikeres a szamla generalas, updateljuk 1-re
+ $query = "UPDATE o_orders SET invoice = 1 WHERE country = {$cntry} AND o_orders.order = '{$prOrderNumber}'";
+ $msh->query($query);
+ }
+ }
+
+ $query = "SELECT invoice FROM o_orders WHERE country = {$cntry} AND o_orders.order = '{$prOrderNumber}' ORDER BY id desc";
+ $msh->query($query);
+ $inv = $msh->fetchNext();
+
+ if ($isInvoice && $price != 0 && $inv['invoice'] != 1) { // Nem sikerult a szamlat legeneralni, emailt kuldunk az office-nak
+ $message = "";
+ $message .= "Email: ".$kapcsolat['email']."
";
+ $message .= "Orders:
";
+ $message .= "Order number: {$prOrderNumber}
";
+ $message .= "Program: {$program}";
+
+ $to = "office@cadline.hu";
+ $subject = "Számlagenerálás hiba";
+ $headers = "Content-Type: text/html; charset=utf-8\r\n";
+ mail($to, $subject, $message, $headers);
+
+ $eredmeny['hiba'] = "Order accepted, but error at making invoice! Please contact office@cadline.hu.
+
+ Continue.";
+ echo json_encode($eredmeny);
+ return false;
+ }
+ } else {
+ $eredmeny['hiba'] = "You've reached your daily limit for orders. Please try it again tomorrow or contact office@cadline.hu
+
+ Continue.";
+ }
+}
+echo json_encode($eredmeny);
+
+function IsSoftwareKey($serial = "")
+{
+ if ($serial == "") return false;
+
+ $ph = popen(PATH_CODEGEN." -IsSoftwareKey ".$serial, "r") or die("A 'codegen' paranccsal nem veheto fel kapcsolat");
+ $szoftveres = fgets($ph, 1024);
+ pclose($ph);
+
+ return ($szoftveres == 'true');
+}
+
+function tryToAlloc($min = 990001, $max = 997000)
+{
+ $config['db_host'] = 'localhost';
+ $config['db_user'] = 'cadline';
+ $config['db_pass'] = 'Shea6hoo';
+ $config['db_name'] = 'cl_hlusers';
+
+ $msh = new hivasok();
+ $msh->init($config['db_host'], $config['db_name'], $config['db_user'], $config['db_pass']);
+ $conn = new mysqli($config['db_host'], $config['db_user'], $config['db_pass'], $config['db_name']);
+
+ $ret = 0;
+ if ((int)$min == 0 || (int)$max == 0) return $ret;
+
+ $msh->query("SELECT LEFT(hlNum, 6) AS hlNum FROM hardlock WHERE hlNum >= ".(int)$min." AND hlNum < ".(int)$max." ORDER BY hlNum;");
+ $res = $msh->fetchAssoc();
+
+ if (count($res)) {
+ $keszlet = range($min, $max);
+ foreach ($res as $r) $kulcsok[]=$r['hlNum'];
+
+ $diff = array_diff($keszlet, $kulcsok);
+ reset($diff);
+ $ret = current($diff);
+ }
+ return $ret;
+}
+
+function DeactivateHardlock($hlNum, $hlManID, $hlInfo, $hlDatePro)
+{
+ $config['db_host'] = 'localhost';
+ $config['db_user'] = 'cadline';
+ $config['db_pass'] = 'Shea6hoo';
+ $config['db_name'] = 'cl_hlusers';
+
+ $msh = new hivasok();
+ $msh->init($config['db_host'], $config['db_name'], $config['db_user'], $config['db_pass']);
+ $conn = new mysqli($config['db_host'], $config['db_user'], $config['db_pass'], $config['db_name']);
+
+ $update = $msh->update("hardlock", array('hlDatePro' => $hlDatePro, 'hlStat' => '2'), "hlNum = {$hlNum}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $update = $msh->update("h_programs", array('prStat' => 1), "prHlNum = {$hlNum}");
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+
+ $insert = $msh->insert("h_history", array(
+ "hiHlNum" => $hlNum,
+ "hiDate" => date('Y-m-d', time()),
+ "hiManID" => $hlManID,
+ "hiTypeID" => 5,
+ "hiTime" => date('Y-m-d H:i:s', time()),
+ "hiInfo" => $hlInfo
+ ));
+
+ $queryString = $msh->getQueryString();
+ $insert = $msh->insert('debug_table', array(
+ 'data' => $queryString,
+ 'insert_date' => date('Y-m-d h:i:s'),
+ 'session_id' => $sesion_id
+ ));
+}
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/szerver2.php.evidence.json b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/szerver2.php.evidence.json
new file mode 100644
index 0000000..78acbfb
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/szerver2.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6883",
+ "log_excerpt": "[quarantine] dev.cadline.hu:php7_update/partners.archlinexp.com/public/order/szerver2.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/dev/php7_update/partners.archlinexp.com/public/order/szerver2.php)",
+ "original_sha256": "fbffb453e8e48ee0a2888583a65ff6aac1315ae8843ea81088960b49bf93d099",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1594129255,
+ "size": 88652,
+ "uid": 12425
+ },
+ "rel_path": "php7_update/partners.archlinexp.com/public/order/szerver2.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "dev.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/sub.archline.hu/components/com_showroom/views/upload/view.html.php b/var/www/hosting/cadline.hu/dev/php7_update/sub.archline.hu/components/com_showroom/views/upload/view.html.php
new file mode 100644
index 0000000..76a12f4
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/sub.archline.hu/components/com_showroom/views/upload/view.html.php
@@ -0,0 +1,235 @@
+'en-GB','hun'=>'hu-HU');
+ protected $defLang='eng';
+ protected $desc=array();
+ protected $data=array();
+ protected $selected_type;
+ protected $selected_manufacture;
+ protected $selected_family;
+ protected $selected_category;
+ protected $selected_subcategory;
+
+ public $pf='ProductsController';
+
+ public function display($tpl = null)
+ {
+ $app=&JFactory::getApplication();
+ $session=&JFactory::getSession();
+ $document=&JFactory::getDocument();
+ $model=$this->getModel();
+
+ if (isset($_GET['lang']))
+ {
+ if (array_key_exists(trim($_GET['lang']), $this->acceptLang)) { $session->set('sr_lang',trim($_GET['lang'])); }
+ else { $session->set('sr_lang',$this->defLang); }
+ }
+
+ if (isset($_GET['file'])) $session->set('sr_file',(trim(addslashes($_GET['file']))=='none' ? '' : trim(addslashes($_GET['file']))));
+ if (isset($_GET['type'])) $session->set('sr_type',(trim(addslashes($_GET['type']))=='none' ? '' : trim(addslashes($_GET['type']))));
+ if (isset($_GET['template']) && trim($_GET['template'])=='blankframe') $session->set('sr_template','blankframe');
+ if (!isset($_SESSION['__default']['sr_lang'])) $session->set('sr_lang',$this->defLang);
+
+ JFactory::getLanguage()->load('com_showroom', JPATH_SITE, $this->acceptLang[$session->get('sr_lang')], true);
+
+ $this->sess=$_SESSION['__default'];
+ $this->types=$this->get('Types');
+ $this->manufactures=$model->getManufactures($this->sess['sr_type']);
+ $this->families=$model->getFamilies($this->sess['sr_type'],$this->sess['sr_manufacture']);
+ $this->family=$model->getFamily(((int)$this->sess["sr_family"]>0 ? $this->sess['sr_family'] : 0));
+ $this->querystring='&lang='.$session->get('sr_lang')
+ .($session->get('sr_template')>'' ? '&template='.$session->get('sr_template') : '')
+ .($session->get('sr_file')>'' ? '&file='.$session->get('sr_file') : '')
+ .($session->get('sr_type')>'' ? '&type='.$session->get('sr_type') : '');
+
+ if ($session->get('sr_file')>"") {
+ $descriptor='/home/vendeg/'.$session->get('sr_file');
+ if (is_file($descriptor))
+ {
+ $this->desc=explode("#",file_get_contents($descriptor));
+
+ if (is_array($this->desc) && count($this->desc)) { foreach ($this->desc as $k=>$v) $this->desc[$k]=trim($v); }
+
+ if ($this->desc[0]==$this->desc[1]) // regi struktura
+ {
+ $this->data=array(
+ "file"=>$this->desc[0],
+ "vendegkep"=>$this->desc[2],
+ "nev_eng"=>$this->desc[4],
+ "nev_hun"=>($this->desc[5] ? $this->desc[5] : $this->desc[4]),
+ "tipus"=>$this->sess['sr_type'],
+ "kategoria"=>"",
+ "alkategoria"=>"",
+ "gyarto"=>"",
+ "prver"=>($this->desc[6]=="-1" ? "2012" : $this->desc[6]),
+ "ifc"=>false
+ );
+ }
+ else // uj struktura
+ {
+ $this->data=array(
+ "file"=>$this->desc[0],
+ "vendegkep"=>$this->desc[1],
+ "nev_eng"=>$this->desc[2],
+ "nev_hun"=>$this->desc[3],
+ "tipus"=>$this->desc[4],
+ "kategoria"=>$this->desc[5],
+ "alkategoria"=>$this->desc[6],
+ "gyarto"=>$this->desc[7],
+ "prver"=>($this->desc[8]=="-1" ? "2012" : $this->desc[8]),
+ "ifc"=>(substr($this->desc[0],-4)==".ifc"?TRUE:FALSE)
+ );
+ }
+
+ if ($this->data['gyarto']>"") { $manufacure=$model->getManufactureByName($this->data['gyarto']); }
+ if ($this->data['kategoria']>"") { $kategoria=$model->getParentByName($this->data['tipus'],$this->data['kategoria']); }
+ if ($this->data['alkategoria']>"" && $kategoria->id>0) { $alkategoria=$model->getSubcatByName($this->data['tipus'],$kategoria->id,$this->data['alkategoria']); }
+
+ $this->selected_type=$this->data['tipus'];
+ $this->selected_manufacture=((int)$manufacure->id>0 ? (int)$manufacure->id : 0);
+ $this->selected_family=$this->sess['sr_family'];
+ $this->selected_category=((int)$kategoria->id>0 ? (int)$kategoria->id : 0);
+ $this->selected_subcategory=((int)$alkategoria->id>0 ? (int)$alkategoria->id : 0);
+
+// kis kép elhelyezése a végleges helyére
+ $honnan='/home/vendeg/'.$this->data['vendegkep'];
+ $hova=$_SERVER['DOCUMENT_ROOT'].'/public/img/collection/'.$this->data['tipus'];
+ if (!is_dir($hova)) mkdir($hova, 0777);
+ $hova.='/'.$this->data['vendegkep'];
+ if (is_file($honnan) && !is_file($hova)) { copy($honnan,$hova); }
+
+ if (isset($_POST['save']))
+ {
+ $tomb=array(
+ 'm_id'=>(int)$_POST['m_id'],
+ 'c_id'=>(int)$_POST['c_id'],
+ 'struct_id'=>(int)$_POST['subcat'],
+ 'title_hun'=>trim(addslashes($_POST['title_hun'])),
+ 'title_eng'=>trim(addslashes($_POST['title_eng'])),
+ 'desc_hun'=>trim(addslashes($_POST['desc_hun'])),
+ 'desc_eng'=>trim(addslashes($_POST['desc_eng'])),
+ 'tipus'=>$_POST['tipus'],
+ 'fajl'=>$this->data['file'],
+ 'version'=>$this->data['prver'],
+ 'deleted'=>(isset($_POST['deleted']) ? 0 : 1),
+ );
+
+// $newID=($this->data['ifc']==FALSE ? $model->saveRecord($tomb) : (int)$_POST['joinID']);
+ $newID=$model->saveRecord($tomb);
+
+ if ((int)$newID>0)
+ {
+ $man=$model->getManufacture($tomb['m_id']);
+
+// objektum file(ok) elhelyezése a végleges helyére
+ $honnan='/home/vendeg/'.$this->data['file'];
+ $hova=$_SERVER['DOCUMENT_ROOT'].'/public/collection/'.$man->dir;
+ if (!is_dir($hova)) mkdir($hova, 0777);
+ $hova.='/'.$newID;
+ if (!is_dir($hova)) mkdir($hova, 0777);
+ $hova.='/'.$this->data['file'];
+ if (is_file($honnan)) copy($honnan,$hova);
+
+ if ($this->data['ifc']==TRUE)
+ {
+ $honnan='/home/vendeg/'.str_replace(".ifc",".oli",$this->data['file']);
+ $hova=$_SERVER['DOCUMENT_ROOT'].'/public/collection/'.$man->dir.'/'.$newID.'/'.str_replace(".ifc",".oli",$this->data['file']);
+ if (is_file($honnan)) copy($honnan,$hova);
+ }
+
+// feltöltött kép elhelyezése a végleges helyére
+ if (is_array($_FILES['fileupload']) && !empty($_FILES['fileupload']) && /*$this->data['ifc']==FALSE &&*/ in_array($_FILES['fileupload']['type'],array('image/jpeg','image/jpg')))
+ {
+ $origSize=getimagesize($_FILES['fileupload']['tmp_name']);
+ $hova=$_SERVER['DOCUMENT_ROOT']."/public/img/collection/".$man->dir;
+ if (!is_dir($hova)) mkdir($hova,0777);
+ $hova.="/".$newID;
+ if (!is_dir($hova)) mkdir($hova,0777);
+ if (!is_dir($hova."/orig")) mkdir($hova."/orig",0777);
+
+ $this->make_thumb($_FILES['fileupload']['tmp_name'], $hova.'/zz_big.jpg', (int)round(($origSize[0]/$origSize[1])*400),400);
+ $this->make_thumb($_FILES['fileupload']['tmp_name'], $hova.'/zz_thumb.jpg', (int)round(($origSize[0]/$origSize[1])*120),120);
+ $this->make_thumb($_FILES['fileupload']['tmp_name'], $hova.'/zz_small.jpg', (int)round(($origSize[0]/$origSize[1])*66),66);
+
+ move_uploaded_file($_FILES['fileupload']['tmp_name'], $hova.'/orig/'.$_FILES['fileupload']['name']);
+ }
+ }
+ }
+ }
+ else { print ("descriptor file nem elérhető"); }
+ }
+
+ $this->parents=$model->getParents();
+ $this->subcat=$model->getSubcat($this->selected_category);
+ $app->getPathway()->addItem(JText::_(COM_SHOWROOM_SHOWROOM), '/index.php?option=com_showroom&view=showroom');
+ $app->getPathway()->addItem(JText::_(COM_SHOWROOM_UPLOAD));
+
+ parent::display($tpl);
+ }
+
+ protected function make_thumb($src, $dest, $desired_width,$desired_h)
+ {
+ $source_image=imagecreatefromjpeg($src);
+ $width=imagesx($source_image);
+ $height=imagesy($source_image);
+ $desired_height=$desired_h;
+ $virtual_image=imagecreatetruecolor($desired_width, $desired_height);
+ imagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $desired_width, $desired_height, $width, $height);
+ imagejpeg($virtual_image, $dest);
+ }
+} // end of class
+?>
\ No newline at end of file
diff --git a/var/www/hosting/cadline.hu/dev/php7_update/sub.archline.hu/components/com_showroom/views/upload/view.html.php.evidence.json b/var/www/hosting/cadline.hu/dev/php7_update/sub.archline.hu/components/com_showroom/views/upload/view.html.php.evidence.json
new file mode 100644
index 0000000..75de1c2
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/php7_update/sub.archline.hu/components/com_showroom/views/upload/view.html.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "6888",
+ "log_excerpt": "[quarantine] dev.cadline.hu:php7_update/sub.archline.hu/components/com_showroom/views/upload/view.html.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/dev/php7_update/sub.archline.hu/components/com_showroom/views/upload/view.html.php)",
+ "original_sha256": "be23b29230dc83d9194c6b3047dec8b7693d8ff582880de84399d41e57a968e7",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1491215591,
+ "size": 10495,
+ "uid": 12425
+ },
+ "rel_path": "php7_update/sub.archline.hu/components/com_showroom/views/upload/view.html.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "dev.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/dev/tcexam/admin/code/tce_functions_upload.php b/var/www/hosting/cadline.hu/dev/tcexam/admin/code/tce_functions_upload.php
new file mode 100644
index 0000000..21c74fa
--- /dev/null
+++ b/var/www/hosting/cadline.hu/dev/tcexam/admin/code/tce_functions_upload.php
@@ -0,0 +1,105 @@
+ quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/dev/tcexam/admin/code/tce_functions_upload.php)",
+ "original_sha256": "526624f3cb1ffec1b482de63aac1ef343a36c7670eac72d45397d47813cfe5fc",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1594883036,
+ "size": 3160,
+ "uid": 12425
+ },
+ "rel_path": "tcexam/admin/code/tce_functions_upload.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "dev.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/www/application/controllers/admin.php b/var/www/hosting/cadline.hu/www/application/controllers/admin.php
new file mode 100755
index 0000000..e8edcf2
--- /dev/null
+++ b/var/www/hosting/cadline.hu/www/application/controllers/admin.php
@@ -0,0 +1,4757 @@
+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'] = '"; 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 "
+
+ }
+ else{
+ if( substr($utvonal,-1) != "/" )
+ $utvonal .= "/";
+
+ if( !is_dir($utvonal) ){
+ print "A megadott mappa nem letezik: ".$utvonal;
+ exit();
+ }
+
+ $utvonalthumbs = $utvonal."thumbs/";
+
+ if( !is_dir($utvonalthumbs) ){
+ mkdir($utvonalthumbs,0644);
+ chmod($utvonalthumbs,0777);
+ }
+
+ $nagykepek = scandir($utvonal);
+ $letrehozva= "";
+
+ include('application/helpers/myimg_helper.php');
+ foreach( $nagykepek as $nagy ){
+ $nagykep = $utvonal.$nagy;
+ // ha letezik a thumb kep akkor ne irja felul
+ if( $nagy!="." && $nagy!=".." && !is_dir($nagykep) && !file_exists($utvonalthumbs.$nagy) ){
+ $ujkiskep = $utvonalthumbs.$nagy;
+ kemeretezesvagassh($nagykep,$ujkiskep,68,68);
+ chmod($ujkiskep,0777);
+ $letrehozva .= $ujkiskep."
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 ){
+ ?>
+
";
+ print "
ok: ".$ujkiskep;
+ }
+ }
+ print "Letrehozva: ".$letrehozva;
+ exit();
+ }
+ }
+
+ function creategallerylink(){
+ $utvonal = $this->input->post('utvonal');
+
+
+ if( !$utvonal ){
+ ?>
+
+
+ }
+ else{
+ if( substr($utvonal,-1) != "/" )
+ $utvonal .= "/";
+
+ if( !is_dir($utvonal) ){
+ print "A megadott mappa nem letezik: ".$utvonal;
+ exit();
+ }
+
+ print $utvonal." : ".base64_encode($utvonal);
+ exit();
+ }
+ }
+
+ function workshop(){
+ $this->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('";
+ // 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 "
";
+ }
+
+
+ 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/cadline.hu/www/application/controllers/admin.php.evidence.json b/var/www/hosting/cadline.hu/www/application/controllers/admin.php.evidence.json
new file mode 100644
index 0000000..73723e2
--- /dev/null
+++ b/var/www/hosting/cadline.hu/www/application/controllers/admin.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "5450",
+ "log_excerpt": "[quarantine] www.cadline.hu:application/controllers/admin.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/www/application/controllers/admin.php)",
+ "original_sha256": "dc2640ce42b3227552feacd9dc8b9d0ae32c0f0343d66c75c9ddad0ba3b6af38",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1402653565,
+ "size": 150915,
+ "uid": 11669
+ },
+ "rel_path": "application/controllers/admin.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "www.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/www/application/controllers/collection.php b/var/www/hosting/cadline.hu/www/application/controllers/collection.php
new file mode 100755
index 0000000..71e0155
--- /dev/null
+++ b/var/www/hosting/cadline.hu/www/application/controllers/collection.php
@@ -0,0 +1,1375 @@
+'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(){
+ // 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'] = " ";
+ }
+ print "".$v->nev.": ".$v->db." db elem
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/cadline.hu/www/application/controllers/collection.php.evidence.json b/var/www/hosting/cadline.hu/www/application/controllers/collection.php.evidence.json
new file mode 100644
index 0000000..16d4b8e
--- /dev/null
+++ b/var/www/hosting/cadline.hu/www/application/controllers/collection.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "5443",
+ "log_excerpt": "[quarantine] www.cadline.hu:application/controllers/collection.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/www/application/controllers/collection.php)",
+ "original_sha256": "a592d4c5753ffc7aa532296c9a64057714541e62efed7eca8e368d52343d1606",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1396359077,
+ "size": 42192,
+ "uid": 11669
+ },
+ "rel_path": "application/controllers/collection.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "www.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/www/application/controllers/forum.php b/var/www/hosting/cadline.hu/www/application/controllers/forum.php
new file mode 100755
index 0000000..5a5a7e5
--- /dev/null
+++ b/var/www/hosting/cadline.hu/www/application/controllers/forum.php
@@ -0,0 +1,2702 @@
+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]="/";
+ $mit[2]="/\n/";
+ $mit[3]="/'/";
+ $mit[4]="/=/";
+ $mit[5]="/\"/";
+ $mit[6]="/;/";
+ $mire[0]=">";
+ $mire[1]="<";
+ $mire[2]="
";
+ $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, '
")
+ $error .= "Üres hozzászólás!
";
+
+
+ if ($_FILES["fkep"]["error"]==0 && ($error == "") ){
+ $login = $tomb['name'];
+ $user_id = $this->mforum->get_userid($login);
+ //ha nincs mappája
+ if(hun())
+ $hova = $this->kepek_utvonal.$user_id;
+ elseif(eng())
+ $hova = $this->kepek_utvonal_eng.$user_id;
+
+ if(!is_dir($hova)){
+ //akkor hozza létre
+ mkdir($hova,0644);
+ chmod($hova,0777);
+ }
+ $feltolt_konyvtar = $hova."/";
+ //ha több fájl lenne ugyanazon a néven
+ $rand = rand(100,999);
+ $basefilename = $rand . "__" .$this->ekezet($_FILES["fkep"]["name"]);
+ $feltolt_fajlnev=$feltolt_konyvtar . $basefilename;
+
+ $error = "";
+ $mi = $_FILES['fkep']['name']."$";
+
+ $mire = "\.bmp|\.jpg|\.jpeg|\.png|\.gif|\.tif|\.BMP|\.JPG|\.PNG|\.GIF";
+ if( !(ereg( $mire , $mi )) ){
+ $error .= "Hibás fájl kiterjesztés, elfogadott kiterjesztések: .bmp, .jpg, .png, .gif
";
+ }
+ if( $_FILES['fkep']['size'] > 1024 * 1024 * 10 ){
+ $error .= "A kép mérete nagyobb 10 MB-nál.
";
+ }
+ else if( $hszszoveg != "" && !$error){
+ if (copy($_FILES["fkep"]["tmp_name"], $feltolt_fajlnev)){
+ $kep = $rand . "__". $this->ekezet($_FILES["fkep"]["name"]);
+ $mit = $hova."/".$kep;
+ chmod($mit,0777);
+
+ // elonezeti kep elkeszitese 200x150-ben
+ // include('application/helpers/myimg_helper.php');
+ // @kepmeretezesvagasmax($feltolt_fajlnev,$hova,"elo_".$basefilename,300,300);
+ }else{
+ $kep = "NULL";
+ }
+ }
+ }
+
+ if(!$error){
+ $this->mforum->hszbeszur($hszszoveg,$tema_id,$valasz,$kep);
+
+
+ // ertesitesek kikuldese
+ $this->load->library('email');
+ $this->email->initialize();
+
+ $mail_data['tema'] = $this->mforum->get_cim($tema_id)->cim;
+ $mail_data['user'] = $tomb['name'];
+ $mail_data['hsz'] = $hszszoveg;
+
+ $this->email->message($this->load->view('mail/forum_ujhsz', $mail_data, true));
+ $this->email->from('info@cadline.hu', 'Cadline Weboldal');
+ $this->email->subject('ARCHLine.XP Fórum - Új hozzászólás');
+
+ $kiknek = $this->mforum->ertesites($tema_id);
+ foreach($kiknek as $kinek){
+ $alap = $this->mforum->default_mail($kinek->email);
+ if(!$alap)
+ $alap = $kinek->email;
+
+ if($alap)
+ $this->email->send($alap, 'smtp');
+ }
+ // end ertesitesek kikuldese
+
+
+ $temaid = $this->phpsession->get('tema_id');
+ header("Location: listaz/$temaid");
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='forum/ujhsz';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+ $data['error']=$error;
+ $data['hsz']=$this->input->post('hsz');
+
+ $this->load->view('site_forum',$data);
+ }
+ }else if( $this->phpsession->get('temaid') ){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='forum/ujhsz';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('../editor/fckeditor');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ $this->index();
+ }
+ }
+
+ function valasz(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->uri->segment(3) ){
+ $this->phpsession->save('valasz',$this->uri->segment(3));
+ $id = $this->uri->segment(3);
+ $temaid = $this->mforum->get_temaidByHszid($id);
+ $this->phpsession->save('temaid',$temaid);
+ }
+ if( $tomb ){
+ if( $this->phpsession->get('temaid') ){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új hozzászólás' : $data['title'] = 'ARCHLine.XP Forum new post';
+ $data['tartalom']='forum/ujhsz';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('../editor/fckeditor');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ $this->index();
+ }
+ }
+
+ function listaz(){
+ $this->phpsession->save('valasz',false);
+ if( !($this->phpsession->get('oldal')) ) $this->phpsession->save('oldal',0);
+ if( $this->uri->segment(3) == 'kov' ) $this->kovetkezo();
+ if( $this->uri->segment(3) == 'elozo' ) $this->elozo();
+
+ if( is_numeric($this->uri->segment(3)) ){
+ $tema_id = $this->uri->segment(3);
+ $this->phpsession->save('temaid',$tema_id);
+// redirect('forum/listaz');
+ }else if($this->phpsession->get('temaid')){
+ $tema_id = $this->phpsession->get('temaid');
+ }else{
+ $tema_id = 0;
+ }
+
+ if(!($tema_id) || !is_numeric($tema_id) || !$this->mforum->is_temaid($tema_id)){
+ redirect('forum');
+ }else{
+ $data['tartalom']='forum/temamutat';
+ $data['csik']=array('home','forum');
+
+
+ if( in_array($tema_id,$this->noindextemak) )
+ $data["noindex"] = true;
+
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ if( !is_numeric($this->uri->segment(4)) )
+ $oldal = $this->phpsession->get('oldal');
+ else{
+ $oldal = $this->uri->segment(4);
+ $this->phpsession->save('oldal',$oldal);
+ }
+ $hszek = $this->mforum->get_lista($tema_id,$oldal);
+ foreach( $hszek as $hsz){
+ if( !($hsz->valasz == "0" || $hsz->valasz == "NULL") ){
+ $vszid = $hsz->valasz;
+ $elozo = $this->mforum->get_hsz($vszid);
+ if( $elozo->user == "" )
+ $elozo = $this->mforum->get_hsz2($vszid);
+ if( isset($elozo->user) && $elozo->user != "0" && $elozo->user != "" ){
+ $hsz->valasz = $elozo->user . ", (" . $elozo->datum . ")";
+ if( $elozo->user == 586 )
+ $hsz->valasz = "Németh Kálmán, (" . $elozo->datum . ")";
+ elseif( $elozo->user == 270 )
+ $hsz->valasz = "Tóth M.Levente, Mészáros Marcel, (" . $elozo->datum . ")";
+ }
+ elseif( $elozo )
+ $hsz->valasz = "[Törölt felhasználó], (" . $elozo->datum . ")";
+ else
+ $hsz->valasz = "-";
+ }
+ //if(!eng()) $hsz->szoveg = $this->csere2($hsz->szoveg);
+ if( strtotime($hsz->datum) < 1282039000) $hsz->szoveg = $this->csere2($hsz->szoveg);
+
+ if( $hsz->user_id == 586 ){
+ $hsz->user = "Németh Kálmán";
+ }elseif( $hsz->user_id == 270 ){
+ $hsz->user = "Tóth M.Levente, Mészáros Marcel";
+ }
+ }
+
+ if( !$hszek ){
+ $data['infok'] = array("2");
+ }else{
+ if( $this->mforum->vanmegoldal($tema_id,$this->phpsession->get('oldal')))
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('oldal') > 0 )
+ $data['elozo'] = true;
+ }
+
+ $data['hszek_json'] = json_encode($hszek);
+
+ $user = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($user['name']) )
+ $data['szerk']=true;
+ $data['temacim'] = $this->mforum->get_cim($tema_id)->cim;
+ $temakor_id = $this->mforum->get_tema1($tema_id)->temakor_id;
+ $data['temakorcim'] = $this->mforum->get_temakor1($temakor_id)->cim;
+ $data['temakorid'] = $temakor_id;
+ $data['tema_id'] = $tema_id;
+ $data['oldalak_szama'] = (int)$this->mforum->get_temaoldal($tema_id);
+ $data['akt_oldal'] = $oldal;
+
+ $data['hozzaszolasok'] = $hszek;
+
+ $data['meta']['keyw'] = $data['temacim'].', ';
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['title'] .= ' - ' . $data['temacim'];
+ $data['meta']['desc'] = hun() ? "ARCHLine.XP fórum, ".$data['temakorcim']." > ".$data['temacim']." téma hozzászólásai, ".($oldal+1).". oldal" : "ARCHLine.XP forum, posts of ".$data['temacim']." topic, ".($oldal+1).". page";
+
+ $data['aktmenu'] = "1";
+ $data['style'] = array('jquery.ui','fancybox2');
+ $data['javascript'] = array('../editor/fckeditor','jquery_ui'/*,'fancybox/jquery-1.3.2.min','fancybox/jquery.easing.1.3'*/,'fancybox/jquery.fancybox-1.2.1.pack','fancybox/fancy');
+ $this->load->view('site_forum',$data);
+ }
+
+ }
+
+ function kovetkezo(){
+ $oldalszam = $this->phpsession->get('oldal');
+ if( $this->mforum->vanmegoldal($this->phpsession->get('temaid'),$oldalszam)){
+ $oldalszam++;
+ }
+ $this->phpsession->save('oldal',$oldalszam);
+ }
+
+ function elozo(){
+ $oldalszam = $this->phpsession->get('oldal');
+ if( $oldalszam > 0 )
+ $oldalszam--;
+ $this->phpsession->save('oldal',$oldalszam);
+ }
+
+ 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 login(){
+ $name = $this->input->post('name');
+ $passwd = $this->input->post('passwd');
+
+ $name = mysql_escape_string($name);//$this->csere($name);
+
+ if(!$passwd || !$name)
+ {
+ $this->belephiba(9);
+ }
+ else
+ {
+ $name2 = $this->ekezet($name);
+ $vanaktiv = $this->mforum->vanaktivprog($name);
+
+ if( ($this->mforum->belep($name,$passwd) || $this->mforum->belep($name2,$passwd))
+ && $vanaktiv )
+ {
+ $uid = $this->mforum->get_userid($name);
+ if( !$uid || !is_numeric($uid) ){
+ $this->belephiba(6);
+ }else{
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$name;
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+ $fuser['rang'] = $this->mforum->get_rang($uid);
+ $rang = $fuser['rang'];
+ }
+
+
+
+
+ // ha csak feltolto
+ if( $rang != "user" && $rang != "moderator" ){
+ $fuser['user_id'] = $uid;
+
+ // webrenderbe is beléptetni
+ $sessid=md5($name.time());
+ $hash=md5($name . $this->pw . $sessid);
+ setcookie("sessid",$sessid,time()+$this->ervenydesseg,"/");
+ setcookie("azonosito", $name, time()+$this->ervenydesseg,"/");
+ setcookie("hash",$hash,time()+$this->ervenydesseg,"/");
+
+ $this->phpsession->save('feltolto',$fuser);
+ $this->belephiba(8);
+ }
+ //ha még nem fogadta el a szabályzatot:
+ elseif( !($this->mforum->szabalyzat($uid) ) ){
+ if(hun())
+ $lap = $this->mpages->get_row(454);
+ else
+ $lap = $this->mpages->get_row(559);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum szabályzat' : $data['title'] = 'ARCHLine.XP Forum Rules';
+ $data['tartalom'] = '/forum/szabalyzat';
+ $data['lap'] = $lap;
+ //$user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($name))
+ $data['moderator']=true;
+
+ //ha még nem fogadta el a szabályzatot:
+ if( !($this->mforum->szabalyzat($uid) ) ){
+ $data['uid'] = $uid;
+ $data['login'] = $name2;
+ $data['pw'] = md5($passwd);
+ $data['nemelfogad'] = true;
+ $data['infok'] = array("0");
+ }
+
+ $this->load->view('site_forum',$data);
+ }
+ else{
+ $fuser['user_id'] = $uid;
+ $this->phpsession->save('fuser',$fuser);
+
+
+ // webrenderbe is beléptetni
+ $sessid=md5($name.time());
+ $hash=md5($name . $this->pw . $sessid);
+ setcookie("sessid",$sessid,time()+$this->ervenydesseg,"/");
+ setcookie("azonosito", $name, time()+$this->ervenydesseg,"/");
+ setcookie("hash",$hash,time()+$this->ervenydesseg,"/");
+
+ redirect('forum');
+ }
+ }else{
+ if( $name == "moderator" ){
+ $szam = date(W);
+ $this->mforum->jelszovaltmod($szam);
+ if( $this->mforum->belep($name,$passwd) ){
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$name;
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+ $uid = $this->mforum->get_userid($name);
+ $fuser['user_id'] = $uid;
+ $this->phpsession->save('fuser',$fuser);
+ redirect('forum');
+ }
+ }
+
+ if( !$vanaktiv )
+ $this->belephiba(7);
+ else{
+ $this->belephiba(6);
+ }
+ }
+ }
+ }
+
+ function belephiba($szoveg){
+ $data['tartalom']='forum/temakorok';
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['csik']=array('home','forum');
+
+ if( !is_numeric($szoveg) ){
+ $data['error'] = $szoveg;
+ }
+ else{
+ $data['error'] = array($szoveg);
+ }
+
+ $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;
+ $tema->rov_cim = $tema->cim;
+
+ /*if(strlen($tema->cim) > 26){
+ $ut26 = array($cim[26]);
+ $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")
+ $tema->utolsouser = $this->mforum->get_userUid($xx->user)->nev;
+ 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'] = 1;
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function logout(){
+ unset($_SESSION['default']['fuser']);
+ unset($_SESSION['default']['feltolto']);
+ redirect('forum');
+ }
+
+ function szerkeszt(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->uri->segment(3) != "")
+ $hszid = $this->uri->segment(3);
+ else
+ //$hszid = $this->phpsession->get('hszid');
+ $hszid = $this->input->post('hszid');
+
+ if( $this->mforum->moderator($tomb['name']) || $this->mforum->get_sajathsz($tomb['user_id'], $hszid) ){
+ if($this->input->post('szerk')!=false){
+ //$hszid = $this->phpsession->get('hszid');
+ $hszid = $this->input->post('hszid');
+ $this->mforum->hszszerk($this->input->post('hsz'),$hszid);
+ $user_id = $this->mforum->get_hsz($hszid)->user_id;
+
+ if( $this->input->post('kepki')=='on' ){
+ if(hun())
+ $kep = $this->kepek_utvonal . $user_id ."/". $this->mforum->get_Kep($hszid)->kep;
+ elseif(eng())
+ $kep = $this->kepek_utvonal_eng . $user_id ."/". $this->mforum->get_Kep($hszid)->kep;
+
+ chmod($kep, 777);
+ unlink($kep);
+ $this->mforum->kepki($hszid);
+ }
+
+ $temaid = $this->phpsession->get('tema_id');
+ header("Location: listaz/$temaid");
+ }else if( $this->uri->segment(3) != "" ){
+ $this->phpsession->save('hszid',$this->uri->segment(3));
+
+ $data['szoveg']=$this->mforum->get_Text($this->phpsession->get('hszid'))->szoveg;
+ $kep = $this->mforum->get_Kep($this->phpsession->get('hszid'))->kep;
+ if( $kep != "" && $kep != "NULL" ){
+ $user_id = $this->mforum->get_hsz($this->phpsession->get('hszid'))->user_id;
+ if(hun())
+ $data['kep'] = "/".$this->kepek_utvonal. $user_id . "/".$kep;
+ elseif(eng())
+ $data['kep'] = "/".$this->kepek_utvonal_eng. $user_id . "/".$kep;
+ }
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['javascript'] = array('../editor/fckeditor');
+ $data['tartalom']='forum/szerkeszt';
+ $data['csik']=array('home','forum');
+
+ $this->load->view('site_forum',$data);
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function torles(){
+ $tomb = $this->phpsession->get('fuser');
+ $hszid = $this->uri->segment(3);
+ if( $this->mforum->moderator($tomb['name']) || $this->mforum->get_sajathsz($tomb['user_id'], $hszid) ){
+ if( $this->uri->segment(3) != "" ){
+ $hszid = $this->uri->segment(3);
+ $uid = $this->mforum->torol($hszid);
+
+ //ha nincs kep a mappajaban:
+ if(hun())
+ $mappa = $this->kepek_utvonal . $uid;
+ elseif(eng())
+ $mappa = $this->kepek_utvonal_eng . $uid;
+
+ $handle = opendir($mappa);
+ //ha nincs fajl a konyvtarban, akkor toroljuk a mappat
+ chmod($mappa,0777);
+ $fajl = readdir($handle);
+ $fajl = readdir($handle);
+ $fajl = readdir($handle);
+ if(!($fajl)){
+ //closedir($mappa);
+ rmdir($mappa);
+ }
+
+ $tema_id = $this->phpsession->get('temaid');
+ if( is_int($this->mforum->get_temaoldal($tema_id)) && ($this->phpsession->get('oldal') == $this->mforum->get_temaoldal($tema_id)) ){
+ $this->elozo();
+ }
+ redirect('forum/listaz');
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tatnevez(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" && ($this->input->post('atnevez')==false) ){
+ $tid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='forum/temaatnevez';
+ $data['csik']=array('home','forum');
+ $data['tema_id'] = $tid;
+ $data['temacim'] = $this->mforum->get_cim($tid)->cim;
+ $data['moderator'] = true;
+
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('atnevez')!=false){
+ $this->mforum->tatnevez($this->input->post('tid'),$this->input->post('ujnev'));
+
+ header("Location: index");
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tkatnevez(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" && ($this->input->post('atnevez')==false) ){
+ $tid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='forum/tkatnevez';
+ $data['csik']=array('home','forum');
+ $data['tema_id'] = $tid;
+ $data['temacim'] = $this->mforum->get_tkcim($tid)->cim;
+ $data['moderator'] = true;
+
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('atnevez')!=false){
+ $this->mforum->tkatnevez($this->input->post('tid'),$this->input->post('ujnev'));
+
+ header("Location: index");
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function tematorol(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $tomb && $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" ){
+ $tid = $this->uri->segment(3);
+ $this->mforum->tematorol($tid);
+
+ redirect('forum');
+ }else{
+ redirect('forum');
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function temakortorol(){
+ $tomb = $this->phpsession->get('fuser');
+ if( $tomb && $this->mforum->moderator($tomb['name']) ){
+ if( $this->uri->segment(3) != "" ){
+ $tid = $this->uri->segment(3);
+ $this->mforum->temakortorol($tid);
+
+ redirect('forum');
+ }else{
+ redirect('forum');
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function mypost(){
+ $this->phpsession->save('valasz',false);
+
+ $data['tartalom']='forum/mypost';
+ $data['csik']=array('home','forum');
+ $data['javascript'] = array('forum');
+ $data['style'] = array('forum_2011');
+ $user = $this->phpsession->get('fuser');
+
+ if(!$user)
+ redirect('forum');
+
+ $hszek = $this->mforum->get_mypost($user['user_id']);
+ foreach( $hszek as $hsz){
+ $elo = $hsz->valasz;
+ $hsz->valasz = $this->mforum->get_valaszok($hsz->hsz_id);
+ $hsz->valaszdb = count($hsz->valasz);
+ $hsz->elozo = $this->mforum->get_hsz($elo);
+ $tema = $this->mforum->get_tema1($hsz->tema_id);
+ $hsz->tema = $this->mforum->get_tema1($hsz->tema_id);
+ $temakor = $this->mforum->get_temakor1($tema->temakor_id);
+ $hsz->temakor = $temakor->cim;
+
+ //print_r($hsz->elozo);
+ }
+
+ $data['hozzaszolasok'] = $hszek;
+ $data['hszdb'] = count($hszek);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+
+ $this->load->view('site_forum',$data);
+ }
+
+
+ function myuser(){
+ $user = $this->phpsession->get('fuser');
+
+ if(!$user)
+ $user = $this->phpsession->get('feltolto');
+
+ if($user){
+ /*$tomb = $this->phpsession->get('fuser');*/
+ $login = $user['name'];
+ $this->user($login);
+ }else
+ redirect('forum');
+ }
+
+ function user($login){
+ if(!$login)
+ redirect('forum');
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum' : $data['title'] = 'ARCHLine.XP Forum';
+ $data['tartalom']='forum/user';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['user']=$login;
+ $data['adatok'] = $this->mforum->get_user($login);
+ $szemadatok = $this->mforum->get_user_szem($login);
+ $emailek = $szemadatok[0]->email;
+ $emailek = explode(";",$emailek);
+ $szemadatok[0]->email = "";
+ foreach( $emailek as $email ){
+ $szemadatok[0]->email .= $email . "
";
+ }
+ $van = $szemadatok[0]->nev;
+ if($van)
+ $data['szemadatok'] = $szemadatok;
+ else
+ $data['szemadatok'] = $this->mforum->get_user_alap($login);
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+
+ $kulcsok[$key_kulcs]->programok = $programs;
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }
+
+ function users(){
+ $user = $this->phpsession->get('fuser');
+
+ if( $user && $this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+ $this->phpsession->save('belep',"");
+
+ if( !($this->phpsession->get('uoldal')) ){
+ $this->phpsession->save('uoldal',0);
+ $oldal = 0;
+ }else{
+ $oldal = $this->phpsession->get('uoldal');
+ }
+
+ if( $this->uri->segment(3) == "kov" ){
+ $oldal++;
+ $this->phpsession->save('uoldal',$oldal);
+ }else if( $this->uri->segment(3) == "elozo" && $oldal > 0 ){
+ $oldal--;
+ $this->phpsession->save('uoldal',$oldal);
+ }
+ else if( is_numeric($this->uri->segment(3))){
+ $oldal = $this->uri->segment(3);
+ $this->phpsession->save('uoldal',$oldal);
+ }
+
+ if( $this->uri->segment(3) == "rendez" ){
+ $ord = $this->uri->segment(4);
+
+
+ $vissza = $this->phpsession->get('rendezvissza');
+ if($this->phpsession->get('rendez') == $ord){
+ $vissza = !$vissza;
+ }
+ $this->phpsession->save('rendezvissza',$vissza);
+
+
+ $this->phpsession->save('rendez',$ord);
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ }else if( $this->phpsession->get('rendez') ){
+ $ord = $this->phpsession->get('rendez');
+ $vissza = $this->phpsession->get('rendezvissza');
+ }else{
+ $ord = "nev";
+ $vissza = false;
+ }
+
+ $data['users']=$this->mforum->get_users($oldal,$ord,$vissza);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ukeres(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+ if( !($this->phpsession->get('ukoldal')) ){
+ $this->phpsession->save('ukoldal',0);
+ $oldal = 0;
+ }else{
+ $oldal = $this->phpsession->get('ukoldal');
+ }
+
+ if( is_numeric($this->uri->segment(3))){
+ $oldal = $this->uri->segment(3);
+ $this->phpsession->save('ukoldal',$oldal);
+ }
+
+ if( $this->uri->segment(3) == "rendez" ){
+ $ord = $this->uri->segment(4);
+
+ $vissza = $this->phpsession->get('rendezvissza');
+ if($this->phpsession->get('rendez') == $ord){
+ $vissza = !$vissza;
+ }
+ $this->phpsession->save('rendezvissza',$vissza);
+
+ $this->phpsession->save('rendez',$ord);
+ $oldal = 0;
+ $this->phpsession->save('ukoldal',0);
+ }else if( $this->phpsession->get('rendez') ){
+ $ord = $this->phpsession->get('rendez');
+ $vissza = $this->phpsession->get('rendezvissza');
+ }else{
+ $ord = "nev";
+ $vissza = false;
+ }
+
+ if( $this->input->post('klogin') || $this->input->post('knev') || $this->input->post('kemail') || $this->input->post('kulcssz') || ($this->input->post('belep') != -1 && $this->input->post('belep') != "" ) ){
+ $oldal = 0;
+ $this->phpsession->save('ukoldal',$oldal);
+ $klog = $this->input->post('klogin');
+ $this->phpsession->save('klogin',$this->input->post('klogin'));
+ $knev = $this->input->post('knev');
+ $this->phpsession->save('knev',$knev);
+ $kmail = $this->input->post('kemail');
+ $this->phpsession->save('kemail',$this->input->post('kemail'));
+ $kulcs = $this->input->post('kulcssz');
+ $this->phpsession->save('kulcssz',$this->input->post('kulcssz'));
+ $belep = $this->input->post('belep');
+ $this->phpsession->save('belep',$this->input->post('belep'));
+ }else{
+ $klog = $this->phpsession->get('klogin');
+ $knev = $this->phpsession->get('knev');
+ $kmail = $this->phpsession->get('kemail');
+ $kulcs = $this->phpsession->get('kulcssz');
+ $belep = $this->phpsession->get('belep');
+ }
+
+ if(UJUGYFELKEZELO===true)
+ $users = $this->mforum->get_kusersujcrm($oldal,$klog,$knev,$kmail,$belep,$kulcs,$ord,$vissza);
+ else
+ $users = $this->mforum->get_kusers($oldal,$klog,$knev,$kmail,$belep,$kulcs,$ord,$vissza);
+ $data['users'] = $users;
+
+ if(UJUGYFELKEZELO===true){
+ if( $this->mforum->vanmegkuserujcrm($this->phpsession->get('ukoldal'),$klog,$knev,$kmail,$belep,$kulcs) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('ukoldal') > 0 )
+ $data['elozo'] = true;
+ }
+ else{
+ if( $this->mforum->vanmegkuser($this->phpsession->get('ukoldal'),$klog,$knev,$kmail,$belep,$kulcs) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('ukoldal') > 0 )
+ $data['elozo'] = true;
+ }
+
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_kusersdb($klog,$knev,$kmail,$belep,$kulcs);
+ $data['akt_oldal'] = $oldal;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function edit_user(){
+ $user = $this->phpsession->get('fuser');
+ if($user && $this->mforum->moderator($user['name'])){
+ if( $this->uri->segment(3) != "" && ($this->input->post('edituser')==false) ){
+ $uid = $this->uri->segment(3);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználó szerkesztése' : $data['title'] = 'ARCHLine.XP Forum Edit User';
+ $data['tartalom']='forum/edit_user';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+ $login = $this->mforum->get_login($uid);
+ $data['adatok'] = $this->mforum->get_user($login);
+
+ $szemadatok = $this->mforum->get_user_szem($login);
+
+ if($szemadatok[0])
+ $data['szemadat'] = $szemadatok[0];
+ else{
+ $cucc = $this->mforum->get_user_alap($login);
+ $data['szemadat'] = $cucc[0];
+ }
+
+ //$data['kulcsok'] = $this->mforum->get_user_kulcsok($login);
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+
+ $i=0;
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $i++;
+
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+
+ $kulcsok[$key_kulcs]->programok = $programs;
+
+
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }else if($this->input->post('edituser')!=false){
+
+ $error = "";
+ $langerror = array();
+ if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') != $this->input->post('jelszo2') ){
+ $error .= "A megadott két jelszó nem egyezik.
";
+ array_push($langerror,0);
+ }else if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') == $this->input->post('jelszo2') && strlen($this->input->post('jelszo1') ) < 5 ){
+ $error .= "A megadott jelszó 5 karakternél rövidebb.
";
+ array_push($langerror,1);
+ }
+
+ $user = $tomb['name'];
+ //$myid = $this->mforum->get_userid($user);
+
+ if( $this->input->post('login') == "" ){
+ $error .= "A login mező értéke nem lehet üres.
";
+ array_push($langerror,4);
+ }
+
+ if( $this->input->post('login') != "" && !$this->mforum->szabadlogin($this->input->post('login'),$this->input->post('uid')) ){
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+ array_push($langerror,2);
+ }
+ elseif( strlen($this->input->post('login') ) < 5 ){
+ $error .= "A megadott login 5 karakternél rövidebb.
";
+ array_push($langerror,3);
+ }
+
+ if( $this->input->post('login') != $this->ekezet($this->input->post('login')) ){
+ $error .= "A felhasználó névben nem szerepelhet ékezet vagy szóköz!
";
+ array_push($langerror,5);
+ }
+
+
+ $uid = $this->input->post('uid');
+
+ if( !$error ){
+ // frissítés
+ $mod['nev'] = $this->input->post('nev');
+ $mod['login'] = $this->input->post('login');
+ $mod['rang'] = $this->input->post('rang');
+ if($this->input->post('jelszo1') != "")
+ $mod['jelszo'] = md5($this->input->post('jelszo1'));
+ $mod['viewsub'] = ($this->input->post('viewsub') == "on") ? 1 : 0;
+
+ $this->db->update('forum_user',$mod,"user_id={$uid}");
+ //$this->mforum->set_user($this->input->post('uid'),$this->input->post('nev'),$this->input->post('email'),$this->input->post('jelszo1'),$this->input->post('login'),$this->input->post('rang'));
+
+ redirect("forum/users");
+ }else{
+
+
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználó szerkesztése' : $data['title'] = 'ARCHLine.XP Forum Edit User';
+ $data['tartalom']='forum/edit_user';
+ $data['csik']=array('home','forum');
+ $data['moderator'] = true;
+
+
+ $login = $this->mforum->get_login($uid);
+ $data['adatok'] = $this->mforum->get_user($login);
+
+ $szemadatok = $this->mforum->get_user_szem($login);
+
+ if($szemadatok[0])
+ $data['szemadat'] = $szemadatok[0];
+ else{
+ $cucc = $this->mforum->get_user_alap($login);
+ $data['szemadat'] = $cucc[0];
+ }
+
+ $kulcsok = $this->mforum->get_user_kulcsok($login);
+
+
+ $i=0;
+ foreach($kulcsok as $key_kulcs => $kulcs){
+ $i++;
+ $programs = $this->mforum->getProgramsByHlNum($kulcs->kulcs_kod);
+ foreach($programs as $key_program => $program){
+ $modulok = $this->mforum->getModulesByPrID($program->prID);
+ $programs[$key_program]->modulok = $modulok;
+ }
+ $kulcsok[$key_kulcs]->programok = $programs;
+ }
+
+ $data['kulcsok'] = $kulcsok;
+
+ $data['error'] = $error;
+ $data['hibak2'] = $langerror;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+
+ print " ";
+ }
+
+ $ezt = "edit_user/".$uid;
+ header("Location: ".$ezt);
+ }else{
+ $this->index();
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujuser(){
+ $user = $this->phpsession->get('fuser');
+ if($user && $this->mforum->moderator($user['name'])){
+ if($this->input->post('do')!=false){
+ $login = $this->input->post('login');
+ $nev = $this->input->post('nev');
+ $jsz1 = $this->input->post('jelszo1');
+ $jsz2 = $this->input->post('jelszo2');
+ $email = $this->input->post('email');
+ $kulcs = $this->input->post('kulcs');
+ $rang = $this->input->post('rang');
+
+ if($kulcs)
+ $nUserID = $this->mforum->get_nUserID($kulcs);
+ else
+ $nUserID = "NULL";
+
+ $error = "";
+ $langerror = array();
+
+ if( $login == "" )
+ $error .= "Nincs login megadva.
";
+
+ if( $login != $this->ekezet($login) )
+ $error .= "A felhasználó névben nem lehet ékezet vagy szóköz.
";
+ elseif( !$this->mforum->szabadlogin($login,10000) )
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+
+ if( $jsz1 == "" || $jsz2 == "" || $jsz1 != $jsz2 )
+ $error .= "A két jelszó nem egyezik vagy nincsenek megadva.
";
+
+ if( $this->mforum->is_email($email) )
+ $error .= "A megadott e-mail-cím már szerepel az adatbázisban.
";
+
+ if(!$error){
+ $this->mforum->ujuser($login,$nev,$jsz1,$email,$nUserID,$rang);
+
+ redirect('forum/users');
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új felhasználó' : $data['title'] = 'ARCHLine.XP Forum new user';
+ $data['tartalom']='forum/ujuser';
+ $data['csik']=array('home','forum');
+ $data['error2'] = $error;
+ $data['moderator']=true;
+ $data['javascript']=array('forum');
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }
+
+ }else{
+ $data['title'] = 'ARCHLine.XP Fórum új felhasználó';
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Új Felhasználó' : $data['title'] = 'ARCHLine.XP Forum New User';
+ $data['tartalom']='forum/ujuser';
+ $data['csik']=array('home','forum');
+ $data['javascript']=array('forum');
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "4";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function del_user(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ $id = $this->uri->segment(3);
+ $this->mforum->del_user($this->uri->segment(3));
+ redirect("forum/users");
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujuserdb(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+
+
+
+
+ $this->access_id = 36;
+
+ $this->load->model('mpartners');
+ $this->keydb = $this->load->database('clusers',true);
+ $search = false;//$this->input->post('search');
+
+ $from = 0;
+ $to = 999999;
+ $limit = 2000;
+
+ $this->keydb->query("SET NAMES utf8");
+ $result = $this->keydb->from('cl_fo_hardlock')->join('cl_users','cl_fo_hardlock.hlUser=cl_users.nUserID','left')->orderby('hlNum','desc')->where("hlCtrID ='".$this->access_id."'")->where('hlStat',1)->where("hlNum >= '".$from."' AND hlNum <= '".$to."'")->limit(99999)->get();
+
+ //$sorok = $result->result();
+
+
+
+
+
+ $query = $this->keydb->from('cl_fo_hardlock')->join('cl_users','cl_fo_hardlock.hlUser=cl_users.nUserID','left')->join('cl_users_emails','cl_users.nUserID=cl_users_emails.nUserID','left')->orderby('hlNum','desc')->where("hlCtrID ='".$this->access_id."'")->where('hlStat',1)->where('default',1)->where("hlNum >= '".$from."' AND hlNum <= '".$to."'")->limit(99999)->get();
+ $sorok = $query->result();
+
+
+ //$this->keydb->query("SET NAMES latin2");
+
+
+
+
+ if($result->num_rows()==0)
+ {
+ $data['sorok'] = false;
+ }
+ else
+ {
+ $data['sorok'] = $sorok;
+ $data['found'] = $result->num_rows();
+ }
+
+ $sorok2 = $sorok;
+ $i = 0;
+ $j = 0;
+ $db = 0;
+ foreach($sorok2 as $sor){
+ $mailek = $sor->email;
+ $mailek = explode(";",$mailek);
+
+ foreach( $mailek as $mail ){
+ $mail = trim($mail);
+
+ //megnezzuk hogy benne van-e az adatbázisban és aktív-e
+ if( $mail != "" && $sor->hlStat == 1 && !$this->mforum->is_email(strtolower($mail)) ){
+ $mailresz = explode('@',$mail);
+ $login = $mail;
+ $nev = $sor->strName;
+ $nev = trim($nev);
+ $jsz1 = $mailresz[0];
+ $nUserID = $sor->nUserID;
+ $rang = "user";
+
+ // eladási dátum 0000-00-00 -e
+ $datum = $this->keydb->from('cl_fo_programs')->where("prHlNum",$sor->hlNum)->select('prSellDate')->get()->row();
+ if($datum->prSellDate != '0000-00-00'){
+ $this->mforum->ujuser($login,$nev,$jsz1,strtolower($mail),$nUserID,$rang);
+ $db++;
+ $kik[$j]->Nev = $nev;
+ $kik[$j]->Login = $login;
+ $kik[$j]->Email = $mail;
+ $kik[$j]->Datum = $datum->prSellDate;
+ }
+ $j++;
+ }
+ }
+ $i++;
+ }
+ $data['darab'] = $db;
+ $data['kik'] = $kik;
+
+
+
+ $data['sorok2'] = $sorok2;
+
+
+
+
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $this->load->view('site_forum',$data);
+ }else
+ redirect('forum');
+ }
+
+ function listVMData()
+ {
+ $azureVMID = $this->uri->segment(3);
+ $txt = "SELECT * FROM cl_hlusers.AzureVM WHERE VMID = '".$azureVMID."'";
+ $vm = $this->db->query($txt)->result();
+ if( count($vm) != 1 )
+ return false;
+
+ $vmGrp = $this->db->query("SELECT * FROM cl_hlusers.AzureGroups WHERE ID = '".$vm[0]->GROUPID."'")->result();
+ if( count($vmGrp) != 1 )
+ return false;
+
+ $data['tartalom']='forum/azurevm';
+ $data['vm'] = $vm;
+ $data['vmGrp'] = $vmGrp;
+ $data['azureVMID'] = $azureVMID;
+ $this->load->view('site_simple',$data);
+ }
+
+ function azuredemo()
+ {
+ $azuredemohardlocks = "SELECT hlNum FROM cl_hlusers.hardlock WHERE hlUser = '50378'";
+ $azureVMIDs = "SELECT prAzureVMID FROM cl_hlusers.h_programs WHERE prHlNum IN (".$azuredemohardlocks.")";
+ $azureVMs = "SELECT * FROM cl_hlusers.AzureVM WHERE ID IN (".$azureVMIDs.")";
+ $azuredemoVMs = $this->db->query($azureVMs)->result();
+
+ $data['tartalom']='forum/azurevm';
+ $data['azuredemoVMs'] = $azuredemoVMs;
+ $this->load->view('site_simple',$data);
+ }
+
+ function VMCreate(){
+ $vmid = $this->input->post('vmid');
+ $vmdatatxt = "SELECT VMID FROM cl_hlusers.AzureVM WHERE ID = '".$vmid."'";
+ $vmdata = $this->db->query($vmdatatxt)->row();
+ if(count($vmdata) != 1)
+ return;
+ createAzureVM($vmdata->VMID);
+ }
+
+ function VMStart(){
+ $vmid = $this->input->post('vmid');
+ $vmdatatxt = "SELECT VMID, STATUS, RDP FROM cl_hlusers.AzureVM WHERE ID = '".$vmid."'";
+ $vmdata = $this->db->query($vmdatatxt)->row();
+
+ //0 - inicializálatlan, még a gép sincs létrehozva, kezdeti állapot
+ //1 - gép megvan, de nincs indítás alatt (rdp nincs és 1 percen belül nem volt adat a státuszról)
+ //2 - induló gép (rdp nincs, de 1 percen belül volt adat a státuszról)
+ //3 - futó gép (rdp van és 1 percen belül volt adat a státuszról)
+ //4 - leállás alatt
+
+ if( $vmdata->STATUS == 0 )
+ {
+ print "A gép még nincs létrehozva!";
+ return;
+ }
+ else if( $vmdata->STATUS == 2 )
+ {
+ print "A gép már indítás alatt van!";
+ return;
+ }
+ else if( $vmdata->STATUS == 4 )
+ {
+ print "A gép leállítás alatt van!";
+ return;
+ }
+ //ba ha már fut, akkor csak kidobjuk az rdp-t letöltésre:
+ if( $vmdata->STATUS == 3 )
+ {
+ $this->VMRDPCommand($vmdata->RDP);
+ }
+ else //ba ha még nem, akkor elindítjuk és várunk hogy fusson, hogy dobhassunk rdp-t letöltésre
+ {
+ $this->VMStartCommand($vmid);
+ }
+ }
+
+ function VMRDPCommand($rdp)
+ {
+ if( $rdp == "" )
+ {
+ print "Nincs meg az RDP!";
+ return;
+ }
+ header("Content-type: application/rdp");
+ header("Content-disposition: attachment; filename=archline.rdp");
+ $decoded = base64_decode($rdp);
+ echo $decoded;
+ }
+
+ function VMStartCommand($vmid)
+ {
+ $vmdatatxt = "SELECT VMID FROM cl_hlusers.AzureVM WHERE ID = '".$vmid."'";
+ $vmdata = $this->db->query($vmdatatxt)->row();
+
+ $rdp = $this->VMIsRunning($vmid);
+ if( $rdp != "" )
+ {
+ //VMRDPCommand($rdp);
+ return;
+ }
+
+ chdir('/var/tmp');
+ $command = "/usr/bin/azure vm start ".$vmdata->VMID;
+ $ph = popen( $command." 2>&1", "r" )
+ or die( "Hiba" );
+ while(!feof($ph))
+ {
+ // send the current file part to the browser
+ /*print*/ fread($ph, 1024);
+ // flush the content to the browser
+ flush();
+ }
+ pclose($ph);
+
+ }
+
+ function VMIsRunning($vmid)
+ {
+ $vmdatatxt = "SELECT VMID, STATUS, RDP FROM cl_hlusers.AzureVM WHERE ID = '".$vmid."'";
+ $vmdata = $this->db->query($vmdatatxt)->row();
+ //ba gyorsítunk kicsit, viszont a lekérdezés így nem 100%os
+ /*chdir('/var/tmp');
+ $command = "/usr/bin/azure vm show --json ".$vmdata->VMID;
+ $ph = popen( $command." 2>&1", "r" )
+ or die( "Hiba" );
+ $stroutput = "";
+ while(!feof($ph))
+ {
+ // send the current file part to the browser
+ $stroutput .= fread($ph, 1024);
+ // flush the content to the browser
+ flush();
+ }
+ pclose($ph);
+ $json = json_decode($stroutput);
+ $stat = $json->InstanceStatus;*/
+ if( /*$stat == "ReadyRole" &&*/ $vmdata->STATUS == 3 && $vmdata->RDP != "" )
+ {
+ $coded = base64_encode($vmdata->RDP);
+ //print $coded;
+ return $coded;
+ }
+ return "";
+ }
+
+ function myedit(){
+ $tomb = $this->phpsession->get('fuser');
+
+ if(!$tomb) $tomb = $this->phpsession->get('feltolto');
+
+ if( $tomb ){
+ if($this->input->post('mysave')!=false){
+
+ $error = "";
+ $langerror = array();
+ if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') != $this->input->post('jelszo2') ){
+ $error .= "A megadott két jelszó nem egyezik.
";
+ array_push($langerror,0);
+ }else if( ($this->input->post('jelszo1') != "" || $this->input->post('jelszo2') != "") && $this->input->post('jelszo1') == $this->input->post('jelszo2') && strlen($this->input->post('jelszo1') ) < 5 ){
+ $error .= "A megadott jelszó 5 karakternél rövidebb.
";
+ array_push($langerror,1);
+ }
+
+ $user = $tomb['name'];
+ $myid = $this->mforum->get_userid($user);
+
+ if( $this->input->post('login') == "" ){
+ $error .= "A login mező értéke nem lehet üres.
";
+ array_push($langerror,4);
+ }
+
+ if( $this->input->post('login') != "" && !$this->mforum->szabadlogin($this->input->post('login'),$myid) ){
+ $error .= "A megadott login már foglalt, kérem válasszon másikat.
";
+ array_push($langerror,2);
+ }
+ elseif( strlen($this->input->post('login') ) < 5 ){
+ $error .= "A megadott login 5 karakternél rövidebb.
";
+ array_push($langerror,3);
+ }
+
+ if( $this->input->post('login') != $this->ekezet($this->input->post('login')) ){
+ $error .= "A felhasználó névben nem szerepelhet ékezet vagy szóköz!
";
+ array_push($langerror,5);
+ }
+
+
+ $ertesitesek = $this->input->post('temak');
+ if(count($ertesitesek) == 0 || (count($ertesitesek) == 1 && $ertesitesek[0] == "") )
+ $ertesit = NULL;
+ elseif( count($ertesitesek) == count($this->mforum->get_temak()) )
+ $ertesit = "mind";
+ else
+ $ertesit = ";".implode(";", $ertesitesek).";";
+
+
+ if($error){
+ hun() ? $data['title'] = 'ARCHLine.XP Adatok változtatása' : $data['title'] = 'ARCHLine.XP Edit Data';
+ $data['tartalom']='forum/myedit';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+ $data['error2'] = $error;
+ $data['hibak2'] = $langerror;
+
+ $user = $tomb['name'];
+ $user_id = $this->mforum->get_userid($user);
+ $data['user_id'] = $user_id;
+ $data['cucc'] = $this->mforum->get_user_alap($user);
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }else{
+ $plogin = $this->input->post('login');
+ $pnev = $this->input->post('nev');
+ $pjelszo = $this->input->post('jelszo1');
+
+ $this->mforum->myedit($plogin, $pnev, $pjelszo, $myid, $ertesit);
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['t_nev'] = $this->mforum->get_nev($plogin);
+ $fuser['name'] = $this->input->post('login');
+ $this->phpsession->save('fuser',$fuser);
+ $this->myuser();
+ }
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Adatok változtatása' : $data['title'] = 'ARCHLine.XP Edit Data';
+ $data['tartalom']='forum/myedit';
+ $data['csik']=array('home','forum');
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ if(hun())
+ $nyelv = "hun";
+ else
+ $nyelv = "eng";
+
+ $user = $tomb['name'];
+ $user_id = $this->mforum->get_userid($user);
+ $data['user_id'] = $user_id;
+ $data['temak'] = $this->mforum->get_temak($nyelv);
+ $data['cucc'] = $this->mforum->get_user_alap($user);
+
+ $data['aktmenu'] = "3";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function ujjelszo(){
+ if($this->input->post('kuld')!=false){
+ $email = $this->input->post('email');
+ if(hun()) $uzenet = "A megadott e-mail-cím: " . $email;
+ //$uzenet = $email;
+
+ $ujjelszo = $this->mforum->ujjelszo($email);
+
+ if($ujjelszo){
+
+ $this->load->library('email');
+ $this->load->helper('email');
+ $this->email->initialize();
+ $this->email->addOfficialImages();
+
+ $mailnek->ujjsz = $ujjelszo;
+ $mailnek->login = $this->mforum->get_login2($email);
+
+
+ /* Akarmilyem mailcimet is adott meg, a default emailre kuldjuk a levelet */
+ $email2 = $this->mforum->default_mail($email);
+ if($email2 != "")
+ $email = $email2;
+
+
+ $this->email->from('info@cadline.hu', 'Cadline Weboldal');
+ if(hun())
+ $this->email->subject('Uj jelszo');
+ else
+ $this->email->subject('New Password');
+ $this->email->message($this->load->view('mail_ujjelszo',$mailnek,true));
+ $this->email->send($email,'smtp');
+
+ if(hun())
+ $uzenet = $email." -ra kiküldtük az Ön új jelszavát.
";
+ else
+ $uzenet = "New password sent to ".$email;
+
+ }else{
+ if(hun()) $uzenet .= " nincs a felhasználók között.
";
+ else $uzenet = "E-mail error: ".$email;
+ }
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új jelszó' : $data['title'] = 'ARCHLine.XP Forum new password';
+
+ $data['uzenet']=$uzenet;
+ $this->phpsession->save('fuzenet',$uzenet);
+
+ if( isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'],'/collection/') ){
+ $data['tartalom']='collection/ujjelszo_valasz';
+ $data['style'] = array('temp/style_new');
+ $this->load->view('site_upload',$data);
+ }
+ else{
+ /*$data['tartalom']='forum/temakorok';
+ $data['csik']=array('home','forum');
+ $this->load->view('site_forum',$data);*/
+ redirect('forum');
+ }
+
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum új jelszó' : $data['title'] = 'ARCHLine.XP Forum new password';
+
+ $data['tartalom']='forum/ujjelszo';
+ $data['csik']=array('home','forum');
+
+ if( isset($_SERVER['HTTP_REFERER']) && (strstr($_SERVER['HTTP_REFERER'],'collection/upload') || strstr($_SERVER['HTTP_REFERER'],'collection/submit')) ){
+ $data['style'] = array('temp/style_new');
+ $this->load->view('site_upload',$data);
+ }
+ else{
+ $this->load->view('site_new',$data);
+ }
+ }
+ }
+
+ function szabalyzat(){
+ if(hun())
+ $lap = $this->mpages->get_row(454);
+ else
+ $lap = $this->mpages->get_row(559);
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum szabályzat' : $data['title'] = 'ARCHLine.XP Forum Rules';
+ $data['tartalom'] = '/forum/szabalyzat';
+ $data['lap'] = $lap;
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $uid = $this->mforum->get_userid($user['name']);
+ //ha még nem fogadta el a szabályzatot:
+ if( !($this->mforum->szabalyzat($uid) ) ){
+ $data['uid'] = $uid;
+ $data['nemelfogad'] = true;
+ }
+
+ $data['aktmenu'] = "2";
+ $this->load->view('site_forum',$data);
+ }
+
+ function elfogad(){
+ if($this->input->post('el')=="igen"){
+ $this->load->model('mclusers');
+
+ $uid = $this->input->post('uid');
+ $name = $this->input->post('fnev');
+ $passwd = $this->input->post('jelszo');
+ if( $this->mforum->belep($name,$passwd,false) ){
+ $this->mforum->elfogad($uid);
+
+ $felhasznalo = $this->mforum->getrow($uid);
+ if($felhasznalo->nUserID > 0 && $felhasznalo->nyelv == "hun")
+ $this->mclusers->addEvent($felhasznalo->nUserID, 109, 'Elso bejelentkezes a forumba.', "hun");
+ elseif( $felhasznalo->nUserID > 0 && $felhasznalo->nyelv == "eng" )
+ $this->mclusers->addEvent($felhasznalo->nUserID, 148, 'Elso bejelentkezes a forumba.', "eng");
+
+ $fuser['lang']=$this->muser->user['lang'];
+ $fuser['name']=$this->mforum->get_login($uid);
+ $fuser['t_nev'] = $this->mforum->get_nev($name);
+
+ $fuser['user_id'] = $uid;
+
+ $this->phpsession->save('fuser',$fuser);
+ $Date = date('Y-m-d',time());
+
+ $nUserID = $this->mforum->get_nUserID2($uid);
+ }
+
+ redirect('forum');
+
+ }else{
+ $this->logout();
+ }
+ }
+
+ function ido(){
+ die(date('Y-m-d H:i:s', time()));
+ }
+
+ function emailjavitas(){
+ $tomb = $this->phpsession->get('fuser');
+ if(!$tomb)
+ redirect('forum');
+
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+
+ $cl_users = $this->mforum->get_cl_users();
+
+ $db = 0;
+ $cserek = "";
+ foreach($cl_users as $user){
+ $nUserID = $user->nUserID;
+ //print $user->strName;
+ $x = $this->mforum->cseremail($nUserID);
+ if( $x ){
+ $cserek .= $x;
+ $db++;
+ }
+ }
+
+ $data['email']=$db;
+ $data['cserek']=$cserek;
+
+
+
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function ujuserdb_eng(){
+ $user = $this->phpsession->get('fuser');
+ if($this->mforum->moderator($user['name'])){
+ hun() ? $data['title'] = 'ARCHLine.XP Fórum Felhasználók' : $data['title'] = 'ARCHLine.XP Forum Users';
+ $data['tartalom']='forum/users';
+ $data['csik']=array('home','forum');
+ $oldal = 0;
+ $this->phpsession->save('uoldal',$oldal);
+ if( $this->phpsession->get('rendez') )
+ $ord = $this->phpsession->get('rendez');
+ else
+ $ord = "nev";
+
+ $data['users']=$this->mforum->get_users($oldal,$ord);
+
+ if( $this->mforum->vanmeguser($this->phpsession->get('uoldal')) )
+ $data['kovetkezo'] = true;
+ if( $this->phpsession->get('uoldal') > 0 )
+ $data['elozo'] = true;
+
+ $data['oldalak_szama'] = (int)$this->mforum->get_usersdb();
+ $data['akt_oldal'] = $oldal;
+ $data['moderator']=true;
+
+ $this->phpsession->save('ukoldal',0);
+ $this->phpsession->save('klogin',"");
+ $this->phpsession->save('knev',"");
+ $this->phpsession->save('kemail',"");
+ $this->phpsession->save('ksorozat',"");
+
+ $sorok = $this->mforum->get_cl_users_eng();
+
+ $i = 0;
+ $j = 0;
+ $db = 0;
+ foreach($sorok as $sor){
+ $mailek = $sor->strEMail;
+ $mailek = explode(";",$mailek);
+
+ foreach( $mailek as $mail ){
+ /* csak az elso email cimet veszi fel */
+ $mail = trim($mailek[0]);
+
+
+ //megnezzuk hogy benne van-e az adatbázisban és aktív-e
+ if( $mail != "" && $sor->hlStat == 1 && !$this->mforum->is_email(strtolower($mail)) ){
+ $mailresz = explode('@',$mail);
+ $login = $mail;
+ $nev = $sor->strName;
+ $nev = trim($nev);
+ $jsz1 = $mailresz[0];
+ $nUserID = $sor->nUserID;
+ $rang = "user";
+
+
+ // eladási dátum 0000-00-00 -e
+ $datum = $this->db->from('`clusers_eng`.`cl_fo_programs`')->where("prHlNum",$sor->hlNum)->select('prSellDate')->get()->row();
+
+ $prog = $this->db->query(" SELECT * FROM `clusers_eng`.`cl_fo_programs` WHERE prHlNum = '".$sor->hlNum."'")->result();
+
+ if($datum->prSellDate != '0000-00-00' && $this->mforum->szabadlogin($login) ){
+ $this->mforum->ujuser_eng($login,$nev,$jsz1,strtolower($mail),$nUserID,$rang);
+
+ // print "
Felvenném: ".$login.$nev.$jsz1.strtolower($mail).$nUserID.$rang;
+
+ $db++;
+ $kik[$j]->Nev = $nev;
+ $kik[$j]->Login = $login;
+ $kik[$j]->Email = $mail;
+ $kik[$j]->Datum = $datum->prSellDate;
+ }
+ $j++;
+ }
+ }
+ $i++;
+ }
+ $data['darab'] = $db;
+ $data['kik'] = $kik;
+
+ $data['sorok2'] = $sorok;
+
+ $this->load->view('site_forum',$data);
+ }else{
+ redirect('forum');
+ }
+ }
+
+ function info($info){
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/kiir';
+ $data['info'] = $info;
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function galeria(){
+ $user = $this->phpsession->get('fuser');
+
+ if( is_numeric($this->uri->segment(3)) ){
+ $this->galeriamutat();
+ }elseif($user){
+ $this->sajatgaleria();
+ }else{
+ redirect("forum");
+ }
+ }
+
+ function galeriamutat(){
+ $user_id = $this->uri->segment(3);
+ $lang = $this->muser->user['lang'];
+
+ $fajlok = $this->mforum->get_galeria($user_id,$lang);
+
+ $data["fajlok"] = $fajlok;
+ if(hun())
+ $data['utvonal'] = $this->galeria_utvonal.$user_id;
+ else
+ $data['utvonal'] = $this->galeria_utvonal_eng.$user_id;
+
+ $data['tartalom'] = '/forum/galeria';
+ $data['javascript'] = array(
+ 'interior_menu',
+ 'fancybox/jquery-1.3.2.min',
+ 'fancybox/jquery.easing.1.3',
+ 'fancybox/jquery.fancybox-1.2.1.pack',
+ 'fancybox/fancy'
+ );
+
+ $data['style'] = array('fancybox');
+
+ $this->load->view('site_forum',$data);
+
+ }
+
+ function sajatgaleria(){
+ $this->load->model('mrender');
+ $user = $this->phpsession->get('fuser');
+
+ if($user){
+ hun() ? $data['title'] = 'ARCHLine.XP Saját Galéria' : $data['title'] = 'ARCHLine.XP My Gallery';
+ $data['tartalom'] = '/forum/sajatgaleria';
+
+ $uid = $user['user_id'];
+ $data['uid'] = $uid;
+
+ $data['fajlok'] = $this->mforum->fajlok($uid);
+ $data['szabad_hely'] = (200 * 1024 * 1024) - $this->foglalt_hely($uid);
+
+ // $data['renderek'] = $this->mrender->get_byuserid($uid);
+
+ $data['javascript'] = array('fancybox/jquery-1.3.2.min','fancybox/jquery.easing.1.3','fancybox/jquery.fancybox-1.2.1.pack','fancybox/fancy','jquery','jquery_ui');
+ $data['style'] = array('fancybox2','jquery.ui');
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "5";
+ $this->load->view('site_forum',$data);
+ }else
+ redirect("forum");
+ }
+
+ function foglalt_hely($user_id){
+ if(hun())
+ $fajlok = $this->galeria_utvonal.$user_id."/";
+ else
+ $fajlok = $this->galeria_utvonal_eng.$user_id."/";
+
+ $total = 0;
+
+ if( is_dir($fajlok) ){
+ $handle = opendir($fajlok);
+ while($file = readdir($handle)){
+ $total += filesize($fajlok.$file);
+ if((is_dir($fajlok.$file.'/')) &&($file != '..')&&($file != '.'))
+ {
+ $total = $total + $this->foglalt_hely($fajlok.$file.'/');
+ }
+ }
+ }
+
+ return $total;
+ }
+
+ function feltolt(){
+ $user = $this->phpsession->get('fuser');
+ $uid = $user['user_id'];
+
+ if($uid && $_FILES["fajl"]["error"]==0){
+
+ $fajl = "";
+ $meret = 0;
+
+ if(hun())
+ $hova = $this->galeria_utvonal.$uid;
+ elseif(eng())
+ $hova = $this->galeria_utvonal_eng.$uid;
+
+ if(!is_dir($hova)){
+ mkdir($hova,0644);
+ chmod($hova,0777);
+ }
+
+
+ $feltolt_konyvtar = $hova."/";
+ //ha több fájl lenne ugyanazon a néven
+ $elotag = substr(time(),-6);
+ $fajlnev = $this->ekezet($_FILES["fajl"]["name"]);
+ $feltolt_fajlnev=$feltolt_konyvtar . $elotag . "__" . $fajlnev;
+
+ $error = "";
+ $mi = $_FILES['fajl']['name']."$";
+
+ $mire = "\.exe|\.EXE|\.php|\.PHP|\.sh|\.SH";
+ if( (ereg( $mire , $mi )) ){
+ $error .= "Hibás fájl kiterjesztés
";
+ }
+ if( $_FILES['fajl']['size'] > 1024 * 1024 * 10 ){
+ $error .= "A fájl mérete nagyobb 10 MB-nál.
";
+ }
+ else if( !$error){
+ if (copy($_FILES["fajl"]["tmp_name"], $feltolt_fajlnev)){
+ $fajl = $elotag . "__". $fajlnev;
+ $meret = $_FILES["fajl"]["size"];
+ $mit = $hova."/".$fajl;
+ chmod($mit,0777);
+
+
+ // elonezeti kep elkeszitese 150x113-ban
+ include('application/helpers/myimg_helper.php');
+ kepmeretezesvagas($feltolt_fajlnev,$hova,"elo_".$fajl,"150","113");
+
+ }else{
+ $fajl = "NULL";
+ $error = "Fájl másolás hiba.
";
+ }
+ }
+
+ if( !$error ){
+ $szamla = $this->input->post('szamla');
+ $info = $this->input->post('leiras');
+ $megoszt = 1;
+
+ if( $this->input->post('megosztas') != "on" ){
+ $megoszt = 0;
+ }
+
+ $this->mforum->feltolt($uid,$fajl,$meret,$szamla,$megoszt,$info);
+
+ redirect("forum/galeria/".$uid);
+ }else{
+ $this->info($error);
+ }
+
+
+ }else{
+ if( $_FILES['fajl']['error'] != 0 )
+ $this->info("Hiba a fájl feltöltésekor!");
+ else
+ redirect("forum");
+ }
+
+ }
+
+ function delfajl(){
+ $fajl_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ $user_id = $user['user_id'];
+
+ if(!$user)
+ redirect('forum');
+
+ if( is_numeric($fajl_id) && $this->mforum->sajatfajl($fajl_id, $user_id) ){
+ $this->load->model('mrender');
+
+ $fajl = $this->mforum->delfajl($fajl_id);
+
+ if(hun())
+ $mit = "public/forum-galeria/hun/".$user_id."/elo_".$fajl;
+ else
+ $mit = "public/forum-galeria/eng/".$user_id."/elo_".$fajl;
+
+ // elonezeti kep torlese ha van
+ if( file_exists( $mit ) ){
+ chmod($mit, 777);
+ unlink($mit);
+ }
+
+ // A fájlhoz tartozó rendereknél törölni a galériás fájl id-t.
+ $renderek = $this->mrender->get_rowBygforumgalid($fajl_id);
+ if( $renderek ){
+ foreach($renderek as $render){
+ $ertek = NULL;
+ $this->db->update('render_img',array('forumgal_id'=>$ertek),"render_id='".$render->render_id."'");
+ }
+ }
+ }
+ redirect("forum/galeria");
+ }
+
+ function editgaleria(){
+ $fajl_id = $this->input->post('fajl_id');
+ // $fajl_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ $user_id = $user['user_id'];
+
+ if(!$user)
+ redirect('forum');
+
+
+ if( is_numeric($fajl_id) && $this->mforum->sajatfajl($fajl_id, $user_id) ){
+ if( $this->input->post('do') ){
+ $leiras = $this->input->post('leiras');
+ $megoszt = 1;
+
+ if( $this->input->post('megosztas') != "on" ){
+ $megoszt = 0;
+ }
+
+ $this->mforum->editgaleria($fajl_id,$leiras,$megoszt);
+
+ redirect("forum/galeria");
+
+ }else{
+ hun() ? $data['title'] = 'ARCHLine.XP Saját Galéria' : $data['title'] = 'ARCHLine.XP My Gallery';
+ $data['tartalom'] = '/forum/editgaleria';
+
+ $data['uid'] = $user_id;
+ $data['fajlinfo'] = $this->mforum->fajlinfo($fajl_id);
+ if(hun())
+ $data['utvonal'] = $this->galeria_utvonal;
+ else
+ $data['utvonal'] = $this->galeria_utvonal_eng;
+
+ $data['utvonal'] .= "/".$user_id;
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['aktmenu'] = "5";
+ $this->load->view('site_forum',$data);
+ }
+ }else{
+ redirect("forum");
+ }
+ }
+
+ function regisztracio(){
+ if($this->input->post('do') != ""){
+ $nev = $this->input->post('regnev');
+ $login = $this->input->post('email');
+ $email = $login;
+ $jelszo = $this->input->post('jelszo1');
+
+ $szabad = $this->mforum->szabadlogin($login,999999);
+ if( $szabad ){
+ //$this->mforum->ujuser($login,$nev,$jelszo,$email,"","feltolto");
+
+
+ $kod = md5($jelszo.time().$nev);
+
+ $record['login'] = $email;
+ $record['jelszo'] = md5($jelszo);
+ $record['nev'] = $nev;
+ $record['email'] = $email;
+ $record['rang'] = "guest";
+ $record['kod'] = $kod;
+ $record['datum'] = date("Y-m-d H:i:s",time());
+ $record['nyelv'] = $this->muser->user['lang'];
+
+ $this->db->insert('forum_user_temp',$record);
+
+
+ $this->load->helper('email');
+
+ //sending the e-mail
+ $mail_vars['kod'] = $kod;
+ $mail_vars['email'] = $email;
+ $mail_vars['first'] = $nev;
+
+ //set the authenticating link
+ $mail_vars['link'] = hun() ? 'http://archline.hu/forum/confirm/' . $kod : 'http://www.archlinexp.com/forum/confirm/' . $kod;
+
+ //setting and sending the email
+ $this->load->library('email');
+ $this->email->initialize();
+ $this->email->addOfficialImages();
+
+ $this->email->setFrom('info@cadline.hu', 'CadLine');
+
+ if(hun())
+ {
+ $mail_vars['mailcontent'] = 'mail/confirm_forum_hun';
+ $this->email->subject('ARCHLine.XP regisztráció');
+ }
+ else
+ {
+ $mail_vars['mailcontent'] = 'mail/confirm_forum_eng';
+ $this->email->subject('ARCHLine.XP registration');
+ }
+
+ $this->email->message($this->load->view('mail',$mail_vars,true));
+ $this->email->send($mail_vars['email'],'smtp');
+
+ redirect('forum/sentconf');
+ }
+ else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/regisztracio';
+ $data['javascript'] = array('forum');
+ $data['style'] = array('temp/style_interior');
+ $data['foglalt'] = "igen";
+
+ $this->load->view('site_upload',$data);
+ }
+ }else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/regisztracio';
+ $data['javascript'] = array('forum');
+ $data['style'] = array('temp/style_interior');
+
+ $this->load->view('site_upload',$data);
+ }
+ }
+
+ function sentconf(){
+ $data['tartalom']='forum/sentconf';
+ $data['lang']=$this->muser->user['lang'];
+ $data['style'] = array('temp/style_new');
+
+ $this->load->view('site_upload',$data);
+ }
+
+ function confirm(){
+ $kod = $this->uri->segment(3);
+
+ $data['style'] = array('temp/style_new');
+
+ if( $this->mforum->confirm($kod) ){
+
+ /* a felhasználóhoz új eseményt felvenni, ha szerepel az adatbázisban */
+ $adatok = $this->mforum->get_userByKod($kod);
+ $nUserID = $this->mforum->get_nUserID30($adatok->email);
+ if( $nUserID ){
+ $this->load->model('mclusers');
+ $this->mclusers->addEvent($nUserID, 114, "Regisztráció");
+ }
+
+ $data['tartalom']='forum/confirm_ok';
+ $data['lang']=$this->muser->user['lang'];
+ }else{
+ $data['tartalom']='forum/confirm_hiba';
+ $data['lang']=$this->muser->user['lang'];
+ }
+
+ $this->load->view('site_upload',$data);
+ }
+
+ function belepfeltolto(){
+ if( $this->input->post("do") != "" ){
+ $login = $this->input->post("email");
+ $jelszo = $this->input->post("jelszo");
+
+ if( $this->mforum->belep($login,$jelszo) ){
+ print "ok";
+ }else
+ print "nem ok";
+
+ }else{
+ $data['title'] = 'ARCHLine.XP';
+ $data['tartalom'] = '/forum/belepfeltolto';
+ $data['javascript'] = array('forum');
+
+ $this->load->view('site',$data);
+ }
+ }
+
+ function renderek(){
+ $this->load->model('mrender');
+ $user = $this->phpsession->get('fuser');
+ $feltolto = $this->phpsession->get('feltolto');
+
+ if($user){
+ $uid = $user['user_id'];
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ }elseif($feltolto){
+ $uid = $feltolto['user_id'];
+ }
+ else
+ redirect("forum");
+
+ hun() ? $data['title'] = 'ARCHLine.XP Renderek' : $data['title'] = 'ARCHLine.XP Renders';
+ $data['tartalom'] = '/forum/renderek';
+
+ $data['uid'] = $uid;
+
+ $renderek = $this->mrender->get_byuserid($uid);
+
+ if($renderek){
+ foreach($renderek as $render){
+ if($render->allapot=='1' && file_exists($render->keszkep)){
+ list($width, $height) = getimagesize($render->keszkep);
+ $render->kepmeret = $width . " x ". $height;
+ }
+ else{
+ $render->kepmeret = '-';
+ }
+ }
+ }
+
+ $data['renderek'] = $renderek;
+
+ $data['onload'] = "betolt()";
+
+ $data['javascript'] = array('fancybox-1.3.4/fancybox/jquery-1.4.3.min','fancybox/jquery.easing.1.3','fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack','jquery_ui','plugin/jquery.maskedinput-1.2.2','plugin/jquery.maskedinput-1.2.2.min');
+ $data['style'] = array('jquery.fancybox-1.3.4','jquery.ui');
+ $data['aktmenu'] = "6";
+ $this->load->view('site_forum',$data);
+
+ unset($_SESSION['webrender']); // ne legyenek meg a render beallitasanal a default ertekek
+ }
+
+ function delrender(){
+ $this->load->model('mrender');
+
+ $render_id = $this->uri->segment(3);
+ $user = $this->phpsession->get('fuser');
+ if(!$user)
+ $user = $this->phpsession->get('feltolto');
+
+ if(!$user)
+ redirect('forum');
+
+ $render = $this->mrender->get_row($render_id);
+
+ if( is_numeric($render_id) && $render->user_id == $user['user_id'] ){
+ $this->mrender->del($render_id);
+ }
+
+ header("Location: ".$_SERVER["HTTP_REFERER"]);
+ }
+
+ function rendercopy(){
+ $this->load->model('mrender');
+
+ $guid = $this->uri->segment(3);
+ $render = $this->mrender->get_rowByguid($guid);
+
+ if( is_numeric($render->render_id) ){
+ if( $this->muser->user['lang'] == "hun" )
+ $almappa = "hun";
+ else
+ $almappa = "eng";
+
+ $uid = $render->user_id;
+
+ $helye = "public/forum-galeria/".$almappa."/".$uid;
+
+ if(!is_dir($helye)){
+ mkdir($helye,0644);
+ chmod($helye,0777);
+ }
+
+ $fajluj = basename($render->keszkep);
+
+ $honnan = $render->keszkep;
+ $hova = $helye."/".$fajluj;
+
+ if( copy($honnan,$hova) ){
+ $meret = filesize($hova);
+ $this->mforum->feltolt($render->user_id,$fajluj,$meret,"","1",$render->render_name,$render->nyelv);
+ $fajl_id = mysql_insert_id();
+ $this->db->update('render_img',array('forumgal_id'=>$fajl_id),"render_id='".$render->render_id."'");
+
+ $uzenet = array(4);
+ $this->phpsession->save('fuzenet',$uzenet);
+
+ // elonezeti kep masolasa is ha van
+ $fajlnev = basename($render->keszkep);
+ $mappak = substr( $render->keszkep,0,(-1*(strlen($fajlnev))) );
+ $elokep = $mappak."elo_".$fajlnev;
+ if(file_exists($elokep)){
+ $ujelokep = $helye."/elo_".$fajlnev;
+ copy($elokep,$ujelokep);
+ }
+ }else{
+ $uzenet = array(14);
+ $this->phpsession->save('fhiba',$uzenet);
+ }
+
+ redirect('forum/renderek');
+ }else{
+ $uzenet = array(14);
+ $this->phpsession->save('fhiba',$uzenet);
+ redirect('forum/renderek');
+ }
+ }
+
+ function renderletolt(){
+ $this->load->model('mrender');
+ $render_id = $this->uri->segment(3);
+ $render = $this->mrender->get_row($render_id);
+
+ $user = $this->phpsession->get('fuser');
+ $feltolto = $this->phpsession->get('feltolto');
+
+ if( isset($render->keszkep) && $render->keszkep != "" && file_exists($render->keszkep) && ( $render->user_id == $user['user_id'] || $render->user_id == $feltolto['user_id'] ) ){
+ $path_parts = pathinfo($render->keszkep);
+ $ext = strtolower($path_parts["extension"]);
+
+ if($render->render_name == "")
+ $render->render_name = "Image";
+
+ header("Content-type: application-download");
+ header('Content-Disposition: attachment; filename="'.$render->render_name.'.'.$ext.'"');
+ readfile($render->keszkep);
+ }else{
+ print "hiba a letoltes kozben";
+ }
+ }
+
+ function myshowroom(){
+ $user = $this->phpsession->get('fuser');
+ $feltolto = $this->phpsession->get('feltolto');
+ if(!$user && !$feltolto)
+ redirect('forum');
+
+ if(!$user)
+ $user = $feltolto;
+
+ if($this->mforum->moderator($user['name']))
+ $data['moderator']=true;
+
+ $data['tartalom'] = 'forum/myshowroom';
+
+ $data['title'] = hun() ? 'ARCHLine.XP Saját Bemutatóterem' : 'ARCHLine.XP My Showroom';
+ $uid = $user['user_id'];
+ $data['uid'] = $uid;
+ $data['elemek'] = $this->db->query("SELECT * FROM collection_user WHERE userid={$uid} AND deleted=0")->result();
+
+ $data['aktmenu'] = "5";
+
+ $data['javascript'] = array('fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack','fancybox/fancy');
+ $data['style'] = array('../js/fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4v2');
+
+ $this->load->view('site_forum',$data);
+ }
+
+ function szerver(){
+ print "";
+ print_r($_SERVER);
+ print "\n\n";
+ // print_r($GLOBALS);
+ print "
";
+ }
+
+
+ function downloadbeta32(){
+ $user = $this->fuser;
+ $login = $user['name'];
+ $email = $this->mforum->get_user_alap($login);
+ redirect('events/click/betaletoltes32/'.$email[0]->email);
+ }
+
+ function downloadbeta64(){
+ $user = $this->phpsession->get('fuser');
+ $login = $user['name'];
+ $email = $this->mforum->get_user_alap($login);
+ redirect('events/click/betaletoltes64/'.$email[0]->email);
+ }
+
+
+ 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->ervenydessegazon,"/");
+ setcookie("hash",$_COOKIE['hash'] ,time()+$this->ervenydesseg,"/");
+
+ return true;
+
+ }else{
+ return false;
+ }
+ }
+
+
+}
+
+function hasonlito( $a, $b ){
+ if ( $a->datum == $b->datum )
+ return 0;
+ if ( $a->datum > $b->datum )
+ return -1;
+ return 1;
+}
+
+?>
\ No newline at end of file
diff --git a/var/www/hosting/cadline.hu/www/application/controllers/forum.php.evidence.json b/var/www/hosting/cadline.hu/www/application/controllers/forum.php.evidence.json
new file mode 100644
index 0000000..7513c28
--- /dev/null
+++ b/var/www/hosting/cadline.hu/www/application/controllers/forum.php.evidence.json
@@ -0,0 +1,15 @@
+{
+ "finding_ref": "5447",
+ "log_excerpt": "[quarantine] www.cadline.hu:application/controllers/forum.php -> quarantined (dest=/var/lib/web-hids/quarantine/var/www/hosting/cadline.hu/www/application/controllers/forum.php)",
+ "original_sha256": "9ff320957968cee7484108a7546a4ac2b6bf092fff325c7327b312ab382d632b",
+ "original_stat": {
+ "gid": 30037,
+ "mtime": 1406189075,
+ "size": 83340,
+ "uid": 11669
+ },
+ "rel_path": "application/controllers/forum.php",
+ "result": "quarantined",
+ "timestamp": "20260718T160424Z",
+ "vhost": "www.cadline.hu"
+}
diff --git a/var/www/hosting/cadline.hu/www/application/controllers/forum.php~ b/var/www/hosting/cadline.hu/www/application/controllers/forum.php~
new file mode 100755
index 0000000..b1336e4
--- /dev/null
+++ b/var/www/hosting/cadline.hu/www/application/controllers/forum.php~
@@ -0,0 +1,2602 @@
+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]="/";
+ $mit[2]="/\n/";
+ $mit[3]="/'/";
+ $mit[4]="/=/";
+ $mit[5]="/\"/";
+ $mit[6]="/;/";
+ $mire[0]=">";
+ $mire[1]="<";
+ $mire[2]="
";
+ $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, '