From 5712a61048ae34365a1a8977d3fa04ddaa1b80c1 Mon Sep 17 00:00:00 2001
From: mcramer <m.cramer@pixcept.de>
Date: Thu, 16 Aug 2012 15:14:34 -0400
Subject: [PATCH] Implemented FS#1938 - Add functions to manage password protected folders to remote api
---
interface/lib/classes/remoting.inc.php | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 106 insertions(+), 0 deletions(-)
diff --git a/interface/lib/classes/remoting.inc.php b/interface/lib/classes/remoting.inc.php
index fe13d0a..36296a6 100644
--- a/interface/lib/classes/remoting.inc.php
+++ b/interface/lib/classes/remoting.inc.php
@@ -1550,6 +1550,112 @@
return $affected_rows;
}
+ // ----------------------------------------------------------------------------------------------------------
+
+ //* Get record details
+ public function sites_web_folder_get($session_id, $primary_id)
+ {
+ global $app;
+
+ if(!$this->checkPerm($session_id, 'sites_web_folder_get')) {
+ $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+ return false;
+ }
+ $app->uses('remoting_lib');
+ $app->remoting_lib->loadFormDef('../sites/form/web_folder.tform.php');
+ return $app->remoting_lib->getDataRecord($primary_id);
+ }
+
+ //* Add a record
+ public function sites_web_folder_add($session_id, $client_id, $params)
+ {
+ if(!$this->checkPerm($session_id, 'sites_web_folder_add')) {
+ $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+ return false;
+ }
+ return $this->insertQuery('../sites/form/web_folder.tform.php',$client_id,$params);
+ }
+
+ //* Update a record
+ public function sites_web_folder_update($session_id, $client_id, $primary_id, $params)
+ {
+ if(!$this->checkPerm($session_id, 'sites_web_folder_update')) {
+ $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+ return false;
+ }
+ $affected_rows = $this->updateQuery('../sites/form/web_folder.tform.php',$client_id,$primary_id,$params);
+ return $affected_rows;
+ }
+
+ //* Delete a record
+ public function sites_web_folder_delete($session_id, $primary_id)
+ {
+ global $app;
+ if(!$this->checkPerm($session_id, 'sites_web_folder_delete')) {
+ $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+ return false;
+ }
+
+ // Delete all users that belong to this folder. - taken from web_folder_delete.php
+ $records = $app->db->queryAllRecords("SELECT web_folder_user_id FROM web_folder_user WHERE web_folder_id = '".intval($primary_id)."'");
+ foreach($records as $rec) {
+ $this->deleteQuery('../sites/form/web_folder_user.tform.php',$rec['web_folder_user_id']);
+ //$app->db->datalogDelete('web_folder_user','web_folder_user_id',$rec['web_folder_user_id']);
+ }
+ unset($records);
+
+ $affected_rows = $this->deleteQuery('../sites/form/web_folder.tform.php',$primary_id);
+ return $affected_rows;
+ }
+
+ // -----------------------------------------------------------------------------------------------
+
+ //* Get record details
+ public function sites_web_folder_user_get($session_id, $primary_id)
+ {
+ global $app;
+
+ if(!$this->checkPerm($session_id, 'sites_web_folder_user_get')) {
+ $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+ return false;
+ }
+ $app->uses('remoting_lib');
+ $app->remoting_lib->loadFormDef('../sites/form/web_folder_user.tform.php');
+ return $app->remoting_lib->getDataRecord($primary_id);
+ }
+
+ //* Add a record
+ public function sites_web_folder_user_add($session_id, $client_id, $params)
+ {
+ if(!$this->checkPerm($session_id, 'sites_web_folder_user_add')) {
+ $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+ return false;
+ }
+ return $this->insertQuery('../sites/form/web_folder_user.tform.php',$client_id,$params);
+ }
+
+ //* Update a record
+ public function sites_web_folder_user_update($session_id, $client_id, $primary_id, $params)
+ {
+ if(!$this->checkPerm($session_id, 'sites_web_folder_user_update')) {
+ $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+ return false;
+ }
+ $affected_rows = $this->updateQuery('../sites/form/web_folder_user.tform.php',$client_id,$primary_id,$params);
+ return $affected_rows;
+ }
+
+ //* Delete a record
+ public function sites_web_folder_user_delete($session_id, $primary_id)
+ {
+ if(!$this->checkPerm($session_id, 'sites_web_folder_user_delete')) {
+ $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+ return false;
+ }
+ $affected_rows = $this->deleteQuery('../sites/form/web_folder_user.tform.php',$primary_id);
+ return $affected_rows;
+ }
+
// -----------------------------------------------------------------------------------------------
//* Get record details
--
Gitblit v1.9.1