Location: PHPKode > projects > Security-Tools Database > sectool-db-0.9.4/source/session.php
<?php
/******************************************************************************
*;#
*;#    Security-Tool Datenbank Version 0.9.4
*;#
*;#    Copyright (C) 2002  Ansgar H. Licher
*;#    hide@address.com
*;#    http://www.team-licher.de
*;#
*;#    This program is free software; you can redistribute it and/or
*;#    modify it under the terms of the GNU General Public License as
*;#    published by the Free Software Foundation; either version 2 of
*;#    the License, or (at your option) any later version.
*;#
*;#    This program is distributed in the hope that it will be useful,
*;#    but WITHOUT ANY WARRANTY; without even the implied warranty of
*;#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
*;#    General Public License for more details.
*;#
*;#    You should have received a copy of the GNU General Public License
*;#    along with this program; if not, write to the Free Software
*;#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*;#
/******************************************************************************
*;#
*;#    PROJEKT             Datenbank der Security-Tools von SecurityFocus.com
*;#
*;#    MODUL BEZEICHNUNG   Session Variable
*;#
*;#    MODUL ZWECK         Definition der notwendigen Session-Variablen
*;#
*;#    DATEINAME           session.php
*;#
*;#
*;#    ERSTELLT            28-Apr-2002
*;#
*;#    LETZTE
*;#    AKTUALISIERUNG      xx-xxx-20xx
*;#
*;#    ENTWICKLER          Ansgar H. Licher (hide@address.com)
*;#
*;#    PROGRAMMIERER       Ansgar H. Licher (hide@address.com)
*;#
*;#
*;# -- REVISIONS UEBERSICHT ---------------------------------------------------
*;#
*;#    VERSIONEN           0.9.1  28-Apr-2002    development release
*;#                        x.x.x  xx-xxx-20xx    xxxxx
*;#
*;#
*;#    AENDERUNGEN
*;#             von        X.X.X zu X.Y.Z
*;#             Datum      xx-xxx-20xx
*;#             Autor      xxxxxxxxxxxxxx
*;#
*;#             Themen/    xxxxxxxxxxxxxxxxx
*;#             Aspekte    xxxxxxxxxxxxxxxxx
*;#
*;#
******************************************************************************/

if (OPERATING_SYSTEM == 0)
	session_save_path("C:\\TEMP");
	
session_start();

/*
*
*   Initializing of session variables
*
*/


/*
*  General purpose session variables
*/

if (!session_is_registered("session_user_logged_in"))  {
	session_register("session_user_logged_in");
	$session_user_logged_in = FALSE;
}

if (!session_is_registered("session_userrights"))
	session_register("session_userrights");

if (!session_is_registered("session_user_id"))
	session_register("session_user_id");



/* 
   The variable "session_display_userlist" drives the mode, how the userlist (add, edit, delete users) is displayed
   Possible values are declared as constants: DISPLAY_...
*/
if (!session_is_registered("session_display_userlist"))  {
	session_register("session_display_userlist");
	// if current user is not a Superuser
	if (is_superuser())
		// This switches the default resp. initial view in Superuser mode to display only users with login capabilities.
		// The Superuser is always allowed to switch the mode. This default value is only a start value,
		// which declares, that the first view is a small part of the whole userlist or namelist
		$session_display_userlist = DISPLAY_LOGINCAPABLE_ONLY;
	else
		// This is for editing purposes for users with Read/Write right.
		// They are allowed to maintain the list of Info-Gebern but not any other kind of users
		// This kind of users is NOT allowed to change the display mode of the userlist
		$session_display_userlist = DISPLAY_INFOGEBER_ONLY;
}


/* 
   The variable "session_sortkey_userlist" drives the mode, by which key value the list is sorted, when displayed
   The variable contains text strings, which will be concatenated to the $sql-querie 
*/
if (!session_is_registered("session_sortkey_userlist"))  {
	session_register("session_sortkey_userlist");
	$session_sortkey_userlist = DB_USERS_NAME;
}


/* 
   The variable "session_sortkey_toolliste" drives the mode, by which key value the info-list is sorted, when displayed
   The variable contains text strings, which will be concatenated to the $sql-querie 
*/
if (!session_is_registered("session_sortkey_toolliste"))  {
	session_register("session_sortkey_toolliste");
	$session_sortkey_toolliste = DB_TOOLS_NEWSLETTER;
}


/* 
   The variable "session_toolliste_modus" drives the mode, wether the call of info_liste() is the first call or any additional call
   (this is for the decision, wether a new SQL statement must be stored or if the given SQL statement must be used again)
*/
if (!session_is_registered("session_toolliste_modus"))  {
	session_register("session_toolliste_modus");
	$session_toolliste_modus = INFOLISTE_NEW_SEARCH;
}


/* 
   The variable "session_prev_next_sql" contains the SQL-query, which is used
   in the "prev_next_db_entries()" function
*/
if (!session_is_registered("session_prev_next_sql"))
	session_register("session_prev_next_sql");


/*
*	session variables for information management
*  (used for moving data between the pages within the main program functionality)
*  This variables are used heavily in the edittools.php module
*/

if (!session_is_registered("session_toolname"))
	session_register("session_toolname");

if (!session_is_registered("session_entwickler"))
	session_register("session_entwickler");

if (!session_is_registered("session_source_url"))
	session_register("session_source_url");

if (!session_is_registered("session_plattform"))
	session_register("session_plattform");

if (!session_is_registered("session_summary"))
	session_register("session_summary");

if (!session_is_registered("session_newsletter"))
	session_register("session_newsletter");

if (!session_is_registered("session_datum"))
	session_register("session_datum");

if (!session_is_registered("session_display_toolname"))
	session_register("session_display_toolname");

if (!session_is_registered("session_display_entwickler"))
	session_register("session_display_entwickler");

if (!session_is_registered("session_display_source_url"))
	session_register("session_display_source_url");

if (!session_is_registered("session_display_plattform"))
	session_register("session_display_plattform");

if (!session_is_registered("session_display_summary"))
	session_register("session_display_summary");

if (!session_is_registered("session_display_newsletter"))
	session_register("session_display_newsletter");

if (!session_is_registered("session_display_datum"))
	session_register("session_display_datum");

/*
*   Drives the mode, if this entries are NEW entries, or if EDITING mode is enabled in formular_info()
*/

if (!session_is_registered("session_infogeber_new"))
	session_register("session_infogeber_new");

if (!session_is_registered("session_infostandort_new"))
	session_register("session_infostandort_new");

if (!session_is_registered("session_infoquelle_new"))
	session_register("session_infoquelle_new");


/*
*   stores the final SQL statement, which is used to search specific entries from the whole catalog
*   (this var is set in info_liste() (module editinfo.php)
*/

if (!session_is_registered("session_tool_sql"))
	session_register("session_tool_sql");

?>
Return current item: Security-Tools Database