From b91328b225502a9fd9d871bae4529b6ea04b9b67 Mon Sep 17 00:00:00 2001
From: Sergio Cambra <sergio@programatica.es>
Date: Mon, 30 Jun 2014 05:09:21 -0400
Subject: [PATCH] display info message after domain owner change

---
 interface/web/client/templates/domain_list.htm |   12 ++++++++++++
 interface/lib/lang/en.lng                      |    1 +
 interface/web/client/domain_list.php           |    5 +++++
 interface/lib/lang/es.lng                      |    1 +
 interface/web/client/domain_edit.php           |    2 ++
 5 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/interface/lib/lang/en.lng b/interface/lib/lang/en.lng
index ec309d9..1d47aeb 100644
--- a/interface/lib/lang/en.lng
+++ b/interface/lib/lang/en.lng
@@ -149,5 +149,6 @@
 $wb['strength_5'] = 'Very Strong';
 $wb['weak_password_txt'] = 'The chosen password does not match the security guidelines. It has to be at least {chars} chars in length and have a strength of "{strength}".';
 $wb['weak_password_length_txt'] = 'The chosen password does not match the security guidelines. It has to be at least {chars} chars in length.';
+$wb['domain_owner_changed'] = 'You have changed the owner of domain {domain}, please change website and mail domain owner for this domain accordingly.';
 
 ?>
diff --git a/interface/lib/lang/es.lng b/interface/lib/lang/es.lng
index 63b6245..8945297 100644
--- a/interface/lib/lang/es.lng
+++ b/interface/lib/lang/es.lng
@@ -147,4 +147,5 @@
 $wb['strength_5'] = 'Very Strong';
 $wb['weak_password_txt'] = 'The chosen password does not match the security guidelines. It has to be at least {chars} chars in length and have a strength of \\"{strength}\\".';
 $wb['weak_password_length_txt'] = 'The chosen password does not match the security guidelines. It has to be at least {chars} chars in length.';
+$wb['domain_owner_changed'] = 'Has cambiado el propietario del dominio {domain}, por favor cambia tambiƩn el propietario del sitio web y dominio de correo de este dominio.';
 ?>
diff --git a/interface/web/client/domain_edit.php b/interface/web/client/domain_edit.php
index 735ec0b..a6eb22f 100644
--- a/interface/web/client/domain_edit.php
+++ b/interface/web/client/domain_edit.php
@@ -208,6 +208,8 @@
 		if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) {
 			$client_group_id = $app->functions->intval($this->dataRecord["client_group_id"]);
 			$app->db->query("UPDATE domain SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE domain_id = ".$this->id);
+			$lng_text = $app->lng("domain_owner_changed");
+			$_SESSION['show_info_msg'] = str_replace("{domain}", $this->dataRecord["domain"], $lng_text);
 		}
 	}
 
diff --git a/interface/web/client/domain_list.php b/interface/web/client/domain_list.php
index 622e52a..bd67c73 100644
--- a/interface/web/client/domain_list.php
+++ b/interface/web/client/domain_list.php
@@ -46,6 +46,11 @@
 
 $app->uses('listform_actions');
 
+if(isset($_SESSION['show_info_msg'])) {
+	$app->tpl->setloop('info', array(array('info_msg' => '<p>'.$_SESSION['show_info_msg'].'</p>')));
+	unset($_SESSION['show_info_msg']);
+}
+
 $app->listform_actions->SQLOrderBy = 'ORDER BY domain.domain';
 $app->listform_actions->onLoad();
 
diff --git a/interface/web/client/templates/domain_list.htm b/interface/web/client/templates/domain_list.htm
index 3100660..0795e48 100644
--- a/interface/web/client/templates/domain_list.htm
+++ b/interface/web/client/templates/domain_list.htm
@@ -4,6 +4,18 @@
 <div class="panel panel_list_domain">
 
     <div class="pnl_toolsarea">
+        <div>
+        <tmpl_if name='info'>
+            <div class="systemmonitor-state state-info">
+                <div class="status"></div>
+                <div class="statusMsg">
+                    <tmpl_loop name="info">
+                        {tmpl_var name='info_msg'}
+                    </tmpl_loop>
+                </div>
+            </div>
+        </tmpl_if>
+        </div>
         <fieldset><legend>{tmpl_var name="toolsarea_head_txt"}</legend>
             <div class="buttons">
                 <button class="button iconstxt icoAdd" type="button" onclick="loadContent('client/domain_edit.php');">

--
Gitblit v1.9.1