コード例 #1
0
ファイル: modules.php プロジェクト: sdgdsffdsfff/component-1
function getModules($new_path)
{
    $category = '';
    $items = array();
    if (isModule($new_path)) {
        $item = readPackage($new_path);
        $category = $item['category'];
        array_push($items, $item);
    } else {
        $new_list = scandir($new_path);
        $items = array();
        foreach ($new_list as $new_folder) {
            if (0 !== strpos($new_folder, '.')) {
                $new_new_path = $new_path . '/' . $new_folder;
                if (isModule($new_new_path)) {
                    $item = readPackage($new_new_path);
                    $category = $item['category'];
                    array_push($items, $item);
                }
            }
        }
    }
    return array('items' => $items, 'category' => $category);
}
コード例 #2
0
    }
    //ha lehet megjegyzest irni a hirekhez, akkor megszamoljuk hany megjegyzes van
    if (!empty($_SESSION['site_cnt_is_comment_news'])) {
        if (!empty($paged_data['data'])) {
            foreach ($paged_data['data'] as $key => $adat) {
                $comments = 0;
                $comment_query = "\n\t\t\t\t\tSELECT COUNT(comment_id) AS comments\n\t\t\t\t\tFROM iShark_Comments \n\t\t\t\t\tWHERE id = " . $adat['cid'] . " AND module_name = 'news'\n\t\t\t\t";
                $result_comment = $mdb2->query($comment_query);
                while ($row_comment = $result_comment->fetchRow()) {
                    $comments = $row_comment['comments'];
                }
                $paged_data['data'][$key]['comments'] = $comments;
            }
        }
    }
    //atadjuk a smarty-nak a kiirando cuccokat
    //$tpl->assign('page_data_news', $paged_data['data']);
    //$tpl->assign('page_list_news', $paged_data['links']);
    //megadjuk a tpl file nevet, amit atadunk az admin.php-nek
    $acttpl = 'news_list';
}
/**
 * megjegyzes a hirekhez
 */
if (!empty($_SESSION['site_cnt_is_comment_news']) && isModule('comments', 'index') && isset($_REQUEST['cid']) && is_numeric($_REQUEST['cid'])) {
    //megadjuk a valtozokat, amik kellenek a megjegyzesekhez
    $back_comment_module = $module_name;
    $back_comment_id = intval($_REQUEST['cid']);
    $back_comment_link = '&act=show&cid=' . $back_comment_id;
    include_once 'comments.php';
}
コード例 #3
0
            @unlink($_SESSION['site_class_advpicdir'] . '/' . $row2['picture']);
        }
        $query = "\n\t\t\tDELETE FROM iShark_Classifieds_Advert_Pictures \n\t\t\tWHERE advert_id = " . $row['advert_id'] . "\n\t\t";
        $mdb2->exec($query);
    }
    //hirdetes torlesenek vege
    require_once 'Mail/Queue.php';
    /* How many mails could we send each time the script is called */
    $max_amount_mails = 100;
    /* we use the db_options and mail_options from the config again  */
    $mail_queue =& new Mail_Queue($mail_queue_db_options, $mail_queue_mail_options);
    /* really sending the messages */
    $mail_queue->sendMailsInQueue($max_amount_mails);
}
//mti hirek beolvasas
if (isModule('contents', 'admin') && !empty($_SESSION['site_cnt_is_mti'])) {
    require_once 'XML/Parser.php';
    require_once 'XML/Parser/Simple.php';
    require_once $include_dir . '/MTI_News_XMLParser.php';
    $parser_counter = 1;
    $p =& new myParser();
    if ($xml = fopen($_SESSION['site_cnt_mti_link'], 'r')) {
        fclose($xml);
        $minta = array('/' . preg_quote('encoding="utf-8"', '/') . '/i', '/^\\xEF\\xBB\\xBF/');
        $csere = array('encoding="iso-8859-1"', '');
        $szoveg = preg_replace($minta, $csere, file_get_contents($_SESSION['site_cnt_mti_link']));
        // karakterkodolasok
        $out_char = strtoupper($locale->getCharset($tr_options['fallback']));
        $in_char = mb_detect_encoding($szoveg);
        if ($in_char != $out_char) {
            $szoveg = iconv($in_char, $out_char, $szoveg);
コード例 #4
0
ファイル: contents.php プロジェクト: span20/Kallay
// fulek definialasa
$tabs = array('news' => $locale->get('main_title_tab_news'), 'mti' => $locale->get('main_title_tab_mti'), 'content' => $locale->get('main_title_tab_contents'), 'category' => $locale->get('main_title_tab_category'), 'sendnews' => $locale->get('main_title_tab_sendnews'), 'mtinews' => $locale->get('main_title_tab_mtinews'));
//hireket lehet-e hasznalni
if (empty($_SESSION['site_is_news'])) {
    unset($tabs['news']);
}
//tartalmat lehet-e hasznalni
if (empty($_SESSION['site_is_other'])) {
    unset($tabs['content']);
}
//kategoriakat lehet-e hasznalni
if (empty($_SESSION['site_category'])) {
    unset($tabs['category']);
}
//bekuldott hirek
if (!isModule('sendnews', 'index')) {
    unset($tabs['sendnews']);
}
//mti hirek
if (empty($_SESSION['site_cnt_is_mti'])) {
    unset($tabs['mti']);
    unset($tabs['mtinews']);
}
$acts = array('news' => array('act', 'add', 'mod', 'del', 'restore', 'show'), 'content' => array('act', 'add', 'mod', 'del', 'restore', 'show'), 'category' => array('act', 'add', 'mod', 'del'), 'sendnews' => array('act', 'del', 'show'), 'mtinews' => array('act', 'del', 'show'), 'mti' => array('act', 'mod', 'del'));
$tabok = array_keys($tabs);
$page = $tabok[0];
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])) {
コード例 #5
0
ファイル: functions.php プロジェクト: span20/Kallay
/**
 * getMetaTags - meta description, meta keywords adatokat adja vissza
 * 
 * @param integer   menu azonosito
 * 
 * @return void
 */
function getMetaTags($mid = NULL)
{
    global $mdb2;
    $meta = array();
    //fooldal
    if ($mid == NULL) {
        $meta['description'] = $_SESSION['site_sys_meta_description'];
        $meta['keywords'] = $_SESSION['site_sys_meta_keywords'];
    }
    //ha a menu_id nem NULL es engedelyezve van a modul
    if ($mid != NULL && isModule('searchwords', 'admin')) {
        $query = "\n\t\t\tSELECT description, keywords \n\t\t\tFROM iShark_Searchwords \n\t\t\tWHERE menu_id = {$mid}\n\t\t";
        $result =& $mdb2->query($query);
        if ($result->numRows() > 0) {
            $row = $result->fetchRow();
            $meta['description'] = $row['description'];
            $meta['keywords'] = $row['keywords'];
        } else {
            $query = "\n\t\t\t\tSELECT description, keywords \n\t\t\t\tFROM iShark_Searchwords \n\t\t\t\tWHERE menu_id = 0\n\t\t\t";
            $result =& $mdb2->query($query);
            if ($result->numRows() > 0) {
                $row = $result->fetchRow();
                if (!empty($row['description'])) {
                    $meta['description'] = $row['description'];
                } else {
                    $meta['description'] = $_SESSION['site_sys_meta_description'];
                }
                if (!empty($row['keywords'])) {
                    $meta['keywords'] = $row['keywords'];
                } else {
                    $meta['keywords'] = $_SESSION['site_sys_meta_keywords'];
                }
            } else {
                $meta['description'] = $_SESSION['site_sys_meta_description'];
                $meta['keywords'] = $_SESSION['site_sys_meta_keywords'];
            }
        }
    }
    return $meta;
}
コード例 #6
0
         $_SESSION['user_realname'] = $row['realname'];
         //ha nem ures az activate es a lost_password mezo, akkor toroljuk a tartalmukat
         if ($row['uact'] != "" || $row['lpass'] != "") {
             $query = "\n\t\t\t\t\t\tUPDATE iShark_Users \n\t\t\t\t\t\tSET activate      = '', \n\t\t\t\t\t\t\tlost_password = '' \n\t\t\t\t\t\tWHERE user_id = '" . $_SESSION['user_id'] . "'\n\t\t\t\t\t";
             $result = $mdb2->query($query);
         }
         //lekerdezzuk a user csoportjait
         $query = "\n\t\t\t\t\tSELECT group_id \n\t\t\t\t\tFROM iShark_Groups_Users \n\t\t\t\t\tWHERE user_id = '" . $_SESSION['user_id'] . "'\n\t\t\t\t";
         $result = $mdb2->query($query);
         $groups = "";
         while ($row = $result->fetchRow()) {
             $groups .= $row['group_id'] . " ";
         }
         $_SESSION['user_groups'] = trim($groups);
         //ha van shop modul, es a felhasznalok vasarolhatnak
         if (isModule('shop', 'index') === true && isset($_SESSION['site_shop_userbuy']) && $_SESSION['site_shop_userbuy'] == 1 && isset($_SESSION['user_id']) && is_numeric($_SESSION['user_id'])) {
             //lekerdezzuk, hogy a kosarban van-e a userhez tartozo termek
             $query = "\n\t\t\t\t\t\tSELECT basket_id \n\t\t\t\t\t\tFROM iShark_Shop_Basket \n\t\t\t\t\t\tWHERE session_id = '" . session_id() . "'\n\t\t\t\t\t";
             $result =& $mdb2->query($query);
             if ($result->numRows() > 0) {
                 while ($row = $result->fetchRow()) {
                     $basket_id = $row['basket_id'];
                     $query2 = "\n\t\t\t\t\t\t\t\tUPDATE iShark_Shop_Basket \n\t\t\t\t\t\t\t\tSET user_id = '" . $_SESSION['user_id'] . "' \n\t\t\t\t\t\t\t\tWHERE basket_id = '{$basket_id}'\n\t\t\t\t\t\t\t";
                     $mdb2->exec($query2);
                 }
             }
         }
     }
 } else {
     logger($act, '', $name . ": " . $locale->get('error_wrong_pass_log'));
     $site_errors[] = array('text' => $locale->get('error_wrong_pass'), 'link' => 'javascript:history.back(-1)');
コード例 #7
0
 }
 $form_shop->addFormRule('check_adduser');
 if ($form_shop->validate()) {
     $form_shop->applyFilter('__ALL__', array(&$mdb2, 'escape'));
     $name = $form_shop->getSubmitValue('name');
     $email = $form_shop->getSubmitValue('email');
     $user_name = $form_shop->getSubmitValue('user_name');
     $is_pmail = $ispublicmail->getChecked() ? '1' : '0';
     $password = md5($form_shop->getSubmitValue('pass1'));
     require_once "Text/Password.php";
     $activate = Text_Password::create(8, 'unpronounceable', 'alphanumeric');
     $user_id = $mdb2->extended->getBeforeID('iShark_Users', 'user_id', TRUE, TRUE);
     $query = "\n\t\t\t\tINSERT INTO iShark_Users \n\t\t\t\t(user_id, name, user_name, email, password, is_deleted, activate, is_active, is_public_mail, is_public)\n\t\t\t\tVALUES \n\t\t\t\t({$user_id}, '{$name}', '{$user_name}', '{$email}', '{$password}', '0', '{$activate}', '0', '{$is_pmail}', '1')\n\t\t\t";
     $mdb2->exec($query);
     // Hirlevel feliratkozas, ha aktiv a hirlevel modul
     if (isModule('newsletter') === true) {
         if ($subscribe_nl->getChecked()) {
             $query = "\n\t\t\t\t\t\tSELECT count(*) AS cnt \n\t\t\t\t\t\tFROM iShark_Newsletter_Users \n\t\t\t\t\t\tWHERE email = '{$email}'\n\t\t\t\t\t";
             $result =& $mdb2->query($query);
             if ($row = $result->fetchRow()) {
                 // Ha meg nem iratkozott fel a hirlevelre:
                 if ((int) $row['cnt'] == 0) {
                     $newsletter_user_id = $mdb2->extended->getBeforeID('iShark_Newsletter_Users', 'newsletter_user_id', TRUE, TRUE);
                     $query = "\n\t\t\t\t\t\t\t\tINSERT INTO iShark_Newsletter_Users \n\t\t\t\t\t\t\t\t(newsletter_user_id, name, email, activate, is_active, is_deleted)\n\t\t\t\t\t\t\t\tVALUES \n\t\t\t\t\t\t\t\t({$newsletter_user_id}, '{$name}', '{$email}', '{$activate}', '0', '0')\n\t\t\t\t\t\t\t";
                     $mdb2->exec($query);
                 }
             }
         }
     }
     //kikuldunk a megadott e-mail cimre egy levelet
     ini_set('display_errors', 0);
コード例 #8
0
ファイル: contents_mti.php プロジェクト: span20/Kallay
 if ($pic['picture'] != "") {
     @unlink($_SESSION['site_cnt_picdir'] . '/' . $pic['picture']);
 }
 //kitoroljuk a tartalmat
 $query = "\n\t\t\tDELETE FROM iShark_Contents \n\t\t\tWHERE content_id = {$cid}\n\t\t";
 $mdb2->exec($query);
 //a dokumentum elobbi verziojanak torlese
 $query = "\n\t\t\tDELETE FROM iShark_Contents_Versions \n\t\t\tWHERE parent_content_id = {$cid}\n\t\t";
 $mdb2->exec($query);
 //kitoroljuk a tartalom kategoria kapcsolotablabol
 if (isset($_SESSION['site_category']) && $_SESSION['site_category'] == 1) {
     $query = "\n\t\t\t\tDELETE FROM iShark_Contents_Category \n\t\t\t\tWHERE content_id = {$cid}\n\t\t\t";
     $mdb2->exec($query);
 }
 //kitoroljuk a tag kapcsolotablabol
 if (isset($_SESSION['site_cnt_is_tags']) && $_SESSION['site_cnt_is_tags'] == 1 && isModule('tags')) {
     $query = "\n\t\t\t\tDELETE FROM iShark_Tags_Modules\n\t\t\t\tWHERE module_name = 'news' and id = {$cid}\n\t\t\t";
     $mdb2->exec($query);
 }
 //kitoroljuk a tartalom ertekeles tablabol
 $query = "\n\t\t\tDELETE FROM iShark_Contents_Ratings \n\t\t\tWHERE content_id = {$cid}\n\t\t";
 $mdb2->exec($query);
 //kitoroljuk a tartalom hozzaszolas tablabol
 $query = "\n\t\t\tDELETE FROM iShark_Comments \n\t\t\tWHERE id = {$cid} AND module_name = 'news'\n\t\t";
 $mdb2->exec($query);
 //kitoroljuk a jogok tablabol
 $query = "\n\t\t\tSELECT r.right_id AS rid \n\t\t\tFROM iShark_Rights r \n\t\t\tWHERE r.content_id = {$cid}\n\t\t";
 $result = $mdb2->query($query);
 if ($result->numRows() > 0) {
     while ($row = $result->fethcRow()) {
         $right_id = $row['rid'];
コード例 #9
0
                $_REQUEST['form_id'] = $row_forms['af_id'];
                // hogy tudjuk hova kell visszadobni
                $backToCnt = "p=contents&cid=" . $content_id;
                include 'modules/forms.php';
            }
            $i++;
        }
        $tpl->assign('cnt_attach_form', $form_arr);
    }
    //kulso linkek
    if (!empty($_SESSION['site_cnt_is_attached_link'])) {
        $query_attached_link = "\n\t\t\tSELECT link, title\n\t\t\tFROM iShark_Contents_Links\n\t\t\tWHERE content_id = {$content_id}\n\t\t";
        $result_attached_link =& $mdb2->query($query_attached_link);
        $tpl->assign('cnt_attach_link', $result_attached_link->fetchAll('', $rekey = true));
    }
    $tpl->assign('self_contents', $module_name);
    $tpl->assign('content_backlink', 'javascript:history.back()');
    $acttpl = 'contents';
}
/**
 * megjegyzes a hirekhez
 * 
 * mivel menuponthoz is lehet csatolni, ezert kell vizsgalni a $content_id-t is
 */
if (!empty($_SESSION['site_cnt_is_comment_cnt']) && isModule('comments', 'index') && (isset($_REQUEST['cid']) && is_numeric($_REQUEST['cid']) || !empty($content_id))) {
    //megadjuk a valtozokat, amik kellenek a megjegyzesekhez
    $back_comment_module = $module_name;
    $back_comment_id = !empty($_REQUEST['cid']) ? intval($_REQUEST['cid']) : $content_id;
    $back_comment_link = '&act=lst&cid=' . $back_comment_id;
    include_once 'comments.php';
}
コード例 #10
0
$tpl->assign('site_errors', $site_errors);
$tpl->assign('site_success', $site_success);
//$banners = get_banners2();
//$tpl->assign("banners", get_banners2());
//meta tag-ek
//if (!empty($mid)) {
//   $tpl->assign('meta_tags', getMetaTags($mid));
//} else {
//    $tpl->assign('meta_tags', getMetaTags());
//}
//ha van shopunk csak, akkor hasznaljuk ezt a reszt
if (isModule('shop', 'index') && !empty($_SESSION['site_shop_is_breadcrumb'])) {
    $tpl->assign('shop_breadcrumb', $shop_breadcrumb->getArray());
}
//ha van aprohirdetesunk csak, akkor hasznaljuk ezt a reszt
if (isModule('classifieds', 'index') && !empty($_SESSION['site_class_is_breadcrumb'])) {
    $tpl->assign('class_breadcrumb', $class_breadcrumb->getArray());
}
$locale->assignToSmarty('locale');
$tpl->display("index.tpl");
//website statisztika
/*if (isModule('stat', 'admin') && !empty($statdoc)) {
	include_once 'phpOpenTracker.php';

	// log access
	phpOpenTracker::log(
		array(
			'document' => $statdoc
			)
		);
}*/
コード例 #11
0
     $leadarea =& $form_sendnews->addElement('textarea', 'lead', $locale->get('field_lead'), 'onKeyDown="textCounter(\'leadfield\',\'lengthfield\',\'' . $_SESSION['site_leadmax'] . '\');" onKeyUp="textCounter(\'leadfield\',\'lengthfield\',\'' . $_SESSION['site_leadmax'] . '\');" id="leadfield" style="width: 100%"');
     $leadarea->setCols(50);
     $leadarea->setRows(5);
     $form_sendnews->addElement('text', 'lead_len', $locale->get('field_news_leadlen'), array('size' => 5, 'id' => 'lengthfield', 'readonly' => 'readonly'));
     $form_sendnews->addRule('lead', $locale->get('error_lead'), 'required');
 }
 //teljes szoveg
 $form_sendnews->addElement('textarea', 'body', $locale->get('field_body'));
 //kep, video feltoltese
 $file =& $form_sendnews->addElement('file', 'fileupl', $locale->get('field_file'));
 $form_sendnews->applyFilter('__ALL__', 'trim');
 $form_sendnews->addRule('sendtype', $locale->get('error_sendtype'), 'required');
 $form_sendnews->addRule('title', $locale->get('error_title'), 'required');
 $form_sendnews->addRule('body', $locale->get('error_body'), 'required');
 //ha kepet vagy videot toltunk fel
 if (isModule('gallery', 'index') && $form_sendnews->isSubmitted() && ($_POST['sendtype'] == 'pic' || $_POST['sendtype'] == 'video')) {
     $form_sendnews->addRule('fileupl', $locale->get('error_file'), 'uploadedfile');
 }
 if ($form_sendnews->validate()) {
     $form_sendnews->applyFilter('__ALL__', array(&$mdb2, 'escape'));
     $filename = "";
     $pic = TRUE;
     //kep feltoltese
     if (isset($_SESSION['site_leadpic']) && $_SESSION['site_leadpic'] == 1 || isset($_SESSION['site_newspic']) && $_SESSION['site_newspic'] == 1) {
         if ($file->isUploadedFile()) {
             $filevalues = $file->getValue();
             $sdir = preg_replace('|/$|', '', $_SESSION['site_cnt_picdir']) . '/';
             $filename = time() . preg_replace('|[^\\d\\w_\\.]|', '_', change_hunchar($filevalues['name']));
             //kep atmeretezese
             include_once 'includes/function.images.php';
             if (is_array($pic = img_resize($filevalues['tmp_name'], $sdir . $filename, $_SESSION['site_newspicw'], $_SESSION['site_newspich']))) {
コード例 #12
0
<?php

if (isModule('tags', 'admin')) {
    $query_tags = "\n\t\tSELECT t.tag_id AS tag_id, t.tag_name AS tag_name \n\t\tFROM iShark_Tags t, iShark_Tags_Modules tm \n\t\tWHERE tm.tag_id = t.tag_id \n\t\tGROUP BY tag_id \n\t\tORDER BY tm.add_date DESC\n\t";
    $mdb2->setLimit(20);
    $result_tags =& $mdb2->query($query_tags);
    $tpl->assign('taglist', $result_tags->fetchAll('', $rekey = true));
    $acttpl = "tags_block";
}
コード例 #13
0
ファイル: contents.php プロジェクト: span20/Kallay
    $tpl->assign('errormsg', $locale->get('settings_error_permission_denied'));
    return;
}
/**
 * ha modositjuk
 */
if ($act == "mod") {
    require_once 'HTML/QuickForm.php';
    require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
    $form =& new HTML_QuickForm('frm_contents', 'post', 'admin.php?p=settings&file=' . $_GET['file']);
    $breadcrumb->add($locale->get('form_settings_header'), 'admin.php?p=settings&amp;file=' . $_GET['file'] . '&amp;act=mod');
    $form->setRequiredNote($locale->get('settings_form_required_note'));
    $form->addElement('header', $locale->get('settings_form_header'));
    $form->addElement('hidden', 'act', 'mod');
    //ha lehet ajanlani a tartalmat masoknak
    if (isModule('recommend', 'index') && !empty($_SESSION['site_cnt_is_send'])) {
        $send_reg = array();
        $send_reg[] =& HTML_QuickForm::createElement('radio', null, null, $locale->get('settings_form_yes'), '1');
        $send_reg[] =& HTML_QuickForm::createElement('radio', null, null, $locale->get('settings_form_no'), '0');
        $form->addGroup($send_reg, 'sendreg', $locale->get('settings_field_sendreg'));
    }
    //lekerdezzuk a guestbook config tablat es beallitjuk alapertelmezettnek
    $query = "\n\t\tSELECT * \n\t\tFROM iShark_Contents_Configs\n\t";
    $is_empty = 0;
    $result = $mdb2->query($query);
    while ($row = $result->fetchRow()) {
        $form->setDefaults(array('sendreg' => $row['is_send_reg']));
        $is_empty = 1;
    }
    $form->applyFilter('__ALL__', 'trim');
    //ha lehet ajanlani a tartalmat masoknak
コード例 #14
0
ファイル: rss.php プロジェクト: span20/Kallay
 $form->addElement('header', $locale->get('form_header'));
 //ha tobb nyelvu az oldal, akkor kilistazzuk a nyelveket
 if (isset($_SESSION['site_multilang']) && $_SESSION['site_multilang'] == 1) {
     include_once $include_dir . '/functions.php';
     $form->addElement('select', 'languages', $locale->get('form_lang'), directory_list($lang_dir, 'php', array(), 1));
 }
 $form->addElement('text', 'name', $locale->get('form_name'));
 $desc =& $form->addElement('textarea', 'desc', $locale->get('form_desc'), 'onKeyDown="textCounter(\'desc_field\',\'lengthfield\',\'' . $_SESSION['site_leadmax'] . '\');" onKeyUp="textCounter(\'desc_field\',\'lengthfield\',\'' . $_SESSION['site_leadmax'] . '\');" id="desc_field"');
 $desc->setCols(60);
 $desc->setRows(7);
 $form->addElement('text', 'desc_len', $locale->get('form_desclen'), array('size' => 5, 'id' => 'lengthfield', 'readonly' => 'readonly'));
 //kirakunk egy ures option-t az elejere
 $empty_array = array('' => '');
 $cats_array = array();
 //lekerdezzuk, hogy milyen rss fájlok vannak
 if (isModule('contents')) {
     if (!empty($_SESSION['site_is_news']) && file_exists('modules/rss_news.php')) {
         $where[] = "module_name='news'";
         //ha hasznaljuk a kategoriakat, akkor azokat kulon is kiemeljuk
         if (!empty($_SESSION['site_category'])) {
             $query_cats = "\n\t\t\t\t\tSELECT category_id, category_name \n\t\t\t\t\tFROM iShark_Category \n\t\t\t\t\tWHERE is_active = 1 AND is_deleted = 0 \n\t\t\t\t\tORDER BY category_name\n\t\t\t\t";
             $result_cats =& $mdb2->query($query_cats);
             while ($row_cats = $result_cats->fetchRow()) {
                 $cats_array['rss_news.php?cat=' . $row_cats['category_id']] = $row_cats['category_name'];
             }
         }
     }
     if (!empty($_SESSION['site_is_other']) && file_exists('modules/rss_contents.php')) {
         $where[] = "module_name='contents'";
     }
 }
コード例 #15
0
ファイル: contents_content.php プロジェクト: span20/Kallay
        if ($attached_contents) {
            $query = "\n                DELETE FROM iShark_Contents_Contents \n                WHERE content_id = {$cid}\n            ";
            $mdb2->exec($query);
        }
        //kitoroljuk a tartalom kategoria kapcsolotablabol
        if (!empty($_SESSION['site_category'])) {
            $query = "\n                DELETE FROM iShark_Contents_Category\n                WHERE content_id = {$cid}\n            ";
            $mdb2->exec($query);
        }
        //kitoroljuk a tag kapcsolotablabol
        if (!empty($_SESSION['site_cnt_is_tags']) && isModule('tags')) {
            $query = "\n                DELETE FROM iShark_Tags_Modules\n                WHERE module_name = 'contents' and id = {$cid}\n            ";
            $mdb2->exec($query);
        }
        //kitoroljuk a hozzaszolas tablabol
        if (isModule('comments')) {
            $query = "\n\t\t\t\tDELETE FROM iShark_Comments \n\t\t\t\tWHERE id = {$cid} AND module_name = 'contents'\n\t\t\t";
            $mdb2->exec($query);
        }
    }
    //loggolas
    logger($page . '_' . $sub_act);
    header('Location: admin.php?p=' . $module_name . '&act=' . $page . '&field=' . $field . '&ord=' . $ord . '&pageID=' . $page_id);
    exit;
}
//torles vege
/**
 * ha visszaalitjuk a tartalmat
 */
if ($sub_act == "restore") {
    if (!empty($_SESSION['site_cnt_version'])) {
コード例 #16
0
ファイル: exec.lighttpd.php プロジェクト: brucewu16899/1.6.x
function buildConfig()
{
    $unix = new unix();
    $sock = new sockets();
    $phpcgi = $unix->LIGHTTPD_PHP5_CGI_BIN_PATH();
    $chown = $unix->find_program("chown");
    $perlbin = $unix->find_program("perl");
    $nohup = $unix->find_program("nohup");
    $php = $unix->LOCATE_PHP5_BIN();
    $PHP_STANDARD_MODE = true;
    $phpfpm = $unix->find_program('php5-fpm');
    if (!is_file($phpfpm)) {
        $phpfpm = $unix->find_program('php-fpm');
    }
    @mkdir("/usr/share/artica-postfix/framework", 0755, true);
    @mkdir("/usr/share/artica-postfix/ressources/sock", 0755, true);
    $LighttpdRunAsminimal = $sock->GET_INFO("LighttpdRunAsminimal");
    $LighttpdArticaMaxProcs = $sock->GET_INFO("LighttpdArticaMaxProcs");
    $LighttpdArticaMaxChildren = $sock->GET_INFO("LighttpdArticaMaxChildren");
    $PHP_FCGI_MAX_REQUESTS = $sock->GET_INFO("PHP_FCGI_MAX_REQUESTS");
    $SessionPathInMemory = $sock->GET_INFO("SessionPathInMemory");
    if (!is_numeric($LighttpdRunAsminimal)) {
        $LighttpdRunAsminimal = 0;
    }
    if (!is_numeric($LighttpdArticaMaxProcs)) {
        $LighttpdArticaMaxProcs = 0;
    }
    if (!is_numeric($LighttpdArticaMaxChildren)) {
        $LighttpdArticaMaxChildren = 0;
    }
    if (!is_numeric($PHP_FCGI_MAX_REQUESTS)) {
        $PHP_FCGI_MAX_REQUESTS = 200;
    }
    if (!is_numeric($SessionPathInMemory)) {
        $SessionPathInMemory = 0;
    }
    $EnableArticaApachePHPFPM = $sock->GET_INFO("EnableArticaApachePHPFPM");
    if (!is_numeric($EnableArticaApachePHPFPM)) {
        $EnableArticaApachePHPFPM = 0;
    }
    if (!is_file("/opt/artica/ssl/certs/lighttpd.pem")) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} creating SSL certificate..\n";
        }
        exec("/usr/share/artica-postfix/bin/artica-install -lighttpd-cert 2>&1", $results);
        while (list($pid, $line) = each($results)) {
            $line = trim($line);
            if ($line == null) {
                continue;
            }
            if (preg_match("#Starting.*?lighttpd(.+)#", $line, $re)) {
                $line = $re[1];
            }
            $line = str_replace(": ", "", $line);
            if ($GLOBALS["OUTPUT"]) {
                echo "Starting......: " . date("H:i:s") . " [ARTI]: {$GLOBALS["SERVICE_NAME"]} {$line}\n";
            }
        }
    }
    $results = array();
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Creating PHP configuration..\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Executing artica-install --php-ini..\n";
    }
    exec("/usr/share/artica-postfix/bin/artica-install --php-ini 2>&1", $results);
    while (list($pid, $line) = each($results)) {
        $line = trim($line);
        if ($line == null) {
            continue;
        }
        if (preg_match("#Starting.*?lighttpd(.+)#", $line, $re)) {
            $line = $re[1];
        }
        $line = str_replace(": ", "", $line);
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [ARTI]: {$GLOBALS["SERVICE_NAME"]} {$line}\n";
        }
    }
    PHP_MYADMIN();
    $PHP_FCGI_CHILDREN = 3;
    $max_procs = 3;
    if ($LighttpdArticaMaxProcs > 0) {
        $max_procs = $LighttpdArticaMaxProcs;
    }
    if ($LighttpdArticaMaxChildren > 0) {
        $PHP_FCGI_CHILDREN = $LighttpdArticaMaxChildren;
    }
    if (!$unix->ISMemoryHiger1G()) {
        $PHP_FCGI_CHILDREN = 2;
        $max_procs = 1;
    }
    $MEMORY = $unix->MEM_TOTAL_INSTALLEE();
    if ($MEMORY < 624288) {
        $LighttpdRunAsminimal = 1;
    }
    if ($LighttpdRunAsminimal == 1) {
        $max_procs = 1;
        $PHP_FCGI_CHILDREN = 2;
        $PHP_FCGI_MAX_REQUESTS = 500;
    }
    $phpfpm = $unix->APACHE_LOCATE_PHP_FPM();
    $EnablePHPFPM = $sock->GET_INFO("EnablePHPFPM");
    if (!is_numeric($EnablePHPFPM)) {
        $EnablePHPFPM = 0;
    }
    if (!is_file($phpfpm)) {
        $EnablePHPFPM = 0;
    }
    if ($EnablePHPFPM == 0) {
        $EnableArticaApachePHPFPM = 0;
    }
    if ($EnableArticaApachePHPFPM == 0) {
        $EnablePHPFPM = 0;
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} EnableArticaApachePHPFPM = {$EnableArticaApachePHPFPM}\n";
    }
    if ($EnablePHPFPM == 1) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Using PHP-FPM........: Yes\n";
        }
    } else {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Using PHP-FPM........: No\n";
        }
    }
    $ArticaHttpsPort = 9000;
    $NoLDAPInLighttpdd = 0;
    $ArticaHttpUseSSL = 1;
    $ArticaHttpsPort = $sock->GET_INFO("ArticaHttpsPort");
    $ArticaHttpUseSSL = $sock->GET_INFO("ArticaHttpUseSSL");
    if (!is_numeric($ArticaHttpUseSSL)) {
        $ArticaHttpUseSSL = 1;
    }
    if (!is_numeric($ArticaHttpsPort)) {
        $ArticaHttpsPort = "9000";
    }
    $ArticaHttpUseSSL = $sock->GET_INFO('ArticaHttpUseSSL');
    if (!is_numeric($ArticaHttpUseSSL)) {
        $ArticaHttpUseSSL = 1;
    }
    $NoLDAPInLighttpdd = $sock->GET_INFO('NoLDAPInLighttpdd');
    if (!is_numeric($NoLDAPInLighttpdd)) {
        $NoLDAPInLighttpdd = 0;
    }
    $LighttpdUseUnixSocket = $sock->GET_INFO('LighttpdUseUnixSocket');
    if (!is_numeric($LighttpdUseUnixSocket)) {
        $LighttpdUseUnixSocket = 0;
    }
    $lighttpdPhpPort = $sock->GET_INFO('lighttpdPhpPort');
    if (!is_numeric($lighttpdPhpPort)) {
        $lighttpdPhpPort = 1808;
    }
    $DenyMiniWebFromStandardPort = $sock->GET_INFO('DenyMiniWebFromStandardPort');
    if (!is_numeric($DenyMiniWebFromStandardPort)) {
        $DenyMiniWebFromStandardPort = 0;
    }
    $LighttpdArticaDisableSSLv2 = $sock->GET_INFO('LighttpdArticaDisableSSLv2');
    if (!is_numeric($LighttpdArticaDisableSSLv2)) {
        $LighttpdArticaDisableSSLv2 = 1;
    }
    $LighttpdArticaMaxProcs = $sock->GET_INFO('LighttpdArticaMaxProcs');
    if (!is_numeric($LighttpdArticaMaxProcs)) {
        $LighttpdArticaMaxProcs = 0;
    }
    $LighttpdArticaMaxChildren = $sock->GET_INFO('LighttpdArticaMaxChildren');
    if (!is_numeric($LighttpdArticaMaxChildren)) {
        $LighttpdArticaMaxChildren = 0;
    }
    $LighttpdRunAsminimal = $sock->GET_INFO('LighttpdRunAsminimal');
    if (!is_numeric($LighttpdRunAsminimal)) {
        $LighttpdRunAsminimal = 0;
    }
    $PHP_FCGI_MAX_REQUESTS = $sock->GET_INFO('PHP_FCGI_MAX_REQUESTS');
    if (!is_numeric($PHP_FCGI_MAX_REQUESTS)) {
        $PHP_FCGI_MAX_REQUESTS = 200;
    }
    $EnableArticaApachePHPFPM = $sock->GET_INFO("EnableArticaApachePHPFPM");
    if (!is_numeric($EnableArticaApachePHPFPM)) {
        $EnableArticaApachePHPFPM = 0;
    }
    if (!is_file($phpfpm)) {
        $EnableArticaApachePHPFPM = 0;
    }
    $EnablePHPFPM = intval($sock->GET_INFO("EnablePHPFPM"));
    if (!is_numeric($EnablePHPFPM)) {
        $EnablePHPFPM = 0;
    }
    if ($EnablePHPFPM == 0) {
        $EnableArticaApachePHPFPM = 0;
    }
    if ($EnableArticaApachePHPFPM == 0) {
        $EnablePHPFPM = 0;
    }
    $PHP_STANDARD_MODE = true;
    $LighttpdArticaListenIP = $sock->GET_INFO('LighttpdArticaListenIP');
    $phpcgi_path = $unix->LIGHTTPD_PHP5_CGI_BIN_PATH();
    $LIGHTTPD_GET_USER = LIGHTTPD_GET_USER();
    $LIGHTTPD_CONF_PATH = LIGHTTPD_CONF_PATH();
    if (preg_match("#^(.+?):(.+)#", $LIGHTTPD_GET_USER, $re)) {
        $LIGHTTPD_USER = $re[1];
        $LIGHTTPD_GROUP = $re[1];
    }
    $PHP_FCGI_CHILDREN = 1;
    $max_procs = 2;
    @mkdir("/var/log/lighttpd", 0755, true);
    @mkdir("/usr/share/artica-postfix/ressources/logs", 0755, true);
    if (!is_file("/var/log/lighttpd/access.log")) {
        @touch("/var/log/lighttpd/access.log");
    }
    @chown("/var/log/lighttpd", $LIGHTTPD_USER);
    @chgrp("/var/log/lighttpd", $LIGHTTPD_GROUP);
    @chown("/var/log/lighttpd/access.log", $LIGHTTPD_USER);
    @chgrp("/var/log/lighttpd/access.log", $LIGHTTPD_GROUP);
    @chmod("/var/log/lighttpd/access.log", 0777);
    $unix->chown_func($LIGHTTPD_USER, $LIGHTTPD_GROUP, "/var/log/lighttpd/*");
    $unix->chown_func($LIGHTTPD_USER, $LIGHTTPD_GROUP, "/usr/share/artica-postfix/ressources/logs/*");
    if ($LighttpdArticaMaxProcs > 0) {
        $max_procs = $LighttpdArticaMaxProcs;
    }
    if ($LighttpdArticaMaxChildren > 0) {
        $HP_FCGI_CHILDREN = $LighttpdArticaMaxChildren;
    }
    if ($LighttpdRunAsminimal == 1) {
        $max_procs = 2;
        $PHP_FCGI_CHILDREN = 2;
    }
    $mod_auth = isModule('mod_auth');
    if (is_file('/proc/user_beancounters')) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} VPS mode enabled, swith to socket mode for PHP\n";
        }
        $LighttpdUseUnixSocket = 1;
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} MAX Procs............: {$max_procs}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Php5 processes.......: {$PHP_FCGI_CHILDREN}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Max cnx/processes....: {$PHP_FCGI_MAX_REQUESTS}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} php-cgi path.........: {$phpcgi_path}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} chown path...........: {$chown}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} php path.............: {$php}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} php FPM Path.........: {$phpfpm}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} php FPM Enabled......: {$EnableArticaApachePHPFPM}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Perl Path............: {$perlbin}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Conf Path............: {$LIGHTTPD_CONF_PATH}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Pid Path.............: /var/run/lighttpd/lighttpd.pid\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} SSL enabled..........: {$ArticaHttpUseSSL}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Disable SSLv2........: {$LighttpdArticaDisableSSLv2}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Listen Port..........: {$ArticaHttpsPort}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Run as...............: {$LIGHTTPD_USER} / {$LIGHTTPD_GROUP}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} No LDAP in Lighttpd..: {$NoLDAPInLighttpdd}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Mod auth installed...: {$mod_auth}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Use Unix socket......: {$LighttpdUseUnixSocket}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Sessions in Memory...: {$SessionPathInMemory}MB\n";
    }
    $MakeDirs[] = "/opt/artica/ssl/certs";
    $MakeDirs[] = "/var/lib/php/session";
    $MakeDirs[] = "/var/lighttpd/upload";
    $MakeDirs[] = "/var/run/lighttpd";
    $MakeDirs[] = "/var/log/lighttpd";
    $MakeDirs[] = "/opt/artica/share/www/jpegPhoto";
    $MakeDirs[] = dirname($LIGHTTPD_CONF_PATH);
    while (list($pid, $dir) = each($MakeDirs)) {
        if (!is_dir($dir)) {
            if ($GLOBALS["OUTPUT"]) {
                echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} creating {$dir}\n";
            }
        }
        @mkdir($dir, 0755, true);
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} permissions on {$dir}\n";
        }
        shell_exec("{$chown} {$LIGHTTPD_GET_USER} {$dir}");
    }
    $f[] = '#artica-postfix saved by artica lighttpd.conf (Artica Install binary) v3.0';
    $f[] = '';
    $f[] = 'server.modules = (';
    $f[] = '        "mod_alias",';
    $f[] = '        "mod_access",';
    $f[] = '        "mod_accesslog",';
    $f[] = '        "mod_compress",';
    $f[] = '        "mod_fastcgi",';
    $f[] = '        "mod_cgi",';
    $f[] = '	       "mod_status",';
    if ($NoLDAPInLighttpdd == 1) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} LDAP Mode is disabled\n";
        }
    }
    if ($mod_auth) {
        $f[] = '	       "mod_auth"';
    } else {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} mod_auth module does not exists (should be a security issue !!!)\n";
        }
    }
    $f[] = ')';
    $f[] = '';
    $f[] = 'server.document-root        = "/usr/share/artica-postfix"';
    $f[] = 'server.username = "******"';
    $f[] = 'server.groupname = "' . $LIGHTTPD_GROUP . '"';
    $f[] = 'server.errorlog-use-syslog = "enable"';
    //$f[]='server.errorlog             = "/var/log/lighttpd/error.log"';
    $f[] = 'index-file.names            = ( "index.php","index.cgi")';
    $f[] = '';
    $f[] = 'mimetype.assign             = (';
    $f[] = '  ".pdf"          =>      "application/pdf",';
    $f[] = '  ".sig"          =>      "application/pgp-signature",';
    $f[] = '  ".spl"          =>      "application/futuresplash",';
    $f[] = '  ".class"        =>      "application/octet-stream",';
    $f[] = '  ".ps"           =>      "application/postscript",';
    $f[] = '  ".torrent"      =>      "application/x-bittorrent",';
    $f[] = '  ".dvi"          =>      "application/x-dvi",';
    $f[] = '  ".gz"           =>      "application/x-gzip",';
    $f[] = '  ".pac"          =>      "application/x-ns-proxy-autoconfig",';
    $f[] = '  ".swf"          =>      "application/x-shockwave-flash",';
    $f[] = '  ".tar.gz"       =>      "application/x-tgz",';
    $f[] = '  ".tgz"          =>      "application/x-tgz",';
    $f[] = '  ".tar"          =>      "application/x-tar",';
    $f[] = '  ".zip"          =>      "application/zip",';
    $f[] = '  ".mp3"          =>      "audio/mpeg",';
    $f[] = '  ".m3u"          =>      "audio/x-mpegurl",';
    $f[] = '  ".wma"          =>      "audio/x-ms-wma",';
    $f[] = '  ".wax"          =>      "audio/x-ms-wax",';
    $f[] = '  ".ogg"          =>      "application/ogg",';
    $f[] = '  ".wav"          =>      "audio/x-wav",';
    $f[] = '  ".gif"          =>      "image/gif",';
    $f[] = '  ".jar"          =>      "application/x-java-archive",';
    $f[] = '  ".jpg"          =>      "image/jpeg",';
    $f[] = '  ".jpeg"         =>      "image/jpeg",';
    $f[] = '  ".png"          =>      "image/png",';
    $f[] = '  ".xbm"          =>      "image/x-xbitmap",';
    $f[] = '  ".xpm"          =>      "image/x-xpixmap",';
    $f[] = '  ".xwd"          =>      "image/x-xwindowdump",';
    $f[] = '  ".css"          =>      "text/css",';
    $f[] = '  ".html"         =>      "text/html",';
    $f[] = '  ".htm"          =>      "text/html",';
    $f[] = '  ".js"           =>      "text/javascript",';
    $f[] = '  ".asc"          =>      "text/plain",';
    $f[] = '  ".c"            =>      "text/plain",';
    $f[] = '  ".cpp"          =>      "text/plain",';
    $f[] = '  ".log"          =>      "text/plain",';
    $f[] = '  ".conf"         =>      "text/plain",';
    $f[] = '  ".text"         =>      "text/plain",';
    $f[] = '  ".txt"          =>      "text/plain",';
    $f[] = '  ".dtd"          =>      "text/xml",';
    $f[] = '  ".xml"          =>      "text/xml",';
    $f[] = '  ".mpeg"         =>      "video/mpeg",';
    $f[] = '  ".mpg"          =>      "video/mpeg",';
    $f[] = '  ".mov"          =>      "video/quicktime",';
    $f[] = '  ".qt"           =>      "video/quicktime",';
    $f[] = '  ".avi"          =>      "video/x-msvideo",';
    $f[] = '  ".asf"          =>      "video/x-ms-asf",';
    $f[] = '  ".asx"          =>      "video/x-ms-asf",';
    $f[] = '  ".wmv"          =>      "video/x-ms-wmv",';
    $f[] = '  ".bz2"          =>      "application/x-bzip",';
    $f[] = '  ".tbz"          =>      "application/x-bzip-compressed-tar",';
    $f[] = '  ".tar.bz2"      =>      "application/x-bzip-compressed-tar",';
    $f[] = '  ""              =>      "application/octet-stream",';
    $f[] = ' )';
    $f[] = '';
    $f[] = '';
    $f[] = 'accesslog.filename          = "/var/log/lighttpd/access.log"';
    $f[] = 'url.access-deny             = ( "~", ".inc",".log",".ini" )';
    $f[] = '';
    $f[] = 'static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )';
    $f[] = 'server.port                 = ' . $ArticaHttpsPort;
    if ($LighttpdArticaListenIP != null) {
        $unix = new unix();
        $IPS = $unix->NETWORK_ALL_INTERFACES(true);
        if (!isset($IPS[$LighttpdArticaListenIP])) {
            if ($GLOBALS["OUTPUT"]) {
                echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} ERROR! Listen IP: {$LighttpdArticaListenIP} -> FALSE !!\n";
            }
            $LighttpdArticaListenIP = null;
        }
    }
    if (strlen($LighttpdArticaListenIP) > 3) {
        $f[] = 'server.bind                = "' . $LighttpdArticaListenIP . '"';
    }
    $f[] = 'server.pid-file             = "/var/run/lighttpd/lighttpd.pid"';
    $f[] = 'server.max-fds 		   = 2048';
    $f[] = 'server.max-connections      = 512';
    $f[] = 'server.network-backend      = "write"';
    shell_exec("{$php} /usr/share/artica-postfix/exec.lighttpd.nets.php");
    shell_exec("{$php} /usr/share/artica-postfix/exec.lighttpd.nets.php --phpmyadmin");
    if (is_file('/etc/artica-postfix/lighttpd_nets')) {
        $f[] = @file_get_contents("/etc/artica-postfix/lighttpd_nets");
    }
    $f[] = '';
    if (is_file($phpfpm)) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} PHP-FPM is installed\n";
        }
        if ($EnablePHPFPM == 1) {
            if ($GLOBALS["OUTPUT"]) {
                echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} PHP-FPM is enabled\n";
            }
            $PHP_STANDARD_MODE = false;
            $f[] = 'fastcgi.server = ( ".php" =>((';
            $f[] = '         "socket" => "/var/run/php-fpm.sock",';
        }
    }
    if ($PHP_STANDARD_MODE) {
        $f[] = 'fastcgi.server = ( ".php" =>((';
        $f[] = '         "bin-path" => "/usr/bin/php-cgi",';
        if ($LighttpdUseUnixSocket == 1) {
            if ($GLOBALS["OUTPUT"]) {
                echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Fast-cgi server unix socket mode\n";
            }
            $f[] = '         "socket" => "/var/run/lighttpd/php.socket" + var.PID,';
        } else {
            if ($GLOBALS["OUTPUT"]) {
                echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Fast-cgi server socket 127.0.0.1:{$lighttpdPhpPort}\n";
            }
            $f[] = '         "host" => "127.0.0.1","port" =>' . $lighttpdPhpPort . ',';
        }
    }
    $f[] = '         "min-procs" => 1,';
    $f[] = '         "max-procs" => 1,';
    $f[] = '         "idle-timeout" => 10,';
    $f[] = '         "bin-environment" => (';
    $f[] = '             "PHP_FCGI_CHILDREN" => "' . $PHP_FCGI_CHILDREN . '",';
    $f[] = '             "PHP_FCGI_MAX_REQUESTS" => "' . $PHP_FCGI_MAX_REQUESTS . '"';
    $f[] = '          ),';
    $f[] = '          "bin-copy-environment" => (';
    $f[] = '            "PATH", "SHELL", "USER"';
    $f[] = '           ),';
    $f[] = '          "broken-scriptfilename" => "enable"';
    $f[] = '        ))';
    $f[] = ')';
    if ($ArticaHttpUseSSL == 1) {
        $f[] = 'ssl.engine                 = "enable"';
        $f[] = 'ssl.pemfile                = "/opt/artica/ssl/certs/lighttpd.pem"';
    }
    if ($LighttpdArticaDisableSSLv2 == 1) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Disable SSLv2 and weak ssl cipher\n";
        }
        $f[] = 'ssl.use-sslv2              = "disable"';
        $f[] = 'ssl.cipher-list            = "TLSv1+HIGH !SSLv2 RC4+MEDIUM !aNULL !eNULL !3DES @STRENGTH"';
    } else {
        $f[] = 'ssl.use-sslv2              = "enable"';
        $f[] = 'ssl.cipher-list            = "TLSv1+HIGH RC4+MEDIUM !SSLv2 !3DES !aNULL @STRENGTH"';
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} No LDAP In lighttpd: {$NoLDAPInLighttpdd}\n";
    }
    if ($NoLDAPInLighttpdd == 0) {
        if ($mod_auth) {
            $f[] = 'status.status-url          = "/server-status"';
            $f[] = 'status.config-url          = "/server-config"';
        }
    }
    $f[] = 'server.upload-dirs         = ( "/var/lighttpd/upload" )';
    $f[] = '	server.follow-symlink = "enable"';
    $f[] = 'alias.url +=("/monitorix"  => "/var/www/monitorix/")';
    $f[] = 'alias.url += ("/blocked_attachments"=> "/var/spool/artica-filter/bightml")';
    $f[] = 'alias.url += ("/squid-rrd"=> "/opt/artica/share/www/squid/rrd")';
    $f[] = 'alias.url += ("/artica-agent"=> "/usr/share/artica-postfix/ressources/artica-agent")';
    if ($DenyMiniWebFromStandardPort == 1) {
        $f[] = '$HTTP["url"] =~ "^/miniadm.*|/computers|/user-backup" { url.access-deny = ( "" )}';
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} checking AWSTATS...\n";
    }
    $AWSTATS_www_root = AWSTATS_www_root();
    $f[] = '$HTTP["url"] =~ "^/prxy.*\\.php" { url.access-deny = ( "" )}';
    if (is_dir($AWSTATS_www_root)) {
        $f[] = 'alias.url += ( "/awstats" => "' . $AWSTATS_www_root . '" )';
    }
    if (is_file('/usr/share/poweradmin/index.php')) {
        $f[] = 'alias.url += ( "/powerdns" => "/usr/share/poweradmin" )';
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Checking PowerAdmin\n";
        }
        shell_exec("{$nohup} {$php} /usr/share/artica-postfix/exec.pdns.php --poweradmin >/dev/null 2>&1 &");
    }
    //$perlbin
    $f[] = 'alias.url += ( "/cgi-bin/" => "/usr/lib/cgi-bin/" )';
    $f[] = '';
    $f[] = 'cgi.assign= (';
    $f[] = '	".pl"  => "' . $perlbin . '",';
    $f[] = '	".php" => "/usr/bin/php-cgi",';
    $f[] = '	".py"  => "/usr/bin/python",';
    $f[] = '	".cgi"  => "' . $perlbin . '",';
    if (is_file("/usr/lib/mailman/bin/mailmanctl")) {
        $f[] = '"/admin" => "",';
        $f[] = '"/admindb" => "",';
        $f[] = '"/confirm" => "",';
        $f[] = '"/create" => "",';
        $f[] = '"/edithtml" => "",';
        $f[] = '"/listinfo" => "",';
        $f[] = '"/options" => "",';
        $f[] = '"/private" => "",';
        $f[] = '"/rmlist" => "",';
        $f[] = '"/roster" => "",';
        $f[] = '"/subscribe" => ""';
    }
    $f[] = ')';
    $f[] = '';
    if ($mod_auth) {
        $f[] = 'auth.debug = 2';
        $f[] = '$HTTP["url"] =~ "^/cgi-bin/" {';
        $f[] = 'auth.backend = "plain"';
        $f[] = 'auth.backend.plain.userfile = "/etc/lighttpd/.lighttpdpassword" ';
        $f[] = 'auth.require = ("/cgi-bin/" => (';
        $f[] = '     "method"  => "basic",';
        $f[] = '     "realm"   => "awstats Statistics",';
        $f[] = '     "require" => "valid-user"';
        $f[] = '  ))';
        $f[] = '}';
        $f[] = '';
        $f[] = '$HTTP["url"] =~ "^/server-status" {';
        $f[] = 'auth.backend = "plain"';
        $f[] = 'auth.backend.plain.userfile = "/etc/lighttpd/.lighttpdpassword" ';
        $f[] = 'auth.require = ("/server-status" => (';
        $f[] = '     "method"  => "basic",';
        $f[] = '     "realm"   => "Lighttpd config - status",';
        $f[] = '     "require" => "valid-user"';
        $f[] = '  ))';
        $f[] = '}';
        $f[] = '';
        $f[] = '$HTTP["url"] =~ "^/server-config" {';
        $f[] = 'auth.backend = "plain"';
        $f[] = 'auth.backend.plain.userfile = "/etc/lighttpd/.lighttpdpassword" ';
        $f[] = 'auth.require = ("/server-config" => (';
        $f[] = '     "method"  => "basic",';
        $f[] = '     "realm"   => "Lighttpd config - status",';
        $f[] = '     "require" => "valid-user"';
        $f[] = '  ))';
        $f[] = '}';
        $f[] = '';
        $f[] = '$HTTP["url"] =~ "^/squid/" {';
        $f[] = 'auth.backend = "plain"';
        $f[] = 'auth.debug = 2';
        $f[] = 'auth.backend.plain.userfile = "/etc/lighttpd/squid-users.passwd" ';
        $f[] = 'auth.require = ("/squid/" => (';
        $f[] = '     "method"  => "basic",';
        $f[] = '     "realm"   => "Squid Statistics",';
        $f[] = '     "require" => "valid-user"';
        $f[] = '  ))';
        $f[] = '}';
        $f[] = '';
        $f[] = '$HTTP["url"] =~ "^/cluebringer/" {';
        $f[] = 'auth.backend = "plain"';
        $f[] = 'auth.debug = 2';
        $f[] = 'auth.backend.plain.userfile = "/etc/lighttpd/cluebringer.passwd" ';
        $f[] = 'auth.require = ("/cluebringer/" => (';
        $f[] = '     "method"  => "basic",';
        $f[] = '     "realm"   => "ClueBringer (Policyd V2) administration",';
        $f[] = '     "require" => "valid-user"';
        $f[] = '  ))';
        $f[] = '}';
        $f[] = '';
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} writing {$LIGHTTPD_CONF_PATH}..\n";
    }
    @file_put_contents($LIGHTTPD_CONF_PATH, @implode("\n", $f));
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} {$LIGHTTPD_CONF_PATH} done\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Check sessions...\n";
    }
    shell_exec("{$nohup} {$php} /usr/share/artica-postfix/exec.shm.php --SessionMem >/dev/null 2>&1 &");
    shell_exec("{$nohup} {$php} /usr/share/artica-postfix/exec.shm.php --service-up >/dev/null 2>&1 &");
}
コード例 #17
0
ファイル: portal.php プロジェクト: tiyolab/autocom
/images/warehouse.png" alt="home img 01" <?php 
echo isModule($user_session, $module, "warehouse");
?>
 ></div>
                <div class="templatemo_mainservice templatemo_botgap"><img src="<?php 
echo Url::to('@web/portal_assets');
?>
/images/arsip.png" alt="home img 01" <?php 
echo isModule($user_session, $module, "surat-arsip");
?>
 ></div>
                <div class="templatemo_mainservice templatemo_botgap"><img src="<?php 
echo Url::to('@web/portal_assets');
?>
/images/e_commerce.png" alt="home img 01" <?php 
echo isModule($user_session, $module, "e-commerce");
?>
 ></div>

            </div>
    </div>
    
   </div>
    <!-- homepage end -->
        <!-- contact end --> 
    
    </div>
    
    	<!-- logo start -->
    <div class="logocontainer">
    	<div class="row">
コード例 #18
0
ファイル: system.php プロジェクト: span20/Kallay
 $form->addGroup($joindwn, 'cnt_is_attached_download', $locale->get('contents_field_attach_download'));
 //Kapcsolodo urlapok
 $joinforms = array();
 $joinforms[] =& HTML_QuickForm::createElement('radio', null, null, $locale->get('contents_field_yes'), '1');
 $joinforms[] =& HTML_QuickForm::createElement('radio', null, null, $locale->get('contents_field_no'), '0');
 $form->addGroup($joinforms, 'cnt_is_attached_forms', $locale->get('contents_field_attach_forms'));
 //ajanlo
 if (isModule('recommend', 'index')) {
     $send = array();
     $send[] =& HTML_QuickForm::createElement('radio', null, null, $locale->get('contents_field_yes'), '1');
     $send[] =& HTML_QuickForm::createElement('radio', null, null, $locale->get('contents_field_no'), '0');
     $form->addGroup($send, 'cnt_is_send', $locale->get('contents_field_recommend'));
     $form->addRule('cnt_is_send', $locale->get('contents_error_recommend'), 'required');
 }
 //cimkek hasznalata
 if (isModule('tags')) {
     $tags = array();
     $tags[] =& HTML_QuickForm::createElement('radio', null, null, $locale->get('contents_field_yes'), '1');
     $tags[] =& HTML_QuickForm::createElement('radio', null, null, $locale->get('contents_field_no'), '0');
     $form->addGroup($tags, 'cnt_is_tags', $locale->get('contents_field_tags'));
     $form->addRule('cnt_is_tags', $locale->get('contents_error_tags'), 'required');
 }
 //futo csik hasznalata
 $marquee = array();
 $marquee[] =& HTML_QuickForm::createElement('radio', null, null, $locale->get('contents_field_yes'), '1');
 $marquee[] =& HTML_QuickForm::createElement('radio', null, null, $locale->get('contents_field_no'), '0');
 $form->addGroup($marquee, 'cnt_is_marquee', $locale->get('contents_field_marquee'));
 //futo csikban hany hir jelenik meg
 $form->addElement('text', 'cnt_marquee_num', $locale->get('contents_field_marqueenum'));
 //mti hirek hasznalata
 $mti = array();
コード例 #19
0
ファイル: builder.php プロジェクト: span20/Kallay
             $seltomb['content_id'] = $content_id_sel;
         }
         if (isset($_SESSION['site_category']) && $_SESSION['site_category'] == '1') {
             $category_id_sel = $form->getSubmitValue('category_id_sel');
             if ($category_id_sel != 0) {
                 $seltomb['category_id'] = $category_id_sel;
             }
         }
     }
     if (isModule('banners', 'admin')) {
         $banner_pos_sel = $form->getSubmitValue('banner_pos_sel');
         if ($banner_pos_sel != 0) {
             $seltomb['banner_pos'] = $banner_pos_sel;
         }
     }
     if (isModule('gallery', 'admin')) {
         $gallery_id_sel = $form->getSubmitValue('gallery_id_sel');
         if ($gallery_id_sel != 0) {
             $seltomb['gallery_id'] = $gallery_id_sel;
         }
     }
     if ($form->getSubmitValue('inside_columns') > 1 && count($seltomb) != $form->getSubmitValue('inside_columns')) {
         $form->setElementError('menu_pos', $locale->get('error_required_modules3'));
     }
     $seltomb2 = array_unique($seltomb);
     if ($seltomb != $seltomb2) {
         $form->setElementError('menu_pos', $locale->get('error_required_modules4'));
     }
 } else {
     $seltomb = "";
 }
コード例 #20
0
ファイル: gallery_video.php プロジェクト: span20/Kallay
                 $mdb2->exec($query);
             }
         }
     }
     //ha hasznaljuk a tag-eket
     if (!empty($_SESSION['site_gallery_is_tags']) && isModule('tags')) {
         //ha letezik a $tags tomb, akkor felvisszuk a kapcsolotablaba
         if (is_array($tags) && count($tags) > 0) {
             foreach ($tags as $key => $id) {
                 $query = "\n    \t\t\t\t\tINSERT INTO iShark_Tags_Modules \n    \t\t\t\t\t(tag_id, module_name, id, add_date) \n    \t\t\t\t\tVALUES \n    \t\t\t\t\t({$id}, 'gallery', {$gallery_id}, NOW())\n    \t\t\t\t";
                 $mdb2->exec($query);
             }
         }
     }
     //ha kapcsolhatunk tartalmat
     if (!empty($_SESSION['site_gallery_cnt_attach']) && isModule('contents')) {
         //ha letezik a $content_select tomb, akkor felvisszuk a kapcsolotablaba
         if (is_array($content_select) && count($content_select) > 0) {
             foreach ($content_select as $value) {
                 $query = "\n        \t\t\t\tINSERT INTO iShark_Galleries_Contents \n        \t\t\t\t(gallery_id, content_id) \n        \t\t\t\tVALUES \n        \t\t\t\t({$gallery_id}, " . $value . ")\n        \t\t\t";
                 $mdb2->exec($query);
             }
         }
     }
     $form->freeze();
     logger($page . '_' . $sub_act);
     header('Location: admin.php?p=' . $module_name . '&act=' . $page);
     exit;
 }
 $form->addElement('submit', 'submit', $locale->get('video_form_submit'), 'class="submit"');
 $form->addElement('reset', 'reset', $locale->get('video_form_reset'), 'class="reset"');
コード例 #21
0
<?php

//futócsík
if (isModule('news', 'index') && !empty($_SESSION['site_cnt_is_marquee'])) {
    $query = "\n\t\tSELECT content_id, title \n\t\tFROM iShark_Contents \n\t\tWHERE is_active = '1' AND type = 0 \n\t\tORDER BY add_date DESC\n\t";
    $mdb2->setLimit($_SESSION['site_cnt_marquee_num']);
    $result = $mdb2->query($query);
    $tpl->assign('marquee', $result->fetchAll('', $rekey = true));
    $acttpl = "block_marquee";
}
コード例 #22
0
ファイル: function.banners.php プロジェクト: span20/Kallay
function get_banners2()
{
    global $mdb2, $tpl;
    $tpl->register_function("redim_banner", "get_banner_dimension");
    $bannerlist = "";
    //csak akkor futtatjuk, ha be van kapcsolva a modul
    if (!isModule('banners', 'admin')) {
        return array();
    }
    $query = "\n   \t\tSELECT \n   \t\t\tb.banner_id AS banner_id, b.realname AS pic, b.type AS type, \n   \t\t\tb.width as width, b.height as height, b.banner_code AS banner_code,\n   \t\t\tp.max_width AS max_width, p.max_height AS max_height, \n   \t\t\tbm.place_id AS place_id, bm.menu_id AS menu_id, b.name as name\n   \t\tFROM iShark_Banners b, iShark_Banners_Menus_Places bm, iShark_Banners_Places p \n   \t\tWHERE b.banner_id = bm.banner_id AND bm.place_id = p.place_id AND \n   \t\t\t(bm.timer_start = '0000-00-00 00:00:00' OR (bm.timer_start < NOW() AND bm.timer_end > NOW())) AND\n\t\t\t(bm.impression_max = 0 OR (bm.impression_max != 0 AND bm.impression_num < bm.impression_max))\n   \t";
    //megvizsgaljuk, ha menuponthoz van kapcsolva
    if (isset($_GET['mid'])) {
        $mid = intval($_GET['mid']);
        $query .= "\n   \t\t\tAND (bm.menu_id = {$mid} OR bm.menu_id = 0) \n   \t\t";
    } else {
        $query .= "\n   \t\t\tAND bm.menu_id = 0 \n   \t\t";
    }
    $query .= "\n   \t\tORDER BY bm.place_id\n   \t";
    //ha nem rakjuk ki adott helyre az osszeset, cserelgetve
    /*if (empty($_SESSION['site_banner_type'])) {
          $query .= ", RAND()";
          $mdb2->setLimit(1);
      }*/
    $result =& $mdb2->query($query);
    $banners = array();
    while ($row = $result->fetchRow()) {
        $banners[$row["place_id"]][] = $row;
    }
    return $banners;
}