From: Dariush M. <dm...@us...> - 2005-10-31 20:11:29
|
Update of /cvsroot/gallery/integration/gallery2/phpnuke/html/modules/gallery2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15305/phpnuke/html/modules/gallery2 Modified Files: index.php Log Message: * Change: Updated PHPNuke ACP with non-Alpha Gallery banner. * Fix: Re-added g2addexternalMapEntry() function to index.php. Index: index.php =================================================================== RCS file: /cvsroot/gallery/integration/gallery2/phpnuke/html/modules/gallery2/index.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- index.php 25 Aug 2005 15:01:50 -0000 1.13 +++ index.php 31 Oct 2005 20:11:21 -0000 1.14 @@ -32,6 +32,41 @@ define("MOD_NAME","gallery2"); + /** + * g2addexternalMapEntry: add an externalId map entry + * + * Add an entry in the G externalId, entityId map table + * + * @author Andy Staudacher + * @access public + * @param integer the uid + * @param integer the entityId from G2 + * @param integer/string the roles type, 1 for groups, 0 for users, or the entityType string + * @return bool true or false + */ + function g2addexternalMapEntry($externalId, $entityId, $entityType) + { + include ("modules/".MOD_NAME."/gallery2.cfg"); + + // init G2 transaction, load G2 API, if not already done so + if (!init()) { + return false; + } + if (is_int($entityType)) { + $entityType = $entityType == 0 ? 'GalleryUser' : 'GalleryGroup'; + } + + require_once ($g2embedparams['embedphpfile']."/".'modules/core/classes/ExternalIdMap.class'); + + $ret = ExternalIdMap :: addMapEntry(array ('externalId' => $externalId, 'entityType' => $entityType, 'entityId' => $entityId)); + if ($ret->isError()) { + g2_message('Failed to create a extmap entry for role uid ['.$externalId.'] and entityId ['.$entityId.'], entityType ['.$entityType.']. Here is the error message from G2: <br />'.$ret->getAsHtml()); + return false; + } + return true; + } + + // -------------------------------------------------------- // Mapping between Phpnuke and Gallery2 language definition // -------------------------------------------------------- @@ -198,4 +233,4 @@ include("footer.php"); -?> \ No newline at end of file +?> |