/**
  * This function checks for an update for a particular module at the lotuscms website.
  */
 protected function checkForModuleUpdate($req, $saveInfo)
 {
     if (isset($_SESSION['MOD_LCMS_ORG_RESPONSE'])) {
         return $_SESSION['MOD_LCMS_ORG_RESPONSE'];
     } else {
         include_once "core/lib/RemoteFiles.php";
         include_once "core/lib/ModuleInfo.php";
         //Get information on update status of each plugin.
         //Setup remote file requestor
         $rf = new RemoteFiles();
         //Get site version
         $version = file_get_contents("data/config/site_version.dat");
         $data = "";
         if (isset($_SESSION['MOD_LCMS_ORG_RESPONSE_URL']) && !$saveInfo) {
             if (!empty($_SESSION['MOD_LCMS_ORG_RESPONSE_URL'])) {
                 $data = $_SESSION['MOD_LCMS_ORG_RESPONSE_URL'];
             }
         } else {
             if (file_exists("data/lcmscache/mod_update.dat")) {
                 include_once "core/lib/io.php";
                 $io = new InputOutput();
                 $data = $io->openFile("data/lcmscache/mod_update.dat");
                 $_SESSION['MOD_LCMS_ORG_RESPONSE_URL'] = $data;
                 //Finally delete the cache
                 unlink("data/lcmscache/mod_update.dat");
             } else {
                 //Collect information on module updates.
                 $data = $rf->getURL("http://cdn.modules.lotuscms.org/lcms-3-series/versioncontrol/allversioncheck.php?m={$req}&v={$version}");
                 //If preloader is getting info, save it to file
                 if ($saveInfo && !empty($data)) {
                     include_once "core/lib/io.php";
                     $io = new InputOutput();
                     $io->saveFile("data/lcmscache/mod_update.dat", $data);
                     return null;
                 }
             }
         }
         //Output
         $out = "";
         if (empty($data)) {
             if (file_exists("data/lcmscache/mod_update.dat")) {
                 unlink("data/lcmscache/mod_update.dat");
             }
             return false;
         }
         $modArray = array();
         //Get list of plugins
         $m = explode("|", $data);
         //Loop through each update response.
         for ($i = 0; $i < count($m); $i++) {
             //Split name & version number
             $getFull = explode(":", $m[$i]);
             //Get full number of plugin
             $nv = (double) $getFull[1];
             //Get current version
             include_once "modules/" . $getFull[0] . "/" . $getFull[0] . "ModuleInfo.php";
             $name = $getFull[0] . "ModuleInfo";
             //Load info class
             $info = new $name();
             //Load info
             $info->ModuleInfo();
             //Get current version number
             $cv = (double) $info->getVersion();
             //If new version is actually newer than installed.
             if ($cv < $nv) {
                 $modArray[$getFull[0]] = true;
             } else {
                 $modArray[$getFull[0]] = false;
             }
         }
         //Response
         $_SESSION['MOD_LCMS_ORG_RESPONSE'] = $modArray;
         return $modArray;
     }
 }
 $password1 = $_POST['password1'];
 $title = $_POST['title'];
 $name = $_POST['fullname'];
 $email = $_POST['email'];
 //Get Locale text
 $loc = explode("[", $_POST['locale']);
 $locale = str_replace("]", "", $loc[1]);
 if (!empty($username) && !empty($password) && !empty($password1) && !empty($title) && !empty($name) && !empty($email)) {
     //Passwords don't match
     if ($password != $password1) {
         redirect(2, true, 2);
     }
     //Creates a long random string as salt.
     $salt = generateRandStr(30);
     //Saves site title
     $io->saveFile("data/config/site_title.dat", $title);
     $io->saveFile("data/config/salt.dat", $salt);
     //Save the site Locale
     $io->saveFile("data/config/locale.dat", $locale);
     //Include user libraries
     include "core/lib/User.php";
     //Create new user
     $u = new User();
     //Removing administrator user.
     @unlink("data/users/admin.dat");
     //Creates the new user
     $u->saveUser($username, $fullname, $email, $password, "administrator");
     //Install essentially complete
     @unlink("cache/index.html");
     $out = str_replace("%MESSAGE%", "<p><strong>Complete!</strong><br />The CMS will now try to delete the installation file due to security reasons.</p><form action='install.php?step=4' method='post'><input style='height: 40px;width: 150px;float: right;' type='submit' value='Delete Install Files' /></form>", $out);
 } else {