Skip to content

Instantly share code, notes, and snippets.

@joebordes
Created March 9, 2017 08:52
Show Gist options
  • Select an option

  • Save joebordes/1ab753177051fbd6706eeac24fba798b to your computer and use it in GitHub Desktop.

Select an option

Save joebordes/1ab753177051fbd6706eeac24fba798b to your computer and use it in GitHub Desktop.
accessIPMessageOnLogin
diff --git a/Smarty/templates/Login.tpl b/Smarty/templates/Login.tpl
index c2af992..ad75657 100644
--- a/Smarty/templates/Login.tpl
+++ b/Smarty/templates/Login.tpl
@@ -34,4 +34,5 @@
{/if}
</form>
</div>
+ <div class="ipWarningNotice">{$MySpecialMessage}</div>
{include file="LoginFooter.tpl"}
diff --git a/modules/Users/Login.php b/modules/Users/Login.php
index 9966bc6..1411142 100644
--- a/modules/Users/Login.php
+++ b/modules/Users/Login.php
@@ -104,5 +104,9 @@ $smarty->assign('coreBOS_uiapp_name', GlobalVariable::getVariable('Application_U
$smarty->assign("LOGIN_ERROR", $login_error);
$currentYear = date('Y');
$smarty->assign('currentYear',$currentYear);
+
+$the_ip = Vtiger_Request::get_ip();
+$smarty->assign('MySpecialMessage','Restricted access to authorised personnel only<br> You are connecting from IP '.$the_ip);
+
$smarty->display('Login.tpl');
?>
\ No newline at end of file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment