From 8d5bc9f865f9cb83aae242646a25b9a3893fef15 Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 16 Oct 2006 16:14:30 +0000 Subject: [PATCH] Got rid of copyright notice in files, we will just have one that covers all files at the root of the package. Converted comments to Phpdocumentor format. Added @author, @version, @package, and @subpackage doc tags. Reformatted code to Campware PHP coding conventions. --- livesupport/src/modules/alib/var/alib.php | 100 +++---- livesupport/src/modules/alib/var/class.php | 110 ++++--- .../modules/alib/var/example/alibExCls.php | 34 +-- .../modules/alib/var/example/alibExLogin.php | 32 +-- .../modules/alib/var/example/alibExPList.php | 33 +-- .../alib/var/example/alibExPMatrix.php | 34 +-- .../modules/alib/var/example/alibExPerms.php | 33 +-- .../modules/alib/var/example/alibExSubj.php | 33 +-- .../alib/var/example/alibExTestAuth.php | 37 +-- .../modules/alib/var/example/alibExTree.php | 33 +-- .../src/modules/alib/var/example/alibHttp.php | 34 +-- .../src/modules/alib/var/example/conf.php | 32 +-- .../src/modules/alib/var/example/index.php | 2 +- livesupport/src/modules/alib/var/index.php | 30 -- .../src/modules/alib/var/install/install.php | 36 +-- .../modules/alib/var/install/uninstall.php | 34 +-- livesupport/src/modules/alib/var/m2tree.php | 268 ++++++++++-------- livesupport/src/modules/alib/var/subj.php | 81 +++--- .../src/modules/alib/var/xmlrpc/alib_xr.php | 34 +-- .../src/modules/alib/var/xmlrpc/index.php | 31 +- .../modules/alib/var/xmlrpc/xr_cli_test.php | 34 +-- 21 files changed, 375 insertions(+), 720 deletions(-) diff --git a/livesupport/src/modules/alib/var/alib.php b/livesupport/src/modules/alib/var/alib.php index 51d4176c1..f1b97d2db 100644 --- a/livesupport/src/modules/alib/var/alib.php +++ b/livesupport/src/modules/alib/var/alib.php @@ -1,33 +1,4 @@ cmembTable = $config['tblNamePrefix'].'cmemb'; } + /* ======================================================= public methods */ /** @@ -67,15 +43,20 @@ class ObjClasses extends M2tree{ function addClass($cname) { $id = $this->dbc->nextId("{$this->treeTable}_id_seq"); - if(PEAR::isError($id)) return $id; + if (PEAR::isError($id)) { + return $id; + } $r = $this->dbc->query(" INSERT INTO {$this->classTable} (id, cname) VALUES ($id, '$cname') "); - if(PEAR::isError($r)) return $r; + if (PEAR::isError($r)) { + return $r; + } return $id; } + /** * Remove class by name * @@ -85,10 +66,13 @@ class ObjClasses extends M2tree{ function removeClass($cname) { $cid = $this->getClassId($cname); - if(PEAR::isError($cid)) return($cid); + if (PEAR::isError($cid)) { + return($cid); + } return $this->removeClassById($cid); } + /** * Remove class by id * @@ -99,13 +83,18 @@ class ObjClasses extends M2tree{ { $r = $this->dbc->query("DELETE FROM {$this->cmembTable} WHERE cid=$cid"); - if(PEAR::isError($r)) return $r; + if (PEAR::isError($r)) { + return $r; + } $r = $this->dbc->query("DELETE FROM {$this->classTable} WHERE id=$cid"); - if(PEAR::isError($r)) return $r; + if (PEAR::isError($r)) { + return $r; + } return TRUE; } + /** * Add object to class * @@ -117,10 +106,13 @@ class ObjClasses extends M2tree{ { $r = $this->dbc->query("INSERT INTO {$this->cmembTable} (cid, objid) VALUES ($cid, $oid)"); - if(PEAR::isError($r)) return $r; + if (PEAR::isError($r)) { + return $r; + } return TRUE; } + /** * Remove object from class * @@ -132,10 +124,13 @@ class ObjClasses extends M2tree{ { $r = $this->dbc->query("DELETE FROM {$this->cmembTable} WHERE objid=$oid".(is_null($cid)? '':" AND cid=$cid")); - if(PEAR::isError($r)) return $r; + if (PEAR::isError($r)) { + return $r; + } return TRUE; } + /* ---------------------------------------------------------- object tree */ /** @@ -147,10 +142,13 @@ class ObjClasses extends M2tree{ function removeObj($id) { $r = $this->removeObjFromClass($id); - if(PEAR::isError($r)) return $r; + if (PEAR::isError($r)) { + return $r; + } return parent::removeObj($id); } + /* --------------------------------------------------------- info methods */ /** @@ -166,6 +164,7 @@ class ObjClasses extends M2tree{ WHERE cname='$cname'"); } + /** * Get class name from id * @@ -178,6 +177,7 @@ class ObjClasses extends M2tree{ $query = "SELECT cname FROM {$this->classTable} WHERE id=$id"); } + /** * Return true is object is class * @@ -188,10 +188,13 @@ class ObjClasses extends M2tree{ { $r = $this->dbc->getOne("SELECT count(*) FROM {$this->classTable} WHERE id=$id"); - if(PEAR::isError($r)) return $r; + if (PEAR::isError($r)) { + return $r; + } return ($r > 0); } + /** * Return all classes * @@ -202,6 +205,7 @@ class ObjClasses extends M2tree{ return $this->dbc->getAll("SELECT * FROM {$this->classTable}"); } + /** * Return all objects in class * @@ -215,6 +219,7 @@ class ObjClasses extends M2tree{ WHERE cm.cid=$id AND cm.objid=t.id"); } + /* =============================================== test and debug methods */ /** @@ -237,6 +242,7 @@ class ObjClasses extends M2tree{ return $r; } + /** * Delete all classes and membeship records * @@ -247,6 +253,8 @@ class ObjClasses extends M2tree{ $this->dbc->query("DELETE FROM {$this->classTable}"); parent::reset(); } + + /** * Insert test data * @@ -263,13 +271,16 @@ class ObjClasses extends M2tree{ $this->tdata['classes'] = $o; } + /** * Make basic test * */ function test() { - if(PEAR::isError($p = parent::test())) return $p; + if (PEAR::isError($p = parent::test())) { + return $p; + } $this->deleteData(); $this->testData(); $this->test_correct = "Sections a (2), Class 2 (2)\n"; @@ -280,14 +291,17 @@ class ObjClasses extends M2tree{ $this->test_correct .= "Class 2 (1)\n"; $this->test_dump .= $this->dumpClasses(); $this->deleteData(); - if($this->test_dump==$this->test_correct){ + if ($this->test_dump==$this->test_correct) { $this->test_log.="class: OK\n"; return TRUE; - }else return PEAR::raiseError( + } else { + return PEAR::raiseError( 'ObjClasses::test:', 1, PEAR_ERROR_DIE, '%s'. "
\ncorrect:\n{$this->test_correct}\n".
             "dump:\n{$this->test_dump}\n
\n"); + } } + /** * Create tables + initialize * @@ -311,6 +325,8 @@ class ObjClasses extends M2tree{ $this->dbc->query("CREATE UNIQUE INDEX {$this->cmembTable}_idx ON {$this->cmembTable} (objid, cid)"); } + + /** * Drop tables etc. * @@ -321,5 +337,5 @@ class ObjClasses extends M2tree{ $this->dbc->query("DROP TABLE {$this->cmembTable}"); parent::uninstall(); } -} +} // class ObjClasses ?> \ No newline at end of file diff --git a/livesupport/src/modules/alib/var/example/alibExCls.php b/livesupport/src/modules/alib/var/example/alibExCls.php index 805e5cfbd..8b1fed8f6 100644 --- a/livesupport/src/modules/alib/var/example/alibExCls.php +++ b/livesupport/src/modules/alib/var/example/alibExCls.php @@ -1,32 +1,8 @@ User/Group editor
- +

Class editor

diff --git a/livesupport/src/modules/alib/var/example/alibExLogin.php b/livesupport/src/modules/alib/var/example/alibExLogin.php index 69b1e1e45..d067810e8 100644 --- a/livesupport/src/modules/alib/var/example/alibExLogin.php +++ b/livesupport/src/modules/alib/var/example/alibExLogin.php @@ -1,32 +1,8 @@ Class editor
User/group editor
- +

Subject permission list

Permissions for subject :

diff --git a/livesupport/src/modules/alib/var/example/alibExPMatrix.php b/livesupport/src/modules/alib/var/example/alibExPMatrix.php index 75c8f8cc1..5d4cf63d3 100644 --- a/livesupport/src/modules/alib/var/example/alibExPMatrix.php +++ b/livesupport/src/modules/alib/var/example/alibExPMatrix.php @@ -1,32 +1,8 @@ getAllObjects(); foreach($alib->getClasses() as $cl) $all[] = array('name'=>$cl['cname']." (class)", 'id'=>$cl['id']); - + foreach($all as $it){ $aa=array(); foreach($alib->getAllActions() as $a){ diff --git a/livesupport/src/modules/alib/var/example/alibExPerms.php b/livesupport/src/modules/alib/var/example/alibExPerms.php index 21e9d438b..7d8c66835 100644 --- a/livesupport/src/modules/alib/var/example/alibExPerms.php +++ b/livesupport/src/modules/alib/var/example/alibExPerms.php @@ -1,32 +1,9 @@ Class editor
User/Group editor
- +

Permission editor

Path: diff --git a/livesupport/src/modules/alib/var/example/alibExSubj.php b/livesupport/src/modules/alib/var/example/alibExSubj.php index 581958aa8..25f167bde 100644 --- a/livesupport/src/modules/alib/var/example/alibExSubj.php +++ b/livesupport/src/modules/alib/var/example/alibExSubj.php @@ -1,32 +1,9 @@ Class editor
- +

User/Group editor

diff --git a/livesupport/src/modules/alib/var/example/alibExTestAuth.php b/livesupport/src/modules/alib/var/example/alibExTestAuth.php index 969f564aa..0eef588b4 100644 --- a/livesupport/src/modules/alib/var/example/alibExTestAuth.php +++ b/livesupport/src/modules/alib/var/example/alibExTestAuth.php @@ -1,36 +1,13 @@ -getSessLogin($_REQUEST['alibsid']); if(!isset($login)||$login==''){ $_SESSION['alertMsg'] = "Login required"; header("Location: alibExLogin.php"); exit; } -?> + +?> \ No newline at end of file diff --git a/livesupport/src/modules/alib/var/example/alibExTree.php b/livesupport/src/modules/alib/var/example/alibExTree.php index 452fa7c44..393d04c98 100644 --- a/livesupport/src/modules/alib/var/example/alibExTree.php +++ b/livesupport/src/modules/alib/var/example/alibExTree.php @@ -1,32 +1,9 @@ Class editor
User/Group editor
- +

Tree editor

Path: $it) {?> diff --git a/livesupport/src/modules/alib/var/example/alibHttp.php b/livesupport/src/modules/alib/var/example/alibHttp.php index cdfa62401..8a21db463 100644 --- a/livesupport/src/modules/alib/var/example/alibHttp.php +++ b/livesupport/src/modules/alib/var/example/alibHttp.php @@ -1,32 +1,8 @@ -\nGET:\n"; print_r($_GET); echo"POST:\n"; print_r($_POST); exit; diff --git a/livesupport/src/modules/alib/var/example/conf.php b/livesupport/src/modules/alib/var/example/conf.php index b606bab43..b3c3e2fc5 100644 --- a/livesupport/src/modules/alib/var/example/conf.php +++ b/livesupport/src/modules/alib/var/example/conf.php @@ -1,32 +1,8 @@ array( // data source definition diff --git a/livesupport/src/modules/alib/var/example/index.php b/livesupport/src/modules/alib/var/example/index.php index d8594b2d1..402b92e6a 100644 --- a/livesupport/src/modules/alib/var/example/index.php +++ b/livesupport/src/modules/alib/var/example/index.php @@ -4,4 +4,4 @@ header ("location: alibExLogin.php"); die; -?> +?> \ No newline at end of file diff --git a/livesupport/src/modules/alib/var/index.php b/livesupport/src/modules/alib/var/index.php index a9c98ece4..89a7d9fc7 100644 --- a/livesupport/src/modules/alib/var/index.php +++ b/livesupport/src/modules/alib/var/index.php @@ -1,33 +1,3 @@ - ALib module diff --git a/livesupport/src/modules/alib/var/install/install.php b/livesupport/src/modules/alib/var/install/install.php index a2e528cbe..941c73efc 100644 --- a/livesupport/src/modules/alib/var/install/install.php +++ b/livesupport/src/modules/alib/var/install/install.php @@ -1,32 +1,8 @@ setFetchMode(DB_FETCHMODE_ASSOC); $alib =& new Alib($dbc, $config); -echo "\n\n======\n". +echo "\n\n======\n". "This is Alib standalone installation script, it is NOT needed to run ". - "for Livesupport.\nAlib is automatically used by storageServer without it.". + "for Campcaster.\nAlib is automatically used by storageServer without it.". "\n======\n\n"; echo "Alib: uninstall ...\n"; diff --git a/livesupport/src/modules/alib/var/install/uninstall.php b/livesupport/src/modules/alib/var/install/uninstall.php index 7f54d2274..e1906f487 100644 --- a/livesupport/src/modules/alib/var/install/uninstall.php +++ b/livesupport/src/modules/alib/var/install/uninstall.php @@ -1,32 +1,8 @@ uninstall(); $dbc->disconnect(); -?> +?> \ No newline at end of file diff --git a/livesupport/src/modules/alib/var/m2tree.php b/livesupport/src/modules/alib/var/m2tree.php index 7a9264d31..be2a3838d 100644 --- a/livesupport/src/modules/alib/var/m2tree.php +++ b/livesupport/src/modules/alib/var/m2tree.php @@ -2,12 +2,12 @@ define('ALIBERR_MTREE', 10); /** - * M2tree class + * M2tree class * - * class for tree hierarchy stored in db + * A class for tree hierarchy stored in db. * - * example config: example/conf.php
- * example minimal config: + * example config: example/conf.php
+ * example minimal config: *

  *    $config = array(
  *        'dsn'       => array(           // data source definition
@@ -21,12 +21,16 @@ define('ALIBERR_MTREE', 10);
  *        'RootNode'	=>'RootNode',
  *    );
  *   
- * @author $Author$ - * @version $Revision$ - * @see ObjClasses - * Original author Tom Hlava + * + * @author $Author$ + * @version $Revision$ + * @package Campcaster + * @subpackage Alib + * @see ObjClasses + * + * Original author Tom Hlava */ -class M2tree{ +class M2tree { /** * Database object container */ @@ -53,11 +57,10 @@ class M2tree{ var $rootNodeName; /** - * Constructor + * Constructor * - * @param dbc object - * @param config array - * @return this + * @param DB $dbc + * @param array $config */ function M2tree(&$dbc, $config) { @@ -71,13 +74,17 @@ class M2tree{ /* ======================================================= public methods */ /** - * Add new object of specified type to the tree under specified parent - * node + * Add new object of specified type to the tree under specified parent + * node * - * @param string $name, mnemonic name for new object - * @param string $type, type of new object - * @param int $parid, optional, parent id - * @return int/err - new id of inserted object or PEAR::error + * @param string $name + * mnemonic name for new object + * @param string $type + * type of new object + * @param int $parid + * optional, parent id + * @return mixed + * int/err - new id of inserted object or PEAR::error */ function addObj($name, $type, $parid = NULL) { @@ -138,14 +145,16 @@ class M2tree{ /** - * Remove specified object + * Remove specified object * - * @param int $oid, object id to remove - * @return boolean/err - TRUE or PEAR::error + * @param int $oid + * object id to remove + * @return mixed + * boolean/err - TRUE or PEAR::error */ function removeObj($oid) { - if ($oid == $this->getRootNode()){ + if ($oid == $this->getRootNode()) { return $this->dbc->raiseError( "M2tree::removeObj: Can't remove root" ); @@ -154,7 +163,7 @@ class M2tree{ if ($this->dbc->isError($dir)) { return $dir; } - foreach ($dir as $k => $ch){ + foreach ($dir as $k => $ch) { $r = $this->removeObj($ch['id']); if ($this->dbc->isError($r)) { return $r; @@ -172,24 +181,28 @@ class M2tree{ DELETE FROM {$this->structTable} WHERE objid=$oid "); - if($this->dbc->isError($r)) return $r; + if ($this->dbc->isError($r)) return $r; */ return TRUE; } // fn removeObj /** - * Create copy of specified object and insert copy to new position - * recursively + * Create copy of specified object and insert copy to new position + * recursively * - * @param oid int, source object id - * @param newParid int, destination parent id - * @param after null, dummy argument for back-compatibility - * @return int/err - new id of inserted object or PEAR::error + * @param int $oid + * source object id + * @param int $newParid + * destination parent id + * @param null $after + * dummy argument for back-compatibility + * @return mixed + * int/err - new id of inserted object or PEAR::error */ function copyObj($oid, $newParid, $after=NULL) { - if (TRUE === ($r = $this->isChildOf($newParid, $oid, TRUE))){ + if (TRUE === ($r = $this->isChildOf($newParid, $oid, TRUE))) { return $this->dbc->raiseError( "M2tree::copyObj: Can't copy into itself" ); @@ -230,7 +243,7 @@ class M2tree{ return $nid; } // optionally insert children recursively: - foreach ($dir as $k => $item){ + foreach ($dir as $k => $item) { $r = $this->copyObj($item['id'], $nid); if ($this->dbc->isError($r)) { return $r; @@ -241,11 +254,12 @@ class M2tree{ /** - * Move subtree to another node without removing/adding + * Move subtree to another node without removing/adding * - * @param oid int - * @param newParid int - * @param after null, dummy argument for back-compatibility + * @param int $oid + * @param int $newParid + * @param null $after + * dummy argument for back-compatibility * @return boolean/err */ function moveObj($oid, $newParid, $after=NULL) @@ -281,7 +295,7 @@ class M2tree{ if ($this->dbc->isError($xid)) { return $this->_dbRollback($xid); } - if ($name != $name0){ + if ($name != $name0) { $r = $this->renameObj($oid, $name); if ($this->dbc->isError($r)) { return $this->_dbRollback($r); @@ -301,11 +315,14 @@ class M2tree{ /** - * Rename of specified object + * Rename of specified object * - * @param int $oid, object id to rename - * @param string $newName, new name - * @return boolean/err - True or PEAR::error + * @param int $oid + * object id to rename + * @param string $newName + * new name + * @return mixed + * boolean/err - True or PEAR::error */ function renameObj($oid, $newName) { @@ -338,11 +355,14 @@ class M2tree{ /* --------------------------------------------------------- info methods */ /** - * Search for child id by name in sibling set + * Search for child id by name in sibling set * - * @param string $name, searched name - * @param int $parId, optional, parent id (default is root node) - * @return int/null/err - child id (if found) or null or PEAR::error + * @param string $name + * searched name + * @param int $parId + * optional, parent id (default is root node) + * @return mixed + * int/null/err - child id (if found) or null or PEAR::error */ function getObjId($name, $parId = null) { @@ -365,11 +385,13 @@ class M2tree{ /** - * Get one value for object by id (default: get name) + * Get one value for object by id (default: get name) * - * @param int $oid - * @param string $fld, optional, requested field (default: name) - * @return string/err + * @param int $oid + * @param string $fld + * optional, requested field (default: name) + * @return mixed + * string/err */ function getObjName($oid, $fld='name') { @@ -382,10 +404,10 @@ class M2tree{ /** - * Get object type by id. + * Get object type by id. * - * @param int $oid - * @return string/err + * @param int $oid + * @return string/err */ function getObjType($oid) { @@ -394,10 +416,10 @@ class M2tree{ /** - * Get parent id + * Get parent id * - * @param int $oid - * @return int/err + * @param int $oid + * @return int/err */ function getParent($oid) { @@ -410,12 +432,13 @@ class M2tree{ /** - * Get array of nodes in object's path from root node + * Get array of nodes in object's path from root node * - * @param int $oid - * @param string $flds, optional - * @param boolean $withSelf - flag for include specified object to the path - * @return array/err + * @param int $oid + * @param string $flds, optional + * @param boolean $withSelf + * flag for include specified object to the path + * @return array/err */ function getPath($oid, $flds='id', $withSelf=TRUE) { @@ -426,13 +449,17 @@ class M2tree{ WHERE objid=$oid ORDER BY coalesce(level, 0) DESC "); - if($this->dbc->isError($path)) return $path; - if($withSelf){ + if ($this->dbc->isError($path)) { + return $path; + } + if ($withSelf) { $r = $this->dbc->getRow(" SELECT $flds FROM {$this->treeTable} WHERE id=$oid "); - if($this->dbc->isError($r)) return $r; + if ($this->dbc->isError($r)) { + return $r; + } array_push($path, $r); } return $path; @@ -440,12 +467,14 @@ class M2tree{ /** - * Get array of childnodes + * Get array of childnodes * - * @param int $oid - * @param string $flds, optional, comma separated list of requested fields - * @param string $order, optional, fieldname for order by clause - * @return array/err + * @param int $oid + * @param string $flds + * optional, comma separated list of requested fields + * @param string $order + * optional, fieldname for order by clause + * @return array/err */ function getDir($oid, $flds='id', $order='name') { @@ -461,14 +490,17 @@ class M2tree{ /** - * Get level of object relatively to specified root + * Get level of object relatively to specified root * - * @param int $oid, object id - * @param string $flds, list of field names for select + * @param int $oid + * object id + * @param string $flds + * list of field names for select * (optional - default: 'level') - * @param int $rootId, root for relative levels + * @param int $rootId + * root for relative levels * (optional - default: NULL - use root of whole tree) - * @return hash-array with field name/value pairs + * @return hash-array with field name/value pairs */ function getObjLevel($oid, $flds='level', $rootId=NULL) { @@ -490,19 +522,23 @@ class M2tree{ /** - * Get subtree of specified node + * Get subtree of specified node * - * @param int $oid, optional, default: root node - * @param boolean $withRoot, optional, include/exclude specified node - * @param int $rootId, root for relative levels, optional - * @return array/err + * @param int $oid + * optional, default: root node + * @param boolean $withRoot + * optional, include/exclude specified node + * @param int $rootId + * root for relative levels, optional + * @return mixed + * array/err */ function getSubTree($oid=NULL, $withRoot=FALSE, $rootId=NULL) { - if(is_null($oid)) $oid = $this->getRootNode(); - if(is_null($rootId)) $rootId = $oid; + if (is_null($oid)) $oid = $this->getRootNode(); + if (is_null($rootId)) $rootId = $oid; $r = array(); - if($withRoot){ + if ($withRoot) { $r[] = $re = $this->getObjLevel($oid, 'id, name, level', $rootId); } else { $re=NULL; @@ -516,7 +552,7 @@ class M2tree{ } foreach ($dirarr as $k => $snod) { $re = $this->getObjLevel($snod['id'], 'id, name, level', $rootId); - if($this->dbc->isError($re)) { + if ($this->dbc->isError($re)) { return $re; } # $re['level'] = intval($re['level'])+1; @@ -529,16 +565,19 @@ class M2tree{ /** - * Returns true if first object if child of second one + * Returns true if first object if child of second one * - * @param int $oid, object id of tested object - * @param int $parid, object id of parent - * @param boolean $indirect, test indirect or only direct relation - * @return boolean + * @param int $oid + * object id of tested object + * @param int $parid + * object id of parent + * @param boolean $indirect + * test indirect or only direct relation + * @return boolean */ function isChildOf($oid, $parid, $indirect=FALSE) { - if (!$indirect){ + if (!$indirect) { $paridD = $this->getParent($oid); if ($this->dbc->isError($paridD)) { return $paridD; @@ -560,9 +599,9 @@ class M2tree{ /** - * Get id of root node + * Get id of root node * - * @return int/err + * @return int/err */ function getRootNode() { @@ -571,9 +610,9 @@ class M2tree{ /** - * Get all objects in the tree as array of hashes + * Get all objects in the tree as array of hashes * - * @return array/err + * @return array/err */ function getAllObjects() { @@ -604,11 +643,12 @@ class M2tree{ /* ==================================================== "private" methods */ /** - * Cut subtree of specified object from tree. - * Preserve subtree structure. + * Cut subtree of specified object from tree. + * Preserve subtree structure. * - * @param int $oid, object id - * @return boolean + * @param int $oid + * object id + * @return boolean */ function _cutSubtree($oid) { @@ -638,17 +678,19 @@ class M2tree{ /** * Paste subtree previously cut by _cutSubtree method into main tree * - * @param int $oid, object id - * @param int $newParid, destination object id + * @param int $oid + * object id + * @param int $newParid + * destination object id * @return boolean */ function _pasteSubtree($oid, $newParid) { $dataArr = array(); // build data ($dataArr) for INSERT: - foreach ($this->getSubTree($oid, TRUE) as $o){ + foreach ($this->getSubTree($oid, TRUE) as $o) { $l = intval($o['level'])+1; - for ($p = $newParid; !is_null($p); $p=$this->getParent($p), $l++){ + for ($p = $newParid; !is_null($p); $p=$this->getParent($p), $l++) { $rid = $this->dbc->nextId("{$this->structTable}_id_seq"); if ($this->dbc->isError($rid)) { return $rid; @@ -672,17 +714,18 @@ class M2tree{ /** - * Do SQL rollback and return PEAR::error + * Do SQL rollback and return PEAR::error * - * @param object/string $r, error object or error message - * @return err + * @param object/string $r + * error object or error message + * @return err */ function _dbRollback($r) { $this->dbc->query("ROLLBACK"); if ($this->dbc->isError($r)) { return $r; - } elseif(is_string($r)) { + } elseif (is_string($r)) { $msg = basename(__FILE__)."::".get_class($this).": $r"; } else { $msg = basename(__FILE__)."::".get_class($this).": unknown error"; @@ -694,18 +737,21 @@ class M2tree{ /* ==================================================== auxiliary methods */ /** - * Human readable dump of subtree - for debug + * Human readable dump of subtree - for debug * - * @param int $oid, start object id - * @param string $indstr, indentation string - * @param string $ind, aktual indentation - * @return string + * @param int $oid + * start object id + * @param string $indstr + * indentation string + * @param string $ind + * actual indentation + * @return string */ function dumpTree($oid=NULL, $indstr=' ', $ind='', $format='{name}({id})', $withRoot=TRUE) { $r=''; - foreach($st = $this->getSubTree($oid, $withRoot) as $o){ + foreach ($st = $this->getSubTree($oid, $withRoot) as $o) { if ($this->dbc->isError($st)) { return $st; } diff --git a/livesupport/src/modules/alib/var/subj.php b/livesupport/src/modules/alib/var/subj.php index 0e7b08f48..6dce75e76 100644 --- a/livesupport/src/modules/alib/var/subj.php +++ b/livesupport/src/modules/alib/var/subj.php @@ -1,32 +1,4 @@ set lastfail, false=> set lastlogin + * @param boolean $failed + * true=> set lastfail, false=> set lastlogin * @return boolean/int/err */ function setTimeStamp($login, $failed=FALSE) @@ -172,9 +152,12 @@ class Subjects extends ObjClasses { * Change user password * * @param string $login - * @param string $oldpass, old password (optional for 'superuser mode') - * @param string $pass, optional - * @param boolean $passenc, optional, password already encrypted if true + * @param string $oldpass + * old password (optional for 'superuser mode') + * @param string $pass + * optional + * @param boolean $passenc + * optional, password already encrypted if true * @return boolean/err */ function passwd($login, $oldpass=null, $pass='', $passenc=FALSE) @@ -386,8 +369,10 @@ class Subjects extends ObjClasses { /** * Return true if uid is [id]direct member of gid * - * @param int $uid, local user id - * @param int $gid, local group id + * @param int $uid + * local user id + * @param int $gid + * local group id * @return boolean */ function isMemberOf($uid, $gid) @@ -412,8 +397,10 @@ class Subjects extends ObjClasses { * * @param int $uid * @param int $gid - * @param int $level, optional - * @param int $mid, optional + * @param int $level + * optional + * @param int $mid + * optional * @return int/err */ function _addMemb($uid, $gid, $level=0, $mid='null') @@ -474,7 +461,8 @@ class Subjects extends ObjClasses { * List [in]direct members of group * * @param int $gid - * @param int $uid, optional + * @param int $uid + * optional * @return array/err */ function _listMemb($gid, $uid=NULL) @@ -490,7 +478,8 @@ class Subjects extends ObjClasses { * List groups where uid is [in]direct member * * @param int $gid - * @param int $uid, optional + * @param int $uid + * optional * @return array/err */ function _listRMemb($uid, $gid=NULL) @@ -580,8 +569,10 @@ class Subjects extends ObjClasses { /** * Dump subjects for debug * - * @param string $indstr // indentation string - * @param string $ind // aktual indentation + * @param string $indstr + * indentation string + * @param string $ind + * actual indentation * @return string */ function dumpSubjects($indstr=' ', $ind='') diff --git a/livesupport/src/modules/alib/var/xmlrpc/alib_xr.php b/livesupport/src/modules/alib/var/xmlrpc/alib_xr.php index ebaefd592..711600ea1 100644 --- a/livesupport/src/modules/alib/var/xmlrpc/alib_xr.php +++ b/livesupport/src/modules/alib/var/xmlrpc/alib_xr.php @@ -1,32 +1,8 @@ - * only for testing now (with example) - LiveSupport uses special interface + * only for testing now (with example) - Campcaster uses special interface * * @author $Author$ * @version $Revision$ diff --git a/livesupport/src/modules/alib/var/xmlrpc/index.php b/livesupport/src/modules/alib/var/xmlrpc/index.php index 487188bae..7e13fde80 100644 --- a/livesupport/src/modules/alib/var/xmlrpc/index.php +++ b/livesupport/src/modules/alib/var/xmlrpc/index.php @@ -1,33 +1,4 @@ +?> \ No newline at end of file diff --git a/livesupport/src/modules/alib/var/xmlrpc/xr_cli_test.php b/livesupport/src/modules/alib/var/xmlrpc/xr_cli_test.php index 825946491..f48f4956a 100644 --- a/livesupport/src/modules/alib/var/xmlrpc/xr_cli_test.php +++ b/livesupport/src/modules/alib/var/xmlrpc/xr_cli_test.php @@ -1,32 +1,8 @@ Alib XMLRPC test client