summaryrefslogtreecommitdiffstats
path: root/lib/api
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-03-26 09:22:50 +0200
committerAleksander Machniak <alec@alec.pl>2012-03-26 09:22:50 +0200
commit0b8849e31162e07bdc5dbfef9ea95b3cf3d5c9b8 (patch)
tree32105cbca3f46f88a3e843f5aa012c4b297e89c7 /lib/api
parent079b73cd67fbb7d103fe1e4ba2ffdb97b1a6f390 (diff)
downloadwebadmin-0b8849e31162e07bdc5dbfef9ea95b3cf3d5c9b8.tar.gz
Added more phpdoc comments
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/kolab_api_service_domains.php22
-rw-r--r--lib/api/kolab_api_service_form_value.php7
-rw-r--r--lib/api/kolab_api_service_group.php39
-rw-r--r--lib/api/kolab_api_service_group_types.php17
-rw-r--r--lib/api/kolab_api_service_groups.php17
-rw-r--r--lib/api/kolab_api_service_roles.php18
-rw-r--r--lib/api/kolab_api_service_user.php43
-rw-r--r--lib/api/kolab_api_service_user_types.php15
-rw-r--r--lib/api/kolab_api_service_users.php17
9 files changed, 181 insertions, 14 deletions
diff --git a/lib/api/kolab_api_service_domains.php b/lib/api/kolab_api_service_domains.php
index e32aeb7..e964936 100644
--- a/lib/api/kolab_api_service_domains.php
+++ b/lib/api/kolab_api_service_domains.php
@@ -24,19 +24,35 @@
*/
/**
- *
+ * Service providing domains listing
*/
class kolab_api_service_domains extends kolab_api_service
{
+
+ /**
+ * Returns service capabilities.
+ *
+ * @param string $domain Domain name
+ *
+ * @return array Capabilities list
+ */
public function capabilities($domain)
{
return array(
'list' => 'r',
-// 'search' => 'r',
);
}
- public function domains_list($get, $post) {
+ /**
+ * Users listing (with searching).
+ *
+ * @param array $get GET parameters
+ * @param array $post POST parameters
+ *
+ * @return array List result with 'list' and 'count' items
+ */
+ public function domains_list($get, $post)
+ {
$auth = Auth::get_instance();
$domains = $auth->list_domains();
diff --git a/lib/api/kolab_api_service_form_value.php b/lib/api/kolab_api_service_form_value.php
index ff63c3d..fa8d19d 100644
--- a/lib/api/kolab_api_service_form_value.php
+++ b/lib/api/kolab_api_service_form_value.php
@@ -29,6 +29,13 @@
class kolab_api_service_form_value extends kolab_api_service
{
+ /**
+ * Returns service capabilities.
+ *
+ * @param string $domain Domain name
+ *
+ * @return array Capabilities list
+ */
public function capabilities($domain)
{
return array(
diff --git a/lib/api/kolab_api_service_group.php b/lib/api/kolab_api_service_group.php
index 9020d01..f382d79 100644
--- a/lib/api/kolab_api_service_group.php
+++ b/lib/api/kolab_api_service_group.php
@@ -28,6 +28,13 @@
*/
class kolab_api_service_group extends kolab_api_service
{
+ /**
+ * Returns service capabilities.
+ *
+ * @param string $domain Domain name
+ *
+ * @return array Capabilities list
+ */
public function capabilities($domain)
{
return array(
@@ -38,6 +45,14 @@ class kolab_api_service_group extends kolab_api_service
);
}
+ /**
+ * Group create.
+ *
+ * @param array $get GET parameters
+ * @param array $post POST parameters
+ *
+ * @return array|bool Group attributes or False on failure
+ */
public function group_add($getdata, $postdata)
{
$gta = $this->group_type_attributes($postdata['group_type_id']);
@@ -87,6 +102,14 @@ class kolab_api_service_group extends kolab_api_service
return FALSE;
}
+ /**
+ * Group delete.
+ *
+ * @param array $get GET parameters
+ * @param array $post POST parameters
+ *
+ * @return bool True on success, False on failure
+ */
public function group_delete($getdata, $postdata)
{
if (empty($postdata['group'])) {
@@ -104,6 +127,14 @@ class kolab_api_service_group extends kolab_api_service
return FALSE;
}
+ /**
+ * Group information.
+ *
+ * @param array $get GET parameters
+ * @param array $post POST parameters
+ *
+ * @return array|bool Group attributes or False on failure
+ */
public function group_info($getdata, $postdata)
{
if (empty($getdata['group'])) {
@@ -125,6 +156,14 @@ class kolab_api_service_group extends kolab_api_service
return FALSE;
}
+ /**
+ * Group members listing.
+ *
+ * @param array $get GET parameters
+ * @param array $post POST parameters
+ *
+ * @return array List of group members ('list' and 'count' items)
+ */
public function group_members_list($getdata, $postdata)
{
$auth = Auth::get_instance();
diff --git a/lib/api/kolab_api_service_group_types.php b/lib/api/kolab_api_service_group_types.php
index 3ee0b83..7145654 100644
--- a/lib/api/kolab_api_service_group_types.php
+++ b/lib/api/kolab_api_service_group_types.php
@@ -24,10 +24,17 @@
*/
/**
- *
+ * Service providing group types listing
*/
class kolab_api_service_group_types extends kolab_api_service
{
+ /**
+ * Returns service capabilities.
+ *
+ * @param string $domain Domain name
+ *
+ * @return array Capabilities list
+ */
public function capabilities($domain)
{
return array(
@@ -35,6 +42,14 @@ class kolab_api_service_group_types extends kolab_api_service
);
}
+ /**
+ * Group types listing.
+ *
+ * @param array $get GET parameters
+ * @param array $post POST parameters
+ *
+ * @return array List result with 'list' and 'count' items
+ */
public function group_types_list($get, $post)
{
$group_types = $this->group_types();
diff --git a/lib/api/kolab_api_service_groups.php b/lib/api/kolab_api_service_groups.php
index d85de12..ff8781b 100644
--- a/lib/api/kolab_api_service_groups.php
+++ b/lib/api/kolab_api_service_groups.php
@@ -24,7 +24,7 @@
*/
/**
- *
+ * Service providing groups listing
*/
class kolab_api_service_groups extends kolab_api_service
{
@@ -35,6 +35,13 @@ class kolab_api_service_groups extends kolab_api_service
'mail',
);
+ /**
+ * Returns service capabilities.
+ *
+ * @param string $domain Domain name
+ *
+ * @return array Capabilities list
+ */
public function capabilities($domain)
{
return array(
@@ -42,6 +49,14 @@ class kolab_api_service_groups extends kolab_api_service
);
}
+ /**
+ * Groups listing (with searching).
+ *
+ * @param array $get GET parameters
+ * @param array $post POST parameters
+ *
+ * @return array List result with 'list' and 'count' items
+ */
public function groups_list($get, $post)
{
$auth = Auth::get_instance();
diff --git a/lib/api/kolab_api_service_roles.php b/lib/api/kolab_api_service_roles.php
index 2be1d7a..1c9b8aa 100644
--- a/lib/api/kolab_api_service_roles.php
+++ b/lib/api/kolab_api_service_roles.php
@@ -24,7 +24,7 @@
*/
/**
- *
+ * Service providing roles listing
*/
class kolab_api_service_roles extends kolab_api_service
{
@@ -35,7 +35,13 @@ class kolab_api_service_roles extends kolab_api_service
'description',
);
-
+ /**
+ * Returns service capabilities.
+ *
+ * @param string $domain Domain name
+ *
+ * @return array Capabilities list
+ */
public function capabilities($domain)
{
return array(
@@ -43,6 +49,14 @@ class kolab_api_service_roles extends kolab_api_service
);
}
+ /**
+ * Roles listing (with searching).
+ *
+ * @param array $get GET parameters
+ * @param array $post POST parameters
+ *
+ * @return array List result with 'list' and 'count' items
+ */
public function roles_list($get, $post)
{
$auth = Auth::get_instance();
diff --git a/lib/api/kolab_api_service_user.php b/lib/api/kolab_api_service_user.php
index a355ac4..b13f40f 100644
--- a/lib/api/kolab_api_service_user.php
+++ b/lib/api/kolab_api_service_user.php
@@ -24,10 +24,17 @@
*/
/**
- *
+ * Service providing user data management
*/
class kolab_api_service_user extends kolab_api_service
{
+ /**
+ * Returns service capabilities.
+ *
+ * @param string $domain Domain name
+ *
+ * @return array Capabilities list
+ */
public function capabilities($domain)
{
return array(
@@ -42,6 +49,14 @@ class kolab_api_service_user extends kolab_api_service
);
}
+ /**
+ * Create user.
+ *
+ * @param array $get GET parameters
+ * @param array $post POST parameters
+ *
+ * @return array|bool User attributes or False on error.
+ */
public function user_add($getdata, $postdata)
{
$uta = $this->user_type_attributes($postdata['user_type_id']);
@@ -87,13 +102,21 @@ class kolab_api_service_user extends kolab_api_service
return $user_attributes;
}
- return FALSE;
+ return false;
}
+ /**
+ * Detete user.
+ *
+ * @param array $get GET parameters
+ * @param array $post POST parameters
+ *
+ * @return bool True on success, False on failure
+ */
public function user_delete($getdata, $postdata)
{
if (!isset($postdata['user'])) {
- return FALSE;
+ return false;
}
// TODO: Input validation
@@ -104,13 +127,21 @@ class kolab_api_service_user extends kolab_api_service
return $result;
}
- return FALSE;
+ return false;
}
+ /**
+ * User information.
+ *
+ * @param array $get GET parameters
+ * @param array $post POST parameters
+ *
+ * @return array|bool User attributes, False on error
+ */
public function user_info($getdata, $postdata)
{
if (!isset($getdata['user'])) {
- return FALSE;
+ return false;
}
$auth = Auth::get_instance();
@@ -146,6 +177,6 @@ class kolab_api_service_user extends kolab_api_service
return $result;
}
- return FALSE;
+ return false;
}
}
diff --git a/lib/api/kolab_api_service_user_types.php b/lib/api/kolab_api_service_user_types.php
index 164e872..b2adcf2 100644
--- a/lib/api/kolab_api_service_user_types.php
+++ b/lib/api/kolab_api_service_user_types.php
@@ -28,6 +28,13 @@
*/
class kolab_api_service_user_types extends kolab_api_service
{
+ /**
+ * Returns service capabilities.
+ *
+ * @param string $domain Domain name
+ *
+ * @return array Capabilities list
+ */
public function capabilities($domain)
{
return array(
@@ -35,6 +42,14 @@ class kolab_api_service_user_types extends kolab_api_service
);
}
+ /**
+ * User types listing.
+ *
+ * @param array $get GET parameters
+ * @param array $post POST parameters
+ *
+ * @return array List result with 'list' and 'count' items
+ */
public function user_types_list($get, $post)
{
$user_types = $this->user_types();
diff --git a/lib/api/kolab_api_service_users.php b/lib/api/kolab_api_service_users.php
index a950a09..f5a04f9 100644
--- a/lib/api/kolab_api_service_users.php
+++ b/lib/api/kolab_api_service_users.php
@@ -24,7 +24,7 @@
*/
/**
- *
+ * Service providing users listing
*/
class kolab_api_service_users extends kolab_api_service
{
@@ -43,6 +43,13 @@ class kolab_api_service_users extends kolab_api_service
);
+ /**
+ * Returns service capabilities.
+ *
+ * @param string $domain Domain name
+ *
+ * @return array Capabilities list
+ */
public function capabilities($domain)
{
return array(
@@ -50,6 +57,14 @@ class kolab_api_service_users extends kolab_api_service
);
}
+ /**
+ * Users listing (with searching).
+ *
+ * @param array $get GET parameters
+ * @param array $post POST parameters
+ *
+ * @return array List result with 'list' and 'count' items
+ */
public function users_list($get, $post)
{
$auth = Auth::get_instance();