</head>
<body>
<h2>Password generator for TWG Flash Uploader</h2>
<center>
<div class="noflash">
<p>Since version 2.7 all passwords are sent sha-1 encrypted. 
<br>Therefore you need to use encrypted passwords in .htusers.php.</p> 
<p>Not encrypted passwords are not supported anymore!</p>
Enter password and press generate:
<form action="tfu_password_generator.php" method="post">
<input style="margin-top:5px;" name="password" type="text" size="30" maxlength="30">
<input name="" type="submit" value="Generate">
</form>
<?php 
if (isset($_POST['password'])) {
    $pas = replaceInput($_POST['password']);
    echo "<p>";
    if (function_exists("sha1")) {
        echo "SHA1 hash value for '" . $pas . "': '" . sha1($pas) . "'";
    } else {
        echo "SHA1 does not exist - Please use a newer php version that supports this.";
    }
    echo "</p>";
    echo "<p>Use the generated value in your your password file .htusers.php.</p>";
}
?>
</div>
</center>
</body>
</html>
<?php 
示例#2
0
/**
 * function:tfu_debug()
 */
function tfu_debug($data)
{
    global $debug_file;
    // set in the tfu_config.php or is overwritten by the twg config
    global $enable_enhanced_debug;
    $data = replaceInput($data);
    // we check output data too - you never know!
    $input_invalid = false;
    if (stristr($data, 'called statically') === false && stristr($data, 'deprecated') === false) {
        // This error can happen in Joomla and can be ignored
        $debug_string = date('m.d.Y G:i:s') . ' - ' . $data . "\n";
        if ($enable_enhanced_debug) {
            $debug_string .= '    Request: ' . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'] . "\n";
            foreach (debug_backtrace() as $element) {
                $debug_string .= '      Stack: ' . basename($element['file']) . ":" . $element['line'] . ":" . $element['function'];
                foreach ($element['args'] as $par) {
                    if (is_array($par)) {
                        $par = str_replace("\n", "", print_r($par, true));
                    }
                    $debug_string .= ":" . substr($par, 0, 100);
                    // max 100 chars
                }
                $debug_string .= "\n";
            }
            if (function_exists("memory_get_usage")) {
                $debug_string .= "    Current memory usage: " . floor(memory_get_usage() / 1024) . " KB\n";
            } else {
                $debug_string .= "    Current memory usage: memory_get_usage not available.\n";
            }
        }
        if ($debug_file == '') {
            @ob_start();
            @error_log($debug_string, 0);
            @ob_end_clean();
            return;
        }
        if (file_exists($debug_file)) {
            if (filesize($debug_file) > 2000000) {
                // debug file max = 2MB !
                // we move the old one and start a new one - but only once!
                rename(dirname(__FILE__) . '/tfu.log', dirname(__FILE__) . '/tfu.log.bak');
                $debug_file_local = fopen($debug_file, 'w');
            } else {
                $debug_file_local = fopen($debug_file, 'a');
            }
            fputs($debug_file_local, $debug_string);
            fclose($debug_file_local);
        } else {
            if (is_writeable(dirname(__FILE__))) {
                if (!isset($debug_file)) {
                    // if helper is included somewhere else!
                    $debug_file = dirname(__FILE__) . "/tfu.log";
                }
                $debug_file_local = @fopen($debug_file, 'a');
                @fputs($debug_file_local, $debug_string);
                @fclose($debug_file_local);
                clearstatcache();
            } else {
                @ob_start();
                @error_log($debug_string, 0);
                @ob_end_clean();
            }
        }
    }
}