Ejemplo n.º 1
0
function check_server()
{
    if (!check_writeable(MAD_PATH . '/conf/')) {
        return false;
    }
    if (!check_writeable(MAD_PATH . '/data/creative/')) {
        return false;
    }
    if (!check_xml()) {
        return false;
    }
    if (!check_mbstring()) {
        return false;
    }
    return true;
}
Ejemplo n.º 2
0
                            <h3>Recommended: PHP Version 5.3+</h3>
                        </div>

                        <div class="widget-content">
                            <p>mAdserve has detected that your PHP version is lower than 5.3. If you would like to
                                enable caching to speed up your mAdserve ad server, you'll need to have PHP 5.3 or
                                greater installed.</p>
                        </div>

                    </div>
                <?php 
    }
    ?>

                <?php 
    if (!check_writeable(MAD_PATH . '/data/cache/')) {
        ?>
                    <div class="widget">

                        <div class="widget-header">
                            <span class="icon-x-alt"></span>

                            <h3>Optional: Caching Directory not writeable: <?php 
        echo MAD_PATH;
        ?>
/data/cache/</h3>
                        </div>

                        <div class="widget-content">
                            <p>If you'd like to enable File-Based caching to speed up your mAdserve ad server, please
                                make sure that the caching directory <strong><?php 
Ejemplo n.º 3
0
 /* PHP Version */
 $ver = (int) str_replace(".", "", substr(phpversion(), 0, 5));
 if ($ver >= $min['php']) {
     $Cphp = GOOD . " (" . phpversion() . ") ";
 } else {
     // E10
     $Cphp = BAD . " (" . phpversion() . ") " . " \n\t <span class='hint'>Bitte installieren Sie eine neuere <a href='http://www.php.net'>PHP Version</a>!</span>\n";
     $STOPP = true;
     array_push($stopp_array, "php version (" . phpversion() . ") too old [E10]");
 }
 echo "\nPHP-Version\t\t\t\t\t" . $Cphp;
 /* FileSystem Test*/
 require_once "../include/check_writeable.inc.php";
 $Clogdir = check_writeable($fullpath, "logs", false) == true ? GOOD : "Nein, " . BAD . " \n\t <span class='hint'>Ändern mit: chmod 777 logs/</span>\n";
 $Cuploaddir = check_writeable($fullpath, "uploaded", false) == true ? GOOD : "Nein, " . BAD . " \n\t <span class='hint'>Ändern mit: chmod 777 uploaded/</span>\n";
 $Ccachedir = check_writeable($fullpath, "cache", false) == true ? GOOD : "Nein, " . BAD . " \n\t <span class='hint'>Ändern mit: chmod 777 cache/</span>\n";
 $Csettings = is_writable(CONFIGFILE) == true ? GOOD : "Nein, " . BAD . " \n\t <span class='hint'>Ändern mit: chmod 777 configs/main.conf.ini/</span>\n";
 // E20
 if ($Clogdir != GOOD || $Cuploaddir != GOOD || $Ccachedir != GOOD || $Csettings != GOOD) {
     $STOPP = true;
     array_push($stopp_array, "file/dir not writable [E20]");
 }
 echo "\n\nDateisystem" . "\n\tInstallationspfad\t\t\t" . $fullpath . "\n\tlog-Verzeichnis ist beschreibbar?\t" . $Clogdir . "\n\tupload-Verzeichnis ist beschreibbar?\t" . $Cuploaddir . "\n\tCache-Verzeichnis ist beschreibbar?\t" . $Ccachedir . "\n\tEinstellungsdatei ist beschreibbar?\t" . $Csettings;
 /* MYSQL Test */
 require_once "../include/cbmysql.class.php";
 // MySQL Module detector
 check_mysql_interface("LOAD_MYSQLI");
 echo "\n\nDatenbankverbindung" . "\n\tPHP-Modul\t\t\t\t";
 if (defined('LOAD_MYSQLI')) {
     echo GOOD . " (MySQL<b>I</b>)";
 } else {
Ejemplo n.º 4
0
    /**
      Define any javascript needed
      @return A javascript string
    function javascript_content(){
        $js="";
        return $js;
    }
    */
    function body_content()
    {
        include '../config.php';
        ob_start();
        echo showInstallTabs('Necessities');
        $self = basename($_SERVER['PHP_SELF']);
        echo "<form action='{$self}' method='post'>";
        if (!$this->themed) {
            echo "<h1 class='install'>{$this->header}</h1>";
        }
        // Path detection: Establish ../../
        $FILEPATH = rtrim(__FILE__, "{$self}");
        if (DIRECTORY_SEPARATOR == '\\') {
            $FILEPATH = str_replace(DIRECTORY_SEPARATOR, '/', $FILEPATH);
        }
        $URL = rtrim($_SERVER['SCRIPT_NAME'], "{$self}");
        $FILEPATH = rtrim($FILEPATH, '/');
        $URL = rtrim($URL, '/');
        $FILEPATH = rtrim($FILEPATH, 'install');
        $URL = rtrim($URL, 'install');
        $FANNIE_ROOT = $FILEPATH;
        $FANNIE_URL = $URL;
        if (function_exists('posix_getpwuid')) {
            $chk = posix_getpwuid(posix_getuid());
            echo "PHP is running as: " . $chk['name'] . "<br />";
        } else {
            echo "PHP is (probably) running as: " . get_current_user() . "<br />";
        }
        if (is_writable($FILEPATH . 'config.php')) {
            confset('FANNIE_ROOT', "'{$FILEPATH}'");
            confset('FANNIE_URL', "'{$URL}'");
            echo "<div class=\"alert alert-success\"><i>config.php</i> is writeable</div>";
            echo "<hr />";
        } else {
            echo "<div class=\"alert alert-danger\"><b>Error</b>: config.php is not writeable</div>";
            echo "<div class=\"well\">";
            echo "config.php ({$FILEPATH}config.php) is Fannie's main configuration file.";
            echo "<ul>";
            echo "<li>If this file exists, ensure it is writable by the user running PHP (see above)";
            echo "<li>If the file does not exist, copy config.dist.php ({$FILEPATH}config.dist.php) to config.php";
            echo "<li>If neither file exists, create a new config.php ({$FILEPATH}config.php) containing:";
            echo "</ul>";
            echo "<pre>\n&lt;?php\n?&gt;\n</pre>";
            echo "</div>";
            echo '<button type="submit" class="btn btn-default">Refresh this page</button>';
            echo "</form>";
            return ob_get_clean();
        }
        if (!is_dir(dirname(__FILE__) . '/../../vendor')) {
            echo "<div class=\"alert alert-warning\"><b>Warning</b>: dependencies appear to be missing.</div>";
            echo '<div class=\\"well\\">';
            echo 'Install <a href="https://getcomposer.org/">Composer</a> then run ';
            echo "<pre>";
            echo '$ cd "' . $FILEPATH . "\"\n";
            echo '$ /path/to/composer.phar update';
            echo '</pre>';
            echo '<a href="https://github.com/CORE-POS/IS4C/wiki/Installation#composer">More info about Composer</a>';
            echo '</div>';
        } else {
            $json = file_get_contents(dirname(__FILE__) . '/../../composer.json');
            $obj = json_decode($json);
            $missing = false;
            foreach (get_object_vars($obj->require) as $package => $version) {
                if (!is_dir(dirname(__FILE__) . '/../../vendor/' . $package)) {
                    $missing = true;
                    echo "<div class=\"alert alert-danger\"><b>Warning</b>: package " . $package . " is not installed.</div>";
                }
            }
            if ($missing) {
                echo '<div class="well">Install dependencies by running';
                echo "<pre>";
                echo '$ cd "' . substr($FILEPATH, 0, strlen($FILEPATH) - 7) . "\"\n";
                echo '$ /path/to/composer.phar update';
                echo '</pre></div>';
            }
        }
        /**
            Detect databases that are supported
        */
        $supportedTypes = \COREPOS\common\sql\Lib::getDrivers();
        if (count($supportedTypes) == 0) {
            echo "<div class=\"alert alert-danger\"><b>Error</b>: no database driver available</div>";
            echo "<div class=\"well\">";
            echo 'Install at least one of the following PHP extensions: pdo_mysql, mysqli, mysql,
                or mssql. If you installed one or more of these and are still seeing this
                error, make sure they are enabled in your PHP configuration and try 
                restarting your web server.';
            echo "</div>";
            return false;
        }
        $db_keys = array_keys($supportedTypes);
        $defaultDbType = $db_keys[0];
        echo '<h4 class="install"><a href="" onclick="$(\'#serverConfTable\').toggle(); return false;">Main Server</a> +</h4>';
        echo '<table id="serverConfTable">';
        echo '<tr><td>Server Database Host</td>' . '<td>' . installTextField('FANNIE_SERVER', $FANNIE_SERVER, '127.0.0.1') . '</td></tr>';
        echo '<tr><td>Server Database Type</td>' . '<td>' . installSelectField('FANNIE_SERVER_DBMS', $FANNIE_SERVER_DBMS, $supportedTypes, $defaultDbType) . '</td></tr>';
        echo '<tr><td>Server Database Username</td>' . '<td>' . installTextField('FANNIE_SERVER_USER', $FANNIE_SERVER_USER, 'root') . '</td></tr>';
        echo '<tr><td>Server Database Password</td>' . '<td> ' . installTextField('FANNIE_SERVER_PW', $FANNIE_SERVER_PW, '', true, array('type' => 'password')) . '</td></tr>';
        echo '<tr><td>Server Operational DB name</td>' . '<td>' . installTextField('FANNIE_OP_DB', $FANNIE_OP_DB, 'core_op') . '</td></tr>';
        echo '<tr><td>Server Transaction DB name</td>' . '<td>' . installTextField('FANNIE_TRANS_DB', $FANNIE_TRANS_DB, 'core_trans') . '</td></tr>';
        echo '</table>';
        $sql = db_test_connect($FANNIE_SERVER, $FANNIE_SERVER_DBMS, $FANNIE_OP_DB, $FANNIE_SERVER_USER, $FANNIE_SERVER_PW);
        $createdOps = false;
        if ($sql === false) {
            echo "<div class=\"alert alert-danger\">Testing Operational DB connection failed</div>";
        } else {
            echo "<div class=\"alert alert-success\">Testing Operational DB connection succeeded</div>";
            $msgs = $this->create_op_dbs($sql, $FANNIE_OP_DB);
            $createdOps = true;
            foreach ($msgs as $msg) {
                if ($msg['error'] == 0) {
                    continue;
                }
                echo $msg['error_msg'] . '<br />';
            }
        }
        $sql = db_test_connect($FANNIE_SERVER, $FANNIE_SERVER_DBMS, $FANNIE_TRANS_DB, $FANNIE_SERVER_USER, $FANNIE_SERVER_PW);
        $createdTrans = false;
        if ($sql === false) {
            echo "<div class=\"alert alert-danger\">Testing Transaction DB connection failed</div>";
        } else {
            echo "<div class=\"alert alert-success\">Testing Transaction DB connection succeeded</div>";
            $msgs = $this->create_trans_dbs($sql, $FANNIE_TRANS_DB, $FANNIE_OP_DB);
            foreach ($msgs as $msg) {
                if ($msg['error'] == 0) {
                    continue;
                }
                echo $msg['error_msg'] . '<br />';
            }
            $createdTrans = true;
        }
        if ($createdOps && $createdTrans) {
            // connected to both databases
            // collapse config fields
            $this->add_onload_command('$(\'#serverConfTable\').hide();');
        }
        ?>
        <hr />
        <?php 
        echo '<h4 class="install"><a href="" onclick="$(\'#archiveConfTable\').toggle(); return false;">Transaction Archiving</a> +</h4>';
        echo '<table id="archiveConfTable">';
        echo '<tr><td>Archive DB name</td>' . '<td>' . installTextField('FANNIE_ARCHIVE_DB', $FANNIE_ARCHIVE_DB, 'trans_archive') . '</td></tr>';
        echo '<tr><td>Archive Method</td>' . '<td>' . installSelectField('FANNIE_ARCHIVE_METHOD', $FANNIE_ARCHIVE_METHOD, array('partitions', 'tables'), 'partitions') . '</td></tr>';
        echo '</table>';
        //local archiving - set up now
        $sql = db_test_connect($FANNIE_SERVER, $FANNIE_SERVER_DBMS, $FANNIE_ARCHIVE_DB, $FANNIE_SERVER_USER, $FANNIE_SERVER_PW);
        if ($sql === false) {
            echo "<div class=\"alert alert-danger\">Testing Archive DB connection failed</div>";
        } else {
            echo "<div class=\"alert alert-success\">Testing Archive DB connection succeeded</div>";
            $msgs = $this->create_archive_dbs($sql, $FANNIE_ARCHIVE_DB, $FANNIE_ARCHIVE_METHOD);
            foreach ($msgs as $msg) {
                if ($msg['error'] == 0) {
                    continue;
                }
                echo $msg['error_msg'] . '<br />';
            }
            $this->add_onload_command('$(\'#archiveConfTable\').hide();');
        }
        ?>
        <hr />
        <h4 class="install">Lanes</h4>
        Number of lanes
        <?php 
        if (!isset($FANNIE_NUM_LANES)) {
            $FANNIE_NUM_LANES = 0;
        }
        if (isset($_REQUEST['FANNIE_NUM_LANES'])) {
            $FANNIE_NUM_LANES = $_REQUEST['FANNIE_NUM_LANES'];
        }
        confset('FANNIE_NUM_LANES', "{$FANNIE_NUM_LANES}");
        echo "<input type=text name=FANNIE_NUM_LANES value=\"{$FANNIE_NUM_LANES}\" size=3 />";
        ?>
        <br />
        <?php 
        if ($FANNIE_NUM_LANES == 0) {
            confset('FANNIE_LANES', 'array()');
        } else {
            ?>
        <script type=text/javascript>
        function showhide(i,num){
            for (var j=0; j<num; j++){
                if (j == i)
                    document.getElementById('lanedef'+j).style.display='block';
                else
                    document.getElementById('lanedef'+j).style.display='none';
            }
        }
        </script>
        <?php 
            echo "<select onchange=\"showhide(this.value,{$FANNIE_NUM_LANES});\">";
            for ($i = 0; $i < $FANNIE_NUM_LANES; $i++) {
                echo "<option value={$i}>Lane " . ($i + 1) . "</option>";
            }
            echo "</select><br />";
            $conf = 'array(';
            for ($i = 0; $i < $FANNIE_NUM_LANES; $i++) {
                $style = $i == 0 ? '' : 'class="collapse"';
                echo "<div id=\"lanedef{$i}\" {$style}>";
                if (!isset($FANNIE_LANES[$i])) {
                    $FANNIE_LANES[$i] = array();
                }
                $conf .= 'array(';
                if (!isset($FANNIE_LANES[$i]['host'])) {
                    $FANNIE_LANES[$i]['host'] = '127.0.0.1';
                }
                if (isset($_REQUEST["LANE_HOST_{$i}"])) {
                    $FANNIE_LANES[$i]['host'] = $_REQUEST["LANE_HOST_{$i}"];
                }
                $conf .= "'host'=>'{$FANNIE_LANES[$i]['host']}',";
                echo "Lane " . ($i + 1) . " Database Host: <input type=text name=LANE_HOST_{$i} value=\"{$FANNIE_LANES[$i]['host']}\" /><br />";
                if (!isset($FANNIE_LANES[$i]['type'])) {
                    $FANNIE_LANES[$i]['type'] = $defaultDbType;
                }
                if (isset($_REQUEST["LANE_TYPE_{$i}"])) {
                    $FANNIE_LANES[$i]['type'] = $_REQUEST["LANE_TYPE_{$i}"];
                }
                $conf .= "'type'=>'{$FANNIE_LANES[$i]['type']}',";
                echo "Lane " . ($i + 1) . " Database Type: <select name=LANE_TYPE_{$i}>";
                foreach ($supportedTypes as $val => $label) {
                    printf('<option value="%s" %s>%s</option>', $val, $FANNIE_LANES[$i]['type'] == $val ? 'selected' : '', $label);
                }
                echo "</select><br />";
                if (!isset($FANNIE_LANES[$i]['user'])) {
                    $FANNIE_LANES[$i]['user'] = '******';
                }
                if (isset($_REQUEST["LANE_USER_{$i}"])) {
                    $FANNIE_LANES[$i]['user'] = $_REQUEST["LANE_USER_{$i}"];
                }
                $conf .= "'user'=>'{$FANNIE_LANES[$i]['user']}',";
                echo "Lane " . ($i + 1) . " Database Username: <input type=text name=LANE_USER_{$i} value=\"{$FANNIE_LANES[$i]['user']}\" /><br />";
                if (!isset($FANNIE_LANES[$i]['pw'])) {
                    $FANNIE_LANES[$i]['pw'] = '';
                }
                if (isset($_REQUEST["LANE_PW_{$i}"])) {
                    $FANNIE_LANES[$i]['pw'] = $_REQUEST["LANE_PW_{$i}"];
                }
                $conf .= "'pw'=>'{$FANNIE_LANES[$i]['pw']}',";
                echo "Lane " . ($i + 1) . " Database Password: <input type=password name=LANE_PW_{$i} value=\"{$FANNIE_LANES[$i]['pw']}\" /><br />";
                if (!isset($FANNIE_LANES[$i]['op'])) {
                    $FANNIE_LANES[$i]['op'] = 'opdata';
                }
                if (isset($_REQUEST["LANE_OP_{$i}"])) {
                    $FANNIE_LANES[$i]['op'] = $_REQUEST["LANE_OP_{$i}"];
                }
                $conf .= "'op'=>'{$FANNIE_LANES[$i]['op']}',";
                echo "Lane " . ($i + 1) . " Operational DB: <input type=text name=LANE_OP_{$i} value=\"{$FANNIE_LANES[$i]['op']}\" /><br />";
                if (!isset($FANNIE_LANES[$i]['trans'])) {
                    $FANNIE_LANES[$i]['trans'] = 'translog';
                }
                if (isset($_REQUEST["LANE_TRANS_{$i}"])) {
                    $FANNIE_LANES[$i]['trans'] = $_REQUEST["LANE_TRANS_{$i}"];
                }
                $conf .= "'trans'=>'{$FANNIE_LANES[$i]['trans']}'";
                echo "Lane " . ($i + 1) . " Transaction DB: <input type=text name=LANE_TRANS_{$i} value=\"{$FANNIE_LANES[$i]['trans']}\" /><br />";
                $conf .= ")";
                echo "</div>";
                if ($i == $FANNIE_NUM_LANES - 1) {
                    $conf .= ")";
                } else {
                    $conf .= ",";
                }
            }
            confset('FANNIE_LANES', $conf);
        }
        ?>
        <a href="LaneConfigPages/index.php">Edit Global Lane Configuration Page</a>
        <hr />
        <h4 class="install">Logs &amp; Debugging</h4>
        Fannie writes to the following log files:
        <?php 
        if (!class_exists('LogViewer')) {
            include dirname(__FILE__) . '/../logs/LogViewer.php';
        }
        $log = new LogViewer();
        ?>
        <ul>
        <li><?php 
        check_writeable('../logs/fannie.log');
        ?>
            <ul>
            <li>Contains info, notice, warning, error, critical, alert, and emergency level messages.</li>
            <li>
            <a href="" onclick="$('#dayendLogView').toggle(); return false;">See Recent Entries</a>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="../logs/LogViewer.php?logfile=<?php 
        echo base64_encode('fannie.log');
        ?>
">View Entire Log</a>
            <?php 
        $dayend = $log->getLogFile('../logs/fannie.log', 100);
        ?>
            <pre id="dayendLogView" class="tailedLog highlight"><?php 
        echo $dayend;
        ?>
</pre>
            </li>
            <li>If this file is missing, messages may be written to legacy log file dayend.log</li>
            </ul>  
        <li><?php 
        check_writeable('../logs/debug_fannie.log');
        ?>
            <ul>
            <li>Contains debug level messages including failed queries and PHP notice/warning/error messages.</li>
            <li>
            <a href="" onclick="$('#dayendLogView').toggle(); return false;">See Recent Entries</a>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="../logs/LogViewer.php?logfile=<?php 
        echo base64_encode('debug_fannie.log');
        ?>
">View Entire Log</a>
            <?php 
        $dayend = $log->getLogFile('../logs/debug_fannie.log', 100);
        ?>
            <pre id="dayendLogView" class="tailedLog highlight"><?php 
        echo $dayend;
        ?>
</pre>
            </li>
            <li>If this file is missing, messages may be written to legacy log file php_errors.log &amp; queries.log</li>
            </ul>  
        </ul>
        <?php 
        echo '<div class="row form-group">
              <label class="control-label col-sm-2">Color-Highlighted Logs</label>
              <div class="col-sm-3">' . installSelectField('FANNIE_PRETTY_LOGS', $FANNIE_PRETTY_LOGS, array('true' => 'Yes', 'false' => 'No'), false, false) . '</div></div>';
        echo '<div class="row form-group">
                <label class="control-label col-sm-2">Log Rotation Count</label>
                <div class="col-sm-3">' . installTextField('FANNIE_LOG_COUNT', $FANNIE_LOG_COUNT, 5, false) . '</div></div>';
        $errorOpts = array(1 => 'Yes', 0 => 'No');
        if ($FANNIE_CUSTOM_ERRORS > 1) {
            $FANNIE_CUSTOM_ERRORS = 1;
        }
        echo '<div class="row form-group">
                <label class="control-label col-sm-2">Verbose Debug Messages</label>
                <div class="col-sm-3">' . installSelectField('FANNIE_CUSTOM_ERRORS', $FANNIE_CUSTOM_ERRORS, $errorOpts, false, false) . '</div></div>';
        $taskOpts = array(99 => 'Never email on error', 0 => 'Emergency', 1 => 'Alert', 2 => 'Critical', 3 => 'Error', 4 => 'Warning', 5 => 'Notice', 6 => 'Info', 7 => 'Debug');
        echo '<div class="row form-group">
                <label class="control-label col-sm-2">Task Error Severity resulting in emails</label>
                <div class="col-sm-3">' . installSelectField('FANNIE_TASK_THRESHOLD', $FANNIE_TASK_THRESHOLD, $taskOpts, 99, false) . '</div></div>';
        echo '<p>
            CORE can send logs to a remote syslog server if a host name or IP
            is provided.
            </p>';
        echo '<div class="row form-group">
            <label class="control-label col-sm-2">Remote Syslog Host</label>
            <div class="col-sm-3">' . installTextField('FANNIE_SYSLOG_SERVER', $FANNIE_SYSLOG_SERVER) . '</div>
            </div>';
        echo '<div class="row form-group">
            <label class="control-label col-sm-2">Remote Syslog Port</label>
            <div class="col-sm-3">' . installTextField('FANNIE_SYSLOG_PORT', $FANNIE_SYSLOG_PORT, 514) . '</div>
            </div>';
        echo '<div class="row form-group">
            <label class="control-label col-sm-2">Remote Syslog Protocol</label>
            <div class="col-sm-3">' . installSelectField('FANNIE_SYSLOG_PROTOCOL', $FANNIE_SYSLOG_PROTOCOL, array('tcp', 'udp'), 'udp') . '</div>
            </div>';
        ?>
        <hr />
        <h4 class="install">Co-op</h4>
        Use this to identify code that is specific to your co-op.
        <br />Particularly important if you plan to contribute to the CORE IT code base.
        <br />Try to use a code that will not be confused with any other, e.g. "WEFC_Toronto" instead of "WEFC".
        <br />Co-op ID: 
        <?php 
        echo installTextField('FANNIE_COOP_ID', $FANNIE_COOP_ID);
        ?>
        <br />Home Page (URL)
        <br />Normally the item editor is displayed by default but another page or site can
        be designated instead.
        <?php 
        echo installTextField('FANNIE_HOME_PAGE', $FANNIE_HOME_PAGE, 'item/ItemEditorPage.php');
        ?>

        <hr />
        <h4 class="install">Locale</h4>
        Set the Country and Language where Fannie will run.
        <br />If these are not set in Fannie configuration but are set in the Linux environment the environment values will be used as
        defaults that can be overridden by settings here.

        <?php 
        echo '<br />Country: ';
        //Use I18N country codes.
        $countries = array("US" => "USA", "CA" => "Canada");
        echo installSelectField('FANNIE_COUNTRY', $FANNIE_COUNTRY, $countries, '');
        echo '<br />Language: ';
        //Use I18N language codes.
        $langs = array("en" => "English", "fr" => "French", "sp" => "Spanish");
        echo installSelectField('FANNIE_LANGUAGE', $FANNIE_LANGUAGE, $langs, '');
        ?>
        <hr />
        <h4 class="install">Back Office Transactions</h4>
        <i>Values used when generating transaction data via Fannie
        instead of through an actual POS terminal. The corrections department
        is only used for balancing individual transactions. Total sales
        to that department via generated transactions should always be
        zero. The catch-all department is used when generated transactions
        will generate a sale (or refund) but it is not known where the 
        amount belongs for accounting purposes.
        </i><br />
        <?php 
        echo '<table>';
        echo '<tr><td>Employee#</td>' . '<td>' . installTextField('FANNIE_EMP_NO', $FANNIE_EMP_NO, 1001, false) . '</td></tr>';
        echo '<tr><td>Register#</td>' . '<td>' . installTextField('FANNIE_REGISTER_NO', $FANNIE_REGISTER_NO, 30, false) . '</td></tr>';
        echo '<tr><td>Corrections Dept#</td>' . '<td>' . installTextField('FANNIE_CORRECTION_DEPT', $FANNIE_CORRECTION_DEPT, 800, false) . '</td></tr>';
        echo '<tr><td>Patronage Transfer Dept#</td>' . '<td>' . installTextField('FANNIE_PATRONAGE_DEPT', $FANNIE_PATRONAGE_DEPT, 800, false) . '</td></tr>';
        echo '<tr><td>Catch-all Dept#</td>' . '<td>' . installTextField('FANNIE_MISC_DEPT', $FANNIE_MISC_DEPT, 800, false) . '</td></tr>';
        echo '</table>';
        ?>
        <hr />
        <p>
            <button type="submit" class="btn btn-default">Save Configuration</button>
        </p>
        </form>


        <?php 
        return ob_get_clean();
        // body_content()
    }
Ejemplo n.º 5
0
}

if ( (file_exists("./installed")&&is_file("./installed")) || (substr(dirname(__FILE__), -4, 4)=='/smu' && (file_exists("../installed")&&is_file("../installed"))) ) {
	$step = 10;
}

if ( (file_exists("./restore")&&is_file("./restore")) || (substr(dirname(__FILE__), -4, 4)=='/smu' && (file_exists("../restore")&&is_file("../restore"))) ) {
	$step = 20;
}

if (!check_allow_remote_files()) {
	$step = 11;
	$error_header = 'Удаленные соединения запрещены';
	$error_content = 'Подробнее об ошибке: <a href="http://errors.umi-cms.ru/13041/" target="_blank">http://errors.umi-cms.ru/13041/</a>';
}
elseif ( ($errors=check_writeable()) && (count($errors)>0) ) {
	$step = 11;
	$error_header = 'Проверьте разрешения на запись';
	$error_content = 'Перечисленные файлы и папки должны быть доступны на запись:<ol>';
	foreach($errors as $path) {
		$error_content .= "<li>{$path}</li>";
	}
	$error_content .= "</ol>";
}

$sleep = get_sleep_time();

function getTrialKey() {
	$email = rawurlencode(trim($_REQUEST['email']));
	$lname = rawurlencode(trim($_REQUEST['lname']));
	$fname = rawurlencode(trim($_REQUEST['fname']));
Ejemplo n.º 6
0
 function Config()
 {
     if (file_exists(CONFIG)) {
         $this->read();
     } else {
         // Default-Werte eintragen
         $this->items = array();
         $this->set('ELMAR_MODULE_ONE_TIME_INSTALL', FALSE);
         $this->set('WRITE_PRODUCTFILE', productAnz() > 1000 && check_writeable(PRODUCTFILE));
         $this->set('WRITE_REQUESTLOG', FALSE);
         $this->set('WRITE_ERRORLOG', FALSE);
         $this->set('WRITE_PRODUCTLOG', FALSE);
         $this->set('LOGFORMAT', 'TXT');
         $this->set('MD5_CHECKSUM', '');
         $this->set('REGISTERED', FALSE);
         $this->set('CAN_WRITE', TRUE);
         $this->set('SHOPINFO_XML_URL', '');
         $this->set('SHOPINFO_XML_FILE', '');
         $this->set('ELMAR_PASSWORD', '');
     }
 }
Ejemplo n.º 7
0
/***************************************************************************/
/* do not modify anything below! */
define("GOOD", "<span style='color:green;font-weight:bold;'>GOOD</span>");
define("OK", "<span style='color:black;background-color:yellow;'>OK</span>");
define("BAD", "<span style='color:red;font-weight:bold;'>BAD!</span>");
/* -----------------------------------------------------------------*/
echo "<html><head><title>Installer V0.1alpha - Unipress</title>" . "<link rel=\"stylesheet\" type=\"text/css\" href=\"mycss.css\" />" . "<body>" . "<br><br><b>Checking for installation-dependencies:</b><pre>";
if (!(array_key_exists("installation", $_REQUEST) && $_REQUEST['installation'] == "start")) {
    /* OS Test */
    $STOPP = false;
    $Cos = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? OK . " (Windows)" : GOOD . " (Linux or other)";
    echo "\nOperation System\t\t\t" . $Cos;
    /* FileSystem Test*/
    require_once "../include/check_writeable.inc.php";
    $Clogdir = check_writeable($fullpath, "logs", false) == true ? GOOD : BAD . " \n\t <span class='hint'>try: chmod 777 logs/</span>\n";
    $Cuploaddir = check_writeable($fullpath, "uploaded", false) == true ? GOOD : BAD . " \n\t <span class='hint'>try: chmod 777 uploaded/</span>\n";
    if ($Clogdir != GOOD || $Cuploaddir != GOOD) {
        $STOPP = true;
    }
    echo "\n\nFilesystem" . "\n\tlog-dir is writeable\t\t" . $Clogdir . "\n\tupload-dir is writeable\t\t" . $Cuploaddir;
    /* MYSQL Test */
    require_once "../include/cbmysql.class.php";
    // MySQL Module detector
    check_mysql_interface("LOAD_MYSQLI");
    echo "\n\nDatabase-Connection" . "\n\tPHP-Module\t\t\t";
    if (defined('LOAD_MYSQLI')) {
        echo GOOD . " (MySQL<b>I</b>)";
    } else {
        echo OK . " (MySQL)";
        echo "\n\t <span class='hint'>This is not the best way, but it works. " . "\n\t You should upgrade to MySQL4.1 and " . "PHP5 with <a href=\"http://php.net/mysqli\">mysql<b>i</b></a> " . "as MySQL handler.</span>\n";
    }
Ejemplo n.º 8
0
function ensure_writable_dir($dir)
{
    /*returns:
    	 	0 if $dir exists and is writeable
    		1 if $dir could be created writeable
    		2 if $dir does exists but is not writeable
    		3 if $dir could be created but is not writeable
    		4 if $dir does not exists and could not be created
    		
    	 
    	*/
    if (is_dir("./" . $dir)) {
        if (check_writeable($dir)) {
            return 0;
        } else {
            return 2;
        }
    } else {
        if (@makedir($dir)) {
            // dir created
            if (check_writeable($dir)) {
                return 1;
            } else {
                return 3;
            }
        } else {
            // dir not creatable
            return 4;
        }
    }
}
Ejemplo n.º 9
0
"><code><?php 
echo ELMAR_SHOP_ROOT_DIR . 'elmar_products.php';
?>
</code></a> automatisch die Produktdatei <code class="data"><?php 
echo DIR_FS_CATALOG . PRODUCTFILE;
?>
</code> erzeugt werden soll.
      Dies ist insbesondere dann sinnvoll, wenn der Server nicht der Schnellste ist, die Produktdaten sehr h&auml;ufig abgerufen werden oder der Shop sehr viele Produkte f&uuml;hrt. Anfragen an die URL werden dann gem&auml;&szlig; <CODE>UPDATEINTERVAL</CODE>-Einstellung f&uuml;r <?php 
echo UPDATEINTERVAL;
?>
&nbsp;Sekunden (<?php 
echo number_format(UPDATEINTERVAL / 3600, 1, ',', '');
?>
&nbsp;Stunden) effizient durch Weiterleitung auf die generierte Produktdatei beantwortet. Danach erfolgt automatisch eine Aktualisierung der Produktdatei beim Abruf. Solange alle Preisvergleichsdienste die obige URL benutzen, brauchen Sie sich also nicht mehr um die Aktualisierung der Produktdatei zu k&uuml;mmern!
      <?php 
if (!check_writeable(PRODUCTFILE)) {
    ?>
        <br><span style="color:red">Achtung:
        <?php 
    if (file_exists(dirname(PRODUCTFILE))) {
        ?>
          F&uuml;r die Produktdatei <code><?php 
        echo PRODUCTFILE;
        ?>
</code> fehlen Schreibrechte.
        <?php 
    } else {
        ?>
          Das Verzeichnis <code><?php 
        echo dirname(PRODUCTFILE);
        ?>