Exemple #1
0
 // Check config file formatting.
 if (!isset($pdo_enabled) || !defined('SECRET_KEY') || !defined('SECRET_KEY_SALT')) {
     // Generate random token keys
     function createRandomToken($length = 32)
     {
         $chars = array("abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ", "123456789");
         $count = array(strlen($chars[0]) - 1, strlen($chars[1]) - 1);
         $key = "";
         for ($i = 0; $i < $length; $i++) {
             $type = mt_rand(0, 1);
             $key .= substr($chars[$type], mt_rand(0, $count[$type]), 1);
         }
         return $key;
     }
     $secret_key = createRandomToken();
     $secret_key_salt = createRandomToken();
     $content .= "<div style='width:850px; margin:15px auto;' class='tbl center'>\n";
     $content .= "Before we can continue you need to edit your <strong>config.php</strong>, insert the following 3 lines right after the line COOKIE_PREFIX : <br />\n";
     $content .= "<div class='tbl-border' style='margin-top:10px; padding: 5px; text-align:left;'>\n";
     $content .= "\$pdo_enabled = \"0\"; <br />\n";
     $content .= "define(\"SECRET_KEY\", \"" . $secret_key . "\"); <br />\n";
     $content .= "define(\"SECRET_KEY_SALT\", \"" . $secret_key_salt . "\"); <br />\n";
     $content .= "</div><br />";
     $content .= "Important : You need to change the \$pdo_enabled = \"0\" to \$pdo_enabled = \"1\" manually in order to enable PDO (Recommended).<br /><br />\n";
     $content .= "When you have inserted the above lines to your <strong>config.php</strong>, please push Next<br /><br />\n";
     $content .= "<strong>Warning</strong> : If you push Next without copying the above lines in grey to your <strong>config.php</strong> you will need to copy them again. <br /> For each failed refresh a new set will be created for you until your config have been updated as instructed.<br /><br />\n";
     $content .= "<input type='hidden' name='stage' value='2'>\n";
     $content .= "<input type='submit' name='refresh' value='Next' class='button btn btn-primary' style='margin: 0px auto;'></div><br /><br />\n";
 } else {
     $content .= "<div style='width:850px; margin:15px auto;' class='tbl center'>\n";
     $content .= "A new .htaccess file will be created with specific settings that are neccessary for PHP-Fusion to run properly<br />\n\t\t\t\t\t\t\t\tPlease note that any changes previosuly made to .htaccess will be lost.";
Exemple #2
0
     }
 }
 $selected_langs = '';
 function createRandomToken($length = 32)
 {
     $chars = array("abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ", "123456789");
     $count = array(strlen($chars[0]) - 1, strlen($chars[1]) - 1);
     $key = "";
     for ($i = 0; $i < $length; $i++) {
         $type = mt_rand(0, 1);
         $key .= substr($chars[$type], mt_rand(0, $count[$type]), 1);
     }
     return $key;
 }
 $secret_key = "" . createRandomToken() . "";
 $secret_key_salt = "" . createRandomToken() . "";
 if ($db_host != "" && $db_user != "" && $db_name != "" && $db_prefix != "") {
     if ($pdo_enabled == "1") {
         require_once "includes/db_handlers/pdo_functions_include.php";
         $pdo = NULL;
         try {
             $pdo = new PDO("mysql:host=" . $db_host . ";dbname=" . $db_name . ";encoding=utf8", $db_user, $db_pass);
             $db_connect = $pdo;
             $db_select = "True";
         } catch (PDOException $e) {
             $db_connect = "False";
             $db_select = "False";
         }
     } else {
         require_once "includes/db_handlers/mysql_functions_include.php";
         $db_connect = @mysql_connect($db_host, $db_user, $db_pass);
function askGlobalQuestions()
{
    $sRandomToken = createRandomToken();
    return array('hauptfarbe' => askColor(array("Damit der Shop in Ihrer CI erstrahlt benoetigen wir Ihre Hauptfarbe. ", "Anhand Ihrer Hauptfarbe werden Links, Hintergruende und Bilder coloriert. ", "Bitte geben Sie Ihre Hauptfarbe als Hex-Farbcode an: (Beispiel: #027a8b) ")), 'akzentfarbe' => askColor(array("Fuer Aktionslinks und wichtige Elemente Ihres Shops bieten wir den Einsatz ", "einer Akzentfarbe an. ", "Bitte geben Sie Ihre Akzentfarbe als Hex-Farbcode an: (Beispiel: #f59000) ")), 'farben-invertieren' => askBool(array("Auf Wunsch koennen Sie die Gestaltung des Shops auch invertieren (heller ", "Text auf dunklem Hintergrund), Ihre Farben bleiben dabei erhalten. ", "Moechten Sie die Farben des Shops invertieren? (j/n): ")), 'auftrags-url-zum-rp-system' => askDomain(array("----------", "", "Um die Produkte und Preise aus Ihrem RP-System ausgeben zu koennen, ", "benoetigen wir eine Anbindung via API zu Ihrem RP-System. Dazu muss Ihr ", "Webspace curl-Verbindungen zu Ihrem ResellerProfessional zulassen. ", "Bitte geben Sie die vollstaendige URL mit Ihrer Auftragsnummer an: ", "(Beispiel: https://123456.premium-admin.eu) ")), 'token-fuer-rp-verbindung' => ask(array("Zum Schutz Ihrer Daten werden Aufrufe an die API Ihres RP-Systems nur als ", "authentifizierter Benutzer oder Gast mit Auth-Token erlaubt. ", "Der Shop verwendet zur Anmeldung den Gast-Benutzer mit dem Auth-Token, das ", "Sie in den RP-Systemeinstellungen unter System > API angeben koennen. ", "Bitte geben Sie Ihr Gast-Token fuer API-Aufrufe an: ", "(Beispiel: " . $sRandomToken . ") ")), 'url-zu-ihrem-shop' => askUrl(array("---------", "", "Installieren Sie Ihren Shop mehrfach unter der selben (Sub-)Domain, so ", "kann es zu Problemen mit der Stabilitaet Ihrer Sitzungen kommen. Um diese zu ", "vermeiden, benoetigen wir die korrekte URL des Verzeichnisses, unter dem der ", "Shop erreichbar ist. Sie koennen diese Angabe spaeter noch aendern. ", "Bitte geben Sie die URL des Shop-Hauptverzeichnisses an: ", "(Beispiel: https://demo.reseller-shop.eu/shop/) ")));
}