Project

General

Profile

Bug #404

Deletion of administrator user with all caps prior to assigning new user with administrator privleges.

Added by o8t3 over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
-
Target version:
-
Start date:
01/05/2010
Due date:
% Done:

100%


Description

After realizing the I had created an administrator user with all caps, I created a new user and did not assign administrator to the new user, then proceeded to delete the old user administrator. Not I see the old administrator user but am not allowed access.

History

#1 Updated by cpg over 11 years ago

  • Status changed from New to Assigned
  • Assignee set to cpg
  • Priority changed from Normal to High

do this:

cd /var/hda/platform/html
echo 'u = User.last; u.admin = true; u.save!; puts "User #{u.login} is now admin"' | ./script/console production

#2 Updated by cpg over 11 years ago

i heard that you got back this:

result: NoMethodError: undefined method `admin=' for nil:NilClass from (irb):1

the above method makes the last user an admin. it looks like User.last returns nil, which is kind of troublesome. basically, it means that there are no users in your system at this time.

we can perhaps force-create a dummy user. with

echo 'u = User.new(:login => "foo"); u.save_without_validation;' | ./script/console

then re-apply the first command.

#3 Updated by Anonymous over 11 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

Applied in changeset commit:"e8b17c835675422d980fb5ec8066abb9920a2b54".

Also available in: Atom