How to use PHP to retrieve user information?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2010 05:47 PM
I am trying to retrieve all user information in my database using php. Is this possible with the PHP library? If so, can anyone provide any guidelines?
I found this post (http://forums.alfresco.com/en/viewtopic.php?f=21&t=9791) with an Administration class for accessing user details, but I could not get it work. Is this on the right track on how to achieve my goal?
Thanks in advance.
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2010 06:49 AM
First of all, if you want to seriously use PHP for client-side scripting, you should use our {hacked,improved} version of the PHP API available at
http://www.sugarforge.org/frs/?group_id=860 (dubbed Alfredo-PHPAPI).
I suppose the version of the PHP API coming with Alfresco is seriously flawed and will perhaps not even work…

There is no explicit support for user management, but you may try some Lucene query like
TYPE:"cm

to fetch the user objects (not tested, but the query should work)
HTH
Gyro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2010 06:08 AM
I don't understand how to fetch the user objects?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2010 11:09 AM
Apache Lucene -> http://lucene.apache.org/java/docs/
Alfresco Search - Lucene [Wiki] -> http://wiki.alfresco.com/wiki/Search#Lucene
If you use the Standard Alfresco PHP Libary you can make a lucene query like:
$nodeId = "//PUT HERE UR NODEID"; $repositoryUrl = "http://localhost:8080/alfresco/api"; $userName = "admin"; $password = "admin"; $repository = new Repository($repositoryUrl); $ticket = $repository->authenticate($userName, $password); $session = $repository->createSession($ticket); $spacesStore = new SpacesStore($session); //$result = $session->query($spacesStore, "PUT HERE YOUR LUCENE QUERY"); // FOR EXAMPLE -> QUERY OF Gyro.Gearless: $result = $session->query($spacesStore, "TYPE:\"cm:person\" AND @cm\:name:\"Jones\"");
I hope i could help you.
Best regards
Dominik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2010 07:25 AM
If you will use php to retrive for user information , you will use MYsql data.
I cant get what you mean?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2010 12:44 PM
I have an integration with a Joomla website. And I want to show user information in User Account, on this website.
offshoredevelopment, do you mean we have to connect to Alfresco DB and get this information directly?
Anyone tried to use Alfredo-PHPAPI?
What can we do to get this info with PHP?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2010 04:02 AM

<?php define('sugarEntry', TRUE);$apiRoot = dirname(__FILE__) . '/../src';set_include_path($apiRoot . PATH_SEPARATOR . get_include_path());print "Include path set to [" . get_include_path() . "}\n";require_once "Alfresco/Service/Repository.php";require_once "Alfresco/Service/Session.php";require_once "Alfresco/Service/SpacesStore.php";require_once "config.php";$timestamp = time();$repository = new AlfRepository($repositoryUrl);$ticket = $repository->authenticate($userName, $password);print "Alfresco ticket is $ticket\n";$session = $repository->createSession($ticket);$spacesStore = new AlfSpacesStore($session);$personNodes = $session->query($spacesStore, 'TYPE:"cm:person" AND @cm\\:userName:"wolland"');foreach ($personNodes as $gyro) { print "– Properties ————–\n"; $gyroProps = $gyro->getProperties(); foreach($gyroProps as $k => $v) { print ": $k -> $v\n"; } print "– Aspects —————–\n"; $aspects = $gyro->getAspects(); foreach ($aspects as $a) { print ": $a\n"; }}?>
where config.php contains the required login parameters:
<?php$repositoryUrl = "http://conman1.acmecorp.net:8080/alfresco/api";$userName = "admin";$password = "töp$€(re7";?>
HTH
Gyro

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2010 05:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2010 06:59 AM
http://forums.alfresco.com/en/viewtopic.php?f=21&t=9390
I wrote a simple Class for the AdministrationService to get the Users and their informations.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2011 02:25 AM

