Marc Schütz
2014-03-11 ff68e56525cc0d1f179ccd937126e65daa0aee22
interface/lib/classes/remote.d/sites.inc.php
@@ -128,7 +128,18 @@
         $this->dataRecord = $params;
         $app->sites_database_plugin->processDatabaseInsert($this);
         return $this->insertQueryExecute($sql, $params);
         $retval = $this->insertQueryExecute($sql, $params);
         // set correct values for backup_interval and backup_copies
         if(isset($params['backup_interval']) || isset($params['backup_copies'])){
            $sql_set = array();
            if(isset($params['backup_interval'])) $sql_set[] = "backup_interval = '".$app->db->quote($params['backup_interval'])."'";
            if(isset($params['backup_copies'])) $sql_set[] = "backup_copies = ".$app->functions->intval($params['backup_copies']);
            //$app->db->query("UPDATE web_database SET ".implode(', ', $sql_set)." WHERE database_id = ".$retval);
            $this->updateQueryExecute("UPDATE web_database SET ".implode(', ', $sql_set)." WHERE database_id = ".$retval, $retval, $params);
         }
         return $retval;
      }
      return false;
@@ -151,7 +162,18 @@
         $this->id = $primary_id;
         $this->dataRecord = $params;
         $app->sites_database_plugin->processDatabaseUpdate($this);
         return $this->updateQueryExecute($sql, $primary_id, $params);
         $retval = $this->updateQueryExecute($sql, $primary_id, $params);
         // set correct values for backup_interval and backup_copies
         if(isset($params['backup_interval']) || isset($params['backup_copies'])){
            $sql_set = array();
            if(isset($params['backup_interval'])) $sql_set[] = "backup_interval = '".$app->db->quote($params['backup_interval'])."'";
            if(isset($params['backup_copies'])) $sql_set[] = "backup_copies = ".$app->functions->intval($params['backup_copies']);
            //$app->db->query("UPDATE web_database SET ".implode(', ', $sql_set)." WHERE database_id = ".$primary_id);
            $this->updateQueryExecute("UPDATE web_database SET ".implode(', ', $sql_set)." WHERE database_id = ".$primary_id, $primary_id, $params);
         }
         return $retval;
      }
      return false;
@@ -455,7 +477,7 @@
   {
      global $app;
      if(!$this->checkPerm($session_id, 'sites_web_vhost_aliasdomain_get')) {
      if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_get')) {
         throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
         return false;
      }
@@ -468,7 +490,7 @@
   public function sites_web_vhost_aliasdomain_add($session_id, $client_id, $params)
   {
      global $app;
      if(!$this->checkPerm($session_id, 'sites_web_vhost_aliasdomain_add')) {
      if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_add')) {
         throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
         return false;
      }
@@ -491,7 +513,7 @@
   //* Update a record
   public function sites_web_vhost_aliasdomain_update($session_id, $client_id, $primary_id, $params)
   {
      if(!$this->checkPerm($session_id, 'sites_web_vhost_aliasdomain_update')) {
      if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_update')) {
         throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
         return false;
      }
@@ -509,7 +531,7 @@
   //* Delete a record
   public function sites_web_vhost_aliasdomain_delete($session_id, $primary_id)
   {
      if(!$this->checkPerm($session_id, 'sites_web_vhost_aliasdomain_delete')) {
      if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_delete')) {
         throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
         return false;
      }
@@ -524,7 +546,7 @@
   {
      global $app;
      if(!$this->checkPerm($session_id, 'sites_web_vhost_subdomain_get')) {
      if(!$this->checkPerm($session_id, 'sites_web_subdomain_get')) {
         throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
         return false;
      }
@@ -537,7 +559,7 @@
   public function sites_web_vhost_subdomain_add($session_id, $client_id, $params)
   {
      global $app;
      if(!$this->checkPerm($session_id, 'sites_web_vhost_subdomain_add')) {
      if(!$this->checkPerm($session_id, 'sites_web_subdomain_add')) {
         throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
         return false;
      }
@@ -560,7 +582,7 @@
   //* Update a record
   public function sites_web_vhost_subdomain_update($session_id, $client_id, $primary_id, $params)
   {
      if(!$this->checkPerm($session_id, 'sites_web_vhost_subdomain_update')) {
      if(!$this->checkPerm($session_id, 'sites_web_subdomain_update')) {
         throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
         return false;
      }
@@ -578,7 +600,7 @@
   //* Delete a record
   public function sites_web_vhost_subdomain_delete($session_id, $primary_id)
   {
      if(!$this->checkPerm($session_id, 'sites_web_vhost_subdomain_delete')) {
      if(!$this->checkPerm($session_id, 'sites_web_subdomain_delete')) {
         throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
         return false;
      }
@@ -872,6 +894,21 @@
      return $all;
   }
   //** quota functions -----------------------------------------------------------------------------------
   public function quota_get_by_user($session_id, $client_id)
   {
      global $app;
      $app->uses('quota_lib');
      if(!$this->checkPerm($session_id, 'quota_get_by_user')) {
         $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
         return false;
      }
      return $app->quota_lib->get_quota_data($client_id, false);
   }
}
?>