dont allow anonymous to be set as a friends alias in the interface

This commit is contained in:
Kevin Froman 2019-06-10 22:19:31 -05:00
parent 7e058b29e0
commit 6e1f26dc91
3 changed files with 12 additions and 7 deletions

View File

@ -29,8 +29,6 @@ Onionr can be used for mail, as a social network, instant messenger, file sharin
The whitepaper (subject to change prior to alpha release) is available [here](docs/whitepaper.md). The whitepaper (subject to change prior to alpha release) is available [here](docs/whitepaper.md).
![node web illustration](docs/onionr-web.png)
![Tor stinks slide image](docs/tor-stinks-02.png) ![Tor stinks slide image](docs/tor-stinks-02.png)
## Main Features ## Main Features
@ -78,9 +76,9 @@ The following applies to Ubuntu Bionic. Other distros may have different package
(--require-hashes is intended to prevent exploitation via compromise of PyPi/CA certificates) (--require-hashes is intended to prevent exploitation via compromise of PyPi/CA certificates)
## Help out # Help out
Everyone is welcome to help out. Help is wanted for the following: Everyone is welcome to contribute. Help is wanted for the following:
* Development (Get in touch first) * Development (Get in touch first)
* Creation of a shared lib for use from other languages and faster proof-of-work * Creation of a shared lib for use from other languages and faster proof-of-work
@ -107,7 +105,7 @@ Note: probably not tax deductible
## Contact ## Contact
beardog [ at ] mailbox.org Email: beardog [ at ] mailbox.org
## Disclaimers and legal ## Disclaimers and legal
@ -123,4 +121,6 @@ The 'open source badge' is by Maik Ellerbrock and is licensed under a Creative C
The Onionr logo was created by [Anhar Ismail](https://github.com/anharismail) under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/). The Onionr logo was created by [Anhar Ismail](https://github.com/anharismail) under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/).
If you modify and redistribute our code ("forking"), please use a different logo and project name to avoid confusion. Please do not use our logo in a way that makes it seem like we endorse you without our permission. If you modify and redistribute our code ("forking"), please use a different logo and project name to avoid confusion. Please do not use the project name or logo in a way that makes it seem like we endorse you without our permission.
![node web illustration](docs/onionr-web.png)

View File

@ -27,6 +27,10 @@ function removeFriend(pubkey){
addForm.onsubmit = function(){ addForm.onsubmit = function(){
var friend = document.getElementsByName('addKey')[0] var friend = document.getElementsByName('addKey')[0]
var alias = document.getElementsByName('data')[0] var alias = document.getElementsByName('data')[0]
if (alias.value.toLowerCase() == 'anonymous'){
alert('Anonymous is a reserved name')
return false
}
fetch('/friends/add/' + friend.value, { fetch('/friends/add/' + friend.value, {
method: 'POST', method: 'POST',

View File

@ -55,7 +55,8 @@ function openReply(bHash, quote, subject){
function openThread(bHash, sender, date, sigBool, pubkey, subjectLine){ function openThread(bHash, sender, date, sigBool, pubkey, subjectLine){
var messageDisplay = document.getElementById('threadDisplay') var messageDisplay = document.getElementById('threadDisplay')
var blockContent = httpGet('/getblockbody/' + bHash) var blockContent = httpGet('/getblockbody/' + bHash)
document.getElementById('fromUser').value = sender
document.getElementById('fromUser').value = sender || 'Anonymous'
document.getElementById('subjectView').innerText = subjectLine document.getElementById('subjectView').innerText = subjectLine
messageDisplay.innerText = blockContent messageDisplay.innerText = blockContent
var sigEl = document.getElementById('sigValid') var sigEl = document.getElementById('sigValid')