Merge branch 'display_prefix_on_new' into 'master'
Display prefix on new
When a client creates a new database or user which has prefix, prefix is not displayed until is created or error is returned. For clients, it's possible to display real prefix if CLIENTID or CLIENTNAME is used, if DOMAINID is used it will be displayed like [DOMAINID]. For reseller or admins, [CLIENTID], [CLIENTNAME] and [DOMAINID] will be displayed if client or domain is not selected.
See merge request !112
| | |
| | | $name=str_replace('['.$keyword.']', $this->getClientID($dataRecord), $name); |
| | | break; |
| | | case 'DOMAINID': |
| | | $name=str_replace('['.$keyword.']', $dataRecord['parent_domain_id'], $name); |
| | | $name=str_replace('['.$keyword.']', $dataRecord['parent_domain_id'] ? $dataRecord['parent_domain_id'] : '[DOMAINID]', $name); |
| | | break; |
| | | } |
| | | } |
| | |
| | | } elseif(isset($dataRecord['sys_groupid'])) { |
| | | $client_group_id = $dataRecord['sys_groupid']; |
| | | } else { |
| | | $client_group_id = 0; |
| | | return '[CLIENTNAME]'; |
| | | } |
| | | } |
| | | |
| | |
| | | } elseif(isset($dataRecord['sys_groupid'])) { |
| | | $client_group_id = $dataRecord['sys_groupid']; |
| | | } else { |
| | | $client_group_id = 0; |
| | | return '[CLIENTID]'; |
| | | } |
| | | } |
| | | $tmp = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE groupid = " . $app->functions->intval($client_group_id)); |
| | |
| | | $app->tpl->setVar("database_name", $app->tools_sites->removePrefix($this->dataRecord['database_name'], $this->dataRecord['database_name_prefix'], $dbname_prefix)); |
| | | } |
| | | |
| | | $app->tpl->setVar("database_name_prefix", $app->tools_sites->getPrefix($this->dataRecord['database_name_prefix'], $dbname_prefix, $global_config['dbname_prefix'])); |
| | | if($this->dataRecord['database_name'] == "") { |
| | | $app->tpl->setVar("database_name_prefix", $dbname_prefix); |
| | | } else { |
| | | $app->tpl->setVar("database_name_prefix", $app->tools_sites->getPrefix($this->dataRecord['database_name_prefix'], $dbname_prefix, $global_config['dbname_prefix'])); |
| | | } |
| | | |
| | | if($this->id > 0) { |
| | | //* we are editing a existing record |
| | |
| | | $app->tpl->setVar("database_user", $app->tools_sites->removePrefix($this->dataRecord['database_user'], $this->dataRecord['database_user_prefix'], $dbuser_prefix)); |
| | | } |
| | | |
| | | |
| | | $app->tpl->setVar("database_user_prefix", $app->tools_sites->getPrefix($this->dataRecord['database_user_prefix'], $dbuser_prefix, $global_config['dbuser_prefix'])); |
| | | if($this->dataRecord['database_user'] == "") { |
| | | $app->tpl->setVar("database_user_prefix", $dbuser_prefix); |
| | | } else { |
| | | $app->tpl->setVar("database_user_prefix", $app->tools_sites->getPrefix($this->dataRecord['database_user_prefix'], $dbuser_prefix, $global_config['dbuser_prefix'])); |
| | | } |
| | | |
| | | parent::onShowEnd(); |
| | | } |
| | |
| | | $app->tpl->setVar("username", $app->tools_sites->removePrefix($this->dataRecord['username'], $this->dataRecord['username_prefix'], $ftpuser_prefix)); |
| | | } |
| | | |
| | | $app->tpl->setVar("username_prefix", $app->tools_sites->getPrefix($this->dataRecord['username_prefix'], $ftpuser_prefix, $global_config['ftpuser_prefix'])); |
| | | if($this->dataRecord['username'] == "") { |
| | | $app->tpl->setVar("username_prefix", $ftpuser_prefix); |
| | | } else { |
| | | $app->tpl->setVar("username_prefix", $app->tools_sites->getPrefix($this->dataRecord['username_prefix'], $ftpuser_prefix, $global_config['ftpuser_prefix'])); |
| | | } |
| | | |
| | | parent::onShowEnd(); |
| | | } |
| | |
| | | $app->tpl->setVar("username", $app->tools_sites->removePrefix($this->dataRecord['username'], $this->dataRecord['username_prefix'], $shelluser_prefix)); |
| | | } |
| | | |
| | | $app->tpl->setVar("username_prefix", $app->tools_sites->getPrefix($this->dataRecord['username_prefix'], $shelluser_prefix, $global_config['shelluser_prefix'])); |
| | | if($this->dataRecord['username'] == "") { |
| | | $app->tpl->setVar("username_prefix", $shelluser_prefix); |
| | | } else { |
| | | $app->tpl->setVar("username_prefix", $app->tools_sites->getPrefix($this->dataRecord['username_prefix'], $shelluser_prefix, $global_config['shelluser_prefix'])); |
| | | } |
| | | |
| | | if($this->id > 0) { |
| | | //* we are editing a existing record |
| | |
| | | $app->tpl->setVar("username", $app->tools_sites->removePrefix($this->dataRecord['username'], $this->dataRecord['username_prefix'], $webdavuser_prefix)); |
| | | } |
| | | |
| | | $app->tpl->setVar("username_prefix", $app->tools_sites->getPrefix($this->dataRecord['username_prefix'], $webdavuser_prefix, $global_config['webdavuser_prefix'])); |
| | | if($this->dataRecord['username'] == "") { |
| | | $app->tpl->setVar("username_prefix", $webdavuser_prefix); |
| | | } else { |
| | | $app->tpl->setVar("username_prefix", $app->tools_sites->getPrefix($this->dataRecord['username_prefix'], $webdavuser_prefix, $global_config['webdavuser_prefix'])); |
| | | } |
| | | |
| | | if($this->id > 0) { |
| | | //* we are editing a existing record |