@@ -1550,6 +1550,112 @@ public function sites_web_subdomain_delete($session_id, $primary_id)
15501550 return $ affected_rows ;
15511551 }
15521552
1553+ // ----------------------------------------------------------------------------------------------------------
1554+
1555+ //* Get record details
1556+ public function sites_web_folder_get ($ session_id , $ primary_id )
1557+ {
1558+ global $ app ;
1559+
1560+ if (!$ this ->checkPerm ($ session_id , 'sites_web_folder_get ' )) {
1561+ $ this ->server ->fault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
1562+ return false ;
1563+ }
1564+ $ app ->uses ('remoting_lib ' );
1565+ $ app ->remoting_lib ->loadFormDef ('../sites/form/web_folder.tform.php ' );
1566+ return $ app ->remoting_lib ->getDataRecord ($ primary_id );
1567+ }
1568+
1569+ //* Add a record
1570+ public function sites_web_folder_add ($ session_id , $ client_id , $ params )
1571+ {
1572+ if (!$ this ->checkPerm ($ session_id , 'sites_web_folder_add ' )) {
1573+ $ this ->server ->fault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
1574+ return false ;
1575+ }
1576+ return $ this ->insertQuery ('../sites/form/web_folder.tform.php ' ,$ client_id ,$ params );
1577+ }
1578+
1579+ //* Update a record
1580+ public function sites_web_folder_update ($ session_id , $ client_id , $ primary_id , $ params )
1581+ {
1582+ if (!$ this ->checkPerm ($ session_id , 'sites_web_folder_update ' )) {
1583+ $ this ->server ->fault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
1584+ return false ;
1585+ }
1586+ $ affected_rows = $ this ->updateQuery ('../sites/form/web_folder.tform.php ' ,$ client_id ,$ primary_id ,$ params );
1587+ return $ affected_rows ;
1588+ }
1589+
1590+ //* Delete a record
1591+ public function sites_web_folder_delete ($ session_id , $ primary_id )
1592+ {
1593+ global $ app ;
1594+ if (!$ this ->checkPerm ($ session_id , 'sites_web_folder_delete ' )) {
1595+ $ this ->server ->fault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
1596+ return false ;
1597+ }
1598+
1599+ // Delete all users that belong to this folder. - taken from web_folder_delete.php
1600+ $ records = $ app ->db ->queryAllRecords ("SELECT web_folder_user_id FROM web_folder_user WHERE web_folder_id = ' " .intval ($ primary_id )."' " );
1601+ foreach ($ records as $ rec ) {
1602+ $ this ->deleteQuery ('../sites/form/web_folder_user.tform.php ' ,$ rec ['web_folder_user_id ' ]);
1603+ //$app->db->datalogDelete('web_folder_user','web_folder_user_id',$rec['web_folder_user_id']);
1604+ }
1605+ unset($ records );
1606+
1607+ $ affected_rows = $ this ->deleteQuery ('../sites/form/web_folder.tform.php ' ,$ primary_id );
1608+ return $ affected_rows ;
1609+ }
1610+
1611+ // -----------------------------------------------------------------------------------------------
1612+
1613+ //* Get record details
1614+ public function sites_web_folder_user_get ($ session_id , $ primary_id )
1615+ {
1616+ global $ app ;
1617+
1618+ if (!$ this ->checkPerm ($ session_id , 'sites_web_folder_user_get ' )) {
1619+ $ this ->server ->fault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
1620+ return false ;
1621+ }
1622+ $ app ->uses ('remoting_lib ' );
1623+ $ app ->remoting_lib ->loadFormDef ('../sites/form/web_folder_user.tform.php ' );
1624+ return $ app ->remoting_lib ->getDataRecord ($ primary_id );
1625+ }
1626+
1627+ //* Add a record
1628+ public function sites_web_folder_user_add ($ session_id , $ client_id , $ params )
1629+ {
1630+ if (!$ this ->checkPerm ($ session_id , 'sites_web_folder_user_add ' )) {
1631+ $ this ->server ->fault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
1632+ return false ;
1633+ }
1634+ return $ this ->insertQuery ('../sites/form/web_folder_user.tform.php ' ,$ client_id ,$ params );
1635+ }
1636+
1637+ //* Update a record
1638+ public function sites_web_folder_user_update ($ session_id , $ client_id , $ primary_id , $ params )
1639+ {
1640+ if (!$ this ->checkPerm ($ session_id , 'sites_web_folder_user_update ' )) {
1641+ $ this ->server ->fault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
1642+ return false ;
1643+ }
1644+ $ affected_rows = $ this ->updateQuery ('../sites/form/web_folder_user.tform.php ' ,$ client_id ,$ primary_id ,$ params );
1645+ return $ affected_rows ;
1646+ }
1647+
1648+ //* Delete a record
1649+ public function sites_web_folder_user_delete ($ session_id , $ primary_id )
1650+ {
1651+ if (!$ this ->checkPerm ($ session_id , 'sites_web_folder_user_delete ' )) {
1652+ $ this ->server ->fault ('permission_denied ' , 'You do not have the permissions to access this function. ' );
1653+ return false ;
1654+ }
1655+ $ affected_rows = $ this ->deleteQuery ('../sites/form/web_folder_user.tform.php ' ,$ primary_id );
1656+ return $ affected_rows ;
1657+ }
1658+
15531659 // -----------------------------------------------------------------------------------------------
15541660
15551661 //* Get record details
0 commit comments