3

I have been asked to make some 'emergency' changes on a Joomla! 1.5.23 website by a friend due to it being hacked. They have given me the only login details they are aware of which is an Administrator account. Not much use to me, read on.

The problem is that the changes I need to make involve having Super Administrator privileges (such as taking the website offline, changing access levels etc). I can't create a 'Super Admin' account as I only have Admin access.

They don't know any of the database nor hosting details. It's a bit of a mess to say the least, however I would like to try help them out. Is there anyway I can add an 'offline' page in place of the index.php? That way the site is offline at least, which is what they want.

Update 1

I have ftp access.

Any suggestions?

2 Answers 2

5

So, as promised:

(Disclaimer: this is not at all best practice. It is some basic code which will work but does not at all conform to any standards of beautiful coding... Use once and delete.)

First, make a backup of your template's index.php if you haven't done it so far (copy and rename or whatever you like, or by all means just download it to your computer).

Insert the code below int the template's index.php (via ftp, you'll find it in templates/your template name/index.php). Open the website. The code will get executed and when you check back with the User Manager in the backend, you should now be Super Administrator.

<?php 
$db = JFactory::getDBO();
$query = "UPDATE #__users SET usertype = 'Super Administrator', gid = '25' where id = '<your user id>';";

$db->setQuery($query);
$result = $db->loadResult();
?>

Which template do I have? -> go to Extensions -> Template Manager and see which template is marked with a yellow star.

What is my user id? -> go to Site -> User Manager, look for your username and check for the id (should be on the far right end of the entry's row)

Remember to remove the code from your template's index.php.

Let me know if this helped! :-)

1
  • 2
    Note: Before doing anything, make a backup of the template's index.php.
    – Farahmand
    Commented Sep 19, 2014 at 21:55
1

In which case I believe this is not possible.

I would suggest you get your friend to contact the hosting provider to redeem the login details to either PhpMyAdmin or the cPanel.

Once done, you will need to start recovering the password which can be done via PhpMyAdmin. The following explains this more in detail:

How do you recover or reset your admin password?

You will also need to change your account from an Admin to Super Admin. To do so, follow these instructions.

  1. Login to the Joomla Admin panel, and get the user ID for the super admin group.
  2. Go to the #__users table in your database and find your user.
  3. Change the usertype to Super Administrator
  4. Change the gid to the ID of the super admin group you found in the backend.

I believe these is everything you will need, however bare in mind that it has honestly been years since I have ever used Joomla 1.5 so I might have accidentally missed something.

Hope this helps

Note:

Make sure once you have everything sorted, you update to Joomla 1.5.26

6
  • thanks @Lodder that's very helpful. They actually can't even remember the hosting details! I'll have to find these myself using WHOIS and contact the hosting provider, this will take much longer though.
    – jonboy
    Commented Sep 19, 2014 at 14:57
  • You could also write a component to manipulate the database for you. I'll elaborate on that if you're interested
    – elk
    Commented Sep 19, 2014 at 18:17
  • And if you have ftp access, rename the index.php in the template's folder and upload your own "offline" page (named index.php)
    – elk
    Commented Sep 19, 2014 at 18:20
  • @elk - Only problem being is that you have to be a super admin to install an extension :)
    – Lodder
    Commented Sep 19, 2014 at 18:38
  • 1
    But now that I think about it, you don't even need to install an extension since you do have ftp access. You could just put the database manipulating code into the index.php :-D
    – elk
    Commented Sep 19, 2014 at 19:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.