From: <abe...@us...> - 2012-01-12 22:24:44
|
Revision: 5375 http://astlinux.svn.sourceforge.net/astlinux/?rev=5375&view=rev Author: abelbeck Date: 2012-01-12 22:24:33 +0000 (Thu, 12 Jan 2012) Log Message: ----------- web interface, Prefs tab and System tab, if the Repository URL: has not been defined (initial configuration), the default value will be based on the installed Asterisk version. Modified Paths: -------------- branches/1.0/package/webinterface/altweb/admin/prefs.php branches/1.0/package/webinterface/altweb/admin/system.php branches/1.0/package/webinterface/altweb/common/functions.php branches/1.0/package/webinterface/altweb/common/version.php Modified: branches/1.0/package/webinterface/altweb/admin/prefs.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/prefs.php 2012-01-12 16:55:55 UTC (rev 5374) +++ branches/1.0/package/webinterface/altweb/admin/prefs.php 2012-01-12 22:24:33 UTC (rev 5375) @@ -817,7 +817,7 @@ putHtml('<tr class="dtrow1"><td style="text-align: right;" colspan="2">Repository URL:</td><td colspan="4">'); if (($value = getPREFdef($global_prefs, 'system_firmware_repository_url')) === '') { - $value = 'http://mirror.astlinux.org/ast18-firmware-1.x'; + $value = asteriskURLrepo(); } putHtml('<input type="text" size="48" maxlength="128" value="'.$value.'" name="repository_url" /></td></tr>'); Modified: branches/1.0/package/webinterface/altweb/admin/system.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/system.php 2012-01-12 16:55:55 UTC (rev 5374) +++ branches/1.0/package/webinterface/altweb/admin/system.php 2012-01-12 22:24:33 UTC (rev 5375) @@ -1,6 +1,6 @@ <?php -// Copyright (C) 2008-2011 Lonnie Abelbeck +// Copyright (C) 2008-2012 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,7 +28,7 @@ require_once '../common/users-password.php'; if (($REPOSITORY_URL = getPREFdef($global_prefs, 'system_firmware_repository_url')) === '') { - $REPOSITORY_URL = 'http://mirror.astlinux.org/ast18-firmware-1.x'; + $REPOSITORY_URL = asteriskURLrepo(); } if (($SOUNDS_URL = getPREFdef($global_prefs, 'system_asterisk_sounds_url')) === '') { Modified: branches/1.0/package/webinterface/altweb/common/functions.php =================================================================== --- branches/1.0/package/webinterface/altweb/common/functions.php 2012-01-12 16:55:55 UTC (rev 5374) +++ branches/1.0/package/webinterface/altweb/common/functions.php 2012-01-12 22:24:33 UTC (rev 5375) @@ -1,6 +1,6 @@ <?php -// Copyright (C) 2008-2011 Lonnie Abelbeck +// Copyright (C) 2008-2012 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 @@ -15,6 +15,7 @@ // 08-20-2008, Added asteriskCMD() // 09-06-2008, Added restartPROCESS() // 12-12-2009, Added systemSHUTDOWN() +// 01-12-2012, Added asteriskURLrepo() // // System location of prefs file $KD_PREFS_LOCATION = '/mnt/kd/webgui-prefs.txt'; @@ -447,6 +448,20 @@ return($db_R); } +// Function: asteriskURLrepo +// +function asteriskURLrepo() { + + $version = trim(shell_exec('/usr/sbin/asterisk -V')); + + if (strncmp($version, 'Asterisk 1.4.', 13) == 0) { + $str = 'http://mirror.astlinux.org/firmware-1.x'; + } else { + $str = 'http://mirror.astlinux.org/ast18-firmware-1.x'; + } + return($str); +} + // Function: asteriskERROR // function asteriskERROR($result) { Modified: branches/1.0/package/webinterface/altweb/common/version.php =================================================================== --- branches/1.0/package/webinterface/altweb/common/version.php 2012-01-12 16:55:55 UTC (rev 5374) +++ branches/1.0/package/webinterface/altweb/common/version.php 2012-01-12 22:24:33 UTC (rev 5375) @@ -1,6 +1,6 @@ <?php // version.php for AstLinux Alternate Web Interface -$GUI_VERSION = '1.8.05'; +$GUI_VERSION = '1.8.06'; ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |