Пример #1
0
/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function users_register($module, &$content)
{
    PHPWS_Core::initModClass('users', 'Permission.php');
    PHPWS_Core::initModClass('users', 'My_Page.php');
    $no_permissions = $no_my_page = FALSE;
    $result = Users_Permission::createPermissions($module);
    if (is_null($result)) {
        PHPWS_Boost::addLog('users', dgettext('users', 'Permissions file not implemented.'));
        $content[] = dgettext('users', 'Permissions file not implemented.');
        $no_permissions = TRUE;
    } elseif (PHPWS_Error::isError($result)) {
        $content[] = dgettext('users', 'Permissions table not created successfully.');
        PHPWS_Error::log($result);
        return FALSE;
    } else {
        $content[] = dgettext('users', 'Permissions table created successfully.');
    }
    $result = My_Page::registerMyPage($module);
    if (PHPWS_Error::isError($result)) {
        PHPWS_Boost::addLog('users', dgettext('users', 'A problem occurred when trying to register this module to My Page.'));
        $content[] = dgettext('users', 'A problem occurred when trying to register this module to My Page.');
        return FALSE;
    } elseif ($result != FALSE) {
        $content[] = dgettext('users', 'My Page registered to Users module.');
    } else {
        $no_my_page = TRUE;
    }
    // If the module doesn't have permissions or a My Page
    // then don't register the module
    if ($no_permissions && $no_my_page) {
        return FALSE;
    } else {
        return TRUE;
    }
}
Пример #2
0
/**
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 */
function filecabinet_install(&$content)
{
    $home_dir = PHPWS_Boost::getHomeDir();
    $mm_dir = $home_dir . 'files/multimedia/';
    if (!is_dir($mm_dir)) {
        if (!@mkdir($mm_dir)) {
            $content[] = dgettext('filecabinet', 'Failed to create files/multimedia directory.');
            return false;
        } else {
            $content[] = dgettext('filecabinet', 'files/multimedia directory created successfully.');
        }
    }
    $files_dir = $home_dir . 'files/filecabinet/';
    if (!is_dir($files_dir)) {
        if (!@mkdir($files_dir)) {
            $content[] = dgettext('filecabinet', 'Failed to create files/filecabinet/ directory.');
            return false;
        } else {
            $content[] = dgettext('filecabinet', 'files/filecabinet/ directory created successfully.');
        }
    }
    $classify_dir = $home_dir . 'files/filecabinet/incoming/';
    if (!is_dir($classify_dir)) {
        if (!@mkdir($classify_dir)) {
            $content[] = dgettext('filecabinet', 'Failed to create files/filecabinet/incoming directory.');
            return false;
        } else {
            $content[] = dgettext('filecabinet', 'files/filecabinet/incoming directory created successfully.');
        }
    }
    return true;
}
Пример #3
0
function slcUpdateFiles($files, &$content)
{
    if (PHPWS_Boost::updateFiles($files, 'checkin')) {
        $content[] = '--- Updated the following files:';
    } else {
        $content[] = '--- Unable to update the following files:';
    }
    $content[] = "    " . implode("\n    ", $files);
}
Пример #4
0
function miniadminUpdateFiles($files, &$content)
{
    if (PHPWS_Boost::updateFiles($files, 'miniadmin')) {
        $content[] = '-- Successfully updated the following files:';
    } else {
        $content[] = '-- Unable to update the following files:';
    }
    $content[] = '    ' . implode("\n    ", $files);
    $content[] = '';
}
Пример #5
0
 public static function registerModule($module, &$content)
 {
     if (is_file(PHPWS_SOURCE_DIR . 'mod/' . $module . '/conf/rss.php')) {
         $reg_file = PHPWS_Core::getConfigFile($module, 'rss.php');
     } else {
         $reg_file = false;
     }
     if ($reg_file == FALSE) {
         PHPWS_Boost::addLog($module, dgettext('rss', 'No RSS file found.'));
         return FALSE;
     }
     PHPWS_Core::initModClass('rss', 'Channel.php');
     include $reg_file;
     $oChannel = new RSS_Channel();
     $oChannel->module = $module;
     if (!isset($channel) || !is_array($channel)) {
         $content[] = dgettext('rss', 'RSS file found but no channel information.');
         PHPWS_Boost::addLog($module, dgettext('rss', 'RSS file found but no channel information.'));
     }
     $oModule = new PHPWS_Module($module);
     if (!empty($channel['title'])) {
         $oChannel->title = strip_tags($channel['title']);
     } else {
         $oChannel->title = $oModule->proper_name;
     }
     if (!empty($channel['description'])) {
         $oChannel->description = strip_tags($channel['description']);
     }
     if (!empty($channel['link'])) {
         $oChannel->link = strip_tags($channel['link']);
     } else {
         $oChannel->link = PHPWS_Core::getHomeHttp();
     }
     $result = $oChannel->save();
     if (PHPWS_Error::isError($result)) {
         PHPWS_Error::log($result);
         PHPWS_Boost::addLog($module, dgettext('rss', 'An error occurred registering to RSS module.'));
         $content[] = dgettext('rss', 'An error occurred registering to RSS module.');
         return NULL;
     } else {
         $content[] = sprintf(dgettext('rss', 'RSS registration to %s module successful.'), $oModule->proper_name);
         return TRUE;
     }
 }
Пример #6
0
/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function users_unregister($module, &$content)
{
    PHPWS_Core::initModClass('users', 'Permission.php');
    PHPWS_Core::initModClass('users', 'My_Page.php');
    $result = Users_Permission::removePermissions($module);
    if (PHPWS_Error::isError($result)) {
        $content[] = dgettext('users', 'Permissions table not removed successfully.');
        return FALSE;
    } elseif ($result) {
        $content[] = dgettext('users', 'Permissions table removed successfully.');
    }
    $result = My_Page::unregisterMyPage($module);
    if (PHPWS_Error::isError($result)) {
        PHPWS_Boost::addLog('users', dgettext('users', 'A problem occurred when trying to unregister this module from My Page.'));
        $content[] = dgettext('users', 'A problem occurred when trying to unregister this module from My Page.');
        return FALSE;
    } elseif ($result != FALSE) {
        $content[] = dgettext('users', 'My Page unregistered from Users module.');
    }
    return TRUE;
}
Пример #7
0
 public static function registerModule($module, &$content)
 {
     PHPWS_Core::initModClass('controlpanel', 'Tab.php');
     PHPWS_Core::initModClass('controlpanel', 'Link.php');
     $cpFile = sprintf('%smod/%s/boost/controlpanel.php', PHPWS_SOURCE_DIR, $module);
     if (!is_file($cpFile)) {
         PHPWS_Boost::addLog($module, dgettext('controlpanel', 'Control Panel file not implemented.'));
         return false;
     }
     include $cpFile;
     // insure cp file does not change translation directory
     if (isset($tabs) && is_array($tabs)) {
         foreach ($tabs as $info) {
             $tab = new PHPWS_Panel_Tab();
             if (!isset($info['id'])) {
                 $tab->setId(strtolower(preg_replace('/\\W/', '_', $info['title'])));
             } else {
                 $tab->setId($info['id']);
             }
             if (!isset($info['title'])) {
                 $content[] = dgettext('controlpanel', 'Unable to create tab.') . ' ' . dgettext('controlpanel', 'Missing title.');
                 continue;
             }
             $tab->setTitle($info['title']);
             if (!isset($info['link'])) {
                 $content[] = dgettext('controlpanel', 'Unable to create tab.') . ' ' . dgettext('controlpanel', 'Missing link.');
                 continue;
             }
             $tab->setLink($info['link']);
             if (isset($info['itemname'])) {
                 $tab->setItemname($info['itemname']);
             } else {
                 $tab->setItemname('controlpanel');
             }
             $result = $tab->save();
             if (PHPWS_Error::isError($result)) {
                 $content[] = dgettext('controlpanel', 'An error occurred when trying to save a controlpanel tab.');
                 PHPWS_Error::log($result);
                 return false;
             }
         }
         $content[] = sprintf(dgettext('controlpanel', 'Control Panel tabs created for %s.'), $module);
     } else {
         PHPWS_Boost::addLog($module, dgettext('controlpanel', 'Control Panel tabs not implemented.'));
     }
     if (isset($link) && is_array($link)) {
         $db = new PHPWS_DB('controlpanel_tab');
         foreach ($link as $info) {
             $modlink = new PHPWS_Panel_Link();
             if (isset($info['label'])) {
                 $modlink->setLabel($info['label']);
             }
             if (isset($info['restricted'])) {
                 $modlink->setRestricted($info['restricted']);
             } elseif (isset($info['admin'])) {
                 $modlink->setRestricted($info['admin']);
             }
             $modlink->setUrl($info['url']);
             $modlink->setActive(1);
             if (isset($info['itemname'])) {
                 $modlink->setItemName($info['itemname']);
             } else {
                 $modlink->setItemName($module);
             }
             $modlink->setDescription($info['description']);
             if (is_string($info['image'])) {
                 $modlink->setImage($info['image']);
             } elseif (is_array($info['image'])) {
                 $modlink->setImage($info['image']['name']);
             }
             $db->addWhere('id', $info['tab']);
             $db->addColumn('id');
             $result = $db->select('one');
             if (PHPWS_Error::isError($result)) {
                 PHPWS_Error::log($result);
                 continue;
             } elseif (!isset($result)) {
                 $tab_id = 'unsorted';
                 PHPWS_Boost::addLog($module, dgettext('controlpanel', 'Unable to load a link into a specified tab.'));
             } else {
                 $tab_id = $info['tab'];
             }
             $modlink->setTab($tab_id);
             $result = $modlink->save();
             if (PHPWS_Error::isError($result)) {
                 PHPWS_Error::log($result);
                 $content[] = dgettext('controlpanel', 'There was a problem trying to save a Control Panel link.');
                 return false;
             }
             $db->resetWhere();
         }
         $content[] = sprintf(dgettext('controlpanel', 'Control Panel links created for %s.'), $module);
     } else {
         PHPWS_Boost::addLog($module, dgettext('controlpanel', 'No Control Panel links found.'));
     }
     PHPWS_ControlPanel::reset();
     return true;
 }
Пример #8
0
function fc_updatefiles($files, &$content)
{
    $result = PHPWS_Boost::updateFiles($files, 'filecabinet', true);
    if (!is_array($result)) {
        $content[] = '--- Copied the following files:';
        $content[] = '    ' . implode("\n    ", $files);
    } else {
        $content[] = '--- FAILED copying the following files:';
        $content[] = '    ' . implode("\n    ", $result);
    }
    $content[] = '';
}
Пример #9
0
function pagesmithUpdateFiles($files, &$content)
{
    $result = PHPWS_Boost::updateFiles($files, 'pagesmith', true);
    $content[] = ' --- Updated the following files:';
    $content[] = "    " . implode("\n    ", $files);
    if (is_array($result)) {
        $content[] = ' --- Unable to update the following files:';
        $content[] = "    " . implode("\n    ", $result);
    }
    $content[] = '';
}
Пример #10
0
/**
 * Description
 * @author Jeff Tickle <jtickle at tux dot appstate dot edu>
 */
function analytics_update(&$content, $currentVersion)
{
    switch ($currentVersion) {
        case version_compare($currentVersion, '1.0.1', '<'):
            $db = new PHPWS_DB('analytics_tracker');
            $result = $db->addTableColumn('disable_if_logged', 'int NOT NULL default 0');
            if (PHPWS_Error::logIfError($result)) {
                $content[] = 'Unable to add disable_if_logged column to analytics_tracker table.';
                return false;
            }
            $files = array('templates/edit.tpl');
            if (PHPWS_Boost::updateFiles($files, 'analytics')) {
                $content[] = '--- Updated templates/edit.tpl';
            }
        case version_compare($currentVersion, '1.1.0', '<'):
            // install.sql has been wrong for awhile, this should fix any discrepancies
            $db = new PHPWS_DB('analytics_tracker');
            if (!$db->isTableColumn('disable_if_logged')) {
                $result = $db->addTableColumn('disable_if_logged', 'int NOT NULL default 0');
                if (PHPWS_Error::logIfError($result)) {
                    $content[] = 'Unable to add disable_if_logged column to analytics_tracker table.';
                    return false;
                }
                $content[] = '--- Added disable_if_logged option to database';
            }
            // Load new schema
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/analytics/boost/update/1.1.0.sql');
            if (PHPWS_Error::logIfError($result)) {
                $content[] = 'Unable to import updated schema for version 1.1.0.';
                return false;
            }
            $content[] = '--- Updated Analytics schema to 1.1.0';
            // Move Google Analytics data to its own table
            $db = new PHPWS_DB('analytics_tracker');
            $db->addColumn('id');
            $db->addColumn('account');
            $db->addWhere('type', 'GoogleAnalyticsTracker');
            $result = $db->select();
            if (PHPWS_Error::logIfError($result)) {
                $content[] = 'Unable to select Google Analytics tracker from analytics_tracker table.';
                return false;
            }
            foreach ($result as $row) {
                $db = new PHPWS_DB('analytics_tracker_google');
                $db->addValue('id', $row['id']);
                // Adding UA- into the account identifier to reduce confusion
                $db->addValue('account', 'UA-' . $row['account']);
                $db->insert(false);
                $content[] = "--- Migrated Google Analytics configuration for account UA-{$row['account']}";
            }
            $db = new PHPWS_DB('analytics_tracker');
            $result = $db->dropTableColumn('account');
            if (PHPWS_Error::logIfError($result)) {
                $content[] = 'Unable to remove account column from analytics_tracker table.';
                return false;
            }
            $content[] = '--- Completed migration to Analytics 1.1.0 schema';
        case version_compare($currentVersion, '1.1.1', '<'):
            $content[] = <<<EOF
<pre>Version 1.1.1
-------------------
+ Piwik fix.
+ Fixed uninstall script
</pre>
EOF;
    }
    return true;
}
Пример #11
0
function coreUpdateFiles($files, &$content)
{
    if (PHPWS_Boost::updateFiles($files, 'core')) {
        $content[] = ' --- Updated the following files:';
        $good = true;
    } else {
        $content[] = ' --- Unable to update the following files:';
        $good = false;
    }
    $content[] = "     " . implode("\n     ", $files);
    $content[] = '';
    return $good;
}
Пример #12
0
/**
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 */
function rss_update(&$content, $version)
{
    switch ($version) {
        case version_compare($version, '0.1.0', '<'):
            $content[] = '- Changed to binary safe file pull.';
            $content[] = '- Added system error checks and warnings.';
        case version_compare($version, '0.1.1', '<'):
            $content[] = '- Channel title now linked to feed.';
            $content[] = '- mod_rewrite works with feed.';
        case version_compare($version, '0.1.2', '<'):
            $content[] = '<pre>
0.1.2 changes
-------------
+ Added some error checks to feed translation.
</pre>';
        case version_compare($version, '0.1.3', '<'):
            $content[] = '<pre>
0.1.3 changes
-------------
+ Added translate functions
</pre>';
        case version_compare($version, '0.1.4', '<'):
            PHPWS_Boost::updateFiles(array('img/rss.png'), 'rss');
            $content[] = '<pre>
0.1.4 changes
-------------
+ Add German translation files.
+ Updated language functions.
+ Changed control panel icon
</pre>';
        case version_compare($version, '0.2.0', '<'):
            $db = new PHPWS_DB('rss_channel');
            PHPWS_Error::logIfError($db->dropTableColumn('last_build_date'));
            $content[] = '<pre>';
            $files = array('templates/rss20.tpl', 'templates/settings.tpl');
            if (PHPWS_Boost::updateFiles($files, 'rss')) {
                $content[] = '--- Successfully updated the following files:';
            } else {
                $content[] = '--- Could NOT update the following files successfully:';
            }
            $content[] = '    ' . implode("\n    ", $files);
            $content[] = '
0.2.0 changes
---------------
+ RSS 2.0 is now useable.
+ Added settings page for some of the RSS 2.0 options
+ Removed a header line that caused some verification errors in the 2.0 template.
+ Changed template process. Some fields were missing from the feeds.
';
        case version_compare($version, '0.2.1', '<'):
            $content[] = '<pre>
0.2.1 changes
-------------
+ Changed rss popup window dimensions and form text length
</pre>';
        case version_compare($version, '0.2.2', '<'):
            $content[] = '<pre>
0.2.2 changes
-------------
+ Added line of code to Feed to prevent error on bad data.
+ Added Vietnamese translation.
</pre>';
        case version_compare($version, '0.2.3', '<'):
            PHPWS_Boost::updateFiles(array('templates/admin_feeds.tpl'), 'rss');
            $content[] = '<pre>
0.2.3 changes
-------------
+ Added error check on feed listing.
+ Shortened urls
+ Added sort button to feed listing.
</pre>';
        case version_compare($version, '0.2.4', '<'):
            $content[] = '<pre>
0.2.4 changes
-------------
+ Fixed the timeout setting for the rss caching.
</pre>';
        case version_compare($version, '0.2.5', '<'):
            $content[] = '<pre>
0.2.5 changes
-------------
+ Mod rewrite link added to rss feed.
+ High ascii characters have their ampersand parsed.
</pre>';
        case version_compare($version, '0.2.6', '<'):
            $content[] = '<pre>
0.2.6 changes
-------------
+ RSS will not pull expired or unpublished keys any longer.
</pre>';
        case version_compare($version, '0.3.0', '<'):
            $content[] = '<pre>
0.3.0 changes
-------------
+ Fixed feed date formats.
+ Sub ampersand code for straight &
+ PHP 5 formatted.
</pre>';
        case version_compare($version, '0.3.1', '<'):
            $content[] = '<pre>
0.3.1 changes
-------------
+ Patch #2500049 - Olivier Sannier : prepares a string for output in
  the resulting XML stream. It ensures it does not contain any XML
  entities and that the line breaks are output correctly.
</pre>';
        case version_compare($version, '0.3.2', '<'):
            $content[] = '<pre>
0.3.2 changes
--------------
+ Changed Channel to only pull active keys.</pre>';
        case version_compare($version, '0.3.3', '<'):
            $content[] = '<pre>
0.3.3 changes
--------------
+ Check made on feed array in case it was force fed it won\'t get overwritten.</pre>';
        case version_compare($version, '0.3.4', '<'):
            $content[] = '<pre>
0.3.4 changes
--------------
+ PHP 5 strict changes</pre>';
        case version_compare($version, '0.3.5', '<'):
            $content[] = '<pre>
0.3.5 changes
--------------
+ RSS feed date fix from Tommy de Jesus</pre>';
        case version_compare($version, '0.3.6', '<'):
            $content[] = '<pre>
0.3.6 changes
--------------
+ Fixed install registration.
+ Fixed labels under Bootstrap.
+ Missing CURRENT_LANGUAGE define added.
+ Bootstrap icons and tables added.
+ Put correct rss.php directory in file check.
</pre>';
    }
    return true;
}
Пример #13
0
 public static function listModules($type)
 {
     Layout::addStyle('boost');
     $allow_update = true;
     $core_update_needed = false;
     $dir_content = array();
     if (!PHPWS_Boost::checkDirectories($dir_content)) {
         $tpl['DIRECTORIES'] = implode('<br />', $dir_content);
         $allow_update = false;
     }
     $core_mods = PHPWS_Core::coreModList();
     $installed_mods = PHPWS_Core::installModList();
     $dir_mods = PHPWS_Boost::getAllMods();
     if ($type == 'core_mods') {
         $allowUninstall = false;
         $modList = $core_mods;
         $core_file = new PHPWS_Module('core');
         $core_db = new PHPWS_Module('core', false);
         $template['TITLE'] = $core_db->proper_name;
         $template['VERSION'] = $core_db->version;
         if (isset($_SESSION['Boost_Needs_Update']['core'])) {
             $link_title = $_SESSION['Boost_Needs_Update']['core'];
             if (version_compare($core_file->version, $_SESSION['Boost_Needs_Update']['core'], '<')) {
                 $link_title = sprintf(dgettext('boost', '%s - New'), $link_title);
             }
         } else {
             $link_title = dgettext('boost', 'Check');
         }
         if ($core_file->isAbout()) {
             $address = PHPWS_Text::linkAddress('boost', array('action' => 'aboutView', 'aboutmod' => $core_file->title), true);
             $aboutView = array('label' => dgettext('boost', 'About'), 'address' => $address);
             $template['ABOUT'] = Layout::getJavascript('open_window', $aboutView);
         }
         $link_command['opmod'] = 'core';
         $link_command['action'] = 'check';
         if (ini_get('allow_url_fopen')) {
             $template['LATEST'] = PHPWS_Text::secureLink($link_title, 'boost', $link_command);
         } else {
             $template['LATEST'] = dgettext('boost', 'Check disabled');
         }
         if (version_compare($core_db->version, $core_file->version, '<')) {
             if ($core_file->checkDependency()) {
                 if ($allow_update) {
                     $link_command['action'] = 'update_core';
                     $core_links[] = PHPWS_Text::secureLink(dgettext('boost', 'Update'), 'boost', $link_command);
                 } else {
                     $core_links[] = dgettext('boost', 'Update');
                 }
                 $tpl['WARNING'] = dgettext('boost', 'The Core requires updating! You should do so before any modules.');
                 $core_update_needed = true;
             } else {
                 $link_command['action'] = 'show_dependency';
                 $core_links[] = PHPWS_Text::secureLink(dgettext('boost', 'Missing dependency'), 'boost', $link_command);
             }
             $template['VERSION'] = sprintf('%s &gt; %s', $core_db->version, $core_file->version);
             $template['COMMAND'] = implode(' | ', $core_links);
         } else {
             $template['COMMAND'] = dgettext('boost', 'None');
         }
         $template['ROW'] = 1;
         $tpl['mod-row'][] = $template;
     } else {
         $allowUninstall = true;
         $modList = array_diff($dir_mods, $core_mods);
     }
     $tpl['TITLE_LABEL'] = dgettext('boost', 'Module Title');
     $tpl['COMMAND_LABEL'] = dgettext('boost', 'Commands');
     $tpl['ABOUT_LABEL'] = dgettext('boost', 'More information');
     $tpl['VERSION_LABEL'] = dgettext('boost', 'Current version');
     if ($type == 'core_mods' && Current_User::isDeity() && DEITIES_CAN_UNINSTALL) {
         $tpl['WARNING'] = dgettext('boost', 'WARNING: Only deities can uninstall core modules. Doing so may corrupt your installation!');
     }
     if (empty($modList)) {
         return dgettext('boost', 'No modules available.');
     }
     sort($modList);
     $count = 1;
     foreach ($modList as $title) {
         $links = array();
         $template = $link_command = NULL;
         $link_command['opmod'] = $title;
         $mod = new PHPWS_Module($title);
         if (!$mod->isFullMod()) {
             continue;
         }
         $proper_name = $mod->getProperName();
         if (!isset($proper_name)) {
             $proper_name = $title;
         }
         $template['VERSION'] = $mod->version;
         $template['TITLE'] = $proper_name;
         $template['ROW'] = $count % 2 + 1;
         $version_check = $mod->getVersionHttp();
         if (isset($version_check)) {
             if (isset($_SESSION['Boost_Needs_Update'][$mod->title])) {
                 $link_title = $_SESSION['Boost_Needs_Update'][$mod->title];
                 if (version_compare($mod->version, $_SESSION['Boost_Needs_Update'][$mod->title], '<')) {
                     $link_title = sprintf(dgettext('boost', '%s - New'), $link_title);
                 }
             } else {
                 $link_title = dgettext('boost', 'Check');
             }
             $link_command['action'] = 'check';
             if (ini_get('allow_url_fopen')) {
                 $template['LATEST'] = PHPWS_Text::secureLink($link_title, 'boost', $link_command);
             } else {
                 $template['LATEST'] = dgettext('boost', 'Check disabled');
             }
         }
         if (!$mod->isInstalled()) {
             if ($mod->checkDependency()) {
                 $link_title = dgettext('boost', 'Install');
                 $link_command['action'] = 'install';
             } else {
                 $link_title = dgettext('boost', 'Missing dependency');
                 $link_command['action'] = 'show_dependency';
             }
             if ($GLOBALS['Boost_Ready']) {
                 if (javascriptEnabled()) {
                     $js['width'] = 640;
                     $js['height'] = 480;
                     $js['address'] = PHPWS_Text::linkAddress('boost', $link_command, true);
                     $js['label'] = $link_title;
                     $links[] = javascript('open_window', $js);
                     unset($js);
                 } else {
                     $links[] = PHPWS_Text::secureLink($link_title, 'boost', $link_command);
                 }
             } else {
                 $links[] =& $link_title;
             }
         } else {
             if ($mod->needsUpdate()) {
                 $db_mod = new PHPWS_Module($mod->title, false);
                 $template['VERSION'] = $db_mod->version . ' &gt; ' . $mod->version;
                 if ($mod->checkDependency()) {
                     if ($title == 'boost' && !$core_update_needed) {
                         $tpl['WARNING'] = dgettext('boost', 'Boost requires updating! You should do so before any other module!');
                     }
                     $link_title = dgettext('boost', 'Update');
                     $link_command['action'] = 'update';
                 } else {
                     $link_title = dgettext('boost', 'Missing dependency');
                     $link_command['action'] = 'show_dependency';
                 }
                 if ($allow_update) {
                     $js['width'] = 640;
                     $js['height'] = 480;
                     $js['address'] = PHPWS_Text::linkAddress('boost', $link_command, true);
                     $js['label'] = $link_title;
                     $links[] = javascript('open_window', $js);
                     unset($js);
                 } else {
                     $links[] =& $link_title;
                 }
             }
             if ($type != 'core_mods' || Current_User::isDeity() && DEITIES_CAN_UNINSTALL) {
                 if ($dependents = $mod->isDependedUpon()) {
                     $link_command['action'] = 'show_depended_upon';
                     $depend_warning = sprintf(dgettext('boost', 'This module is depended upon by: %s'), implode(', ', $dependents));
                     $links[] = PHPWS_Text::secureLink(dgettext('boost', 'Depended upon'), 'boost', $link_command, NULL, $depend_warning);
                 } else {
                     $links[] = PHPWS_Boost::uninstallLink($title);
                 }
             }
         }
         if ($mod->isAbout()) {
             $address = PHPWS_Text::linkAddress('boost', array('action' => 'aboutView', 'aboutmod' => $mod->title), true);
             $aboutView = array('label' => dgettext('boost', 'About'), 'address' => $address);
             $template['ABOUT'] = Layout::getJavascript('open_window', $aboutView);
         }
         if (!empty($links)) {
             $template['COMMAND'] = implode(' | ', $links);
         } else {
             $template['COMMAND'] = dgettext('boost', 'None');
         }
         $tpl['mod-row'][] = $template;
         $count++;
     }
     $tpl['OLD_MODS'] = Boost_Form::oldModList();
     if (ini_get('allow_url_fopen')) {
         $tpl['CHECK_FOR_UPDATES'] = PHPWS_Text::secureLink(dgettext('boost', 'Check all'), 'boost', array('action' => 'check_all', 'tab' => $type));
     } else {
         $tpl['CHECK_FOR_UPDATES'] = dgettext('boost', 'Server configuration prevents version checking.');
     }
     $tpl['LATEST_LABEL'] = dgettext('boost', 'Latest version');
     $release_version = PHPWS_Core::releaseVersion();
     $tpl['PHPWS_VERSION'] = $release_version;
     $result = PHPWS_Template::process($tpl, 'boost', 'module_list.tpl');
     return $result;
 }
Пример #14
0
/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function access_update(&$content, $version)
{
    switch (1) {
        case version_compare($version, '0.1.0', '<'):
            if (PHPWS_Boost::updateFiles(array('conf/config.php'), 'access')) {
                $content[] = '- Copied config.php locally.';
            } else {
                $content[] = '- Unable to copy config.php locally.';
            }
            $content[] = '- Added rewrite conditionals to .htaccess write.';
        case version_compare($version, '0.1.1', '<'):
            $content[] = '<pre>';
            $files = array('templates/main.tpl', 'templates/box.tpl', 'templates/shortcut_menu.tpl');
            if (PHPWS_Boost::updateFiles($files, 'access')) {
                $content[] = '-- Copied following template files locally:';
            } else {
                $content[] = '-- Failed to copy the following files locally:';
            }
            $content[] = implode("\n", $files);
            $content[] = '+ Fixed header tags (Bug #1652279)';
            $content[] = '</pre>';
        case version_compare($version, '0.1.2', '<'):
            $content[] = '<pre>
0.1.2 changes
---------------
+ Added translate functions.
</pre>
';
        case version_compare($version, '0.2.0', '<'):
            $content[] = '<pre>
0.2.0 changes
---------------';
            $files = array('conf/error.php', 'templates/forms/administrator.tpl', 'templates/forms/update_file.tpl', 'img/access.png');
            if (PHPWS_Boost::updateFiles($files, 'access')) {
                $content[] = '+ The following files were updated successfully.';
            } else {
                $content[] = '+ The following files were not updated successfully.';
            }
            $content[] = '    ' . implode("\n    ", $files);
            $content[] = '+ Update panel shows the current .htaccess file as well as
  the one the admin is about to save.
+ Changed the admin panel to turn off different components.
+ Rewrite engine enabled by default.
+ Shortcuts now separated by dashes and not underlines
+ Keywords in shortcuts parsed better.
+ Admins can now edit shortcut keywords from the admin panel.
+ Deny/Allow tab changed to Allow/Deny since it is set that way every where else.
+ Allow/Deny can now be disabled in the Admin panel.
+ Added a way to restore the default .htaccess file.
+ Removed symbolic link option from htaccess writes.
+ New control panel icon.
</pre>
';
        case version_compare($version, '0.2.1', '<'):
            $content[] = '<pre>0.2.1 changes
---------------
+ Updated to new language format.</pre>';
        case version_compare($version, '0.2.2', '<'):
            $content[] = '<pre>';
            $files = array('conf/error.php', 'templates/forms/administrator.tpl', 'templates/forms/update_file.tpl', 'img/access.png', 'conf/config.php');
            if (PHPWS_Boost::updateFiles($files, 'access')) {
                $content[] = '+ The following files were updated successfully.';
            } else {
                $content[] = '+ The following files were not updated successfully.';
            }
            $content[] = '    ' . implode("\n    ", $files);
            $content[] = '
0.2.2 changes
---------------
+ The default rewrite conditional was missing a file check.
+ Previous update had updated files going to incorrect directory.
+ Template was removing curly brackets from review mode. Fixed.
</pre>';
        case version_compare($version, '0.2.3', '<'):
            $content[] = '<pre>
0.2.3 changes
---------------
+ Fixed bug #1690698: Cannot create a new .htaccess file if original
  is deleted. Thanks singletrack
+ Fixed bug #1690544: If the .htaccess file is not writable or
  missing, give the user a warning message.</pre>';
        case version_compare($version, '1.0.0', '<'):
            $content[] = '<pre>';
            $files = array('templates/forms/allow_deny.tpl', 'templates/forms/shortcut_list.tpl');
            if (PHPWS_Boost::updateFiles($files, 'access')) {
                $content[] = '--- The following files were updated successfully.';
            } else {
                $content[] = '--- The following files were not updated successfully.';
            }
            $content[] = implode("\n", $files);
            $content[] = '1.0.0 changes
---------------
+ Rewritten for phpwebsite 1.5.0 changes.
+ addIP and removeIP allow modules to restrict users.
</pre>';
        case version_compare($version, '1.0.1', '<'):
            $content[] = '<pre>1.0.1 changes
---------------
+ Fixed Access option not appearing on MiniAdmin
+ .html completely removed from shortcuts
</pre>';
        case version_compare($version, '1.0.2', '<'):
            $content[] = '<pre>1.0.2 changes
---------------
+ Removed htaccess file. Now expect core/inc/htaccess.
</pre>';
        case version_compare($version, '1.1.0', '<'):
            PHPWS_Boost::updateFiles(array('templates/htaccess.tpl'), 'access');
            $content[] = '<pre>1.1.0 changes
---------------
+ New ability to added a RewriteBase to a .htaccess file.
+ Updated to PHP 5 standards.
</pre>';
        case version_compare($version, '1.1.1', '<'):
            $content[] = '<pre>1.1.1 changes
---------------
+ Reformated shortcut creation method. Should work with old version
  as well as any new longer links.</pre>';
        case version_compare($version, '1.1.2', '<'):
            $content[] = '<pre>1.1.2 changes
---------------
+ Fixed some error notices
+ Fixed access shortcuts to work with GET arrays</pre>';
        case version_compare($version, '1.1.3', '<'):
            $content[] = '<pre>1.1.3 changes
---------------
+ Access forces bad urls to 404 error
</pre>';
        case version_compare($version, '1.1.4', '<'):
            $content[] = '<pre>1.1.4 changes
---------------
+ Trimming the title to prevent extra spaces in shortcuts
</pre>';
        case version_compare($version, '1.1.5', '<'):
            $module = new PHPWS_Module('access');
            PHPWS_Error::logIfError($module->save());
            $content[] = '<pre>1.1.5 changes
---------------
+ Lowered Access priority to assure its init.php is called early.</pre>';
        case version_compare($version, '1.1.6', '<'):
            $content[] = '<pre>1.1.6 changes
---------------
+ Added link check on url setting to prevent ./ from suffixing and
  breaking storage.</pre>';
        case version_compare($version, '1.1.7', '<'):
            $content[] = '<pre>1.1.7 changes
---------------
+ Code changes to make PHP 5 strict compatible.</pre>';
        case version_compare($version, '1.1.8', '<'):
            $content[] = '<pre>1.1.8 changes
---------------
+ Fixed shortcuts not working with some older pages
+ Pager links added to shortcut list</pre>';
        case version_compare($version, '1.1.9', '<'):
            $content[] = '<pre>1.1.9 changes
---------------
+ Fixed a bug in Access module which was causing the RewriteBase? to be set to the empty string</pre>';
        case version_compare($version, '1.2.0', '<'):
            $sql = "ALTER TABLE  access_shortcuts CHANGE  keyword  keyword VARCHAR( 255 ) NOT NULL DEFAULT ''";
            PHPWS_DB::query($sql);
            $content[] = '<pre>1.2.0 changes
---------------
+ Shortcut length increased and observed in code.</pre>';
        case version_compare($version, '1.2.1', '<'):
            $sql = "ALTER TABLE  access_shortcuts CHANGE  keyword  keyword VARCHAR( 255 ) NOT NULL DEFAULT ''";
            PHPWS_DB::query($sql);
            $content[] = '<pre>1.2.1 changes
---------------
+ Added tools to shortcuts to give all pages shortcuts and to autoforward on id calls.
+ Made sure the varchar is changed since the install did not reflect the change.</pre>';
        case version_compare($version, '1.2.2', '<'):
            $content[] = '<pre>1.2.2 changes
--------------
+ Fixed autoforwarding</pre>';
        case version_compare($version, '1.3.0', '<'):
            $content[] = '<pre>1.3.0 changes
--------------
+ Bootstrap changes, use of modal
+ Various bug fixes
</pre>';
    }
    return true;
}
Пример #15
0
function cpFileUpdate($files, &$content)
{
    if (PHPWS_Boost::updateFiles($files, 'controlpanel')) {
        $content[] = '-- Successfully updated the following files:';
    } else {
        $content[] = '-- Unable to update the following files:';
    }
    $content[] = '    ' . implode("\n    ", $files);
}
Пример #16
0
function branch_update_files($files, &$content)
{
    if (PHPWS_Boost::updateFiles($files, 'branch')) {
        $content[] = '--- Updated the following files:';
    } else {
        $content[] = '--- Failed to update the following files:';
    }
    $content[] = '    ' . implode("\n    ", $files);
    $content[] = '';
}
Пример #17
0
$backToBoost = PHPWS_Text::secureLink(dgettext('boost', 'Return to Boost'), 'boost', $vars);
switch ($_REQUEST['action']) {
    case 'admin':
        $content[] = Boost_Form::listModules(Boost_Form::boostTab($boostPanel));
        break;
    case 'check':
        $content[] = $backToBoost . '<br />';
        $content[] = Boost_Action::checkupdate($_REQUEST['opmod']);
        break;
    case 'check_all':
        Boost_Action::checkAll();
        $content[] = Boost_Form::listModules(Boost_Form::boostTab($boostPanel));
        break;
    case 'aboutView':
        PHPWS_Core::initModClass('boost', 'Boost.php');
        PHPWS_Boost::aboutView($_REQUEST['aboutmod']);
        break;
    case 'install':
        $js = javascriptEnabled();
        if (!$js) {
            $content[] = $backToBoost . '<br />';
        }
        $result = Boost_Action::installModule($_REQUEST['opmod']);
        if (PHPWS_Error::isError($result)) {
            PHPWS_Error::log($result);
            $content[] = dgettext('boost', 'An error occurred while installing this module.') . ' ' . dgettext('boost', 'Please check your error logs.');
        } else {
            $content[] = $result;
        }
        break;
    case 'uninstall':
Пример #18
0
/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function block_update(&$content, $currentVersion)
{
    switch ($currentVersion) {
        case version_compare($currentVersion, '1.1.1', '<'):
            $content[] = '<pre>Block versions prior to 1.1.1 are not supported for updating.
Please download version 1.1.2.</pre>';
            break;
        case version_compare($currentVersion, '1.1.2', '<'):
            PHPWS_Boost::updateFiles(array('img/block.png'), 'block');
            $content[] = '<pre>1.1.2 changes
-------------
+ Added German files
+ Use new translation format
+ Changed control panel icon
</pre>';
        case version_compare($currentVersion, '1.1.3', '<'):
            $content[] = '<pre>';
            if (PHPWS_Boost::updateFiles(array('templates/sample.tpl'), 'block')) {
                $content[] = '--- Successfully copied templates/sample.tpl';
            } else {
                $content[] = '--- Unable to copy templates/sample.tpl';
            }
            $content[] = '
1.1.3 changes
-------------
+ Changed the sample.tpl layout to conform with other "box" templates.
</pre>';
        case version_compare($currentVersion, '1.2.0', '<'):
            $content[] = '<pre>';
            $db = new PHPWS_DB('block');
            if (PHPWS_Error::logIfError($db->addTableColumn('file_id', 'int not null default 0'))) {
                $content[] = 'Unable to add file_id column to block table.</pre>';
                return false;
            }
            if (PHPWS_Error::logIfError($db->addTableColumn('hide_title', 'smallint not null default 0'))) {
                $content[] = 'Unable to add file_only column to block table.</pre>';
                return false;
            }
            if (PHPWS_Boost::updateFiles(array('conf/config.php', 'templates/edit.tpl', 'templates/sample.tpl'), 'block')) {
                $content[] = '--- Successfully updated files.';
            } else {
                $content[] = '--- Unable to update files. Please run revert in Boost.';
            }
            $content[] = '1.2.0 changes
-----------------
+ Blocks can now contain File Cabinet elements.</pre>';
        case version_compare($currentVersion, '1.3.0', '<'):
            if (PHPWS_Boost::updateFiles(array('templates/list.tpl', 'templates/sample.tpl'), 'block')) {
                $content[] = '--- Successfully copied templates/list.tpl';
            } else {
                $content[] = '--- Unable to copy templates/list.tpl';
            }
            $content[] = '<pre>1.3.0 changes
-----------------
+ PHP 5 updated
+ Wrapped block-file class around file display.
+ Changed pager view to use addSortHeaders</pre>';
        case version_compare($currentVersion, '1.3.1', '<'):
            if (PHPWS_Boost::updateFiles(array('templates/settings.tpl'), 'block')) {
                $content[] = '--- Successfully copied templates/settings.tpl';
            } else {
                $content[] = '--- Unable to copy templates/settings.tpl';
            }
            $content[] = '<pre>1.3.1 changes
-----------------
+ RFE #2236544 - Image size limits set in settings tab instead of in
  config file.
</pre>';
        case version_compare($currentVersion, '1.3.2', '<'):
            $content[] = '<pre>1.3.2 changes
-------------
+ Removed isPosted check on block save.
</pre>';
        case version_compare($currentVersion, '1.3.3', '<'):
            $content[] = '<pre>1.3.3 changes
-------------
+ PHP 5 strict changes.
+ Using Icon class.
+ Id added to each block.
</pre>';
        case version_compare($currentVersion, '1.3.4', '<'):
            $content[] = '<pre>1.3.4 changes
--------------
+ Removed exit call.
</pre>';
        case version_compare($currentVersion, '1.3.5', '<'):
            $content[] = '<pre>1.3.5 changes
--------------
+ Put in sanity checks preventing blank blocks.
+ Removed New tab, added New block button to List view.
+ Empty block titles now get a deactivated title based on the content.
</pre>';
        case version_compare($currentVersion, '1.3.6', '<'):
            moveBlockImages();
            $content[] = '<pre>1.3.6 changes
---------------
+ Moved File Cabinet material to block content.
+ Removed copy and pin single functionality.
+ Added ability to post block to page through the miniadmin link.
</pre>';
        case version_compare($currentVersion, '1.3.7', '<'):
            if ($currentVersion == '1.3.6' && PHPWS_Boost::inBranch()) {
                moveBlockImages();
            }
            $db = Database::newDB();
            $btable = $db->addTable('block');
            $dt = $btable->addDataType('hide_narrow', 'smallint');
            $dt->add();
            $content[] = '<pre>1.3.7
---------------
+ Moved File Cabinet material to block content (did not work on branches from 1.3.6).
+ Added option to hide a block when width is minimized.
</pre>';
        case version_compare($currentVersion, '1.3.8', '<'):
            $content[] = '<pre>1.3.8 changes
---------------
+ Updated icons to Font Awesome
+ Fixed bug with Branch update.
</pre>';
        case version_compare($currentVersion, '1.3.9', '<'):
            $content[] = '<pre>1.3.9 changes
---------------
+ Removed viewPinnedBlocks code
</pre>';
        case version_compare($currentVersion, '1.3.10', '<'):
            $content[] = '<pre>1.3.10 changes
---------------
+ Added font-awesome icons.
+ Updated to work with ckeditor 4.
</pre>';
        case version_compare($currentVersion, '1.3.11', '<'):
            $content[] = '<pre>1.3.10 changes
---------------
+ Added error check in admin for blank titles.
</pre>';
    }
    return TRUE;
}
Пример #19
0
/**
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 */
function phatform_update(&$content, $version)
{
    switch ($version) {
        case version_compare($version, '3.0.2', '<'):
            $content[] = '- Fixed compatibility issues.';
        case version_compare($version, '3.0.3', '<'):
            $content[] = '- Fixed element move bug.';
        case version_compare($version, '3.0.4', '<'):
            $content[] = '<pre>
3.0.4 changes
-------------
+ Simplified install.sql
+ Fixed some incompatible errorMessage function calls
</pre>';
        case version_compare($version, '3.0.5', '<'):
            $content[] = '<pre>
3.0.5 changes
-------------
+ Fixed typo in Form_Manager class causing crashes.
</pre>';
        case version_compare($version, '3.0.6', '<'):
            $content[] = '<pre>
3.0.6 changes
-------------
+ Added translate call.
+ Added missing "export" directory creation.
+ Removed all global core calls
+ Fixed email bug.
</pre>';
        case version_compare($version, '3.1.0', '<'):
            PHPWS_Boost::updateFiles(array('img/phatform.png'), 'phatform');
            $content[] = '<pre>
3.1.0 changes
-------------
+ Added German translations
+ Update language functions.
+ Changed control panel icon
</pre>';
        case version_compare($version, '3.1.1', '<'):
            $content[] = '<pre>
3.1.1 changes
-------------
+ Fixed bug #1785639. Unable to move elements up and down.
+ Fixed bug #1785626. Unable to delete option set.
+ Fixed bug #1785585. List archive would not function.
+ Reduced control panel info.
</pre>';
        case version_compare($version, '3.1.2', '<'):
            $content[] = '<pre>
3.1.2 changes
-------------
+ Fixed error construction in some element save functions.
+ Element now prohibits element names matching preexisting column names.
</pre>';
        case version_compare($version, '3.1.3', '<'):
            if (!PHPWS_Boost::updateFiles(array('templates/form/form.tpl'), 'phatform')) {
                $content[] = 'Failed copying templates/form/form.tpl';
            }
            $content[] = '<pre>
3.1.3 changes
-------------
+ added Captcha to anonymous user forms
+ Checking elements against database restricted names.
</pre>';
        case version_compare($version, '3.1.4', '<'):
            PHPWS_Boost::updateFiles(array('conf/phatform.php'), 'phatform');
            $content[] = '<pre>
3.1.4 changes
-------------
+ RFE # 2609260 - PHATFORM_CAPTCHA now definable in configuration file.
+ Preventing numbers from being element names.
</pre>';
        case version_compare($version, '3.1.5', '<'):
            $content[] = '<pre>
3.1.5 changes
-------------
+ mod_rewrite works with form.
+ Page selection fix.
+ Fixed element deletion.
+ Some PHP 5 strict fixes.</pre>';
        case version_compare($version, '3.1.6', '<'):
            $content[] = '<pre>
3.1.6 changes
-------------
+ Introduction passed through text parser
+ Timed out session give warning instead of forcing login</pre>';
        case version_compare($version, '3.1.7', '<'):
            $content[] = '<pre>
3.1.7 changes
-------------
+ Fixed isset check that should have used empty
</pre>';
        case version_compare($version, '3.1.8', '<'):
            $content[] = '<pre>
3.1.8 changes
-------------
+ Fixed newline bug.
+ Fixed notice error message display.
</pre>';
        case version_compare($version, '3.1.9', '<'):
            if (!is_file(PHPWS_HOME_DIR . 'files/phatform/.htaccess')) {
                mkdir(PHPWS_HOME_DIR . 'files/phatform', 0755, true);
                copy(PHPWS_SOURCE_DIR . 'mod/phatform/boost/htaccess', PHPWS_HOME_DIR . 'files/phatform/.htaccess');
            }
            $content[] = '<pre>
3.1.9 changes
-------------
+ Added .htaccess to files/phatform to prevent direct accecss
</pre>';
        case version_compare($version, '3.1.10', '<'):
            $content[] = <<<EOF
3.1.10 changes
---------------
+ Changed: H1 tags to H2
+ Changed: Removed call to Help class.
+ Changed: Export serves the file instead of offering direct access to the file.
+ Changed: Moved Pager and Manager classes out of core and into Phatform
+ Fixed: deprecated function ereg
+ Fixed: regexp check on multiple entries so they appear in single item report view
EOF;
    }
    return true;
}
Пример #20
0
/**
 *
 * @author Micah Carter <mcarter at tux dot appstate dot edu>
 *
 */
function intern_update(&$content, $currentVersion)
{
    switch ($currentVersion) {
        case version_compare($currentVersion, '0.0.2', '<'):
            $files = array();
            $files[] = 'templates/add_system.tpl';
            PHPWS_Boost::updateFiles($files, 'intern');
        case version_compare($currentVersion, '0.0.3', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_03.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.4', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_04.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.6', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_06.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.7', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_07.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.8', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_08.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.9', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_09.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.10', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_10.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.11', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_11.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.12', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_12.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.13', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_13.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.14', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_14.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.15', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_15.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.16', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_16.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.17', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('intern', $content);
        case version_compare($currentVersion, '0.0.18', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_18.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.19', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_19.sql');
            test($result);
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.20', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_20.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.21', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_21.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.22', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_22.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.23', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_23.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.24', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_24.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.25', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('intern', $content);
        case version_compare($currentVersion, '0.0.26', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_26.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.27', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_27.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.28', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_28.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.29', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_29.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.30', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_30.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.31', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_31.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.32', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_32.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('intern', $content);
        case version_compare($currentVersion, '0.0.33', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('intern', $content);
        case version_compare($currentVersion, '0.0.35', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_35.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.0.36', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('intern', $content);
        case version_compare($currentVersion, '0.0.37', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_0_0_37.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.1.0', '<'):
            Users_Permission::registerPermissions('intern', $content);
        case version_compare($currentVersion, '0.1.1', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_00.01.01.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.1.2', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_00.01.02.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.1.3', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_00.01.03.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.1.4', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_00.01.04.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.1.5', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_00.01.05.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.1.6', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_00.01.06.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.1.7', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_00.01.07.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.1.8', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_00.01.08.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.1.9', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/intern/boost/updates/update_00.01.09.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
    }
    return TRUE;
}
Пример #21
0
 public function updateBranches(&$content)
 {
     if (!PHPWS_Core::moduleExists('branch')) {
         return true;
     }
     PHPWS_Core::initModClass('branch', 'Branch_Admin.php');
     $branches = Branch_Admin::getBranches(true);
     if (empty($branches)) {
         return true;
     }
     $keys = array_keys($this->status);
     foreach ($branches as $branch) {
         $GLOBALS['Boost_In_Branch'] = $branch;
         // used as the "local" directory in updateFiles
         $GLOBALS['boost_branch_dir'] = $branch->directory;
         if (PHPWS_Error::isError($branch->loadBranchDB())) {
             $content[] = dgettext('boost', 'Problem connecting to the branch. May be too many connections.');
             continue;
         }
         // create a new boost based on the branch database
         $branch_boost = new PHPWS_Boost();
         $branch_boost->loadModules($keys, false);
         $content[] = '<hr />';
         $content[] = sprintf(dgettext('boost', 'Updating branch %s'), $branch->branch_name);
         $result = $branch_boost->update($content);
         if (PHPWS_Error::isError($result)) {
             PHPWS_Error::log($result);
             $content[] = dgettext('boost', 'Unable to update branch.');
         }
     }
     Branch::loadHubDB();
     $GLOBALS['Boost_In_Branch'] = false;
 }
Пример #22
0
function userUpdateFiles($files, &$content)
{
    $result = PHPWS_Boost::updateFiles($files, 'users', true);
    if (!is_array($result)) {
        $content[] = '--- Successfully updated the following files:';
        $content[] = '     ' . implode("\n     ", $files);
    } else {
        $content[] = '--- Was unable to copy the following files:';
        $content[] = '     ' . implode("\n     ", $result);
    }
    $content[] = '';
}
Пример #23
0
 /**
  * Checks all modules for update status
  */
 public static function checkAll()
 {
     PHPWS_Core::initModClass('boost', 'Boost.php');
     $all_mods = PHPWS_Boost::getAllMods();
     if (empty($all_mods)) {
         return;
     }
     PHPWS_Core::initCoreClass('Module.php');
     $all_mods[] = 'core';
     if (!ini_get('allow_url_fopen')) {
         return false;
     }
     foreach ($all_mods as $mod_title) {
         $module = new PHPWS_Module($mod_title);
         $file = $module->getVersionHttp();
         if (empty($file)) {
             continue;
         }
         $full_xml_array = PHPWS_Text::xml2php($file, 2);
         if (empty($full_xml_array)) {
             continue;
         }
         $version_info = PHPWS_Text::tagXML($full_xml_array);
         if (empty($version_info) || empty($version_info['VERSION'])) {
             continue;
         }
         $_SESSION['Boost_Needs_Update'][$mod_title] = $version_info['VERSION'];
     }
 }
Пример #24
0
/**
 *
 * @author theFergus <kevin at tux dot appstate dot edu>
 */
function hms_update(&$content, $currentVersion)
{
    $files = array();
    switch ($currentVersion) {
        case version_compare($currentVersion, '0.1.2', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_2.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/student/rlc_signup_form_page2.tmp';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = _('+ RLC application form template');
            $content[] = _('+ RLC application table');
        case version_compare($currentVersion, '0.1.3', '<'):
            $files[] = 'templates/student/rlc_signup_confirmation.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = _('+ Complete system for RLC applications');
        case version_compare($currentVersion, '0.1.4', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_4.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/display_final_rlc_assignments.tpl';
            $files[] = 'templates/admin/display_rlc_student_detail_form_questions.tpl';
            $files[] = 'templates/admin/make_new_rlc_assignments.tpl';
            $files[] = 'templates/admin/make_new_rlc_assignments_summary.tpl';
            $files[] = 'templates/admin/display_rlc_student_detail.tpl';
            $files[] = 'templates/admin/deadlines.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = _('+ RLC administration templates');
            $content[] = _('+ Deadline for Questionnaire replaced by deadlines for Profile and Application');
            $content[] = _('+ Deadline added for editing applications');
            $content[] = _('+ Deadline added for submitting RLC applications');
        case version_compare($currentVersion, '0.1.5', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_5.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/deadlines.tpl';
            $files[] = 'templates/admin/statistics.tpl';
            $files[] = 'templates/student/application_search.tpl';
            $files[] = 'templates/student/application_search_pager.tpl';
            $files[] = 'templates/student/application_search_results.tpl';
            $files[] = 'templates/student/contract.tpl';
            $files[] = 'templates/student/student_application.tpl';
            $files[] = 'templates/student/student_application_combined.tpl';
            $files[] = 'templates/student/student_application_redo.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = _('+ Fixed RLC deadline bug in deadlines.tpl');
            $content[] = _('+ Added Number of People Assigned');
            $content[] = _('+ Added Number of Applications Received');
            $content[] = _('+ Added Number of Learning Community Applications Received');
            $content[] = _('+ Refactored questionnaire references to application');
            $content[] = _('+ Added the contract verbage for when a student first logs in');
            $content[] = _('+ Completed Housing applications now go straight into the RLC application if the student said they were interested');
            $content[] = _('+ Added link to allow students to go to the RLC application on first login as soon as they complete an application');
            $content[] = _('+ Added link to the pdf of the contract for students that want to print it out');
        case version_compare($currentVersion, '0.1.6', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_6.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/misc/login.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = _('+ Modifying permissions for RLC admins to approve members and assign to rooms');
            $content[] = _('+ Added verbage for students to see before they login');
        case version_compare($currentVersion, '0.1.7', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_7.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/make_new_rlc_assignments_summary.tpl';
            $files[] = 'templates/admin/rlc_assignments_page.tpl';
            $files[] = 'templates/admin/add_floor.tpl';
            $files[] = 'templates/admin/display_room_data.tpl';
            $files[] = 'templates/admin/display_hall_data.tpl';
            $files[] = 'templates/admin/get_hall_floor_room.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Removed capacity_per_room';
            $content[] = '+ Added bedrooms_per_room';
            $content[] = '+ Added beds_per_bedroom';
            $content[] = '+ Added list of existing halls when adding new halls';
            $content[] = '+ Room assignments working - assignments now by bed instead of room';
        case version_compare($currentVersion, '0.1.8', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_8.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/display_learning_community_data.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/display_hall_data.tpl';
            $files[] = 'templates/admin/add_floor.tpl';
            $files[] = 'templates/admin/display_floor_data.tpl';
            $files[] = 'templates/student/student_application.tpl';
            $files[] = 'templates/admin/select_room_for_delete.tpl';
            $files[] = 'templates/admin/display_room_data.tpl';
            $files[] = 'templates/admin/verify_delete_room.tpl';
            $files[] = 'templates/admin/select_floor_for_delete_room.tpl';
            $files[] = 'templates/misc/side_thingie.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Added abbreviation and capacity changes to Add RLC template. They now properly save and delete.';
            $content[] = '+ Deleting a building now deletes the bedrooms and beds in that building.';
            $content[] = '+ Hid Edit Building temporarily. Bedroom/bed maintenance needs to be finished first.';
            $content[] = '+ Editing a floor works again. Can not delete/add rooms from floor maintenance, must go through room menu.';
            $content[] = '+ Removed gender option from student_application.tpl';
        case version_compare($currentVersion, '0.1.9', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_9.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/maintenance.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Sync\'d with the current live release.';
        case version_compare($currentVersion, '0.1.10', '<'):
            $files[] = 'templates/admin/assign_floor.tpl';
            $files[] = 'templates/admin/bed_and_id.tpl';
            $files[] = 'templates/admin/get_hall_floor.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/select_floor_for_edit.tpl';
            $files[] = 'templates/admin/select_residence_hall.tpl';
            $files[] = 'templates/admin/select_room_for_edit.tpl';
            $files[] = 'templates/student/student_application.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Changed templates regarding editing/deleting rooms and floors to be more user friendly';
            $content[] = '+ Changed to version 0.1.10 to get all dev sites and production site in sync';
            $content[] = '+ Changed HMS_Room so beds are deleted manually instead of through a db object';
            $content[] = '+ Added mechanism to handle mass assignment of an entire floor';
            $content[] = '+ Added student\'s name and gender to student application template';
            $content[] = '+ All locations where usernames are saved have been extended to size 32';
            $content[] = '+ All RLC question response lengths have been extended to 2048 characters';
            $content[] = '+ WSDL modified to reflect change in Web Services server location';
        case version_compare($currentVersion, '0.1.11', '<'):
            $content[] = '+ Fixed minor glitch where assignment by room range was pulling rooms incorrectly (did not take floor number into account)';
        case version_compare($currentVersion, '0.1.12', '<'):
            $files[] = 'templates/student/contract.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Contract text now shows in a scrollable iframe';
            $content[] = '+ PDF of the contract now opens in a new tab/window';
            $content[] = '+ Link to Acrobat download, opens in new tab/window';
            $content[] = '+ Added link to a FAQ page. We need to make sure there *is* a FAQ page.';
        case version_compare($currentVersion, '0.1.13', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_13.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/bed_and_id.tpl';
            $files[] = 'templates/misc/side_thingie.tpl';
            $files[] = 'templates/student/profile_form.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Jeremy\'s updates to the side bar and various debugging options';
            $content[] = '+ Alphabetization of hall drop-downs';
            $content[] = '+ Assign by floor should always show ascending room numbers';
            $content[] = '+ Fixed bug in assign by floor that kept *all* assignments from going through';
            $content[] = '+ At building creation, all deleteds should be set to 0 instead of NULL';
            $content[] = '+ Added mechanism to allow viewing of all available and assigned rooms/beds in a hall';
            $content[] = '+ Various bug and syntax fixes by Jeremy';
            $content[] = '+ Added meal plan option when assigning by an entire floor';
            $content[] = '+ Adjusted color of "optionally skipped" items in side thingie';
            $content[] = '+ Added a template for the profile form';
        case version_compare($currentVersion, '0.1.14', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_14.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/student/profile_form.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Updated profile_form template';
        case version_compare($currentVersion, '0.1.15', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_15.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/student/student_success_failure_message.tpl';
            $files[] = 'templates/admin/deadlines.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/display_final_rlc_assignments.tpl';
            $files[] = 'templates/admin/rlc_assignments_pager.tpl';
            $files[] = 'templates/admin/make_new_rlc_assignments_summary.tpl';
            $files[] = 'templates/student/rlc_application.tpl';
            $files[] = 'templates/student/profile_form.tpl';
            $files[] = 'templates/student/verify_single_student.tpl';
            $files[] = 'templates/admin/get_single_username.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Added success/failure message template';
            $content[] = '+ Added unique constraint to user_id column in student profiles.';
            $content[] = '+ Added new deadlines (for profiles) to the deadlines page.';
            $content[] = '+ Allowed access to RLC assignments on the maintenance page.';
            $content[] = '+ Finalized Final RLC Assignments page.';
            $content[] = '+ Fixed formatting in the RLC Applicatition assignments pager and the corresponding summary.';
            $content[] = '+ Added student viewing of their RLC applications.';
        case version_compare($currentVersion, '0.1.16', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_16.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/student/profile_form.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Added "writing" column to student_profiles table';
            $content[] = '+ Adjusted student profile template for reuse in viewing profiles';
            $content[] = '+ jtickle\'s additions for ordering RLC applications';
        case version_compare($currentVersion, '0.1.17', '<'):
            $content[] = '+ Added profile editing!';
        case version_compare($currentVersion, '0.1.18', '<'):
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/student/profile_form.tpl';
            $files[] = 'templates/profile_search.tpl';
            $files[] = 'templates/profile_search_pager.tpl';
            $files[] = 'templates/profile_search_results.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Yay for searching by student';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Added profile searching!';
            $content[] = '+ Added code to prevent duplicate RLC Applications';
            $content[] = '+ Improved "Side Thingie" to show roomate status/deadlines';
        case version_compare($currentVersion, '0.1.19', '<'):
            $files[] = 'templates/admin/rlc_assignments_pager.tpl';
            $files[] = 'templates/admin/make_new_rlc_assignments.tpl';
            $files[] = 'templates/student/show_student_info.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/rlc_roster.tpl';
            $files[] = 'templates/admin/rlc_roster_table.tpl';
            $files[] = 'templates/admin/search_by_rlc.tpl';
            $files[] = 'templates/admin/full_name_gender_email.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Minor improvement to RLC Assignments pager';
            $content[] = '+ Yay for searching by student actually working';
            $content[] = '+ Yay for searching by RLC =)';
        case version_compare($currentVersion, '0.1.21', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_21.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/student/rlc_application.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '* Modified some text when viewing a RLC app for less clutter';
            $content[] = 'Roommate preference (or assigned roommate) listed in the RLC application export';
            $content[] = '+ Added support for an aggregate value in the application';
            $content[] = 'Calculating Aggregates...';
            $db = new PHPWS_DB('hms_application');
            $db->addColumn('id');
            $db->addColumn('term_classification');
            $db->addColumn('student_status');
            $db->addColumn('preferred_bedtime');
            $db->addColumn('room_condition');
            $result = $db->select();
            if (PEAR::isError($result)) {
                return $result;
            }
            /*
             * The following is weird, and I just wanted to take a few minutes
             * to explain exactly what the hell is going on here.  Any students
             * in the database at this point have filled out an application but
             * do not have the aggregate number that is used to autoassign
             * roommates.  What follows generates the appropriate aggregate
             * number for each student.  The aggregate number is a bitmask that
             * will end up looking like this:
             *
             * Bits Meaning
             * 43   term_classification
             * 2    student_status
             * 1    preferred_bedtime
             * 0    room_condition
             *
             * Unfortunately, this code is duplicated in HMS_Application.
             * Fortunately, this code should only be needed once.
             */
            $i = 0;
            foreach ($result as $row) {
                $aggregate = 0;
                $aggregate |= $row['term_classification'] - 1 << 3;
                $aggregate |= $row['student_status'] - 1 << 2;
                $aggregate |= $row['preferred_bedtime'] - 1 << 1;
                $aggregate |= $row['room_condition'] - 1;
                $db->reset();
                $db->addWhere('id', $row['id']);
                $db->addValue('aggregate', $aggregate);
                $result = $db->update();
                if (PEAR::isError($result)) {
                    return $result;
                }
                $i++;
            }
            $content[] = "+ Calculated {$i} aggregates.";
        case version_compare($currentVersion, '0.1.22', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_22.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/display_room_data.tpl';
            $files[] = 'templates/student/profile_search_pager.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = "* Fixed bug in pagination of student profile results";
            $content[] = '** Bug still exists where search values need to be set in $_SESSION';
            $content[] = "+ Added 'displayed room number' to room editing";
            $content[] = "+ Added 'displayed room number' to the assign by floor/mass assignment page";
            $content[] = "+ Fixed bug in assigned RLC members page where address/telephone number were displaying incorrectly or not at all";
        case version_compare($currentVersion, '0.1.23', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_23.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $content[] = '+ Increased length of the asu_username field for RLC assignments';
            $content[] = '+ Added stateful pagination when assigning people to RLCs';
            $content[] = '+ Corrected count when viewing the Learning Community Assignments';
        case version_compare($currentVersion, '0.1.24', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_24.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/student/show_student_info.tpl';
            $files[] = 'templates/admin/add_floor.tpl';
            $files[] = 'templates/admin/display_floor_data.tpl';
            $files[] = 'templates/admin/display_room_data.tpl';
            $files[] = 'templates/admin/display_hall_data.tpl';
            $files[] = 'templates/admin/add_room.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Added a _deleted_ flag to hms_assignment';
            $content[] = '+ Added a timestamp field to hms_assignment';
            $content[] = '+ Added a move_student method to move a single student between rooms';
            $content[] = '+ Student Housing Application now a link when displaying other student information (results from a search)';
            $content[] = '+ Added a flag to hms_room for private rooms';
            $content[] = '+ Added a flag to hms_room for ra rooms';
            $content[] = '+ Added a flag to hms_room for freshman reserved rooms';
            $content[] = '+ Student\'s first, middle and last names now show beside the username at the building overview page of assigned rooms/students';
            $content[] = '+ Added method to add a room to a floor';
            $content[] = '+ Added pricing tier to the room. Always.';
            $content[] = '+ Added roommate status to the student search results.';
        case version_compare($currentVersion, '0.1.25', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_25.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/full_name_gender_email.tpl';
            $files[] = 'templates/admin/rlc_roster_table.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/verify_break_roommates.tpl';
            $files[] = 'templates/admin/confirm_remove_from_rlc.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Fixed numerous bugs that arrived with the _deleted_ flag';
            $content[] = '+ Added the ability to review RLC Applications after assignment';
            $content[] = '+ Fixed error reporting for assigning students to nonexistent rooms';
            $content[] = '+ Re-instated the ability to create and break roommates';
            $content[] = '+ Auto Assignment';
        case version_compare($currentVersion, '0.1.26', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_26.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $content[] = '+ Letters are ready!';
        case version_compare($currentVersion, '0.1.27', '<'):
            $files[] = 'templates/student/show_student_info.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Added ability to change meal plans to student search screen';
        case version_compare($currentVersion, '0.1.28', '<'):
            $files[] = 'templates/admin/display_floor_Data.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = '+ Added ability to change movein times per floor';
        case version_compare($currentVersion, '0.1.29', '<'):
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/get_hall_floor_room.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ OMG BANNER WORKS hopefully';
        case version_compare($currentVersion, '0.1.30', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_30.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/deadlines.tpl';
            $files[] = 'templates/student/main_menu_spring.tpl';
            $files[] = 'templates/student/main_menu_fall.tpl';
            $files[] = 'templates/student/student_application.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ Added check to prevent students selecting themselves as roommates';
            $content[] = '+ Added check to make sure a requested roommate has a housing application';
            $content[] = '+ Cleaned up main menu, added checks for deadlines for menu options';
            $content[] = '+ Fixed colors for messages returned when setting deadlines (UI)';
            $content[] = '+ Added entry term to hms_application and rlc application tables';
            $content[] = '+ Added entry term to student application';
        case version_compare($currentVersion, '0.1.31', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_1_31.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/student/rlc_signup_form_page1.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ Added some verbage and a link to the top of the RLC signup form.';
            $content[] = '+ Added activity log table';
        case version_compare($currentVersion, '0.1.32', '<'):
            $files[] = 'templates/admin/display_room_data.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ Updated edit room template to disallow room gender changes is someone is assigned.';
        case version_compare($currentVersion, '0.1.33', '<'):
            $files[] = 'templates/admin/display_room_data.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.0', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_0.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/edit_terms.tpl';
            $files[] = 'templates/admin/term_pager.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ Added term database and term admin to maintenance panel';
        case version_compare($currentVersion, '0.2.1', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_1.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $content[] = '+ Renamed entry_term column in hms_application to term';
        case version_compare($currentVersion, '0.2.2', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_2.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.3', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_3.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/edit_terms.tpl';
            $files[] = 'templates/admin/add_term.tpl';
            $fiels[] = 'maintenance.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ Redesigned hall structure';
            $content[] = '+ Massive db update for hall structure changes';
            $content[] = '+ Seperated add term and edit term pages';
        case version_compare($currentVersion, '0.2.4', '<'):
            $files[] = 'templates/admin/assign_student.tpl';
            $files[] = 'templates/admin/unassign_student.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.5', '<'):
            $files[] = 'templates/admin/select_residence_hall.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.6', '<'):
            $files[] = 'templates/admin/assign_student_move_confirm.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.7', '<'):
            $files[] = 'templates/admin/maintenance.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ Maintenance template was phoned in, now properly updated';
        case version_compare($currentVersion, '0.2.8', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_8.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/select_room.tpl';
            $files[] = 'template/admin/maintenance.tpl';
            $files[] = 'templates/admin/edit_room.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ Room selection for editing rooms now works';
            $content[] = '+ Added Queue system for "offline" editing of assignments';
            $content[] = '+ Room editing also works now';
        case version_compare($currentVersion, '0.2.9', '<'):
            $files[] = 'templates/admin/select_room.tpl';
            $files[] = 'templates/admin/edit_room.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'template/admin/assignment_pager_by_room.tpl';
            $files[] = 'javascript/assign_student/head.js';
            $fiels[] = 'javascript/select_room/head.js';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ Added queue items to Maintenance panel';
            $content[] = '+ Removed "move student" link';
            $content[] = '+ Added assignment pager to room edit page';
        case version_compare($currentVersion, '0.2.10', '<'):
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/edit_room.tpl';
            $files[] = 'templates/admin/select_suite.tpl';
            $files[] = 'javascript/select_suite/head.js';
            $files[] = 'templates/admin/edit_suite.tpl';
            $files[] = 'templates/admin/room_pager_by_suite.tpl';
            $files[] = 'templates/admin/assignment_pager_by_suite.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = '+ Added ability to edit suites.';
            $content[] = '+ Fixed "DB Error" in queued assignments';
        case version_compare($currentVersion, '0.2.12', '<'):
            $files[] = 'javascript/autosuggest/autosuggest.js';
            $files[] = 'javascript/autosuggest/head.js';
            $files[] = 'javascript/autosuggest/zxml.js';
            $files[] = '/templates/admin/maintenance.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $content[] = 'Autoassigner baby!';
            $content[] = 'Autocompletion for usernames';
        case version_compare($currentVersion, '0.2.13', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_13.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/movein_time_pager.tpl';
            $files[] = 'templates/admin/edit_movein_time.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'javascript/select_floor/head.js';
            $files[] = 'templates/admin/select_floor.js';
            $files[] = 'templates/admin/display_floor_data.tpl';
            $files[] = 'templates/admin/edit_room.tpl';
            $files[] = 'templates/admin/select_room.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.14', '<'):
            $db = new PHPWS_DB();
            $result = $db->query('ALTER TABLE hms_floor DROP COLUMN ft_movein;');
            if (PEAR::isError($result)) {
                return $result;
            }
            $result = $db->query('ALTER TABLE hms_floor DROP COLUMN c_movein;');
            if (PEAR::isError($result)) {
                return $result;
            }
            $result = $db->query('ALTER TABLE hms_floor ADD COLUMN ft_movein_time_id smallint REFERENCES hms_movein_time(id);');
            if (PEAR::isError($result)) {
                return $result;
            }
            $result = $db->query('ALTER TABLE hms_floor ADD COLUMN rt_movein_time_id smallint REFERENCES hms_movein_time(id);');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/room_pager_by_floor.tpl';
            $files[] = 'templates/admin/edit_floor.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.15', '<'):
            $files[] = 'templates/admin/floor_pager_by_hall.tpl';
            $files[] = 'templates/admin/edit_residence_hall.tpl';
            $files[] = 'templates/admin/select_residence_hall.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.16', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_16.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/edit_room.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.17', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_17.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/select_bed.tpl';
            $files[] = 'templates/admin/edit_bed.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'javascript/select_bed/head.js';
            $files[] = 'templates/admin/bed_pager_by_room.tpl';
            $files[] = 'templates/admin/edit_room.tpl';
            $files[] = 'javascript/assign_student/head.js';
            $files[] = 'templates/admin/assign_student.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.18', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_18.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/deadlines.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.19', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_19.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/deadlines.tpl';
            $files[] = 'templates/student/freshmen_welcome_screen.tpl';
            $files[] = 'templates/student/freshmen_welcome_screen.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.20', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFIle(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_20.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.21', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFIle(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_21.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/student/welcome_screen_freshmen.tpl';
            $files[] = 'templates/student/welcome_screen_transfer.tpl';
            $files[] = 'templates/student/welcome_screen_no_entry_term.tpl';
            $files[] = 'templates/student/welcome_screen_deadline_past.tpl';
            $files[] = 'templates/student/welcome_screen_non_traditional.tpl';
            $files[] = 'templates/student/welcome_screen_too_soon.tpl';
            $files[] = 'templates/student/contact_page.tpl';
            $files[] = 'templates/student/contact_form_thankyou.tpl';
            $files[] = 'templates/student/rlc_signup_form_page1.tpl';
            $files[] = 'templates/student/rlc_singup_form_page2.tpl';
            $files[] = 'templates/student/rlc_singup_confirmation.tpl';
            $files[] = 'templates/student/student_application.tpl';
            $files[] = 'templates/student/main_menu_fall.tpl';
            $files[] = 'templates/admin/assign_student.tpl';
            $files[] = 'templates/admin/deadlines.tpl';
            $files[] = 'templates/admin/rlc_assignments_pager.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.22', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_22.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.23', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_23.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/student/roommate_accept_reject_form.tpl';
            $files[] = 'templates/student/select_roommate.tpl';
            $files[] = 'templates/student/requestor_handle_rlc_application.tpl';
            $files[] = 'templates/student/select_roommate_confirmation.tpl';
            $files[] = 'templates/student/roommate_accept_reject_screen.tpl';
            $files[] = 'templates/student/main_menu_fall.tpl';
            $files[] = 'templates/student/roommate_accept_done.tpl';
            $files[] = 'templates/student/roommate_reject_done.tpl';
            $files[] = 'templates/student/requested_roommate_list.tpl';
            $files[] = 'templates/student/roommate_accept_confirm.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.24', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_24.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.25', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_25.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/edit_floor.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.26', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_26.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/display_final_rlc_assignments.tpl';
            $files[] = 'templates/student/show_student_info.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.28', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_28.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/term_pager.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
        case version_compare($currentVersion, '0.2.29', '<'):
            PHPWS_Boost::registerMyModule('hms', 'users', $content);
            $files[] = 'templates/admin/permission_denied.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.30', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_30.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $files[] = 'templates/admin/make_new_rlc_assignments.tpl';
            $files[] = 'templates/admin/rlc_assignments_pager.tpl';
            $files[] = 'templates/admin/view_by_rlc_pager.tpl';
            $files[] = 'templates/admin/rlc_roster.tpl';
            $files[] = 'templates/admin/maintenance.tpl';
            $files[] = 'templates/admin/log_pager.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.31', '<'):
            PHPWS_Boost::registerMyModule('hms', 'users', $content);
            // ust need to update the permissions
        // ust need to update the permissions
        case version_compare($currentVersion, '0.2.32', '<'):
            $files[] = 'templates/admin/show_confirmed_roommates.tpl';
            $files[] = 'templates/admin/roommate_pager.tpl';
            $files[] = 'templates/admin/create_roommate_group.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
        case version_compare($currentVersion, '0.2.33', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_33.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.34', '<'):
            $files[] = 'templates/admin/display_reports.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $content[] = 'Added Special Needs report.';
            $content[] = 'Reports now better suited for printing.';
        case version_compare($currentVersion, '0.2.35', '<'):
            $files[] = 'templates/admin/statistics.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
            $db = new PHPWS_Db();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_35.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            $content[] = 'Updated Statistics Template';
            $content[] = 'Updated Term Information';
        case version_compare($currentVersion, '0.2.36', '<'):
            $db = new PHPWS_Db();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_36.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.40', '<'):
            PHPWS_Boost::registerMyModule('hms', 'users', $content);
            // ust need to update the permissions
        // ust need to update the permissions
        case version_compare($currentVersion, '0.2.41', '<'):
            $files[] = 'templates/admin/activity_log_pager.tpl';
            PHPWS_Boost::updateFiles($files, 'hms');
        case version_compare($currentVersion, '0.2.42', '<'):
            $files[] = 'templates/admin/maintenance.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            $db = new PHPWS_Db();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_42.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.45', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.2.46', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.2.49', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_49.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.50', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_50.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.51', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_51.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.2.52', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_2_52.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.0', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_0.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.1', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_1.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.2', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_2.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.3', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_3.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.5', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.3.7', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_7.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.8', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_8.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.9', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_9.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.10', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_10.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.11', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.3.13', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_13.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.16', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_16.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.17', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_17.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.18', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_18.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.19', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_19.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.20', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_20.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.21', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_21.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.3.31', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_3_31.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.0', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_0.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.1', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_1.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.2', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_2.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.3', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_3.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.4', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_4.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.5', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_5.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.6', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_6.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.7', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_7.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.9', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_9.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.12', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_12.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.13', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_13.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.14', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_14.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.15', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.18', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.19', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_19.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.22', '<'):
            $files[] = 'templates/admin/floor_assignment.tpl';
            PHPWS_Boost::updatefiles($files, 'hms');
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.23', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_23.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.24', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_24.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.26', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_26.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.28', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_28.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.30', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.32', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_32.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.33', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_33.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.34', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_34.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.35', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_35.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.37', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_37.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.38', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_38.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.39', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_39.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.42', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_42.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.43', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_43.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.44', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_44.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.45', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_45.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.47', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_47.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.48', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_48.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.49', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_49.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.50', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_50.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.51', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_51.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.52', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_52.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.53', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_53.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.55', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_55.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.61', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/0_4_61.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.63', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-63.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.66', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-66.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.67', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-67.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.68', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-68.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.69', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-69.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.70', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-70.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.71', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.72', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-72.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.73', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-73.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.74', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-74.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.75', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-75.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.77', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.78', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-78.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.79', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-79.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.80', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-80.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.81', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-81.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.82', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.83', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-83.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.84', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.85', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-85.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.86', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-86.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.87', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
        case version_compare($currentVersion, '0.4.88', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-88.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.89', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-89.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.90', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-90.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.91', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-91.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.4.92', '<'):
            PHPWS_Core::initModClass('users', 'Permission.php');
            Users_Permission::registerPermissions('hms', $content);
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-04-92.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.5.0', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-05-00.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.5.1', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-05-01.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.5.2', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-05-02.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.5.3', '<'):
            PHPWS_Core::initCoreClass('Module.php');
            $module = new \PHPWS_Module('pulse', false);
            $pulse_version = $module->getVersion();
            if (version_compare($pulse_version, '2.0.0', '<')) {
                $content[] = '<p style="color:red;font-weight:bold">Pulse needs to be upgraded.</p>';
            }
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-05-03.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.5.4', '<'):
            $content[] = '<pre>Adding hms_hall_structure view.</pre>';
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-05-04.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.5.5', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-05-05.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
        case version_compare($currentVersion, '0.5.6', '<'):
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/hms/boost/updates/00-05-06.sql');
            if (PEAR::isError($result)) {
                return $result;
            }
    }
    return TRUE;
}
Пример #25
0
function update_boost_files($files, &$content)
{
    if (PHPWS_Boost::updateFiles($files, 'boost')) {
        $content[] = ' --- The following files were updated successfully:';
    } else {
        $content[] = ' --- Failed to update the following files:';
    }
    $content[] = ' ' . implode("\n    ", $files);
    $content[] = '';
}
Пример #26
0
function menuUpdateFiles($files, &$content)
{
    $result = PHPWS_Boost::updateFiles($files, 'menu', true);
    if ($result === true) {
        $content[] = '--- Updated the following files:';
        $content[] = "     " . implode("\n     ", $files);
    } elseif (is_array($result)) {
        $content[] = '--- Unable to update the following files:';
        $content[] = "     " . implode("\n     ", $result);
    }
}