diff --git a/lam/help/help.inc b/lam/help/help.inc
index af132335..eac5dbb7 100644
--- a/lam/help/help.inc
+++ b/lam/help/help.inc
@@ -217,6 +217,8 @@ $helpArray = array (
 					"Text" => _('Path to SSH key file to connect to lamdaemon server. If empty then password authentication with the person\'s password who is logged into LAM will be used.')),
 				'286' => array ("Headline" => _('SSH key password'),
 					"Text" => _('Password to unlock SSH key file.')),
+				'287' => array ("Headline" => _('License'),
+					"Text" => _('Please enter your license key.')),
 				// 300 - 399
 				// profile editor, file upload
 				"301" => array ("Headline" => _("RDN identifier"),
diff --git a/lam/lib/config.inc b/lam/lib/config.inc
index c29705f6..43e73b60 100644
--- a/lam/lib/config.inc
+++ b/lam/lib/config.inc
@@ -2113,13 +2113,18 @@ class LAMCfgMain {
 	/** error reporting */
 	public $errorReporting = self::ERROR_REPORTING_DEFAULT;
 
+	/** license data */
+	private $license = '';
+
 	/** list of data fields to save in config file */
 	private $settings = array("password", "default", "sessionTimeout",
 		"logLevel", "logDestination", "allowedHosts", "passwordMinLength",
 		"passwordMinUpper", "passwordMinLower", "passwordMinNumeric",
 		"passwordMinClasses", "passwordMinSymbol", 'checkedRulesCount',
 		'passwordMustNotContainUser', 'passwordMustNotContain3Chars',
-		"mailEOL", 'errorReporting', 'encryptSession', 'allowedHostsSelfService');
+		"mailEOL", 'errorReporting', 'encryptSession', 'allowedHostsSelfService',
+		'license'
+	);
 
 	/**
 	* Loads preferences from config file
@@ -2213,6 +2218,7 @@ class LAMCfgMain {
 		if (!in_array("passwordMustNotContainUser", $saved)) array_push($file_array, "\n\n# Password: must not contain user name\n" . "passwordMustNotContainUser: " . $this->passwordMustNotContainUser);
 		if (!in_array("mailEOL", $saved)) array_push($file_array, "\n\n# Email format (default/unix)\n" . "mailEOL: " . $this->mailEOL);
 		if (!in_array("errorReporting", $saved)) array_push($file_array, "\n\n# PHP error reporting (default/system)\n" . "errorReporting: " . $this->errorReporting);
+		if (!in_array("license", $saved)) array_push($file_array, "\n\n# License\n" . "license: " . $this->license);
 		$file = @fopen($this->conffile, "w");
 		if ($file) {
 			for ($i = 0; $i < sizeof($file_array); $i++) fputs($file, $file_array[$i]);
@@ -2492,6 +2498,24 @@ class LAMCfgMain {
 		return $list;
 	}
 
+	/**
+	 * Returns the license key as multiple lines.
+	 *
+	 * @return String license
+	 */
+	public function getLicenseLines() {
+		return explode(LAMConfig::LINE_SEPARATOR, $this->license);
+	}
+
+	/**
+	 * Sets the license key as multiple lines.
+	 *
+	 * @param String $license license
+	 */
+	public function setLicenseLines($licenseLines) {
+		$this->license = implode(LAMConfig::LINE_SEPARATOR, $licenseLines);
+	}
+
 }
 
 ?>
diff --git a/lam/style/500_layout.css b/lam/style/500_layout.css
index df41e806..25dd1fe3 100644
--- a/lam/style/500_layout.css
+++ b/lam/style/500_layout.css
@@ -519,6 +519,11 @@ div.confModList {
 	overflow-y: auto;
 }
 
+div.licenseInfo {
+	display: inline-block;
+	padding: 20px;
+	min-width: 200px;
+}
 
 /* schema browser */
 
diff --git a/lam/templates/config/mainlogin.php b/lam/templates/config/mainlogin.php
index 5c034d70..434d74a9 100644
--- a/lam/templates/config/mainlogin.php
+++ b/lam/templates/config/mainlogin.php
@@ -3,7 +3,7 @@
 $Id$
 
   This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
-  Copyright (C) 2003 - 2015  Roland Gruber
+  Copyright (C) 2003 - 2016  Roland Gruber
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -34,6 +34,9 @@ $Id$
 include_once('../../lib/config.inc');
 /** Used to print status messages */
 include_once('../../lib/status.inc');
+if (isLAMProVersion()) {
+	include_once("../../lib/env.inc");
+}
 
 // start session
 if (strtolower(session_module_name()) == 'files') {
@@ -63,7 +66,6 @@ if (isset($_POST['passwd'])) {
 	}
 }
 
-
 echo $_SESSION['header'];
 
 ?>
@@ -132,6 +134,9 @@ echo $_SESSION['header'];
 			if (!$cfgMain->isWritable()) {
 				StatusMessage('WARN', 'The config file is not writable.', 'Your changes cannot be saved until you make the file writable for the webserver user.');
 			}
+			if (!empty($_GET['invalidLicense'])) {
+				StatusMessage('WARN', _('Invalid license'), _('Please setup your license data.'));
+			}
 		?>
 		
 		
@@ -181,8 +186,14 @@ echo $_SESSION['header'];
 		
 		
 
-