function get_menu($params)
{
    $out = '';
    extract($params);
    $prefix = empty($prefix) ? '' : $prefix;
    $suffix = empty($suffix) ? '' : $suffix;
    $pre_tag = empty($pre_tag) ? '' : $pre_tag;
    $after_tag = empty($after_tag) ? '' : $after_tag;
    $out = '';
    include_once LIB_ROOT . '/pages/page.class.php';
    $out .= $prefix . '<a href="/" class=menu>' . _('Home') . '</a>' . $suffix;
    if (!AuthController::getInstance()->isAuthorized() && $show_signup) {
        $out .= $prefix . '<a href="/signup.php" class=menu>' . _('Sign Up') . '</a>' . $suffix;
    }
    if ($show_memberarea) {
        $out .= $prefix . '<a href="/user/account.php" class=menu>' . _('Member\'s area') . '</a>' . $suffix;
    }
    if (Project::getInstance()->getCurUser()->isAdmin()) {
        $out .= $prefix . '<small><a href="/includes/inlines/admin/page.php?position=0" target="blank" style="font-size:9px;">(add page here)</a></small>' . $suffix;
    }
    $result = sql_query('
		SELECT *
		FROM pages
		WHERE lang="' . $_COOKIE['lang'] . '" AND home=0 AND show_in_menu=1
		ORDER BY position, id DESC
	');
    while ($menu_page = mysql_fetch_assoc($result)) {
        $out .= $prefix . '<a href="/index.php?page=' . $menu_page['id'] . '" class=menu>' . $menu_page['name'] . '</a>' . $suffix;
        if (Project::getInstance()->getCurUser()->isAdmin()) {
            $out .= $prefix . '<small><a href="/includes/inlines/admin/page.php?position=' . $menu_page['position'] . '"  target="blank"  style="font-size:9px;">(add page here)</a></small>' . $suffix;
        }
    }
    $out .= $exclude ? '' : $prefix . '<a href="/contactus.php" class=menu>' . _('Contact Us') . '</a>' . $suffix;
    return $pre_tag . $out . $after_tag;
}
 public function init()
 {
     parent::init();
     AuthController::getInstance()->requireLogin();
     ErrorHandler::getInstance()->getUrlErrorMessage();
     $this->setSmarty();
 }
 public function init()
 {
     parent::init();
     AuthController::getInstance()->requireLogin();
     AuthController::requireShopSession();
     Shop::getInstance()->requireOpenShop();
     $this->setSmarty();
 }
 function __construct()
 {
     parent::__construct();
     AuthController::getInstance()->requireAdmin();
     $this->init();
     /*$db = DB::getInstance();
     		$db->connect();
     
     		$this->init();
     
     
     		$CSVdata = File_CSV::getCVSArrayList('category.csv');
     
     		//products_lang query
     		$sql = "INSERT INTO category
     			".$CSVdata['index'].
     			"VALUES ".$CSVdata['values'];
     
     		$db->query($sql);*/
     //categories query
     /*
     		$CSVdata = File_CSV::getCVSArrayList('category.csv');
     
     
     		/*$sql = "REPLACE INTO product
     			".$CSVdata['index'].
     			"VALUES ".$CSVdata['values'];
     
     		$db->query($sql);*/
     //categories query
     /*
     		$CSVdata = File_CSV::getCVSArrayList('category.csv');
     
     		$sql = "INSERT INTO product
     			".$CSVdata['index'].
     			"VALUES ".$CSVdata['values'];*/
     /*$sql = "REPLACE INTO product
     			".$CSVdata['index'].
     			"VALUES ".$CSVdata['values'];
     
     		$db->query($sql);*/
     /*$CSVdata = File_CSV::getCVSArrayList('products.csv');
     
     		//products query
     		$sql = "INSERT INTO products
     			".$CSVdata['index'].
     			"VALUES ".$CSVdata['values'];
     
     		$db->_query($sql);
     
     		$CSVdata = File_CSV::getCVSArrayList('products_lang.csv');
     
     		//products_lang query
     		$sql = "INSERT INTO products_lang
     			".$CSVdata['index'].
     			"VALUES ".$CSVdata['values'];
     
     		$db->_query($sql);
     
     		$CSVdata = File_CSV::getCVSArrayList('manufacturer.csv');
     
     		//manufacturer query
     		$sql = "INSERT INTO manufacturer
     			".$CSVdata['index'].
     			"VALUES ".$CSVdata['values'];
     
     		$db->_query($sql);
     
     		$CSVdata = File_CSV::getCVSArrayList('categories.csv');
     
     		//categories query
     		$sql = "INSERT INTO category
     			".$CSVdata['index'].
     			"VALUES ".$CSVdata['values'];
     
     		$db->_query($sql);*/
 }
Exemple #5
0
Project::getInstance()->getSmarty()->assign('authorized', 0);
if (AuthController::getInstance()->isAuthorized()) {
    //if got logout action
    if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'logout') {
        session_destroy();
        header('Location: /index.php');
    }
    if (Project::getInstance()->getCurUser()->access < $GLOBALS['ACCESS_LEVEL']) {
        Project::getInstance()->getSmarty()->display('login_warning.tpl');
    }
    Project::getInstance()->getSmarty()->assign('authorized', 1);
} else {
    //if got login action
    if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'login') {
        AuthController::getInstance()->authorize($_REQUEST['login'], $_REQUEST['password'], $_REQUEST['secpin']);
        if (AuthController::getInstance()->isAuthorized()) {
            if (Project::getInstance()->getCurUser()->access_notify) {
                include_once LIB_ROOT . '/emails.class.php';
                //%user_fullname%, %user_login%, %access_time%, %access_ip%, %project_name%, %project_email
                $params = array('%user_fullname%' => Project::getInstance()->getCurUser()->fullname, '%user_login%' => Project::getInstance()->getCurUser()->login, '%user_password%' => Project::getInstance()->getCurUser()->password, '%project_name%' => get_setting('project_name'), '%project_email%' => get_setting('project_email'), '%access_time%' => date('d.m.Y H:i', Project::getInstance()->getNow()), '%access_ip%' => $_SERVER['REMOTE_ADDR']);
                $email = new Emails(Project::getInstance()->getCurUser()->id, 'access_notify', $params);
                $email->send();
            }
            location('/user/account.php');
        } else {
            Project::getInstance()->getSmarty()->assign('message', '<p class=imp><strong>Alert:</strong> Authorization failed!</p>');
            Project::getInstance()->showPage('login_warning.tpl');
            exit;
        }
    } else {
        //if guest & ACCESS_LEVEL > guest