--- /dev/null
+@INCLUDE = Doxyfile.inc
+INPUT = src
+HTML_OUTPUT = doc/source-cpp
+
--- /dev/null
+@INCLUDE = Doxyfile.inc
+INPUT = www
+HTML_OUTPUT = doc/source-php
+
-# Doxyfile 1.5.1-KDevelop
-
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = MagicSmoke.kdevelop
+PROJECT_NAME = MagicSmoke
PROJECT_NUMBER = $VERSION$
OUTPUT_DIRECTORY =
CREATE_SUBDIRS = NO
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
-EXTRACT_ALL = NO
+EXTRACT_ALL = YES
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
-INPUT = /home/konrad/src/smoke
+#INPUT = /home/konrad/src/smoke
FILE_PATTERNS = *.c \
*.cc \
*.cxx \
*.cs \
*.php \
*.php3 \
+ *.php5 \
*.inc \
*.m \
*.mm \
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
-HTML_OUTPUT = html
+#HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
-GENERATE_XML = yes
+GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
//
//
+/**helper for Session::authenticate, using hash module*/
function calcAuth($cha,$tok)
{
global $ClientAuthAlgo;
//
//
+/**helper for Session::authenticate, using mhash module*/
function calcAuth($cha,$tok)
{
global $ClientAuthAlgo;
//
//
+/**helper for Session::authenticate, using string module*/
function calcAuth($key,$tok)
{
global $ClientAuthAlgo;
<?
+/**MySQL adaptation of DB-Engine*/
class MysqlEngine extends DbEngine
{
/**prefix for table names*/
<?
+/**This class contains a high-level description of the database structure*/
class DbScheme {
private static $scheme;
function __construct()
<?
-//Helper class, should never be used directly
+/**Helper class, should never be used directly*/
class PHelper
{
private $cont;
- //create helper with array of text lines
+ /**create helper with array of text lines*/
public function __construct(array $c)
{
$this->cont=$c;
reset($this->cont);
}
- //return next line from array until end is reached
+ /**return next line from array until end is reached*/
public function getLine()
{
$r=current($this->cont);
}
}
-//Parser class: see syntax docu for details
+/**Parser class: see syntax docu for details*/
class Parser
{
private $vars=array();
- //create parser object, initialize its internal state with optional file
+ /**create parser object, initialize its internal state with optional file*/
public function __construct($fname="")
{
global $_SERVER;
if($fname!="")
$this->parseFile($fname);
}
- //parse a file, return parser-result
+ /**parse a file, return parser-result*/
public function parseFile($fname)
{
global $template;
$cont=file_get_contents($template.$fname);
return $this->parse($cont);
}
- //parse a string, return parser-result
+ /**parse a string, return parser-result*/
public function parse($str)
{
$cont=explode("\n",str_replace("\r","",$str));
$help=new PHelper($cont);
return $this->parseNormal($help);
}
- //set an internal variable
+ /**set an internal variable*/
public function setVar($vname,$vval)
{
$this->vars[$vname]=$vval;
}
+ /**set several internal variables array(variablename=>value)*/
public function setVars(array $vs)
{
reset($vs);
foreach($vs as $k => $v)
$this->vars[$k]=$v;
}
- //unset a variable
+ /**unset a variable*/
public function unsetVar($vname)
{
if(isset($this->vars[$vname]))
unset($this->vars[$vname]);
}
- //get value of a variable (returns false if variable does not exist)
+ /**get value of a variable (returns false if variable does not exist)*/
public function getVar($vname)
{
if(isset($this->vars[$vname]))
else
return false;
}
- //returns true if variable exists
+ /**returns true if variable exists*/
public function haveVar($vname)
{
return isset($this->vars[$vname]);
}
- //internal: used by parse to load data
+ /**internal: used by parse to load data*/
protected function parseNormal($help)
{
$out="";
else $out.=$this->parseLine($line);
}
}
- //internal: replace variables on a line
+ /**internal: replace variables on a line*/
protected function parseLine($line)
{
$ak=array();
}
return str_replace($ak,$av,$line)."\n";
}
- //internal: handle an #if statement
+ /**internal: handle an #if statement*/
protected function parseIf($help,$line)
{
//parse if-line
}
}
}
+ /**internal: handle #set statement*/
protected function parseSet($help,$line)
{
//parse set-line
//prune session cache
$db->deleteRows("session","timeout<=".time());
-/**initiate new session*/
+/**initiate new session - $rand should contain some food for the random number generator (from the host request)*/
function newSession($rand)
{
global $db,$ClientAuthTimeout;
private $sessid="";
private $user="";
+ /**construct the session object, check validity*/
public function __construct()
{
global $_SERVER,$db;
}
}
+ /**returns true if the session exists, it may still be temporary and unauthenticated*/
public function isValid()
{
return $this->sessid!="";
}
+ /**returns true if the session is actually authenticated*/
public function isAuthenticated()
{
return $this->user!="";
}
+ /**helber function for authenticate*/
protected function xdie($str)
{
//debug version:
exit();
}
+ /**runs authentication against the user request*/
public function authenticate()
{
global $db,$REQUESTDATA;
header("Content-Type: application/x-MagicSmoke");
//check whether the request is known
-// all valid requests must be listed here (in lower case)
+/**all valid requests must be listed here (in lower case)*/
$ALLOWEDREQUESTS=array(
"serverinfo", //info request
"startsession","sessionauth","closesession", //session requests
"blah" //...
);
+/**contains the low-level request name from the client*/
$SMOKEREQUEST=strtolower($_SERVER["HTTP_X_MAGICSMOKE_REQUEST"]);
if(!in_array($SMOKEREQUEST,$ALLOWEDREQUESTS)){
header("X-MagicSmoke-Status: InvalidRequest");
die("Invalid Request, please use the MagicSmoke Client with this page.");
}
+/**contains the low-level request data from the client*/
$REQUESTDATA="";
if(isset($HTTP_RAW_POST_DATA)){
$REQUESTDATA=$HTTP_RAW_POST_DATA;
//all others need a valid session, check it
//check session
+/**session object*/
$session=new Session;
if(!$session->isValid()){
header("X-MagicSmoke-Status: Unauthenticated");