dialog loading, validation, more logic in forms, IP address banning

This commit is contained in:
2025-09-26 23:45:38 -06:00
parent be56b06d7a
commit 5082e2bbc2
10 changed files with 422 additions and 11 deletions
+27
View File
@@ -0,0 +1,27 @@
/*
* Amsterdam Web Communities System
* Copyright (c) 2025 Erbosoft Metaverse Design Solutions, All Rights Reserved
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
// The database package contains database management and storage logic.
package database
import "strings"
const AMS_ID_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~*'$"
// AmIsValidAmsterdamID returns true if the given string is a valid Amsterdam ID.
func AmIsValidAmsterdamID(test string) bool {
if len(test) < 1 {
return false
}
for _, r := range test {
if !strings.ContainsRune(AMS_ID_CHARS, r) {
return false
}
}
return true
}