-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
- require($INC);
-}
+if (!defined('__SECURITY')) {
+ die();
+} // END - if
+
+// Initial message part
+$message = "<strong>{--VALIDATING_LOGIN--}</strong>";
+
+// Is the member id and u_hash set?
+if (isMemberIdSet() && (isSessionVariableSet('u_hash'))) {
+ // Is 'theme' installed and activated?
+ if (isExtensionActive('theme')) {
+ // Get theme from profile
+ if (!fetchUserData(getMemberId())) {
+ // Userid is not valid
+ debug_report_bug('User id '.getMemberId() . ' is invalid.');
+ } // END - if