diff --git a/lam/lib/account.inc b/lam/lib/account.inc index c216d6b7..497e199a 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -1751,6 +1751,16 @@ function getLAMVersionText() { return $text . ' - ' . LAMVersion(); } +/** + * Returns if the given release is a developer version. + * + * @param string version + * @return bool is developer version + */ +function isDeveloperVersion($version) { + return strpos($version, 'DEV') !== false; +} + /** * LAM exception with title and message. * diff --git a/lam/templates/config/index.php b/lam/templates/config/index.php index 48d4fef2..1aa9544f 100644 --- a/lam/templates/config/index.php +++ b/lam/templates/config/index.php @@ -2,7 +2,7 @@ /* This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) - Copyright (C) 2003 - 2019 Roland Gruber + Copyright (C) 2003 - 2020 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 diff --git a/lam/tests/lib/accountTest.php b/lam/tests/lib/accountTest.php index bca309c1..b33623bd 100644 --- a/lam/tests/lib/accountTest.php +++ b/lam/tests/lib/accountTest.php @@ -24,7 +24,7 @@ include_once __DIR__ . '/../../lib/account.inc'; include_once __DIR__ . '/../../lib/security.inc'; /** - * LAMConfig test case. + * account.inc test cases. * * @author Roland Gruber */ @@ -155,4 +155,13 @@ class AccountTest extends TestCase { $this->assertFalse(isCommandlineSafeEmailAddress('test+abc@example.com')); } + /** + * Tests isDeveloperVersion() + */ + function testIsDeveloperVersion() { + $this->assertFalse(isDeveloperVersion('0.4.1')); + $this->assertFalse(isDeveloperVersion('3.2.RC1')); + $this->assertTrue(isDeveloperVersion('4.5.DEV')); + } + }