mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
check for empty username
This commit is contained in:
parent
c9a2638acf
commit
6ecf5539b5
1 changed files with 5 additions and 0 deletions
5
app.rb
5
app.rb
|
@ -207,6 +207,11 @@ post '/change_name' do
|
|||
require_login
|
||||
old_username = current_site.username
|
||||
|
||||
if params[:name] == nil || params[:name] == ''
|
||||
flash[:error] = 'Name cannot be blank.'
|
||||
redirect '/settings'
|
||||
end
|
||||
|
||||
if old_username == params[:name]
|
||||
flash[:error] = 'You already have this name.'
|
||||
redirect '/settings'
|
||||
|
|
Loading…
Add table
Reference in a new issue