From: <abe...@us...> - 2015-08-21 17:46:18
|
Revision: 7213 http://sourceforge.net/p/astlinux/code/7213 Author: abelbeck Date: 2015-08-21 17:46:16 +0000 (Fri, 21 Aug 2015) Log Message: ----------- web interface, add support for Fossil Modified Paths: -------------- branches/1.0/package/webinterface/altweb/admin/edit.php branches/1.0/package/webinterface/altweb/admin/network.php branches/1.0/package/webinterface/altweb/admin/prefs.php branches/1.0/package/webinterface/altweb/common/header.php branches/1.0/package/webinterface/altweb/common/license-packages.txt Added Paths: ----------- branches/1.0/package/webinterface/altweb/admin/fossil.php Modified: branches/1.0/package/webinterface/altweb/admin/edit.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/edit.php 2015-08-21 12:55:21 UTC (rev 7212) +++ branches/1.0/package/webinterface/altweb/admin/edit.php 2015-08-21 17:46:16 UTC (rev 7213) @@ -1,6 +1,6 @@ <?php -// Copyright (C) 2008-2014 Lonnie Abelbeck +// Copyright (C) 2008-2015 Lonnie Abelbeck // This is free software, licensed under the GNU General Public License // version 3 as published by the Free Software Foundation; you can // redistribute it and/or modify it under the terms of the GNU @@ -28,6 +28,7 @@ 'openvpnclient' => 'Restart OpenVPN Client', 'racoon' => 'Restart IPsec VPN', 'pptpd' => 'Restart PPTP VPN Server', + 'fossil' => 'Restart Fossil Server', 'ldap' => 'Reload LDAP Client', 'slapd' => 'Restart LDAP Server', 'monit' => 'Restart Monit Monitor', @@ -250,6 +251,8 @@ $result = restartPROCESS($process, 45, $result, 'init'); } elseif ($process === 'monit') { $result = restartPROCESS($process, 46, $result, 'init'); + } elseif ($process === 'fossil') { + $result = restartPROCESS($process, 47, $result, 'init'); } elseif ($process === 'cron') { $result = updateCRON('root', 30, $result); } @@ -384,6 +387,8 @@ putHtml('<p style="color: green;">Kamailio SIP Server'.statusPROCESS('kamailio').'.</p>'); } elseif ($result == 46) { putHtml('<p style="color: green;">Monit Monitoring'.statusPROCESS('monit').'.</p>'); + } elseif ($result == 47) { + putHtml('<p style="color: green;">Fossil Server'.statusPROCESS('fossil').'.</p>'); } elseif ($result == 99) { putHtml('<p style="color: red;">Action Failed.</p>'); } elseif ($result == 999) { Added: branches/1.0/package/webinterface/altweb/admin/fossil.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/fossil.php (rev 0) +++ branches/1.0/package/webinterface/altweb/admin/fossil.php 2015-08-21 17:46:16 UTC (rev 7213) @@ -0,0 +1,73 @@ +<?php + +// Copyright (C) 2015 Lonnie Abelbeck +// This is free software, licensed under the GNU General Public License +// version 3 as published by the Free Software Foundation; you can +// redistribute it and/or modify it under the terms of the GNU +// General Public License; and comes with ABSOLUTELY NO WARRANTY. + +// fossil.php for AstLinux +// 08-21-2015 +// + +$myself = $_SERVER['PHP_SELF']; + +require_once '../common/functions.php'; + +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + $result = 1; + if (! $global_admin) { + $result = 999; + } + header('Location: '.$myself.'?result='.$result); + exit; +} else { // Start of HTTP GET +$ACCESS_RIGHTS = 'admin'; +require_once '../common/header.php'; + + putHtml("<center>"); + putHtml('<p> </p>'); + putHtml("</center>"); +?> + <script language="JavaScript" type="text/javascript"> + //<![CDATA[ + + function setIFheight() { + var iframe = document.getElementById("fossil"); + var winH = 460; + if (document.documentElement && document.documentElement.offsetHeight) { + winH = document.documentElement.offsetHeight; + } + if (window.innerHeight) { + winH = window.innerHeight; + } + var offset = 160; + if (iframe.getBoundingClientRect) { + offset = iframe.getBoundingClientRect().top + 22; + } + + iframe.height = winH - offset; + window.onresize = setIFheight; + } + //]]> + </script> + <center> + <table class="layoutNOpad" width="100%"><tr><td><center> +<?php + + putHtml('<table class="stdtable" width="100%"><tr><td style="text-align: center;">'); + if (is_file('/var/run/fossil.pid')) { + echo '<iframe id="fossil" src="/admin/fossil/" frameborder="1" width="100%" onload="setIFheight();">'; + putHtml('</iframe>'); + } elseif (! is_file('/etc/init.d/fossil')) { + putHtml('<p style="color: red;">Fossil is not available on your AstLinux image.</p>'); + } else { + putHtml('<p style="color: red;">The Fossil Server is not running, enable via the Network Tab.</p>'); + } + putHtml('</td></tr></table>'); + putHtml("</center></td></tr></table>"); + putHtml("</center>"); +} // End of HTTP GET +require_once '../common/footer.php'; + +?> Property changes on: branches/1.0/package/webinterface/altweb/admin/fossil.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Modified: branches/1.0/package/webinterface/altweb/admin/network.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/network.php 2015-08-21 12:55:21 UTC (rev 7212) +++ branches/1.0/package/webinterface/altweb/admin/network.php 2015-08-21 17:46:16 UTC (rev 7213) @@ -1,6 +1,6 @@ <?php -// Copyright (C) 2008-2014 Lonnie Abelbeck +// Copyright (C) 2008-2015 Lonnie Abelbeck // This is free software, licensed under the GNU General Public License // version 3 as published by the Free Software Foundation; you can // redistribute it and/or modify it under the terms of the GNU @@ -35,6 +35,7 @@ // 10-21-2013, Added LDAP server support // 01-04-2014, Added NUT UPS Monitoring support // 12-16-2014, Added Monit Monitoring support +// 08-21-2015, Added Fossil - Software Configuration Management // // System location of rc.conf file $CONFFILE = '/etc/rc.conf'; @@ -647,6 +648,14 @@ $value = 'UPS_KILL_POWER="'.$_POST['ups_kill_power'].'"'; fwrite($fp, $value."\n"); + fwrite($fp, "### Fossil - Software Configuration Management\n"); + $value = 'FOSSIL_SERVER="'.$_POST['fossil_server'].'"'; + fwrite($fp, $value."\n"); + $value = 'FOSSIL_INCLUDE_DIRS="'.tuq($_POST['fossil_include_dirs']).'"'; + fwrite($fp, $value."\n"); + $value = 'FOSSIL_INCLUDE_FILES="'.tuq($_POST['fossil_include_files']).'"'; + fwrite($fp, $value."\n"); + $value = 'ADNAME=""'; fwrite($fp, "### Disable Bonjour Broadcasts\n".$value."\n"); fwrite($fp, "### gui.network.conf - end ###\n"); @@ -1030,6 +1039,8 @@ $result = restartPROCESS($process, 45, $result, 'init'); } elseif ($process === 'monit') { $result = restartPROCESS($process, 46, $result, 'init'); + } elseif ($process === 'fossil') { + $result = restartPROCESS($process, 47, $result, 'init'); } } else { $result = 2; @@ -1118,6 +1129,8 @@ putHtml('<p style="color: green;">Kamailio SIP Server'.statusPROCESS('kamailio').'.</p>'); } elseif ($result == 46) { putHtml('<p style="color: green;">Monit Monitoring'.statusPROCESS('monit').'.</p>'); + } elseif ($result == 47) { + putHtml('<p style="color: green;">Fossil Server'.statusPROCESS('fossil').'.</p>'); } elseif ($result == 99) { putHtml('<p style="color: red;">Action Failed.</p>'); } elseif ($result == 100) { @@ -1193,6 +1206,8 @@ putHtml('<option value="racoon"'.$sel.'>Restart IPsec VPN</option>'); $sel = ($reboot_restart === 'pptpd') ? ' selected="selected"' : ''; putHtml('<option value="pptpd"'.$sel.'>Restart PPTP VPN Server</option>'); + $sel = ($reboot_restart === 'fossil') ? ' selected="selected"' : ''; + putHtml('<option value="fossil"'.$sel.'>Restart Fossil Server</option>'); $sel = ($reboot_restart === 'ldap') ? ' selected="selected"' : ''; putHtml('<option value="ldap"'.$sel.'>Reload LDAP Client</option>'); $sel = ($reboot_restart === 'slapd') ? ' selected="selected"' : ''; @@ -2058,8 +2073,30 @@ putHtml('<tr class="dtrow0"><td colspan="6"> </td></tr>'); +if (is_file('/etc/init.d/fossil')) { putHtml('<tr class="dtrow0"><td class="dialogText" style="text-align: left;" colspan="6">'); + putHtml('<strong>Fossil – Software Configuration Management:</strong>'); + putHtml('</td></tr>'); + putHtml('<tr class="dtrow1"><td style="text-align: left;" colspan="6">'); + putHtml('Fossil Server:'); + putHtml('<select name="fossil_server">'); + putHtml('<option value="no">disabled</option>'); + $sel = (getVARdef($db, 'FOSSIL_SERVER', $cur_db) === 'yes') ? ' selected="selected"' : ''; + putHtml('<option value="yes"'.$sel.'>enabled</option>'); + putHtml('</select></td></tr>'); + + putHtml('<tr class="dtrow1"><td style="text-align: left;" colspan="6">'); + $value = getVARdef($db, 'FOSSIL_INCLUDE_DIRS', $cur_db); + putHtml('Fossil Include Dirs: <input type="text" size="82" maxlength="256" value="'.$value.'" name="fossil_include_dirs" /></td></tr>'); + putHtml('<tr class="dtrow1"><td style="text-align: left;" colspan="6">'); + $value = getVARdef($db, 'FOSSIL_INCLUDE_FILES', $cur_db); + putHtml('Fossil Include Files:<input type="text" size="82" maxlength="256" value="'.$value.'" name="fossil_include_files" /></td></tr>'); + + putHtml('<tr class="dtrow0"><td colspan="6"> </td></tr>'); +} + putHtml('<tr class="dtrow0"><td class="dialogText" style="text-align: left;" colspan="6">'); + putHtml('<strong>Advanced Configuration:</strong>'); putHtml('</td></tr>'); putHtml('<tr class="dtrow1"><td style="text-align: left;" colspan="6">'); Modified: branches/1.0/package/webinterface/altweb/admin/prefs.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/prefs.php 2015-08-21 12:55:21 UTC (rev 7212) +++ branches/1.0/package/webinterface/altweb/admin/prefs.php 2015-08-21 17:46:16 UTC (rev 7213) @@ -1,6 +1,6 @@ <?php -// Copyright (C) 2008-2014 Lonnie Abelbeck +// Copyright (C) 2008-2015 Lonnie Abelbeck // This is free software, licensed under the GNU General Public License // version 3 as published by the Free Software Foundation; you can // redistribute it and/or modify it under the terms of the GNU @@ -19,6 +19,7 @@ // 09-06-2013, Added Edit Tab Shortcut support // 09-04-2014, Added Show Kamailio SIP Server Status // 12-16-2014, Added Show Monit Tab +// 08-12-2015, Added Show Fossil Tab // $myself = $_SERVER['PHP_SELF']; @@ -504,6 +505,10 @@ $value = 'tab_monit_show = yes'; fwrite($fp, $value."\n"); } + if (isset($_POST['tab_fossil'])) { + $value = 'tab_fossil_show = yes'; + fwrite($fp, $value."\n"); + } if (! isset($_POST['tab_staff'])) { $value = 'tab_staff_disable_staff = yes'; fwrite($fp, $value."\n"); @@ -1201,6 +1206,10 @@ putHtml('<input type="checkbox" value="tab_cli" name="tab_cli"'.$sel.' /></td><td colspan="5">Show CLI Tab</td></tr>'); putHtml('<tr class="dtrow1"><td style="text-align: right;">'); + $sel = (getPREFdef($global_prefs, 'tab_fossil_show') === 'yes') ? ' checked="checked"' : ''; + putHtml('<input type="checkbox" value="tab_fossil" name="tab_fossil"'.$sel.' /></td><td colspan="5">Show Fossil Tab</td></tr>'); + + putHtml('<tr class="dtrow1"><td style="text-align: right;">'); $sel = (getPREFdef($global_prefs, 'tab_staff_disable_staff') !== 'yes') ? ' checked="checked"' : ''; putHtml('<input type="checkbox" value="tab_staff" name="tab_staff"'.$sel.' /></td><td colspan="5">Show Staff Tab for "staff" user</td></tr>'); Modified: branches/1.0/package/webinterface/altweb/common/header.php =================================================================== --- branches/1.0/package/webinterface/altweb/common/header.php 2015-08-21 12:55:21 UTC (rev 7212) +++ branches/1.0/package/webinterface/altweb/common/header.php 2015-08-21 17:46:16 UTC (rev 7213) @@ -1,6 +1,6 @@ <?php session_manual_gc(); -// Copyright (C) 2008-2014 Lonnie Abelbeck +// Copyright (C) 2008-2015 Lonnie Abelbeck // This is free software, licensed under the GNU General Public License // version 3 as published by the Free Software Foundation; you can // redistribute it and/or modify it under the terms of the GNU @@ -270,6 +270,9 @@ if ($global_admin && (getPREFdef($global_prefs, 'tab_cli_show') === 'yes')) { putHtml('<li><a href="/admin/cli.php"><span>CLI</span></a></li>'); } + if ($global_admin && (getPREFdef($global_prefs, 'tab_fossil_show') === 'yes')) { + putHtml('<li><a href="/admin/fossil.php"><span>Fossil</span></a></li>'); + } if ($global_admin && (getPREFdef($global_prefs, 'tab_prefs_show') !== 'no')) { putHtml('<li><a href="/admin/prefs.php"><span>Prefs</span></a></li>'); } Modified: branches/1.0/package/webinterface/altweb/common/license-packages.txt =================================================================== --- branches/1.0/package/webinterface/altweb/common/license-packages.txt 2015-08-21 12:55:21 UTC (rev 7212) +++ branches/1.0/package/webinterface/altweb/common/license-packages.txt 2015-08-21 17:46:16 UTC (rev 7213) @@ -54,3 +54,4 @@ Monit~Copyright (c) 2001-2015, Tildeslash. All rights reserved sqlite~Copyright (c) 1995-2015, SQLite Consortium sqliteodbc~Copyright (c) 2001-2015, Christian Werner +Fossil~Copyright (c) 2007-2015 D. Richard Hipp. All rights reserved. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |