Commit 41f234fd authored by noplanman's avatar noplanman Committed by David Morley

Remove unnecessary pg_free_result and pg_close calls. (#76)

ah, never knew you did not Have to have them!
parent 24e8cc15
......@@ -32,5 +32,3 @@ while ($row = pg_fetch_array($result)) {
echo 'Longitude: ' . $row['long'] . '<br>';
}
}
pg_free_result($result);
pg_close($dbh);
......@@ -90,6 +90,3 @@ EOF;
);
}
}
pg_free_result($result);
pg_close($dbh);
......@@ -97,8 +97,6 @@ $numrows = pg_num_rows($result);
<?php
echo '</td></tr>';
}
pg_free_result($result);
pg_close($dbh);
?>
</tbody>
</table>
......@@ -80,9 +80,6 @@ if (stristr($outputssl, 'nodeName')) {
echo 'Data successfully inserted! Your pod will be reviewed and live on the list in a few hours!';
pg_free_result($result);
pg_close($dbh);
} else {
$log->lwrite('Could not validate your pod, check your setup! ' . $_domain);
echo 'Could not validate your pod, check your setup!<br>Take a look at <a href="https://' . $_domain . '/nodeinfo/1.0">your /nodeinfo</a>';
......
......@@ -49,8 +49,6 @@ while ($row = pg_fetch_array($result)) {
$message = 'Data for ' . $_domain . " Updated. If it was not you reply and let me know! \n\n";
$headers = "From: " . $adminemail . "\r\nCc:" . $adminemail . "," . $_oldemail . "\r\n";
@mail($to, $subject, $message, $headers);
pg_free_result($result);
pg_close($dbh);
die('Data saved. Will go into effect on next hourly change');
}
......
......@@ -49,8 +49,4 @@ while ($row = pg_fetch_array($result)) {
@mail($to, $subject, $message, $headers);
echo 'Link sent to administrator to review and verify, if approved they will forward the edit key to you.';
}
pg_free_result($result);
}
pg_close($dbh);
......@@ -33,7 +33,6 @@ while ($row = pg_fetch_array($result)) {
$headers = "From: " . $adminemail ."\r\nCc:" . $adminemail . "," . $row['email'] . "\r\n";
@mail($to, $subject, $message, $headers);
}
pg_free_result($result);
} elseif ($_action === 'warn') {
if ($row['email']) {
$to = $row['email'];
......@@ -46,5 +45,3 @@ while ($row = pg_fetch_array($result)) {
echo $result;
}
pg_close($dbh);
......@@ -89,7 +89,6 @@ while ($row = pg_fetch_all($result)) {
if ($admindb == - 1) {
$admin_rating = - 1;
}
pg_free_result($ratings);
unset($name);
unset($total_users);
unset($active_users_halfyear);
......@@ -289,5 +288,3 @@ while ($row = pg_fetch_all($result)) {
//end foreach
}
}
pg_free_result($result);
pg_close($dbh);
......@@ -25,6 +25,3 @@ $message = 'Pod:' . $_domain . $_domain . $_username . $_userurl . $_comment . $
$headers = 'From: ' . $_email . "\r\n";
@mail($to, $subject, $message, $headers);
echo 'Comment posted!';
pg_free_result($result);
pg_close($dbh);
......@@ -35,5 +35,3 @@ if ($_url) {
header('Location:https://' . $row[0]['domain'] . '/users/sign_up');
}
pg_free_result($result);
pg_close($dbh);
......@@ -90,5 +90,3 @@
</div>
</div>
<?php
pg_free_result($result);
pg_close($dbh);
......@@ -59,8 +59,6 @@ $numrows = pg_num_rows($result);
$row['service_xmpp'] === 't' && print '<div class="smlogo smlogo-xmpp"><img src="/images/icon-xmpp.png" width="16" height="16" title="XMPP chat server" alt="XMPP chat server"></div>';
echo '</td></tr>';
}
pg_free_result($result);
pg_close($dbh);
?>
</tbody>
</table>
......@@ -93,8 +93,6 @@ $numrows = pg_num_rows($result);
$row['service_xmpp'] === 't' && print '<div class="smlogo smlogo-xmpp"><img src="/images/icon-xmpp.png" width="16" height="16" title="XMPP chat server" alt="XMPP chat server"></div>';
echo '</td></tr>';
}
pg_free_result($result);
pg_close($dbh);
?>
</tbody>
</table>
......@@ -48,5 +48,3 @@ if ($uptr->monitors[0]->status == 9) {
$live = 'Down';
}
echo 'Status: ' . $live;
pg_free_result($result);
pg_close($dbh);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment