mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 09:42: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
|
require_login
|
||||||
old_username = current_site.username
|
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]
|
if old_username == params[:name]
|
||||||
flash[:error] = 'You already have this name.'
|
flash[:error] = 'You already have this name.'
|
||||||
redirect '/settings'
|
redirect '/settings'
|
||||||
|
|
Loading…
Add table
Reference in a new issue