added dev mode

This commit is contained in:
Roland Gruber 2020-04-10 20:34:36 +02:00
parent c9990fa189
commit b65125beaf
3 changed files with 21 additions and 2 deletions

View File

@ -1751,6 +1751,16 @@ function getLAMVersionText() {
return $text . ' - ' . LAMVersion(); 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. * LAM exception with title and message.
* *

View File

@ -2,7 +2,7 @@
/* /*
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) 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 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 it under the terms of the GNU General Public License as published by

View File

@ -24,7 +24,7 @@ include_once __DIR__ . '/../../lib/account.inc';
include_once __DIR__ . '/../../lib/security.inc'; include_once __DIR__ . '/../../lib/security.inc';
/** /**
* LAMConfig test case. * account.inc test cases.
* *
* @author Roland Gruber * @author Roland Gruber
*/ */
@ -155,4 +155,13 @@ class AccountTest extends TestCase {
$this->assertFalse(isCommandlineSafeEmailAddress('test+abc@example.com')); $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'));
}
} }