ОБСУЖДЕНИЕ

Запреты на Php (до регистрации и после)

4 ответов 4,9 тыс.
Статус
Закрыто для дальнейших ответов.
Автор темы
Здравствуйте ПРОШУ ОЧЕНЬ ПОМОЧЬ.
Как можно сделать чтобы пользователь сайта только при регистрации мог получить полномочия на показ например какихнибуть объектов сайта,например каталог. И чтобы он их не видел будучи не зарегистрированным на сайте. Плиз помогите. Если инициализация происходит следующим образом:
Код:
// -------------------------INITIALIZATION-----------------------------//

session_start();

//select new language?
if (isset($new_language))
{
$current_language = $new_language;
session_register("current_language");
}

include("cfg/settings.inc.php");
include("functions.php");

include("language_list.php");
if (!isset($current_language) ||
$current_language<0 || $current_language>count($lang_list))
$current_language = 0; //set default language

if (isset($lang_list[$current_language]) && file_exists($lang_list[$current_language]->filename))
include($lang_list[$current_language]->filename); //include current language file
else
{
die("<font color=red><b>ERROR: Couldn't find language file!</b></font>
<p><a href=\"index.php?new_language=0\">Click here to use default language</a>");
}


//connect to the database
db_connect(DB_HOST,DB_USER,DB_PASS) or die (db_error());
db_select_db(DB_NAME) or die (db_error());

//$output is the main output buffer.
//include template file (it is set in the language file)
$output = implode("",file($lang_list[$current_language]->template));

//authorized access check
include ("checklogin.php");
//currencies file
include("cfg/currency.inc.php");

//# of selected currency
if (!isset($current_currency)) $current_currency = 0;

//load all categories to array $cats to avoid multiple queries
$cats = array();
$i=0;
$q = db_query("SELECT categoryID, name, parent, products_count, description, picture FROM ".CATEGORIES_TABLE." where categoryID<>0 ORDER BY name") or die (db_error());	
while ($row = db_fetch_row($q)) $cats[$i++] = $row;

if (!isset($categoryID)) $categoryID = 0;

if (!isset($vote_completed)) $vote_completed = array();

if (!isset($offset)) $offset=0;
//checking for proper $offset init
if ($offset<0 || $offset%$products_count) $offset=0;




// -----------------------------------------------------------------//
 
млин.. книшку штоли написать по веб-программированию.. :P
 
в вашем коде разбираться лень. на первый взгляд это кусок кода какой-то cms, магазина не относящийся к делу (выбор языка).
введите переменную, поле в таблице пользователей а-ля userlevel. в зависимости от ее значения пользователь будет обладать теми или иными правами.
 
страшно знакомый код. :D
неужели нашелся ещё один спикулянт который пытается прикрутить бесплатный shop-script. хе хе хе.

а вообще оч странный вопрос. :).
 
:blink: короче пошурупь головой и сложи 1 + 1
 
Статус
Закрыто для дальнейших ответов.