Commit 05457e3f authored by vogelor's avatar vogelor

Site->aliasdomain now works together with the domain - module

parent 1293d860
......@@ -3,48 +3,54 @@
<div class="panel panel_web_domain">
<div class="pnl_formsarea">
<fieldset class="inlineLabels">
<div class="ctrlHolder">
<label for="domain">{tmpl_var name='domain_txt'}</label>
<input name="domain" id="domain" value="{tmpl_var name='domain'}" size="30" maxlength="255" type="text" class="textInput" />
<div class="pnl_formsarea">
<fieldset class="inlineLabels">
<div class="ctrlHolder">
<label for="domain">{tmpl_var name='domain_txt'}</label>
<tmpl_if name="domain_option">
<select name="domain" id="domain" class="selectInput">
{tmpl_var name='domain_option'}
</select>
<tmpl_else>
<input name="domain" id="domain" value="{tmpl_var name='domain'}" size="30" maxlength="255" type="text" class="textInput" />
</tmpl_if>
</div>
<div class="ctrlHolder">
<label for="parent_domain_id">{tmpl_var name='parent_domain_id_txt'}</label>
<select name="parent_domain_id" id="parent_domain_id" class="selectInput">
<div class="ctrlHolder">
<label for="parent_domain_id">{tmpl_var name='parent_domain_id_txt'}</label>
<select name="parent_domain_id" id="parent_domain_id" class="selectInput">
{tmpl_var name='parent_domain_id'}
</select>
</div>
<div class="ctrlHolder">
<label for="redirect_type">{tmpl_var name='redirect_type_txt'}</label>
<select name="redirect_type" id="redirect_type" class="selectInput formLengthHalf">
</div>
<div class="ctrlHolder">
<label for="redirect_type">{tmpl_var name='redirect_type_txt'}</label>
<select name="redirect_type" id="redirect_type" class="selectInput formLengthHalf">
{tmpl_var name='redirect_type'}
</select>
</div>
<div class="ctrlHolder">
<label for="redirect_path">{tmpl_var name='redirect_path_txt'}</label>
<input name="redirect_path" id="redirect_path" value="{tmpl_var name='redirect_path'}" size="30" maxlength="255" type="text" class="textInput" />
</div>
<div class="ctrlHolder">
<label for="subdomain">{tmpl_var name='subdomain_txt'}</label>
<select name="subdomain" id="subdomain" class="selectInput formLengthHalf">
<div class="ctrlHolder">
<label for="redirect_path">{tmpl_var name='redirect_path_txt'}</label>
<input name="redirect_path" id="redirect_path" value="{tmpl_var name='redirect_path'}" size="30" maxlength="255" type="text" class="textInput" />
</div>
<div class="ctrlHolder">
<label for="subdomain">{tmpl_var name='subdomain_txt'}</label>
<select name="subdomain" id="subdomain" class="selectInput formLengthHalf">
{tmpl_var name='subdomain'}
</select>
</div>
<div class="ctrlHolder">
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='active_txt'}</p>
<div class="multiField">
<div class="multiField">
{tmpl_var name='active'}
</div>
</div>
</div>
</fieldset>
</fieldset>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<div class="buttonHolder buttons">
<button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','sites/web_aliasdomain_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button>
<button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('sites/web_aliasdomain_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
</div>
</div>
<div class="buttonHolder buttons">
<button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','sites/web_aliasdomain_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button>
<button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('sites/web_aliasdomain_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
</div>
</div>
</div>
......@@ -68,20 +68,54 @@ class page_action extends tform_actions {
parent::onShowNew();
}
/*
function onShowEnd() {
global $app, $conf;
// Get the record of the parent domain
$parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".intval($this->dataRecord["parent_domain_id"]));
$this->dataRecord["domain"] = str_replace('.'.$parent_domain["domain"],'',$this->dataRecord["domain"]);
$app->tpl->setVar("domain",$this->dataRecord["domain"]);
/*
* Now we have to check, if we should use the domain-module to select the domain
* or not
*/
$app->uses('ini_parser,getconf');
$settings = $app->getconf->get_global_config('domains');
if ($settings['use_domain_module'] == 'y') {
/*
* The domain-module is in use.
*/
$client_group_id = $_SESSION["s"]["user"]["default_group"];
/*
* The admin can select ALL domains, the user only the domains assigned to him
*/
$sql = "SELECT domain FROM domain ";
if ($_SESSION["s"]["user"]["typ"] != 'admin') {
$sql .= "WHERE sys_groupid =" . $client_group_id;
}
$sql .= " ORDER BY domain";
$domains = $app->db->queryAllRecords($sql);
$domain_select = '';
if(is_array($domains) && sizeof($domains) > 0) {
/* We have domains in the list, so create the drop-down-list */
foreach( $domains as $domain) {
$domain_select .= "<option value=" . $domain['domain'] ;
if ($domain['domain'] == $this->dataRecord["domain"]) {
$domain_select .= " selected";
}
$domain_select .= ">" . $domain['domain'] . "</option>\r\n";
}
}
else {
/*
* We have no domains in the domain-list. This means, we can not add ANY new domain.
* To avoid, that the variable "domain_option" is empty and so the user can
* free enter a domain, we have to create a empty option!
*/
$domain_select .= "<option value=''></option>\r\n";
}
$app->tpl->setVar("domain_option",$domain_select);
}
parent::onShowEnd();
}
*/
function onSubmit() {
global $app, $conf;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment