Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ispconfig/ispconfig3
  • RealOpty/ispconfig3
  • Horfic/ispconfig3
  • kingcody/ispconfig3
  • mbethke/ispconfig3
  • harkman/ispconfig3
  • stefanheinen/ispconfig3
  • JanKraljic/ispconfig3
  • pulsweb/ispconfig3
  • kayyy/ispconfig3
  • mwacht/ispconfig3
  • schuetzm/ispconfig3
  • gbg/ispconfig3
  • jproxx/ispconfig3
  • Nilpo/ispconfig3
  • Cambra/ispconfig3
  • crackerizer/ispconfig3
  • simonswine/ispconfig3
  • zbuzanic/ispconfig3
  • alexalouit/ispconfig3
  • guilhermefilippo/ispconfig3
  • kotishe/ispconfig3
  • Rescue9/ispconfig3
  • DmitriyLyalyuev/ispconfig3
  • simon.levesque/ispconfig3
  • Viktor/ispconfig3
  • Dr4c0/ispconfig3
  • stefanmcds-mnt/ispconfig3
  • Konflikted/ispconfig3
  • Schoene/ispconfig3
  • stefan.eertwegh/ispconfig3
  • Quest/ispconfig3
  • bst2002/ispconfig3
  • jphustman/ispconfig3
  • lepirlouit/ispconfig3
  • lolo888/ispconfig3
  • Quetzal/ispconfig3
  • kolorafa/ispconfig3
  • jdsn/ispconfig3
  • mk/ispconfig3
  • jnorell/ispconfig3
  • madalin/ispconfig3
  • edspiner/ispconfig3
  • blu3bird/ispconfig3
  • ITManager/ispconfig3
  • virtualweb/ispconfig3
  • dirkd/ispconfig3
  • jcdirks/ispconfig3
  • bvbmedia/ispconfig3
  • CSoellinger/ispconfig3
  • lutacon/ispconfig3
  • armsby/ispconfig3
  • psantos/ispconfig3
  • pkdevbox_y/ispconfig3
  • tlanger/ispconfig3
  • Krauser/ispconfig3
  • ochorocho/ispconfig3
  • aisfrond/ispconfig3
  • ldrrp/ispconfig3
  • steglicd/ispconfig3
  • darkalex/ispconfig3
  • b.dokimakis/ispconfig3
  • MarioSteinitz/ispconfig3
  • bweston/ispconfig3
  • bob/ispconfig3
  • HHGAG/ispconfig3
  • ark74/ispconfig3
  • fuerni/ispconfig3
  • hexblot/ispconfig3
  • maxxer/ispconfig3
  • JustDevZero/ispconfig3
  • habeggerl/ispconfig3
  • phpexpert/ispconfig3
  • Questler/ispconfig3
  • JanThiel/ispconfig3
  • joni_1993/ispconfig3
  • MePha/ispconfig3
  • flies/ispconfig3
  • macjohnny/ispconfig3
  • csegarra/ispconfig3
  • Tibius/ispconfig3
  • wairuru/ispconfig3
  • pdreissen/ispconfig3
  • mgiworx/ispconfig3
  • michielp/ispconfig3
  • ZarToK/ispconfig3
  • x-f/ispconfig3
  • tomlankhorst/ispconfig3
  • olivier.br/ispconfig3
  • hajti/ispconfig3
  • JaviSabalete/ispconfig3
  • dharman/ispconfig3
  • Martin-enavn/ispconfig3
  • Fr3k4Life/ispconfig3
  • Caldeira/ispconfig3
  • enavn/ispconfig3
  • cybernet2u/ispconfig3
  • Denny/ispconfig3
  • jbbr/ispconfig3
  • kakohari/ispconfig3
  • almere/ispconfig3
  • Kyokata/ispconfig3
  • burn/ispconfig3
  • feldsam/ispconfig3
  • woutervddn/ispconfig3
  • tm/ispconfig3
  • blount/ispconfig3
  • pravdomil/ispconfig3
  • manyk/ispconfig3
  • Poppabear/ispconfig3
  • t1st3/ispconfig3
  • scrat14/ispconfig3
  • ncomputers.org/ispconfig3
  • wlisik/ispconfig3
  • CupOfTea696/ispconfig3
  • ogmelch/ispconfig3
  • techwolf12/ispconfig3
  • timo.boldt/ispconfig3
  • DemoFreak/ispconfig3
  • EndelWar/ispconfig3
  • maanus/ispconfig3
  • ms217/ispconfig3
  • luisvivasb/ispconfig3
  • Ismir/ispconfig3
  • truongld/ispconfig3
  • nhutphan/ispconfig3
  • ram/ispconfig3
  • josemorenoasix/ispconfig3
  • onestepp/ispconfig3
  • gguglielmetti/ispconfig3
  • andre/ispconfig3
  • omig/ispconfig3
  • liane/ispconfig3
  • PVasileff/ispconfig3
  • mattanja/ispconfig3
  • dnl-jst/ispconfig3
  • jkalousek/ispconfig3
  • lgg42/ispconfig3
  • ispcomm/ispconfig3
  • moglgasy/ispconfig3
  • natanfelles/ispconfig3
  • cristiandeluxe/ispconfig3
  • pete/ispconfig3
  • Sosha/ispconfig3
  • shr3k/ispconfig3
  • niceit/ispconfig3
  • dani/ispconfig3
  • Ongaro/ispconfig3
  • Djidel/ispconfig3
  • andre.ballensiefen/ispconfig3
  • qroac/ispconfig3
  • magenbrot/ispconfig3
  • doekia/ispconfig3
  • edersonmora/ispconfig3
  • zucha.imz/ispconfig3
  • ckc/ispconfig3
  • Sroka/ispconfig3
  • batgau/ispconfig3
  • isp/ispconfig3
  • oboumati/ispconfig3
  • mscholz/ispconfig3
  • katiak/ispconfig3
  • jamiroph/ispconfig3
  • buhlerax/ispconfig3
  • johan/ispconfig3
  • KordianBruck/ispconfig3
  • trs997/ispconfig3
  • Funclineal/ispconfig3
  • xals/ispconfig3
  • sververda/ispconfig3
  • presure/ispconfig3
  • vojtech.myslivec/ispconfig3
  • helmo/ispconfig3
  • brody/ispconfig3
  • GameO7er/ispconfig3
  • webslice/ispconfig3
  • ufoonline/ispconfig3
  • alwin/ispconfig3
  • t.heller/ispconfig3
  • philipp/ispconfig3
  • andrzejs/ispconfig3
  • pixcept/ispconfig3
  • tgmedia/ispconfig3
  • Nardol/ispconfig3
  • m42e/ispconfig3
  • condless/ispconfig3
  • alesak/ispconfig3
  • MasonChase/ispconfig3
  • brt/ispconfig3
  • Rusek/ispconfig3
  • credz/ispconfig3
  • fiftyz/ispconfig3
  • dciancu/ispconfig3
  • thom/ispconfig3
  • florian030/ispconfig3
  • Mixasik/ispconfig3
  • SimonSparks/ispconfig3
  • eurodomenii/ispconfig3
  • vitex/ispconfig3
  • mitho/ispconfig3
  • CaptainStarbuck/ispconfig3
  • renky/ispconfig3
  • d--j/ispconfig3
  • inetspec/ispconfig3
  • Christian/ispconfig3
  • lukav/ispconfig3
  • galgenjunge/ispconfig3
  • gody/ispconfig3
  • kpendic/ispconfig3
  • diciannove/ispconfig3
  • tbasler/ispconfig3
  • logifech/ispconfig3
  • maximaweb/ispconfig3
  • tommaso-perondi/ispconfig3
  • francoisPE/ispconfig3
  • elgeorge2k/ispconfig3
  • francoisgrizzlydev/ispconfig3
  • Chris_UK/ispconfig3
  • mrutkowski/ispconfig3
  • mladen074/ispconfig3
  • trogper/ispconfig3
  • Lokutos/ispconfig3
  • manoaratefy/ispconfig3
  • GwynethLlewelyn/ispconfig3
  • tim427/ispconfig3
  • mapreri/ispconfig3
  • gsubiron/ispconfig3
  • eriam/ispconfig3
  • Steveorevo/ispconfig3
  • Jens/ispconfig3
  • ebela/ispconfig3
  • typoworx/ispconfig3
  • teuto.net/ispconfig3
  • sonority/ispconfig3
  • element/ispconfig3
  • Petar/ispconfig3
  • ewsp/ispconfig3
  • bicisteadm/ispconfig3
  • ivmm/ispconfig3
  • blinkenbox/ispconfig3
  • Samgarr/ispconfig3
  • B.Richard/ispconfig3
  • ahrasis/ispconfig3
  • nephi.aust/ispconfig3
  • beastycoding/ispconfig3
  • luttje/ispconfig3
  • hairy/ispconfig3
  • styxtdo/ispconfig3
  • SGr33n/ispconfig3
  • mepstein/ispconfig3
  • kobuki/ispconfig3
  • dachris/ispconfig3
  • mina/ispconfig3
253 results
Show changes
Commits on Source (11)
Showing
with 183 additions and 37 deletions
......@@ -55,7 +55,7 @@ $revision = str_replace(array('Revision:','$',' '), '', $svn_revision);
//** Application
define('ISPC_APP_TITLE', 'ISPConfig');
define('ISPC_APP_VERSION', '3.2dev');
define('ISPC_APP_VERSION', '3.2.9stable-helmo1');
define('DEVSYSTEM', false);
......
......@@ -1610,17 +1610,27 @@ class tform_base {
return true;
}
function getAuthSQL($perm, $table = '') {
if($_SESSION["s"]["user"]["typ"] == 'admin' || $_SESSION['s']['user']['mailuser_id'] > 0) {
function getAuthSQL($perm, $table = '', $userid = NULL, $groups = NULL) {
if(($_SESSION["s"]["user"]["typ"] == 'admin' || $_SESSION['s']['user']['mailuser_id'] > 0 ) && $userid == NULL && $groups == NULL) {
return '1';
} else {
if ($table != ''){
$table = ' ' . $table . '.';
}
$groups = ( $_SESSION["s"]["user"]["groups"] ) ? $_SESSION["s"]["user"]["groups"] : 0;
$sql = '(';
$sql .= "(" . $table . "sys_userid = ".$_SESSION["s"]["user"]["userid"]." AND " . $table . "sys_perm_user like '%$perm%') OR ";
$sql .= "(" . $table . "sys_groupid IN (".$groups.") AND " . $table ."sys_perm_group like '%$perm%') OR ";
if ($userid === NULL) {
$userid = $_SESSION["s"]["user"]["userid"];
}
if ($userid > 0) {
$sql .= "(" . $table . "sys_userid = ".$userid." AND " . $table . "sys_perm_user like '%$perm%') OR ";
}
if ($groups === NULL) {
$groups = ( $_SESSION["s"]["user"]["groups"] ) ? $_SESSION["s"]["user"]["groups"] : 0;
}
if ($groups > 0) {
$sql .= "(" . $table . "sys_groupid IN (".$groups.") AND " . $table ."sys_perm_group like '%$perm%') OR ";
}
$sql .= $table . "sys_perm_other like '%$perm%'";
$sql .= ')';
......
......@@ -576,6 +576,25 @@ class tools_monitor {
return $html;
}
function showMx_ip_match() {
global $app;
/* fetch the Data from the DB */
$record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'mx_ip_match' and server_id = ? ORDER BY created DESC", $_SESSION['monitor']['server_id']);
if(isset($record['data'])) {
$data = unserialize($record['data']);
$html = '';
foreach ($data as $domain => $text) {
$html .= "$domain: $text<br />";
}
} else {
$html = '<p>'.$app->lng("no_data_mx_ip_match_txt").'</p>';
}
return $html;
}
function getDataTime($type) {
global $app;
......
......@@ -661,6 +661,12 @@ $form["tabs"]['misc'] = array (
'default' => 'y',
'value' => array(0 => 'n', 1 => 'y')
),
'show_delete_on_forms' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'n',
'value' => array(0 => 'n', 1 => 'y')
),
'maintenance_mode' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
......
......@@ -108,4 +108,5 @@ $wb['show_aps_menu_note_txt'] = 'APS will be removed from the panel in the near
$wb['show_aps_menu_note_url_txt'] = 'Click here for more information.';
$wb['dns_show_zoneexport_txt'] = 'Show zone export.';
$wb['le_caa_autocreate_options_txt'] = 'Enable automatic creation of CAA record on issuing LE';
$wb['show_delete_on_forms_txt'] = 'Show delete button on edit forms';
?>
......@@ -107,4 +107,5 @@ $wb['show_aps_menu_note_txt'] = 'APS will be removed from the panel in the near
$wb['show_aps_menu_note_url_txt'] = 'Click here for more information.';
$wb['dns_show_zoneexport_txt'] = 'Show zone export.';
$wb['le_caa_autocreate_options_txt'] = 'Enable automatic creation of CAA record on issuing LE';
$wb['show_delete_on_forms_txt'] = 'Show delete button on edit forms';
?>
......@@ -90,6 +90,12 @@
{tmpl_var name='show_support_messages'}
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">{tmpl_var name='show_delete_on_forms_txt'}</label>
<div class="col-sm-9">
{tmpl_var name='show_delete_on_forms'}
</div>
</div>
<div class="form-group">
<label for="customer_no_template" class="col-sm-3 control-label">{tmpl_var name='customer_no_template_txt'}</label>
<div class="col-sm-9"><input type="text" name="customer_no_template" id="customer_no_template" value="{tmpl_var name='customer_no_template'}" class="form-control" /></div>
......
......@@ -73,6 +73,35 @@ class page_action extends tform_actions {
parent::onShowNew();
}
function onShowEdit() {
global $app, $conf;
chdir('../dashboard');
$dashlet_list = array();
$dashlets = array('databasequota.php', 'limits.php', 'mailquota.php', 'quota.php');
$current_client_id = $this->id;
foreach ($dashlets as $file) {
if ($file != '.' && $file != '..' && !is_dir(ISPC_WEB_PATH.'/dashboard/dashlets/'.$file)) {
$dashlet_name = substr($file, 0, -4);
$dashlet_class = 'dashlet_'.$dashlet_name;
include_once ISPC_WEB_PATH.'/dashboard/dashlets/'.$file;
$dashlet_list[$dashlet_name] = new $dashlet_class;
$dashlets_html .= $dashlet_list[$dashlet_name]->show($current_client_id);
}
}
$app->tpl->setVar('dashlets', $dashlets_html);
chdir('../client');
$tmp = $app->db->queryOneRecord("SELECT company_name, contact_firstname, contact_name, email FROM client WHERE client_id = ?", $current_client_id);
$app->tpl->setVar('company_name', $tmp['company_name']);
$app->tpl->setVar('contact_name', $tmp['contact_name']);
$app->tpl->setVar('email', $tmp['email']);
parent::onShowEdit();
}
function onSubmit() {
global $app, $conf;
......
......@@ -45,7 +45,7 @@ $form["action"] = "client_edit.php";
$form["db_table"] = "client";
$form["db_table_idx"] = "client_id";
$form["db_history"] = "yes";
$form["tab_default"] = "address";
$form["tab_default"] = "info";
$form["list_default"] = "client_list.php";
$form["auth"] = 'yes';
......@@ -80,6 +80,12 @@ while ($file = @readdir($handle)) {
}
}
$form["tabs"]['info'] = array (
'title' => "Info",
'width' => 100,
'template' => "templates/client_edit_info.htm",
'fields' => array ()
);
$form["tabs"]['address'] = array (
'title' => "Address",
'width' => 100,
......
......@@ -154,3 +154,9 @@
<button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="client/client_edit.php">{tmpl_var name='btn_save_txt'}</button>
<button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="{tmpl_var name='session_module'}/client_list.php">{tmpl_var name='btn_cancel_txt'}</button>
</div></div>
<tmpl_if name="is_admin">
<a class="btn btn-default formbutton-success formbutton-narrow" data-load-content="login/login_as.php?cid={tmpl_var name='id'}"><span class="icon icon-loginas"></span></a>
<tmpl_elseif name="is_reseller">
<a class="btn btn-default formbutton-success formbutton-narrow" data-load-content="login/login_as.php?cid={tmpl_var name='id'}"><span class="icon icon-loginas"></span></a>
</tmpl_if>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<div class='page-header'>
<legend>Client info</legend>
<div>
<ul>
<li>Company Name: {tmpl_var name='company_name'}</li>
<li>Contact Name: {tmpl_var name='contact_name'}</li>
<li>E-mail: <a href="mailto:{tmpl_var name='email'}">{tmpl_var name='email'}</a></li>
<li>Login as:
<tmpl_if name="is_admin">
<a class="btn btn-default formbutton-success formbutton-narrow" data-load-content="login/login_as.php?cid={tmpl_var name='id'}"><span class="icon icon-loginas"></span></a>
<tmpl_elseif name="is_reseller">
<a class="btn btn-default formbutton-success formbutton-narrow" data-load-content="login/login_as.php?cid={tmpl_var name='id'}"><span class="icon icon-loginas"></span></a>
</tmpl_if>
</li>
</ul>
</div>
<tmpl_var name="dashlets">
</div>
......@@ -2,7 +2,7 @@
class dashlet_databasequota {
function show() {
function show($limit_to_client_id = 0) {
global $app;
//* Loading Template
......@@ -23,8 +23,13 @@ class dashlet_databasequota {
$lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_dashlet_databasequota.lng';
if(is_file($lng_file)) include $lng_file;
$tpl->setVar($wb);
if ($limit_to_client_id == 0 || $_SESSION["s"]["user"]["typ"] != 'admin') {
$client_id = $_SESSION['s']['user']['client_id'];
} else {
$client_id = $limit_to_client_id;
}
$databases = $app->quota_lib->get_databasequota_data( ($_SESSION["s"]["user"]["typ"] != 'admin') ? $_SESSION['s']['user']['client_id'] : null);
$databases = $app->quota_lib->get_databasequota_data($client_id);
//print_r($databases);
$has_databasequota = false;
......
......@@ -2,7 +2,7 @@
class dashlet_limits
{
public function show()
public function show($limit_to_client_id = 0)
{
global $app, $conf;
......@@ -147,33 +147,27 @@ class dashlet_limits
}
$tpl->setVar($wb);
if ($app->auth->is_admin()) {
$user_is_admin = true;
if ($limit_to_client_id == 0) {
$client_id = $_SESSION['s']['user']['client_id'];
} else {
$user_is_admin = false;
$client_id = $limit_to_client_id;
}
$tpl->setVar('is_admin', $user_is_admin);
if ($user_is_admin == false) {
$client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
$client = $app->db->queryOneRecord("SELECT * FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
}
$client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
$client = $app->db->queryOneRecord("SELECT * FROM client WHERE client_id = ?", $client_id);
$rows = array();
foreach ($limits as $limit) {
$field = $limit['field'];
if ($user_is_admin) {
$value = $wb['unlimited_txt'];
} else {
$value = $client[$field];
}
$value = $client[$field];
if ($value != 0 || $value == $wb['unlimited_txt']) {
$value_formatted = ($value == '-1')?$wb['unlimited_txt']:$value;
if (isset($limit['q_type']) && $limit['q_type'] != '') {
$usage = $this->_get_assigned_quota($limit) . " MB";
$usage = $this->_get_assigned_quota($limit, $client_id) . " MB";
$value_formatted = ($value == '-1')?$wb['unlimited_txt']:$value . " MB";
} else {
$usage = $this->_get_limit_usage($limit);
$usage = $this->_get_limit_usage($limit, $client_id);
}
$percentage = ($value == '-1' || intval($value) == 0 || trim($value) == '' ? -1 : round(100 * (int)$usage / (int)$value));
$progressbar = $percentage > 100 ? 100 : $percentage;
......@@ -195,7 +189,7 @@ class dashlet_limits
return $tpl->grab();
}
public function _get_limit_usage($limit)
public function _get_limit_usage($limit, $limit_to_client_id)
{
global $app;
......@@ -203,12 +197,15 @@ class dashlet_limits
if ($limit['db_where'] != '') {
$sql .= $limit['db_where']." AND ";
}
$sql .= $app->tform->getAuthSQL('r');
$sql .= $app->tform->getAuthSQL('r', '', $limit_to_client_id);
// TEST to show reseller data.
//$sql .= $app->tform->getAuthSQL('r', '', 0, '3,28,39');
//echo $sql;
$rec = $app->db->queryOneRecord($sql, $limit['db_table']);
return $rec['number'];
}
public function _get_assigned_quota($limit)
public function _get_assigned_quota($limit, $limit_to_client_id)
{
global $app;
......@@ -216,7 +213,7 @@ class dashlet_limits
if ($limit['db_where'] != '') {
$sql .= $limit['db_where']." AND ";
}
$sql .= $app->tform->getAuthSQL('r');
$sql .= $app->tform->getAuthSQL('r', '', $limit_to_client_id);
$rec = $app->db->queryOneRecord($sql, $limit['q_type'], $limit['db_table']);
if ($limit['db_table']=='mail_user') {
$quotaMB = $rec['number'] / 1048576;
......
......@@ -2,7 +2,7 @@
class dashlet_mailquota {
function show() {
function show($limit_to_client_id = 0) {
global $app;
//* Loading Template
......@@ -16,7 +16,13 @@ class dashlet_mailquota {
if(is_file($lng_file)) include $lng_file;
$tpl->setVar($wb);
$emails = $app->quota_lib->get_mailquota_data( ($_SESSION["s"]["user"]["typ"] != 'admin') ? $_SESSION['s']['user']['client_id'] : null);
if ($limit_to_client_id == 0 || $_SESSION["s"]["user"]["typ"] != 'admin') {
$client_id = $_SESSION['s']['user']['client_id'];
} else {
$client_id = $limit_to_client_id;
}
$emails = $app->quota_lib->get_mailquota_data($client_id);
//print_r($emails);
$has_mailquota = false;
......
......@@ -2,7 +2,7 @@
class dashlet_quota {
function show() {
function show($limit_to_client_id = 0) {
global $app;
//* Loading Template
......@@ -24,7 +24,13 @@ class dashlet_quota {
if(is_file($lng_file)) include $lng_file;
$tpl->setVar($wb);
$sites = $app->quota_lib->get_quota_data( ($_SESSION["s"]["user"]["typ"] != 'admin') ? $_SESSION['s']['user']['client_id'] : null);
if ($limit_to_client_id == 0 || $_SESSION["s"]["user"]["typ"] != 'admin') {
$client_id = $_SESSION['s']['user']['client_id'];
} else {
$client_id = $limit_to_client_id;
}
$sites = $app->quota_lib->get_quota_data($client_id);
//print_r($sites);
$has_quota = false;
......
......@@ -11,7 +11,7 @@
<tbody>
<tmpl_loop name='databasequota'>
<tr>
<td>{tmpl_var name='database_name'}</td>
<td><a href="#" data-load-content="sites/database_edit.php?id={tmpl_var name='database_id'}" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="{tmpl_var name='database_name'}">{tmpl_var name='database_name'}</a></td>
<td>{tmpl_var name='used'}</td>
<td>{tmpl_var name='database_quota'}</td>
{tmpl_if name="quota_raw" op="!=" value="0"}<td>
......
......@@ -12,7 +12,7 @@
<tbody>
<tmpl_loop name='quota'>
<tr>
<td>{tmpl_var name='domain'}</td>
<td><a href="#" data-load-content="sites/web_vhost_domain_edit.php?id={tmpl_var name='domain_id'}" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="{tmpl_var name='domain'}">{tmpl_var name='domain'}</a></td>
<td>{tmpl_var name='used'}</td>
<td>{tmpl_var name='soft'}</td>
<td>{tmpl_var name='hard'}</td>
......
......@@ -58,11 +58,11 @@
<thead class="dark form-group-sm">
<tr>
<th class="tiny-col" data-column="active"><tmpl_var name="active_txt"></th>
<th data-column="type"><tmpl_var name="type_txt"></th>
<th data-column="type" style="width: 12%;"><tmpl_var name="type_txt"></th>
<th data-column="name"><tmpl_var name="name_txt"></th>
<th data-column="data"><tmpl_var name="data_txt"></th>
<th data-column="aux"><tmpl_var name="aux_txt"></th>
<th data-column="ttl"><tmpl_var name="ttl_txt"></th>
<th data-column="aux" style="width: 8%;"><tmpl_var name="aux_txt"></th>
<th data-column="ttl" style="width: 8%;"><tmpl_var name="ttl_txt"></th>
<th class="small-col text-right">{tmpl_var name='search_limit'}</th>
</tr>
<tr>
......
......@@ -129,6 +129,24 @@ if($_SESSION['otp']['type'] == 'email') {
// Send code via email.
if (!isset($_SESSION['otp']['sent']) || $_GET['action'] == 'resend') {
// Handle otp_email_override.
$sys_user = $app->db->queryOneRecord('SELECT otp_data FROM sys_user WHERE userid = ?', $_SESSION['s_pending']['user']['userid']);
$data = json_decode($sys_user['otp_data'], TRUE);
if (!empty($data['otp_email_override'] )) {
$email_to = $data['otp_email_override'];
}
else {
$clientuser = $app->db->queryOneRecord('SELECT email FROM sys_user u LEFT JOIN client c ON (u.client_id=c.client_id) WHERE u.userid = ?', $_SESSION['s_pending']['user']['userid']);
if (!empty($clientuser['email'])) {
$email_to = $clientuser['email'];
}
else {
// Admin users are not related to a client, thus use the globally configured email address.
$email_to = $mail_config['admin_mail'];
}
}
$mail_otp_code_retry_timeout = 30;
if (isset($_SESSION['otp']['starttime']) && $_SESSION['otp']['starttime'] > time() - $mail_otp_code_retry_timeout) {
$token_sent_message = sprintf($wb['otp_code_email_sent_wait_txt'], $mail_otp_code_retry_timeout);
......
......@@ -88,6 +88,13 @@ class page_action extends tform_actions {
}
$app->tpl->setVar("email_domain", $domain_select);
$csrf_token = $app->auth->csrf_token_get('mail_alias_del');
$app->tpl->setVar('_csrf_id', $csrf_token['csrf_id']);
$app->tpl->setVar('_csrf_key', $csrf_token['csrf_key']);
$global_config = $app->getconf->get_global_config();
$app->tpl->setVar('show_delete_on_forms', $global_config['misc']['show_delete_on_forms']);
parent::onShowEnd();
}
......