FusionDirectory
|
This class is the JSON-RPC webservice of FusionDirectory. More...
Public Member Functions | |
listLdaps () | |
Get the list of configured LDAP servers. More... | |
login ($ldap, $user, $pwd) | |
Login into the webservice. More... | |
logout ($sid) | |
Log out of the webservice. More... | |
ls ($sid, $type, $attrs=NULL, $ou=NULL, $filter='') | |
Get list of object of objectType $type in $ou. More... | |
count ($sid, $type, $ou=NULL, $filter='') | |
Get count of objects of objectType $type in $ou. More... | |
infos ($sid, $type) | |
Get information about objectType $type. More... | |
listTypes ($sid) | |
List existing object types. More... | |
listTabs ($sid, $type, $dn=NULL) | |
List tabs on an object. More... | |
removetab ($sid, $type, $dn, $tab) | |
Deactivate a tab of an object. More... | |
formfields ($sid, $type, $dn=NULL, $tab=NULL) | |
Get all form fields from an object (or an object type) More... | |
formpost ($sid, $type, $dn, $tab, $post) | |
Update form values of an object's attributes through POST. More... | |
getfields ($sid, $type, $dn=NULL, $tab=NULL) | |
Get all internal FD fields from an object (or an object type) More... | |
setfields ($sid, $type, $dn, $values) | |
Update attributes values of an object. More... | |
addvalues ($sid, $type, $dn, $values) | |
Add values to an object's attributes and save it. More... | |
delvalues ($sid, $type, $dn, $values) | |
Delete values from an object's attributes and save it. More... | |
gettemplate ($sid, $type, $dn) | |
Get needed internal FD fields from a template. More... | |
usetemplate ($sid, $type, $dn, $values) | |
Create an object from a template. More... | |
delete ($sid, $type, $dn) | |
Delete an object. More... | |
lockUser ($sid, $dns, $type='toggle') | |
Lock or unlock a user. More... | |
isUserLocked ($sid, $dns) | |
Test if a user is locked. More... | |
recoveryGenToken ($sid, $email) | |
Generate recovery token for a user. More... | |
recoveryConfirmPasswordChange ($sid, $uid, $password1, $password2, $token) | |
Change a user password using a recovery token. More... | |
getId () | |
Get the session ID. More... | |
getBase ($sid) | |
Get the LDAP base. More... | |
This class is the JSON-RPC webservice of FusionDirectory.
It must be served through jsonRPCServer::handle
Definition at line 34 of file jsonrpc.php.doc.
addvalues | ( | $sid, | |
$type, | |||
$dn, | |||
$values | |||
) |
Add values to an object's attributes and save it.
string | $sid | the session id |
string | $type | the object type |
string | $dn | the object dn |
array | $values | the values as an associative array of associative arrays. First level keys are tabs, second level keys should be the same keys returned by getfields (without section, directly the attributes). Values should be formed as the internal attribute expects them. See the concerned attribute type for more information. |
Definition at line 222 of file jsonrpc.php.doc.
count | ( | $sid, | |
$type, | |||
$ou = NULL , |
|||
$filter = '' |
|||
) |
Get count of objects of objectType $type in $ou.
string | $sid | the session id |
string | $type | the objectType to list |
string | $ou | the LDAP branch to search in, base will be used if it is NULL |
string | $filter | an additional filter to use in the LDAP search. |
Definition at line 92 of file jsonrpc.php.doc.
delete | ( | $sid, | |
$type, | |||
$dn | |||
) |
Delete an object.
string | $sid | the session id |
string | $type | the object type |
string | $dn | the template dn |
Definition at line 284 of file jsonrpc.php.doc.
delvalues | ( | $sid, | |
$type, | |||
$dn, | |||
$values | |||
) |
Delete values from an object's attributes and save it.
string | $sid | the session id |
string | $type | the object type |
string | $dn | the object dn |
array | $values | the values as an associative array of associative arrays. First level keys are tabs, second level keys should be the same keys returned by getfields (without section, directly the attributes). Values should be formed as the internal attribute expects them. See the concerned attribute type for more information. |
Definition at line 237 of file jsonrpc.php.doc.
formfields | ( | $sid, | |
$type, | |||
$dn = NULL , |
|||
$tab = NULL |
|||
) |
Get all form fields from an object (or an object type)
Fields as they appear in the HTML form Prefer to use getfields when possible
string | $sid | the session id |
string | $type | the object type |
string | $dn | the object to load values from if any |
string | $tab | the tab to show if not the main one |
Definition at line 159 of file jsonrpc.php.doc.
formpost | ( | $sid, | |
$type, | |||
$dn, | |||
$tab, | |||
$post | |||
) |
Update form values of an object's attributes through POST.
Prefer to use setfields if possible
string | $sid | the session id |
string | $type | the object type |
string | $dn | the object to load values from if any (otherwise it's a creation) |
string | $tab | the tab to modify if not the main one |
array | $post | the values as a POST array. Keys should be the 'id' returned by formfields. |
Definition at line 176 of file jsonrpc.php.doc.
getBase | ( | $sid | ) |
Get the LDAP base.
string | $sid | the session id |
Definition at line 355 of file jsonrpc.php.doc.
getfields | ( | $sid, | |
$type, | |||
$dn = NULL , |
|||
$tab = NULL |
|||
) |
Get all internal FD fields from an object (or an object type)
Fields as they are stored in FusionDirectory
string | $sid | the session id |
string | $type | the object type |
string | $dn | the object to load values from if any |
string | $tab | the tab to show if not the main one |
Definition at line 192 of file jsonrpc.php.doc.
getId | ( | ) |
Get the session ID.
Definition at line 344 of file jsonrpc.php.doc.
gettemplate | ( | $sid, | |
$type, | |||
$dn | |||
) |
Get needed internal FD fields from a template.
This returns the fields that needs filling for using this template to create an object. Return value looks like the getfields one, except they are grouped by tab and not by section. Empty activated tab may also be included.
string | $sid | the session id |
string | $type | the object type |
string | $dn | the template dn |
Definition at line 255 of file jsonrpc.php.doc.
infos | ( | $sid, | |
$type | |||
) |
Get information about objectType $type.
string | $sid | the session id |
string | $type | the object type |
Definition at line 104 of file jsonrpc.php.doc.
isUserLocked | ( | $sid, | |
$dns | |||
) |
Test if a user is locked.
string | $sid | the session id |
string | $dns | an array of user dns to test if they are locked, or a single dn of a user to test |
Definition at line 308 of file jsonrpc.php.doc.
listLdaps | ( | ) |
Get the list of configured LDAP servers.
Definition at line 41 of file jsonrpc.php.doc.
listTabs | ( | $sid, | |
$type, | |||
$dn = NULL |
|||
) |
List tabs on an object.
string | $sid | the session id |
string | $type | the object type |
string | $dn | the object to load values from if any |
Definition at line 128 of file jsonrpc.php.doc.
listTypes | ( | $sid | ) |
List existing object types.
string | $sid | the session id |
Definition at line 115 of file jsonrpc.php.doc.
lockUser | ( | $sid, | |
$dns, | |||
$type = 'toggle' |
|||
) |
Lock or unlock a user.
string | $sid | the session id |
string | $dns | an array of user dns to be locked, or a single dn of a user to lock |
string | $type | the action to be done. Can be 'lock', 'unlock' or 'toggle'. Defaults to 'toggle'. |
Definition at line 296 of file jsonrpc.php.doc.
login | ( | $ldap, | |
$user, | |||
$pwd | |||
) |
Login into the webservice.
string | $ldap | the id of the LDAP server to use (can be NULL, in which case the first LDAP server found is used) |
string | $user | The user to log in with |
string | $pwd | The password for this user |
Definition at line 52 of file jsonrpc.php.doc.
logout | ( | $sid | ) |
Log out of the webservice.
string | $sid | the session id |
Definition at line 61 of file jsonrpc.php.doc.
ls | ( | $sid, | |
$type, | |||
$attrs = NULL , |
|||
$ou = NULL , |
|||
$filter = '' |
|||
) |
Get list of object of objectType $type in $ou.
string | $sid | the session id |
string | $type | the objectType to list |
mixed | $attrs | The attributes to fetch. If this is a single value, the resulting associative array will have for each dn the value of this attribute. If this is an array, the keys must be the wanted attributes, and the values can be either 1, '*' or 'raw' depending if you want a single value or an array of values. 'raw' means untouched LDAP value and is only useful for dns. Other values are considered to be 1. |
string | $ou | the LDAP branch to search in, base will be used if it is NULL |
string | $filter | an additional filter to use in the LDAP search. |
Definition at line 78 of file jsonrpc.php.doc.
recoveryConfirmPasswordChange | ( | $sid, | |
$uid, | |||
$password1, | |||
$password2, | |||
$token | |||
) |
Change a user password using a recovery token.
string | $sid | the session id |
string | $uid | the uid of the user |
string | $password1 | the password entered by the user |
string | $password2 | the repeated password entered by the user |
string | $token | the recovery token |
Definition at line 335 of file jsonrpc.php.doc.
recoveryGenToken | ( | $sid, | |
) |
Generate recovery token for a user.
string | $sid | the session id |
string | an email address associated to the user |
Definition at line 320 of file jsonrpc.php.doc.
removetab | ( | $sid, | |
$type, | |||
$dn, | |||
$tab | |||
) |
Deactivate a tab of an object.
string | $sid | the session id |
string | $type | the object type |
string | $dn | the object to remove a tab from |
string | $tab | the tab to remove |
Definition at line 142 of file jsonrpc.php.doc.
setfields | ( | $sid, | |
$type, | |||
$dn, | |||
$values | |||
) |
Update attributes values of an object.
string | $sid | the session id |
string | $type | the object type |
string | $dn | the object to load values from if any (otherwise it's a creation) |
array | $values | the values as an associative array of associative arrays. First level keys are tabs, second level keys should be the same keys returned by getfields (without section, directly the attributes). Values should be formed as the internal attribute expects them. See the concerned attribute type for more information. |
Definition at line 207 of file jsonrpc.php.doc.
usetemplate | ( | $sid, | |
$type, | |||
$dn, | |||
$values | |||
) |
Create an object from a template.
This apply the template to the given values and creates an object.
string | $sid | the session id |
string | $type | the object type |
string | $dn | the template dn |
string | $values | the values for each tab organised in the same way as for setfields |
Definition at line 271 of file jsonrpc.php.doc.