function SetupRender()
 {
     if (isset($_POST['install_base64']) || isset($_POST['uninstall_base64'])) {
         $this->SetupExecute();
     } else {
         $out = "This plugin allows you to install and uninstall a base64 custom function to and from your database.\n\t\t\tYou can then set \$configuration['db_encoding'] = 1 so that all data is transparently encoded and decoded\n\t\t\twith the minimal overhead possible. Enabling data encoding has quite a few advantages: <br/><br/>\n\n\t\t\t";
         $out .= "<br/><br/><textarea>BASE64 Status";
         if (Base64::IsBase64FunctionInstalled()) {
             $out .= "\n\tChecking MySQL function....OK!";
             if (!isset($GLOBALS['configuration']['db_encoding']) || $GLOBALS['configuration']['db_encoding'] != 1) {
                 $out .= "\n\tChecking db_encoding status....Failed";
                 $out .= "\n\n---------------------------------------------------";
                 $out .= "\n\$configuration['db_encoding'] is set to 0. Make sure you set the value to 1 to enable data encoding.";
             } else {
                 $out .= "\n\tChecking db_encoding status....OK!";
                 $out .= "\n\nBASE64 Status...OK!";
                 $out .= "\n---------------------------------------------------";
             }
             $out .= "</textarea><div style='padding-left:250px;padding-top:10px;'><input type='submit' value='UNINSTALL' name='uninstall_base64'/></div>";
         } else {
             $out .= "\n\tChecking MySQL function....NOT INSTALLED";
             $out .= "\n\tChecking db_encoding status ignored";
             $out .= "\n\n---------------------------------------------------";
             $out .= "\nClick the INSTALL button below to install the base64 function to your database.";
             $out .= "</textarea><div style='padding-left:250px;padding-top:10px;'><input type='submit' value='INSTALL' name='install_base64'/></div>";
         }
         $out .= "<input type='hidden' name='plugins' value='true'/>";
         echo $out;
     }
 }
Beispiel #2
0
                 $plugins[] = $file;
             }
         }
     }
     closedir($dir);
 }
 /**
  * verify configuration info
  */
 if ($errors == 0) {
     AddTrace('File Structure....OK!');
     if (!mysql_connect($GLOBALS['configuration']['host'] . ":" . $GLOBALS['configuration']['port'], $GLOBALS['configuration']['user'], $GLOBALS['configuration']['pass'])) {
         $errors++;
         AddError('Cannot connect to the specified database server. Edit configuration.php');
     }
     if (isset($GLOBALS['configuration']['db_encoding']) && $GLOBALS['configuration']['db_encoding'] == 1 && !Base64::IsBase64FunctionInstalled()) {
         $errors++;
         AddError('$configuration[db_encoding] needs to be set to 0 until you install the base64 plugin. Set db_encoding to 0 by editing configuration.php, run setup again and go to the "Manage Plugins" tab. Install the base64 plugin. Then you can set db_encoding = 1');
     }
     if ($errors == 0) {
         if (!@mysql_select_db($GLOBALS['configuration']['db'])) {
             $errors++;
             AddError('Cannot find the specified database "' . $GLOBALS['configuration']['db'] . '". Edit configuration.php');
         }
     }
 }
 /**
  * verify storage status
  */
 if ($errors == 0) {
     AddTrace("Configuration Info....OK!\n");