[2] | 1 | <?php |
---|
| 2 | /**************************************************************************\ |
---|
| 3 | * eGroupWare - Admin * |
---|
| 4 | * http://www.egroupware.org * |
---|
| 5 | * This application written by Miles Lott <milos@groupwhere.org> * |
---|
| 6 | * -------------------------------------------- * |
---|
| 7 | * This program is free software; you can redistribute it and/or modify it * |
---|
| 8 | * under the terms of the GNU General Public License as published by the * |
---|
| 9 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
| 10 | * option) any later version. * |
---|
| 11 | \**************************************************************************/ |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | /* Check currentapp and API upgrade status */ |
---|
| 15 | |
---|
| 16 | if($GLOBALS['phpgw_info']['flags']['currentapp'] != 'home' && |
---|
| 17 | $GLOBALS['phpgw_info']['flags']['currentapp'] != 'welcome' && |
---|
| 18 | (isset($GLOBALS['phpgw_info']['server']['checkappversions']) && |
---|
| 19 | $GLOBALS['phpgw_info']['server']['checkappversions'])) |
---|
| 20 | { |
---|
| 21 | if((isset($GLOBALS['phpgw_info']['user']['apps']['admin']) && |
---|
| 22 | $GLOBALS['phpgw_info']['user']['apps']['admin']) || |
---|
| 23 | $GLOBALS['phpgw_info']['server']['checkappversions'] == 'All') |
---|
| 24 | { |
---|
| 25 | $_current = False; |
---|
| 26 | $app_name = $GLOBALS['phpgw_info']['flags']['currentapp']; |
---|
| 27 | $GLOBALS['phpgw']->db->query("SELECT app_name,app_version FROM phpgw_applications WHERE app_name='$app_name' OR app_name='phpgwapi'",__LINE__,__FILE__); |
---|
| 28 | while($GLOBALS['phpgw']->db->next_record()) |
---|
| 29 | { |
---|
| 30 | $_db_version = $GLOBALS['phpgw']->db->f('app_version'); |
---|
| 31 | $app_name = $GLOBALS['phpgw']->db->f('app_name'); |
---|
| 32 | $_versionfile = $GLOBALS['phpgw']->common->get_app_dir($app_name) . '/setup/setup.inc.php'; |
---|
| 33 | if(file_exists($_versionfile)) |
---|
| 34 | { |
---|
| 35 | include($_versionfile); |
---|
| 36 | /* echo '<br>' . $_versionfile . ','; */ |
---|
| 37 | $_file_version = $setup_info[$app_name]['version']; |
---|
| 38 | $_app_title = $setup_info[$app_name]['title']; |
---|
| 39 | unset($setup_info); |
---|
| 40 | |
---|
| 41 | if($app_name == 'phpgwapi') |
---|
| 42 | { |
---|
| 43 | $api_str = '<br>' . lang('The API requires an upgrade'); |
---|
| 44 | } |
---|
| 45 | /* echo $app_name . ',' . $_db_version . ',' . $_file_version; */ |
---|
| 46 | if(!$GLOBALS['phpgw']->common->cmp_version_long($_db_version,$_file_version)) |
---|
| 47 | { |
---|
| 48 | $_current = True; |
---|
| 49 | if($app_name == 'phpgwapi') |
---|
| 50 | { |
---|
| 51 | $api_str = '<br>' . lang('The API is current'); |
---|
| 52 | } |
---|
| 53 | } |
---|
| 54 | unset($_file_version); |
---|
| 55 | unset($_app_title); |
---|
| 56 | } |
---|
| 57 | unset($_db_version); |
---|
| 58 | unset($_versionfile); |
---|
| 59 | } |
---|
| 60 | if(!$_current) |
---|
| 61 | { |
---|
| 62 | echo '<center>'; |
---|
| 63 | echo $api_str; |
---|
| 64 | echo '<br>' . lang('This application requires an upgrade') . ':' . "\n"; |
---|
| 65 | echo '<br>' . lang('Please run setup to become current') . '.' . "\n"; |
---|
| 66 | echo '</center>'; |
---|
| 67 | } |
---|
| 68 | else |
---|
| 69 | { |
---|
| 70 | echo '<center>'; |
---|
| 71 | echo $api_str; |
---|
| 72 | echo '<br>' . lang('This application is current') . "\n"; |
---|
| 73 | echo '</center>'; |
---|
| 74 | } |
---|
| 75 | } |
---|
| 76 | } |
---|