Exemplo n.º 1
0
    }
    //Update LDAP tls
    if (@$_SESSION['settings']['ldap_tls'] != $_POST['ldap_tls']) {
        UpdateSettings('ldap_tls', $_POST['ldap_tls']);
    }
    //Update anyone_can_modify
    if (@$_SESSION['settings']['anyone_can_modify'] != $_POST['anyone_can_modify']) {
        UpdateSettings('anyone_can_modify', $_POST['anyone_can_modify']);
    }
    //Update enable_kb
    if (@$_SESSION['settings']['enable_kb'] != $_POST['enable_kb']) {
        UpdateSettings('enable_kb', $_POST['enable_kb']);
    }
    //Update nb_bad_identification
    if (@$_SESSION['settings']['nb_bad_authentication'] != $_POST['nb_bad_authentication']) {
        UpdateSettings('nb_bad_authentication', $_POST['nb_bad_authentication']);
    }
}
echo '
<div style="margin-top:10px;">
    <form name="form_settings" method="post" action="">';
// Main div for TABS
echo '
        <div style="width:900px;margin:auto; line-height:20px; padding:10px;" id="tabs">';
// Tabs menu
echo '
            <ul>
                <li><a href="#tabs-1">' . $txt['admin_settings_title'] . '</a></li>
                <li><a href="#tabs-3">' . $txt['admin_misc_title'] . '</a></li>
                <li><a href="#tabs-2">' . $txt['admin_actions_title'] . '</a></li>
				<li><a href="#tabs-4">' . $txt['admin_ldap_menu'] . '</a></li>
Exemplo n.º 2
0
if (!Initialized()) {
    if ($argc < 2 || $argv[1] !== 'updated') {
        // wait until we have connectivity
        echo "waiting for network...\n";
        while (!GetUserData()) {
            sleep(5);
        }
        echo "updating";
        // Update from git and re-run
        shell_exec('git pull origin master');
        echo "Re-launching for update\n";
        shell_exec('php "' . __FILE__ . '" updated');
    } else {
        echo "initializing\n";
        $api_key = null;
        UpdateSettings();
        SetupAPIKeys();
    }
}
// go back to whatever working directory was being used before running the script
chdir($dir);
function UpdateSettings()
{
    global $api_key;
    echo "Updating Settings\n";
    $user = GetUserData();
    if (is_array($user) && count($user)) {
        // load the current settings
        copy("./settings/settings.ini", "./settings/settings.ini.bak");
        $current = file_get_contents("./settings/settings.ini");
        if ($current && strlen($current)) {
Exemplo n.º 3
0
    if (@$_SESSION['settings']['custom_logo'] != $_POST['custom_logo']) {
        UpdateSettings('custom_logo', $_POST['custom_logo']);
    }
    //Update custom_login_text
    if (@$_SESSION['settings']['custom_login_text'] != $_POST['custom_login_text']) {
        UpdateSettings('custom_login_text', htmlentities($_POST['custom_login_text'], ENT_QUOTES, "UTF-8"));
    }
    //store backups settings
    if (isset($_POST['bck_script_filename'])) {
        UpdateSettings('bck_script_filename', $_POST['bck_script_filename'], 'settings');
    }
    if (isset($_POST['bck_script_path'])) {
        UpdateSettings('bck_script_path', $_POST['bck_script_path'], 'settings');
    }
    if (isset($_POST['bck_script_key'])) {
        UpdateSettings('bck_script_key', $_POST['bck_script_key'], 'settings');
    }
}
echo '
<div style="margin-top:10px;">
    <form name="form_settings" method="post" action="">';
// Main div for TABS
echo '
        <div style="width:900px;margin:auto; line-height:20px; padding:10px;" id="tabs">';
// Tabs menu
echo '
            <ul>
                <li><a href="#tabs-1">' . $txt['admin_settings_title'] . '</a></li>
                <li><a href="#tabs-3">' . $txt['admin_misc_title'] . '</a></li>
                <li><a href="#tabs-2">' . $txt['admin_actions_title'] . '</a></li>
				<li><a href="#tabs-4">' . $txt['admin_ldap_menu'] . '</a></li>