tbrehm
2009-06-21 17db6c110f591226c6dd6a7517295f9bd07c30eb
interface/web/sites/ftp_user_edit.php
@@ -82,7 +82,8 @@
      
      $app->uses('getconf');
      $global_config = $app->getconf->get_global_config('sites');
      $ftpuser_prefix = ($global_config['ftpuser_prefix'] == '')?'':str_replace('[CLIENTNAME]', $this->getClientName(), $global_config['ftpuser_prefix']);
      // $ftpuser_prefix = ($global_config['ftpuser_prefix'] == '')?'':str_replace('[CLIENTNAME]', $this->getClientName(), $global_config['ftpuser_prefix']);
      $ftpuser_prefix = replacePrefix($global_config['ftpuser_prefix'], $this->dataRecord);
      
      if ($this->dataRecord['username'] != ""){
         /* REMOVE the restriction */
@@ -115,7 +116,8 @@
      
      $app->uses('getconf');
      $global_config = $app->getconf->get_global_config('sites');
      $ftpuser_prefix = ($global_config['ftpuser_prefix'] == '')?'':str_replace('[CLIENTNAME]', $this->getClientName(), $global_config['ftpuser_prefix']);
      //$ftpuser_prefix = ($global_config['ftpuser_prefix'] == '')?'':str_replace('[CLIENTNAME]', $this->getClientName(), $global_config['ftpuser_prefix']);
      $ftpuser_prefix = replacePrefix($global_config['ftpuser_prefix'], $this->dataRecord);
      
      if ($app->tform->errorMessage == '') {
         $this->dataRecord['username'] = $ftpuser_prefix . $this->dataRecord['username'];
@@ -151,11 +153,12 @@
      
      $app->uses('getconf');
      $global_config = $app->getconf->get_global_config('sites');
      $ftpuser_prefix = ($global_config['ftpuser_prefix'] == '')?'':str_replace('[CLIENTNAME]', $this->getClientName(), $global_config['ftpuser_prefix']);
      //$ftpuser_prefix = ($global_config['ftpuser_prefix'] == '')?'':str_replace('[CLIENTNAME]', $this->getClientName(), $global_config['ftpuser_prefix']);
      $ftpuser_prefix = replacePrefix($global_config['ftpuser_prefix'], $this->dataRecord);
      
      /* restrict the names */
      if ($app->tform->errorMessage == '') {
         $this->dataRecord['username'] = $restriction . $this->dataRecord['username'];
         $this->dataRecord['username'] = $ftpuser_prefix . $this->dataRecord['username'];
      }
   }
   
@@ -173,13 +176,15 @@
         $client_group_id = $_SESSION["s"]["user"]["default_group"];
      } else {
         // Get the group-id from the data itself
         $client_group_id = $this->dataRecord['client_group_id'];
         $web = $app->db->queryOneRecord("SELECT sys_groupid FROM web_domain WHERE domain_id = ".intval($this->dataRecord['parent_domain_id']));
         $client_group_id = $web['sys_groupid'];
      }
      /* get the name of the client */
      $tmp = $app->db->queryOneRecord("SELECT name FROM sys_group WHERE groupid = " . $client_group_id);
      $clientName = $tmp['name'];
      if ($clientName == "") $clientName = 'default';
      $clientName = convertClientName($clientName);
      return $clientName;
   
   }