diff --git a/livesupport/modules/alib/Makefile b/livesupport/modules/alib/Makefile new file mode 100644 index 000000000..6a496ea3d --- /dev/null +++ b/livesupport/modules/alib/Makefile @@ -0,0 +1,139 @@ +#------------------------------------------------------------------------------- +# Alib - authentication and authorizaction component +# Copyright (c) 2004 Media Development Loan Fund +# +# This file is part of the LiveSupport project. +# +# LiveSupport 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. +# +# LiveSupport 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 LiveSupport; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# +# Author : $Author: tomas $ +# Version : $Revision: 1.1 $ +# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/alib/Attic/Makefile,v $ +# +# @configure_input@ +#------------------------------------------------------------------------------- + +#------------------------------------------------------------------------------- +# General command definitions +#------------------------------------------------------------------------------- +MKDIR = mkdir -p +RM = rm -f +RMDIR = rm -rf +DOXYGEN = doxygen + +#------------------------------------------------------------------------------- +# Misc +#------------------------------------------------------------------------------- + +MODULE_NAME = alib +TAR_C = tar -cj --exclude CVS --exclude '*~' -C ${BASE_DIR} -f +DIST_EXT = .tgz +DATE = `date +%y%m%d` + +#------------------------------------------------------------------------------- +# Basic directory and file definitions +#------------------------------------------------------------------------------- +#BASE_DIR = @builddir@ +BASE_DIR = . +DOC_DIR = ${BASE_DIR}/doc +DOXYGEN_DIR = ${DOC_DIR}/doxygen +ETC_DIR = ${BASE_DIR}/etc +INCLUDE_DIR = ${BASE_DIR}/include +LIB_DIR = ${BASE_DIR}/lib +SRC_DIR = ${BASE_DIR}/src +TMP_DIR = ${BASE_DIR}/tmp + +USR_DIR = ${BASE_DIR}/../../usr +USR_INCLUDE_DIR = ${USR_DIR}/include +USR_LIB_DIR = ${USR_DIR}/lib + +DOXYGEN_CONFIG = ${ETC_DIR}/doxygen.config + +PHP_DIR = ${BASE_DIR}/var +TEST_RUNNER = ${PHP_DIR}/tests/index.php + +#------------------------------------------------------------------------------- +# Configuration parameters +#------------------------------------------------------------------------------- +#CPPFLAGS = @CPPFLAGS@ +#CXXFLAGS = @CXXFLAGS@ @DEFS@ -I${USR_INCLUDE_DIR} -I${INCLUDE_DIR} -I${TMP_DIR}\ +# -pedantic -Wall +#LDFLAGS = @LDFLAGS@ -L${USR_LIB_DIR} -L${LIB_DIR} + + +#------------------------------------------------------------------------------- +# Dependencies +#------------------------------------------------------------------------------- +#HELLO_LIB_OBJS = ${TMP_DIR}/Hello.o +#TEST_RUNNER_OBJS = ${TMP_DIR}/HelloTest.o ${TMP_DIR}/TestRunner.o + + +#------------------------------------------------------------------------------- +# Targets +#------------------------------------------------------------------------------- +.PHONY: all dir_setup doc clean docclean depclean distclean dist db_init db_clean + +all: dir_setup db_init + +#dir_setup: ${TMP_DIR} ${DOXYGEN_DIR} +dir_setup: ${DOXYGEN_DIR} + +doc: + ${DOXYGEN} ${DOXYGEN_CONFIG} + +clean: db_clean +# ${RM} ... + +docclean: + ${RMDIR} ${DOXYGEN_DIR}/html + +depclean: clean + +dist: all + ${TAR_C} ${MODULE_NAME}${DATE}${DIST_EXT} * + +distclean: clean docclean +# ${RMDIR} ${TMP_DIR}/config* ${TMP_DIR}/autom4te* + +check: all ${TEST_RUNNER} + ${TEST_RUNNER} + +#------------------------------------------------------------------------------- +# Specific targets +#------------------------------------------------------------------------------- +# IMPORTANT: db_init and db_clean are commented out only for Livesupport, +# where alib is installed through storage modules + +db_init: +# cd var/install; php -q install.php + +db_clean: +# cd var/install; php -q uninstall.php + +${TMP_DIR}: + ${MKDIR} ${TMP_DIR} + +${DOXYGEN_DIR}: + ${MKDIR} ${DOXYGEN_DIR} + +${TEST_RUNNER}: + +#------------------------------------------------------------------------------- +# Pattern rules +#------------------------------------------------------------------------------- +#${TMP_DIR}/%.o : ${SRC_DIR}/%.cxx +# ${CXX} ${CPPFLAGS} ${CXXFLAGS} -c -o $@ $< + diff --git a/livesupport/modules/alib/doc/aarfc.html b/livesupport/modules/alib/doc/aarfc.html deleted file mode 100644 index 6dd0b51d9..000000000 --- a/livesupport/modules/alib/doc/aarfc.html +++ /dev/null @@ -1,244 +0,0 @@ - - -
- - Authentication - as user's identity
-checking - login call create and return auth token, client sends this token
-with all subsequent calls, logout call make this token invalid
-
Authorization - as checking user's -permission for called action on some object - that's main solved problem. -
-Where:
- Subjects are divided into two types - users and groups. There is membership relation
-(type N:M) from subjects table to itself with "linearization" feature - for
-questions about it send me a mail please ;)
-This approach allows inserting user to group or group to group with quick
-searching of direct and indirect membership.
-
For simple use with existing projects, there would be a object tree -always separated from project's database tables. It would be implemented by -table of objects and information about parent/child (or other) relation -between objects. -
--There is also class table and N:M membership relation between objects and -classes. -
--RootNode - | - |-> Publication_A(publication) - | \-> Issue_1(issue) <--\ - | |-> Sport(section) | <--\ - | \-> Politics(section) | | - \-> Publication_B(publication) | | - |-> Issue_1(issue) <--| | - | |-> Politics(section) | | - | |-> Sport(section) | <--| - | \-> Culture(section) | | - \-> Issue_2(issue) <--| | - |-> Culture(section) | | - \-> Politics(section) | | - | | -Class "Issues" -------------------------------------------/ | -Class "Sport sections" -------------------------------------------/ -- - - -
There are several ways to handle permissions - I've used this:
-allow/deny - all without allow
-permission is denied, but more specified setting may overcome less
-specified
-(e.g. group of users is allowed to do smth., but one specified group-member is
-denied)
-
Permissions are stored as triple [subject, action, object]
-and allow/deny flag.
-
Procedure of permission checking:
-Rem.: Some cache system for authorization decisions would be good ... -
-There are 3 main types of usage:
-Alib(&$dbc, $config) returns objectlogin($login, $pass) returns tokenlogout($sessid) returns booleancheckToken($sessid) returns booleanaddObj($name, $type, $parid, $aftid, $param) returns intremoveObj($id) returns booleanaddSubj($login, $pass) returns intremoveSubj($login) returns booleanaddPerm($sid, $action, $oid, $type) returns intremovePerm($permid, $subj, $obj) returns nullcheckPerm($sid, $action, $oid) returns booleancopyObj($id, $newParid, $after) returns intrenameObj($id, $newName) returns booleangetParent($oid) returns stringgetPath($id, $flds) returns arraygetDir($id, $flds, $order) returns arrayaddClass($cname) returns intremoveClass($cname) returns booleanaddObj2Class($cid, $oid) returns booleanremoveObjFromClass($oid, $cid) returns booleanaddSubj2Gr($login, $gname) returns intremoveSubjFromGr($login, $gname) returns booleanisGroup($gid) returns booleanlistGroup($gid) returns arrayAll methods may return PEAR::error object if fails ...
- PHP applications could include Alib class and call API methods
-directly.
-Other programming platforms should call XMLRPC or HTTP layer above this API.
-
P.S.: sorry for my English ... ;)
- - diff --git a/livesupport/modules/alib/doc/reference.html b/livesupport/modules/alib/doc/reference.html deleted file mode 100644 index 083dd0409..000000000 --- a/livesupport/modules/alib/doc/reference.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - -Classes may be replaced by one branch in object tree ...
- - --subjects < perms > objects/classes - < smemb - cmemb > -- - - diff --git a/livesupport/modules/alib/doc/todo.txt b/livesupport/modules/alib/doc/todo.txt deleted file mode 100644 index ef6a3a915..000000000 --- a/livesupport/modules/alib/doc/todo.txt +++ /dev/null @@ -1,17 +0,0 @@ - - $Id: todo.txt,v 1.1 2004/07/23 00:22:13 tomas Exp $ - -* delete old sessions -* if user have 'classes' permission: - -> create new class ('X') - -> add '_all' perm on class 'X' to himself - -> insert RootNode to class 'X' - => user have all perms ;) -* complete xmlrpc layer - ---- -partialy done: - -. actions would have priority order (or set lower priority to '_all' action only), - temp hack: '_all' action is in string sort after all act names => with ASC order have '_all' lower prio ... ---- diff --git a/livesupport/modules/alib/etc/doxygen.config b/livesupport/modules/alib/etc/doxygen.config new file mode 100644 index 000000000..590d9a545 --- /dev/null +++ b/livesupport/modules/alib/etc/doxygen.config @@ -0,0 +1,1144 @@ +#------------------------------------------------------------------------------- +# doxygen.config +# Copyright (c) 2004 Media Development Loan Fund +# +# This file is part of the LiveSupport project. +# +# LiveSupport 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. +# +# LiveSupport 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 LiveSupport; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# +# Author : $Author: tomas $ +# Version : $Revision: 1.1 $ +# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/alib/etc/doxygen.config,v $ +#------------------------------------------------------------------------------- + +# Doxyfile 1.3.6 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = LiveSupport + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = 1.0 + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = doc/doxygen + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, +# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en +# (Japanese with English messages), Korean, Korean-en, Norwegian, Polish, Portuguese, +# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# This tag can be used to specify the encoding used in the generated output. +# The encoding is not always determined by the language that is chosen, +# but also whether or not the output is meant for Windows or non-Windows users. +# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES +# forces the Windows encoding (this is the default for the Windows binary), +# whereas setting the tag to NO uses a Unix-style encoding (the default for +# all platforms other than Windows). + +USE_WINDOWS_ENCODING = NO + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is used +# as the annotated text. Otherwise, the brief description is used as-is. If left +# blank, the following values are used ("$name" is automatically replaced with the +# name of the entity): "The $name class" "The $name widget" "The $name file" +# "is" "provides" "specifies" "contains" "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited +# members of a class in the documentation of that class as if those members were +# ordinary class members. Constructors, destructors and assignment operators of +# the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. It is allowed to use relative paths in the argument list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like the Qt-style comments (thus requiring an +# explicit @brief command for a brief description. + +JAVADOC_AUTOBRIEF = YES + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = YES + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources +# only. Doxygen will then generate output that is more tailored for Java. +# For instance, namespaces will be presented as packages, qualified scopes +# will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +#EXTRACT_ALL = NO +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = var var/xmlrpc + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp +# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc + +FILE_PATTERNS = *.php + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories +# that are symbolic links (a Unix filesystem feature) are excluded from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. + +EXCLUDE_PATTERNS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command
\ncorrect:\n{$this->test_correct}\ndump:\n{$this->test_dump}\n\n");
+ if($this->test_dump==$this->test_correct)
+ { $this->test_log.="alib: OK\n"; return TRUE;
+ }else return PEAR::raiseError('Alib::test', 1, PEAR_ERROR_DIE, '%s'.
+ "\ncorrect:\n{$this->test_correct}\n".
+ "dump:\n{$this->test_dump}\n\n");
}
/**
- * install - create tables + initialize
- *
- * @return void
- **/
+ * Create tables + initialize
+ *
+ * @return void
+ */
function install()
{
parent::install();
@@ -413,8 +479,10 @@ class Alib extends Subjects{
obj int,
type char(1)
)");
- $this->dbc->query("CREATE UNIQUE INDEX {$this->permTable}_permid_idx on {$this->permTable} (permid)");
- $this->dbc->query("CREATE INDEX {$this->permTable}_subj_obj_idx on {$this->permTable} (subj, obj)");
+ $this->dbc->query("CREATE UNIQUE INDEX {$this->permTable}_permid_idx
+ ON {$this->permTable} (permid)");
+ $this->dbc->query("CREATE INDEX {$this->permTable}_subj_obj_idx
+ ON {$this->permTable} (subj, obj)");
$this->dbc->createSequence("{$this->permTable}_id_seq");
$this->dbc->query("CREATE TABLE {$this->sessTable} (
@@ -423,16 +491,19 @@ class Alib extends Subjects{
login varchar(255),
ts timestamp
)");
- $this->dbc->query("CREATE UNIQUE INDEX {$this->sessTable}_sessid_idx on {$this->sessTable} (sessid)");
- $this->dbc->query("CREATE INDEX {$this->sessTable}_userid_idx on {$this->sessTable} (userid)");
- $this->dbc->query("CREATE INDEX {$this->sessTable}_login_idx on {$this->sessTable} (login)");
+ $this->dbc->query("CREATE UNIQUE INDEX {$this->sessTable}_sessid_idx
+ ON {$this->sessTable} (sessid)");
+ $this->dbc->query("CREATE INDEX {$this->sessTable}_userid_idx
+ ON {$this->sessTable} (userid)");
+ $this->dbc->query("CREATE INDEX {$this->sessTable}_login_idx
+ ON {$this->sessTable} (login)");
}
/**
- * uninstall
- *
- * @return void
- **/
+ * Drop tables etc.
+ *
+ * @return void
+ */
function uninstall()
{
$this->dbc->query("DROP TABLE {$this->permTable}");
diff --git a/livesupport/modules/alib/var/class.php b/livesupport/modules/alib/var/class.php
index 0c878bf86..d034a6e62 100644
--- a/livesupport/modules/alib/var/class.php
+++ b/livesupport/modules/alib/var/class.php
@@ -1,23 +1,54 @@
cmembTable = $config['tblNamePrefix'].'cmemb';
}
- /* ========== public methods: ========== */
+ /* ======================================================= public methods */
/**
- * addClass
- *
- * @param cname string
- * @return id/error
- **/
+ * Add new class of objects
+ *
+ * @param cname string
+ * @return id/error
+ */
function addClass($cname)
{
- $id = $this->dbc->nextId("{$this->treeTable}_id_seq"); if(PEAR::isError($id)) return $id;
+ $id = $this->dbc->nextId("{$this->treeTable}_id_seq");
+ if(PEAR::isError($id)) return $id;
$r = $this->dbc->query("
INSERT INTO {$this->classTable} (id, cname)
VALUES ($id, '$cname')
@@ -45,146 +77,156 @@ class ObjClasses extends Mtree{
}
/**
- * removeClass
- *
- * @param cname string
- * @return boolean/err
- **/
+ * Remove class by name
+ *
+ * @param cname string
+ * @return boolean/err
+ */
function removeClass($cname)
{
- $cid = $this->getClassId($cname); if(PEAR::isError($cid)) return($cid);
+ $cid = $this->getClassId($cname);
+ if(PEAR::isError($cid)) return($cid);
return $this->removeClassById($cid);
}
/**
- * removeClassById
- *
- * @param cid int
- * @return boolean/err
- **/
+ * Remove class by id
+ *
+ * @param cid int
+ * @return boolean/err
+ */
function removeClassById($cid)
{
- $r = $this->dbc->query("DELETE FROM {$this->cmembTable} WHERE cid=$cid");
+ $r = $this->dbc->query("DELETE FROM {$this->cmembTable}
+ WHERE cid=$cid");
if(PEAR::isError($r)) return $r;
- $r = $this->dbc->query("DELETE FROM {$this->classTable} WHERE id=$cid");
+ $r = $this->dbc->query("DELETE FROM {$this->classTable}
+ WHERE id=$cid");
if(PEAR::isError($r)) return $r;
return TRUE;
}
/**
- * addObj2Class
- *
- * @param cid int
- * @param oid int
- * @return boolean/err
- **/
+ * Add object to class
+ *
+ * @param cid int
+ * @param oid int
+ * @return boolean/err
+ */
function addObj2Class($cid, $oid)
{
- $r = $this->dbc->query("INSERT INTO {$this->cmembTable} (cid, objid) VALUES ($cid, $oid)");
+ $r = $this->dbc->query("INSERT INTO {$this->cmembTable} (cid, objid)
+ VALUES ($cid, $oid)");
if(PEAR::isError($r)) return $r;
return TRUE;
}
/**
- * removeObjFromClass
- *
- * @param oid int
- * @param cid int OPT // if not specified, remove obj from all classes
- * @return boolean/err
- **/
+ * Remove object from class
+ *
+ * @param oid int
+ * @param cid int, optional, default: remove obj from all classes
+ * @return boolean/err
+ */
function removeObjFromClass($oid, $cid=NULL)
{
- $r = $this->dbc->query("DELETE FROM {$this->cmembTable} WHERE objid=$oid".(is_null($cid)? '':" AND cid=$cid"));
+ $r = $this->dbc->query("DELETE FROM {$this->cmembTable}
+ WHERE objid=$oid".(is_null($cid)? '':" AND cid=$cid"));
if(PEAR::isError($r)) return $r;
return TRUE;
}
- /* --- object tree --- */
+ /* ---------------------------------------------------------- object tree */
/**
- * removeObj
- *
- * @param id int
- * @return boolean/err
- **/
+ * Remove object from all classes and remove object itself
+ *
+ * @param id int
+ * @return boolean/err
+ */
function removeObj($id)
{
- $r = $this->removeObjFromClass($id); if(PEAR::isError($r)) return $r;
+ $r = $this->removeObjFromClass($id);
+ if(PEAR::isError($r)) return $r;
return parent::removeObj($id);
}
- /* --- info methods: --- */
+ /* --------------------------------------------------------- info methods */
/**
- * getClassId
- *
- * @param cname string
- * @return int/err
- **/
+ * Get class id from name
+ *
+ * @param cname string
+ * @return int/err
+ */
function getClassId($cname)
{
- return $this->dbc->getOne($query = "SELECT id FROM {$this->classTable} WHERE cname='$cname'");
+ return $this->dbc->getOne($query = "SELECT id FROM {$this->classTable}
+ WHERE cname='$cname'");
}
/**
- * getClassName
- *
- * @param id int
- * @return string/err
- **/
+ * Get class name from id
+ *
+ * @param id int
+ * @return string/err
+ */
function getClassName($id)
{
- return $this->dbc->getOne($query = "SELECT cname FROM {$this->classTable} WHERE id=$id");
+ return $this->dbc->getOne(
+ $query = "SELECT cname FROM {$this->classTable}WHERE id=$id");
}
/**
- * isClass
- *
- * @param id int
- * @return boolean/err
- **/
+ * Return true is object is class
+ *
+ * @param id int
+ * @return boolean/err
+ */
function isClass($id)
{
- $r = $this->dbc->getOne("SELECT count(*) FROM {$this->classTable} WHERE id=$id");
+ $r = $this->dbc->getOne("SELECT count(*) FROM {$this->classTable}
+ WHERE id=$id");
if(PEAR::isError($r)) return $r;
return ($r > 0);
}
/**
- * getClasses
- *
- * @return array/err
- **/
+ * Return all classes
+ *
+ * @return array/err
+ */
function getClasses()
{
return $this->dbc->getAll("SELECT * FROM {$this->classTable}");
}
/**
- * listClass
- *
- * @param id int
- * @return array/err
- **/
+ * Return all objects in class
+ *
+ * @param id int
+ * @return array/err
+ */
function listClass($id)
{
- return $this->dbc->getAll("SELECT t.* FROM {$this->cmembTable} cm, {$this->treeTable} t
+ return $this->dbc->getAll("
+ SELECT t.* FROM {$this->cmembTable} cm, {$this->treeTable} t
WHERE cm.cid=$id AND cm.objid=t.id");
}
- /* ========== test and debug methods: ========== */
+ /* =============================================== test and debug methods */
/**
- * dumpClasses
- *
- * @param id int
- * @param indstr string // indentation string
- * @param ind string // aktual indentation
- * @return string
- **/
+ * Dump all classes fot debug
+ *
+ * @param indstr string // indentation string
+ * @param ind string // aktual indentation
+ * @return string
+ */
function dumpClasses($indstr=' ', $ind='')
{
- $r = $ind.join(', ', array_map(create_function('$v', 'return "{$v[\'cname\']} ({$v[\'cnt\']})";'),
+ $r = $ind.join(', ', array_map(
+ create_function('$v', 'return "{$v[\'cname\']} ({$v[\'cnt\']})";'),
$this->dbc->getAll("
SELECT cname, count(cm.objid)as cnt FROM {$this->classTable} c
LEFT JOIN {$this->cmembTable} cm ON c.id=cm.cid
@@ -195,15 +237,19 @@ class ObjClasses extends Mtree{
}
/**
- * testData
- *
- **/
+ * Delete all classes and membeship records
+ *
+ */
function deleteData()
{
$this->dbc->query("DELETE FROM {$this->cmembTable}");
$this->dbc->query("DELETE FROM {$this->classTable}");
parent::deleteData();
}
+ /**
+ * Insert test data
+ *
+ */
function testData()
{
parent::testData();
@@ -215,9 +261,9 @@ class ObjClasses extends Mtree{
}
/**
- * test
- *
- **/
+ * Make basic test
+ *
+ */
function test()
{
if(PEAR::isError($p = parent::test())) return $p;
@@ -226,19 +272,23 @@ class ObjClasses extends Mtree{
$this->test_correct = "Sections b (0), Class 2 (2)\n";
$this->test_dump = $this->dumpClasses();
$this->removeClass('Sections b');
- $this->removeObjFromClass($this->tdata['tree'][4], $this->tdata['classes'][1]);
+ $this->removeObjFromClass($this->tdata['tree'][4],
+ $this->tdata['classes'][1]);
$this->test_correct .= "Class 2 (1)\n";
$this->test_dump .= $this->dumpClasses();
$this->deleteData();
- if($this->test_dump==$this->test_correct){ $this->test_log.="class: OK\n"; return TRUE; }
- else return PEAR::raiseError('ObjClasses::test:', 1, PEAR_ERROR_DIE, '%s'.
- "\ncorrect:\n{$this->test_correct}\ndump:\n{$this->test_dump}\n\n");
+ if($this->test_dump==$this->test_correct){
+ $this->test_log.="class: OK\n"; return TRUE;
+ }else return PEAR::raiseError(
+ 'ObjClasses::test:', 1, PEAR_ERROR_DIE, '%s'.
+ "\ncorrect:\n{$this->test_correct}\n".
+ "dump:\n{$this->test_dump}\n\n");
}
/**
- * install - create tables + initialize
- *
- **/
+ * Create tables + initialize
+ *
+ */
function install()
{
parent::install();
@@ -246,15 +296,22 @@ class ObjClasses extends Mtree{
id int not null,
cname varchar(20)
)");
- $this->dbc->query("CREATE UNIQUE INDEX {$this->classTable}_id_idx on {$this->classTable} (id)");
- $this->dbc->query("CREATE UNIQUE INDEX {$this->classTable}_cname_idx on {$this->classTable} (cname)");
+ $this->dbc->query("CREATE UNIQUE INDEX {$this->classTable}_id_idx
+ ON {$this->classTable} (id)");
+ $this->dbc->query("CREATE UNIQUE INDEX {$this->classTable}_cname_idx
+ ON {$this->classTable} (cname)");
$this->dbc->query("CREATE TABLE {$this->cmembTable} (
objid int not null,
cid int not null
)");
- $this->dbc->query("CREATE UNIQUE INDEX {$this->cmembTable}_idx on {$this->cmembTable} (objid, cid)");
+ $this->dbc->query("CREATE UNIQUE INDEX {$this->cmembTable}_idx
+ ON {$this->cmembTable} (objid, cid)");
}
+ /**
+ * Drop tables etc.
+ *
+ */
function uninstall()
{
$this->dbc->query("DROP TABLE {$this->classTable}");
diff --git a/livesupport/modules/alib/var/example/alibExCls.php b/livesupport/modules/alib/var/example/alibExCls.php
index 7db05e3de..5d3d45d8d 100644
--- a/livesupport/modules/alib/var/example/alibExCls.php
+++ b/livesupport/modules/alib/var/example/alibExCls.php
@@ -1,7 +1,34 @@
diff --git a/livesupport/modules/alib/var/example/alibExLogin.php b/livesupport/modules/alib/var/example/alibExLogin.php
index 18225964e..082b182b7 100644
--- a/livesupport/modules/alib/var/example/alibExLogin.php
+++ b/livesupport/modules/alib/var/example/alibExLogin.php
@@ -1,6 +1,33 @@
@@ -100,7 +127,7 @@ Permission matrix for subject: