Beispiel #1
0
 * See COPYRIGHT.php for copyright notices and details.
 *
 * $Id: index.php 10268 2011-06-15 09:17:29Z c_schmitz $
 */
if (isset($_REQUEST['rootdir'])) {
    die('You cannot start this script directly');
}
$action = '';
require_once dirname(__FILE__) . '/../../config-defaults.php';
require_once dirname(__FILE__) . '/../../common.php';
require_once dirname(__FILE__) . '/../admin_functions.php';
require_once dirname(__FILE__) . '/../update/updater.php';
// SET THE LANGUAGE???? -> DEFAULT SET TO EN FOR NOW
require_once $rootdir . '/classes/core/language.php';
$clang = new limesurvey_lang("en");
$adminoutput = getAdminHeader();
// Alle future output is written into this and then outputted at the end of file
ob_implicit_flush(true);
sendcacheheaders();
if (!$database_exists) {
    $adminoutput .= "<br />\n" . "<table width='350' align='center' style='border: 1px solid #555555' cellpadding='1' cellspacing='0'>\n" . "\t<tr bgcolor='#555555'><td colspan='2' height='4'><font size='1' face='verdana' color='white'><strong>" . $clang->gT("LimeSurvey Setup") . "</strong></td></tr>\n" . "\t<tr bgcolor='#CCCCCC'><td align='center'>\n" . "<strong>" . $clang->gT("Welcome to LimeSurvey Setup!") . "</strong><br /><br />\n" . $clang->gT("The database defined in config.php does not exist.") . "<br />\n" . $clang->gT("LimeSurvey can attempt to create this database for you.") . "<br /><br />\n" . $clang->gT("Your selected database name is:") . "<strong> {$databasename}</strong><br />\n" . "<br /><input type='submit' value='" . $clang->gT("Create Database") . "' onclick='location.href=\"createdb.php\"' /></center>\n" . "</td></tr></table>\n" . "</body>\n</html>\n";
} elseif ($dbexistsbutempty && !(returnglobal('createdbstep2') == $clang->gT("Populate Database"))) {
    $connect->database = $databasename;
    $connect->Execute("USE DATABASE `{$databasename}`");
    $adminoutput .= "<div class='messagebox ui-corner-all'><div class='header ui-widget-header' >" . $clang->gT("LimeSurvey Setup") . "</div>\n";
    $adminoutput .= "<br /><div class='successtitle'>\n";
    $adminoutput .= sprintf($clang->gT('A database named "%s" already exists.'), $databasename) . "</div><p>\n";
    $adminoutput .= $clang->gT("Do you want to populate that database now by creating the necessary tables?") . "<br /><br />\n";
    $adminoutput .= "<form method='post' action='createdb.php'>";
    $adminoutput .= "<input type='submit' name='createdbstep2' value='" . $clang->gT("Populate Database") . "'></form></div>";
} else {
function doAdminHeader()
{
    echo getAdminHeader();
}
    }
    if (!isset($printablesurveyoutput) && $subaction != 'export' && substr($action, 0, 4) != 'ajax') {
        if (!isset($_SESSION['metaHeader'])) {
            $_SESSION['metaHeader'] = '';
        }
        $adminoutput = getAdminHeader($_SESSION['metaHeader']) . $adminoutput;
        // All future output is written into this and then outputted at the end of file
        unset($_SESSION['metaHeader']);
        $adminoutput .= "</div>\n";
        if (!isset($_SESSION['checksessionpost'])) {
            $_SESSION['checksessionpost'] = '';
        }
        $adminoutput .= "<script type=\"text/javascript\">\n" . "<!--\n" . "\tfor(i=0; i<document.forms.length; i++)\n" . "\t{\n" . "var el = document.createElement('input');\n" . "el.type = 'hidden';\n" . "el.name = 'checksessionbypost';\n" . "el.value = '" . $_SESSION['checksessionpost'] . "';\n" . "document.forms[i].appendChild(el);\n" . "\t}\n" . "\n" . "\tfunction addHiddenElement(theform,thename,thevalue)\n" . "\t{\n" . "var myel = document.createElement('input');\n" . "myel.type = 'hidden';\n" . "myel.name = thename;\n" . "theform.appendChild(myel);\n" . "myel.value = thevalue;\n" . "return myel;\n" . "\t}\n" . "\n" . "\tfunction sendPost(myaction,checkcode,arrayparam,arrayval)\n" . "\t{\n" . "var myform = document.createElement('form');\n" . "document.body.appendChild(myform);\n" . "myform.action =myaction;\n" . "myform.method = 'POST';\n" . "for (i=0;i<arrayparam.length;i++)\n" . "{\n" . "\taddHiddenElement(myform,arrayparam[i],arrayval[i])\n" . "}\n" . "addHiddenElement(myform,'checksessionbypost',checkcode)\n" . "myform.submit();\n" . "\t}\n" . "\n" . "//-->\n" . "</script>\n";
        $adminoutput .= getAdminFooter("http://docs.limesurvey.org", $clang->gT("LimeSurvey online manual"));
    }
} else {
    //not logged in
    sendcacheheaders();
    if (!isset($_SESSION['metaHeader'])) {
        $_SESSION['metaHeader'] = '';
    }
    $adminoutput = getAdminHeader($_SESSION['metaHeader']) . $adminoutput . $loginsummary;
    // All future output is written into this and then outputted at the end of file
    unset($_SESSION['metaHeader']);
    $adminoutput .= "</div>\n" . getAdminFooter("http://docs.limesurvey.org", $clang->gT("LimeSurvey online manual"));
}
if ($action == 'showphpinfo' && $_SESSION['USER_RIGHT_CONFIGURATOR'] == 1) {
    phpinfo();
} else {
    echo $adminoutput;
}
Beispiel #4
0
//
//      if (is_dir($homedir."/install") && $debug<2)
//       {
//        die ("<p style='text-align: center; margin-left: auto; margin-right: auto; width: 500px; margin-top: 50px;'><img src='../images/limecursor-handle.png' /><strong>Congratulations</strong><br /><br />Your installation is now complete. The final step is to remove or rename the LimeSurvey installation directory (admin/install) on your server since it may be a security risk.<br /><br />Once this directory has been removed or renamed you will be able to log in to your new LimeSurvey Installation.<br /><br /><a href='admin.php'>Try again</a></p>");
//       }
//}
//Admin menus and standards
//IF THIS IS AN ADMIN SCRIPT, RUN THE SESSIONCONTROL SCRIPT
if ($sourcefrom == "admin") {
    include $homedir . "/sessioncontrol.php";
    /**
     * @param string $htmlheader
     * This is the html header text for all administration pages
     *
     */
    $htmlheader = getAdminHeader();
}
//SET LANGUAGE DIRECTORY
if ($sourcefrom == "admin") {
    $langdir = "{$publicurl}/locale/" . $_SESSION['adminlang'] . "/help";
    $langdirlocal = "{$rootdir}/locale/" . $_SESSION['adminlang'] . "/help";
    if (!is_dir($langdirlocal)) {
        $langdir = "{$publicurl}/locale/en/help";
        //default to english if there is no matching language dir
    }
}
if ($sourcefrom == "admin" && $buildnumber != "" && $updatecheckperiod > 0 && $updatelastcheck < date_shift(date("Y-m-d H:i:s"), "Y-m-d H:i:s", "-" . $updatecheckperiod . " days")) {
    //updatecheck();
}
//SET LOCAL TIME
if (substr($timeadjust, 0, 1) != '-' && substr($timeadjust, 0, 1) != '+') {
Beispiel #5
0
        . "\taddHiddenElement(myform,arrayparam[i],arrayval[i])\n"
        . "}\n"
        . "addHiddenElement(myform,'checksessionbypost',checkcode)\n"
        . "myform.submit();\n"
        . "\t}\n"
        . "\n"
        . "//-->\n"
        . "</script>\n";
        $adminoutput .= getAdminFooter("http://docs.limesurvey.org", $clang->gT("LimeSurvey online manual"));
    }

}
else
{ //not logged in

sendcacheheaders();
if (!isset($_SESSION['metaHeader'])) {$_SESSION['metaHeader']='';}
$adminoutput = getAdminHeader($_SESSION['metaHeader']).$adminoutput.$loginsummary;  // All future output is written into this and then outputted at the end of file
unset($_SESSION['metaHeader']);
$adminoutput.= "</div>\n".getAdminFooter("http://docs.limesurvey.org", $clang->gT("LimeSurvey online manual"));
}
if (($action=='showphpinfo') && ($_SESSION['USER_RIGHT_CONFIGURATOR'] == 1))
{
    phpinfo();
}
else
{
    echo $adminoutput;
}

Beispiel #6
0
 * See COPYRIGHT.php for copyright notices and details.
 *
 * $Id: createdb.php 9622 2010-12-10 21:38:02Z c_schmitz $
 */
//Ensure script is not run directly, avoid path disclosure
if (isset($_REQUEST['rootdir'])) {
    die('You cannot start this script directly');
}
require_once dirname(__FILE__) . '/../../config-defaults.php';
require_once dirname(__FILE__) . '/../../common.php';
require_once $rootdir . '/classes/core/language.php';
require_once dirname(__FILE__) . '/../admin_functions.php';
$clang = new limesurvey_lang("en");
$dbname = $databasename;
sendcacheheaders();
echo getAdminHeader();
echo "<div class='messagebox ui-corner-all'><div class='header ui-widget-header' >" . $clang->gT("Create Database") . "</div><p>\n";
echo $clang->gT("Creating tables. This might take a moment...") . "<p>&nbsp;\n";
// In Step2 fill the database with data
if (returnglobal('createdbstep2') == $clang->gT("Populate Database")) {
    $createdbtype = $databasetype;
    if ($databasetype == 'mysql' || $databasetype == 'mysqli') {
        @$connect->Execute("ALTER DATABASE `{$dbname}` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;");
        $createdbtype = 'mysql';
    }
    if ($createdbtype == 'mssql_n' || $createdbtype == 'odbc_mssql' || $createdbtype == 'odbtp') {
        $createdbtype = 'mssql';
    }
    if ($createdbtype == 'postgres' && version_compare($connect->pgVersion, '9') >= 0) {
        $connect->execute("ALTER DATABASE {$dbname} SET bytea_output='escape';");
    }
Beispiel #7
0
        $adminoutput .= $dumpdboutput;
    }
    if (isset($exportspssoutput)) {
        $adminoutput .= $exportspssoutput;
    }
    if (isset($exportroutput)) {
        $adminoutput .= $exportroutput;
    }
    if (isset($loginsummary)) {
        $adminoutput .= $loginsummary;
    }
    if (!isset($printablesurveyoutput) && $subaction != 'export' && substr($action, 0, 4) != 'ajax') {
        if (!isset($_SESSION['metaHeader'])) {
            $_SESSION['metaHeader'] = '';
        }
        $adminoutput = getAdminHeader($_SESSION['metaHeader']) . $adminoutput;
        // All future output is written into this and then outputted at the end of file
        unset($_SESSION['metaHeader']);
        $adminoutput .= "</div>\n";
        if (!isset($_SESSION['checksessionpost'])) {
            $_SESSION['checksessionpost'] = '';
        }
        $adminoutput .= "<script type=\"text/javascript\">\n" . "<!--\n" . "\tfor(i=0; i<document.forms.length; i++)\n" . "\t{\n" . "var el = document.createElement('input');\n" . "el.type = 'hidden';\n" . "el.name = 'checksessionbypost';\n" . "el.value = '" . $_SESSION['checksessionpost'] . "';\n" . "document.forms[i].appendChild(el);\n" . "\t}\n" . "\n" . "\tfunction addHiddenElement(theform,thename,thevalue)\n" . "\t{\n" . "var myel = document.createElement('input');\n" . "myel.type = 'hidden';\n" . "myel.name = thename;\n" . "theform.appendChild(myel);\n" . "myel.value = thevalue;\n" . "return myel;\n" . "\t}\n" . "\n" . "\tfunction sendPost(myaction,checkcode,arrayparam,arrayval)\n" . "\t{\n" . "var myform = document.createElement('form');\n" . "document.body.appendChild(myform);\n" . "myform.action =myaction;\n" . "myform.method = 'POST';\n" . "for (i=0;i<arrayparam.length;i++)\n" . "{\n" . "\taddHiddenElement(myform,arrayparam[i],arrayval[i])\n" . "}\n" . "addHiddenElement(myform,'checksessionbypost',checkcode)\n" . "myform.submit();\n" . "\t}\n" . "\n" . "//-->\n" . "</script>\n";
        $adminoutput .= getAdminFooter("http://docs.limesurvey.org", $clang->gT("LimeSurvey online manual"));
    }
} else {
    //not logged in
    sendcacheheaders();
    $adminoutput = <<<EOD
<!DOCTYPE html>
<html lang="en">