mirror of https://gitlab.com/bashrc2/epicyon
Add administered by link to terms
parent
eaf711672a
commit
71d65ad07a
|
@ -634,7 +634,9 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
|
||||
if self.path.startswith('/terms'):
|
||||
self._login_headers('text/html')
|
||||
self.wfile.write(htmlTermsOfService(self.server.baseDir).encode())
|
||||
self.wfile.write(htmlTermsOfService(self.server.baseDir, \
|
||||
self.server.httpPrefix, \
|
||||
self.server.domainFull).encode())
|
||||
self.server.GETbusy=False
|
||||
return
|
||||
|
||||
|
|
|
@ -280,6 +280,10 @@ body, html {
|
|||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.container p.administeredby {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.container::after {
|
||||
content: "";
|
||||
clear: both;
|
||||
|
|
13
epicyon.py
13
epicyon.py
|
@ -1195,6 +1195,16 @@ if args.testdata:
|
|||
|
||||
if os.path.isdir(baseDir+'/tags'):
|
||||
shutil.rmtree(baseDir+'/tags')
|
||||
if os.path.isdir(baseDir+'/accounts'):
|
||||
shutil.rmtree(baseDir+'/accounts')
|
||||
if os.path.isdir(baseDir+'/keys'):
|
||||
shutil.rmtree(baseDir+'/keys')
|
||||
if os.path.isdir(baseDir+'/media'):
|
||||
shutil.rmtree(baseDir+'/media')
|
||||
if os.path.isdir(baseDir+'/sharefiles'):
|
||||
shutil.rmtree(baseDir+'/sharefiles')
|
||||
if os.path.isdir(baseDir+'/wfendpoints'):
|
||||
shutil.rmtree(baseDir+'/wfendpoints')
|
||||
|
||||
setConfigParam(baseDir,'registrationsRemaining',str(maxRegistrations))
|
||||
|
||||
|
@ -1206,7 +1216,7 @@ if args.testdata:
|
|||
createPerson(baseDir,nickname,domain,port,httpPrefix,True,'likewhateveryouwantscoob')
|
||||
setSkillLevel(baseDir,nickname,domain,'testing',60)
|
||||
setSkillLevel(baseDir,nickname,domain,'typing',50)
|
||||
setRole(baseDir,nickname,domain,'epicyon','tester')
|
||||
setRole(baseDir,nickname,domain,'instance','admin')
|
||||
setRole(baseDir,nickname,domain,'epicyon','hacker')
|
||||
setRole(baseDir,nickname,domain,'someproject','assistant')
|
||||
setAvailability(baseDir,nickname,domain,'busy')
|
||||
|
@ -1251,6 +1261,7 @@ if args.testdata:
|
|||
followPerson(baseDir,nickname,domain,'drokk',domainFull,federationList,False)
|
||||
followerOfPerson(baseDir,nickname,domain,'drokk',domainFull,federationList,False)
|
||||
followerOfPerson(baseDir,nickname,domain,'maxboardroom',domainFull,federationList,False)
|
||||
setConfigParam(baseDir,'admin',nickname)
|
||||
|
||||
runDaemon(instanceId,args.client,baseDir, \
|
||||
domain,port,httpPrefix, \
|
||||
|
|
|
@ -288,7 +288,8 @@ def htmlLogin(baseDir: str) -> str:
|
|||
loginForm+=htmlFooter()
|
||||
return loginForm
|
||||
|
||||
def htmlTermsOfService(baseDir: str) -> str:
|
||||
def htmlTermsOfService(baseDir: str,httpPrefix: str,domainFull: str) -> str:
|
||||
adminNickname = getConfigParam(baseDir,'admin')
|
||||
if not os.path.isfile(baseDir+'/accounts/tos.txt'):
|
||||
copyfile(baseDir+'/default_tos.txt',baseDir+'/accounts/tos.txt')
|
||||
if os.path.isfile(baseDir+'/img/login-background.png'):
|
||||
|
@ -306,6 +307,9 @@ def htmlTermsOfService(baseDir: str) -> str:
|
|||
|
||||
TOSForm=htmlHeader(termsCSS)
|
||||
TOSForm+='<div class="container">'+TOSText+'</div>'
|
||||
if adminNickname:
|
||||
adminActor=httpPrefix+'://'+domainFull+'/users/'+adminNickname
|
||||
TOSForm+='<div class="container"><center><p class="administeredby">Administered by <a href="'+adminActor+'">'+adminNickname+'</a></p></center></div>'
|
||||
TOSForm+=htmlFooter()
|
||||
return TOSForm
|
||||
|
||||
|
|
Loading…
Reference in New Issue