forked from GithubBackups/tinyib
Add ability to update via Git from the management panel (Administrators only)
This commit is contained in:
parent
02290cc3d1
commit
a5a93dd639
13
imgboard.php
13
imgboard.php
@ -237,6 +237,19 @@ if (isset($_POST['message']) || isset($_POST['file'])) {
|
|||||||
$onload = manageOnLoad('bans');
|
$onload = manageOnLoad('bans');
|
||||||
$text .= manageBanForm();
|
$text .= manageBanForm();
|
||||||
$text .= manageBansTable();
|
$text .= manageBansTable();
|
||||||
|
} else if (isset($_GET['update'])) {
|
||||||
|
if (is_dir('.git')) {
|
||||||
|
$git_output = shell_exec('git pull 2>&1');
|
||||||
|
$text .= '<blockquote class="reply" style="padding: 7px;font-size: 1.25em;">
|
||||||
|
<pre>Attempting update...' . "\n\n" . $git_output . '</pre>
|
||||||
|
</blockquote>
|
||||||
|
<p><b>Note:</b> If TinyIB updates and you have made custom modifications, <a href="https://github.com/tslocum/TinyIB/commits/master">review the changes</a> which have been merged into your installation.
|
||||||
|
Ensure that your modifications do not interfere with any new/modified files.
|
||||||
|
See the <a href="https://github.com/tslocum/TinyIB#readme">README</a> for more information.</p>';
|
||||||
|
} else {
|
||||||
|
$text .= '<p><b>TinyIB was not installed via Git.</b></p>
|
||||||
|
<p>If you installed TinyIB without Git, you must <a href="https://github.com/tslocum/TinyIB">update manually</a>. If you did install with Git, ensure the script has read and write access to the <b>.git</b> folder.</p>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
24
inc/html.php
24
inc/html.php
@ -561,7 +561,7 @@ function manageStatus() {
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($posts as $post) {
|
foreach ($posts as $post) {
|
||||||
if ($post_html != '') { $post_html .= '<tr><td colspan="2"><hr></td></tr>'; }
|
if ($post_html != '') { $post_html .= '<tr><td colspan="2"><hr></td></tr>'; }
|
||||||
$post_html .= '<tr><td>' . buildPost($post, TINYIB_INDEXPAGE) . '</td><td valign="top"><form method="get" action="?"><input type="hidden" name="manage" value=""><input type="hidden" name="moderate" value="' . $post['id'] . '"><input type="submit" value="Moderate" class="managebutton"></form></td></tr>';
|
$post_html .= '<tr><td>' . buildPost($post, TINYIB_INDEXPAGE) . '</td><td valign="top" align="right"><form method="get" action="?"><input type="hidden" name="manage" value=""><input type="hidden" name="moderate" value="' . $post['id'] . '"><input type="submit" value="Moderate" class="managebutton"></form></td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return <<<EOF
|
return <<<EOF
|
||||||
@ -570,7 +570,27 @@ function manageStatus() {
|
|||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Info</legend>
|
<legend>Info</legend>
|
||||||
$info
|
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr><td>
|
||||||
|
$info
|
||||||
|
</td>
|
||||||
|
EOF;
|
||||||
|
if ($isadmin) {
|
||||||
|
$output .= <<<EOF
|
||||||
|
<td valign="top" align="right">
|
||||||
|
<form method="get" action="?">
|
||||||
|
<input type="hidden" name="manage">
|
||||||
|
<input type="hidden" name="update">
|
||||||
|
<input type="submit" value="Update TinyIB" class="managebutton">
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
EOF;
|
||||||
|
}
|
||||||
|
$output .= <<<EOF
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user