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

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)) { ...@@ -32,5 +32,3 @@ while ($row = pg_fetch_array($result)) {
echo 'Longitude: ' . $row['long'] . '<br>'; echo 'Longitude: ' . $row['long'] . '<br>';
} }
} }
pg_free_result($result);
pg_close($dbh);
...@@ -90,6 +90,3 @@ EOF; ...@@ -90,6 +90,3 @@ EOF;
); );
} }
} }
pg_free_result($result);
pg_close($dbh);
...@@ -97,8 +97,6 @@ $numrows = pg_num_rows($result); ...@@ -97,8 +97,6 @@ $numrows = pg_num_rows($result);
<?php <?php
echo '</td></tr>'; echo '</td></tr>';
} }
pg_free_result($result);
pg_close($dbh);
?> ?>
</tbody> </tbody>
</table> </table>
...@@ -80,9 +80,6 @@ if (stristr($outputssl, 'nodeName')) { ...@@ -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!'; 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 { } else {
$log->lwrite('Could not validate your pod, check your setup! ' . $_domain); $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>'; 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)) { ...@@ -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"; $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"; $headers = "From: " . $adminemail . "\r\nCc:" . $adminemail . "," . $_oldemail . "\r\n";
@mail($to, $subject, $message, $headers); @mail($to, $subject, $message, $headers);
pg_free_result($result);
pg_close($dbh);
die('Data saved. Will go into effect on next hourly change'); die('Data saved. Will go into effect on next hourly change');
} }
......
...@@ -49,8 +49,4 @@ while ($row = pg_fetch_array($result)) { ...@@ -49,8 +49,4 @@ while ($row = pg_fetch_array($result)) {
@mail($to, $subject, $message, $headers); @mail($to, $subject, $message, $headers);
echo 'Link sent to administrator to review and verify, if approved they will forward the edit key to you.'; 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)) { ...@@ -33,7 +33,6 @@ while ($row = pg_fetch_array($result)) {
$headers = "From: " . $adminemail ."\r\nCc:" . $adminemail . "," . $row['email'] . "\r\n"; $headers = "From: " . $adminemail ."\r\nCc:" . $adminemail . "," . $row['email'] . "\r\n";
@mail($to, $subject, $message, $headers); @mail($to, $subject, $message, $headers);
} }
pg_free_result($result);
} elseif ($_action === 'warn') { } elseif ($_action === 'warn') {
if ($row['email']) { if ($row['email']) {
$to = $row['email']; $to = $row['email'];
...@@ -46,5 +45,3 @@ while ($row = pg_fetch_array($result)) { ...@@ -46,5 +45,3 @@ while ($row = pg_fetch_array($result)) {
echo $result; echo $result;
} }
pg_close($dbh);
...@@ -89,7 +89,6 @@ while ($row = pg_fetch_all($result)) { ...@@ -89,7 +89,6 @@ while ($row = pg_fetch_all($result)) {
if ($admindb == - 1) { if ($admindb == - 1) {
$admin_rating = - 1; $admin_rating = - 1;
} }
pg_free_result($ratings);
unset($name); unset($name);
unset($total_users); unset($total_users);
unset($active_users_halfyear); unset($active_users_halfyear);
...@@ -289,5 +288,3 @@ while ($row = pg_fetch_all($result)) { ...@@ -289,5 +288,3 @@ while ($row = pg_fetch_all($result)) {
//end foreach //end foreach
} }
} }
pg_free_result($result);
pg_close($dbh);
...@@ -25,6 +25,3 @@ $message = 'Pod:' . $_domain . $_domain . $_username . $_userurl . $_comment . $ ...@@ -25,6 +25,3 @@ $message = 'Pod:' . $_domain . $_domain . $_username . $_userurl . $_comment . $
$headers = 'From: ' . $_email . "\r\n"; $headers = 'From: ' . $_email . "\r\n";
@mail($to, $subject, $message, $headers); @mail($to, $subject, $message, $headers);
echo 'Comment posted!'; echo 'Comment posted!';
pg_free_result($result);
pg_close($dbh);
...@@ -35,5 +35,3 @@ if ($_url) { ...@@ -35,5 +35,3 @@ if ($_url) {
header('Location:https://' . $row[0]['domain'] . '/users/sign_up'); header('Location:https://' . $row[0]['domain'] . '/users/sign_up');
} }
pg_free_result($result);
pg_close($dbh);
...@@ -90,5 +90,3 @@ ...@@ -90,5 +90,3 @@
</div> </div>
</div> </div>
<?php <?php
pg_free_result($result);
pg_close($dbh);
...@@ -59,8 +59,6 @@ $numrows = pg_num_rows($result); ...@@ -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>'; $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>'; echo '</td></tr>';
} }
pg_free_result($result);
pg_close($dbh);
?> ?>
</tbody> </tbody>
</table> </table>
...@@ -93,8 +93,6 @@ $numrows = pg_num_rows($result); ...@@ -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>'; $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>'; echo '</td></tr>';
} }
pg_free_result($result);
pg_close($dbh);
?> ?>
</tbody> </tbody>
</table> </table>
...@@ -48,5 +48,3 @@ if ($uptr->monitors[0]->status == 9) { ...@@ -48,5 +48,3 @@ if ($uptr->monitors[0]->status == 9) {
$live = 'Down'; $live = 'Down';
} }
echo 'Status: ' . $live; 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