// Copyright 2022 The Gogs Authors. All rights reserved.// Use of this source code is governed by a MIT-style// license that can be found in the LICENSE file.packageuserutilimport("encoding/hex""fmt""strings""gogs.io/gogs/internal/conf""gogs.io/gogs/internal/tool")// DashboardURLPath returns the URL path to the user or organization dashboard.funcDashboardURLPath(namestring,isOrganizationbool)string{ifisOrganization{returnconf.Server.Subpath+"/org/"+name+"/dashboard/"}returnconf.Server.Subpath+"/"}// GenerateActivateCode generates an activate code based on user information and// the given email.funcGenerateActivateCode(idint64,email,name,password,randsstring)string{code:=tool.CreateTimeLimitCode(fmt.Sprintf("%d%s%s%s%s",id,email,strings.ToLower(name),password,rands),conf.Auth.ActivateCodeLives,nil,)// Add tailing hex usernamecode+=hex.EncodeToString([]byte(strings.ToLower(name)))returncode}