cyprich.com

Occasionally Relevant Insights from a Software Builder

By

How to Recover a Joomla Admin Password

If you don’t login regularly to your Joomla administrator site, you may one day forget what your password is. If this unfortunate event does happen, its very easy to recover it if you have access to the database that your web site uses.

Open your database and find the table prefix_users, where prefix is the database prefix that you selected when you installed Joomla.

Open your user account for editing.

In the password field, replace the contents with

d2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199

You’ve just changed your password to the word secret. Now immediately login and change your password to something more secure.

This procedure works with Joomla 2.5 and 3.x.

By

How to Fix Microsoft Outlook Failure to Activate License

When I upgraded to Windows 8 from Windows XP, everything worked well except Microsoft Outlook. It required me to activate its license and failed on every attempt I made at this. This may be due to it trying to write data to a folder that Windows 8’s enhanced security was blocking. Windows 7 users experience the same problem with Outlook’s license activation.

The solution is very simple. You need to run Outlook as an administrator, i.e. right click on the Outlook program icon and select “Run as administrator” from the list of options. Even though I was logged in as administrator, I still had to do this step to force Windows to run Outlook as an administrator. Outlook was then able to activate its license with Microsoft and then ran without a red title bar in the application that indicated a problem.

By

Redirecting ASP.NET Pages

You can redirect an ASP.NET page using one of three methods. The first method is through metatag redirection. If that fails, then it will try to redirect with JavaScript. If that fails, a URL will be displayed that the user can click on to redirect the page.

An HTML 5 only version of this redirect page can be found in the post Redirecting Pages in HTML 5.

— ASP.NET code below —

<%@ Page Language=”C#” %>

<!DOCTYPE html>

<script runat=”server”>
</script>

<html>
<head runat=”server”>
<title>Page Title</title>

<meta http-equiv=”Refresh” content=”0; url=http://www.website.com”>

<!– If the meta tag doesn’t work, try JavaScript to redirect. –>

<script type=”text/javascript”>
window.location.href = “http://www.website.com”
</script>
</head>

<body>
<form id=”form1″ runat=”server”>
<div>
<!– If JavaScript doesn’t work, give a link to click on to redirect. –>

<p>If you are not redirected automatically, click <a href=’http://www.website.com’>here</a>.</p>
</div>
</form>
</body>
</html>

By

Finding the Version of Joomla in the Back End

I was trying to find out which version of Joomla was installed in a web site. The first place I looked was in the database where this type of information was normally stored. I couldn’t find any global settings table which would have the version number. This is because Joomla stores version information in the libraries folder in version.php which is located in different folders on Joomla 1.5 and Joomla 2.5/3.x.

Joomla 1.5
/libraries/joomla/version.php

Joomla 2.5/3.x
/libraries/cms/version/version.php

In the version.php document will be the following variables:

public $RELEASE = '3.3';
public $DEV_LEVEL = '1';

This shows that the installed version of Joomla is 3.3.1.

By

Restore Backed Up Database in MS SQL Server Using Transact-SQL

The following code will restore a database from a backup file in MS SQL Server. Normally you would use Management Studio to do this, but this might fail if the database needs to be in single user mode to restore. The code below will restore the database as a single user, then put it back in multi-user mode after its done.

—[ Transact-SQL Code ]——————–

-- Set database as single user and restore from backup.
USE master
ALTER DATABASE <your_database>
 SET SINGLE_USER WITH ROLLBACK IMMEDIATE
RESTORE DATABASE <your_database>
 FROM DISK = 'D:\Databases\YourDatabase.bak'
 WITH REPLACE
GO
-- Set database back to multi user.
ALTER DATABASE <your_database> SET MULTI_USER WITH ROLLBACK IMMEDIATE
GO