Example #1
0
 /**
  * Index Page for this controller.
  *
  * Maps to the following URL
  * 		http://example.com/index.php/welcome
  * 	- or -  
  * 		http://example.com/index.php/welcome/index
  * 	- or -
  * Since this controller is set as the default controller in 
  * config/routes.php, it's displayed at http://example.com/
  *
  * So any other public methods not prefixed with an underscore will
  * map to /index.php/welcome/<method_name>
  * @see http://codeigniter.com/user_guide/general/urls.html
  */
 public function get($genid = '')
 {
     $id = id_from_genid($genid);
     //Kullanıcı izni var mı?
     check_perm($id);
     $person = $this->db->select('id,name,first_name,last_name,gender,locale')->from('liste')->where('id', $id)->limit('1')->get()->row();
     if (!isset($person->id) || $person->id < 1) {
         show_error("Information Removed or Not Exists", "410", "Sorry for inconvenience");
     }
     $person->picture = site_url('picture/large/' . genid_from_id($person->id));
     //$person->picture = "http://graph.facebook.com/".$person->id."/picture?type=large";
     $data['person'] = $person;
     $data['same_last'] = $this->db->select('id,name')->from('liste')->where('last_name', $person->last_name)->where('id !=', $person->id)->limit('28')->get()->result();
     $data['same_first'] = $this->db->select('id,name')->from('liste')->where('first_name', $person->first_name)->where('id !=', $person->id)->limit('28')->get()->result();
     $data['same_wiki'] = $this->db->select('id,name,short_desc')->from('wiki')->or_where_in('last_name', array($person->first_name, $person->last_name))->limit('28')->get()->result();
     //Stats Ekle -> Viewed
     stats_add($person->id, "viewed");
     //$this->template->set_master_template('template_get');
     $this->template->write('title', convert_accented_characters($person->name));
     $this->template->write('description', 'about ' . convert_accented_characters($person->name));
     $this->template->write('name', convert_accented_characters($person->name));
     $this->template->write('image', site_url('picture/square/' . genid_from_id($person->id)));
     $this->template->write('picture', $person->picture);
     $this->template->write_view('page', 'face/get', $data);
     $this->template->render();
 }
Example #2
0
function make_footer($has_page = True)
{
    global $prefs;
    $new_page = "?new";
    $latest_pages = "?";
    $edit_page = "?edit." . $has_page;
    $revert_page = "?revert." . $has_page;
    $delete_page = "?delete." . $has_page;
    $footer = "<h4>Wiki</h4>\n\t<ul>\n\t\t<li><a href='" . $latest_pages . "'>" . LAN_W_3 . "</a></li>\n\t\t<li><a href='" . e_HTTP . "search.php?&t=wiki&adv=0'>" . LAN_W_9 . "</a></li>\n\t\t\n\t\t";
    if (check_perm()) {
        $footer .= "<li><a href='" . $new_page . "'>" . LAN_W_6 . "</a></li>";
        if ($has_page) {
            $footer .= "<li><a href='" . $edit_page . "'>" . LAN_W_5 . "</a></li>";
            if (ADMIN) {
                $footer .= "<li><a href='" . $revert_page . "'>" . LAN_W_7 . "</a></li>";
                $footer .= "<li><a href='" . $delete_page . "'>" . LAN_W_10 . "</a></li>";
            }
        }
    }
    $footer .= "\n\t</ul>";
    return $footer;
}
Example #3
0
//rendezes vege
//megnezzuk, hogy az azonosito alapjan milyen csoportot akar lekerdezni
$admin_group = 0;
if (isset($_REQUEST['gid']) && is_numeric($_REQUEST['gid'])) {
    $gid = intval($_REQUEST['gid']);
    $query = "\n\t\tSELECT * \n\t\tFROM iShark_Groups \n\t\tWHERE group_id = {$gid}\n\t";
    $result =& $mdb2->query($query);
    if ($result->numRows() > 0) {
        $row = $result->fetchRow();
        if ($row['group_id'] == $_SESSION['site_sys_prefgroup']) {
            $admin_group = 1;
        }
    }
}
//jogosultsag ellenorzes
if (!check_perm($act, NULL, 1, 'groups') || $admin_group == 1 && $is_admin == 0) {
    $acttpl = 'error';
    $tpl->assign('errormsg', $locale->get('error_no_permission'));
    return;
}
$groupnums = 0;
//lekerdezzuk, hogy mennyi nem torolt csoport van jelenleg
$query = "\n\tSELECT * \n\tFROM iShark_Groups \n\tWHERE is_deleted = 0\n";
$result = $mdb2->query($query);
$groupnums = $result->numRows();
if ($act == "add" || $act == "mod") {
    //js beszurasa
    $javascripts[] = "javascripts";
    require_once 'HTML/QuickForm.php';
    require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
    require_once $include_dir . '/function.check.php';
Example #4
0
// Közvetlenül ezt az állományt kérte
if (!eregi("index.php", $_SERVER['SCRIPT_NAME'])) {
    die("Közvetlenül nem lehet az állományhoz hozzáférni...");
}
//nyelvi file
$locale->useArea('index_newsletter');
//ezek az elfogadhato muveleti hivasok ($act)
$is_act = array('newsletter_subs', 'newsletter_unsubs');
//jogosultsag ellenorzes
if (isset($_REQUEST['act']) && in_array($_REQUEST['act'], $is_act)) {
    $act = $_REQUEST['act'];
} else {
    $site_errors[] = array('text' => $locale->get('error_not_act'), 'link' => 'javascript:history.back(-1)');
    return;
}
if (!check_perm($act, NULL, 0, 'newsletter', 'index')) {
    $site_errors[] = array('text' => $locale->get('error_no_permission'), 'link' => 'javascript:history.back(-1)');
    return;
}
/**
 * hirlevél jelentkezés
 */
if ($act == "newsletter_subs") {
    $query = "\n\t\tSELECT * \n\t\tFROM iShark_Newsletter_Users \n\t\tWHERE is_active = '1' AND is_deleted = '0' AND activate = '' AND email = '" . $_REQUEST['email'] . "'\n\t";
    $result =& $mdb2->query($query);
    if ($result->numRows() > 0) {
        $site_errors[] = array('text' => $locale->get('error_email_exists'), 'link' => 'javascript:history.back(-1)');
        return;
    } else {
        //TODO - siman, csak e-mail cim alapjan ne irjuk fel hirlevelre, kelljen hozza egy aktivalas is
        //TODO - megcsinlani a kulon hirlevel feliratkozas block-ot is
Example #5
0
$module_name = "settings";
//nyelvi file betoltese
$locale->useArea("admin_" . $module_name);
// Cím beállítása
$title_module = array('title' => $locale->get('title'));
//ezek az elfogadhato muveleti hivasok ($_REQUEST['act'])
$is_act = array('lst');
//breadcrumb
$breadcrumb->add($title_module['title'], 'admin.php?p=settings');
//jogosultsag ellenorzes
if (isset($_REQUEST['act']) && in_array($_REQUEST['act'], $is_act)) {
    $act = $_REQUEST['act'];
} else {
    $act = "lst";
}
if (!check_perm($act, '', 1, 'settings')) {
    $acttpl = 'error';
    $tpl->assign('errormsg', $locale->get('error_permission_denied'));
    return;
}
$tpl->assign('self', $module_name);
$tpl->assign('title_module', $title_module);
if (isset($_GET['file'])) {
    include_once 'admin/settings/' . $_GET['file'];
} else {
    if ($act == "lst") {
        //lekerdezzuk es kiirjuk a rendszerben talalhato fooldali modulokat
        $query = "\n\t\t\tSELECT DISTINCT m.module_id AS mid, m.module_name AS mname, m.file_name AS mfname, m.file_ext AS mfext, \n\t\t\t\tm.description AS mdesc, m.is_active AS mactive, m.type AS mtypem \n\t\t\tFROM iShark_Modules AS m \n\t\t\tWHERE m.is_active = 1 \n\t\t\tGROUP BY m.file_name \n\t\t\tORDER BY m.module_name\n\t\t";
        $result = $mdb2->query($query);
        //ha ures a lista, akkor uzenet
        if ($result->numRows() != 0) {
Example #6
0
// fulek definialasa
$tabs = array('flats' => $locale->get('tabs_title'));
$acts = array('flats' => array('lst', 'mod'));
//aktualis ful beallitasa
$page = 'flats';
if (isset($_REQUEST['act']) && array_key_exists($_REQUEST['act'], $tabs)) {
    $page = $_REQUEST['act'];
}
$sub_act = 'lst';
if (isset($_REQUEST['sub_act']) && in_array($_REQUEST['sub_act'], $acts[$page])) {
    $sub_act = $_REQUEST['sub_act'];
}
//breadcrumb
$breadcrumb->add($title_module['title'], 'admin.php?p=' . $module_name);
//jogosultsag ellenorzes
if (!check_perm($page, 0, 0, $module_name) || $sub_act != 'lst' && !check_perm($page . '_' . $sub_act, 0, 1, $module_name)) {
    $acttpl = 'error';
    $tpl->assign('errormsg', $locale->get('error_no_permission'));
    return;
}
$tpl->assign('self', $module_name);
$tpl->assign('title_module', $title_module);
$tpl->assign('this_page', $page);
$tpl->assign('dynamic_tabs', $tabs);
/**
 * a hozzadas vagy modositas reszhez tartozo quickform kozos beallitasa
 */
if ($sub_act == "mod") {
    require_once 'HTML/QuickForm.php';
    require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
    $titles = array('add' => $locale->get('main_title_add'), 'mod' => $locale->get('main_title_mod'));
Example #7
0
//nyelvi file betoltese
$locale->useArea($module_name);
//ezek az elfogadhato muveleti hivasok ($_REQUEST['act'])
$is_act = array('ins', 'unins', 'mod');
$menu_id = 0;
//menu azonosito vizsgalata
if (isset($_GET['mid'])) {
    $menu_id = intval($_GET['mid']);
}
//jogosultsag ellenorzes
if (isset($_REQUEST['act']) && in_array($_REQUEST['act'], $is_act)) {
    $act = $_REQUEST['act'];
} else {
    $act = "lst";
}
if (!check_perm($act, $menu_id, 1, 'settings')) {
    $acttpl = 'error';
    $tpl->assign('errormsg', $locale->get('error_no_permission'));
    return;
}
/**
 *ha modositjuk a beallitasokat
 */
if ($act == "mod") {
    require_once 'HTML/QuickForm.php';
    require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
    $form =& new HTML_QuickForm('frm_polls', 'post', 'admin.php?p=settings&file=' . $_GET['file']);
    $form->removeAttribute('name');
    $form->setRequiredNote($locale->get('form_required_note'));
    $form->addElement('header', $locale->get('form_header'));
    $form->addElement('hidden', 'act', $act);
Example #8
0
    $fieldorder = "ORDER BY fb.form_title";
    $order = "ASC";
}
if (isset($_GET['pageID']) && is_numeric($_GET['pageID'])) {
    $page_id = intval($_GET['pageID']);
} else {
    $page_id = 1;
}
$tpl->assign('fieldselect1', $fieldselect1);
$tpl->assign('fieldselect2', $fieldselect2);
$tpl->assign('ordselect1', $ordselect1);
$tpl->assign('ordselect2', $ordselect2);
$tpl->assign('page_id', $page_id);
//rendezes vege
//jogosultsag ellenorzes
if (!check_perm($act, NULL, 1, 'form_builder')) {
    $acttpl = 'error';
    $tpl->assign('errormsg', $locale->get('error_no_permission'));
    return;
}
if ($act == "add" || $act == "mod") {
    //js beszurasa
    $javascripts[] = "javascripts";
    require_once 'HTML/QuickForm.php';
    require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
    require_once $include_dir . '/function.check.php';
    $titles = array('add' => $locale->get('title_add'), 'mod' => $locale->get('title_mod'));
    $form =& new HTML_QuickForm('frm_forms', 'post', 'admin.php?p=' . $module_name);
    $form->setRequiredNote($locale->get('form_required_note'));
    $form->addElement('header', $locale->get('form_header'));
    $form->addElement('hidden', 'field', $field);
Example #9
0
if (!eregi("index.php", $_SERVER['SCRIPT_NAME'])) {
    die("Közvetlenül nem lehet az állományhoz hozzáférni...");
}
$module_name = "polls";
//nyelvi file betoltese
$locale->useArea($module_name);
$tpl->assign('self', $module_name);
//ezek az elfogadhato muveleti hivasok ($_REQUEST['act'])
$is_act = array('lst');
//jogosultsag ellenorzes
if (isset($_REQUEST['pact']) && in_array($_REQUEST['pact'], $is_act)) {
    $pact = $_REQUEST['pact'];
} else {
    $pact = "lst";
}
if (!check_perm($pact, '', 0, $module_name)) {
    $acttpl = 'error';
    $tpl->assign('errormsg', $locale->get('error_no_premission'));
    return;
}
//lekerdezzuk a modulhoz tartozo beallitasokat
$query = "\n\tSELECT * \n\tFROM iShark_Polls_Configs\n";
$result = $mdb2->query($query);
while ($row = $result->fetchRow()) {
    $poll_captcha = $row['captcha'];
    $poll_ismenu = $row['is_menu'];
    $poll_reuse = $row['reuse_time'];
    $poll_oldpoll = $row['oldpoll_view'];
}
//lekerdezzuk az idozitett szavazasokat, ha lejart az idozites, akkor lezarjuk oket
$query = "\n\tSELECT p.poll_id AS pid \n\tFROM iShark_Polls p \n\tWHERE p.is_active = 1 AND p.end_date != '0000-00-00 00:00:00' AND p.timer_start != '0000-00-00 00:00:00' AND p.timer_end < NOW()\n";
Example #10
0
 function create_user()
 {
     if ($_POST) {
         $this->load->model('dx_auth/users', 'user2');
         $val = $this->form_validation;
         $val->set_rules('username', lang('Login', 'user_manager'), 'trim|required|xss_clean');
         $val->set_rules('password', lang('Password', 'user_manager'), 'trim|min_length[' . $this->config->item('DX_login_min_length') . ']|max_length[' . $this->config->item('DX_login_max_length') . ']|required|xss_clean');
         $val->set_rules('password_conf', lang('Confirm the password', 'user_manager'), 'matches[password]|required');
         $val->set_rules('email', lang('E-Mail', 'user_manager'), 'trim|required|xss_clean|valid_email');
         $val->set_rules('phone', lang('Phone', 'user_manager'), 'trim');
         ($hook = get_hook('users_create_set_val_rules')) ? eval($hook) : NULL;
         $user = $this->input->post('username');
         $email = $this->input->post('email');
         $role = $this->input->post('role');
         // check user mail
         if ($this->user2->check_email($email)->num_rows() > 0) {
             showMessage(lang('User with the same e-mail has been registered', 'user_manager'), '', 'r');
             exit;
         }
         if (!check_perm('user_create') and !check_perm('user_create_all_roles')) {
             //cp_check_perm('user_create');
         }
         //            if (!check_perm('user_create_all_roles')) {
         //                $role = $this->dx_auth->get_role_id();
         //            }
         $this->load->helper('string');
         if ($val->run() and $user_info = $this->dx_auth->register($val->set_value('username'), $val->set_value('password'), $val->set_value('email'), '', random_string('alnum', 5), $this->input->post('phone'), false)) {
             //set user role
             $user_info = $this->user2->get_user_by_email($user_info['email'])->row_array();
             $this->user2->set_role($user_info['id'], $role);
             $this->lib_admin->log(lang('Create a user or the username has been created', 'user_manager') . ' <a href="' . site_url('/admin/components/cp/user_manager/edit_user/' . $user_info['id']) . '">' . $val->set_value('username') . '</a>');
             showMessage(lang('Username has been created or user has been created', 'user_manager'));
             $action = $_POST['action'];
             if ($action == 'close') {
                 pjax('/admin/components/cp/user_manager/edit_user/' . $user_info['id']);
             } else {
                 pjax('/admin/components/init_window/user_manager');
             }
         } else {
             $fields = array('username', 'password', 'password_conf', 'email', 'phone');
             $script = "<script type=\"text/javascript\">";
             foreach ($fields as $field) {
                 $error = $val->error($field);
                 if (!empty($error)) {
                     $script .= "showError('{$field}','{$error}'); ";
                 }
             }
             $script .= "</script>";
             echo $script;
         }
     }
     $this->set_tpl_roles();
     if (!$this->ajaxRequest) {
         $this->template->registerJsFile('templates/administrator/js/jquery.maskedinput-1.3.min.js', 'after');
         $this->template->registerJsFile('application/modules/user_manager/templates/js/create.js', 'after');
         $this->display_tpl('create_user');
     }
 }
Example #11
0
     if ($admin_grant == 1) {
         if (check_perm('guestbook_ena', '', 1, $module_name, 'index') === false) {
             $query .= "\n\t\t\t\t\tWHERE g.is_enabled = '1'\n\t\t\t\t";
         } else {
             $is_enable_link = "index.php?p=" . $module_name . "&amp;act=guestbook_ena&amp;gid=";
         }
     }
     $query .= "\n\t\t\tORDER BY g.guestbook_id DESC\n\t\t";
     //ha van torles joga
     $is_delete_link = "";
     if (check_perm('guestbook_del', '', 1, $module_name, 'index') === true) {
         $is_delete_link = "index.php?p=" . $module_name . "&amp;act=guestbook_del&amp;gid=";
     }
     //ha van valasz joga
     $is_reply_link = "";
     if (check_perm('guestbook_rep', '', 1, $module_name, 'index') === true) {
         $is_reply_link = "index.php?p=" . $module_name . "&amp;act=guestbook_rep&amp;gid=";
     }
     require_once 'Pager/Pager.php';
     $paged_data = Pager_Wrapper_MDB2($mdb2, $query, $pagerOptions);
     //atadjuk a smarty-nak a kiirando cuccokat
     $tpl->assign('page_data', $paged_data['data']);
     $tpl->assign('page_list', $paged_data['links']);
     $tpl->assign('total', $paged_data['totalItems']);
     $tpl->assign('self', $module_name);
     $tpl->assign('is_enable_link', $is_enable_link);
     $tpl->assign('is_delete_link', $is_delete_link);
     $tpl->assign('is_reply_link', $is_reply_link);
     //megadjuk a tpl file nevet, amit atadunk az admin.php-nek
     $acttpl = 'guestbook_list';
 }
Example #12
0
/**
 * is_addright 
 * 
 * @access public
 * @return void
 */
function is_addright()
{
    global $settings, $menu_id;
    $is_addright = FALSE;
    if (isset($_SESSION['user_id'])) {
        if ($settings['admin_addtopic'] == '1') {
            $is_addright = check_perm('add', $menu_id, 1, 'forum', 'index');
        } else {
            $is_addright = TRUE;
        }
    }
    return $is_addright;
}
Example #13
0
}
if (isset($_GET['pageID']) && is_numeric($_GET['pageID'])) {
    $page_id = intval($_GET['pageID']);
} else {
    $page_id = 1;
}
$tpl->assign('fieldselect1', $fieldselect1);
$tpl->assign('fieldselect2', $fieldselect2);
$tpl->assign('fieldselect3', $fieldselect3);
$tpl->assign('fieldselect4', $fieldselect4);
$tpl->assign('ordselect1', $ordselect1);
$tpl->assign('ordselect2', $ordselect2);
$tpl->assign('page_id', $page_id);
//rendezes vege
//jogosultsag ellenorzes
if (!check_perm($act, NULL, 1, 'modules')) {
    $acttpl = 'error';
    $tpl->assign('errormsg', $strErrorPermission);
    return;
}
/**
 * ha aktivaljuk valamelyik modult
 */
if ($act == "act") {
    include_once $include_dir . '/function.check.php';
    $mid = intval($_GET['m_id']);
    check_active('iShark_Modules', 'module_id', $mid);
    //loggolas
    logger($act, NULL, '');
    header('Location: admin.php?p=modules&field=' . $field . '&ord=' . $ord);
    exit;
Example #14
0
    $tpl->assign('act_dir', $gallery['name']);
    $tpl->assign('dirlist', $dirlist);
    $tpl->assign('lang_title', $locale->get('title_ftp_upload'));
    $tpl->assign('back_arrow', 'admin.php?p=' . $module_name . '&act=' . $page . '&sub_act=plst&gid=' . $gid);
    $acttpl = 'gallery_ftp';
}
/**
 * képek listázása 
 */
if ($sub_act == 'plst') {
    // Galériához tartozó képek lekérdezése
    $query = "\n\t\tSELECT P.*, GP.orders\n\t\tFROM iShark_Galleries_Pictures GP\n\t\tLEFT JOIN iShark_Pictures P ON GP.picture_id = P.picture_id\n\t\tWHERE GP.gallery_id = {$gid}\n\t\tORDER BY GP.orders\n\t";
    include_once 'Pager/Pager.php';
    $paged_data = Pager_Wrapper_MDB2($mdb2, $query, $pagerOptions);
    $paged_data2 = Pager_Wrapper_MDB2($mdb2, $query, $pagerOptions);
    if ($_SESSION['site_gallery_is_ftpdir'] == '1' && check_perm($page . '_' . $sub_act, NULL, 1, $module_name)) {
        $tpl->assign('is_ftp', TRUE);
    }
    $add_new = array(array('link' => 'admin.php?p=' . $module_name . '&amp;act=' . $page . '&amp;sub_act=upl&amp;gid=' . $gid, 'title' => $locale->get('title_upload'), 'pic' => 'add.jpg'));
    if (!empty($_SESSION['site_gallery_is_ftpdir'])) {
        $add_new[] = array('link' => 'admin.php?p=' . $module_name . '&amp;act=' . $page . '&amp;sub_act=ftp&amp;gid=' . $gid, 'title' => $locale->get('title_ftp_upload'), 'pic' => 'ftpgallery.jpg');
    }
    //breadcrumb
    $breadcrumb->add($locale->get('tabs_title_piclist'), '#');
    $tpl->assign('add_new', $add_new);
    $tpl->assign('lang_title', $locale->get('tabs_title_piclist') . ' (' . $gallery['name'] . ')');
    $tpl->assign('page_data', $paged_data['data']);
    $tpl->assign('page_list', $paged_data['links']);
    $acttpl = 'gallery_pics';
}
// Galéria törlése
Example #15
0
        if ($elements[0] == "delete" && ADMIN) {
            $sql->db_Delete("wiki", "page_title='" . $row['page_title'] . "' ");
            Header("Location: ./");
        }
    }
} elseif (!isset($_GET['page'])) {
    // list of last 10 pages added or modified
    $title = LAN_W_3;
    $sql->db_Select("wiki", "*", "page_active = 1 ORDER BY page_datestamp DESC LIMIT 0,10", true);
    $content = make_links($sql->db_getList());
} else {
    $page = mysql_real_escape_string($_GET['page']);
    $count = $sql->db_Select("wiki", "*", "page_title = '" . $page . "' and page_active=1", true);
    if ($count > 0) {
        // Page does exists
        $row = $sql->db_Fetch();
        $title = $row['page_title'];
        $content = make_content($row);
        $has_page = $row['page_id'];
    } elseif (check_perm()) {
        $title = "New Page";
        $content = "" . page_form(array());
    } else {
        // Page not found
        $title = LAN_W_1;
        $content = LAN_W_2;
    }
}
require_once HEADERF;
$ns->tablerender($title, $content . make_footer($has_page));
require_once FOOTERF;
Example #16
0
    die("Közvetlenül nem lehet az állományhoz hozzáférni...");
}
//modul neve
$module_name = "news";
//nyelvi file betoltese
$locale->useArea("index_" . $module_name);
$tpl->assign('self_news', $module_name);
//ezek az elfogadhato muveleti hivasok ($_REQUEST['act'])
$is_act = array('lst', 'show');
if (isset($_REQUEST['act']) && in_array($_REQUEST['act'], $is_act)) {
    $act = $_REQUEST['act'];
} else {
    $act = "lst";
}
//jogosultsag ellenorzes
if (!check_perm($act, NULL, 0, $module_name, 'index')) {
    $site_errors[] = array('text' => $locale->get('error_no_permission'), 'link' => 'javascript:history.back(-1)');
    return;
}
//lekerdezzuk a tartalomszerkesztohoz tartozo beallitasokat
$query_contents_config = "\n\tSELECT is_send_reg \n\tFROM iShark_Contents_Configs\n";
$result_contents_config =& $mdb2->query($query_contents_config);
if (!PEAR::isError($result_contents_config)) {
    $row_configs = $result_contents_config->fetchRow();
} else {
    $site_errors[] = array('text' => $locale->get('error_no_config_table'), 'link' => 'javascript:history.back(-1)');
    return;
}
/**
 * ertekeles
 */
Example #17
0
	";
	$mdb2->exec($query);
	//loggolas
	logger('unins', $menu_id);

	header('Location: admin.php?mid='.$menu_id);
	exit;
}
*/
//jogosultsag ellenorzes
if (isset($_REQUEST['act']) && in_array($_REQUEST['act'], $is_act)) {
    $act = $_REQUEST['act'];
} else {
    $act = "lst";
}
if (!check_perm($act, $menu_id, 1)) {
    $acttpl = 'error';
    $tpl->assign('errormsg', $strErrorPermission);
    return;
}
/**
 * ha modositjuk
 */
if ($act == "mod") {
    require_once 'HTML/QuickForm.php';
    require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
    $form =& new HTML_QuickForm('frm_guestbook', 'post', 'admin.php?mid=' . $menu_id . '&file=' . $_GET['file']);
    $form->setRequiredNote($strAdminForumRequired);
    $form->addElement('header', $strAdminForumHeader);
    $form->addElement('hidden', 'act', 'mod');
    $radio1 = array();
function recursiveDirList($dir, $prefix = '')
{
    $dir = rtrim($dir, '/');
    $result = array();
    foreach (glob("{$dir}/*", GLOB_MARK) as $f) {
        #print "\nDEBUG: $f\n";
        check_perm($f);
        if (substr($f, -1) === '/') {
            $result = array_merge($result, recursiveDirList($f, $prefix . basename($f) . '/'));
        } else {
            $patterns = array("php\$", "js\$");
            $regex = '/(' . implode('|', $patterns) . ')/i';
            if (preg_match($regex, $f)) {
                if (substr(decoct(fileperms($f)), -3) !== '000') {
                    $result[] = $prefix . basename($f);
                    #print ".";
                }
            }
        }
    }
    return $result;
}
Example #19
0
        $site_errors[] = array('text' => $locale->get('main_error_notexists'), 'link' => 'javascript:history.back(-1)');
        return;
    }
    //ajax-hoz szukseges infok - ha vasarolhatnak a userek
    if (!empty($_SESSION['site_shop_userbuy'])) {
        $ajax['link'] = "ajax.php?client=all&stub=all";
        $ajax['script'] = "\n    \t\tfunction bsksend(id, name, price, attr) {\n    \t\t\tamount = document.getElementById('amount_'+id).value;\n    \t\t\tvar attrs = new Array();\n    \t\t\tfor(i = 1; i <= attr; i++) {\n    \t\t\t\tattributes = document.getElementById('attr_select_'+i);\n    \t\t\t\tattrs += '&attrs['+i+']['+attributes.name+'] = '+attributes.value;\n    \t\t\t}\n    \t\t\tHTML_AJAX.replace('target_'+id,'ajax.php?act=basket&pid='+id+'&amount='+amount+attrs);\n    \t\t\tHTML_AJAX.append('bsktarget','ajax.php?act=bskblock&name='+name+'&amount='+amount+'&price='+price);\n    \t\t}\n    \t";
    }
    //megadjuk a tpl file nevet, amit atadunk az admin.php-nek
    $acttpl = 'shop_product';
}
//termek adatlap vege
/**
 * ha megjegyzest akarjuk torolni
 */
if ($act == "delcom" && check_perm('delcom', NULL, 1, 'shop', 'index') && isset($_SESSION['site_shop_is_rating']) && $_SESSION['site_shop_is_rating'] == 1) {
    if (isset($_GET['rid']) && is_numeric($_GET['rid']) && isset($_GET['pid']) && is_numeric($_GET['pid'])) {
        $rid = intval($_GET['rid']);
        $pid = intval($_GET['pid']);
        if (isset($_GET['cid']) && is_numeric($_GET['cid'])) {
            $cid = intval($_GET['cid']);
        } else {
            $cid = "";
        }
        $query = "\n\t\t\tDELETE FROM iShark_Shop_Products_Rating \n\t\t\tWHERE rating_id = {$rid}\n\t\t";
        $mdb2->exec($query);
        header('Location: index.php?p=' . $module_name . '&act=prd&cid=' . $cid . '&pid=' . $pid);
        exit;
    }
}
/**
Example #20
0
$tpl->assign('page_id', $page_id);
$tpl->assign('self', $module_name);
$tpl->assign('title_module', $title_module);
//rendezes vege
//megnezzuk, hogy az azonosito alapjan milyen felhasznalot akar lekerdezni
$admin_user = 0;
if (isset($_REQUEST['uid']) && is_numeric($_REQUEST['uid'])) {
    $uid = intval($_REQUEST['uid']);
    $query = "\n\t\tSELECT * \n\t\tFROM iShark_Groups_Users \n\t\tWHERE user_id = {$uid} AND group_id = " . $_SESSION['site_sys_prefgroup'] . "\n\t";
    $result =& $mdb2->query($query);
    if ($result->numRows() > 0) {
        $admin_user = 1;
    }
}
//jogosultsag ellenorzes
if (!check_perm($act, NULL, 1, $module_name) || $admin_user == 1 && $is_admin == 0) {
    $acttpl = 'error';
    $tpl->assign('errormsg', $locale->get('error_no_permission'));
    return;
}
$group_get = "";
/**
 * a hozzadas vagy modositas reszhez tartozo quickform kozos beallitasa
 */
if ($act == "add" || $act == "mod") {
    //szukseges fuggvenykonyvtarak betoltese
    require_once 'HTML/QuickForm.php';
    require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
    require_once $include_dir . '/function.check.php';
    $titles = array('add' => $locale->get('title_add'), 'mod' => $locale->get('title_mod'));
    //elinditjuk a form-ot
Example #21
0
//nyelvi file betoltese
$locale->useArea("index_" . $module_name);
$tpl->assign('self', $module_name);
//ezek az elfogadhato muveleti hivasok ($_REQUEST['act'])
$is_act = array('lst');
//menu azonosito vizsgalata
if (isset($_GET['mid'])) {
    $menu_id = intval($_GET['mid']);
}
//jogosultsag ellenorzes
if (isset($_REQUEST['act']) && in_array($_REQUEST['act'], $is_act)) {
    $act = $_REQUEST['act'];
} else {
    $act = "lst";
}
if (!check_perm($act, NULL, 0, 'downloads', 'index')) {
    $acttpl = 'error';
    $tpl->assign('errormsg', $locale->get('error_no_permission'));
    return;
}
//modulhoz tartozo beallitasok lekerdezese
$query = "\n\tSELECT c.is_ftpdir AS isftp, c.ftpdir AS fdir, c.downdir AS ddir, c.maxdir AS mdir, c.allow_filetypes AS types, \n\t\tc.maxsize AS msize \n\tFROM iShark_Configs c\n";
$result = $mdb2->query($query);
while ($row = $result->fetchRow()) {
    $isftp = $row['isftp'];
    $fdir = $row['fdir'];
    $ddir = $row['ddir'];
    $mdir = $row['mdir'];
    $types = $row['types'];
    $msize = $row['msize'];
}
Example #22
0
    die("Közvetlenül nem lehet az állományhoz hozzáférni...");
}
//modul neve
$module_name = "system";
$locale->useArea("admin_" . $module_name);
//ezek az elfogadhato muveleti hivasok ($_REQUEST['act'])
$is_act = array('mod');
//ezek az elfogadhato almuveleti hivasok ($_REQUEST['type'])
$is_type = array('sys', 'cont', 'mce', 'dwn', 'gal', 'ban', 'sho', 'partners', 'builder', 'stat', 'class');
//jogosultsag ellenorzes
if (isset($_REQUEST['act']) && in_array($_REQUEST['act'], $is_act)) {
    $act = $_REQUEST['act'];
} else {
    $act = "lst";
}
if (!check_perm($act, NULL, 1, 'system')) {
    $acttpl = 'error';
    $tpl->assign('errormsg', $locale->get('error_no_permission'));
    return;
}
if (isset($_REQUEST['type']) && in_array($_REQUEST['type'], $is_type)) {
    require_once 'HTML/QuickForm.php';
    require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
    $form =& new HTML_QuickForm('frm_system', 'post', 'admin.php?p=system');
    $form->setRequiredNote($locale->get('form_required_note'));
    $form->addElement('header', 'system', $locale->get('form_header'));
    $form->addElement('hidden', 'act', 'mod');
    $form->addElement('hidden', 'type', $_REQUEST['type']);
    /**
     * a rendszer alapbeallitasai
     */
Example #23
0
            $renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl, true);
            $form_comment->accept($renderer);
            $tpl->assign('form_comment', $renderer->toArray());
            // capture the array stucture
            ob_start();
            print_r($renderer->toArray());
            $tpl->assign('static_array', ob_get_contents());
            ob_end_clean();
            $acttpl = "comments_add";
        } else {
            $site_errors[] = array('text' => $locale->get('error_no_writeperm'), 'link' => 'javascript:history.back(-1)');
            return;
        }
    } else {
        $site_errors[] = array('text' => $locale->get('error_flooding'), 'link' => 'javascript:history.back(-1)');
        return;
    }
} else {
    $query = "\n\t\tSELECT c.comment_id AS comment_id, c.add_date AS add_date, c.comment AS comment, c.premise AS premise, \n\t\t\t(CASE c.user_id \n\t\t\t\tWHEN '0' THEN c.name\n\t\t\t\tELSE u.name\n\t\t\t\tEND\n\t\t\t) AS name\n\t\tFROM iShark_Comments c \n\t\tLEFT JOIN iShark_Users u ON u.user_id = c.user_id \n\t\tWHERE c.id = {$back_comment_id} AND module_name = '" . $back_comment_module . "' \n\t\tORDER BY c.add_date DESC\n\t";
    $result =& $mdb2->query($query);
    if ($result->numRows() > 0) {
        $tpl->assign('news_comment', $result->fetchAll('', $rekey = true));
    }
    //par valtozot at kell adnunk smarty-nak, mert ettol fuggoen rakjuk ki az uj hozzaszolas, modositas, torles gombot
    $tpl->assign('is_user_reg', $row_comments['is_user_reg']);
    $tpl->assign('is_newscomment_modify', check_perm('comments_mod', NULL, 1, $module_name, 'index'));
    $tpl->assign('is_newscomment_delete', check_perm('comments_del', NULL, 1, $module_name, 'index'));
    $tpl->assign('back_module', $back_comment_module);
    $tpl->assign('back_id', $back_comment_id);
    $tpl->assign('back_link', $back_comment_link);
}
Example #24
0
    $tpl->assign('act_dir', $gallery['name']);
    $tpl->assign('dirlist', $dirlist);
    $tpl->assign('lang_title', $locale->get('title_ftp_upload'));
    $tpl->assign('back_arrow', 'admin.php?p=' . $module_name . '&act=' . $page . '&sub_act=plst&gid=' . $gid);
    $acttpl = 'gallery_ftp';
}
/**
 * képek listázása 
 */
if ($sub_act == 'plst') {
    // Galériához tartozó képek lekérdezése
    $query = "\n\t\tSELECT P.* \n\t\tFROM iShark_Galleries_Pictures GP\n\t\tLEFT JOIN iShark_Pictures P ON GP.picture_id = P.picture_id\n\t\tWHERE GP.gallery_id = {$gid}\n\t\tORDER BY name\n\t";
    include_once 'Pager/Pager.php';
    $paged_data = Pager_Wrapper_MDB2($mdb2, $query, $pagerOptions);
    $paged_data2 = Pager_Wrapper_MDB2($mdb2, $query, $pagerOptions);
    if ($_SESSION['site_gallery_is_ftpdir'] == '1' && check_perm('ftp', NULL, 1, $module_name)) {
        $tpl->assign('is_ftp', TRUE);
    }
    $add_new = array(array('link' => 'admin.php?p=' . $module_name . '&amp;act=' . $page . '&amp;sub_act=upl&amp;gid=' . $gid, 'title' => $locale->get('video_title_upload'), 'pic' => 'add.jpg'));
    if (!empty($_SESSION['site_gallery_is_ftpdir'])) {
        $add_new[] = array('link' => 'admin.php?p=' . $module_name . '&amp;act=' . $page . '&amp;sub_act=ftp&amp;gid=' . $gid, 'title' => $locale->get('video_title_ftp_upload'), 'pic' => 'ftpgallery.jpg');
    }
    //breadcrumb
    $breadcrumb->add($locale->get('video_tabs_title_piclist'), '#');
    $tpl->assign('add_new', $add_new);
    $tpl->assign('lang_title', $locale->get('video_tabs_title_piclist') . ' (' . $gallery['name'] . ')');
    $tpl->assign('page_data', $paged_data['data']);
    $tpl->assign('page_list', $paged_data['links']);
    $acttpl = 'gallery_video';
}
// Galéria törlése
Example #25
0
$locale->useArea($module_name);
//design-hoz a cim betoltese
$title_module = array('title' => $locale->get('title'));
$tpl->assign('title_module', $title_module);
$tpl->assign('self', $module_name);
//breadcrumb
$breadcrumb->add($title_module['title'], 'admin.php?p=' . $module_name);
// ezek a megengedett muveletek
$is_act = array('add', 'mod', 'del', 'lst', 'act', 'res', 'ins', 'unins');
//jogosultsag ellenorzes
if (isset($_REQUEST['act']) && in_array($_REQUEST['act'], $is_act)) {
    $act = $_REQUEST['act'];
} else {
    $act = "lst";
}
if (!check_perm($act, NULL, 1, $module_name)) {
    $acttpl = 'error';
    $tpl->assign('errormsg', $locale->get('error_no_permission'));
    return;
}
//modulhoz tartozo beallitasok lekerdezese
$query = "\n\tSELECT pc.is_menu AS ismenu \n\tFROM iShark_Polls_Configs pc\n";
$result = $mdb2->query($query);
while ($row = $result->fetchRow()) {
    $ismenu = $row['ismenu'];
}
require_once $include_dir . '/function.polls.php';
/**
 * ha telepitjuk a modult
 */
if ($act == "ins") {
Example #26
0
                return true;
            }
        }
    }
}
/* здесь  перепроверка каталогов и вывод где ошибка */
check_perm($config['working_dir'], 1);
check_perm($config['working_thumb_dir'], 1);
check_perm($config['uploaddir'], 1);
check_perm($config['thumbdir'], 1);
//если старый конфиг не содержит IniFile
if (!isset($IniFile) and isset($config['working_dir'])) {
    $IniFile = $config['working_dir'] . 'config.ini';
    $OldConfigNoINI = 1;
}
check_perm($IniFile, 1);
preg_match('/\\/(.*\\/).*\\.php/', $_SERVER['PHP_SELF'], $out);
$folder_adm = isset($out[1]) ? $out[1] : '';
if (!isset($config['site_http_path']) || isset($config['site_http_path']) && $config['site_http_path'] != 'http://' . $_SERVER['HTTP_HOST'] . '/' . $folder_adm) {
    $config['site_http_path'] = 'http://' . $_SERVER['HTTP_HOST'] . '/' . $folder_adm;
}
//$config['site_url']='http://'.$_SERVER['HTTP_HOST'].'/'.$folder_adm;
//$config['thumbs_url']=$config['site_url'].'thumbs/';
//$config['img_url']=$config['site_url'].'img/';
if (!isset($debug)) {
    $debug = false;
}
$template = @file_get_contents($config['site_dir'] . '/admin/admin.tpl') or die('Template admin.tpl don\'t find.');
//проверка прав доступа к каталогам
$processUser = posix_getpwuid(posix_geteuid());
$uid = $processUser['uid'];