composer format

pull/289/head
David Goodwin 5 years ago
parent bee5fcbe24
commit 6a89b9a363

@ -564,7 +564,7 @@ function create_page_browser($idxfield, $querypart, $sql_params = []) {
# afterwards: DROP SEQUENCE foo # afterwards: DROP SEQUENCE foo
$result = db_query_all($query, $sql_params); $result = db_query_all($query, $sql_params);
for($k = 0; $k < count($result); $k+=2) { for ($k = 0; $k < count($result); $k+=2) {
if (isset($result[$k + 1])) { if (isset($result[$k + 1])) {
$label = substr($result[$k]['label'], 0, $label_len) . '-' . substr($result[$k+1]['label'], 0, $label_len); $label = substr($result[$k]['label'], 0, $label_len) . '-' . substr($result[$k+1]['label'], 0, $label_len);
} else { } else {
@ -1402,9 +1402,9 @@ function smtp_mail($to, $from, $data, $password = "", $body = "") {
fputs($fh, "STARTTLS\r\n"); fputs($fh, "STARTTLS\r\n");
smtp_get_response($fh); smtp_get_response($fh);
stream_set_blocking ($fh, true); stream_set_blocking($fh, true);
stream_socket_enable_crypto($fh, true, STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT); stream_socket_enable_crypto($fh, true, STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT);
stream_set_blocking ($fh, true); stream_set_blocking($fh, true);
} }
fputs($fh, "EHLO $smtp_server\r\n"); fputs($fh, "EHLO $smtp_server\r\n");

@ -337,9 +337,7 @@ require(dirname(__FILE__) . '/../templates/header.php');
if (!isset($_SERVER['HTTPS'])) { if (!isset($_SERVER['HTTPS'])) {
echo "<h2>Warning: connection not secure, switch to https if possible</h2>"; echo "<h2>Warning: connection not secure, switch to https if possible</h2>";
} } ?>
?>
<div class="standout"><?php print $setupMessage; ?></div> <div class="standout"><?php print $setupMessage; ?></div>
@ -352,8 +350,7 @@ require(dirname(__FILE__) . '/../templates/header.php');
<p>You can use the form below, or run something like <pre>php -r 'echo "somesalt:" . sha1("somesalt:" . "password");'</pre> in a shell, after changing the salt.<p> <p>You can use the form below, or run something like <pre>php -r 'echo "somesalt:" . sha1("somesalt:" . "password");'</pre> in a shell, after changing the salt.<p>
EOF; EOF;
$change = "Generate"; $change = "Generate";
} } ?>
?>
<h2><?= $change ?> $CONF['setup_password']</h2> <h2><?= $change ?> $CONF['setup_password']</h2>
@ -425,23 +422,20 @@ EOF;
</html> </html>
<?php <?php
function _error_field($errors, $key) function _error_field($errors, $key) {
{
if (!isset($errors[$key])) { if (!isset($errors[$key])) {
return ''; return '';
} }
return "<span style='color: red'>{$errors[$key]}</span>"; return "<span style='color: red'>{$errors[$key]}</span>";
} }
function generate_setup_password_salt() function generate_setup_password_salt() {
{
$salt = time() . '*' . $_SERVER['REMOTE_ADDR'] . '*' . mt_rand(0, 60000); $salt = time() . '*' . $_SERVER['REMOTE_ADDR'] . '*' . mt_rand(0, 60000);
$salt = md5($salt); $salt = md5($salt);
return $salt; return $salt;
} }
function encrypt_setup_password($password, $salt) function encrypt_setup_password($password, $salt) {
{
return $salt . ':' . sha1($salt . ':' . $password); return $salt . ':' . sha1($salt . ':' . $password);
} }
@ -452,8 +446,7 @@ function encrypt_setup_password($password, $salt)
'message => text 'message => text
) )
*/ */
function check_setup_password($password, $lostpw_mode = 0) function check_setup_password($password, $lostpw_mode = 0) {
{
global $CONF; global $CONF;
$error = 1; # be pessimistic $error = 1; # be pessimistic
@ -488,8 +481,7 @@ function check_setup_password($password, $lostpw_mode = 0)
return array($error, $result); return array($error, $result);
} }
function create_admin($values) function create_admin($values) {
{
DEFINE('POSTFIXADMIN_SETUP', 1); # avoids instant redirect to login.php after creating the admin DEFINE('POSTFIXADMIN_SETUP', 1); # avoids instant redirect to login.php after creating the admin
$handler = new AdminHandler(1, 'setup.php'); $handler = new AdminHandler(1, 'setup.php');

Loading…
Cancel
Save