Ejemplo n.º 1
0
function install_content(&$a)
{
    global $install_wizard_pass, $db;
    $o = '';
    $wizard_status = "";
    $install_title = t('Friendica Social Communications Server - Setup');
    if (x($a->data, 'db_conn_failed')) {
        $install_wizard_pass = 2;
        $wizard_status = t('Could not connect to database.');
    }
    if (x($a->data, 'db_create_failed')) {
        $install_wizard_pass = 2;
        $wizard_status = t('Could not create table.');
    }
    $db_return_text = "";
    if (x($a->data, 'db_installed')) {
        $txt = '<p style="font-size: 130%;">';
        $txt .= t('Your Friendica site database has been installed.') . EOL;
        $db_return_text .= $txt;
    }
    if (x($a->data, 'db_failed')) {
        $txt = t('You may need to import the file "database.sql" manually using phpmyadmin or mysql.') . EOL;
        $txt .= t('Please see the file "INSTALL.txt".') . EOL . "<hr>";
        $txt .= "<pre>" . $a->data['db_failed'] . "</pre>" . EOL;
        $db_return_text .= $txt;
    }
    if ($db && $db->connected) {
        $r = q("SELECT COUNT(*) as `total` FROM `user`");
        if ($r && count($r) && $r[0]['total']) {
            $tpl = get_markup_template('install.tpl');
            return replace_macros($tpl, array('$title' => $install_title, '$pass' => '', '$status' => t('Permission denied.'), '$text' => ''));
        }
    }
    if (x($a->data, 'txt') && strlen($a->data['txt'])) {
        $db_return_text .= manual_config($a);
    }
    if ($db_return_text != "") {
        $tpl = get_markup_template('install.tpl');
        return replace_macros($tpl, array('$title' => $install_title, '$pass' => "", '$text' => $db_return_text . what_next()));
    }
    switch ($install_wizard_pass) {
        case 1:
            // System check
            $checks = array();
            check_funcs($checks);
            check_htconfig($checks);
            check_smarty3($checks);
            check_keys($checks);
            if (x($_POST, 'phpath')) {
                $phpath = notags(trim($_POST['phpath']));
            }
            check_php($phpath, $checks);
            check_htaccess($checks);
            function check_passed($v, $c)
            {
                if ($c['required']) {
                    $v = $v && $c['status'];
                }
                return $v;
            }
            $checkspassed = array_reduce($checks, "check_passed", true);
            $tpl = get_markup_template('install_checks.tpl');
            $o .= replace_macros($tpl, array('$title' => $install_title, '$pass' => t('System check'), '$checks' => $checks, '$passed' => $checkspassed, '$see_install' => t('Please see the file "INSTALL.txt".'), '$next' => t('Next'), '$reload' => t('Check again'), '$phpath' => $phpath, '$baseurl' => $a->get_baseurl()));
            return $o;
            break;
        case 2:
            // Database config
            $dbhost = x($_POST, 'dbhost') ? notags(trim($_POST['dbhost'])) : 'localhost';
            $dbuser = notags(trim($_POST['dbuser']));
            $dbpass = notags(trim($_POST['dbpass']));
            $dbdata = notags(trim($_POST['dbdata']));
            $phpath = notags(trim($_POST['phpath']));
            $tpl = get_markup_template('install_db.tpl');
            $o .= replace_macros($tpl, array('$title' => $install_title, '$pass' => t('Database connection'), '$info_01' => t('In order to install Friendica we need to know how to connect to your database.'), '$info_02' => t('Please contact your hosting provider or site administrator if you have questions about these settings.'), '$info_03' => t('The database you specify below should already exist. If it does not, please create it before continuing.'), '$status' => $wizard_status, '$dbhost' => array('dbhost', t('Database Server Name'), $dbhost, ''), '$dbuser' => array('dbuser', t('Database Login Name'), $dbuser, ''), '$dbpass' => array('dbpass', t('Database Login Password'), $dbpass, ''), '$dbdata' => array('dbdata', t('Database Name'), $dbdata, ''), '$adminmail' => array('adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.')), '$lbl_10' => t('Please select a default timezone for your website'), '$baseurl' => $a->get_baseurl(), '$phpath' => $phpath, '$submit' => t('Submit')));
            return $o;
            break;
        case 3:
            // Site settings
            require_once 'include/datetime.php';
            $dbhost = x($_POST, 'dbhost') ? notags(trim($_POST['dbhost'])) : 'localhost';
            $dbuser = notags(trim($_POST['dbuser']));
            $dbpass = notags(trim($_POST['dbpass']));
            $dbdata = notags(trim($_POST['dbdata']));
            $phpath = notags(trim($_POST['phpath']));
            $adminmail = notags(trim($_POST['adminmail']));
            $timezone = x($_POST, 'timezone') ? $_POST['timezone'] : 'America/Los_Angeles';
            $tpl = get_markup_template('install_settings.tpl');
            $o .= replace_macros($tpl, array('$title' => $install_title, '$pass' => t('Site settings'), '$status' => $wizard_status, '$dbhost' => $dbhost, '$dbuser' => $dbuser, '$dbpass' => $dbpass, '$dbdata' => $dbdata, '$phpath' => $phpath, '$adminmail' => array('adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.')), '$timezone' => field_timezone('timezone', t('Please select a default timezone for your website'), $timezone, ''), '$baseurl' => $a->get_baseurl(), '$submit' => t('Submit')));
            return $o;
            break;
    }
}
Ejemplo n.º 2
0
function checkConfig($config)
{
    umask(011);
    $dir = getcwd();
    if (!file_exists("config.php") && !is_writable(".")) {
        print "<h3 class='warn'>" . _t("Please change the permission of some directories writable on your server to initialize your Wiki.") . "</h3>\n";
        print "<pre class='console'>\n<font color='green'>\$</font> chmod <b>777</b> {$dir}/data/ {$dir}\n</pre>\n";
        print sprintf(_t("If you want a more safe wiki, try to change the permission of directories with %s."), "<font color='red'>2777(setgid).</font>\n");
        print "<pre class='console'>\n<font color='green'>\$</font> chmod <b>2777</b> {$dir}/data/ {$dir}\n</pre>\n";
        print _t("or use <tt>monisetup.sh</tt> and select 777 or <font color='red'>2777</font>");
        print "<pre class='console'>\n<font color='green'>\$</font> sh monisetup.sh</pre>\n";
        print _t("After execute one of above two commands, just <a href='monisetup.php'>reload this <tt>monisetup.php</tt></a> would make a new initial <tt>config.php</tt> with detected parameters for your wiki.") . "\n<br/>";
        print "<h2><a href='monisetup.php?step=agree'>" . _t("Reload") . "</a></h2>";
        exit;
    } else {
        if (file_exists("config.php")) {
            print "<p class='notice'><span class='warn'>" . _t("WARN") . ":</span> " . _t("Please execute the following command after you have completed your configuration.") . "</p>\n";
            print "<pre class='console'>\n<font color='green'>\$</font> sh secure.sh\n</pre>\n";
            if (is_writable('config.php')) {
                if (empty($config['admin_passwd'])) {
                    print "<h2 class='warn'>" . _t("WARN: You have to enter your Admin Password") . "</h2>\n";
                } else {
                    $owner = fileowner('.');
                    print "<h2 class='warn'>" . _t("WARN: If you have any permission to execute 'secure.sh'. press the following button") . "</h2>\n";
                    $msg = _t("Protect my config.php now!");
                    echo <<<FORM
<form method='post' action=''>
<div class='protect'><input type='hidden' name='action' value='protect' /><input type='submit' name='protect' value='{$msg}' /></div>
</form>
FORM;
                }
            }
        }
    }
    if (file_exists("config.php")) {
        if (!is_writable($config['data_dir'])) {
            if (02000 & fileperms(".")) {
                # check sgid
                $datadir_perm = 02777;
            } else {
                $datadir_perm = 0777;
            }
            $datadir_perm = decoct($datadir_perm);
            print "<h3 class='error'>" . sprintf(_t("FATAL: %s directory is not writable"), $config['data_dir']) . "</h3>\n";
            print "<h4>" . _t("Please execute the following command.") . "</h4>";
            print "<pre class='console'>\n" . "<font color='green'>\$</font> chmod {$datadir_perm} {$config['data_dir']}\n</pre>\n";
            exit;
        }
        $data_sub_dir = array("cache", "user", "text");
        if (02000 & fileperms($config['data_dir'])) {
            $DPERM = 0775;
        } else {
            $DPERM = 0777;
        }
        foreach ($data_sub_dir as $dir) {
            if (!file_exists("{$config['data_dir']}/{$dir}")) {
                umask(00);
                mkdir("{$config['data_dir']}/{$dir}", $DPERM);
                if ($dir == 'text') {
                    mkdir($config['data_dir'] . "/{$dir}/RCS", $DPERM);
                }
            } else {
                if (!is_writable("{$config['data_dir']}/{$dir}")) {
                    print "<h4 class='warn'>" . sprintf(_t("%s directory is not writable"), $dir) . "</h4>\n";
                    print "<pre class='console'>\n" . "<font color='green'>\$</font> chmod a+w {$config[$file]}\n</pre>\n";
                }
            }
        }
        $writables = array("upload_dir", 'cache_public_dir', "editlog_name");
        $is_apache = preg_match('/apache/i', $_SERVER['SERVER_SOFTWARE']);
        $port = $_SERVER['SERVER_PORT'] != 80 ? $_SERVER['SERVER_PORT'] : 80;
        $path = preg_replace('/monisetup\\.php/', '', $_SERVER['SCRIPT_NAME']);
        if (preg_match('/^\\d+\\.\\d+\\.\\d+\\.\\d+$/', $_SERVER['SERVER_ADDR'])) {
            $host = $_SERVER['SERVER_ADDR'];
        } else {
            $host = $_SERVER['SERVER_NAME'];
        }
        print '<div class="check">';
        foreach ($writables as $file) {
            if (empty($config[$file])) {
                continue;
            }
            if (!is_writable($config[$file])) {
                if (file_exists($config[$file])) {
                    print "<h3 class='warn'>" . sprintf(_t("%s is not writable"), $config[$file]) . " :( </h3>\n";
                    print "<pre class='console'>\n" . "<font color='green'>\$</font> chmod a+w {$config[$file]}\n</pre>\n";
                } else {
                    if (preg_match("/_dir/", $file)) {
                        umask(00);
                        mkdir($config[$file], $DPERM);
                        print "<h3>&nbsp;&nbsp;<font color=blue>" . sprintf(_t("%s is created now"), $config[$file]) . "</font> :)</h3>\n";
                    } else {
                        $fp = @fopen($config[$file], "w+");
                        if ($fp) {
                            chmod($config[$file], 0666);
                            fclose($fp);
                            print "<h4><font color='green'>" . sprintf(_t("%s is created now"), $config[$file]) . "</font> ;) </h4>\n";
                        } else {
                            print "<pre class='console'>\n" . "<font color='green'>\$</font> touch {$config[$file]}\n" . "<font color='green'>\$</font> chmod a+w {$config[$file]}\n</pre>\n";
                        }
                    }
                }
                $error = 1;
            } else {
                print "<h3><font color=blue>" . sprintf(_t("%s is writable"), $config[$file]) . "</font> :)</h3>\n";
            }
        }
        if ($is_apache && is_dir($config['upload_dir'])) {
            echo "<div class='helpicon'><a href='http://moniwiki.kldp.net/wiki.php/.htaccess'>?</a></div>";
            $chk = array('AddType' => "AddType text/plain .sh .cgi .pl .py .php .php3 .php4 .phtml .html\n", 'ForceType' => "<Files ~ '\\.(php.?|pl|py|cgi)\$'>\nForceType text/plain\n</Files>\n", 'php_value' => "AddType text/plain .php\nphp_value engine off\n", 'NoExecCGI' => "#Options NoExecCGI\n");
            $re = array('@^HTTP/1.1\\s+\\d+\\s+OK$@' => 1, '@^HTTP/1.1\\s+500\\s+@' => -1, '@^Content-Type: text/plain@' => 2, '@^Content-Type: text/html@' => 0);
            if (file_exists($config['upload_dir'] . '/.htaccess')) {
                print '<h3>' . sprintf(_t("If you want to check .htaccess file please delete '%s' file and reload it."), $config['upload_dir'] . '/.htaccess') . '</h3>';
            } else {
                print '<h3>' . _t("Security check for 'upload_dir'.") . '</h3>';
                $fp = fopen('pds/test.php', 'w');
                if (is_resource($fp)) {
                    fwrite($fp, "<?php echo 'HelloWorld';");
                    fclose($fp);
                }
                echo "<div class='log'>";
                $work = check_htaccess($chk, $re, $host, $port, $path . '/' . $config['upload_dir'] . '/test.php', $config['upload_dir']);
                echo "</div>";
                $fp = @fopen('pds_htaccess', 'w');
                if (is_resource($fp)) {
                    fwrite($fp, implode('', $work));
                    fclose($fp);
                } else {
                    echo _t("Unable to open .htaccess");
                }
                @unlink('pds/test.php');
            }
            #
            $chk2 = array('ErrorDocument' => "#ErrorDocument 404 " . $config['url_prefix'] . '/imgs/moni/inter.png' . "\n");
            $re = array('@^HTTP/1.1\\s+\\d+\\s+OK$@' => 1, '@^HTTP/1.1\\s+500\\s+@' => -1, '@^HTTP/1.1\\s+404\\s+@' => 2, '@^Content-Type: text/png@' => 2);
            if (is_dir('imgs') and !file_exists($config['upload_dir'] . '/.htaccess')) {
                print '<h3>' . _t(".htaccess for 'imgs_dir'.") . '</h3>';
                echo "<div class='log'>";
                $work = check_htaccess($chk2, $re, $host, $port, $path . '/' . $config['upload_dir'] . '/nonexists.png', $config['upload_dir']);
                echo "</div>";
                $fp = @fopen('imgs_htaccess', 'w');
                if (is_resource($fp)) {
                    fwrite($fp, implode('', $work));
                    fclose($fp);
                } else {
                    echo _t("Unable to open .htaccess");
                }
            }
        }
        print "</div>\n";
    }
}
Ejemplo n.º 3
0
<?php

if (!headers_sent()) {
    header('X-Powered-By: arcanum');
}
require_once 'config.php';
$request = array_merge($_GET, $_POST);
if (!isset($request['module'])) {
    if ($config['checkhtaccess'] == TRUE) {
        check_htaccess();
    }
    //there are a lot of useful functions like: check_environment() and test_arcanum_db()
    redirect('login');
} else {
    $module = strtolower(trim($request['module']));
}
try {
    if ($config['log_stats'] === TRUE) {
        $t = new measure_time();
    }
    check_environment();
    $instance = new $module();
    $is_auth = $instance->authenticate();
    if ($is_auth === TRUE) {
        //Check if user can be authenticated or is authenticated
        $instance->bootstrap($request);
        isset($request['action']) ? $action = strtolower(trim($request['action'])) : ($action = 'show');
        $instance->execute($action);
        $instance->dispatch();
        $instance->cooldown();
    } else {
Ejemplo n.º 4
0
        }
    }
    $form->addElement('hidden', 'submitted', 1);
    $form->addRule('tos1', __('Field required'), 'required');
    $form->addRule('tos2', __('Field required'), 'required');
    $form->addRule('tos3', __('Field required'), 'required');
    $form->addRule('tos4', __('Field required'), 'required');
    isset($_GET['submitted']) && $_GET['submitted'] && $form->validate();
    $form->addElement('submit', null, __('Next'));
    $form->setRequiredNote('<span class="required_note_star">*</span> <span class="required_note">' . __('denotes required field') . '</span>');
    $form->display();
    print '</div>';
} elseif (!isset($_GET['htaccess'])) {
    ob_start();
    print '<h1>' . __('Welcome to EPESI setup!') . '<br></h1><h2>' . __('Hosting compatibility') . ':</h2><br><div class="license">';
    if (check_htaccess()) {
        $_GET['htaccess'] = 1;
        ob_end_clean();
    } else {
        print '</div><br><a class="button" href="setup.php?license=1&htaccess=1&install_lang=' . $install_lang_load . '">' . __('Ok') . '</a>';
        ob_end_flush();
    }
}
if (isset($_GET['htaccess']) && isset($_GET['license'])) {
    set_header(__('Configuration'));
    $form = new HTML_QuickForm('serverform', 'post', $_SERVER['PHP_SELF'] . '?' . http_build_query($_GET));
    $form->addElement('header', null, __('Database server settings'));
    $form->addElement('text', 'host', __('Database server address'));
    $form->addRule('host', __('Field required'), 'required');
    $form->addElement('text', 'port', __('Custom database port'));
    $form->addElement('select', 'engine', __('Database engine'), array('postgres' => 'PostgreSQL', 'mysqlt' => 'MySQL'));
Ejemplo n.º 5
0
/**
 * @brief Get output for the setup page.
 *
 * Depending on the state we are currently in it returns different content.
 *
 * @param App &$a
 * @return string parsed HTML output
 */
function setup_content(&$a)
{
    global $install_wizard_pass, $db;
    $o = '';
    $wizard_status = '';
    $install_title = t('$Projectname Server - Setup');
    if (x(App::$data, 'db_conn_failed')) {
        $install_wizard_pass = 2;
        $wizard_status = t('Could not connect to database.');
    }
    if (x(App::$data, 'url_fail')) {
        $install_wizard_pass = 3;
        $wizard_status = t('Could not connect to specified site URL. Possible SSL certificate or DNS issue.');
        if (App::$data['url_error']) {
            $wizard_status .= ' ' . App::$data['url_error'];
        }
    }
    if (x(App::$data, 'db_create_failed')) {
        $install_wizard_pass = 2;
        $wizard_status = t('Could not create table.');
    }
    $db_return_text = '';
    if (x(App::$data, 'db_installed')) {
        $txt = '<p style="font-size: 130%;">';
        $txt .= t('Your site database has been installed.') . EOL;
        $db_return_text .= $txt;
    }
    if (x(App::$data, 'db_failed')) {
        $txt = t('You may need to import the file "install/schema_xxx.sql" manually using a database client.') . EOL;
        $txt .= t('Please see the file "install/INSTALL.txt".') . EOL . "<hr>";
        $txt .= "<pre>" . App::$data['db_failed'] . "</pre>" . EOL;
        $db_return_text .= $txt;
    }
    if ($db && $db->connected) {
        $r = q("SELECT COUNT(*) as `total` FROM `account`");
        if ($r && count($r) && $r[0]['total']) {
            $tpl = get_markup_template('install.tpl');
            return replace_macros($tpl, array('$title' => $install_title, '$pass' => '', '$status' => t('Permission denied.'), '$text' => ''));
        }
    }
    if (x(App::$data, 'txt') && strlen(App::$data['txt'])) {
        $db_return_text .= manual_config($a);
    }
    if ($db_return_text != "") {
        $tpl = get_markup_template('install.tpl');
        return replace_macros($tpl, array('$title' => $install_title, '$pass' => '', '$text' => $db_return_text . what_next()));
    }
    switch ($install_wizard_pass) {
        case 1:
            // System check
            $checks = array();
            check_funcs($checks);
            check_htconfig($checks);
            check_store($checks);
            check_smarty3($checks);
            check_keys($checks);
            if (x($_POST, 'phpath')) {
                $phpath = notags(trim($_POST['phpath']));
            }
            check_php($phpath, $checks);
            check_phpconfig($checks);
            check_htaccess($checks);
            function check_passed($v, $c)
            {
                if ($c['required']) {
                    $v = $v && $c['status'];
                }
                return $v;
            }
            $checkspassed = array_reduce($checks, "check_passed", true);
            $tpl = get_markup_template('install_checks.tpl');
            $o .= replace_macros($tpl, array('$title' => $install_title, '$pass' => t('System check'), '$checks' => $checks, '$passed' => $checkspassed, '$see_install' => t('Please see the file "install/INSTALL.txt".'), '$next' => t('Next'), '$reload' => t('Check again'), '$phpath' => $phpath, '$baseurl' => z_root()));
            return $o;
            break;
        case 2:
            // Database config
            $dbhost = x($_POST, 'dbhost') ? notags(trim($_POST['dbhost'])) : '127.0.0.1';
            $dbuser = notags(trim($_POST['dbuser']));
            $dbport = intval(notags(trim($_POST['dbport'])));
            $dbpass = notags(trim($_POST['dbpass']));
            $dbdata = notags(trim($_POST['dbdata']));
            $dbtype = intval(notags(trim($_POST['dbtype'])));
            $phpath = notags(trim($_POST['phpath']));
            $adminmail = notags(trim($_POST['adminmail']));
            $siteurl = notags(trim($_POST['siteurl']));
            $tpl = get_markup_template('install_db.tpl');
            $o .= replace_macros($tpl, array('$title' => $install_title, '$pass' => t('Database connection'), '$info_01' => t('In order to install $Projectname we need to know how to connect to your database.'), '$info_02' => t('Please contact your hosting provider or site administrator if you have questions about these settings.'), '$info_03' => t('The database you specify below should already exist. If it does not, please create it before continuing.'), '$status' => $wizard_status, '$dbhost' => array('dbhost', t('Database Server Name'), $dbhost, t('Default is 127.0.0.1')), '$dbport' => array('dbport', t('Database Port'), $dbport, t('Communication port number - use 0 for default')), '$dbuser' => array('dbuser', t('Database Login Name'), $dbuser, ''), '$dbpass' => array('dbpass', t('Database Login Password'), $dbpass, ''), '$dbdata' => array('dbdata', t('Database Name'), $dbdata, ''), '$dbtype' => array('dbtype', t('Database Type'), $dbtype, '', array(0 => 'MySQL', 1 => 'PostgreSQL')), '$adminmail' => array('adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.')), '$siteurl' => array('siteurl', t('Website URL'), z_root(), t('Please use SSL (https) URL if available.')), '$lbl_10' => t('Please select a default timezone for your website'), '$baseurl' => z_root(), '$phpath' => $phpath, '$submit' => t('Submit')));
            return $o;
            break;
        case 3:
            // Site settings
            require_once 'include/datetime.php';
            $dbhost = x($_POST, 'dbhost') ? notags(trim($_POST['dbhost'])) : '127.0.0.1';
            $dbport = intval(notags(trim($_POST['dbuser'])));
            $dbuser = notags(trim($_POST['dbuser']));
            $dbpass = notags(trim($_POST['dbpass']));
            $dbdata = notags(trim($_POST['dbdata']));
            $dbtype = intval(notags(trim($_POST['dbtype'])));
            $phpath = notags(trim($_POST['phpath']));
            $adminmail = notags(trim($_POST['adminmail']));
            $siteurl = notags(trim($_POST['siteurl']));
            $timezone = x($_POST, 'timezone') ? $_POST['timezone'] : 'America/Los_Angeles';
            $tpl = get_markup_template('install_settings.tpl');
            $o .= replace_macros($tpl, array('$title' => $install_title, '$pass' => t('Site settings'), '$status' => $wizard_status, '$dbhost' => $dbhost, '$dbport' => $dbport, '$dbuser' => $dbuser, '$dbpass' => $dbpass, '$dbdata' => $dbdata, '$phpath' => $phpath, '$dbtype' => $dbtype, '$adminmail' => array('adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.')), '$siteurl' => array('siteurl', t('Website URL'), z_root(), t('Please use SSL (https) URL if available.')), '$advanced' => array('advanced', t('Enable $Projectname <strong>advanced</strong> features?'), 1, t('Some advanced features, while useful - may be best suited for technically proficient audiences')), '$timezone' => array('timezone', t('Please select a default timezone for your website'), $timezone, '', get_timezones()), '$baseurl' => z_root(), '$submit' => t('Submit')));
            return $o;
            break;
    }
}
}
if ($error_count == count($folder_list)) {
    $permissions_module['status'] = 20;
}
if ($permissions_module['status'] == 0) {
    $permissions_module['anchor'] = 'access';
    $permissions_module['heading'] = 'Access';
} elseif ($permissions_module['status'] == 10) {
    $permissions_module['anchor'] = 'access';
    $permissions_module['heading'] = 'Access';
} else {
    $permissions_module['anchor'] = 'access';
    $permissions_module['heading'] = 'Access';
}
/////////// Permissions check
$htaccess_status = check_htaccess($htaccess_string);
if ($htaccess_status['status'] == 'aok') {
    $htaccess_module['status'] = 0;
    $htaccess_module['anchor'] = 'htaccess';
    $htaccess_module['heading'] = 'Routes';
    $htaccess_module['report'] = '<p>.htaccess file found.</p>';
} else {
    $htaccess_module['status'] = 1;
    $htaccess_module['anchor'] = 'htaccess';
    $htaccess_module['heading'] = 'Routes';
    $htaccess_module['report'] = '<p>.htaccess file not found.</p>';
}
/////////// Display
// Group
$report = display_module($permissions_module, $link);
$view->group_h2($report[1] . ' Permissions');
Ejemplo n.º 7
0
* Version 0.897
* Author:  IT-Master GmbH
* www.it-master.ch / info@it-master.ch
* Copyright (c), IT-Master GmbH, All rights reserved
*******************************************************************************/
//--------------------------------------------------------------
//zip - Pfad überprüfen und erstellen falls nicht vorhanden
//--------------------------------------------------------------
$_tmppfad = "./Data/" . $_user->_ordnerpfad . "/img/";
if (!file_exists($_tmppfad)) {
    mkdir($_tmppfad);
}
//--------------------------------------------------------------
//Berechtigung überprüfen und setzten falls nötig
//--------------------------------------------------------------
check_htaccess($_tmppfad . ".htaccess", true, ".htaccess im Personalbildpfad gesetzt");
//--------------------------------------------------------------
//Bild upload Überprüfung
//--------------------------------------------------------------
if ($_POST['submit']) {
    $dateityp = GetImageSize($_FILES['datei']['tmp_name']);
    if ($dateityp[2] == 2) {
        move_uploaded_file($_FILES['datei']['tmp_name'], "./Data/" . $_user->_ordnerpfad . "/img/bild.jpg");
        include_once './include/class_foto.php';
        $foto = new foto("./Data/" . $_user->_ordnerpfad . "/img/bild.jpg", 250, 300);
    } else {
        echo "Bitte nur Bilder im jpg Format hochladen.<hr>";
    }
}
$_count = count($_personaldaten->_personaldaten) + 1;
if ($_POST['update']) {
Ejemplo n.º 8
0
            if (is_dir($file) === true) {
                $zip->addEmptyDir(str_replace($source . '/', '', $file . '/'));
            } else {
                if (is_file($file) === true) {
                    $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));
                }
            }
        }
    } else {
        if (is_file($source) === true) {
            $zip->addFromString(basename($source), file_get_contents($source));
        }
    }
    return $zip->close();
}
check_htaccess($_pfad . ".htaccess", true, ".htaccess - ZIP-Berechtigung gestzt in " . $_pfad);
$_pfad = "./Data/_zip/" . $_user->_ordnerpfad . "/";
echo "<div id='divpdf'>\n";
$folder1 = opendir($_pfad);
while ($fA1 = readdir($folder1)) {
    if (!is_dir($fA1)) {
        $afile[] = $fA1;
    }
}
closedir($folder1);
if ($afile) {
    rsort($afile);
}
$anz = count($afile);
$aktuell = date("Y", time());
for ($i = 0; $i < $anz; $i++) {