Exemple #1
0
if ($apps['max'] != 0) {
    $percent_apps = $apps['used'] * 100 / $apps['max'];
}
$disk['max'] = round($disk['max'] / 1024, 2) . " {$lang['gb']}";
if ($disk['used'] >= 1024) {
    $disk['used'] = round($disk['used'] / 1024, 2) . " {$lang['gb']}";
} else {
    $disk['used'] = "{$disk['used']} {$lang['mb']}";
}
$mem['max'] = round($mem['max'] / 1024, 2) . " {$lang['gb']}";
if ($mem['used'] >= 1024) {
    $mem['used'] = round($mem['used'] / 1024, 2) . " {$lang['gb']}";
} else {
    $mem['used'] = "{$mem['used']} {$lang['mb']}";
}
$content = "\n\t\t<div class=\"panel\">\n\t\t\t<div class=\"top\">\n\t\t\t\t<div class=\"left\" style=\"padding-top: 5px;\">\n\t\t\t\t\t<h1 class=\"dark\">{$lang['title']}</h1>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"right\">\n\t\t\t\t\t<a class=\"button classic\" href=\"/panel/raise\" style=\"width: 200px; height: 22px; float: right;\">\n\t\t\t\t\t\t<img style=\"float: left;\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/plus-white.png\" />\n\t\t\t\t\t\t<span style=\"display: block; padding-top: 3px;\">{$lang['more']}</span>\n\t\t\t\t\t</a>\t\t\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"clear\"></div><br /><br />\n\t\t\t<div class=\"container\">\n\t\t\t\t<div style=\"float: left; width: 500px;\">\n\t\t\t\t\t<span style=\"block; float: left; padding-top: 7px; font-size: 18px; color: #878787;\">{$lang['memory']}</span>\n\t\t\t\t\t<div style=\"float: right;\">\n\t\t\t\t\t\t<div class=\"fillgraph\" style=\"margin-top: 10px;\">\n\t\t\t\t\t\t\t<small style=\"width: {$percent_memory}%;\"></small>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class=\"quota\"><span style='font-weight: bold;'>{$mem['used']}</span> {$lang['of']} {$mem['max']}.</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"clear\"></div><br />\n\t\t\t\t\t<span style=\"block; float: left; padding-top: 7px; font-size: 18px; color: #878787;\">{$lang['disk']}</span>\n\t\t\t\t\t<div style=\"float: right;\">\n\t\t\t\t\t\t<div class=\"fillgraph\" style=\"margin-top: 10px;\">\n\t\t\t\t\t\t\t<small style=\"width: {$percent_disk}%;\"></small>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class=\"quota\"><span style='font-weight: bold;'>{$disk['used']}</span> {$lang['of']} {$disk['max']}.</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div style=\"float: right; width: 500px;\">\n\t\t\t\t\t<span style=\"block; float: left; padding-top: 7px; font-size: 18px; color: #878787;\">{$lang['services']}</span>\n\t\t\t\t\t<div style=\"float: right;\">\n\t\t\t\t\t\t<div class=\"fillgraph\" style=\"margin-top: 10px;\">\n\t\t\t\t\t\t\t<small style=\"width: {$percent_services}%;\"></small>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class=\"quota\"><span style='font-weight: bold;'>{$services['used']}</span> {$lang['of']} {$services['max']}.</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"clear\"></div><br />\n\t\t\t\t\t<span style=\"block; float: left; padding-top: 7px; font-size: 18px; color: #878787;\">{$lang['apps']}</span>\n\t\t\t\t\t<div style=\"float: right;\">\n\t\t\t\t\t\t<div class=\"fillgraph\" style=\"margin-top: 10px;\">\n\t\t\t\t\t\t\t<small style=\"width: {$percent_apps}%;\"></small>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class=\"quota\"><span style='font-weight: bold;'>{$apps['used']}</span> {$lang['of']} {$apps['max']}.</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"clear\"></div><br /><br />\n\t\t\t\t<br />\n\t\t\t\t<h2 class=\"dark\">{$lang['sizes']}</h2>\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th style=\"text-align: center; width: 40px;\">#</th>\n\t\t\t\t\t\t<th>{$lang['name']}</th>\n\t\t\t\t\t\t<th>{$lang['type']}</th>\n\t\t\t\t\t\t<th>{$lang['path']}</th>\n\t\t\t\t\t\t<th>{$lang['size']}</th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td style=\"text-align: center; width: 40px;\"><img src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/ftp.png\" style=\"width: 40px;\" /></td>\n\t\t\t\t\t\t<td>{$lang['cloud']}</td>\n\t\t\t\t\t\t<td>{$lang['cloud_type']}</td>\n\t\t\t\t\t\t<td>/dns/com/anotherservice/Users/" . security::get('USER') . "</td>\n\t\t\t\t\t\t<td><span style=\"font-weight: bold;\">{$me['size']} {$lang['mb']}</span></td>\n\t\t\t\t\t</tr>\n";
foreach ($apps2 as $a) {
    $content .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td style=\"text-align: center; width: 40px;\"><img src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/panel.png\" style=\"width: 40px;\" /></td>\n\t\t\t\t\t\t<td>{$a['tag']}</td>\n\t\t\t\t\t\t<td>{$lang['app']}</td>\n\t\t\t\t\t\t<td>{$a['homeDirectory']}</td>\n\t\t\t\t\t\t<td><span style=\"font-weight: bold;\">{$a['size']} {$lang['mb']}</span></td>\n\t\t\t\t\t</tr>\n\t";
}
foreach ($services2 as $s) {
    $content .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td style=\"text-align: center; width: 40px;\"><img src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/service.png\" style=\"width: 40px;\" /></td>\n\t\t\t\t\t\t<td>{$s['description']}</td>\n\t\t\t\t\t\t<td>{$lang['service']} {$s['vendor']}</td>\n\t\t\t\t\t\t<td>/services/{$s['name']}-master</td>\n\t\t\t\t\t\t<td><span style=\"font-weight: bold;\">{$s['size']} {$lang['mb']}</span></td>\n\t\t\t\t\t</tr>\n\t";
    if (count($s['branches']) > 0) {
        foreach ($s['branches'] as $b) {
            $content .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td style=\"text-align: center; width: 40px;\"><img src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/service.png\" style=\"width: 40px;\" /></td>\n\t\t\t\t\t\t<td>{$s['description']}</td>\n\t\t\t\t\t\t<td>{$lang['service']} {$s['vendor']}</td>\n\t\t\t\t\t\t<td>/services/{$s['name']}-{$b['branch_name']}</td>\n\t\t\t\t\t\t<td><span style=\"font-weight: bold;\">{$b['size']} {$lang['mb']}</span></td>\n\t\t\t\t\t</tr>\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t";
        }
    }
}
foreach ($domains2 as $d) {
    $users = api::send('self/account/list', array('domain' => $d['hostname']));
    foreach ($users as $u) {
        $content .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td style=\"text-align: center; width: 40px;\"><img src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/user.png\" style=\"width: 40px;\" /></td>\n\t\t\t\t\t\t<td>{$u['mail']}</td>\n\t\t\t\t\t\t<td>{$lang['user']}</td>\n\t\t\t\t\t\t<td>{$u['homeDirectory']}</td>\n\t\t\t\t\t\t<td><span style=\"font-weight: bold;\">{$u['size']} {$lang['mb']}</span></td>\n\t\t\t\t\t</tr>\n\t\t";
Exemple #2
0
    if ($q['name'] == 'BYTES') {
        $quota = $q;
    }
}
$percent = $quota['used'] * 100 / $quota['max'];
if ($quota['used'] >= 1024) {
    $quota['used'] = round($quota['used'] / 1024, 2) . " {$lang['gb']}";
} else {
    $quota['used'] = "{$quota['used']} {$lang['mb']}";
}
if ($quota['max'] >= 1024) {
    $quota['max'] = round($quota['max'] / 1024, 2) . " {$lang['gb']}";
} else {
    $quota['max'] = "{$quota['max']} {$lang['mb']}";
}
$content = "\r\n\t<div class=\"panel\">\r\n\t\t<div class=\"top\">\r\n\t\t\t<div class=\"left\" style=\"width: 500px;\">\r\n\t\t\t\t<img style=\"width: 60px; height: 60px; float: left; margin: 5px 10px 0px 0px; display: block;\" src=\"" . (file_exists("{$GLOBALS['CONFIG']['SITE']}/images/users/{$userinfo['id']}.png") ? "/{$GLOBALS['CONFIG']['SITE']}/images/users/{$userinfo['id']}.png" : "/{$GLOBALS['CONFIG']['SITE']}/images/users/user.png") . "\" />\r\n\t\t\t\t<h1 class=\"dark title\">" . security::get('USER') . "</h1>\r\n\t\t\t\t<h2 class=\"dark title\">" . ($userinfo['firstname'] ? "{$userinfo['firstname']} {$userinfo['lastname']}" : "{$lang['nolastname']}") . "</h2>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"right\" style=\"width: 460px;\">\r\n\t\t\t\t<span style=\"block; float: left; padding-top: 7px; font-size: 18px; color: #878787;\">{$lang['disk2']}</span>\r\n\t\t\t\t<div style=\"float: right;\">\r\n\t\t\t\t\t<div class=\"fillgraph\" style=\"margin-top: 10px;\">\r\n\t\t\t\t\t\t<small style=\"width: {$percent}%;\"></small>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<span class=\"quota\"><span style='font-weight: bold;'>{$quota['used']}</span> {$lang['of']} {$quota['max']}. <a href=\"/panel/messages\">{$lang['request']}</a>.</span>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"clear\"></div>\r\n\t\t</div>\r\n\t\t<br />\r\n\t\t<div class=\"sites\">\r\n\t\t\t<div class=\"sitescontent\">\r\n\t\t\t\t<div style=\"width: 1080px; padding: 10px; background-color: #ffffff; opacity: 0.6; border-radius: 5px; margin-bottom: 20px;\">\r\n\t\t\t\t\t<img style=\"display: block; float: left; margin-right: 10px;\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/donation.png\" />\r\n\t\t\t\t\t<span style=\"font-size: 18px; display: block; float: left;\">{$lang['help']} <a href=\"/org/help\">{$lang['help_text']}</a> !</span><br /><br />\r\n\t\t\t\t\t<span style=\"font-size: 12px; color: #ff8827; display: block; float: left; padding-top: 10px;\"\">{$lang['thanks']} <span style=\"font-weight: bold;\">{$lang['thanks2']}</span>.</span>\r\n\t\t\t\t\t<div class=\"clear\"></div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"site newsite\" id=\"newsite\">\r\n\t\t\t\t\t<div id=\"addsite\">\r\n\t\t\t\t\t\t<a href=\"#\" onclick=\"showForm(); return false;\" class=\"button classic\" style=\"margin: 0 auto; margin-top: 97px; padding: 10px 0 0 0; height: 40px; width: 50px; text-align: center;\">\r\n\t\t\t\t\t\t\t<img src=\"/{$GLOBALS['CONFIG']['SITE']}/images/plus-white-big.png\" />\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div id=\"formsite\" style=\"display: none; position: relative; padding: 30px 10px 10px 10px;\">\r\n\t\t\t\t\t\t<a href=\"#\" style=\"display: block; position: absolute; top: 5px; left: 5px;\" onclick=\"showNew(); return false;\"><img class=\"link\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/small/arrowLeft.png\" alt=\"\" /></a>\r\n\t\t\t\t\t\t<div class=\"form-small\">\t\t\r\n\t\t\t\t\t\t\t<form action=\"/panel/sites/add_action\" method=\"post\" class=\"center\">\r\n\t\t\t\t\t\t\t\t<fieldset style=\"padding-top: 10px;\">\r\n\t\t\t\t\t\t\t\t\t<input class=\"auto\" type=\"text\" value=\"{$lang['name']}\" name=\"subdomain\" onfocus=\"this.value = this.value=='{$lang['name']}' ? '' : this.value; this.style.color='#4c4c4c';\" onfocusout=\"this.value = this.value == '' ? this.value = '{$lang['name']}' : this.value; this.value=='{$lang['name']}' ? this.style.color='#cccccc' : this.style.color='#4c4c4c'\" />\r\n\t\t\t\t\t\t\t\t\t<span class=\"help-block\">{$lang['tipsite']}</span>\r\n\t\t\t\t\t\t\t\t</fieldset>\r\n\t\t\t\t\t\t\t\t<fieldset>\r\n\t\t\t\t\t\t\t\t\t<input class=\"auto\" type=\"password\" value=\"{$lang['password']}\" name=\"password\" onfocus=\"this.value = this.value=='{$lang['password']}' ? '' : this.value; this.style.color='#4c4c4c';\" onfocusout=\"this.value = this.value == '' ? this.value = '{$lang['password']}' : this.value; this.value=='{$lang['password']}' ? this.style.color='#cccccc' : this.style.color='#4c4c4c'\" />\r\n\t\t\t\t\t\t\t\t\t<span class=\"help-block\">{$lang['tippassword']}</span>\r\n\t\t\t\t\t\t\t\t</fieldset>\r\n\t\t\t\t\t\t\t\t<fieldset>\t\r\n\t\t\t\t\t\t\t\t\t<input autofocus type=\"submit\" value=\"{$lang['create']}\" style=\"width: 120px;\" />\r\n\t\t\t\t\t\t\t\t</fieldset>\r\n\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n";
if (count($sites) == 0) {
    $content .= "<div class=\"new\">\r\n\t\t\t\t\t<div class=\"bullet\"></div>\r\n\t\t\t\t\t<div class=\"text\">\r\n\t\t\t\t\t\t<span class=\"title\">{$lang['welcome']}</span>\r\n\t\t\t\t\t\t{$lang['welcome_text']}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t";
} else {
    $count = count($sites);
    $i = 1;
    foreach ($sites as $s) {
        if ($i == $count) {
            $last = "style=\"margin-right: 0;\"";
        }
        $i++;
        if (!$s['size']) {
            $s['size'] = 0;
        }
        $content .= "\r\n\t\t\t\t<div class=\"site\" {$last} onclick=\"window.location.href='/panel/sites/config?id={$s['id']}'; return false;\">\r\n\t\t\t\t\t<div class=\"normal\">\r\n\t\t\t\t\t\t<span style=\"font-size: 16px; font-weight: bold; display: block; margin-bottom: 5px;\">{$s['hostname']}</span>\r\n\t\t\t\t\t\t<span style=\"color: #9a9a9a; font-size: 12px; display: block; margin-bottom: 20px;\">{$lang['disk']} {$s['size']} {$lang['mb']}</span></span>\r\n\t\t\t\t\t\t<div class=\"thumbshot\">\r\n\t\t\t\t\t\t\t<img src=\"/{$GLOBALS['CONFIG']['SITE']}/images/sites/?url={$s['hostname']}\" />\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t";
    }
Exemple #3
0
    foreach ($apps as $a) {
        $content .= "\n\t\t\t\t\t\t<option value=\"{$a['id']}\">{$a['tag']} ({$a['name']})</option>";
    }
}
$content .= "\n\t\t\t\t\t</select>\n\t\t\t\t\t<span class=\"help-block\">{$lang['help_app']}</span>\n\t\t\t\t</fieldset>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<select name=\"permission\">\n\t\t\t\t\t\t<option value=\"rx\">{$lang['readonly']}</option>\n\t\t\t\t\t\t<option value=\"rwx\">{$lang['readwrite']}</option>\n\t\t\t\t\t</select>\n\t\t\t\t\t<span class=\"help-block\">{$lang['help_permission']}</span>\n\t\t\t\t</fieldset>\t\n\t\t\t\t<fieldset autofocus>\t\n\t\t\t\t\t<input type=\"submit\" value=\"{$lang['grant']}\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n\t<div id=\"newuser\" class=\"floatingdialog\" style=\"padding: 30px;\">\n\t\t<h3 class=\"center\">{$lang['add_users']}</h3>\n\t\t<p style=\"text-align: center;\">{$lang['add_users_text']}</p>\n\t\t<div class=\"form-small\">\n\t\t\t<form action=\"/panel/apps/permit_action\" method=\"get\" class=\"center\">\n\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"" . security::encode($_GET['id']) . "\" />\n\t\t\t\t<fieldset>\n\t\t\t\t\t<select name=\"member\">\n";
$domains = api::send('self/domain/list');
if (count($domains) > 0) {
    foreach ($domains as $d) {
        $users = api::send('self/account/list', array('domain' => $d['hostname']));
        if (count($users) > 0) {
            foreach ($users as $u) {
                $content .= "\n\t\t\t\t\t\t<option value=\"{$u['id']}\">{$u['mail']}</option>";
            }
        }
    }
}
$content .= "\n\t\t\t\t\t</select>\n\t\t\t\t\t<span class=\"help-block\">{$lang['help_user']}</span>\n\t\t\t\t</fieldset>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<select name=\"permission\">\n\t\t\t\t\t\t<option value=\"rx\">{$lang['readonly']}</option>\n\t\t\t\t\t\t<option value=\"rwx\">{$lang['readwrite']}</option>\n\t\t\t\t\t</select>\n\t\t\t\t\t<span class=\"help-block\">{$lang['help_permission']}</span>\n\t\t\t\t</fieldset>\t\n\t\t\t\t<fieldset autofocus>\t\n\t\t\t\t\t<input type=\"submit\" value=\"{$lang['grant']}\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n\t<div id=\"newgroup\" class=\"floatingdialog\" style=\"padding: 30px;\">\n\t\t<h3 class=\"center\">{$lang['add_groups']}</h3>\n\t\t<p style=\"text-align: center;\">{$lang['add_groups_text']}</p>\n\t\t<br />\n\t\t<div class=\"form-small\">\n\t\t\t<form action=\"/panel/apps/permit_action\" method=\"get\" class=\"center\">\n\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"" . security::encode($_GET['id']) . "\" />\n\t\t\t\t<fieldset>\n\t\t\t\t\t<select name=\"member\">\n";
$domains = api::send('self/domain/list');
if (count($domains) > 0) {
    foreach ($domains as $d) {
        $groups = api::send('self/team/list', array('domain' => $d['hostname']));
        if (count($groups) > 0) {
            foreach ($groups as $g) {
                $content .= "\n\t\t\t\t\t\t<option value=\"{$g['id']}\">{$g['mail']}</option>";
            }
        }
    }
}
$content .= "\n\t\t\t\t\t</select>\n\t\t\t\t\t<span class=\"help-block\">{$lang['help_group']}</span>\n\t\t\t\t</fieldset>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<select name=\"permission\">\n\t\t\t\t\t\t<option value=\"rx\">{$lang['readonly']}</option>\n\t\t\t\t\t\t<option value=\"rwx\">{$lang['readwrite']}</option>\n\t\t\t\t\t</select>\n\t\t\t\t\t<span class=\"help-block\">{$lang['help_permission']}</span>\n\t\t\t\t</fieldset>\t\n\t\t\t\t<fieldset autofocus>\t\n\t\t\t\t\t<input type=\"submit\" value=\"{$lang['grant']}\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n\t<div id=\"push\" class=\"floatingdialog\">\n\t\t<br />\n\t\t<h3 class=\"center\" style=\"padding-top: 5px;\">{$lang['push_title']}</h3>\n\t\t<p style=\"text-align: center;\">{$lang['push_text']}</p>\n\t\t<br />\n\t\t<h2 class=\"dark\" style=\"text-align: center;\">{$lang['access']}</h2>\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<th>{$lang['type']}</th>\n\t\t\t\t<th>{$lang['infos']}</th>\n\t\t\t\t<th>{$lang['user']}</th>\n\t\t\t\t<th>{$lang['port']}</th>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td><span class=\"large\">SSH</span></td>\n\t\t\t\t<td>ssh://git.as/~" . security::get('USER') . "/{$app['name']}.git</td>\n\t\t\t\t<td>" . security::get('USER') . "</td>\n\t\t\t\t<td>22</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<br />\n\t\t<h2 class=\"dark\" style=\"text-align: center;\">{$lang['paths']}</h2>\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<th>{$lang['type']}</th>\n\t\t\t\t<th>{$lang['folder']}</th>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>{$lang['git']}</td>\n\t\t\t\t<td colspan=\"2\">{$app['homeDirectory']}</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<br />\n\t</div>\n\t<script>\n\t\tnewFlexibleDialog('newapp', 550);\n\t\tnewFlexibleDialog('newuser', 550);\n\t\tnewFlexibleDialog('newgroup', 550);\n\t\tnewFlexibleDialog('push', 900);\n\t</script>\n\t";
/* ========================== OUTPUT PAGE ========================== */
$template->output($content);
Exemple #4
0
<?php

if (!defined('PROPER_START')) {
    header("HTTP/1.0 403 Forbidden");
    exit;
}
if (preg_match("/^[0-9]{2,30}\$/", $_POST['id']) != 1) {
    raise(new SecurityException(iSeverity::CRITICAL, $lang['ABNORMAL_PARAMETER_VALUE']));
}
$form = new form('edit_domain');
$form->checkReferer();
$form->reset();
$form->importValues($_POST);
$form->setCheck('dir', $lang['check_dir'], formCheck::ALLTEXT, 2, 30, true);
if (preg_match("/(^\\/?\\.\\.|\\/\\.\\.\\/?\$|\\/\\.\\.\\/|\\\\|\\s)/", $_POST['dir']) > 0) {
    $form->setError('dir', $lang['check_dir']);
}
$form->validate();
$home = '/dns/com/olympe-network/' . security::get('user') . '/' . $form->getValue('dir');
$sql = "UPDATE domain SET homeDirectory = '" . security::encode($home, false) . "' WHERE uid = '{$_POST['id']}'";
$userapi->query($sql, iDatabase::NO_ROW);
// LOG ACTION IN HISTORY
$sql = "SELECT Hostname FROM domain WHERE uid = '{$_POST['id']}'";
$domain = $userapi->query($sql);
$data = array('domain' => $domain['Hostname'], 'dir' => $form->getValue('dir'));
$logger = new logger();
$logger->log($data);
$form->cleanup();
$template->redirect('/panel/domains/edit?done&id=' . $_POST['id']);
Exemple #5
0
<?php

if (!defined('PROPER_START')) {
    header("HTTP/1.0 403 Forbidden");
    exit;
}
try {
    $message = api::send('self/message/list', array('id' => $_GET['id']));
    $message = $message[0];
    $messages = api::send('self/message/list', array('parent' => $_GET['id']));
} catch (Exception $e) {
    template::redirect('/admin/messages');
}
if (!$message['id'] || !$_GET['id']) {
    template::redirect('/admin/messages');
}
$content .= "\n\t<div class=\"panel\">\n\t\t<div class=\"top\">\n\t\t\t<div class=\"left\" style=\"width: 600px;\">\n\t\t\t\t<h3>{$message['title']}</h3>\n\t\t\t</div>\n\t\t\t<div class=\"right\" style=\"width: 400px; float: right; text-align: right;\">\n\t\t\t\t<a class=\"button classic\" href=\"#\" onclick=\"\$('#reply').dialog('open'); return false;\" style=\"width: 180px; height: 22px; float: right;\">\n\t\t\t\t\t<span style=\"display: block; padding-top: 3px;\">{$lang['reply']}</span>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t\t<div class=\"clear\"></div><br /><br />\n\t\t</div>\n\t\t<div class=\"container\">\n\t\t\t<div class=\"topic\">\n";
foreach ($messages as $m) {
    $content .= "\n\t\t\t\t<div class=\"message\">\n\t\t\t\t\t<div class=\"toppart\">\n\t\t\t\t\t\t<div class=\"messageid\">\n\t\t\t\t\t\t\t#{$m['id']}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"date\">\n\t\t\t\t\t\t\t" . date($lang['dateformat'], $m['date']) . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"icons\">\n\t\t";
    if ($m['user']['name'] == security::get('USER')) {
        $content .= "\n\t\t\t\t\t\t\t<a href=\"#\" onclick=\"showEdit('{$m['id']}'); return false;\"><img class=\"link\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/small/pencil.png\" alt=\"\" /></a>\n\t\t\t\t\t\t\t<a href=\"#\" onclick=\"\$('#id').val('{$m['id']}'); \$('#delete').dialog('open'); return false;\"><img class=\"link\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/small/close.png\" alt=\"\" /></a>\n\t\t\t";
    }
    $content .= "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"meta\">\n\t\t\t\t\t\t<img style=\"width: 80px; display: block;\" src=\"" . (file_exists("{$GLOBALS['CONFIG']['SITE']}/images/users/{$m['user']['id']}.png") ? "/{$GLOBALS['CONFIG']['SITE']}/images/users/{$m['user']['id']}.png" : "/{$GLOBALS['CONFIG']['SITE']}/images/users/user.png") . "\" />\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t{$m['user']['name']}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"text\">\n\t\t\t\t\t\t<form action=\"/panel/messages/update_action\" method=\"post\">\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{$m['id']}\" />\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"parent\" value=\"{$message['id']}\" />\n\t\t\t\t\t\t\t<p id=\"text{$m['id']}\">" . bbcode::display($m['content']) . "</p>\n\t\t\t\t\t\t\t<textarea id=\"edit{$m['id']}\" style=\"display: none; width: 700px; height: 200px;\" name=\"content\">" . bbcode::edit($m['content']) . "</textarea>\n\t\t\t\t\t\t\t<input id=\"submit{$m['id']}\" style=\"display: none;\" type=\"submit\" value=\"{$lang['update']}\" />\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t</div>\n\t\t";
}
$content .= "\n\t\t\t\t<div class=\"message\">\n\t\t\t\t\t<div class=\"toppart\">\n\t\t\t\t\t\t<div class=\"messageid\">\n\t\t\t\t\t\t\t#{$message['id']}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"date\">\n\t\t\t\t\t\t\t" . date($lang['dateformat'], $message['date']) . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"icons\">\n\t\t\t\t\t\t\t<a href=\"#\" onclick=\"showEdit('{$message['id']}'); return false;\"><img class=\"link\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/small/pencil.png\" alt=\"\" /></a>\n\t\t\t\t\t\t\t<a href=\"#\" onclick=\"\$('#id').val('{$message['id']}'); \$('#delete').dialog('open'); return false;\"><img class=\"link\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/small/close.png\" alt=\"\" /></a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"meta\">\n\t\t\t\t\t\t<img style=\"width: 80px; display: block;\" src=\"" . (file_exists("{$GLOBALS['CONFIG']['SITE']}/images/users/{$message['user']['id']}.png") ? "/{$GLOBALS['CONFIG']['SITE']}/images/users/{$message['user']['id']}.png" : "/{$GLOBALS['CONFIG']['SITE']}/images/users/user.png") . "\" />\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t{$message['user']['name']}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"text\">\n\t\t\t\t\t\t<form action=\"/panel/messages/update_action\" method=\"post\">\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{$message['id']}\" />\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"parent\" value=\"{$message['id']}\" />\n\t\t\t\t\t\t\t<p id=\"text{$message['id']}\">" . bbcode::display($message['content']) . "</p>\n\t\t\t\t\t\t\t<textarea id=\"edit{$message['id']}\" style=\"display: none; width: 700px; height: 200px;\" name=\"content\">" . bbcode::edit($message['content']) . "</textarea>\n\t\t\t\t\t\t\t<input id=\"submit{$message['id']}\" style=\"display: none;\" type=\"submit\" value=\"{$lang['update']}\" />\n\t\t\t\t\t\t</form>\t\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<br />\n\t\t\t<a class=\"button classic\" href=\"#\" onclick=\"\$('#reply').dialog('open'); return false;\" style=\"width: 180px; height: 22px; float: right;\">\n\t\t\t\t<span style=\"display: block; padding-top: 3px;\">{$lang['reply']}</span>\n\t\t\t</a>\n\t\t</div>\n\t\t<div class=\"clear\"></div><br /><br />\n\t</div>\n\t<div id=\"reply\" class=\"floatingdialog\">\n\t\t<br />\n\t\t<h3 class=\"center\">{$lang['reply']}</h3>\n\t\t<div class=\"form-small\">\t\t\n\t\t\t<form action=\"/panel/messages/add_action\" method=\"post\" class=\"center\">\n\t\t\t\t<input type=\"hidden\" name=\"parent\" value=\"{$message['id']}\" />\n\t\t\t\t<input type=\"hidden\" name=\"type\" value=\"{$message['type']}\" />\n\t\t\t\t<fieldset>\n\t\t\t\t\t<textarea class=\"auto\" style=\"text-align: left; width: 400px; height: 150px;\" name=\"content\" onfocus=\"this.value = this.value=='{$lang['content']}' ? '' : this.value; this.style.color='#4c4c4c';\" onfocusout=\"this.value = this.value == '' ? this.value = '{$lang['content']}' : this.value; this.value=='{$lang['content']}' ? this.style.color='#cccccc' : this.style.color='#4c4c4c'\">{$lang['content']}</textarea>\n\t\t\t\t\t<span class=\"help-block\">{$lang['content_help']}</span>\n\t\t\t\t</fieldset>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<input autofocus type=\"submit\" value=\"{$lang['send']}\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n\t<div id=\"delete\" class=\"floatingdialog\">\n\t\t<h3 class=\"center\">{$lang['delete']}</h3>\n\t\t<p style=\"text-align: center;\">{$lang['delete_text']}</p>\n\t\t<div class=\"form-small\">\t\t\n\t\t\t<form action=\"/panel/messages/del_action\" method=\"get\" class=\"center\">\n\t\t\t\t<input id=\"id\" type=\"hidden\" value=\"\" name=\"id\" />\n\t\t\t\t<input type=\"hidden\" value=\"{$message['id']}\" name=\"parent\" />\n\t\t\t\t<fieldset>\t\n\t\t\t\t\t<input autofocus type=\"submit\" value=\"{$lang['delete_now']}\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n\t<script>\n\t\tnewFlexibleDialog('reply', 550);\n\t\tnewFlexibleDialog('delete', 550);\n\t\tvar status = 0;\n\t\tfunction showEdit(id)\n\t\t{\n\t\t\tvar options = {};\n\t\t\tif( status == 0 )\n\t\t\t{\n\t\t\t\t\$(\"#text\" + id).css(\"display\", \"none\");\n\t\t\t\t\$(\"#submit\"  + id).show(\"fade\", options, 200);\n\t\t\t\t\$(\"#edit\"  + id).show(\"fade\", options, 200);\n\t\t\t\tstatus = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\$(\"#submit\" + id).css(\"display\", \"none\");\n\t\t\t\t\$(\"#edit\" + id).css(\"display\", \"none\");\n\t\t\t\t\$(\"#text\"  + id).show(\"fade\", options, 200);\n\t\t\t\tstatus = 0;\n\t\t\t}\n\t\t}\n\t</script>\n";
/* ========================== OUTPUT PAGE ========================== */
$template->output($content);
Exemple #6
0
<?php

if (!defined('PROPER_START')) {
    header("HTTP/1.0 403 Forbidden");
    exit;
}
if ($security->hasAccess('/panel')) {
    $user = security::get('USER');
}
$message = "\r\nName: " . security::encode($_POST['name']) . "\r\nEmail: " . security::encode($_POST['email']) . "\r\nSubjet: " . security::encode($_POST['subject']) . "\r\nCompte: {$user}\r\n\r\nMessage: " . security::encode($_POST['message']) . "\r\n";
mail("*****@*****.**", "[Olympe] {$_POST['subject']}", $message, "From: " . security::encode($_POST['email']));
$_SESSION['MESSAGE']['TYPE'] = 'success';
$_SESSION['MESSAGE']['TEXT'] = $lang['success'];
template::redirect('/about/contact');
/* ========================== OUTPUT PAGE ========================== */
$template->output($content);
Exemple #7
0
if (count($domains) == 0) {
    template::redirect('/panel/domains');
}
if ($mquota['max'] > 0) {
    $mpercent = $mquota['used'] * 100 / $mquota['max'];
}
if ($aquota['max'] > 0) {
    $apercent = $aquota['used'] * 100 / $aquota['max'];
}
$mquota['max'] = round($mquota['max'] / 1024, 2) . " {$lang['gb']}";
if ($mquota['used'] >= 1024) {
    $mquota['used'] = round($mquota['used'] / 1024, 2) . " {$lang['gb']}";
} else {
    $mquota['used'] = "{$mquota['used']} {$lang['mb']}";
}
$content = "\r\n\t<div class=\"panel\">\r\n\t\t<div class=\"top\">\r\n\t\t\t<div class=\"left\" style=\"width: 500px;\">\r\n\t\t\t\t<img style=\"width: 60px; height: 60px; float: left; margin: 5px 10px 0px 0px; display: block;\" src=\"" . (file_exists("{$GLOBALS['CONFIG']['SITE']}/images/users/{$userinfo['id']}.png") ? "/{$GLOBALS['CONFIG']['SITE']}/images/users/{$userinfo['id']}.png" : "/{$GLOBALS['CONFIG']['SITE']}/images/users/user.png") . "\" />\r\n\t\t\t\t<h1 class=\"dark title\">" . security::get('USER') . "</h1>\r\n\t\t\t\t<h2 class=\"dark title\">" . ($userinfo['firstname'] ? "{$userinfo['firstname']} {$userinfo['lastname']}" : "{$lang['nolastname']}") . "</h2>\r\n\t\t\t</div>\r\n";
if ($mquota['max'] > 0) {
    $content .= "\r\n\t\t\t<div class=\"right\" style=\"width: 450px;\">\r\n\t\t\t\t<span style=\"block; float: left; padding-top: 7px; font-size: 18px; color: #878787;\">{$lang['memory2']}</span>\r\n\t\t\t\t<div style=\"float: right;\">\r\n\t\t\t\t\t<div class=\"fillgraph\" style=\"margin-top: 10px;\">\r\n\t\t\t\t\t\t<small style=\"width: {$mpercent}%;\"></small>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<span class=\"quota\"><span style='font-weight: bold;'>{$mquota['used']}</span> {$lang['of']} {$mquota['max']}. <a href=\"/panel/raise\">{$lang['request']}</a>.</span>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t";
} else {
    if ($aquota['max'] > 0) {
        $content .= "\r\n\t\t\t<div class=\"right\" style=\"width: 450px;\">\r\n\t\t\t\t<span style=\"block; float: left; padding-top: 7px; font-size: 18px; color: #878787;\">{$lang['apps2']}</span>\r\n\t\t\t\t<div style=\"float: right;\">\r\n\t\t\t\t\t<div class=\"fillgraph\" style=\"margin-top: 10px;\">\r\n\t\t\t\t\t\t<small style=\"width: {$apercent}%;\"></small>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<span class=\"quota\"><span style='font-weight: bold;'>{$aquota['used']}</span> {$lang['of']} {$aquota['max']}. <a href=\"/panel/raise\">{$lang['request']}</a>.</span>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t";
    }
}
$content .= "\r\n\t\t\t<div class=\"clear\"></div>\r\n\t\t</div>\r\n\t\t<br />\r\n\t\t<div class=\"apps\">\r\n\t\t\t<div class=\"appscontent\">\r\n\t\t\t\t<div class=\"app newapp\" id=\"newapp\">\r\n\t\t\t\t\t<div id=\"addapp\">\r\n\t\t\t\t\t\t<a href=\"#\" onclick=\"showForm(); return false;\" class=\"button classic\" style=\"margin: 0 auto; margin-top: 97px; padding: 10px 0 0 0; height: 40px; width: 50px; text-align: center;\">\r\n\t\t\t\t\t\t\t<img src=\"/{$GLOBALS['CONFIG']['SITE']}/images/plus-white-big.png\" />\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div id=\"formapp\" style=\"display: none; position: relative; padding: 30px 10px 10px 10px;\">\r\n\t\t\t\t\t\t<a href=\"#\" style=\"display: block; position: absolute; top: 5px; left: 5px;\" onclick=\"showNew(); return false;\"><img class=\"link\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/small/arrowLeft.png\" alt=\"\" /></a>\r\n\t\t\t\t\t\t<div class=\"form-small\">\t\t\r\n\t\t\t\t\t\t\t<form action=\"/panel/apps/add\" method=\"post\" class=\"center\">\r\n\t\t\t\t\t\t\t\t<fieldset style=\"padding-top: 10px;\">\r\n\t\t\t\t\t\t\t\t\t<input class=\"auto\" type=\"text\" value=\"{$lang['name']}\" name=\"tag\" onfocus=\"this.value = this.value=='{$lang['name']}' ? '' : this.value; this.style.color='#4c4c4c';\" onfocusout=\"this.value = this.value == '' ? this.value = '{$lang['name']}' : this.value; this.value=='{$lang['name']}' ? this.style.color='#cccccc' : this.style.color='#4c4c4c'\" />\r\n\t\t\t\t\t\t\t\t\t<span class=\"help-block\">{$lang['tipapp']}</span>\r\n\t\t\t\t\t\t\t\t</fieldset>\r\n\t\t\t\t\t\t\t\t<fieldset>\r\n\t\t\t\t\t\t\t\t\t<input class=\"auto\" type=\"password\" value=\"{$lang['password']}\" name=\"password\" onfocus=\"this.value = this.value=='{$lang['password']}' ? '' : this.value; this.style.color='#4c4c4c';\" onfocusout=\"this.value = this.value == '' ? this.value = '{$lang['password']}' : this.value; this.value=='{$lang['password']}' ? this.style.color='#cccccc' : this.style.color='#4c4c4c'\" />\r\n\t\t\t\t\t\t\t\t\t<span class=\"help-block\">{$lang['tippassword']}</span>\r\n\t\t\t\t\t\t\t\t</fieldset>\r\n\t\t\t\t\t\t\t\t<fieldset>\t\r\n\t\t\t\t\t\t\t\t\t<input autofocus type=\"submit\" value=\"{$lang['create']}\" style=\"width: 120px;\" />\r\n\t\t\t\t\t\t\t\t</fieldset>\r\n\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n";
if (count($apps) == 0) {
    $content .= "<div class=\"new\">\r\n\t\t\t\t\t<div class=\"bullet\"></div>\r\n\t\t\t\t\t<div class=\"text\">\r\n\t\t\t\t\t\t<span class=\"title\">{$lang['welcome']}</span>\r\n\t\t\t\t\t\t{$lang['welcome_text']}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t";
} else {
    $count = count($apps);
    $i = 1;
    foreach ($apps as $a) {
        $language = explode('-', $a['name']);
Exemple #8
0
if ($mquota['max'] > 0) {
    $content .= "\n\t\t\t\t<fieldset>\n\t\t\t\t\t<select style=\"width: 420px;\" name=\"cache\" style=\"text-align: center;\">\n\t\t\t\t\t\t<option " . ($app['cache'] != 1 ? "selected" : "") . " value=\"0\" style=\"text-align: center;\">{$lang['inactive']}</option>\n\t\t\t\t\t\t<option " . ($app['cache'] == 1 ? "selected" : "") . " value=\"1\" style=\"text-align: center;\">{$lang['active']}</option>\n\t\t\t\t\t</select>\n\t\t\t\t\t<span class=\"help-block\">{$lang['cache_help']}</span>\n\t\t\t\t</fieldset>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<input disabled style=\"width: 400px;\" type=\"text\" name=\"tag\" value=\"" . ($app['binary'] ? "{$lang['command']} {$app['binary']}" : str_replace('{BRANCH}', security::encode($_SESSION['DATA'][$app['id']]['branch']), $lang['binary_' . $language])) . "\" />\n\t\t\t\t\t<span class=\"help-block\">{$lang['binary_help']}</span>\n\t\t\t\t</fieldset>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<input disabled style=\"width: 400px;\" type=\"text\" name=\"certificate\" value=\"" . ($app['certificate'] ? "{$app['certificate']}-crt+ca.pem" : "{$lang['nocertficiate']}") . "\" />\n\t\t\t\t\t<span class=\"help-block\">{$lang['certificate_help']}</span>\n\t\t\t\t</fieldset>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<div style=\"margin: 0 auto; width: 400px;\">\n\t\t\t\t\t\t<div style=\"float: left; width: 200px;\">\n\t\t\t\t\t\t\t<input type=\"button\" value=\"{$lang['upload1']}\" style=\"width: 150px;\" onclick=\"\$('#certificate1').trigger('click'); return false;\" />\n\t\t\t\t\t\t\t<input id=\"certificate1\" type=\"file\" name=\"certificate1\" style=\"display: none;\"/>\n\t\t\t\t\t\t\t<span class=\"help-block\">{$lang['certificate1_help']}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style=\"float: right; width: 200px;\">\n\t\t\t\t\t\t\t<input type=\"button\" value=\"{$lang['upload2']}\" style=\"width: 150px;\" onclick=\"\$('#certificate2').trigger('click'); return false;\" />\n\t\t\t\t\t\t\t<input id=\"certificate2\" type=\"file\" name=\"certificate2\" style=\"display: none;\"/>\n\t\t\t\t\t\t\t<span class=\"help-block\">{$lang['certificate2_help']}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</fieldset>\n\t\t\t";
}
$content .= "\n\t\t\t\t<fieldset>\t\n\t\t\t\t\t<input autofocus type=\"submit\" value=\"{$lang['update']}\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n\t<div id=\"changepass\" class=\"floatingdialog\">\n\t\t<br />\n\t\t<h3 class=\"center\">{$lang['changepassword_title']}</h3>\n\t\t<p style=\"text-align: center;\">{$lang['changepassword_text']}</p>\n\t\t<div class=\"form-small\">\t\t\n\t\t\t<form action=\"/panel/apps/update_action\" method=\"post\" class=\"center\">\n\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{$app['id']}\" />\n\t\t\t\t<fieldset>\n\t\t\t\t\t<input type=\"password\" name=\"newpassword\" />\n\t\t\t\t\t<span class=\"help-block\">{$lang['pass_help']}</span>\n\t\t\t\t</fieldset>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<input type=\"password\" name=\"confirm\" />\n\t\t\t\t\t<span class=\"help-block\">{$lang['confirm_help']}</span>\n\t\t\t\t</fieldset>\n\t\t\t\t<fieldset>\t\n\t\t\t\t\t<input autofocus type=\"submit\" value=\"{$lang['update']}\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n\t<div id=\"monitoring\" class=\"floatingdialog\">\n\t\t<br />\n\t\t<h3 class=\"center\">{$lang['monitoring_title']}</h3>\n\t\t<p style=\"text-align: center;\">{$lang['monitoring_text']}</p>\n\t\t<div class=\"form-small\">\t\t\n\t\t\t<form action=\"/panel/apps/monitoring_action\" method=\"post\" class=\"center\">\n\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{$app['id']}\" />\n\t\t\t\t<input type=\"hidden\" name=\"branch\" value=\"{$_SESSION['DATA'][$app['id']]['branch']}\" />\n\t\t\t\t<fieldset>\n\t\t\t\t\t<select style=\"width: 420px;\" name=\"monitor\" style=\"text-align: center;\">\n\t\t\t\t\t\t<option " . ($app['branches'][$_SESSION['DATA'][$app['id']]['branch']]['monitor'] != 1 ? "selected" : "") . " value=\"0\" style=\"text-align: center;\">{$lang['monitorinactive']}</option>\n\t\t\t\t\t\t<option " . ($app['branches'][$_SESSION['DATA'][$app['id']]['branch']]['monitor'] == 1 ? "selected" : "") . " value=\"1\" style=\"text-align: center;\">{$lang['monitoractive']}</option>\n\t\t\t\t\t</select>\n\t\t\t\t\t<span class=\"help-block\">{$lang['monitor_help']}</span>\n\t\t\t\t</fieldset>\t\t\t\t\t\n\t\t\t\t<fieldset>\n\t\t\t\t\t<select style=\"width: 420px;\" name=\"alert\" style=\"text-align: center;\">\n\t\t\t\t\t\t<option " . ($app['branches'][$_SESSION['DATA'][$app['id']]['branch']]['alert'] == 0 ? "selected" : "") . " value=\"0\" style=\"text-align: center;\">{$lang['alertinactive']}</option>\n\t\t\t\t\t\t<option " . ($app['branches'][$_SESSION['DATA'][$app['id']]['branch']]['alert'] == 1 ? "selected" : "") . " value=\"1\" style=\"text-align: center;\">{$lang['alertowner']}</option>\n\t\t\t\t\t\t<option " . ($app['branches'][$_SESSION['DATA'][$app['id']]['branch']]['alert'] == 2 ? "selected" : "") . " value=\"2\" style=\"text-align: center;\">{$lang['alertall']}</option>\n\t\t\t\t\t</select>\n\t\t\t\t\t<span class=\"help-block\">{$lang['alert_help']}</span>\n\t\t\t\t</fieldset>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<input style=\"width: 400px;\" type=\"text\" name=\"regex\" value=\"{$app['branches'][$_SESSION['DATA'][$app['id']]['branch']]['regex']}\" />\n\t\t\t\t\t<span class=\"help-block\">{$lang['regex_help']}</span>\n\t\t\t\t</fieldset>\t\n\t\t\t\t<fieldset>\t\n\t\t\t\t\t<input autofocus type=\"submit\" value=\"{$lang['update']}\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n\t<div id=\"push\" class=\"floatingdialog\">\n\t\t<br />\n\t\t<h3 class=\"center\" style=\"padding-top: 5px;\">{$lang['push_title']}</h3>\n\t\t<p style=\"text-align: center;\">{$lang['push_text']}</p>\n\t\t<br />\n\t\t<div style=\"float: left; width: 300px; padding-top: 5px;\">\n\t\t\t<h2 class=\"dark\">{$lang['keys']}</h2>\n\t\t</div>\n\t\t<div style=\"float: right; width: 200px;\">\n\t\t\t<a class=\"button classic\" href=\"#\" onclick=\"\$('#new-key').dialog('open');\" style=\"width: 22px; height: 22px; float: right;\">\n\t\t\t\t<img style=\"float: left;\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/plus-white.png\" />\n\t\t\t</a>\n\t\t</div>\n\t\t<div class=\"clear\"></div>\n\t\t<br />\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<th>{$lang['key']}</th>\n\t\t\t\t<th style=\"width: 70px; text-align: center;\">{$lang['actions']}</th>\n\t\t\t</tr>\n\t";
if (!is_array($app['keys']) && $app['keys']) {
    $app['keys'] = array($app['keys']);
}
if ($app['keys']) {
    $i = 0;
    foreach ($app['keys'] as $k) {
        $k = trim(str_replace("'", "\\'", $k));
        $content .= "\n\t\t\t<tr>\n\t\t\t\t<td style=\"white-space: nowrap; overflow: hidden; text-overflow: ellipsis; \">" . substr($k, 0, 60) . "...</td>\n\t\t\t\t<td style=\"width: 70px; text-align: center;\">\n\t\t\t\t\t<a href=\"#\"onclick=\"\$('#keyvalue').html('{$k}'); \$('#key').dialog('open');\"><img class=\"link\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/small/preview.png\" alt=\"\" /></a>\n\t\t\t\t\t<a href=\"/panel/apps/del_key_action?key={$i}&id={$app['id']}\" title=\"\"><img class=\"link\" src=\"/{$GLOBALS['CONFIG']['SITE']}/images/icons/small/close.png\" alt=\"\" /></a>\n\t\t\t\t</td>\n\t\t\t</tr>";
        $i++;
    }
}
$content .= "\t\t\n\t\t</table>\n\t\t<br /><br />\n\t\t<h2 class=\"dark\">{$lang['access']}</h2>\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<th>{$lang['type']}</th>\n\t\t\t\t<th>{$lang['infos']}</th>\n\t\t\t\t<th>{$lang['user']}</th>\n\t\t\t\t<th>{$lang['port']}</th>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td><span class=\"large\">SFTP / FTP</span></td>\n\t\t\t\t<td>(s)ftp://ftp.anotherservice.com</td>\n\t\t\t\t<td>{$app['name']}</td>\n\t\t\t\t<td>22 / 21</td>\n\t\t\t</tr>\t\n\t\t\t<tr>\n\t\t\t\t<td><span class=\"large\">Git</span></td>\n\t\t\t\t<td>ssh://git.as/~" . security::get('USER') . "/{$app['name']}.git</td>\n\t\t\t\t<td>{$app['name']}</td>\n\t\t\t\t<td>22</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td><span class=\"large\">{$lang['dir']}</span></td>\n\t\t\t\t<td colspan=\"3\">{$app['homeDirectory']}</td>\n\t\t\t</tr>\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td><span class=\"large\">{$lang['currentdir']}</span></td>\n\t\t\t\t<td colspan=\"3\">{$app['homeDirectory']}/{$_SESSION['DATA'][$app['id']]['branch']}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td><span class=\"large\">{$lang['git']}</span></td>\n\t\t\t\t<td colspan=\"3\">" . str_replace("Apps/{$app['name']}", "", $app['homeDirectory']) . "var/git/{$app['name']}</td>\n\t\t\t</tr>\t\t\t\n\t\t</table>\n\t\t<br />\n\t</div>\n\t<div id=\"delete\" class=\"floatingdialog\">\n\t\t<h3 class=\"center\" style=\"padding-top: 5px;\">{$lang['delete_title']}</h3>\n\t\t<p style=\"text-align: center;\">{$lang['delete_text']}</p>\n\t\t<a style=\"width: 150px; margin: 0 auto;\" href=\"/panel/apps/del_action?id={$app['id']}&name={$app['name']}\" class=\"button classic\">{$lang['delete_now']}</a>\n\t\t<br />\n\t</div>\n\t<div id=\"deletebranch\" class=\"floatingdialog\">\n\t\t<br />\n\t\t<h3 class=\"center\" style=\"padding-top: 5px;\">{$lang['deletebranch_title']}</h3>\n\t\t<p style=\"text-align: center;\">{$lang['deletebranch_text']}</p>\n\t\t<a style=\"width: 150px; margin: 0 auto;\" href=\"/panel/apps/del_env_action?id={$app['id']}&branch={$_SESSION['DATA'][$app['id']]['branch']}\" class=\"button classic\">{$lang['delete_now']}</a>\n\t\t<br />\n\t</div>\n\t<div id=\"alert\" class=\"floatingdialog\">\n\t\t<br />\n\t\t<h3 class=\"center\" style=\"padding-top: 5px;\">{$lang['alert']}</h3>\n\t\t<p style=\"text-align: center;\" id=\"alertcontent\"></p>\n\t\t<a style=\"width: 150px; margin: 0 auto;\" href=\"#\" onclick=\"\$('#alert').dialog('close'); return false;\" class=\"button classic\">{$lang['close']}</a>\n\t\t<br />\n\t</div>\n\t<div id=\"newservice\" class=\"floatingdialog\">\n\t\t<br />\n\t\t<h3 class=\"center\" style=\"padding-top: 5px;\">{$lang['newservice']}</h3>\n\t\t\n";
$services = api::send('self/service/list');
if (count($services) > 0) {
    $content .= "\n\t\t<p style=\"text-align: center;\">{$lang['newservice_text']}</p>\n\t\t<div class=\"form-small\">\t\t\n\t\t\t<form action=\"/panel/apps/link_action\" method=\"post\" class=\"center\">\n\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{$app['id']}\" />\n\t\t\t\t<input type=\"hidden\" name=\"branch\" value=\"{$_SESSION['DATA'][$app['id']]['branch']}\" />\n\t\t\t\t<fieldset>\n\t\t\t\t\t<select name=\"service\" style=\"width: 320px;\">\n\t";
    foreach ($services as $s) {
        $content .= "\t\t\t<option value=\"{$s['name']}\">{$s['description']} ({$s['name']})</option>\n\t\t";
    }
    $content .= "\n\t\t\t\t\t</select>\n\t\t\t\t\t<span class=\"help-block\">{$lang['service_help']}</span>\n\t\t\t\t</fieldset>\n\t\t\t\t<fieldset>\t\n\t\t\t\t\t<input autofocus type=\"submit\" value=\"{$lang['link']}\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t";
} else {
    $content .= "<p style=\"text-align: center;\">{$lang['noservice']}</p>\n\t";
}
$content .= "\n\t\t</div>\n\t</div>\n\t<div id=\"deleteservice\" class=\"floatingdialog\">\n\t\t<br />\n\t\t<h3 class=\"center\">{$lang['deleteservice']}</h3>\n\t\t<p style=\"text-align: center;\">{$lang['deleteservice_text']}</p>\n\t\t<div class=\"form-small\">\t\t\n\t\t\t<form action=\"/panel/apps/unlink_action\" method=\"get\" class=\"center\">\n\t\t\t\t<input id=\"service\" type=\"hidden\" value=\"\" name=\"service\" />\n\t\t\t\t<input type=\"hidden\" name=\"branch\" value=\"{$_SESSION['DATA'][$app['id']]['branch']}\" />\n\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{$app['id']}\" />\n\t\t\t\t<fieldset autofocus>\t\n\t\t\t\t\t<input type=\"submit\" value=\"{$lang['delete_now']}\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n\t<div id=\"backup\" class=\"floatingdialog\">\n\t\t<br />\n\t\t<h3 class=\"center\">{$lang['backup_title']}</h3>\n\t\t<p style=\"text-align: center;\">{$lang['backup_text']}</p>\n\t\t<div class=\"form-small\">\t\t\n\t\t\t<form action=\"/panel/apps/backup_action\" method=\"post\" class=\"center\">\n\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{$app['id']}\" />\n\t\t\t\t<input type=\"hidden\" name=\"branch\" value=\"{$_SESSION['DATA'][$app['id']]['branch']}\" />\n\t\t\t\t<fieldset>\n\t\t\t\t\t<select style=\"width: 420px;\" name=\"backup\" style=\"text-align: center;\">\n\t\t\t\t\t\t<option " . ($app['branches'][$_SESSION['DATA'][$app['id']]['branch']]['backup'] == 98 ? "selected" : "") . " value=\"98\" style=\"text-align: center;\">{$lang['backupnow']}</option>\n\t\t\t\t\t\t<option " . ($app['branches'][$_SESSION['DATA'][$app['id']]['branch']]['backup'] == 99 ? "selected" : "") . " value=\"99\" style=\"text-align: center;\">{$lang['backupnowfull']}</option>\n\t\t\t\t\t\t<option " . ($app['branches'][$_SESSION['DATA'][$app['id']]['branch']]['backup'] == 2 ? "selected" : "") . " value=\"2\" style=\"text-align: center;\">{$lang['backupdaily']}</option>\n\t\t\t\t\t\t<option " . ($app['branches'][$_SESSION['DATA'][$app['id']]['branch']]['backup'] == 1 ? "selected" : "") . " value=\"1\" style=\"text-align: center;\">{$lang['backuphebdo']}</option>\n\t\t\t\t\t\t<option " . ($app['branches'][$_SESSION['DATA'][$app['id']]['branch']]['backup'] == 0 ? "selected" : "") . " value=\"0\" style=\"text-align: center;\">{$lang['backupinactive']}</option>\n\t\t\t\t\t</select>\n\t\t\t\t\t<span class=\"help-block\">{$lang['backup_help']}</span>\n\t\t\t\t</fieldset>\t\n\t\t\t\t<fieldset>\t\n\t\t\t\t\t<input autofocus type=\"submit\" value=\"{$lang['backup_now']}\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n\t<div id=\"new-key\" style=\"display: none;\" class=\"floatingdialog\">\n\t\t<br />\n\t\t<h3 class=\"center\">{$lang['new_key']}</h3>\n\t\t<p style=\"text-align: center;\">{$lang['new_key_text']}</p>\n\t\t<div class=\"form-small\">\t\t\n\t\t\t<form action=\"/panel/apps/add_key_action\" method=\"post\" class=\"center\">\n\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{$app['id']}\" />\n\t\t\t\t<fieldset>\n\t\t\t\t\t<textarea class=\"auto\" style=\"width: 300px;\" rows=\"10\" name=\"key\" onfocus=\"this.value = this.value=='{$lang['key']}' ? '' : this.value; this.style.color='#4c4c4c';\" onfocusout=\"this.value = this.value == '' ? this.value = '{$lang['key']}' : this.value; this.value=='{$lang['key']}' ? this.style.color='#cccccc' : this.style.color='#4c4c4c'\">{$lang['key']}</textarea>\n\t\t\t\t\t<span class=\"help-block\">{$lang['key_help']}</span>\n\t\t\t\t</fieldset>\n\t\t\t\t<fieldset autofocus>\t\n\t\t\t\t\t<input type=\"submit\" value=\"{$lang['create']}\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n\t<div id=\"key\" style=\"display: none;\" class=\"floatingdialog\">\n\t\t<br />\n\t\t<p id=\"keyvalue\"></p>\n\t</div>\n\t<div id=\"sequence\" class=\"floatingdialog\"></div>\n\t<div id=\"recipe\" style=\"display: none;\"></div>\n\t<script>\n\t\tmemory = {$memoryone};\n\t\tinstances = {$instances};\n\t\t\n\t\t\$(\"#instances\").html(\"<img src='/{$GLOBALS['CONFIG']['SITE']}/images/anim_loading_16x16.gif' />\");\n\t\t\$('#instances').load('/panel/apps/ajax_instances?id={$app['id']}', function()\n\t\t{\n\t\t\tsetTimeout(function() { getinstances(); }, 2000);\n\t\t});\n\n\t\t\$(\"#graphs\").html(\"<img src='/{$GLOBALS['CONFIG']['SITE']}/images/anim_loading_16x16.gif' />\");\n\t\t\$('#graphs').load('/panel/apps/ajax_graphs?id={$app['id']}', function()\n\t\t{\n\t\t});\n\n\t\tnewFlexibleDialog('newurl', 550);\n\t\tnewFlexibleDialog('newbranch', 550);\n\t\tnewFlexibleDialog('settings', 550);\n\t\tnewFlexibleDialog('changepass', 550);\n\t\tnewFlexibleDialog('delete', 550);\n\t\tnewFlexibleDialog('deletebranch', 550);\n\t\tnewFlexibleDialog('push', 900);\n\t\tnewFlexibleDialog('alert', 550);\n\t\tnewFlexibleDialog('newservice', 550);\n\t\tnewFlexibleDialog('deleteservice', 550);\n\t\tnewFlexibleDialog('backup', 550);\n\t\tnewFlexibleDialog('monitoring', 550);\n\t\tnewFlexibleDialog('new-key', 550);\n\t\tnewFlexibleDialog('key', 550);\n\t\tnewDialog('sequence', 300, 320);\n\t\t\n\t\tfunction initSequence(id, message)\n\t\t{\n\t\t\tif( id == 1 )\n\t\t\t{\n\t\t\t\t\$('#sequence').html('');\n\t\t\t\t\$('#sequence').dialog('open');\n\t\t\t}\n\t\t\t\$('#sequence').append(\"<br /><div style='margin: 0;  padding: 0; clear: left;'><img id='wait\" + id + \"' src='/{$GLOBALS['CONFIG']['SITE']}/images/anim_loading_16x16.gif' style='float: left; margin-right: 15px; display: block;' /><span style='font-size: 12px;'>\" + message + \"</span></div>\");\n\t\t}\n\t\t\n\t\tfunction successSeq(id)\n\t\t{\n\t\t\t \$('#wait' + id).attr(\"src\", \"/{$GLOBALS['CONFIG']['SITE']}/images/icons/status_2.png\");\n\t\t}\n\n\t\tfunction failSeq(id)\n\t\t{\n\t\t\t \$('#wait' + id).attr(\"src\", \"/{$GLOBALS['CONFIG']['SITE']}/images/icons/status_4.png\");\n\t\t}\n\t\t\n\t\tfunction resetSeq()\n\t\t{\n\t\t\t\$('#sequence').html('');\n\t\t}\n\t\t\n\t\tfunction getinstances()\n\t\t{\n\t\t\t\$('#instances').load('/panel/apps/ajax_instances?id={$app['id']}', function()\n\t\t\t{\n\t\t\t\tsetTimeout(function() { getinstances(); }, 2000);\n\t\t\t});\n\t\t}\n\t\t\n\t\tfunction geturls()\n\t\t{\n\t\t\t\$(\"#urls\").html(\"<img src='/{$GLOBALS['CONFIG']['SITE']}/images/anim_loading_16x16.gif' />\");\n\t\t\t\$('#urls').load('/panel/apps/ajax_urls?id={$app['id']}', function()\t{});\n\t\t}\n\n\t\tfunction increaseInstances()\n\t\t{\n\t\t\tif( instances == 0 )\n\t\t\t\tmemory = 128;\n\t\t\t\t\n\t\t\tinstances = instances+1;\n\t\t\t\$('#instancescount').html(instances);\n\t\t\t\$('#memorycount').html(memory*instances);\n\t\t\t\n\t\t\tinitSequence(1, \"{$lang['init']}\");\n\t\t\tsuccessSeq(1);\n\t\t\tinitSequence(2, \"{$lang['seq_increase_instance']}\");\n\t\t\t\$('#recipe').load('/panel/apps/instance_increase_action?id={$app['id']}&branch=" . security::encode($_SESSION['DATA'][$app['id']]['branch']) . "&instances=' + instances, function()\n\t\t\t{\n\t\t\t\tsuccessSeq(2);\n\t\t\t\tinitSequence(3, \"{$lang['seq_end']}\");\n\t\t\t\tsuccessSeq(3);\n\t\t\t\tsetTimeout(function() { \$('#sequence').dialog('close'); resetSeq(); }, 2000);\n\t\t\t});\n\t\t}\n\t\t\n\t\tfunction decreaseInstances()\n\t\t{\n\t\t\tif( instances > 0 )\n\t\t\t{\n\t\t\t\tinstances = instances-1;\n\t\t\t\t\$('#instancescount').html(instances);\n\t\t\t\t\$('#memorycount').html(memory*instances);\n\t\t\t\t\n\t\t\t\tinitSequence(1, \"{$lang['init']}\");\n\t\t\t\tsuccessSeq(1);\n\t\t\t\tinitSequence(2, \"{$lang['seq_decrease_instance']}\");\n\t\t\t\t\$('#recipe').load('/panel/apps/instance_decrease_action?id={$app['id']}&branch=" . security::encode($_SESSION['DATA'][$app['id']]['branch']) . "&instances=' + instances, function()\n\t\t\t\t{\n\t\t\t\t\tsuccessSeq(2);\n\t\t\t\t\tinitSequence(3, \"{$lang['seq_end']}\");\n\t\t\t\t\tsuccessSeq(3);\n\t\t\t\t\tsetTimeout(function() { \$('#sequence').dialog('close'); resetSeq(); }, 2000);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\$('#alertcontent').html(\"{$lang['stupid']}\");\n\t\t\t\t\$('#alert').dialog('open');\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction decreaseMemory()\n\t\t{\n\t\t\tif( memory > 128 )\n\t\t\t{\n\t\t\t\tmemory = memory/2;\n\t\t\t\t\$('#memorycount').html(memory*instances);\n\t\t\t\t\n\t\t\t\tinitSequence(1, \"{$lang['init']}\");\n\t\t\t\tsuccessSeq(1);\n\t\t\t\tinitSequence(2, \"{$lang['seq_decrease_memory']}\");\n\t\t\t\t\$('#recipe').load('/panel/apps/memory_decrease_action?id={$app['id']}&branch=" . security::encode($_SESSION['DATA'][$app['id']]['branch']) . "&memory=' + memory, function()\n\t\t\t\t{\n\t\t\t\t\tsuccessSeq(2);\n\t\t\t\t\tinitSequence(3, \"{$lang['seq_end']}\");\n\t\t\t\t\tsuccessSeq(3);\n\t\t\t\t\tsetTimeout(function() { \$('#sequence').dialog('close'); resetSeq(); }, 2000);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\$('#alertcontent').html(\"{$lang['not_less']}\");\n\t\t\t\t\$('#alert').dialog('open');\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction increaseMemory()\n\t\t{\n\t\t\tif( memory < 1024 )\n\t\t\t{\n\t\t\t\tinitSequence(1, \"{$lang['init']}\");\n\t\t\t\tsuccessSeq(1);\n\t\t\t\tinitSequence(2, \"{$lang['seq_increase_memory']}\");\n\t\t\t\tinitSequence(3, \"{$lang['seq_restart']}\");\n\t\t\t\tmemory = memory*2;\n\t\t\t\t\$('#memorycount').html(memory*instances);\n\t\t\t\t\n\t\t\t\t\$('#recipe').load('/panel/apps/memory_increase_action?id={$app['id']}&branch=" . security::encode($_SESSION['DATA'][$app['id']]['branch']) . "&memory=' + memory, function()\n\t\t\t\t{\n\t\t\t\t\tsuccessSeq(2);\n\t\t\t\t\tsuccessSeq(3);\n\t\t\t\t\tinitSequence(4, \"{$lang['seq_end']}\");\n\t\t\t\t\tsuccessSeq(4);\n\t\t\t\t\trestart();\n\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\$('#alertcontent').html(\"{$lang['not_more']}\");\n\t\t\t\t\$('#alert').dialog('open');\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction start()\n\t\t{\n\t\t\tinitSequence(1, \"{$lang['init']}\");\n\t\t\tsuccessSeq(1);\n\t\t\tinitSequence(2, \"{$lang['seq_start']}\");\n\t\t\t\$('#recipe').load('/panel/apps/start_action?id={$app['id']}&branch=" . security::encode($_SESSION['DATA'][$app['id']]['branch']) . "', function()\n\t\t\t{\n\t\t\t\tsuccessSeq(2);\n\t\t\t\tinitSequence(3, \"{$lang['seq_end']}\");\n\t\t\t\tsuccessSeq(3);\n\t\t\t\tsetTimeout(function() { \$('#sequence').dialog('close'); resetSeq(); }, 2000);\n\t\t\t});\t\n\t\t}\n\t\t\n\t\tfunction stop()\n\t\t{\n\t\t\tinitSequence(1, \"{$lang['init']}\");\n\t\t\tsuccessSeq(1);\n\t\t\tinitSequence(2, \"{$lang['seq_stop']}\");\n\t\t\t\$('#recipe').load('/panel/apps/stop_action?id={$app['id']}&branch=" . security::encode($_SESSION['DATA'][$app['id']]['branch']) . "', function()\n\t\t\t{\n\t\t\t\tsuccessSeq(2);\n\t\t\t\tinitSequence(3, \"{$lang['seq_end']}\");\n\t\t\t\tsuccessSeq(3);\n\t\t\t\tsetTimeout(function() { \$('#sequence').dialog('close'); resetSeq(); }, 2000);\n\t\t\t});\t\n\t\t}\n\n\t\tfunction restart()\n\t\t{\n\t\t\tinitSequence(1, \"{$lang['init']}\");\n\t\t\tsuccessSeq(1);\n\t\t\tinitSequence(2, \"{$lang['seq_restart']}\");\n\t\t\t\$('#recipe').load('/panel/apps/restart_action?id={$app['id']}&branch=" . security::encode($_SESSION['DATA'][$app['id']]['branch']) . "', function()\n\t\t\t{\n\t\t\t\tsuccessSeq(2);\n\t\t\t\tinitSequence(3, \"{$lang['seq_end']}\");\n\t\t\t\tsuccessSeq(3);\n\t\t\t\tsetTimeout(function() { \$('#sequence').dialog('close'); resetSeq(); }, 2000);\n\t\t\t});\t\n\t\t}\n\n\t\tfunction rebuild()\n\t\t{\n\t\t\tinitSequence(1, \"{$lang['init']}\");\n\t\t\tsuccessSeq(1);\n\t\t\tinitSequence(2, \"{$lang['seq_rebuild']}\");\n\t\t\t\$('#recipe').load('/panel/apps/rebuild_action?id={$app['id']}&branch=" . security::encode($_SESSION['DATA'][$app['id']]['branch']) . "', function()\n\t\t\t{\n\t\t\t\tsuccessSeq(2);\n\t\t\t\tinitSequence(3, \"{$lang['seq_end']}\");\n\t\t\t\tsuccessSeq(3);\n\t\t\t\trestart();\n\t\t\t});\t\n\t\t}\n\n\t\t\$(function()\n\t\t{\n\t\t\t";
if (isset($_GET['key'])) {
    $content .= "\$('#push').dialog('open');";
}
$content .= "\n\t\t\tvar dataSourceDay = [";
<?php

if (!defined('PROPER_START')) {
    header("HTTP/1.0 403 Forbidden");
    exit;
}
if (preg_match("/^[0-9]{2,30}\$/", $_POST['id']) != 1) {
    raise(new SecurityException(iSeverity::CRITICAL, $lang['ABNORMAL_PARAMETER_VALUE']));
}
$url = '/domains/fake.com';
$data = array('uidNumber' => $_POST['id']);
$domain = $api->query($url, 'GET', $data);
$form = new form('add_subdomain');
$form->checkReferer();
$form->reset();
$form->importValues($_POST);
$form->setCheck('subdomain', $lang['check_subdomain'], formCheck::LOWERCASE . formCheck::NUMERIC . '_-', 2, 50, false);
$form->validate();
$url = '/' . $domain['associatedDomain'] . '/subdomains';
$data = array('subdomain' => $form->getValue('subdomain'), 'gidNumber' => security::get('user_id'));
$subdomain = $api->query($url, 'POST', $data);
// LOG ACTION IN HISTORY
$data = array('domain' => $domain['associatedDomain'], 'subdomain' => $form->getValue('subdomain'));
$logger = new logger();
$logger->log($data);
$form->cleanup();
$template->redirect('/panel/domains/config?id=' . $_POST['id']);